summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-22 01:18:55 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-25 12:48:36 (GMT)
commit71e69fc93b9f1a0829d04b9e44107c92458efe20 (patch)
tree242ee964ba495918694ffd76874b1499cbece399 /Source/cmPolicies.h
parent84e18056668491d5a7e0068c9287455151a18197 (diff)
downloadCMake-71e69fc93b9f1a0829d04b9e44107c92458efe20.zip
CMake-71e69fc93b9f1a0829d04b9e44107c92458efe20.tar.gz
CMake-71e69fc93b9f1a0829d04b9e44107c92458efe20.tar.bz2
cmPolicies: Store only state that users can set.
cmPolicies::PolicyMap does not need to store the REQUIRED_ALWAYS or REQUIRED_IF_USED states as they are statically determined.
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r--Source/cmPolicies.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8a3c27d..a5aba58 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -244,7 +244,6 @@ public:
REQUIRED_IF_USED,
REQUIRED_ALWAYS ///< Issue an error unless user sets policy status to NEW.
};
-#define POLICY_STATUS_COUNT 5
/// Policy identifiers
enum PolicyID
@@ -288,6 +287,7 @@ public:
bool IsEmpty() const;
private:
+#define POLICY_STATUS_COUNT 3
std::bitset<cmPolicies::CMPCOUNT * POLICY_STATUS_COUNT> Status;
};
};
n> Tk is a free and open-source, cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages.
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat
-rw-r--r--ChangeLog16030
-rw-r--r--ChangeLog.20027877
-rw-r--r--ChangeLog.20043653
-rw-r--r--README6
-rw-r--r--bitmaps/error.xbm (renamed from bitmaps/error.bmp)0
-rw-r--r--bitmaps/gray12.xbm (renamed from bitmaps/gray12.bmp)0
-rw-r--r--bitmaps/gray25.xbm (renamed from bitmaps/gray25.bmp)0
-rw-r--r--bitmaps/gray50.xbm (renamed from bitmaps/gray50.bmp)0
-rw-r--r--bitmaps/gray75.xbm (renamed from bitmaps/gray75.bmp)0
-rw-r--r--bitmaps/hourglass.xbm (renamed from bitmaps/hourglass.bmp)0
-rw-r--r--bitmaps/info.xbm (renamed from bitmaps/info.bmp)0
-rw-r--r--bitmaps/questhead.xbm (renamed from bitmaps/questhead.bmp)0
-rw-r--r--bitmaps/question.xbm (renamed from bitmaps/question.bmp)0
-rw-r--r--bitmaps/warning.xbm (renamed from bitmaps/warning.bmp)0
-rw-r--r--changes773
-rw-r--r--doc/3DBorder.356
-rw-r--r--doc/AddOption.319
-rw-r--r--doc/BindTable.36
-rw-r--r--doc/CanvPsY.314
-rw-r--r--doc/CanvTkwin.318
-rw-r--r--doc/CanvTxtInfo.330
-rw-r--r--doc/Clipboard.38
-rw-r--r--doc/ConfigWidg.3198
-rw-r--r--doc/ConfigWind.36
-rw-r--r--doc/CrtCmHdlr.38
-rw-r--r--doc/CrtConsoleChan.344
-rw-r--r--doc/CrtErrHdlr.326
-rw-r--r--doc/CrtGenHdlr.34
-rw-r--r--doc/CrtImgType.3130
-rw-r--r--doc/CrtItemType.3268
-rw-r--r--doc/CrtPhImgFmt.3135
-rw-r--r--doc/CrtSelHdlr.313
-rw-r--r--doc/CrtWindow.324
-rw-r--r--doc/DeleteImg.32
-rw-r--r--doc/EventHndlr.34
-rw-r--r--doc/FindPhoto.392
-rw-r--r--doc/FontId.330
-rw-r--r--doc/FreeXId.34
-rw-r--r--doc/GetAnchor.334
-rw-r--r--doc/GetBitmap.352
-rw-r--r--doc/GetCapStyl.318
-rw-r--r--doc/GetClrmap.324
-rw-r--r--doc/GetColor.320
-rw-r--r--doc/GetCursor.333
-rw-r--r--doc/GetDash.342
-rw-r--r--doc/GetFont.319
-rw-r--r--doc/GetHINSTANCE.34
-rw-r--r--doc/GetHWND.32
-rw-r--r--doc/GetImage.318
-rw-r--r--doc/GetJoinStl.318
-rw-r--r--doc/GetJustify.330
-rw-r--r--doc/GetOption.34
-rw-r--r--doc/GetPixels.318
-rw-r--r--doc/GetRelief.344
-rw-r--r--doc/GetRootCrd.34
-rw-r--r--doc/GetScroll.34
-rw-r--r--doc/GetSelect.316
-rw-r--r--doc/GetUid.33
-rw-r--r--doc/GetVRoot.39
-rw-r--r--doc/GetVisual.324
-rw-r--r--doc/Grab.34
-rw-r--r--doc/HandleEvent.35
-rw-r--r--doc/Inactive.336
-rw-r--r--doc/InternAtom.37
-rw-r--r--doc/MaintGeom.35
-rw-r--r--doc/ManageGeom.319
-rw-r--r--doc/MapWindow.34
-rw-r--r--doc/MeasureChar.326
-rw-r--r--doc/MoveToplev.32
-rw-r--r--doc/Name.316
-rw-r--r--doc/NameOfImg.32
-rw-r--r--doc/ParseArgv.3145
-rw-r--r--doc/QWinEvent.33
-rw-r--r--doc/RestrictEv.39
-rw-r--r--doc/SetAppName.311
-rw-r--r--doc/SetClassProcs.322
-rw-r--r--doc/SetOptions.3174
-rw-r--r--doc/SetVisual.32
-rw-r--r--doc/StrictMotif.35
-rw-r--r--doc/TextLayout.327
-rw-r--r--doc/TkInitStubs.310
-rw-r--r--doc/Tk_Init.35
-rw-r--r--doc/Tk_Main.33
-rw-r--r--doc/WindowId.316
-rw-r--r--doc/bind.n394
-rw-r--r--doc/bindtags.n7
-rw-r--r--doc/button.n37
-rw-r--r--doc/canvas.n372
-rw-r--r--doc/checkbutton.n105
-rw-r--r--doc/chooseColor.n1
-rw-r--r--doc/chooseDirectory.n26
-rw-r--r--doc/clipboard.n69
-rw-r--r--doc/colors.n1760
-rw-r--r--doc/console.n15
-rw-r--r--doc/cursors.n14
-rw-r--r--doc/destroy.n9
-rw-r--r--doc/dialog.n6
-rw-r--r--doc/entry.n76
-rw-r--r--doc/event.n102
-rw-r--r--doc/focus.n20
-rw-r--r--doc/focusNext.n7
-rw-r--r--doc/font.n234
-rw-r--r--doc/frame.n27
-rw-r--r--doc/getOpenFile.n81
-rw-r--r--doc/grab.n9
-rw-r--r--doc/grid.n253
-rw-r--r--doc/image.n2
-rw-r--r--doc/label.n26
-rw-r--r--doc/labelframe.n53
-rw-r--r--doc/listbox.n56
-rw-r--r--doc/loadTk.n11
-rw-r--r--doc/menu.n157
-rw-r--r--doc/menubutton.n12
-rw-r--r--doc/message.n29
-rw-r--r--doc/messageBox.n19
-rw-r--r--doc/option.n47
-rw-r--r--doc/optionMenu.n15
-rw-r--r--doc/options.n42
-rw-r--r--doc/pack-old.n2
-rw-r--r--doc/pack.n28
-rw-r--r--doc/palette.n15
-rw-r--r--doc/panedwindow.n63
-rw-r--r--doc/photo.n16
-rw-r--r--doc/place.n17
-rw-r--r--doc/radiobutton.n49
-rw-r--r--doc/raise.n10
-rw-r--r--doc/scale.n7
-rw-r--r--doc/scrollbar.n18
-rw-r--r--doc/selection.n48
-rw-r--r--doc/send.n15
-rw-r--r--doc/spinbox.n51
-rw-r--r--doc/text.n1012
-rw-r--r--doc/tk.n42
-rw-r--r--doc/tkvars.n2
-rw-r--r--doc/toplevel.n2
-rw-r--r--doc/ttk_Geometry.3223
-rw-r--r--doc/ttk_Theme.332
-rw-r--r--doc/ttk_button.n81
-rw-r--r--doc/ttk_checkbutton.n77
-rw-r--r--doc/ttk_combobox.n119
-rw-r--r--doc/ttk_entry.n470
-rw-r--r--doc/ttk_frame.n56
-rw-r--r--doc/ttk_image.n82
-rw-r--r--doc/ttk_intro.n177
-rw-r--r--doc/ttk_label.n78
-rw-r--r--doc/ttk_labelframe.n76
-rw-r--r--doc/ttk_menubutton.n54
-rw-r--r--doc/ttk_notebook.n213
-rw-r--r--doc/ttk_panedwindow.n112
-rw-r--r--doc/ttk_progressbar.n93
-rw-r--r--doc/ttk_radiobutton.n74
-rw-r--r--doc/ttk_scale.n101
-rw-r--r--doc/ttk_scrollbar.n163
-rw-r--r--doc/ttk_separator.n38
-rw-r--r--doc/ttk_sizegrip.n69
-rw-r--r--doc/ttk_spinbox.n86
-rw-r--r--doc/ttk_style.n131
-rw-r--r--doc/ttk_treeview.n484
-rw-r--r--doc/ttk_vsapi.n102
-rw-r--r--doc/ttk_widget.n262
-rw-r--r--doc/winfo.n40
-rw-r--r--doc/wish.189
-rw-r--r--doc/wm.n204
-rw-r--r--generic/README4
-rw-r--r--generic/default.h4
-rw-r--r--generic/prolog.ps283
-rw-r--r--generic/tk.decls949
-rw-r--r--generic/tk.h1052
-rw-r--r--generic/tk3d.c667
-rw-r--r--generic/tk3d.h74
-rw-r--r--generic/tkArgv.c467
-rw-r--r--generic/tkAtom.c123
-rw-r--r--generic/tkBind.c3504
-rw-r--r--generic/tkBitmap.c814
-rw-r--r--generic/tkButton.c851
-rw-r--r--generic/tkButton.h233
-rw-r--r--generic/tkCanvArc.c979
-rw-r--r--generic/tkCanvBmap.c518
-rw-r--r--generic/tkCanvImg.c526
-rw-r--r--generic/tkCanvLine.c1121
-rw-r--r--generic/tkCanvPoly.c934
-rw-r--r--generic/tkCanvPs.c1550
-rw-r--r--generic/tkCanvText.c747
-rw-r--r--generic/tkCanvUtil.c1304
-rw-r--r--generic/tkCanvWind.c622
-rw-r--r--generic/tkCanvas.c3552
-rw-r--r--generic/tkCanvas.h257
-rw-r--r--generic/tkClipboard.c564
-rw-r--r--generic/tkCmds.c2064
-rw-r--r--generic/tkColor.c471
-rw-r--r--generic/tkColor.h72
-rw-r--r--generic/tkConfig.c1943
-rw-r--r--generic/tkConsole.c401
-rw-r--r--generic/tkCursor.c495
-rw-r--r--generic/tkDecls.h2599
-rw-r--r--generic/tkEntry.c3371
-rw-r--r--generic/tkEntry.h189
-rw-r--r--generic/tkError.c225
-rw-r--r--generic/tkEvent.c2008
-rw-r--r--generic/tkFileFilter.c383
-rw-r--r--generic/tkFileFilter.h88
-rw-r--r--generic/tkFocus.c767
-rw-r--r--generic/tkFont.c2347
-rw-r--r--generic/tkFont.h154
-rw-r--r--generic/tkFrame.c1195
-rw-r--r--generic/tkGC.c148
-rw-r--r--generic/tkGeometry.c342
-rw-r--r--generic/tkGet.c503
-rw-r--r--generic/tkGrab.c961
-rw-r--r--generic/tkGrid.c2546
-rw-r--r--generic/tkImage.c947
-rw-r--r--generic/tkImgBmap.c595
-rw-r--r--generic/tkImgGIF.c1954
-rw-r--r--generic/tkImgPPM.c373
-rw-r--r--generic/tkImgPhoto.c3229
-rw-r--r--generic/tkImgUtil.c37
-rw-r--r--generic/tkInitScript.h56
-rw-r--r--generic/tkInt.decls2050
-rw-r--r--generic/tkInt.h1185
-rw-r--r--generic/tkIntDecls.h2004
-rw-r--r--generic/tkIntPlatDecls.h1218
-rw-r--r--generic/tkIntXlibDecls.h2545
-rw-r--r--generic/tkListbox.c2527
-rw-r--r--generic/tkMacWinMenu.c139
-rw-r--r--generic/tkMain.c328
-rw-r--r--generic/tkMenu.c2444
-rw-r--r--generic/tkMenu.h543
-rw-r--r--generic/tkMenuDraw.c450
-rw-r--r--generic/tkMenubutton.c481
-rw-r--r--generic/tkMenubutton.h191
-rw-r--r--generic/tkMessage.c387
-rw-r--r--generic/tkObj.c592
-rw-r--r--generic/tkOldConfig.c1082
-rw-r--r--generic/tkOldTest.c404
-rw-r--r--generic/tkOption.c931
-rw-r--r--generic/tkPack.c879
-rw-r--r--generic/tkPanedWindow.c1900
-rw-r--r--generic/tkPlace.c819
-rw-r--r--generic/tkPlatDecls.h257
-rw-r--r--generic/tkPointer.c306
-rw-r--r--generic/tkPort.h4
-rw-r--r--generic/tkRectOval.c808
-rw-r--r--generic/tkScale.c810
-rw-r--r--generic/tkScale.h178
-rw-r--r--generic/tkScrollbar.c278
-rw-r--r--generic/tkScrollbar.h155
-rw-r--r--generic/tkSelect.c1179
-rw-r--r--generic/tkSelect.h180
-rw-r--r--generic/tkSquare.c337
-rw-r--r--generic/tkStubImg.c74
-rw-r--r--generic/tkStubInit.c464
-rw-r--r--generic/tkStubLib.c108
-rw-r--r--generic/tkStyle.c817
-rw-r--r--generic/tkTest.c2292
-rw-r--r--generic/tkText.c6853
-rw-r--r--generic/tkText.h1429
-rw-r--r--generic/tkTextBTree.c3079
-rw-r--r--generic/tkTextDisp.c6867
-rw-r--r--generic/tkTextImage.c800
-rw-r--r--generic/tkTextIndex.c1723
-rw-r--r--generic/tkTextMark.c775
-rw-r--r--generic/tkTextTag.c1521
-rw-r--r--generic/tkTextWind.c1318
-rw-r--r--generic/tkTrig.c992
-rw-r--r--generic/tkUndo.c725
-rw-r--r--generic/tkUndo.h133
-rw-r--r--generic/tkUtil.c969
-rw-r--r--generic/tkVisual.c288
-rw-r--r--generic/tkWindow.c1873
-rw-r--r--generic/ttk/ttk.decls150
-rw-r--r--generic/ttk/ttkBlink.c166
-rw-r--r--generic/ttk/ttkButton.c856
-rw-r--r--generic/ttk/ttkCache.c350
-rw-r--r--generic/ttk/ttkClamTheme.c971
-rw-r--r--generic/ttk/ttkClassicTheme.c513
-rw-r--r--generic/ttk/ttkDecls.h272
-rw-r--r--generic/ttk/ttkDefaultTheme.c1130
-rw-r--r--generic/ttk/ttkElements.c1281
-rw-r--r--generic/ttk/ttkEntry.c2015
-rw-r--r--generic/ttk/ttkFrame.c653
-rw-r--r--generic/ttk/ttkGenStubs.tcl920
-rw-r--r--generic/ttk/ttkImage.c415
-rw-r--r--generic/ttk/ttkInit.c284
-rw-r--r--generic/ttk/ttkLabel.c670
-rw-r--r--generic/ttk/ttkLayout.c1252
-rw-r--r--generic/ttk/ttkManager.c552
-rw-r--r--generic/ttk/ttkManager.h92
-rw-r--r--generic/ttk/ttkNotebook.c1414
-rw-r--r--generic/ttk/ttkPanedwindow.c974
-rw-r--r--generic/ttk/ttkProgress.c543
-rw-r--r--generic/ttk/ttkScale.c516
-rw-r--r--generic/ttk/ttkScroll.c252
-rw-r--r--generic/ttk/ttkScrollbar.c344
-rw-r--r--generic/ttk/ttkSeparator.c131
-rw-r--r--generic/ttk/ttkSquare.c302
-rw-r--r--generic/ttk/ttkState.c273
-rw-r--r--generic/ttk/ttkStubInit.c61
-rw-r--r--generic/ttk/ttkStubLib.c74
-rw-r--r--generic/ttk/ttkTagSet.c306
-rw-r--r--generic/ttk/ttkTheme.c1737
-rw-r--r--generic/ttk/ttkTheme.h444
-rw-r--r--generic/ttk/ttkThemeInt.h42
-rw-r--r--generic/ttk/ttkTrace.c144
-rw-r--r--generic/ttk/ttkTrack.c183
-rw-r--r--generic/ttk/ttkTreeview.c3443
-rw-r--r--generic/ttk/ttkWidget.c789
-rw-r--r--generic/ttk/ttkWidget.h270
-rw-r--r--library/bgerror.tcl161
-rw-r--r--library/button.tcl129
-rw-r--r--library/choosedir.tcl75
-rw-r--r--library/clrpick.tcl128
-rw-r--r--library/comdlg.tcl13
-rw-r--r--library/console.tcl361
-rw-r--r--library/demos/README6
-rw-r--r--library/demos/anilabel.tcl160
-rw-r--r--library/demos/aniwave.tcl104
-rw-r--r--library/demos/arrow.tcl14
-rw-r--r--library/demos/bind.tcl23
-rw-r--r--library/demos/bitmap.tcl11
-rw-r--r--library/demos/browse2
-rw-r--r--library/demos/button.tcl12
-rw-r--r--library/demos/check.tcl58
-rw-r--r--library/demos/clrpick.tcl10
-rw-r--r--library/demos/colors.tcl10
-rw-r--r--library/demos/combo.tcl62
-rw-r--r--library/demos/cscroll.tcl10
-rw-r--r--library/demos/ctext.tcl12
-rw-r--r--library/demos/en.msg97
-rw-r--r--library/demos/entry1.tcl10
-rw-r--r--library/demos/entry2.tcl10
-rw-r--r--library/demos/entry3.tcl18
-rw-r--r--library/demos/filebox.tcl22
-rw-r--r--library/demos/floor.tcl38
-rw-r--r--library/demos/form.tcl10
-rw-r--r--library/demos/goldberg.tcl1833
-rw-r--r--library/demos/hello4
-rw-r--r--library/demos/hscale.tcl10
-rw-r--r--library/demos/icon.tcl25
-rw-r--r--library/demos/image1.tcl15
-rw-r--r--library/demos/image2.tcl22
-rw-r--r--library/demos/images/face.xbm (renamed from library/demos/images/face.bmp)0
-rw-r--r--library/demos/images/flagdown.xbm (renamed from library/demos/images/flagdown.bmp)0
-rw-r--r--library/demos/images/flagup.xbm (renamed from library/demos/images/flagup.bmp)0
-rw-r--r--library/demos/images/gray25.xbm (renamed from library/demos/images/gray25.bmp)0
-rw-r--r--library/demos/images/letters.xbm (renamed from library/demos/images/letters.bmp)0
-rw-r--r--library/demos/images/noletter.xbm (renamed from library/demos/images/noletter.bmp)0
-rw-r--r--library/demos/images/pattern.xbm (renamed from library/demos/images/pattern.bmp)0
-rw-r--r--library/demos/items.tcl29
-rw-r--r--library/demos/ixset66
-rw-r--r--library/demos/knightstour.tcl255
-rw-r--r--library/demos/label.tcl13
-rw-r--r--library/demos/labelframe.tcl12
-rw-r--r--library/demos/mclist.tcl96
-rw-r--r--library/demos/menu.tcl25
-rw-r--r--library/demos/menubu.tcl13
-rw-r--r--library/demos/msgbox.tcl14
-rw-r--r--library/demos/nl.msg125
-rw-r--r--library/demos/paned1.tcl10
-rw-r--r--library/demos/paned2.tcl12
-rw-r--r--library/demos/pendulum.tcl197
-rw-r--r--library/demos/plot.tcl10
-rw-r--r--library/demos/puzzle.tcl10
-rw-r--r--library/demos/radio.tcl33
-rw-r--r--library/demos/rmt53
-rw-r--r--library/demos/rolodex10
-rw-r--r--library/demos/ruler.tcl16
-rw-r--r--library/demos/sayings.tcl14
-rw-r--r--library/demos/search.tcl10
-rw-r--r--library/demos/spin.tcl10
-rw-r--r--library/demos/square7
-rw-r--r--library/demos/states.tcl10
-rw-r--r--library/demos/style.tcl33
-rw-r--r--library/demos/tcolor16
-rw-r--r--library/demos/text.tcl16
-rw-r--r--library/demos/textpeer.tcl62
-rw-r--r--library/demos/timer3
-rw-r--r--library/demos/toolbar.tcl104
-rw-r--r--library/demos/tree.tcl94
-rw-r--r--library/demos/ttkbut.tcl85
-rw-r--r--library/demos/ttkmenu.tcl54
-rw-r--r--library/demos/ttknote.tcl62
-rw-r--r--library/demos/ttkpane.tcl107
-rw-r--r--library/demos/ttkprogress.tcl47
-rw-r--r--library/demos/ttkscale.tcl39
-rw-r--r--library/demos/twind.tcl176
-rw-r--r--library/demos/unicodeout.tcl62
-rw-r--r--library/demos/vscale.tcl10
-rw-r--r--library/demos/widget780
-rw-r--r--library/dialog.tcl50
-rw-r--r--library/entry.tcl25
-rw-r--r--library/focus.tcl5
-rw-r--r--library/listbox.tcl13
-rw-r--r--library/menu.tcl137
-rw-r--r--library/msgbox.tcl78
-rw-r--r--library/msgs/cs.msg48
-rw-r--r--library/msgs/da.msg77
-rw-r--r--library/msgs/de.msg30
-rw-r--r--library/msgs/el.msg2
-rw-r--r--library/msgs/en.msg26
-rw-r--r--library/msgs/es.msg38
-rw-r--r--library/msgs/hu.msg21
-rw-r--r--library/msgs/pl.msg60
-rw-r--r--library/msgs/sv.msg74
-rw-r--r--library/obsolete.tcl159
-rw-r--r--library/optMenu.tcl2
-rw-r--r--library/palette.tcl21
-rw-r--r--library/panedwindow.tcl71
-rw-r--r--library/prolog.ps283
-rw-r--r--library/safetk.tcl103
-rw-r--r--library/scale.tcl3
-rw-r--r--library/scrlbar.tcl8
-rw-r--r--library/spinbox.tcl14
-rw-r--r--library/tclIndex3
-rw-r--r--library/tearoff.tcl15
-rw-r--r--library/text.tcl412
-rw-r--r--library/tk.tcl364
-rw-r--r--library/tkfbox.tcl573
-rw-r--r--library/ttk/altTheme.tcl101
-rw-r--r--library/ttk/aquaTheme.tcl59
-rw-r--r--library/ttk/button.tcl83
-rw-r--r--library/ttk/clamTheme.tcl137
-rw-r--r--library/ttk/classicTheme.tcl108
-rw-r--r--library/ttk/combobox.tcl453
-rw-r--r--library/ttk/cursors.tcl186
-rw-r--r--library/ttk/defaults.tcl125
-rw-r--r--library/ttk/entry.tcl585
-rw-r--r--library/ttk/fonts.tcl157
-rw-r--r--library/ttk/menubutton.tcl169
-rw-r--r--library/ttk/notebook.tcl197
-rw-r--r--library/ttk/panedwindow.tcl82
-rw-r--r--library/ttk/progress.tcl49
-rw-r--r--library/ttk/scale.tcl88
-rw-r--r--library/ttk/scrollbar.tcl123
-rw-r--r--library/ttk/sizegrip.tcl102
-rw-r--r--library/ttk/spinbox.tcl173
-rw-r--r--library/ttk/treeview.tcl363
-rw-r--r--library/ttk/ttk.tcl176
-rw-r--r--library/ttk/utils.tcl350
-rw-r--r--library/ttk/vistaTheme.tcl224
-rw-r--r--library/ttk/winTheme.tcl80
-rw-r--r--library/ttk/xpTheme.tcl65
-rw-r--r--library/unsupported.tcl2
-rw-r--r--library/xmfbox.tcl68
-rw-r--r--license.terms2
-rw-r--r--mac/MW_TkBuildLibHeader.h7
-rw-r--r--mac/MW_TkBuildLibHeader.pch34
-rwxr-xr-xmac/MW_TkHeader.h7
-rw-r--r--mac/MW_TkHeader.pch32
-rw-r--r--mac/MW_TkHeaderCommon.h38
-rwxr-xr-xmac/MW_TkOldImgHeader.h3
-rw-r--r--mac/MW_TkOldImgStaticHeader.h3
-rw-r--r--mac/MW_TkStaticHeader.h7
-rw-r--r--mac/MW_TkStaticHeader.pch34
-rwxr-xr-xmac/MW_TkTestHeader.h7
-rwxr-xr-xmac/MW_TkTestHeader.pch40
-rw-r--r--mac/README91
-rw-r--r--mac/bugs.doc52
-rwxr-xr-xmac/tclets.r172
-rw-r--r--mac/tclets.tcl223
-rw-r--r--mac/tkMac.h54
-rw-r--r--mac/tkMacAppInit.c418
-rwxr-xr-xmac/tkMacAppearanceStubs.c104
-rw-r--r--mac/tkMacApplication.r315
-rw-r--r--mac/tkMacBitmap.c277
-rw-r--r--mac/tkMacButton.c1709
-rw-r--r--mac/tkMacClipboard.c301
-rw-r--r--mac/tkMacColor.c502
-rw-r--r--mac/tkMacConfig.c43
-rw-r--r--mac/tkMacCursor.c399
-rw-r--r--mac/tkMacCursors.r128
-rw-r--r--mac/tkMacDefault.h527
-rw-r--r--mac/tkMacDialog.c1418
-rw-r--r--mac/tkMacDraw.c1221
-rw-r--r--mac/tkMacEmbed.c1205
-rw-r--r--mac/tkMacFont.c2150
-rw-r--r--mac/tkMacHLEvents.c439
-rw-r--r--mac/tkMacInit.c226
-rw-r--r--mac/tkMacInt.h231
-rw-r--r--mac/tkMacKeyboard.c646
-rw-r--r--mac/tkMacLibrary.r71
-rw-r--r--mac/tkMacMDEF.c114
-rw-r--r--mac/tkMacMDEF.r43
-rw-r--r--mac/tkMacMenu.c4605
-rw-r--r--mac/tkMacMenu.r45
-rw-r--r--mac/tkMacMenubutton.c493
-rw-r--r--mac/tkMacMenus.c353
-rw-r--r--mac/tkMacPort.h160
-rw-r--r--mac/tkMacProjects.sea.hqx3718
-rw-r--r--mac/tkMacRegion.c246
-rw-r--r--mac/tkMacResource.r435
-rw-r--r--mac/tkMacScale.c437
-rw-r--r--mac/tkMacScrlbr.c1067
-rw-r--r--mac/tkMacSend.c546
-rw-r--r--mac/tkMacSubwindows.c1256
-rw-r--r--mac/tkMacTclCode.r69
-rw-r--r--mac/tkMacTest.c80
-rw-r--r--mac/tkMacWindowMgr.c1789
-rw-r--r--mac/tkMacWm.c5785
-rw-r--r--mac/tkMacXCursors.r959
-rw-r--r--mac/tkMacXStubs.c875
-rw-r--r--mac/widget.r18
-rw-r--r--macosx/GNUmakefile (renamed from macosx/Makefile)82
-rw-r--r--macosx/README94
-rw-r--r--macosx/Tk-Info.plist.in6
-rw-r--r--macosx/Wish-Common.xcconfig48
-rw-r--r--macosx/Wish-Debug.xcconfig19
-rw-r--r--macosx/Wish-Info.plist.in6
-rw-r--r--macosx/Wish-Release.xcconfig19
-rw-r--r--macosx/Wish.pbproj/project.pbxproj43
-rw-r--r--macosx/Wish.xcode/default.pbxuser337
-rw-r--r--macosx/Wish.xcode/project.pbxproj5374
-rw-r--r--macosx/Wish.xcodeproj/default.pbxuser339
-rw-r--r--macosx/Wish.xcodeproj/project.pbxproj5734
-rw-r--r--macosx/configure.ac11
-rw-r--r--macosx/tkAboutDlg.r8
-rw-r--r--macosx/tkMacOSXBitmap.c6
-rw-r--r--macosx/tkMacOSXButton.c12
-rw-r--r--macosx/tkMacOSXCarbonEvents.c9
-rw-r--r--macosx/tkMacOSXColor.c2
-rw-r--r--macosx/tkMacOSXCursor.c156
-rw-r--r--macosx/tkMacOSXDefault.h24
-rw-r--r--macosx/tkMacOSXDialog.c893
-rw-r--r--macosx/tkMacOSXDraw.c2
-rw-r--r--macosx/tkMacOSXEmbed.c494
-rw-r--r--macosx/tkMacOSXFont.c3063
-rw-r--r--macosx/tkMacOSXHLEvents.c380
-rw-r--r--macosx/tkMacOSXInit.c190
-rw-r--r--macosx/tkMacOSXInt.h11
-rw-r--r--macosx/tkMacOSXKeyEvent.c2
-rw-r--r--macosx/tkMacOSXMenubutton.c2
-rw-r--r--macosx/tkMacOSXPort.h3
-rw-r--r--macosx/tkMacOSXPrivate.h4
-rw-r--r--macosx/tkMacOSXScrlbr.c51
-rw-r--r--macosx/tkMacOSXSend.c389
-rw-r--r--macosx/tkMacOSXSubwindows.c9
-rw-r--r--macosx/tkMacOSXWm.c1678
-rw-r--r--macosx/tkMacOSXXStubs.c273
-rw-r--r--macosx/ttkMacOSXTheme.c1137
-rw-r--r--tests/all.tcl10
-rw-r--r--tests/bell.test20
-rw-r--r--tests/bgerror.test20
-rw-r--r--tests/bind.test742
-rw-r--r--tests/bitmap.test22
-rw-r--r--tests/border.test36
-rw-r--r--tests/button.test112
-rw-r--r--tests/canvImg.test74
-rw-r--r--tests/canvPs.test148
-rw-r--r--tests/canvPsBmap.tcl20
-rw-r--r--tests/canvPsImg.tcl6
-rw-r--r--tests/canvRect.test51
-rw-r--r--tests/canvText.test58
-rw-r--r--tests/canvWind.test20
-rw-r--r--tests/canvas.test489
-rw-r--r--tests/choosedir.test35
-rw-r--r--tests/clipboard.test24
-rw-r--r--tests/clrpick.test101
-rw-r--r--tests/cmds.test20
-rw-r--r--tests/color.test9
-rw-r--r--tests/config.test9
-rw-r--r--tests/constraints.tcl90
-rw-r--r--tests/cursor.test319
-rw-r--r--tests/dialog.test11
-rw-r--r--tests/earth.gifbin0 -> 51712 bytes
-rw-r--r--tests/embed.test35
-rw-r--r--tests/entry.test125
-rw-r--r--tests/event.test292
-rw-r--r--tests/face.xbm173
-rw-r--r--tests/filebox.test335
-rw-r--r--tests/flagdown.xbm27
-rw-r--r--tests/flagup.xbm27
-rw-r--r--tests/focus.test135
-rw-r--r--tests/focusTcl.test20
-rw-r--r--tests/font.test292
-rw-r--r--tests/frame.test369
-rw-r--r--tests/geometry.test20
-rw-r--r--tests/get.test20
-rw-r--r--tests/grab.test7
-rw-r--r--tests/grid.test428
-rw-r--r--tests/id.test22
-rw-r--r--tests/image.test85
-rw-r--r--tests/imgBmap.test23
-rw-r--r--tests/imgPPM.test32
-rw-r--r--tests/imgPhoto.test38
-rw-r--r--tests/listbox.test99
-rw-r--r--tests/macEmbed.test267
-rw-r--r--tests/macFont.test284
-rw-r--r--tests/macMenu.test1547
-rw-r--r--tests/macWinMenu.test103
-rw-r--r--tests/macscrollbar.test93
-rw-r--r--tests/main.test99
-rw-r--r--tests/menu.test115
-rw-r--r--tests/menuDraw.test46
-rw-r--r--tests/menubut.test24
-rw-r--r--tests/message.test7
-rw-r--r--tests/msgbox.test43
-rw-r--r--tests/obj.test21
-rw-r--r--tests/oldpack.test230
-rw-r--r--tests/option.test27
-rw-r--r--tests/pack.test15
-rw-r--r--tests/panedwindow.test303
-rw-r--r--tests/place.test13
-rw-r--r--tests/pwrdLogo150.gifbin0 -> 2489 bytes
-rw-r--r--tests/raise.test22
-rw-r--r--tests/safe.test17
-rw-r--r--tests/scale.test9
-rw-r--r--tests/scrollbar.test253
-rw-r--r--tests/select.test197
-rw-r--r--tests/send.test8
-rw-r--r--tests/spinbox.test83
-rw-r--r--tests/teapot.ppm31
-rw-r--r--tests/text.test2184
-rw-r--r--tests/textBTree.test20
-rw-r--r--tests/textDisp.test1669
-rw-r--r--tests/textImage.test52
-rw-r--r--tests/textIndex.test265
-rw-r--r--tests/textMark.test105
-rw-r--r--tests/textTag.test306
-rw-r--r--tests/textWind.test280
-rw-r--r--tests/tk.test57
-rw-r--r--tests/ttk/all.tcl21
-rw-r--r--tests/ttk/checkbutton.test48
-rw-r--r--tests/ttk/combobox.test68
-rw-r--r--tests/ttk/entry.test283
-rw-r--r--tests/ttk/image.test50
-rw-r--r--tests/ttk/labelframe.test130
-rw-r--r--tests/ttk/layout.test25
-rw-r--r--tests/ttk/notebook.test493
-rw-r--r--tests/ttk/panedwindow.test291
-rw-r--r--tests/ttk/progressbar.test85
-rw-r--r--tests/ttk/radiobutton.test48
-rw-r--r--tests/ttk/scrollbar.test69
-rw-r--r--tests/ttk/spinbox.test280
-rw-r--r--tests/ttk/treetags.test221
-rw-r--r--tests/ttk/treeview.test639
-rw-r--r--tests/ttk/ttk.test604
-rw-r--r--tests/ttk/validate.test277
-rw-r--r--tests/ttk/vsapi.test47
-rw-r--r--tests/unixButton.test7
-rw-r--r--tests/unixEmbed.test22
-rw-r--r--tests/unixFont.test56
-rw-r--r--tests/unixMenu.test15
-rw-r--r--tests/unixSelect.test45
-rw-r--r--tests/unixWm.test500
-rw-r--r--tests/util.test20
-rw-r--r--tests/visual.test260
-rw-r--r--tests/visual_bb.test7
-rw-r--r--tests/winButton.test33
-rw-r--r--tests/winClipboard.test25
-rw-r--r--tests/winDialog.test216
-rw-r--r--tests/winFont.test70
-rw-r--r--tests/winMenu.test297
-rw-r--r--tests/winMsgbox.test297
-rw-r--r--tests/winSend.test63
-rw-r--r--tests/winWm.test209
-rw-r--r--tests/window.test140
-rw-r--r--tests/winfo.test29
-rw-r--r--tests/wm.test2529
-rw-r--r--tests/xmfbox.test35
-rw-r--r--unix/Makefile.in593
-rw-r--r--unix/README256
-rw-r--r--unix/aclocal.m42
-rwxr-xr-xunix/configure13566
-rw-r--r--unix/configure.in393
-rwxr-xr-x[-rw-r--r--]unix/install-sh24
-rwxr-xr-xunix/installManPage131
-rw-r--r--unix/tcl.m41610
-rw-r--r--unix/tk.spec59
-rw-r--r--unix/tkAppInit.c75
-rw-r--r--unix/tkConfig.h.in256
-rw-r--r--unix/tkConfig.sh.in8
-rw-r--r--unix/tkUnix.c209
-rw-r--r--unix/tkUnix3d.c276
-rw-r--r--unix/tkUnixButton.c693
-rw-r--r--unix/tkUnixColor.c244
-rw-r--r--unix/tkUnixConfig.c35
-rw-r--r--unix/tkUnixCursor.c485
-rw-r--r--unix/tkUnixDefault.h85
-rw-r--r--unix/tkUnixDialog.c159
-rw-r--r--unix/tkUnixDraw.c132
-rw-r--r--unix/tkUnixEmbed.c568
-rw-r--r--unix/tkUnixEvent.c421
-rw-r--r--unix/tkUnixFocus.c109
-rw-r--r--unix/tkUnixFont.c1572
-rw-r--r--unix/tkUnixInit.c91
-rw-r--r--unix/tkUnixInt.h20
-rw-r--r--unix/tkUnixKey.c308
-rw-r--r--unix/tkUnixMenu.c1042
-rw-r--r--unix/tkUnixMenubu.c324
-rw-r--r--unix/tkUnixPort.h13
-rw-r--r--unix/tkUnixRFont.c791
-rw-r--r--unix/tkUnixScale.c250
-rw-r--r--unix/tkUnixScrlbr.c126
-rw-r--r--unix/tkUnixSelect.c714
-rw-r--r--unix/tkUnixSend.c1305
-rw-r--r--unix/tkUnixWm.c3819
-rw-r--r--unix/tkUnixXId.c353
-rw-r--r--win/Makefile.in125
-rw-r--r--win/README2
-rwxr-xr-xwin/buildall.vc.bat91
-rwxr-xr-xwin/configure5287
-rw-r--r--win/configure.in92
-rw-r--r--win/makefile.bc10
-rw-r--r--win/makefile.vc531
-rw-r--r--win/nmakehlp.c266
-rw-r--r--win/rc/cursor00.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor02.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor04.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor06.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor0a.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor0c.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor0e.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor12.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor1e.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor20.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor2a.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor3a.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor46.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor48.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor4c.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor4e.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor60.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor62.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor66.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor6c.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor72.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor74.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor86.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor88.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor8a.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor8c.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor90.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor94.curbin326 -> 326 bytes
-rw-r--r--win/rc/cursor9a.curbin0 -> 326 bytes
-rw-r--r--win/rc/lamp.bmp (renamed from win/lamp.bmp)bin2102 -> 2102 bytes
-rw-r--r--win/rc/tk.rc8
-rw-r--r--win/rc/tk_base.rc2
-rw-r--r--win/rc/wish.rc12
-rw-r--r--win/rules.vc341
-rw-r--r--win/stubs.c379
-rw-r--r--win/tcl.m496
-rw-r--r--win/tkConfig.sh.in2
-rw-r--r--win/tkWin.h48
-rw-r--r--win/tkWin32Dll.c24
-rw-r--r--win/tkWin3d.c370
-rw-r--r--win/tkWinButton.c935
-rw-r--r--win/tkWinClipboard.c181
-rw-r--r--win/tkWinColor.c283
-rw-r--r--win/tkWinConfig.c32
-rw-r--r--win/tkWinCursor.c91
-rw-r--r--win/tkWinDefault.h49
-rw-r--r--win/tkWinDialog.c2789
-rw-r--r--win/tkWinDraw.c593
-rw-r--r--win/tkWinEmbed.c1029
-rw-r--r--win/tkWinFont.c1496
-rw-r--r--win/tkWinImage.c394
-rw-r--r--win/tkWinInit.c74
-rw-r--r--win/tkWinInt.h149
-rw-r--r--win/tkWinKey.c539
-rw-r--r--win/tkWinMenu.c2321
-rw-r--r--win/tkWinPixmap.c124
-rw-r--r--win/tkWinPointer.c218
-rw-r--r--win/tkWinPort.h46
-rw-r--r--win/tkWinRegion.c139
-rw-r--r--win/tkWinScrlbr.c399
-rw-r--r--win/tkWinSend.c1044
-rw-r--r--win/tkWinSendCom.c463
-rw-r--r--win/tkWinSendCom.h61
-rw-r--r--win/tkWinTest.c310
-rw-r--r--win/tkWinWindow.c335
-rw-r--r--win/tkWinWm.c5217
-rw-r--r--win/tkWinX.c1636
-rw-r--r--win/ttkWinMonitor.c158
-rw-r--r--win/ttkWinTheme.c733
-rw-r--r--win/ttkWinXPTheme.c1324
-rw-r--r--win/winMain.c330
-rw-r--r--win/wish.exe.manifest.in47
-rw-r--r--xlib/X11/X.h4
-rw-r--r--xlib/X11/Xlib.h15
-rw-r--r--xlib/X11/Xutil.h4
-rw-r--r--xlib/X11/keysym.h4
-rw-r--r--xlib/xbytes.h17
-rw-r--r--xlib/xcolors.c87
-rw-r--r--xlib/xdraw.c50
-rw-r--r--xlib/xgc.c494
-rw-r--r--xlib/ximage.c35
-rw-r--r--xlib/xutil.c54
786 files changed, 196240 insertions, 137088 deletions
diff --git a/ChangeLog b/ChangeLog
index 6584204..3b213fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-06-07 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updated for 8.5.10 release.
+
+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].
+
2011-06-06 Don Porter <dgp@users.sourceforge.net>
* generic/tkConsole.c: Restore proper NUL output to the [console].
@@ -15,86 +26,705 @@
* doc/listbox.n:
* doc/menu.n:
* doc/options.n:
+ * doc/ttk_combobox.n:
+ * doc/ttk_entry.n:
+ * doc/ttk_progressbar.n:
+ * doc/ttk_widget.n:
+
+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 Peter Spjuth <peter.spjuth@gmail.com>
+
+ * doc/labelframe.n:
+ * doc/frame.n:
+ * generic/tkFrame.c: [Bug 2997657]: Removed -container from labelframe
+ documentation since it does not work as expected and does not make
+ sense as a container. Added note to frame about restrictions when used
+ as a container.
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
menu font support.
+2011-03-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Make SHLIB_LD_LIBS='${LIBS}' the default and
+ * unix/configure: set to "" on per-platform necessary basis.
+ Backported from TEA, but kept all original platform code which was
+ removed from TEA.
+
2011-03-12 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWin32Dll.c: SEH-emulation for AMD64
- * win/tkWinX.c: mingw-w64 does not accept _WIN32_IE < 0x0501
- Merged --cherrypick from core-8-5-branch (2010-12-13, f4ecadb40d)
- * win/tkWinPort.h: remove conflicting definition of timezone struct
+ * win/tkWin32Dll.c: Eliminate unneeded _TkFinalize wrapper.
2011-03-11 Jan Nijtmans <nijtmans@users.sf.net>
- * win/Makefile.in (VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE):
- * win/configure, win/configure.in, win/tcl.m4: SC_EMBED_MANIFEST macro.
- Merged --cherrypick from core-8-5-branch (2010-08-26, 3416226333358009f)
+ * generic/ttk/ttkDefaultTheme.c: Eliminate some unneeded write-only
+ * generic/ttk/ttkManager.c: variables (discovered by gcc-4.6)
+ * generic/ttk/ttkSquare.c:
+
+2011-03-09 Reinhard Max <max@suse.de>
+
+ * unix/configure.in: Use a symbol from libXft itself for the link
+ 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>
- * generic/tkSelect.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5 and
- * generic/tkTextDisp.c -D_FORTIFY_SOURCE=2. Just the strcpy->memcpy part,
- * unix/tkUnixWm.c to prevent anything like [Bug #3164879]
- * win/tkWinWm.c
+ * 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]
+
+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>
+
+ * 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.
+
+2011-01-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tcl.m4: handle --enable-64bit=ia64 for gcc. BACKPORT.
+ * win/configure: (autoconf-2.59)
2011-01-13 Jan Nijtmans <nijtmans@users.sf.net>
- * library/msgbox.tcl: [Patch #3154705] Close button has no
- effect. Add <Escape> binding as well (backported from Tcl 8.5)
+ * library/msgbox.tcl: [Patch #3154705] Close button has no effect
+
+2011-01-06 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * generic/tkEvent.c: Cast some NULLs to (void *) in order to quash
+ * unix/tkUnixEvent.c: "missing sentinel in function call"
+ * unix/tkUnixKey.c: compiler warnings.
+ * unix/tkUnixRFont.c:
-2010-10-31 Jan Nijtmans <nijtmans@users.sf.net>
+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-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
- * win/tcl.m4 Add -D_CRT_SECURE_NO_DEPRECATE and
- -D_CRT_NONSTDC_NO_DEPRECATE, reducing the number of
- deprecation warnings on later VC++ versions.
- * win/rules.vc Better VCVERSION determination
- * win/configure (regenerated with autoconf 2.13)
- All changes backported from Tcl8.5/8.6
+2010-12-12 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * unix/tcl.m4: Better building on OpenBSD.
+ * unix/configure: (autoconf-2.59)
+
+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.
+
+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)
+
+2010-11-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinPort.h [Bug #3110161]: Extensions using TCHAR don't compile
+ on VS2005 SP1
+
+2010-11-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * library/msgs/de.msg: Updated German messages. Thanks to Ruediger
+ Haertel. [Patch 2442309] [Bug 3102739].
2010-10-23 Jan Nijtmans <nijtmans@users.sf.net>
- * win/rules.vc Update for VS10
+ * 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].
+
+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>
+
+ * generic/ttk/ttkTreeview.c (TreeviewSeeCommand): [Bug 2829363]:
+ Schedule redisplay if [$tv see] opens any items.
+
+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-09-01 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.9 TAGGED FOR RELEASE ***
+
+ * changes: Updated for 8.5.9 release.
+
+ * doc/menu.n: Formatting error.
+
+2010-09-01 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/entry.tcl: Revert keyboard navigation bindings
+ to use real events instead of virtual events.
+
+2010-08-31 Andreas Kupries <andreask@activestate.com>
+
+ * 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/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.
+
+2010-08-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * 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
+ -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>
+
+ * 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
+
+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.
+
+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>
+
+ * changes: Updated for 8.5.9 release.
+
+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>
+
+ * generic/tkBind.c (Tk_CreateBinding): [Bug 3006842]: Silently ignore
+ empty binding scripts.
+ * generic/ttk/ttkTreeview.c: [$tv tag bind $tag <...> {}] now removes
+ binding.
+
+2010-05-31 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.
+
+2010-05-20 Donal K. Fellows <dkf@users.sf.net>
+
+ * win/tkWinX.c (HandleIMEComposition): [Bug 2992129]: Ensure that all
+ 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>
+
+ * win/tkWinDialog.c: [Bug 3002230]: tk_chooseDirectory returns garbage
+ on cancel.
+
+2010-05-17 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tkWinDialog.c: [Bug 2987995]: Tk_getOpenFile returns garbage
+ under described circumstances. Backported some formatting from trunk.
+
+2010-05-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/button.tcl (CheckInvoke, CheckEnter): [Patch 1530276 redux]:
+ Apply a bit more care to ensure that things continue to work correctly
+ even when there is no -selectcolor defined.
+
+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.
+ * win/tkWinDialog.c: [Patch 2898255]: Filenames limit with
+ Tk_GetFileName().
+ Assure modern style dialogs where available
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/tkWinTest.c Fix 2 minor gcc warnings
- * win/.cvsignore
- * doc/.cvsignore Ignore man.macros
+ * 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/.cvsignore:
+
+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.
+
+2010-03-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/clipboard.n: Added note about STRING vs. UTF8_STRING types.
+
+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.
+
+2010-02-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * 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
+ file).
+
+2010-02-19 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Correct compiler/linker flags for threaded builds on
+ OpenBSD.
+ * configure: (regenerated).
2010-02-17 Joe English <jenglish@users.sourceforge.net>
- * generic/tkMenu.c: Defer TkMenuOptionTables cleanup
- to CallWhenDeleted() time, to ensure that the record
- doesn't get freed until after all widget instance commands
- have been deleted (Fixes [Bug#2952745]).
+ * 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-01-23 Pat Thoyts <patthoyts@users.sourceforge.net>
+2010-02-16 Jan Nijtmans <nijtmans@users.sf.net>
- * library/bgerror.tcl: [TIP #359]: Extended Window Manager Hints
- * library/clrpick.tcl: backported from 8.5 for use on X11.
- * library/dialog.tcl:
- * library/msgbox.tcl:
- * library/tkfbox.tcl:
+ * unix/tkUnixWm.c: Make TkSetTransientFor static
+
+2010-02-07 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!)
+
+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/ttkInit.c:
+
+2010-01-20 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/bgerror.tcl: [TIP 359]: Extended Window Manager Hints
+ * library/clrpick.tcl: following the freedesktop.org specification
+ * library/demos/widget: are now supported on X11 using a new
+ * library/dialog.tcl: wm attribute called '-type'
+ * library/msgbox.tcl: This feature is now used in the Tk library
+ * library/tkfbox.tcl: functions where appropriate.
+ * library/ttk/combobox.tcl:
* tests/unixWm.test:
+ * tests/wm.test:
* unix/tkUnixWm.c:
+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-18 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkCanvas.c: [Patch 2932808]: Canvas items not
+ updating on widget state change.
+
+2010-01-09 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * doc/menu.n: [TIP 360]: Remove special handling of
+ * 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.
+
+2010-01-08 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * doc/photo.n: [Bug 2927569]: Multiple edits have peverted the
+ original meaning of the phrase 'image file data' to reference
+ a filename option that does not exist.
+
+2010-01-07 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkTextDisp.c (AsyncUpdateLineMetrics): [Bug 2677890]: Fix
+ 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>
+
+ * 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)
+
+2010-01-05 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkMenu.c (MenuWidgetObjCmd): [Bug 220950]: Do not delete
+ menu entries if the first index to delete is explicitly after the last
+ index of existing entries.
+
+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.
+ * library/tk.tcl: Correctly handle quoted ampersands in AmpMenuArgs
+
+2010-01-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * 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 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * 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
+
+2010-01-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixEvent.c (TransferXEventsToTcl): [Bug 1924761]: Use the
+ new cache mechanism to force the extraction of the string of a key
+ event from XIM at the right time rather than after queueing when it
+ can be quashed by a race condition centered on the limited amount of
+ state in some XIM implementations.
+
+ * unix/tkUnixKey.c (TkpGetString): [Bug 1373712]: Cache the value that
+ * generic/tkInt.h (TkKeyEvent): will be substituted via %A so
+ * 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.
+
+2010-01-01 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixEvent.c (TransferXEventsToTcl): [Bug 1924761]: Move the
+ * generic/tkEvent.c (Tk_HandleEvent): passing of key events to
+ XFilterEvent to the low level point where all other events are
+ handled, where it should have been all along. This makes more input
+ methods work, stops [event generate] from interfering with input
+ methods, and allows the simplification of tkEvent.c by removing half
+ of InvokeInputMethods and allowing the rest - which was not full input
+ method handling - to be rolled back into Tk_HandleEvent. Introduces a
+ small potential bug when a focus change and input method handling are
+ too close together in the Tk event queue, but that should be less
+ deadly to usability than the previous problems where input methods
+ could fail completely or reorder key presses...
+
+2009-12-30 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkMenu.c: [Patch 2879789]: Torn off menu items are only
+ * tests/menu.tcl: activated over a limited region of the window.
+ Fixed to make the whole width of a menu item activate the entry.
+
+2009-12-27 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinMenu.c: [Bug 2879927]: Highlight for cascade items in
+ torn-off menus is incorrect on Windows.
+
+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 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>
+
+ * generic/ttk/ttkNotebook.c: Don't call Tk_DeleteOptionTable()
+ [Bug 2915709], backport fix for [Bug 2496162].
+
+2009-12-14 Kevin B. Kenny <kennykb@acm.org>
+
+ * library/demos/unicodeout.tcl: Added code to check for right-to-left
+ support on Windows and adjust Hebrew and Arabic character strings
+ accordingly. Changed the Hebrew string to 'ktb ebryt' (ktav Ivrit,
+ "Hebrew writing") to be consistent with at least the Greek and Russian
+ strings. Thanks to Rodrigo Readi for calling the inconsistency to our
+ attention.
+
+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
+
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).
+
+2009-12-08 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: [Bug 2864685]: Backported window manager hinting
+ update from HEAD
+
+2009-12-06 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
+
+ * macosx/tkMacOSXFont.c (GetFontFamilyName): [Bug 2548661]: Merge fix
+ from HEAD (1.44).
+
+2009-12-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/xpTheme.tcl: Fix selection of treeview rows on
+ * library/ttk/vistaTheme.tcl: Windows XP and Vista.
+
+2009-12-02 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)
+
+2009-11-25 Stuart Cassoff <stwo@users.sf.net>
+
+ * unix/tcl.m4: [Patch 2892871]: Remove unneeded
+ * AC_STRUCT_TIMEZONE.
+ * unix/configure: Regenerated with autoconf-2.59.
+
+2009-11-24 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixWm.c (WmIconphotoCmd): [Bug 2902814]: Use the correct
+ type for the array of data passed into X. It's wrong, but "right"
+ because of a mistake in the X11 specification.
+
+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
+
+2009-11-13 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/winDialog.test: [Bug 2307837]: Backported fix for running
+ * win/tkWinTest.c: dialog tests on non-English locales
+
+2009-11-12 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.8 TAGGED FOR RELEASE ***
+
+ * changes: Updated for 8.5.8 release.
+
+2009-11-03 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump to 8.5.8 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.8 release.
+
+2009-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinWm.c: [Bug 2891541]: Permit normal behaviour on
+ Windows for a grabbed toplevel when it is the main window.
+
2009-11-01 Joe Mistachkin <joe@mistachkin.com>
* win/tkWinButton.c: [Bug 1739613]: The default width being stored
@@ -102,24 +732,92 @@
allocates storage for the default width from the heap and frees it
using an exit handler.
+2009-10-29 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinFont.c: [Bug 1825353]: Backported patch for tiny
+ fixed font on Russian Windows systems.
+
2009-10-25 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixColor.c (TkpGetColor): [Bug 2809525]: Impose a maximum
X11 color name length so that it becomes impossible to blow things up
that way.
+ * library/text.tcl: [Bug 1854913]: Stop <Delete> actions from ever
+ deleting backwards, even when the insertion cursor is "at the end" of
+ the text widget.
+
+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.
+
2009-10-22 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkText.c (Tk_TextCmd, TextEditUndo, TextEditRedo)
- (TextEditCmd, updateDirtyFlag):
+ * generic/tkText.c (CreateWidget, TextEditUndo, TextEditRedo)
+ (TextEditCmd, UpdateDirtyFlag):
* generic/tkText.h: [Patch 1469210]: Corrected handling of marking as
dirty when inserting after an undo from a non-dirty state.
+ * 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>
+
+ * 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-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.
+
+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.
+
+2009-10-07 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/vistaTheme.tcl: [Bug 2787164]: Fix size of dropdown
+ arrow on combobox and menubutton for Windows 7.
+
2009-10-07 Donal K. Fellows <dkf@users.sf.net>
* unix/tkUnixScrlbr.c (TkpComputeScrollbarGeometry): [Patch 2088597]:
Stop scrollbars from getting too small at the end.
+2009-10-05 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updated for 8.5.8 release.
+
+2009-10-05 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinButton.c: [Bug 2860827]: Backported patch avoiding 3D
+ effects with user-specified background.
+
+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-14 Jeff Hobbs <jeffh@ActiveState.com>
* generic/tkMenuDraw.c (TkPostSubmenu): [Bug 873613]: Fix reposting of
@@ -128,70 +826,624 @@
(DrawMenuEntryArrow): [Bug 873608]: Draw Win menu arrow after being
torn off.
+2009-09-10 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
+ the failure.
+ (TkpGetFontFromAttributes): If the default attributes don't work, try
+ adding a setting to turn off use of XRender. That seems to work for
+ some people for unexplained reasons (possibly local misconfiguration).
+ * generic/tkFont.c (Tk_AllocFontFromObj): Stop this function from
+ keeling over in a heap when the low-level font allocation fails. An
+ error beats a crash! (Issue reported on comp.lang.tcl by Denis
+ Berezhnoy.)
+
+2009-08-25 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixSend.c (ServerSecure): [Bug 1909931]: Added some support
+ for server-interpreted access control addreses.
+
+2009-08-24 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/msgbox.tcl (::tk::MessageBox): Correct bindings so that they
+ work with ttk::buttons. Reported by Hans-Christoph Steiner.
+
2009-08-24 Daniel Steffen <das@users.sourceforge.net>
- * macosx/tkMacOSXHLEvents.c (ScriptHandler): fix "do script" apple
+ * 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
+ to 'utf8' for text data and to 'fsrf' for alias data. (Reported by
Youness Alaoui on tcl-mac)
+2009-08-08 Donal K. Fellows <dkf@users.sf.net>
+
+ * library/demos/pendulum.tcl: Make the display handle being resized
+ more gracefully.
+
+2009-08-04 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkTextDisp.c (TkTextCharLayoutProc): Make the line breaking
+ algorithm (in the word-wrap case) do the right thing with non-breaking
+ spaces by restricting what we break on to ASCII spaces, which is good
+ enough for most purposes.
+
+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-22 Donal K. Fellows <dkf@users.sf.net>
* generic/tkFocus.c (TkFocusDeadWindow): [Bug 2496114]: Ensure that
focus desynchronization doesn't cause a crash.
-2009-04-30 Don Porter <dgp@users.sourceforge.net>
+2009-07-20 Donal K. Fellows <dkf@users.sf.net>
+
+ * tests/clipboard.test (clipboard-6.2): [Bug 2824378]: Corrected
+ result of test in light of changes to binary selection retrieval.
+
+2009-07-18 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixSelect.c (SelCvtFromX32, SelCvtFromX8): Make the
+ incremental transfer of binary selections work get deserialized
+ correctly. Thanks to Emiliano Gavilan for detecting.
+
+2009-07-15 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixSelect.c (TkSelEventProc, SelRcvIncrProc, SelCvtFromX8):
+ [Bug 2821962]: Make byte sequence selection transfers possible.
+
+2009-07-14 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/canvas.n (WINDOW ITEMS): [Bug 2326602]: Corrected definition of
+ the -height and -width options for these items.
+
+ * unix/configure.in: [Bug 2496018]: Allow the disabling of the use of
+ XScreenSaver at configuration time, so as to permit better control of
+ dependencies in the embedded case.
+
+2009-07-11 Donal K. Fellows <dkf@users.sf.net>
+
+ * 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>
+
+ * generic/tkCanvUtil.c: [Bug 220935]: canvas dash update problem
+
+2009-06-02 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinWm.c: [Bug 2799589]: Backported fix for crash on
+ * tests/winWm.test: delayed window activation.
+
+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:
+
+2009-05-13 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tkFont.c: [Bug 2791352]: Backported fix and tests for
+ * tests/font.test: mis-parsing of certain font descriptions.
+
+2009-05-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * win/tkWinWm.c (UpdateWrapper): [Bug 2785744]: Manipulate flag bit
+ correctly so that menubar updates can't smash other attributes.
+
+2009-04-30 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinWm.c: [Patch 2504402]: Backported change to create
+ wm icons as device independent bitmaps. (cjmcdonald)
+
+2009-04-30 Donal K. Fellows <dkf@users.sf.net>
* win/tkWinPixmap.c (Tk_GetPixmap): [Bug 2080533]: Added patch that
allows Tk to keep working even when the graphics card is stressed.
2009-04-28 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/tcl.m4, unix/configure (SC_CONFIG_CFLAGS): harden the check
+ * unix/tcl.m4, unix/configure (SC_CONFIG_CFLAGS): Harden the check
to add _r to CC on AIX with threads.
+2009-04-27 Donal K. Fellows <dkf@users.sf.net>
+
+ * 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-04-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (ChooseDirectoryValidateProc): No need to set
+ cwd on selchange. Prevents delete of selected folder in dialog.
+
+2009-04-24 Stuart Cassoff <stwo@users.sf.net>
+
+ * 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.
+
+2009-04-24 Stuart Cassoff <stwo@users.sf.net>
+
+ * unix/Makefile.in: [Patch 2769530]: Don't chmod/exec installManPage.
+
+2009-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * 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.
+
+2009-04-15 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.7 TAGGED FOR RELEASE ***
+
+ * changes: Updated for 8.5.7 release.
+
2009-04-14 Stuart Cassoff <stwo@users.sourceforge.net>
* unix/tcl.m4: Removed -Wno-implicit-int from CFLAGS_WARNING.
-2009-04-09 Don Porter <dgp@users.sourceforge.net>
+2009-04-10 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updated for 8.5.7 release.
+
+ * generic/tk.h: Bump to 8.5.7 for release.
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+ * README:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+2009-04-10 Joe English <jenglish@users.sourceforge.net
+
+ * library/palette.tcl(tk_setPalette): Don't set
+ *selectColor: #b03060; this makes radio- and checkbuttons
+ look wrong post-TIP#109.
+
+2009-04-10 Daniel Steffen <das@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
+
+ * library/msgbox.tcl: don't set msgbox bitmap background on TkAqua.
+
+ * library/demos/filebox.tcl: only show "Motif Style Dialog" checkbutton
+ on X11 windowingsystem.
+
+ * library/demos/widget: GOOBE: use ttk::cursor
+
+ * library/ttk/cursors.tcl: backport ttk::cursor from HEAD
+
+ * library/demos/knightstour.tcl: fix knightstour demo not running from
+ interactive wish.
+
+ * library/console.tcl (::tk::ConsoleInit): remove redundant TkAqua
+ Quit menu item.
+
+ * generic/tkPointer.c (Tk_UpdatePointer): use all 5 buttons.
+
+ * generic/tkMenu.c (PostProcessEntry): delay call to
+ TkpConfigureMenuEntry() until all menu entry attributes are setup.
+
+ * library/menu.tcl (::tk::MbPost): fix error thrown in y position
+ computation with indicatoron.
+
+ * generic/tkMenubutton.c: s/DEF_BUTTON_JUSTIFY/DEF_MENUBUTTON_JUSTIFY/
+
+ * generic/tkTextBTree.c (TkBTreeDeleteIndexRange): add bounds check
+ to startEnd array access (fixes testsuite crash).
+
+ * tests/unixFont.test: only use xlsfonts with X11 windowingsystem.
+
+2009-04-10 Donal K. Fellows <dkf@users.sf.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.
+
+ * library/tk.tcl: [Bug 2116837]: Add event definitions to handle the
+ standard virtual events when Caps Lock is on.
+
+2009-04-03 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: [Bug 1789819]: Don't Panic.
+
+2009-03-25 Donal K. Fellows <dkf@users.sf.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.
+
+ * win/wish.exe.manifest.in: [Bug 1871101]: Add magic to make Tk not be
+ blurred on Vista with large fonts.
- * generic/tk.h: Restore _TCL guards around tcl.h inclusion to restore
- compat with early 8.4.* releases. Thanks Stuart Cassoff. [Bug 1723812]
+2009-03-03 Pat Thoyts <patthoyts@users.sourceforge.net>
-2009-02-28 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * 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>
* generic/tkWindow.c: [Bug 2645457] check for dead windows after
calling Tk_MakeWindowExist to avoid a crash when mapping dead windows.
+2009-02-23 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinCursor.c: [Patch 2542828] use stock Win32 help arrow
+ cursor when question_arrow requested (danckaert)
+
+ * win/rc/*.cur: [Patch 2513104] fix cursor hotspots (cjmcdonald)
+
+ * win/tkWinMenu.c: Applied patch for menu image display bug
+ [Bug 1329198, 456299] [Patch 2507419] (cjmcdonald)
+
+2009-02-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * 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.
+
+2009-02-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure.in, win/configure: align better with tcl
+ version. Ensures finding correct CPP for Win64.
+
2008-02-06 Daniel Steffen <das@users.sourceforge.net>
- * generic/tkImgPhoto.c: fix leaks discovered with the Mac OS X
- * generic/tkMenu.c: Instruments.app Leaks tool.
+ * 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:
-2009-01-16 Andreas Kupries <andreask@activestate.com>
+2009-01-22 Kevin B. Kenny <kennykb@acm.org>
+
+ * unix/tcl.m4: Corrected a typo ($(SHLIB_VERSION) should be
+ ${SHLIB_VERSION}).
+ * unix/configure: Autoconf 2.59
+
+2009-01-19 Kevin B. Kenny <kennykb@acm.org>
+
+ * 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
+
+2009-01-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkImgPhoto.c: fix for aMSN compatibility [tcl-Bug 2507326]
+
+2009-01-11 George Peter Staplin <georgeps@users.sourceforge.net>
- * win/tkWinWm.c (WmAttributesCmd): Fix a single use of
- SetWindowLongPtr which was not properly ifdef'd.
+ * generic/tkEvent.c: Backport a fix from 8.6 for a NULL pointer
+ dereference in CreateXIC.
-2008-11-04 Jeff Hobbs <jeffh@ActiveState.com>
+2009-01-07 Pat Thoyts <patthoyts@users.sourceforge.net>
- * generic/tkPort.h: remove the ../unix/ header dir as the build
- system already has it, and it confuses builds when used with
- private headers installed.
+ * win/tkWinWm.c: Backported fix for [Bug 1847002] to prevent the
+ bypassing of grab restrictions via the taskbar on Windows.
+
+2008-12-22 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.6 TAGGED FOR RELEASE ***
+
+ * tests/embed.test: Eliminate duplicate test names.
+
+ * changes: Updates for 8.5.6 release.
+
+2008-12-22 Joe English <jenglish@users.sourceforge.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).
+
+2008-12-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkCanvPs.c (Tk_PostscriptFont,TkCanvPostscriptCmd): Backport
+ of font size and reflection fix. [Bug 2107938]
+
+2008-12-22 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+
+ * generic/tkCanvUtil.c: Backport of the Millipeter patch [1813597,
+ * generic/tkInt.h: 2218964]
+ * generic/tkObj.c:
+ * generic/tkText.c:
+
+2008-12-21 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump to 8.5.6 for release.
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+ * README:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+ * changes: Updates for 8.5.6 release.
+
+2008-11-22 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/combobox.tcl: [Bug 1939129,1991930] combobox dropdown
+ was drawn behind topmost toplevels.
+
+2008-11-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * 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]
+
+2008-11-15 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * 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]
+
+2008-11-12 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * 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.
+
+2008-10-23 Don Porter <dgp@users.sourceforge.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:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
+2008-10-17 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/scale.tcl: Backported keyboard bindings for ttk::scale
+
+2008-10-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ *** 8.5.5 TAGGED FOR RELEASE ***
+
+ * generic/tkCanvas.c (CanvasWidgetCmd): Corrected result generation.
+
+2008-10-10 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump to 8.5.5 for release.
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+ * changes: Updates for 8.5.5 release.
+
+ * 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].
+
+2008-10-09 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkListbox.c: Make literal return values consistent with
+ those generated by Tcl_PrintDouble().
+
+ * 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:
+
+ * generic/tkEntry.c: Fix missing space constructing the scroll
+ command.
+
+2008-10-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * 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:
+
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+
+ * library/menu.tcl: additional fix for [Bug 1023955]
+
+2008-09-08 Todd M. Helfter <tmh@users.sourceforge.net>
+
+ * doc/menu.n: fix typo in docs [Bug 2098425]
+
+2008-08-28 Don Porter <dgp@users.sourceforge.net>
+
+ * 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).
+
+ * 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:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+
+ * library/menu.tcl: fix typo from [Bug 1023955]
+
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+
+ * 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]
+
+2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net>
+
+ 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.
+
+2008-08-19 Joe English <jenglish@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.
+
+2008-08-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXFont.c (SetFontFeatures): Disable antialiasing of
+ fixed-width fonts with
+ size <= 10.
2008-08-14 Daniel Steffen <das@users.sourceforge.net>
+ *** 8.5.4 TAGGED FOR RELEASE ***
+
* unix/tcl.m4 (SC_PATH_X): check for libX11.dylib in addition to
libX11.so et al.
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
+
+2008-08-08 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Bump to 8.5.4 for release.
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+ * README:
+
+ * unix/configure: autoconf-2.59
+ * win/configure:
+
+ * changes: Updates for 8.5.4 release.
+
+2008-08-05 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tk.h, generic/tkEvent.c: Fix for [Bug 2010422]
+ "no event type or button # or keysym while executing
+ "bind Listbox <MouseWheel> [...]".
+
+2008-08-01 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinWm.c: Backported fixes for handling unmapped parent
+ * test/wm.test: toplevels. [Bug 2009788, 2028703]
+
+2008-07-31 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.h: Added missing EXTERN for the Tcl_PkgInitStubsCheck
+ declaration to fix inability to embed non-stub-enabled Tk on Windows.
+
+2008-07-26 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * doc/options.n: Direct to the font manual for -font [Bug 1686012]
+
+ * win/tkWinWindow.c: Check for 0x prefix in sprintf %p. Bug [2026405]
+
+2008-07-22 Daniel Steffen <das@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.
+
+ * macosx/tkMacOSXHLEvents.c: sync with HEAD.
+
+2008-07-04 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c,
+ generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c:
+ Backport [Bug 2009213].
+
+2008-06-29 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.3 TAGGED FOR RELEASE ***
+
+ * generic/tk.h: Bump to 8.5.3 for release.
+ * library/tk.tcl:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * 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-08-06 Joe English <jenglish@users.sourceforge.net>
+2008-06-19 Don Porter <dgp@users.sourceforge.net>
- * generic/tk.h: Fix for [Bug 2010422]: account for X11 changing
- constant LASTEvent.
+ * changes: Updates for 8.5.3 release.
2008-06-18 Daniel Steffen <das@users.sourceforge.net>
@@ -211,6 +1463,18 @@
* 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
@@ -218,61 +1482,257 @@
releasing a button grab. Fixes segfault due to dangling reference to
restrict window inside TkpSetCapture() implementation. [Bug 1991932]
- * macosx/tkMacOSXXStubs.c: sync with core-8-5-branch.
-
* unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
-2008-04-17 Don Porter <dgp@users.sourceforge.net>
+ * 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.
- *** 8.4.19 TAGGED FOR RELEASE ***
+2008-05-23 Joe English <jenglish@users.sourceforge.net>
- * generic/tkCanvas.c: Fix logic that determines when canvas item
+ * 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]
+2008-04-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * 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.
+
+2008-04-11 Don Porter <dgp@users.sourceforge.net>
+
+ * 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:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
2008-04-07 Jeff Hobbs <jeffh@ActiveState.com>
* generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv
* tests/main.test (main-3.*): error. [Bug 1937135]
-2008-04-07 Don Porter <dgp@users.sourceforge.net>
+ * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny)
+
+2008-04-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/ttk/xpTheme.tcl: fix the colour of labelframe in xp
- * README: Bump version number to 8.4.19
+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/tk.tcl:
* unix/configure.in:
* unix/tk.spec:
* win/configure.in:
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
* win/configure:
- * changes: updates for 8.4.19 release.
+ * 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.13
+ * 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>
+
+ * 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>
+
+ * 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]
+
+2008-03-19 Donal K. Fellows <dkf@users.sf.net>
+
+ * doc/GetClrmap.3: Documented Tk_PreserveColormap. [Bug 220809]
+
+2008-03-17 Joe English <jenglish@users.sourceforge.net>
+
+ * 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>
+
+ * library/demos/goldberg.tcl: Made work when run twice in the same
+ session. [Bug 1899664] Also made the control panel use Ttk widgets.
+
+2008-03-13 Daniel Steffen <das@users.sourceforge.net>
+
+ * 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
+
+2008-03-13 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.5.2 release.
+
+2008-03-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * 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'.
+
+2008-03-12 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: Try a fallback font if XftFontOpenPattern()
+ fails in GetFont (workaround for [Bug 1090382]).
+
+2008-03-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/demos/knightstour.tcl: Aqua GOOBE.
+ * library/demos/widget:
+
+ * 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.
+
+2008-03-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/colors.n: Reworked to produce nicer HTML output.
+
+2008-03-06 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/ttk_notebook.n: Move "TAB IDENTIFIERS" section above "WIDGET
+ COMMAND" section. [Bug 1882011]
+
+2008-02-29 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/demos/widget: Added a Knight's tour canvas demo.
+ * library/demos/knightstour.tcl:
2008-02-27 Daniel Steffen <das@users.sourceforge.net>
* macosx/tkMacOSXDraw.c: workaround leak in Carbon SetPortPenPixPat()
API [Bug 1863346]; avoid repeated PixPat allocation/deallocation.
-2008-02-06 Don Porter <dgp@users.sourceforge.net>
+2008-02-23 Joe English <jenglish@users.sourceforge.net>
- *** 8.4.18 TAGGED FOR RELEASE ***
+ * 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.
- * README: Bump version number to 8.4.18
- * generic/tk.h:
+2008-02-23 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]
+
+2008-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * unix/README: Documented missing configure flags.
+
+2008-02-06 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/ttk_scale.n (new file): Added basic documentation. [Bug 1881925]
+
+2008-02-04 Don Porter <dgp@users.sourceforge.net>
+
+ *** 8.5.1 TAGGED FOR RELEASE ***
+
+ * generic/tk.h: Bump to 8.5.1 for release.
+ * library/tk.tcl:
* unix/configure.in:
* unix/tk.spec:
* win/configure.in:
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
* win/configure:
- * changes: updates for 8.4.18 release.
+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>
@@ -282,22 +1742,151 @@
* unix/configure.in (Darwin): correct Info.plist year substitution in
non-framework builds.
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
+
+2008-02-01 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.5.1 release.
2008-02-01 Reinhard Max <max@suse.de>
* generic/tkImgGIF.c: Fixed a buffer overflow (CVE-2008-0553).
* tests/imgPhoto.test: Added a test for the above.
-2007-12-31 Don Porter <dgp@users.sourceforge.net>
+2008-01-31 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/msgbox.tcl (::tk::MessageBox): don't use ttk::label in
+ low depth/aqua fallback, as it doesn't support -bitmap.
+
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): pass "" instead of NULL
+ when -title isn't set. [Bug 1881892]
+
+2008-01-31 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * 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>
+
+ * library/treeview.tcl: Fix bug in Shift-ButtonPress-1 binding (error
+ if no current focus item; reported on c.l.t.)
+
+2008-01-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * 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-01-28 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: Re-fix strict-aliasing warnings reintroduced by
+ last patch.
+
+2008-01-27 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkNotebook.c: Make sure to schedule a redisplay when
+ adding and/or hiding tabs. [Bug 1878298]
+
+2008-01-27 Joe English <jenglish@users.sourceforge.net>
- *** 8.4.17 TAGGED FOR RELEASE ***
+ * 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]
- * changes: updates for 8.4.17 release.
- * unix/configure.in: Add "hu" to LOCALES.
- * unix/configure: autoconf-2.13
+2008-01-25 Don Porter <dgp@users.sourceforge.net>
-2007-12-18 Daniel Steffen <das@users.sourceforge.net>
+ * changes: Updates for 8.5.1 release.
+
+2008-01-08 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkFrame.c: BUGFIX: fix crash in [ttk::labelframe] when
+ -style option specified. [Bug 1867122]
+
+2008-01-08 Joe English <jenglish@users.sourceforge.net>
+
+ * win/ttkWinTheme.c: Add tristate support to checkbuttons and
+ radiobuttons. [Bug 1865898]
+ Fix check and radio indicator size. [Bug 1679067]
+
+2008-01-06 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkWidget.c, generic/ttk/ttkWidget.h: Call
+ Tk_MakeWindowExist() in widget constructor. Removed now-unnecessary
+ initial ConfigureNotify processing.
+
+2008-01-06 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/treeview.tcl, library/ttk/utils.tcl: Fix MouseWheel
+ bindings for ttk::treeview widget. [Bugs 1442006, 1821939, 1862692]
+
+2008-01-02 Don Porter <dgp@users.sourceforge.net>
+
+ * 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:
+
+ * unix/configure: autoconf (2.59)
+ * win/configure:
+
+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
@@ -311,44 +1900,283 @@
master; bring master to front when selecting transient windows; restore
default window group of transients if master destroyed. [Bug 1845899]
- * macosx/tkMacOSXPrivate.h: fix Panther build.
+2007-12-12 Joe English <jenglish@users.sourceforge.net>
-2007-12-13 Jeff Hobbs <jeffh@ActiveState.com>
+ * doc/ttk_intro.n, doc/ttk_style.n, doc/ttk_widget.n:
+ Various minor updates.
- * generic/tkMenubutton.c (ConfigureMenuButton): trace the
- -textvariable even if an image exists as it may use -compound.
+2007-12-12 Don Porter <dgp@users.sourceforge.net>
-2007-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+ * changes: Updated for 8.5.0 release.
- * generic/tkText.c (DeleteChars, 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-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.
+ change only and set WS_EX_LAYERED as sticky (once set on a window, do
+ not remove it) to reduce alpha transition flicker.
- * win/tkWinDraw.c: Applied [Patch 1723362] for transparent bitmaps.
+ * 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>
- Backport from HEAD of [Bug #1822391]:
+ * 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]
- * 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]
- * tests/imgPPM.test (imgPPM-4.1): Added test case that
- exercises [Bug #1822391].
+2007-11-25 Joe English <jenglish@users.sourceforge.net>
-2007-11-09 Daniel Steffen <das@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.
- Backport from HEAD of Aqua changes from 2007-10-12 to 2007-11-09:
+ * 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
@@ -401,6 +2229,64 @@
* 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"
@@ -408,18 +2294,446 @@
* library/bgerror.tcl: fix background of detail text on Aqua.
- * library/console.tcl: sync aqua font size with HEAD.
+ * library/console.tcl: add accelerators and fix Aqua bindings
+ of the new font size menu items.
- * library/demos/widget: Aqua GOOBE.
+ * 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.
+ 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/demos/widget: increase height of main window text
- widget to use more of the available
- vertical space.
+ * 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
@@ -449,6 +2763,7 @@
* 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
@@ -467,29 +2782,14 @@
* macosx/tkMacOSXButton.c: delay picParams setup until needed.
-2007-10-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/entry.tcl: don't error with Clear event. [Bug 1509288]
-
-2007-10-26 Daniel Steffen <das@users.sourceforge.net>
+ * generic/tkTextDisp.c (CharUndisplayProc): fix textDisp.test crash.
- * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): fix window class of
- transient toplevels that are not also overrideredirect. [Bug 1816252]
+2007-10-11 David Gravereaux <davygrvy@pobox.com>
- * macosx/tkMacOSXDialog.c: sync with HEAD.
-
- * unix/configure.in (Darwin): add support for 64-bit X11.
- * unix/configure: autoconf-2.13
-
-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-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/msgs/hu.msg: Added message catalog for Hungarian.
- [Patch 1800742] (rezso)
+ * 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>
@@ -497,56 +2797,212 @@
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>
- * README: Bump version number to 8.4.17
+ [core-stabilizer-branch]
+
+ * README: Bump version number to 8.5.0
* generic/tk.h:
- * unix/configure.in: Removed "es_ES" entry in LOCALES
+ * library/tk.tcl:
+ * unix/configure.in: Updated LOCALES.
* unix/tk.spec:
* win/configure.in:
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf (2.59)
* win/configure:
-2007-09-18 Daniel Steffen <das@users.sourceforge.net>
+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.4.16 TAGGED FOR RELEASE ***
+ *** 8.5b1 TAGGED FOR RELEASE ***
- * changes: updates for 8.4.16 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 (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld'
- in SHLIB_LD by 'cc' compiler driver.
- * unix/configure: autoconf-2.13
+ * 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.
+ 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 Daniel Steffen <das@users.sourceforge.net>
+2007-09-11 Don Porter <dgp@users.sourceforge.net>
- * unix/configure.in: backport of TK_INCLUDE_SPEC addition.
- * unix/tkConfig.sh.in: [Bug 777203]
- * unix/configure: autoconf-2.13
+ * 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-11 Pat Thoyts <patthoyts@users.sourceforge.net>
+2007-09-10 Jeff Hobbs <jeffh@ActiveState.com>
- * win/makefile.vc: Fix for AMD64 symbols target builds.
- * win/rules.vc:
+ * 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).
-2007-09-05 Pat Thoyts <patthoyts@users.sourceforge.net>
+ * 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:
- * win/rc/tk_base.rc: Backported the BASE_NO_TK_ICON patch to assist in
- creating tclkits and/or basekits with corrent resources.
+ * macosx/README: document project changes.
-2007-09-04 Pat Thoyts <patthoyts@users.sourceforge.net>
+2007-09-04 Joe English <jenglish@users.sourceforge.net>
- * tests/wm.test: -transparentcolor added to windows wm attributes tests
+ * 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>
@@ -554,80 +3010,107 @@
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
+ * 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;
+ * 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.13
+ * 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
+ * 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/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
+ * 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
+ * macosx/tkMacOSXDraw.c (TkPutImage): Handle non-native XImage byte and
bit orders; reverse bits via xBitReverseTable instead of InvertByte().
-2007-07-04 Jeff Hobbs <jeffh@ActiveState.com>
+2007-07-06 Joe English <jenglish@users.sourceforge.net>
- * macosx/tkMacOSXXStubs.c (DestroyImage): Fixed crash in release
- of image data for images coming from XGetImage, introduced
- 2007-06-23. (das)
+ * 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
+ * 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/tkMacOSXColor.c: Add debug messages for unknown pixel values.
- * macosx/tkMacOSXDraw.c (TkMacOSXRestoreDrawingContext): don't restore
+ * 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 .bmp
+ * xlib/ximage.c: Bitmaps created from the static .xbm
arrays always have LSBFirst bit order.
- * macosx/tkMacOSXScrlbr.c: correct int <-> dobule conversion issues
+ * 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
+ * macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage): Use
TkMacOSX{Setup,Restore}DrawingContext() to setup/restore clip & colors.
- (TkMacOSXSetupDrawingContext, TkMacOSXRestoreDrawingContext): add save
+ (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
+ (TkScrollWindow): Remove unnecessary scroll region manipulation
- * macosx/tkMacOSXDraw.c: remove second global QD temp region
+ * 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 sync formatting with HEAD.
+ * 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/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(
@@ -643,7 +3126,7 @@
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXInt.h: factor out macros, declarations
+ * 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.
@@ -674,35 +3157,77 @@
* 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
+ 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
+ * xlib/ximage.c (XCreateBitmapFromData): Use XCreateImage and
XDestroyImage instead of creating XImage structure manually.
- * macosx/tkMacOSXXStubs.c (XCreateImage, DestroyImage): correct XImage
+ * 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
+ * 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]
+ * 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/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
@@ -711,28 +3236,36 @@
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXDraw.c (XCopyArea, XCopyPlane, TkPutImage)
- (TkMacOSXSetupDrawingContext): factor out common code and standardize
+ (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/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/tkMacOSXInt.h: Use native debug message API when available.
+ * macosx/Wish-Debug.xcconfig:
- * macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): enable
+ * macosx/tkMacOSXMouseEvent.c (GenerateMouseWheelEvent): Enable
processing of mousewheel events in background windows.
- * macosx/tkMacOSXScrlbr.c: modernize checks for active/front window.
+ * 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/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.
@@ -740,27 +3273,35 @@
* macosx/tkMacOSXInt.h:
* macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXDraw.c: factor out clip clearing in QD ports;
- * macosx/tkMacOSXEntry.c: formatting cleanup.
+ * 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
+ * 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.13
+ * 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-04 Daniel Steffen <das@users.sourceforge.net>
+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/tkMacOSXMenu.c: Add error checking; whitespace cleanup.
- * macosx/tkMacOSXDraw.c: sync comment formatting with HEAD.
+ * 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:
@@ -772,76 +3313,66 @@
2007-06-02 Daniel Steffen <das@users.sourceforge.net>
- * macosx/tkMacOSXMenu.c (TkpPostMenu): ensure cascade menus display in
+ * 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
+ * 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.
+ 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/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
+ * 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/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.
+ Correct handling of gridded windows in max size calculations.
- * macosx/tkMacOSXEvent.c (TkMacOSXFlushWindows): use HIWindowFlush API
+ * macosx/tkMacOSXEvent.c (TkMacOSXFlushWindows): Use HIWindowFlush API
when available.
- * macosx/tkMacOSXColor.c: cleanup whitespace and formatting.
+ * 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].
-
- * README: Bump version number to 8.4.16
- * generic/tk.h:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf-2.13
- * win/configure:
+ * 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/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.
-
- * generic/tkFileFilter.c (AddClause): fix warning.
+ * library/demos/button.tcl: Set button highlightbackground on Aqua.
- * macosx/tkMacOSXMenu.c (DrawMenuSeparator): use DrawingContext API.
+ * macosx/tkMacOSXMenu.c (DrawMenuSeparator): Use DrawingContext API.
- * macosx/tkMacOSXWindowEvent.c (ClearPort): clip to updateRgn.
+ * macosx/tkMacOSXWindowEvent.c (ClearPort): Clip to updateRgn.
- * macosx/tkMacOSXDebug.c: factor out debug region flashing.
+ * 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/tkMacOSXEvent.c: Cleanup whitespace and formatting.
* macosx/tkMacOSXFont.c:
* macosx/tkMacOSXRegion.c:
* macosx/tkMacOSXSubwindows.c:
@@ -850,77 +3381,306 @@
* macosx/tkMacOSXXStubs.c:
* xlib/xgc.c:
-2007-05-25 Don Porter <dgp@users.sourceforge.net>
+ * 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>
- *** 8.4.15 TAGGED FOR RELEASE ***
+ [core-stabilizer-branch]
- * unix/README: Updates and typo corrections. [Bug 1724841]
+ * 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>
- * tests/bind.test: Make test suite more SCIM-tolerant [Bug 1609316]
+ * 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-15 Don Porter <dgp@users.sourceforge.net>
+2007-05-16 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Test ttk widgets.
- * changes: updates for 8.4.15 release.
+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
+ * 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/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.
+ * 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
+ * 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/tkMacOSXScrlbr.c (ScrollbarBindProc): Fix testsuite
* macosx/tkMacOSXSubwindows.c (TkMacOSXUpdateClipRgn): crashes by
adding sanity checks.
- * macosx/tkMacOSXButton.c: fix debug msg typo.
+ * 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>
- * generic/tkCanvas.c: allow -selectforeground option to be None; add
+ * 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/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
- * macosx/tkMacOSXPort.h: platforms would only require implementation
+ * 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/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/tearoff.tcl: Correct aqua menu bar height; vertically offset
* library/tk.tcl: aqua tearoff floating window to match menu.
- * library/demos/menu.tcl: on aqua, use custom MDEF and tearoffs;
+ * 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/puzzle.tcl: Fix button size & padding for aqua.
+ * library/demos/radio.tcl:
- * macosx/tkMacOSXCarbonEvents.c: add window event target carbon event
+ * 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
@@ -937,7 +3697,7 @@
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/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
@@ -946,12 +3706,12 @@
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.c:
- * macosx/tkMacOSXDialog.c: use new TkMacOSXRunTclEventLoop()
+ * 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/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
@@ -960,24 +3720,24 @@
(lossy for most system colors); modernize/remove Classic-era code;
replace crufty strcmp() elseifs by Tcl_GetIndexFromObjStruct().
- * macosx/tkMacOSXButton.c: use new TkMacOSXSetColorInPort()
+ * 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
+ * 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
+ * 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/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/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
@@ -985,55 +3745,59 @@
"systemWindowHeaderBackground" to setup background in themed toplevels;
correct implementation of TkMacOSXMakeStippleMap().
- * macosx/tkMacOSXEntry.c: use new TkMacOSXSetupDrawingContext() and
- * macosx/tkMacOSXFont.c: TkMacOSXRestoreDrawingContext() instead of
- various setup/teardown procs like TkMacOSX{SetUp,Release}CGContext(),
- TkMacOSXQuarz{Start,End}Draw(), TkMacOSXSetUpGraphicsPort() etc.
+ * 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/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.
+ * 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/tkAboutDlg.r: Use themed movable modal dialog, fix (c) year.
- * macosx/tkMacOSXEntry.c: take xOff/yOff of MacDrawable into account
- when computing locations/bounds to ensure correct posititioning when
- not drawing into intermediate pixmap.
+ * 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.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; disable broken QD stippling.
-
- * macosx/tkMacOSXMenu.c: large-scale rewrite of custom
- * macosx/tkMacOSXMenu.r (removed): MDEF and related code that
- * unix/Makefile.in: restores many longtime-MIA
- features to working order (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
+ 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
+ * 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
+ * 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
+ * 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
@@ -1046,13 +3810,13 @@
HiliteControl() by modern API; replace control mgr constants with
appearance mgr equivalents.
- * macosx/tkMacOSXSubwindows.c: use SetWindowBounds() API instead of
+ * 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
+ * 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
@@ -1064,7 +3828,7 @@
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.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
@@ -1092,51 +3856,50 @@
port; workaround GetWindowStructureWidths() Carbon bug (bogus results
for never-mapped floating windows).
- * macosx/tkMacOSXXStubs.c (TkMacOSXDisplayChanged): add maximal window
+ * 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/tkMacOSXBitmap.c: Fix macRoman encoding leak.
* macosx/tkMacOSXCursor.c:
- * macosx/tkMacOSXDebug.c (TkMacOSXCarbonEventToAscii): use static
+ * 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/tkMacOSXBitmap.c: Use more efficient QDSwapPort() instead of
* macosx/tkMacOSXButton.c: GetPort()/SetPort()/GetGWorld()/SetGWorld().
* macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXFont.c:
* macosx/tkMacOSXMenubutton.c:
* macosx/tkMacOSXScale.c:
* macosx/tkMacOSXScrlbr.c:
* macosx/tkMacOSXXStubs.c:
- * macosx/tkMacOSXColor.c: use kHIToolboxVersionNumber for runtime OS
+ * 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/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/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/tkMacOSXInit.c (TkpInit): Reorder initialization steps.
- * macosx/tkMacOSXKeyEvent.c: remove pre-10.2 support.
+ * macosx/tkMacOSXKeyEvent.c: Remove pre-10.2 support.
- * macosx/tkMacOSXMenus.c: remove now useless call to
+ * 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/tkMacOSXScale.c: Replace TrackControl() by modern
* macosx/tkMacOSXScrlbr.c: HandleControlClick() API (using new
TkMacOSXModifierState()).
- * macosx/tkMacOSXInt.h: move all constant #defines needed to
+ * 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:
@@ -1145,8 +3908,9 @@
* macosx/tkMacOSXMenus.c:
* macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXWm.c:
+ * macosx/ttkMacOSXTheme.c:
- * macosx/tkMacOSXInt.h: add ChkErr() macro to factor out
+ * 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
@@ -1171,91 +3935,273 @@
* macosx/tkMacOSXWm.c:
* macosx/tkMacOSXXStubs.c:
- * macosx/tkMacOSXSend.c: remove duplicate/unused declarations.
+ * macosx/tkMacOSXSend.c: Remove duplicate/unused declarations.
* macosx/tkMacOSXXStubs.c:
- * macosx/tkMacOSXDebug.c: const fixes.
+ * 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
+ * macosx/Wish-Info.plist.in: Add tcl document extensions/mime types and
LSMinimumSystemVersion, LSRequiresCarbon & NSAppleScriptEnabled keys.
- * macosx/tkMacOSXAETE.r: fix whitespace.
+ * 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/Makefile: fix/add copyright and license refs.
+ * 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/Makefile.in (dist): copy license.terms to dist macosx dir.
- * unix/configure.in: install license.terms into Tk.framework; fix tk
+ * unix/configure.in: Install license.terms into Tk.framework; fix tk
debug build detection.
- * unix/configure: autoconf-2.13
+ * 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.
- * 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].
+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
+ * 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().
- * macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol): add fix for
+ * 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.13
+ * 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.13
+ * 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.
- * library/tkfbox.tcl (::tk::IconList_Goto): avoid goto issues in
- empty dirs. [Bug 1662959]
+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.13
+ * 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.
-2007-01-30 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/README: Document new Wish.xcodeproj configurations; other
+ minor updates/corrections.
- * win/Makefile.in (install-private-headers): added target
+ * 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
- * unix/configure.in: and move (rather than duplicate) -isysroot flags
- from CFLAGS to CPPFLAGS to avoid errors about multiple -isysroot flags
- from some older gcc builds.
+ * 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>
- * unix/configure: autoconf-2.13
+ * win/makefile.vc: Properly build man2tcl.c for MSVC8.
-2006-01-19 Daniel Steffen <das@users.sourceforge.net>
+2007-01-19 Daniel Steffen <das@users.sourceforge.net>
- * unix/tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861]
+ * 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.13
+ * 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-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+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
@@ -1273,45 +4219,352 @@
* unix/tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch
flag succeeds before enabling 64bit build.
- * unix/configure: autoconf-2.13
+ * 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)
+ * 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.13 [Bug 1230558]
+ * 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]
+ * 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]
+ * 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
@@ -1319,10 +4572,10 @@
2006-11-01 Daniel Steffen <das@users.sourceforge.net>
- * macosx/tkMacOSXDebug.c: add TkMacOSX prefix to leftover macosx-private
- * macosx/tkMacOSXDebug.h: global symbols without Tk prefix; ifdef out
- * macosx/tkMacOSXEmbed.c: currently unused debug procs.
- * macosx/tkMacOSXEvent.c:
+ * 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:
@@ -1330,40 +4583,137 @@
2006-10-31 Pat Thoyts <patthoyts@users.sourceforge.net>
- * rules.vc: Fix bug #1582769 build with VC2003 and correct i386 arch.
+ * 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.4.15
+ * 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.13
+ * unix/configure: autoconf-2.59
* win/configure:
-2006-10-18 Pat Thoyts <patthoyts@users.sourceforge.net>
+2006-10-19 Pat Thoyts <patthoyts@users.sourceforge.net>
- *** 8.4.14 TAGGED FOR RELEASE ***
+ *** 8.5a5 TAGGED FOR RELEASE ***
- * win/nmakehlp.c: Ensure builds with VC6 without Platform SDK.
- * win/rules.vc: Pickup MACHINE from environment.
+ * 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-17 Don Porter <dgp@users.sourceforge.net>
+2006-10-18 Don Porter <dgp@users.sourceforge.net>
- * generic/tkPanedWindow.c: Cleaned up some code flagged by a
- * generic/tkText.c: `make checkexports` test.
- * generic/tkText.h
- * generic/tkTextTag.c:
+ * 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.4.14 release.
+ * 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/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.
@@ -1373,39 +4723,37 @@
* generic/tkCanvPoly.c (ConfigurePolygon): linewidth in gc even for
* generic/tkRectOval.c (ConfigureRectOval): fills (as it controls AA).
- * macosx/Makefile: don't redo prebinding of non-prebound binaires.
+ * 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: changes updated for 8.4.14 release.
+ * 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]
+ encoding conversion. Call ucs-2be "unicode" on big-endian systems.
+ [Bug 1122671]
-2006-09-27 Pat Thoyts <patthoyts@users.sourceforge.net>
+2006-09-27 Andreas Kupries <andreask@activestate.com>
- * win/makefile.vc: Support MSVC8 and AMD64 target. Also try using
- * win/rules.vc: sed to generate the manifest (cross-compile cannot
- * win/nmakehlp.c: execute tclsh). If no sed, use the tclsh exe.
-
-2006-09-25 Andreas Kupries <andreask@activestate.com>
-
- * generic/tkConsole.c: Complete reversal of the changes of Sep 22.
- * generic/tkMain.c: For compat reason the Tcl core will not change
- * generic/tkWindow.c: the registered version to include the patchlevel,
- * library/tk.tcl: making the changes to Tk unnecessary.
- * unix/configure:
- * unix/Makefile.in:
- * unix/tcl.m4:
- * win/configure:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/rules.vc:
- * win/tcl.m4:
+ * 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>
@@ -1422,16 +4770,16 @@
* win/rules.vc:
* win/tcl.m4:
-2006-09-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2006-09-20 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkImgBmap.c (ImgBmapPostscript): Use NULL instead of 0 as
- end-of-strings marker to Tcl_AppendResult; the difference matters on
- 64-bit machines. [Bug 1562528]
+ * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus with
+ images to avoid clipping bug. [Bug 1329198]
-2006-09-20 Jeff Hobbs <jeffh@ActiveState.com>
+2006-09-21 Donal K. Fellows <dkf@users.sf.net>
- * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus
- with images to avoid clipping bug. [Bug 1329198]
+ * 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>
@@ -1452,22 +4800,23 @@
2006-09-10 Daniel Steffen <das@users.sourceforge.net>
- * macosx/tkMacOSXColor.c (TkSetMacColor, TkpGetColor): use AppearanceMgr
+ * 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.
+ 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): change focus bindings to implement platform
- standard look for inactive text selections using this new color.
+ * library/text.tcl (aqua): remove focus bindings to set selection color
- * generic/tkTextBTree.c (TkTextIsElided): on TkAqua, don't show text
- * generic/tkTextDisp.c (GetStyle): selection when text widget
- * generic/tkText.c (TextEventProc): is in disabled state.
+ * 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 (Tk_TextCmd): fix bug leading to default text
+ * 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
@@ -1484,32 +4833,28 @@
* macosx/tkMacOSXMenu.c (DrawMenuEntryLabel): fix leak. [Bug 1554672]
- * macosx/Makefile: 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/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.
-
-2006-09-07 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkWindow.c: add #include "tclInt.h" now required due to use
- of tcl internal Tcl_CreateNamespace() in previous commit.
+ * unix/configure: autoconf-2.59
2006-09-06 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION
- * generic/tkInt.h: control of entry/text selection display
- * generic/tkText.c: based on focus to the Tcl level,
- * generic/tkTextBTree.c: controlled by ::tk::AlwaysShowSelection
- * generic/tkTextDisp.c: (boolean, private). [Bug 1553691]
- * generic/tkWindow.c:
- * library/tk.tcl
+ * 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:
-
- * generic/tkText.c (DeleteChars): backport of 8.5 text delete
- speedup that removes tags from deleted area first. [Bug 1456342]
+ * win/tkWinDefault.h:
2006-08-30 Jeff Hobbs <jeffh@ActiveState.com>
@@ -1528,33 +4873,44 @@
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.
+ 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.13
+ 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.
+ 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/tkMacOSXWm.c (WmAttrGetTitlePath): use HIWindow API on >=Tiger
* macosx/tkMacOSXMouseEvent.c (GenerateToolbarButtonEvent):
* macosx/tkMacOSXMenus.c (GenerateEditEvent):
- * macosx/tkMacOSXMenu.c (MenuSelectEvent): bzero XVirtualEvent structure
- before use to ensure all fields are initialized. [Bug 1542205]
+ * 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].
+ * macosx/tkMacOSXWm.c (WmAttributesCmd): correct OS X result for [wm
+ attributes $top].
2006-07-25 Daniel Steffen <das@users.sourceforge.net>
@@ -1566,14 +4922,16 @@
* 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]
+ 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".
+ 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
@@ -1582,15 +4940,24 @@
2006-07-20 Daniel Steffen <das@users.sourceforge.net>
* macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support
- 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.
+ * 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: enforce requirement of OSX 10.2 for TkAqua; move
- * unix/tcl.m4: Darwin specific checks & defines that are only
- relevant to the tcl build out of tcl.m4; restrict framework option to
- Darwin; cleanup quoting.
- * unix/configure: autoconf-2.13
-
+ * 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
@@ -1600,17 +4967,19 @@
* macosx/tkMacOSXMouseEvent.c:
* macosx/tkMacOSXWm.c:
+ * generic/tkImgGIF.c (ReadImage):
* macosx/tkMacOSXCursor.c (TkMacOSXCursor):
* macosx/tkMacOSXDebug.c (TkMacOSXGetNamedDebugSymbol):
- * macosx/tkMacOSXInit.c (Map): fix signed-with-unsigned comparison and
- other warnings from gcc4 -Wextra.
+ * 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.
+ * 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>
@@ -1618,30 +4987,20 @@
2006-06-21 Jeff Hobbs <jeffh@ActiveState.com>
- * library/bgerror.tcl (::tk::dialog::error::bgerror): remove a
- couple of unnecessary hardcoded options
-
-2006-06-15 Don Porter <dgp@users.sourceforge.net>
-
- * changes: changes to start prep for an 8.4.14 release.
-
-2006-06-15 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Sync with tcl to enable building with
- * win/rules.vc: VC8 (VS2005 C compiler)
- * win/nmakehlp.c:
+ * 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].
+ * 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
+ * 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
@@ -1650,44 +5009,49 @@
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.
+ * generic/tkMain.c: Added Tcl_Preserve() call on the master interp
+ as crash protection against any Tcl_DeleteInterp() call that might
+ happen.
-2006-06-05 Don Porter <dgp@users.sourceforge.net>
+2006-06-01 Don Porter <dgp@users.sourceforge.net>
- * generic/tkInt.h: Thread safety for the data structures of
- * generic/tkConsole.c: the wish [console]. [Bug 1188340].
-
-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].
+ * 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]
+ 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]
+ * 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]
+ * 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>
@@ -1705,30 +5069,31 @@
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]
+ * 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/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]
+ 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/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/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.
@@ -1742,13 +5107,13 @@
2006-05-04 Don Porter <dgp@users.sourceforge.net>
- * README: Bump version number to 8.4.14
+ * README: Bump version number to 8.5a5
* generic/tk.h:
* unix/configure.in:
* unix/tk.spec:
* win/configure.in:
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
* win/configure:
2006-04-28 Daniel Steffen <das@users.sourceforge.net>
@@ -1767,64 +5132,56 @@
window-local pointer position.
* macosx/tkMacOSXInt.h: use improvements above to avoid calls to
- * macosx/tkMacOSXKeyEvent.c: GlobalToLocal() when the current port might
- * macosx/tkMacOSXMenu.c: not be set correctly. May fix [Bug 1243318]
- * macosx/tkMacOSXMenus.c:
+ * 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/tkMacOSXCarbonEvents.c: sync with HEAD
- * macosx/tkMacOSXDebug.c:
- * macosx/tkMacOSXDebug.h:
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXEvent.c:
+ * macosx/tkMacOSXDebug.h: sync #includes with core-8-4-branch.
* macosx/tkMacOSXEvent.h:
* macosx/tkMacOSXFont.h:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXMenu.c:
- * macosx/tkMacOSXMenubutton.c:
- * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXSend.c:
- * macosx/tkMacOSXTest.c:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXWm.c:
-2006-04-25 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+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-22 Daniel Steffen <das@users.sourceforge.net>
+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/tkMacOSXEmbed.c:
* macosx/tkMacOSXWm.c:
* tests/constraints.tcl:
- * tests/wm.test: sync with 2006-04-18 commit to HEAD. (darley)
+ * tests/wm.test: fix to 'wm attributes' test for TkAqua
-2006-04-12 Don Porter <dgp@users.sourceforge.net>
+2006-04-11 Peter Spjuth <peter.spjuth@space.se>
- *** 8.4.13 TAGGED FOR RELEASE ***
+ * 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]
- * changes: Updates for next RC.
-
-2006-04-11 Jeff Hobbs <jeffh@ActiveState.com>
-
- * changes: update for bug fix.
-
- * generic/tkBind.c (Tk_BindEvent, ChangeScreen): replace
- Tcl_GlobalEval with more efficient Tcl_EvalEx.
+2006-04-11 Don Porter <dgp@users.sourceforge.net>
- * win/tkWinEmbed.c (TkpGetOtherWindow): do not panic if no window
- * win/tkWinWm.c (UpdateGeometryInfo): is found - handle it in
- * unix/tkUnixEmbed.c (TkpGetOtherWindow): the caller. [Bug 1212056]
- * unix/tkUnixWm.c (Tk_CoordsToWindow, UpdateGeometryInfo):
+ * 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>
@@ -1844,14 +5201,31 @@
* 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 Don Porter <dgp@users.sourceforge.net>
+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>
- * changes: Updates for next RC.
+ * 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>
@@ -1871,81 +5245,138 @@
* 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>
+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.
+ * 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]
+ * 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.13
+ * 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.
+ (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.
- * generic/tkTextDisp.c (TkTextPixelIndex): Don't segfault on full
- -elide text. [Bug 1442102]
+ * tests/textWind.test (textWind-10.6.1): prevent infinite update loop
+ in case of test failure.
- * win/tkWinX.c (TkWinXInit): init default keyboard charset
- correctly. [Bug 1374119] (pajas)
+ * tests/wm.test (wm-attributes-1.2.4): correct expected result.
- * generic/tkText.c (DumpLine): stop dumping if we detect that the
- text widget state has changed while dumping. [Bug 1414171]
- (InsertChars, DeleteChars): fix undo with space-based path.
- * tests/text.test (text-25.14): [Bug 1452419]
+ * tests/grid.test: fix segfault on empty or "all" index list
+ * generic/tkGrid.c (GridRowColumnConfigureCommand): [Bug 1422430]
- * tests/grid.test: fix segfault on empty 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/tkWindow.c (DeleteWindowsExitProc): added comments
- * generic/tkOption.c (TkOptionDeadWindow): handle
- OptionThreadExitProc being called before DeleteWindowsExitProc.
+ * 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]
+ those color names. [Bug 917433]
2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkWindow.c (CreateTopLevelWindow): use thread exit
- handler for DeleteWindowsExitProc.
+ * unix/tcl.m4, win/tcl.m4: []-quote AC_DEFUN functions.
-2006-03-28 Pat Thoyts <patthoyts@users.sourceforge.net>
+2006-03-26 Vince Darley <vincentdarley@users.sourceforge.net>
- * win/makefile.vc: Avoid pipe problems on win98.
+ * 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 Jeff Hobbs <jeffh@ActiveState.com>
+2006-03-28 Daniel Steffen <das@users.sourceforge.net>
- * win/configure, win/tcl.m4: define MACHINE for gcc builds as well.
- Needed by Tk for manifest generation.
+ * macosx/Wish.xcode/default.pbxuser: add '-singleproc 1' cli arg to
+ * macosx/Wish.xcodeproj/default.pbxuser: tktest to ease test debugging.
-2006-03-28 Daniel Steffen <das@users.sourceforge.net>
+ * 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:
- * generic/tkFont.h: added prototype for TkFontGetFirstTextLayout()
- needed by tkMacOSXButton.c and tkMacOSXMenubutton.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: sync whitespace, comments & minor
- * macosx/tkMacOSXCarbonEvents.c: changes with HEAD.
+ * macosx/tkMacOSXBitmap.c: #includes of tk and carbon headers.
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXCarbonEvents.c:
* macosx/tkMacOSXClipboard.c:
* macosx/tkMacOSXColor.c:
* macosx/tkMacOSXConfig.c:
@@ -1956,8 +5387,7 @@
* macosx/tkMacOSXEntry.c:
* macosx/tkMacOSXEvent.c:
* macosx/tkMacOSXEvent.h:
- * macosx/tkMacOSXFont.c:
- * macosx/tkMacOSXFont.h (new file):
+ * macosx/tkMacOSXFont.h:
* macosx/tkMacOSXHLEvents.c:
* macosx/tkMacOSXInit.c:
* macosx/tkMacOSXInt.h:
@@ -1967,55 +5397,99 @@
* macosx/tkMacOSXMenubutton.c:
* macosx/tkMacOSXMenus.c:
* macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXNotify.c:
* 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:
-2006-03-27 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2006-03-23 Reinhard Max <max@tclers.tk>
- * generic/tkImgGIF.c (FileReadGIF): Stop crashes when the first GIF
- frame does not define the overall size of the image. [Bug 1458234]
+ * 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.
+ * 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.13
+ error on intel macs. [Bug 1415789]
+ * unix/configure: autoconf-2.59
-2006-03-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2006-03-20 Don Porter <dgp@users.sourceforge.net>
- * generic/tkUndo.c (TkUndoSetDepth): Fix a crash in the undo stack
- code. [Bug 1380427, Patch 1391939] Thanks to <lz_ufo@tin.it> for
- reporting and Ludwig Callewaert for the fix.
+ * 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: bug #1451587: avoid using abbreviated
- * library/palette.tcl: sub-commands in core scripts as this can
- * library/scale.tcl: cause problems with mega-widget libraries
- * library/scrlbar.tcl: like snit.
+ * 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 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+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]
+ 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
@@ -2023,7 +5497,7 @@
This should speed up many photo-to-photo copies, keeping the cost of
the alpha channel down.
-2006-03-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+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
@@ -2032,65 +5506,54 @@
2006-03-13 Don Porter <dgp@users.sourceforge.net>
- * tests/scrollbar.test: Corrected several broken calls to [testmetrics]
+ * 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.
+ * 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
- * macosx/tkMacOSXPort.h: errno, and errno.h. Standardized
- * macosx/tkMacOSXWm.c: the logic for using header files from
- * macosx/tkMacOSXWm.h: the compat directory. Thanks Joe
- * unix/tkUnixPort.h: English for the patch. [Patch 1445404]
+ * 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-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2006-03-08 Don Porter <dgp@users.sourceforge.net>
- * library/bgerror.tcl (::tk::dialog::error::bgerror): Truncated error
- details were getting lost, leading to unreadable error messages.
+ * 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.
-2006-03-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * 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-07 Don Porter <dgp@users.sourceforge.net>
-
- * READNE: Bump version number to 8.4.13 and update
- * changes: changes to start prep for an 8.4.13 release.
- * generic/tk.h:
- * unix/configure{.in}:
- * unix/tk.spec:
- * win/configure{.in}:
-
2006-03-02 Jeff Hobbs <jeffh@ActiveState.com>
- * win/Makefile.in: convert _NATIVE paths to use / to avoid ".\"
- path-as-escape issue.
-
- * unix/tcl.m4, win/tcl.m4: []-quote ac_defun functions.
-
- * 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-03-02 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * unix/tcl.m4: Fix for tk bug #1334613 to sort out shared library
- * unix/configure: issues on NetBSD. Regenerated configure script.
+ * 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]
+ * 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>
@@ -2103,28 +5566,21 @@
* generic/tk.h: move TkAqua specific REDO_KEYSYM_LOOKUP define
* macosx/tkMacOSXPort.h: out of tk.h into platform header.
-2006-01-25 Don Porter <dgp@users.sourceforge.net>
+2006-01-31 Donal K. Fellows <dkf@users.sf.net>
- * library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759]
- * library/button.tcl:
+ * 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/clrpick.tcl:
* library/comdlg.tcl:
* library/console.tcl:
* library/dialog.tcl:
- * library/entry.tcl:
* library/focus.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
* library/msgbox.tcl:
* library/palette.tcl:
- * library/panedwindow.tcl:
- * library/safetk.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/spinbox.tcl:
- * library/tearoff.tcl:
- * library/text.tcl:
* library/tk.tcl:
* library/tkfbox.tcl:
* library/xmfbox.tcl:
@@ -2136,16 +5592,33 @@
2006-01-20 Joe English <jenglish@users.sourceforge.net>
- * generic/tkEvent.c, unix/tkUnixEvent.c: XIM fixes
- [See #905830, patch tk84-xim-fixes.patch].
- + Revert 2005-12-05 patch disabling XIM when SCIM in use;
- + Make sure all X events get passed to XFilterEvent,
+ * 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-10 Daniel Steffen <das@users.sourceforge.net>
+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
- * macosx/tkMacOSXDraw.c: re-added inclusion of tclInt.h to allow access
- * macosx/tkMacOSXFont.c: to 8.4-internal Tcl_CreateNamespace().
+ * 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
@@ -2156,21 +5629,37 @@
* 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/Makefile: add 'wish8.x' symlink to SYMROOT.
+ * 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.
+ * 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
+ * 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
@@ -2182,108 +5671,107 @@
* unix/tcl.m4, unix/configure: Fix sh quoting error reported in
bash-3.1+ [Bug 1377619] (schafer)
-2005-12-08 Daniel Steffen <das@users.sourceforge.net>
+2005-12-09 Mo DeJong <mdejong@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:
- * macosx/tkMacOSXWindowEvent.c:
- * macosx/tkMacOSXXStubs.c: sync comments/whitespace with HEAD.
+ * 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:
-2005-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c: regen.
- *** 8.4.12 TAGGED FOR RELEASE ***
+2005-12-08 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkOldConfig.c (Tk_ConfigureWidget): fix the handling of
- TK_CONFIG_OPTION_SPECIFIED to be flagged appropriately in original
- Tk_ConfigSpec. This is *not* thread safe, but will be retained
- for 8.4.x and left out of 8.5.x. [Bug 749908]
+ * 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
-2005-12-05 Reinhard Max <max@tclers.tk>
+ * 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
- * 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.
+ * generic/tkTextTag.c (TkTextTagCmd): use correct arraySize for peered
+ text widgets in [$text tag names]. [Bugs 1375069, 1374935]
-2005-12-04 Daniel Steffen <das@users.sourceforge.net>
+2005-12-08 Daniel Steffen <das@users.sourceforge.net>
- * mac/README: add note that mac classic port is no longer supported.
+ * 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]
-2005-12-01 Don Porter <dgp@users.sourceforge.net>
+ * macosx/tkMacOSXInt.h: sync comments with core-8-4-branch.
- * changes: Update changes for 8.4.12 release
+2005-12-07 Jeff Hobbs <jeffh@ActiveState.com>
- * mac/tkMacWm.c: Restored consistent error checking and
- * macosx/tkMacOSXWm.c: messages among different platform's
- * tests/wm.test: [wm grid] commands. [Bug 1323972].
- * win/tkWinWm.c:
+ * unix/tkUnixEvent.c (OpenIM): remove extraneous const
-2005-12-01 Kevin Kenny <kennykb@acm.org>
+2005-12-06 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * win/makefile.vc: restored buildability.
+ * doc/ConfigWidg.3 (TK_CONFIG_OPTION_SPECIFIED): Mentioned that the
+ flag is deprecated because it is not thread-safe.
-2005-12-01 Jeff Hobbs <jeffh@ActiveState.com>
+2005-12-05 Reinhard Max <max@suse.de>
- * library/menu.tcl (::tk::PostOverPoint): correct menu post near
- bottom of screen on Windows. [Bug 1353416]
+ * 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.
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents): added newly
- registered kEventAppAvailableWindowBoundsChanged to debugging code.
-
2005-11-30 Jeff Hobbs <jeffh@ActiveState.com>
- * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect
- before rewrapping. [Bug 1086049]
+ * win/tkWinWm.c (WmAttributesCmd): set (no)topmost window aspect before
+ rewrapping. [Bug 1086049]
- * generic/tkImgGIF.c: cast calls to block_out
-
- * win/Makefile.in: place TCL_BIN_DIR first in PATH for targets to
- get Tcl built dll first.
-
- * tests/scrollbar.test (6.22): fix rounding-error sensitive test
+ * 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.
- * tests/textWind.test: use "Courier -12" on all platforms.
- Reduces Windows XP test errors in that file from 9 to 2 (13.2 and
- 13.9 still off-by-one pixel).
+ * doc/checkbutton.n: fix -selectcolor docs. [Bug 1083838]
- * win/tkWinWm.c (UpdateWrapper): Don't install frame menu on dead
- window. Backport of 1233635
+ * generic/tkImgGIF.c: cast calls to blockOut
- * generic/tkEvent.c: fix handling of ClientMessage handlers.
- [Bug 1289565 983920]
+ * 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).
- * macosx/tkMacOSXEvent.h: define
- kEventAppAvailableWindowBoundsChanged for OS X < 10.3.
+ * 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]
-
- * macosx/tkMacOSXXStubs.c (TkpOpenDisplay, TkMacOSXDisplayChanged):
- * macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
- * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessApplicationEvent):
- * macosx/tkMacOSXInt.h: Trap kEventAppAvailableWindowBoundsChanged
- event to watch for change in display size and adjust internal
- state appropriately.
-
- * 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]
- * win/configure.in:
- * win/wish.exe.manifest.in (new): manifest must map in MACHINE
- * win/rc/wish.exe.manifest (removed): and VERSION to be correct.
+ * library/console.tcl (::tk::ConsoleInit): improve work-around to avoid
+ '% ' from tclMain.c. [Bug 1252259]
2005-11-27 Daniel Steffen <das@users.sourceforge.net>
@@ -2293,18 +5781,19 @@
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 tk/unix/tcl.m4, sync whitespace with HEAD.
+ 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
+ * 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:
@@ -2312,7 +5801,7 @@
* 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
+ 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
@@ -2330,8 +5819,8 @@
* macosx/tkMacOSXMenu.c (TkpNewMenu):
* macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
- * macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to modern
- utf8 aware menu manager API, remove obsolete code, add error handling.
+ * 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:
@@ -2342,152 +5831,315 @@
* macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
executed.
- * generic/tk.h: add/correct location of version numbers in macosx
- files.
+ * 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 file):
+ * macosx/Wish.pbproj/default.pbxuser (new):
* macosx/Wish.pbproj/jingham.pbxuser:
- * macosx/Wish.pbproj/project.pbxproj: sync with HEAD.
-
+ * 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, sync with HEAD, document
+ * macosx/README: clarification/cleanup, document new Xcode projects and
universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).
- * macosx/Makefile: add support for reusing configure cache, build
- target fixes.
+ * 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/tkMacOSXXStubs.c:
+ * macosx/tkMacOSXSend.c:
* macosx/tkMacOSXSubwindows.c:
- * xlib/xgc.c: declare functions and globals used only in own file as
- static, #ifdef out a few Xlib and aqua functions that are never called
- (sync with HEAD).
+ * 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:
- * generic/tkInt.decls: correct signature of TkMacOSXHandleMenuSelect,
- add XSync to aqua Xlib stubs.
+ * 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:
- * generic/tkTextBTree.c:
* macosx/tkMacOSXInit.c:
* macosx/tkMacOSXKeyEvent.c:
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.
* macosx/tkMacOSXNotify.c:
- * macosx/tkMacOSXTest.c: sync with HEAD.
+ * macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.
+ * generic/tkIntDecls.h:
* generic/tkIntPlatDecls.h:
* generic/tkIntXlibDecls.h:
* generic/tkStubInit.c:
- * unix/configure: regen.
+ * unix/configure:
+ * unix/tkConfig.h.in: regen.
-2005-11-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-11-22 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * generic/tkFont.c (ParseFontNameObj, ConfigAttributesObj): Allow
- these functions to work with a NULL interp by making them check when
+ * 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]
- * unix/tkUnixSelect.c (SelCvtToX, SelCvtFromX): Backport of fixes for
- * generic/tkSelect.c (TkSelDefaultSelection): "spaces in atom names"
- * tests/select.test (select-9.5): problems. [Bug 1353414]
+ * 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]
- * 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>
-2005-11-16 Don Porter <dgp@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]
- * changes: Update changes for 8.4.12 release
+2005-11-15 Joe English <jenglish@users.sourceforge.net>
- * README: Bump version number to 8.4.12
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
+ * unix/tkUnixWm.c, tests/unixWm.test, doc/wm.n: Support for [wm
+ attributes] on X11. [TIP#231, Patch 1062022]
- * unix/configure: autoconf
- * win/configure:
+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>
-2005-11-16 Vince Darley <vincentdarley@users.sourceforge.net>
+ * generic/tkSelect.c (TkSelDefaultSelection): Test select-9.5
+ highlighted further brokenness in this function.
- * doc/text.n: clarify left to right interpretation of index
- modifiers, including the fact that validation occurs after
- each step [Bug 1357575]
+2005-11-13 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-2005-11-06 Pat Thoyts <patthoyts@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/tcl.m4: Add missing LIBS for OpenBSD shared libary
+ * 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-10-18 Don Porter <dgp@users.sourceforge.net>
+2005-11-10 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * 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/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
+ * macosx/tkMacOSXScrlbr.c (UpdateControlValues): check geomMgrPtr is
+ valid before checking type
-2005-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+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>
- * generic/tkInt.h: add MODULE_SCOPE and WORDS_BIGENDIAN checks
- that will work with OS X universal binary compiles. (steffen)
+ * 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)
-2005-10-10 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)
+
+ * 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]
- * tests/winfo.test: Wait until child window is visible
- * tests/wm.test: Modified test to match actual error output.
+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]
+ * 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).
- * win/tkWinDialog.c (ChooseDirectoryValidateProc): reset stored
- path to "" if it doesn't exist and -mustexist is true. [Bug 1309218]
+ * 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-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+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.
+ 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/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().
@@ -2496,14 +6148,20 @@
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.
+ 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:
@@ -2519,13 +6177,26 @@
* macosx/tkMacOSXWm.c:
* unix/configure.in: define TK_MAC_DEBUG on aqua when symbols enabled.
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
+ * unix/tkConfig.h.in: autoheader-2.59
- * library/listbox.tcl: corrected comments.
+ * 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
@@ -2533,38 +6204,68 @@
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]
+ * 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-16 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-08-20 Joe Mistachkin <joe@mistachkin.com>
- * generic/tkOldConfig.c (Tk_ConfigureWidget, Tk_ConfigureInfo):
- (Tk_ConfigureValue, DeleteSpecCacheTable): Keep per-interpreter (and
- hence per-thread) copies of all the Tk_ConfigSpec tables so that
- Tk_Uids do not leak across threads. [Bug 749908]
+ * win/tkWinX.c: Fixed bad cast. [Bug 1216006]
-2005-08-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-08-18 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * generic/tkCanvLine.c, generic/tkCanvPoly.c, generic/tkCanvText.c:
- * generic/tkCanvas.c, generic/tkConfig.c, generic/tkFocus.c:
- * generic/tkFrame.c, generic/tkGrid.c, generic/tkImgPhoto.c:
- * generic/tkPack.c, generic/tkPanedWindow.c: Don't pass size_t
- arguments to Tcl_GetStringFromObj, even with casting; it's not
- portable to 64-bit systems. [Bug 1252702]
+ * doc/GetFont.3: Reworded to reflect the truth. [Bug 1151523]
-2005-08-09 Daniel Steffen <das@users.sourceforge.net>
+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.
- * macosx/tkMacOSXCarbonEvents.c (new): moved carbon events code into
- * macosx/tkMacOSXHLEvents.c: new file like on HEAD,
- * macosx/tkMacOSXInit.c (TkpInit): initialize carbon event handlers
- * macosx/tkMacOSXInt.h: in TkpInit(), add new source
- * unix/Makefile.in: file to Makefile.in.
+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
@@ -2575,18 +6276,19 @@
* macosx/tkMacOSXEvent.h: made TkMacOSXProcessEvent() non-static, added
* macosx/tkMacOSXEvent.c: new interp field to TkMacOSXEvent struct for
- use by app event handler.
+ 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.
+ 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
@@ -2597,13 +6299,13 @@
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
+ * 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/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
@@ -2648,132 +6350,88 @@
* macosx/tkMacOSXWindowEvent.c:
* macosx/tkMacOSXWm.h:
- * macosx/tkMacOSXEmbed.c: replaced all uses of panic() with Tcl_Panic()
- * macosx/tkMacOSXFont.c: (sync with HEAD).
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXSubwindows.c:
+ * 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/tkMacOSXXStubs.c:
+ * macosx/tkMacOSXMouseEvent.c:
- * macosx/tkMacOSXInt.h: sync with HEAD changes of 2005-03-14.
+ * 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/tclets.r (removed): sync with HEAD.
+ * macosx/tkMacOSXButton.c: sync with core-8-4-branch.
+ * macosx/tkMacOSXEntry.c:
* macosx/tkMacOSXScale.c:
- * macosx/tkMacOSXPort.h:
-
-2005-07-30 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in (html): reverted/amended changes of 2005-07-24
- that broke TkAqua 'make install'; added BUILD_HTML_FLAGS
- optional var like in tcl/unix/Makefile.in.
-2005-07-28 Jeff Hobbs <jeffh@ActiveState.com>
+ * library/demos/menu.tcl: removed errant '}'.
- * macosx/tkMacOSXDraw.c (XDrawLines, XDrawSegments): correct
- drawing of CoordModePrevious style (each point based on last).
- Exposed by tktable -drawmode fast.
+2005-08-04 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * library/bgerror.tcl (::tk::dialog::error::bgerror): use
- zoomDocProc instead of dBoxProc for bgerror dialog
+ * doc/clipboard.n: Add example demonstrating custom types of clipboard
+ data.
- * macosx/tkMacOSXWm.c (TkpWmSetState): add IsWindowCollapsed check
- before calling CollapseWindow.
- (WmResizableCmd): adjust kWindow*Attributes according to resize
- parameters.
+2005-07-25 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): handle
- inToolbarButton action (generates <<ToolbarButton>> virtual event)
- and correct inCollapseBox to properly track the event (waiting for
- buttonrelease) and generate the Unmap event (Map event on
- redisplay still missing).
+ * library/*.tcl: Updated to use more 8.4 and 8.5 features as part of
+ resolving [Patch 1237759].
-2005-07-27 Jeff Hobbs <jeffh@ActiveState.com>
+2005-07-22 Mo DeJong <mdejong@users.sourceforge.net>
- * generic/tkFrame.c (DisplayFrame):
- * generic/tkInt.decls: add TkpDrawFrame to allow for
- * generic/tkIntDecls.h: platform-specific drawing into the frame/
- * generic/tkStubInit.c: toplevel area. Currently only differs on
- * generic/tkFrame.c: OS X (Aqua), which will draw a themed bg
- * win/tkWinDraw.c: if tk::mac::useThemedToplevel == 1.
- * unix/tkUnixDraw.c: Normal frames left alone until we can
- * mac/tkMacDraw.c: better factor out frame drawing to be
- * macosx/tkMacOSXDraw.c:widget-specific.
+ * 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]
- * generic/tkInt.h: Swap TkUnsupported1Cmd for TkUnsupported1ObjCmd.
- * generic/tkWindow.c: Ditto. (neil madden)
- * macosx/tkMacOSXInt.h: Added TkMacOSXWindowClass decl
- * macosx/tkMacOSXWm.c (TkMacOSXWinStyle) New function.
- (TkUnsupported1ObjCmd): New function, replaces the un-objectified
- version of the command, recognizes more classes and attributes.
- (TkMacOSXWindowClass): private function to return OS X class of a
- Tk window.
- * macosx/tkMacOSXSubwindows.c (XMapWindow, XUnmapWindow):
- recognize special show/hide functions for sheets
-
-2005-07-24 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Subst TCLSH_PROG and
- BUILD_TCLSH into Makefile. Rework html
- target so that it depends on the tclsh
- installed on the system PATH.
- * unix/configure: Regen.
- * unix/configure.in: Invoke SC_PROG_TCLSH
- and SC_BUILD_TCLSH and subst into Makefile.
- * unix/tcl.m4: Update from Tcl.
- * win/Makefile.in: Subst TCLSH_PROG and
- BUILD_TCLSH into Makefile. Rework winhelp
- target so that it depends on the tclsh
- installed on the system PATH.
- * win/configure: Regen.
- * win/configure.in: Invoke SC_BUILD_TCLSH
- and subst into Makefile.
- * win/tcl.m4: Update from Tcl.
- [Tcl patch 1244153]
+2005-07-21 Jeff Hobbs <jeffh@ActiveState.com>
-2005-07-21 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): corrected if
+ expression error (use of = instead of ==).
- * unix/configure, unix/tcl.m4: sync'ed to Tcl's tcl.m4
+2005-07-18 Vince Darley <vincentdarley@users.sourceforge.net>
- * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): set
- oldWidth to avoid warning
+ * generic/tkTextMark.c: fix to segfault in "mark prev"
+ * tests/textIndex.test: [Bug 1240221]
- * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
- corrected if expression error (use of = instead of ==)
+ * tests/textWind.test: make test more robust to avoid infinite loop
-2005-07-06 Jeff Hobbs <jeffh@ActiveState.com>
+2005-07-06 Jeff Hobbs <jeffh@ActiveState.com>
* doc/getOpenFile.n: correct -multiple docs (takes boolean)
-2005-06-25 Daniel Steffen <das@users.sourceforge.net>
+2005-07-05 Don Porter <dgp@users.sourceforge.net>
- *** 8.4.11 TAGGED FOR RELEASE ***
-
- * library/demos/menu.tcl: removed errant '}'.
+ * unix/Makefile.in: Purged use of TCLTESTARGS. [RFE 1161550]
2005-06-23 Daniel Steffen <das@users.sourceforge.net>
- * generic/tkConsole.c: backport fix for bug 756840 & sync whitespace
- changes from HEAD.
-
* 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]
- * unix/Makefile.in (install-private-headers): rewrite tkPort.h when
- installing private headers to remove ../unix relative #include path to
- tkUnixPort.h (which is incorrect at the installed location).
-
-2005-06-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-06-21 Donal K. Fellows <dkf@users.sf.net>
* doc/GetBitmap.3: Fix silly error in SYNOPSIS. [Bug 1224983]
-2005-06-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-06-19 Donal K. Fellows <dkf@users.sf.net>
- * generic/tkImgGIF.c (mInit,Mgetc,Fread): Stop anyone from reading
- off the end of a buffer.
+ * 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>
@@ -2783,100 +6441,118 @@
* 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.13
+ * unix/configure: autoconf-2.59
-2005-06-18 Don Porter <dgp@users.sourceforge.net>
+2005-06-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * changes: Update changes for 8.4.11 release
+ Bump patchlevel to a4 to distinguish from a3 release.
- * README: Bump version number to 8.4.11
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproc:
- * unix/configure.in:
- * win/configure.in:
-
- * unix/configure.in: Updated LOCALES to cover all msgs catalogs.
+2005-06-04 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/configure: autoconf
- * win/configure:
+ *** 8.5a3 TAGGED FOR RELEASE ***
-2005-06-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+2005-06-02 Jim Ingham <jingham@apple.com>
- * generic/tkCanvas.c (SearchUids): Move all global data into
- protected storage to stop cross-thread issues. [Bug 1114977]
+ * generic/tkEvent.c (InvokeFocusHandlers): On Mac OS X the scrollwheel
+ events are sent to the window under the mouse, not to the focus window
-2005-06-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ Another patch from M. Kirkham.
- * generic/tkConsole.c (Tk_CreateConsoleWindow, TkConsolePrint):
- Transmit the ConsoleInfo through AssocData, so renaming [console]
- won't make things break. [Bug 1016385]
+ * 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>
- *** 8.4.10 TAGGED FOR RELEASE ***
-
* macosx/Makefile: fixed 'embedded' target.
-2005-06-02 Jim Ingham <jingham@apple.com>
+2005-06-02 Reinhard Max <max@suse.de>
- Another patch from M. Kirkham.
+ * 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.
- * 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-01 Jeff Hobbs <jeffh@ActiveState.com>
-2005-06-02 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.
- * changes: update for 8.4.10 release (porter)
+ * win/tkWinX.c (Tk_ResetUserInactiveTime): cast to squelch compiler
+ warning.
-2005-05-31 Mo DeJong <mdejong@users.sourceforge.net>
+2005-05-31 Reinhard Max <max@suse.de>
- * 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
- diplay. The code now ignores toplevels that have a display
- that does not match the display of the parent window.
- [Bug 1152809]
+ * 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>
+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/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]
+ * 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.
+ * 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/Wish.pbproj/project.pbxproj: added missing FRAMEWORK defines
+ * 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.
- * unix/configure.in: skip X11 configure checks when building tk_aqua.
- * unix/configure: autoconf-2.13
+ * generic/tkDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c: ran missing 'make genstubs' for TIP245 changes
+ to tk.decls
-2005-05-27 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use symbolic
+ constant argument in call to UpdateSystemActivity();
- * README: Bumped patchlevel to 8.4.10
- * generic/tk.h:
* macosx/Wish.pbproj/project.pbxproj:
- * unix/configure, unix/configure.in, unix/tk.spec:
- * win/configure, win/configure.in:
+ * 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>
-2005-05-27 Todd Helfter <tmh@users.sourceforge.net>
+ * 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>
@@ -2884,25 +6560,26 @@
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/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
+ * 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.13
+ * 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>
-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.
- * unix/configure, unix/configure.in: ensure false Tcl.framework is
- only created with --enable-framework
+2005-05-23 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/Makefile.in (install-libraries): protect possible empty
- list in for with list= trick for older shells.
+ * generic/tkFileFilter.c (FreeGlobPatterns): s/null/NULL/
2005-05-24 Daniel Steffen <das@users.sourceforge.net>
@@ -2915,10 +6592,10 @@
* unix/Makefile.in:
* unix/configure.in:
* unix/tcl.m4:
- * unix/tkUnixInit.c: moved all Darwin framework and TkAqua build
+ * 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
+ 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
@@ -2926,34 +6603,46 @@
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.
+ 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 segment of the library or executable at link time and
+ __tk_rsrc MachO section of the library or executable at link time and
extracted into a temporary location at initialization.
- * unix/configure: autoconf-2.13
+ * 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-15 Jim Ingham <jingham@apple.com>
+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. [Tk Bug 1012852]
+ * 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. [Tk Bug 1202181]
+ * 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.
- [Tk Bug 1202223]
+ 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>
@@ -2962,13 +6651,20 @@
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]
+ 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:
@@ -2982,23 +6678,40 @@
* macosx/tkMacOSXXStubs.c: fixed gcc 4.0 warnings.
* unix/tcl.m4: sync with tcl
- * unix/configure: autoconf-2.13
+ * unix/configure: autoconf-2.59
-2005-05-10 Vince Darley <vincentdarley@users.sourceforge.net>
+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]
+ * 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>
-2005-05-06 Jeff Hobbs <jeffh@ActiveState.com>
+ * 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
- * unix/tcl.m4: correct Solaris 10 (5.10) check and add support for
+ * 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: syncd with tclUnixNotfy.c changes since
+ * 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.
@@ -3006,10093 +6719,404 @@
* 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.
+ * 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.
- (SC_TCL_64BIT_FLAGS): fixed 'checking for off64_t' message output.
-
- * unix/configure: autoconf-2.13
-
-2005-04-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to
- avoid possible segv. Minimal fix for [Bug 1122671]
-
- * 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.13
-
-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-24 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
- TkpDrawEntryBorderAndFocus and TkpDrawSpinboxButtons. 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.
-
- * xlib/xgc.c (XCreateGC): Set the default linewidth to 1, not
- 0. Some extensions seem to expect this.
-
-2005-03-15 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * unix/tcl.m4: Updated for OpenBSD and regenerated the configure
- * unix/configure: script
-
-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-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-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (FontMapLoadPage): swap decl of char arrays to
- avoid aligment issues in Tcl_UtfToExternal. [Bug 1122671]
-
- * unix/configure, unix/configure.in: add AC_C_BIGENDIAN check
- which defines WORDS_BIGENDIAN on BE machines.
-
-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-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
- (DisplayBitmap): remove unused fg/bgColor refs
-
-2005-02-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in: remove SHLIB_LD_FLAGS (only for AIX, inlined
- * unix/tcl.m4: into SHLIB_LD). Combine AIX-* and AIX-5
- * unix/configure: branches in SC_CONFIG_CFLAGS.
- Correct gcc builds for AIX-4+ and HP-UX-11.
-
-2005-01-31 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/msgs/es_ES.msg: Added more localization for Spanish
- Spanish. [Bug 1111213]
-
-2005-01-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure, unix/tcl.m4: add solaris 64-bit gcc build
- support. [Bug 1021871]
-
-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.13
-
-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-14 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixWm.c: Sync with CVS HEAD (r1.47):
- Fixes: #959973 "wm title bug" (support Unicode titles)
- Fixes: #742882 "Potential division by zero in gridded wm geometry"
- Use Tcl_GetTime instead of TclpGetTime [#874745]
- Use Tcl_Panic() instead of "panic" [#865264]
- Fixes: #632816 "cannot remove transient"
- Fixes: #568861 "Fix for wm minsize and maxsize commands"
- * tests/unixWm.test, tests/wm.test: Updated test suite for
- #632816 (unixWm-37.3, unixWm-37.4, wm-grid-1.11, wm-grid-1.12)
- and #742882 (unixWm-20.9, unixWm-20.11).
-
-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-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).
-
-2004-12-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tcl.m4, win/configure: update MSVC CFLAGS_OPT to -O2, remove
- -Gs (included in -O2) and -GD (outdated). Use "link -lib" instead
- of "lib" binary and remove -YX for MSVC7 portability. Add
- -fomit-frame-pointer for gcc OPT compiles. [Bug 1092952, 1091967]
-
-2004-12-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/panedwindow.n: Fix silly typo. [Bug 1087842]
-
-2004-12-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
- Added guards so that rescanning for the complex-alpha check is not
- done in the common case of creating a simple image a bit at a
- time, or any other time where the image was simple before and the
- input data has no alpha channel. [Bug 1081966]
-
-2004-12-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.9 TAGGED FOR RELEASE ***
-
- * library/text.tcl (::tk::TextUpDownLine): revert 2004-11-23 as it
- prevented scrolling to bottom.
-
-2004-12-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
- Make overlay compositing where the target is empty no longer set
- the target to magical gray, and also make sure that the
- complex-alpha flag is toggled when necessary. [Patch 848161]
-
-2004-12-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * changes: updated for 8.4.9 release
-
-2004-12-01 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixButton.c (TkpDisplayButton): constrain coords to
- Tk_RedrawImage to display only portion that is valid.
- * generic/tkImgPhoto.c (ImgPhotoDisplay): add X error suppression
- around XGetImage to prevent app abort. [Bug 979239]
-
-2004-11-24 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README: Bumped patchlevel to 8.4.9
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure, unix/configure.in, unix/tk.spec:
- * win/configure, win/configure.in:
-
-2004-11-23 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * library/text.tcl: make up/down cursor keys move by display
- lines, not logical lines [Bug 1011234] (REVERTED 2004-12-06)
-
-2004-11-19 Reinhard Max <max@suse.de>
-
- *** 8.4.8 TAGGED FOR RELEASE ***
-
- * unix/installManPage: Classic sed doesn't support | in REs.
-
- * doc/pack-old.n: Changed the internal name of the man page to
- pack-old to avoid a name clash in the installed man pages.
-
-2004-11-18 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Final updates for Tcl 8.4.8 release.
-
-2004-11-18 Reinhard Max <max@suse.de>
-
- * unix/tcl.m4 (SC_CONFIG_MANPAGES): Applied an improved version of
- * unix/configure.in: patch #996085, that introduces
- * unix/Makefile.in: --enable-man-suffix.
-
- * unix/installManPage: added
- * unix/mkLinks: removed
-
-2004-11-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCanvWind.c (ConfigureWinItem): unmap windows
- immediately when state hidden is requested. [Bug 982248]
-
- * generic/tkCanvImg.c (ImageToPostscript): don't try ps generation
- of canvas image item without image specified. [Bug 1032300]
-
- * library/console.tcl (::tk::console::ExpandVariable): correct
- array keyname expansion. [Bug 1004508] (bold)
-
- * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): set save_under X
- attr to prevent expose events when moving sash. [Bug 1036963]
-
-2004-11-16 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Updates for Tk 8.4.8 release.
-
- * library/msgs/it.msg: Updated Italian message catalog.
- Thanks to Roberto Ugoccioni [Bug 1063675].
-
-2004-11-12 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXXStubs.c: implemented XGetGeometry().
-
-2004-11-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCmds.c (Tk_TkObjCmd): use correct screen data when
- -displayof arg is passed to [tk scaling]. [Bug 800178]
-
-2004-11-12 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXFont.c (Tk_MeasureChars,Tk_DrawChars,etc): Make
- sure that the lastSubFontPtr remains valid even when the subfont
- array is reallocated. [Bug 618872]
-
-2004-11-11 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkMain.c:
- * macosx/tkMacOSXAppInit.c (removed):
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXInt.h: changes to make TkAqua dynamically loadable,
- enabling [package require Tk] from tclsh. Startup code from
- tkMacOSXAppInit.c moved into tkMacOSXInit.c, added code that
- notifies the window server that an unbundled executable is a full
- GUI application after loading Tk. [Patch 1035348]
-
- * doc/wm.n: documented [wm attributes] on Mac OS X. [Bug 606665]
- * macosx/tkMacOSXWm.c: implemented TIP 222 [wm attributes -alpha] on
- Mac OS X. [Patch 892194]
- WmIconbitmapCmd: adopted FSRef changes from [wm atttrs -titlepath].
-
- * macosx/tkMacOSXButton.c:
- * macosx/tkMacOSXMenus.c:
- * macosx/tkMacOSXRegion.c:
- * macosx/tkMacOSXSubwindows.c: synced spacing/formatting with HEAD.
-
- * macosx/tkMacOSXMouseEvent.c: endianness fixes.
-
- * macosx/Wish.pbproj/project.pbxproj: corrected path to html help
- inside framework.
-
- * macosx/Makefile: prevent parallel make from building several
- targets at the same time.
- Ensure that xcodebuild will use Wish.pbproj project even if a .xcode
- project is also present.
-
-2004-11-10 Jim Ingham <jingham@apple.com>
-
- From Michael Kirkham (mikek@muonics.com):
-
- * macosx/tkMacOSXButton.c (TkpDisplayButton): Don't set
- the text if compound is NONE and we have and image.
- [Bug 1055023]
-
-2004-10-29 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Add Win32 test cases for attributes
- subcommand.
- * win/tkWinWm.c (WmAttributesCmd): Fixup broken
- option processing logic for attributes subcommand.
-
-2004-10-29 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc (DOTVERSION): Was installing 8.4 relabelled as 8.5
-
- * library/tk.tcl (::tk::PlaceWindow): Backported the fix from
- #533519 to handle window placement on multi-monitor Windows.
-
-2004-10-28 Mo DeJong <mdejong@users.sourceforge.net>
-
- * doc/wm.n: Add wm attributes . -alpha doc to account
- for recent alpha changes.
-
-2004-10-28 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWin32Dll.c (DllMain, _except_dllmain_detach_handler):
- Back port HAVE_NO_SEH handler code from CVS HEAD to fix
- gcc build breakage caused by 2004-10-26 back port.
-
-2004-10-28 Don Porter <dgp@users.sourceforge.net>
-
- * README: Bumped to patch level 8.4.8
- * generic/tk.h: to prepare for next patch
- * macosx/Wish.pbproj/project.pbxproj: release.
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf (2.13)
- * win/configure:
-
-2004-10-28 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * unix/tkUnixScale.c (DisplayHorizontalValue): Backport fix for
- #220927 by Michael Schlenker to keep the labels within the window.
-
-2004-10-28 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/*.n: Backport of minor documentation fixes.
-
-2004-10-27 Don Porter <dgp@users.sourceforge.net>
-
- * library/xmfbox.tcl (MotifFDialog_BuildUI): Fix [Bug 987169] in
- the Motif file dialogs as well. Backport of DKF bug fix.
-
-2004-10-26 David Gravereaux <davygrvy@pobox.com>
-
- * generic/tkInt.h: Backport of shutdown safety mods from the HEAD
- * generic/tkMenu.c: dating from 2003-12-21
- * generic/tkUtil.c:
- * generic/tkWindow.c:
- * mac/tkMacButton.c:
- * unix/tkUnixEvent.c:
- * win/tkWin32Dll.c:
- * win/tkWinEmbed.c:
- * win/tkWinMenu.c:
- * win/tkWinX.c:
-
- * generic/tkInt.decls: Signature for tkWinXCleanup needed to be
- * generic/tkIntPlatDecls.h: changed so it matches the Tcl_ExitProc
- typedef to avoid a bad-style cast.
-
-
- * win/makefile.vc: Backport to the most recent
- * win/rules.vc: changes on the HEAD.
- * win/nmakehlp.c:
-
-2004-10-26 Don Porter <dgp@users.sourceforge.net>
-
- * tests/safe.test (safe-1.3): Made test less sensitve to the
- full set of existing aliases in an interp, so the it only tests
- whether the tested ones are present.
-
- * unix/Makefile.in: Copied LD_LIBRARY_PATH machinery from
- `make shell` target to other similar targets so that just built
- libraries are tested, rather than previous installations.
-
-2004-10-26 Reinhard Max <max@suse.de>
-
- * generic/tkEvent.c (Tk_HandleEvent): Call XSetICFocus whenever
- the window receives focus. This fixes bug #905830 but avoids
- #1000051.
-
-2004-10-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (UpdateWrapper): pass SWP_NOOWNERZORDER to
- SetWindowPos when maintaining win Z order, to prevent parent
- from flashing (adjusting Z order).
-
-2004-10-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- Backport of 8.5 wm iconphoto that added support for Tk photo
- * generic/tkInt.h (TkDisplay): images as titlebar icons. TIP #159
- * win/tkWinWm.c (WmIconphotoCmd): wm iconphoto ?-default? image1 ...
- * macosx/tkMacOSXWm.c (WmIconphotoCmd): Implemented for Win/Unix,
- * unix/tkUnixWm.c (WmIconphotoCmd): stubbed out for OS X.
- * tests/wm.test, tests/unixWm.test, tests/winWm.test: [Bug 815751]
-
-2004-09-24 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkCursor.c: Add missing initialization in debug routine.
-
-2004-09-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinInt.h (TkWinDisplayChanged): added decl
- * win/tkWinX.c (TkWinDisplayChanged, TkpOpenDisplay): Correctly
- * win/tkWinWm.c (InvalidateSubTreeDepth, WmProc): handle color
- and screen resolution changes. Tested for 16/24/32 bpp changes on
- XP. May need more fixes for 8bpp switch, use of special
- colormaps, or other special palette handling cases. [Bug 223689]
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkInt.decls: Add decl for TkWinGetPlatformTheme.
- It is only defined under Win32.
- * generic/tkIntPlatDecls.h: Regen.
- * generic/tkStubInit.c: Regen.
- * win/tkWinInt.h: Define TK_THEME_WIN_CLASSIC and
- TK_THEME_WIN_XP.
- * win/tkWinMenu.c (DrawMenuEntryAccelerator, DrawMenuEntryLabel):
- Draw a disabled 3D text highlight for the accelerator only
- with the Win95/98 look. Same goes for the menu entry text.
- * win/tkWinX.c (TkWinGetPlatformId, TkWinGetPlatformTheme):
- Automatically detect the Windows theme in use and return
- either TK_THEME_WIN_CLASSIC or TK_THEME_WIN_XP when the
- TkWinGetPlatformTheme function is invoked.
- [Patch 866194]
-
-2004-09-22 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * win/tkWinMenu.c: only provide a submenu handle when the
- MF_POPUP flag is given, fixing a recently-introduced crash
- when submenus are disabled. Also better error checking for
- this sort of situation in the future.
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinMenu.c (ReconfigureWindowsMenu): Fix drawing of a disabled
- (TkWinHandleMenuEvent, DrawMenuEntryArrow): cascade menu arrow. Tk was
- displaying a disabled cascade menu arrow in black instead of
- gray. This was caused by a bug in the Win32 code for user drawn
- menu items. The fix is to avoid telling Windows that the menu item
- is a cascade type and then draw the gray arrow bitmap on our own.
- [Patch 865842]
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinMenu.c (DrawWindowsSystemBitmap): Fix a strange Win32
- bug where the logical coordinates returned by a call to DPtoLP are
- wrong the first time a menu is posted. This bug manifested itself
- by drawing the bitmap in the wrong place in a menu. The fix was
- to pass the newly created DC instead of the DC from the window.
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinMenu.c (DrawMenuEntryAccelerator):
- (DrawMenuEntryLabel): When drawing the label text and accelerator
- text for a disabled menu entry be sure to draw a 3D highlight.
- The only exception to this is when a disabled menu entry is
- highlighted, in that case do not draw a 3D hightlight.
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinMenu.c (DrawMenuEntryAccelerator, DrawMenuEntryArrow):
- Move the unused menu arrow drawing code in
- DrawMenuEntryAccelerator into a new function named
- DrawMenuEntryArrow. This makes no functional change but it will
- make it easier to fix things in the future.
-
-2004-09-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinWm.c: Rework WS_EX_LAYERED and LWA_ALPHA
- defines so that compiling with mingw works again.
-
-2004-09-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (UpdateWrapper, WmAttributesCmd): handle attribute
- settings prior to window mapping and resort to more forceful
- wrapper update again for -toolwindow (to remove it from taskbar).
-
-2004-09-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (WmAttributesCmd): correct -alpha 0.0/1.0 setting
- and round the value.
- (UpdateWrapper): don't adjust Z order of TOPMOST window.
- (WmAttributesCmd): don't call UpdateWrapper for -disabled or
- -toolwindow attr changes.
-
-2004-09-18 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/README: typos
- * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext): performance
- improvements: removed slow & unnecessary calls.
-
-2004-09-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/winWm.test: Add 'wm attributes -alpha' to control toplevel
- * win/tkWinInt.h: alpha transparency on Win2K/XP+.
- * win/tkWinWm.c: TIP #222 [Patch 892194]
-
- * win/tkWinWm.c (UpdateWrapper): Ensure that we maintain Z order
- * tests/winWm.test: and focus of preexisting window
- when replacing the wrapper window.
- * win/tkWinWm.c (WmIconwindowCmd): Replace bogus call to
- XWithdrawWindow with proper code. (mdejong)
-
-2004-09-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkMenu.c (MenuWorldChanged): ensure that we recompute
- the menu geometry on WorldChanged to handle font size
- changes. [Bug 607649]
-
-2004-09-16 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/place.test:
- * generic/tkPlace.c: Fixed a memory leak when a placed widget was
- forgotten. [Bug 1028888]
-
-2004-09-13 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (ReadIconFromFile): fix mem alloc to get the right
- size for both icons ('?:' order of precedence mistake).
-
-2004-09-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/tkfbox.tcl (::tk::dialog::file::): Make sure that the
- state is reset properly when starting to run the dialog. [Bug 845189]
-
- * library/demos/filebox.tcl: Stop the use of tk_strictMotif from
- poisoning the rest of the widget demo. [Bug 1013942]
-
-2004-09-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (ActivateWindow): SetFocus to grab window when
- clicking outside the grab window hierarchy. [Bug 220908]
- (UpdateWrapper): update to Kovalenko to account for whether the
- override window has a transient parent, and apply WS_POPUP in the
- correct case. The makes splash screens pop up as well as making
- dropdowns not grab focus away from the parent.
-
-2004-09-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c: backport of several items from 8.5 head:
- (ReadIconFromFile): when using SHGetFileInfo to retrieve icon, get
- regular icon as well for correct Alt-Tab icon. (hobbs)
- Fix for #742882 "Potential division by zero in gridded wm
- geometry" (jenglish)
- (UpdateWrapper): Let overrideredirect'ed window's wrapper be the
- child of desktop window, thus making it to behave more similarly
- to X11 Override Redirect. Esp. useful for combobox-like
- megawidgets. (kovalenko)
- (InstallColormaps): Check for TK_ALREADY_DEAD to avoid handling of
- dead windows. (kovalenko)
- Change 'panic' to 'Tcl_Panic' (davygrvy)
-
-2004-09-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/tkfbox.tcl (::tk::dialog::file::Create): use label
- instead of button for "File of type", as it properly handles
- -state disabled now.
-
-2004-08-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/text.tcl (::tk::TextTranspose): Ensure that Transpose is
- an atomic op to undo. Replace 'string compare' with 'ne'.
-
-2004-08-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinDialog.c (EatSpuriousMessageBugFix): Fix a problem with
- double clicks in file dialogs falling through to the window
- underneath in win32. [Patch #611615]
-
- * win/tkWinDialog.c (Tk_MessageBoxObjCmd): Inherit the icon from
- * win/tkWinInt.h: the -parent window for
- * win/tkWinWm.c (TkWinGetIcon): the MessageBox.
-
-2004-08-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkPanedWindow.c (optionSpecs): Add missing GEOMETRY flag
- to -handlepad option. [Bug 1010938]
-
-2004-08-10 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixWm.c: Fix for #1006686 "wm resizable command
- not working on Solaris/CDE" (patch from Colin McDonald).
-
-2004-08-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/canvText.test:
- * win/tkWinFont.c (Tk_MeasureChars): Fix for text
- wrapping problem that appeared using canvas text
- under Win32. A long wrapping string that had
- leading spaces was being incorrectly wrapped.
- This change makes the Win32 implementation behave
- the same as the Unix implementation. [Patch 1006286]
-
-2004-08-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): Clean the code
- up a bit and add a few more comments.
- (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Clarified the code,
- corrected the compositing rule now that I have looked up what the
- right thing to do is, and factorized out the compositing rule code
- into a few simpler macros.
-
-2004-07-30 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/configure:
- * unix/tcl.m4 (SC_CONFIG_CFLAGS): Darwin: instead of setting PLAT_OBJS
- to explict object files in tcl.m4, refer to MAC_OSX_OBJS makefile var.
-
-2004-07-29 Don Porter <dgp@users.sourceforge.net>
-
- *** 8.4.7 TAGGED FOR RELEASE ***
-
- * changes:
- * generic/tkEvent.c (Tk_HandleEvent): revert the 2004-07-20 commit.
- That commit created a new Bug 1000051 - a broken Compose Key.
- This revert restores Bug 905830 until a cleaner fix can be provided.
-
-2004-07-27 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkImgGIF.c (FileReadGIF): fix crash reported by Reinhard Max:
- in case of premature end of image data, return error instead of
- passing nil buffer to Tk_PhotoPutBlock().
-
- * generic/tkRectOval.c (ComputeRectOvalBbox): Mac OS X specific
- fix to rounding in bounding box 'bloat' calculation to avoid drawing
- outside of bounding box when CG drawing enabled. Fix probably
- correct on other platforms as well?
-
- * macosx/tkMacOSXDraw.c (TkMacOSXInitCGDrawing): fixed LinkVar type
- for tkMacOSXCGAntiAliasLimit.
-
-2004-07-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * changes: Updated for Tcl 8.4.7 release.
-
-2004-07-24 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXDefault.h: Change the default -tearoff value
- to 0. It doesn't work at present, so it is silly to make
- it the default.
-
- Mac OS X: Complete the implementation of the CG version of
- the X drawing emulation layer.
-
- This was mostly done by James Tittle (tigital<at>mac<dot>com),
- with a little help from me.
-
- * macosx/tkMacOSXint.h: Add declaration of TkMacOSXInitCGDrawing.
- * macosx/tkMacOSXInit.c: Call it.
- * macosx/tkMacOSXDraw.c (TkMacOSXInitCGDrawing): New function
- set up the variables controlling the use of cg drawing.
- (XFillRectangles): Make the CG branch work.
- (XDrawLines): Ditto
- (XDrawSegments): Ditto
- (XFillPolygon): Ditto
- (XDrawRectangle): Ditto
- (XDrawRectangles): Ditto
- (XDrawArc): Ditto
- (XDrawArcs): Ditto
- (XFillArc): Ditto
- (XFillArcs): Ditto
- (TkMacOSXSetupCGContext): Make this actually work.
- (TkMacOSXReleaseCGContext): Ditto.
-
- Mac OS X: Add support for reading the wm attributes -titlepath
- command, and convert to using FSRef's.
- This was done by Neil Madden (nem<at>cs<dot>nott<dot>ac<dot>uk).
-
- * macosx/tkMacOSXWm.c (WmAttrGetModifiedStatus): New function.
- (WmAttrGetTitlePath) New function.
- (WmAttributesCmd): Convert command parsing to use the options index.
- Use the two above functions to report results. Convert the titlepath
- code to use FSRef's.
-
-2004-07-23 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
-
- [Merge from HEAD]
-
- Mac OS X: Fix several problems with Icelandic (and Faroese) keyboards
- reported by J�r�me Gagnon-Voyer <gagnonje5000<at>mac<dot>com> on
- tcl-mac on 2004-03-22.
-
- * macosx/tkMacOSXKeyEvent.c (KLSInit): Add.
- (GetKeyboardLayout): Add calls to Keyboard Layout Services, if
- present. Rework classic handling. Use GetKCHREncoding(). Add
- parameter encodingPtr.
- (GetKCHREncoding): Add.
-
-2004-07-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/tkfbox.tcl (::tk::dialog::file::Update): use -directory
- [pwd] (instead of .) to get around some VFS edge case bugs.
- Use [bind $w], not [$w configure] to modify bindings.
-
-2004-07-20 Jim Ingham <jingham@apple.com>
-
- * generic/tkEvent.c (TkQueueEventForAllChildren): Don't queue
- events for unmapped windows.
-
-2004-07-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkEvent.c (Tk_HandleEvent): ensure IC focus is set after
- creation. [Bug #905830]
-
-2004-07-20 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4: fixed Darwin autoconf breakage caused by
- recent CFLAGS reordering.
- * unix/configure: regen
-
- * macosx/Makefile: added support to tk framework build to
- optionally install tk manpages in addition to html help,
- similarly to tcl/macosx/Makefile.
-
- * macosx/Wish.pbproj/project.pbxproj: fixes for building with
- non-default SYMROOT/OBJROOT/SRCROOT, added support for using a
- Tcl.framework in DYLIB_INSTALL_PATH != /Library/Frameworks,
- added optional support for building html help without tcl sources
- present by giving explicit location of tcltk-man2html script.
-
- * macosx/tkMacOSXMenu.c: fixed #include case sensitivity bug.
-
-2004-07-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in, unix/tcl.m4: move (C|LD)FLAGS after their
- * unix/configure.in, unix/configure: _DEFAULT to allow for env
- setting to override m4 switches.
- Consolidate header checks to limit redundancy in configure.
- (CFLAGS_WARNING): Remove -Wconversion, add -fno-strict-aliasing
- for gcc builds (need to suppress 3.x type puning warnings).
- (SC_ENABLE_THREADS): Set m4 to force threaded build when built
- against a threaded Tcl core.
- Reorder configure.in for better 64-bit build configuration,
- replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058]
-
-2004-07-14 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXCursor.c (TkpSetCursor): The code to not
- reset the cursor more often than necessary was getting fooled
- when the current cursor was nulled out when the current cursor
- gets freed. So in the case where the input cursor was NULL, we
- have to just always set it. [Bug #894550]
-
-2004-07-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkUndo.c (TkUndoSetDepth): correct -maxundo
- segfault. [Bug #969358] (jiangwu)
-
- * generic/tk.h (TK_PATCH_LEVEL):
- * README, macosx/Wish.pbproj/project.pbxproj: bumped to
- * unix/configure, unix/configure.in, unix/tk.spec: patchlevel 8.4.7
- * win/configure, win/configure.in:
-
-2004-07-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/tkfbox.tcl (::tk::dialog::file::Create): Watch out for
- users destroying the dialog indirectly. [Bug 987169]
-
-2004-06-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCmds.c (Tk_WinfoObjCmd): refetch interp result obj for
- 'winfo id' as it can change when making the window exist.
-
-2004-06-25 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPhoto.c (ImgPhotoDisplay): Early exit from image
- redraw if the region to redraw is empty, so stopping XGetImage
- from bailing out. [Bug 979239]
-
-2004-06-08 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkCanvText.c (DisplayCanvText): Fix text
- rendering problem with canvas text items that
- have a selected region. The previous implementation
- would render the whole line and then redraw the
- selected text if it was a different color. This caused
- problems when the selected text foreground differs
- from the normal text foreground, the anti-aliasing
- alpha pixels for the two text strings would blend
- together resulting in strange looking text. The
- fix is to draw the normal text and the selected text
- separately. This problem has only been observed
- under Windows, with anti-aliased text. [Patch 968725]
-
-2004-05-14 Chengye Mao <chengye.geo@yahoo.com>
-
- * win/tkWinWm.c (UpdateWrapper): Modified to delete the old wrapper
- correctly [Bug #767176]
-
-2004-05-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/msgbox.tcl (MessageBox): Shrank the default font size
- for the message to 14-point; nobody liked 18-point!
-
-2004-05-12 Chengye Mao <chengye.geo@yahoo.com>
-
- * generic/tkBind.c (HandleEventGenerate): Modified to fix wish
- crash due to incorrectly generate <Destroy> event. This bug was
- reported in comp.lang.tcl but not logged.
-
-2004-05-10 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/makefile.vc: Apply fix from tcl bug #950049 for make docs.
-
-2004-05-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinFont.c (Tk_MeasureChars,Tk_DrawChars,etc): Make sure
- that the lastSubFontPtr remains valid even when the subfont array
- is reallocated. [Bug #618872] (dkf, hobbs)
-
-2004-05-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinMenu.c, unix/tkUnixMenu.c (DrawMenuEntryLabel): place
- images of compound menu entries in indicator space if not a radio
- of checkbutton. [Bug #756952] (eserte)
-
- * win/tkWinX.c: fix drawing of unicode chars in menu
- * win/tkWinInt.h (TkWinProcs): titles. [Bug #904371] (riefenstahl)
- * win/tkWinMenu.c (ReconfigureWindowsMenu):
-
- * generic/tkClipboard.c: Move TkClipCleanup from tkClipboard.c
- * mac/tkMacXStubs.c: to being implemented in a platform
- * macosx/tkMacOSXXStubs.c: specific manner. The cleanup order was
- * unix/tkUnixEvent.c: bad at least on Windows, where we
- * win/tkWinX.c: reset/cleared display info that was
- still needed for the clipboard to render.
- [Bug #939389, #822002, #732662]
-
- * library/panedwindow.tcl (MarkSash): call DragSash to stop sash
- jump when B1 is pressed and released without moving. [Bug #932155]
- Make the panedwindow -opaqueresize option work as per the docs.
- [Bug #778893]
-
- * tests/panedwindow.test: panedwindow-25.1
- * generic/tkPanedWindow.c (Unlink): clean up -before/-after refs
- to a slave when removing it. [Bug #928413] (griffin)
-
- * generic/tkImgPhoto.c (ImgPhotoConfigureMaster): force -data into
- ByteArray and -format into String to correctly handle them if they've
- been shimmered or created as some other object type. [Bug #1027849]
- (ImgPhotoCmd): correctly init matched to 0.
-
-2004-04-20 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixWm.c: Backported fix for bug #915350
- "Tk sets min, max size in WM_HINTS when it shouldn't"
- and #922336 "Tk apps have no maximize window button under
- KDE-3.2.1"
-
-2004-04-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/bgerror.tcl (bgerror): rework to only set -topmost bit
- on Windows if necessary. Also use existing ::tk functions for
- placing dialog and managing focus/grab.
-
-2004-03-31 Jim Ingham <jingham@apple.com>
-
- * tkMacOSXMenu.c (EventuallyInvokeMenu): Report errors from invoking
- menu commands as background errors. [Bug 220871]
-
-2004-03-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPPM.c (ReadPPMStringHeader): Code to read PPM/PGM data
- (StringReadPPM, StringMatchPPM): from strings/bytearrays. [FRQ 540375]
- * generic/tkImgPPM.c (StringWritePPM): New function to support
- converting of images to PPM strings. Other direction not yet
- done. Rest of file converted to use new image API.
- * generic/tkImgPhoto.c (ImgPhotoCmd): Restored support for the
- stringWriteProc of old photo formats. [Bug 923555]
-
-2004-03-20 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXSubwindows.c (GenerateConfigureNotify): New
- function.
- (XMoveWindow): Generate configure notify events for child
- widgets on move.
- (XMoveResizeWindow): Ditto.
-
-2004-03-17 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXHLEvents.c (ApplicationCarbonEventsHandler): New
- function.
- (tkMacOSXInitAppleEvents): Init the Application Event handler as
- well.
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): Grab
- the Command-H & Command-Shift-H keys and use them for Hide and
- Hide Others before passing keystrokes on to the generic keyboard
- event processing. There isn't any other good way to get the
- Hide command to work, and the Apple HIG explicitly reserves them.
- * macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): Stop putting a Quit
- menu item in the File menu. It doesn't belong there.
-
-2004-03-01 Don Porter <dgp@users.sourceforge.net>
-
- *** 8.4.6 TAGGED FOR RELEASE ***
-
- * unix/tcl.m4 (SC_CONFIG_CFLAGS): Allow 64-bit enabling on
- IRIX64-6.5* systems. [Bug 218561]
- * unix/configure: autoconf-2.13
-
-2004-02-23 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXDraw.c:
- * macosx/tkMacOSXXStubs.c:
- * xlib/ximage.c: fixed MacOSX XGetImage/XPutImage and related
- functions to deal properly with XImages copied from screen.
- * generic/tkCanvPs.c (TkImageGetColor): MacOSX fix.
- * generic/tkImgPhoto.c (ImgPhotoDisplay): enabled alpha blending
- for images with partial transparency on MacOSX.
- [Bug 809157]
-
-2004-02-18 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/grid.test:
- * generic/tkGrid.c: Fixed a bug in grid geometry calculations for
- a shrinking grid. [Bug 899246]
-
-2004-02-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkBind.c (HandleEventGenerate): only modify root[xy]
- with [xy] when they haven't been otherwise set.
-
-2004-02-17 Don Porter <dgp@users.sourceforge.net>
-
- * tests/imgPhoto.test (imgPhoto-16.1): Corrected incorrect
- variable name [Bug 899010].
-
-2004-02-17 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXMouseEvent.c: fixed modifiers for MouseWheel events.
-
- * library/listbox.tcl:
- * library/text.tcl:
- * library/scrlbar.tcl: on Mac OS, add bindings for MouseWheel with
- modifiers, according to platform convention:
- Option increases scrolling speed 10 fold; Space scrolls horizontally.
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/tkAboutDlg.r: changed year in copyright strings to 2004.
-
-2004-02-16 Jim Ingham <jingham@apple.com>
-
- Fix for MouseWheel Events (from Daniel Steffen):
-
- * generic/tkEvent.c (Tk_HandleEvent): On Mac OS X, don't route
- MouseWheel events to the Focus window. They are sent to the
- window under the pointer on X (and the GenerateMouseWheelEvent
- already got this right.)
- * library/listbox.tcl: On Mac OS, don't use the magic 120
- divisor that is used on Windows. We may come up with a cleaner
- way to do this for the TOT, but this is simple and will do for the
- 8.4 branch.
- * library/text.tcl: Ditto.
- * doc/bind.n: Update the docs to reflect the changes.
-
-2004-02-15 Jim Ingham <jingham@apple.com>
-
- Backport Mac OS X specific fixes from TOT:
-
- * macosx/tkMacOSXKeyboard.c: General cleanup. Add support for
- [event generate]. [Bug #860454] - [Benjamin Riefenstahl]
- * macosx/tkMacOSXKeyboard.c: Add PowerBook keycode 0x34 as <Return>.
- [Benjamin Riefenstahl]
-
- * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
- This version is clearer, and works helps keep the mouse better
- pinned to the scrollbar. I also removed the glitch where the
- scrollbar would jump get its middle over the mouse when you first
- moved it.
-
- * macosx/tkMacOSXClipboard.c (TkSuspendClipboard, TkSelGetSelection):
- add unicode clipboard support. [Patch #840107] (senn)
-
- * macosx/tkMacOSXDialog.c (NavServicesGetFile): Minor cleanups.
- * (OpenFileFilterProc): Handle FSRef's as well as FSSpec's in the input
- file. Also convert the FSSpec filename to an C-string before passing
- to MatchOneFile. [bug 517600]
- * (MatchOneFile): Require the input filename to be a C-string, not a
- pascal string.
-
- * macosx/tkMacOSXDialog.c (MatchOneType): If the Macintosh filetype
- is 0, then automatically pass the fileType check.
-
- * macosx/tkMacOSXButton.c (TkpDisplayButton): Use the tk text
- drawing for checkbuttons & radiobuttons as well as for labels.
- * macosx/tkMacOSXEvent.c (XSync): New function, need to implement
- this so drawing will get flushed in "update idletasks".
- * tkMacOSXPort.h: convert #define of XSync to function def'n.
-
- * generic/tkWindow.c:
- * macosx/tkMacOSXDialog.c: added native tk_messageBox command,
- (Tk_MessageBoxObjCmd) for MacOS X platform. [Vince Darley]
-
- * macosx/tkMacOSXMenu.c: corrected encoding conversion for
- torn-off menu entries (but many other display problems still
- exist with these) [Vince Darley]
-
- * macosx/tkMacOSXMouseEvent.c: improved handling of events in the
- presence of grabs, particularly activation events. [Vince Darley]
-
- * macosx/tkMacOSXColor.c (GetControlPartColor): Use
- the ThemeBrushes to get the control text color for
- buttons.
-
- * tkMacOSXAppInit.c: Formatting cleanups.
- * tkMacOSXButton.c: Ditto
- * tkMacOSXClipboard.c: Ditto
- * tkMacOSXDebug.c: Ditto
- * tkMacOSXDialog.c: Ditto
- * tkMacOSXDraw.c: Ditto
- * tkMacOSXEvent.c: Ditto
- * tkMacOSXFont.c: Ditto
- * tkMacOSXHLEvents.c: Ditto
- * tkMacOSXInit.c: Ditto
- * tkMacOSXInt.h
- * tkMacOSXKeyEvent.c: Ditto
- * tkMacOSXMenu.c: Ditto
- * tkMacOSXMenubutton.c: Ditto
- * tkMacOSXMouseEvent.c: Ditto
- * tkMacOSXNotify.c: Ditto
- * tkMacOSXScale.c: Ditto
- * tkMacOSXScrlbr.c: Ditto
- * tkMacOSXSubwindows.c: Ditto
- * tkMacOSXWindowEvent.c: Ditto
- * tkMacOSXWm.c: Ditto
-
-2004-02-13 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinFont.c (Tk_MeasureChars): backport fixes to bold/italic
- font handling. [Patch 852669] [Bug 478568]
- * tests/textDisp.test: added test for the font measurement
- problem.
-
-2004-02-13 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXDialog.c (Tk_GetOpenFileObjCmd): Use CFStringRef for
- title & message options, not pascal strings.
- (Tk_GetSaveFileObjCmd): Ditto
- (Tk_ChooseDirectoryObjCmd): Ditto
- (NavServicesGetFile): Now that we get CFStrings, we don't need
- to convert them here.
-
- * macosx/tkMacOSXMenu.c (TkMacOSXDispatchMenuEvent): Cleanup, we don't
- need to handle the Apple Menu picks any more, but the code didn't
- reflect that.
-
- * macosx/tkMacOSXWm.c (TkSetWMName): Use CFStrings for the Window Title
- name, not Pascal strings.
-
-2004-02-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README: update to patchlevel 8.4.6
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure, unix/configure.in, unix/tk.spec:
- * win/configure, win/configure.in:
-
- * tests/window.test: simple code cleanup
-
- * win/tkWinDialog.c (ChooseDirectoryValidateProc): create a pidl
- for -initialdir if we have a UNC path because BFFM_SETSELECTION
- doesn't support UNC paths in strings.
-
-2004-02-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/msgs/eo.msg: Language support for Esperanto and Polish from
- * library/msgs/pl.msg: Artur Trzewik <mail@xdobry.de> with thanks.
-
-2004-02-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
- * tests/imgPhoto.test (imgPhoto-16.1): Better handling of the case
- when copying from one area of a photo to another triggers a
- resizing of the image. [Bug 877950]
-
-2004-02-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/menu.tcl (::tk::MbPost): make menubuttons that post
- above or below reverse direction when not enough space is available.
-
-2004-01-28 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * win/tkWinCursor.c: Backported fix for bug #776646 which makes
- * tests/cursor.test: hand2 and fleur native on windows.
-
-2003-01-27 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: removed erroneous reference
- to mkpsenc.tcl in bundle resources phase (mkpsenc.tcl is already
- part of the copy files phase to Resources/Scripts).
-
- * macosx/Makefile: added support for 'xcodebuild' on Mac OS X 10.3.
-
-2003-12-31 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: added missing private headers
- to installed Tk.framework, so that tkInt.h can be included
- sucessfully from Tk.framework/PrivateHeaders.
- * generic/tkPort.h: corrected include of tkMacOSXPort.h
-
-2003-12-17 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952].
- This version is clearer, and works helps keep the mouse better
- pinned to the scrollbar. I also removed the glitch where the
- scrollbar would jump get its middle over the mouse when you first
- moved it.
-
- Import from TOT.
-
-2003-12-11 David Gravereaux <davygrvy@pobox.com>
-
- * win/winMain.c: Backed-out yesterdays change. Reverted to 1.15 for
- two reasons. 1) problem is best addressed in Tcl's DllMain() and
- 2) needs a MinGW custom assembly implimentation as it doesn't
- understand SEH syntax.
-
-2003-12-10 David Gravereaux <davygrvy@pobox.com>
-
- * win/winMain.c (WishPanic) : placed ExitProcess() in a __try block
- (SEH) to catch any exceptions that might happen. As Tcl will call
- Tcl_Finalize from its DllMain due to the unload from ExitProcess()
- unloading Tcl, and if Tcl_Panic had gotten called in an __except
- block handling an exception, this avoid the possibility of not
- being able to exit from the stack being a mess. Falls to
- TerminateProcess() in the __except case.
-
- Removed the #ifdef _MSC_VER around DebugBreak as that function
- exists in kernel32.dll and is not compiler dependent. I'd prefer
- to use 'if (IsDebuggerPresent()) DebugBreak();' but
- IsDebuggerPresent() isn't available in all kernel32.dll modules
- for all versions of windows.
-
-2003-12-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * doc/CrtImgType.3: Fixed line-transposition error found by Eric
- Raymond. [Bug 857159]
-
-2003-12-03 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tk.h: Bumped patch level to 8.4.5.1 to distinguish
- * unix/configure.in: CVS snapshots from the 8.4.5 release.
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf (2.13)
- * win/configure:
-
-2003-12-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkMenu.c (MenuVarProc): prevent this from triggering
- while interp is being destroyed.
-
-2003-11-21 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
-
- *** 8.4.5 TAGGED FOR RELEASE ***
-
- * macosx/tkMacOSXKeyboard.c: Add PowerBook keycode 0x34 as
- <Return>. (Merge from trunk)
-
-2003-11-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * changes: updated for 8.4.5 release
-
-2003-11-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkMenubutton.h: fixed compound menubutton handling like
- * generic/tkMenubutton.c: *button corrections of 2003-04-25.
- * mac/tkMacMenubutton.c (TkpDisplayMenuButton):
- * unix/tkUnixMenubu.c (TkpDisplayMenuButton):
-
-2003-11-16 Don Porter <dgp@users.sourceforge.net>
-
- * win/makefile.vc: Restored consistency of pkgIndex.tcl file
- with that generated by Makefile.
-
-2003-11-15 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: Fixes pkgIndex.tcl generation so a symbols build
- is loaded when Tcl is symbols.
-
-2003-11-11 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure:
- * unix/tcl.m4: improve AIX --enable-64bit handling
-
- * generic/tkButton.c (ConfigureButton): abort option processing if
- the button was deleted. [Bug #824479]
-
- * generic/tkMenuDraw.c (TkPostSubmenu): add {} around menu name in
- case it has spaces when calling Tcl_VarEval. This is a hack until
- this is rewritten for proper Tcl_Obj handling. [Bug #723856]
-
- * library/tkfbox.tcl (::tk::dialog::file::Update): optimize the
- dir/files list separation by using the -tails, -directory and
- -type option of 'glob'. Also passes the glob the -filetypes
- filters instead of calling string match over each file.
- [Patch #833819]
- (::tk::dialog::file::ActivateEnt): allow typing filename into
- entry when tk_getOpenFile -multiple 1 is specified. [Bug #788069]
-
- * generic/tkListbox.c (ListboxDeleteSubCmd, ListboxListVarProc):
- free itemconfig data when removing it from table. [Bug #836483]
-
- * macosx/tkMacOSXClipboard.c (TkSuspendClipboard, TkSelGetSelection):
- add unicode clipboard support. [Patch #840107] (senn)
-
-2003-11-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinDraw.c (XFillRectangles): correctly handle the
- XGCValues.function parameter when filling rectangles.
- [Bug #820278] [Patch #820282]
-
- * generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): add alpha
- blending for images with partial transparency. Only operates for
- 15bpp+ display, and not on Mac at all. [Bug 809157]
-
- * win/configure:
- * win/configure.in: define TK_LIB_FLAG, TK_LIB_SPEC,
- TK_BUILD_LIB_SPEC, TK_STUB_LIB_SPEC, TK_STUB_LIB_PATH, and
- TK_BUILD_STUB_LIB_PATH for tkConfig.sh [Bug #826614]
-
- * unix/Makefile.in (SHLIB_LD_FLAGS): include in Makefile as it is
- used in MAKE_LIB sometimes (ie: AIX-64) [Bug #829686] (jimix)
-
-2003-11-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/msgs/nl.msg: Updated messages from Arjen Markus and
- Pascal Scheffers. Thanks! [Patch 820519]
-
-2003-10-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-
- * library/tkfbox.tcl (IconList_Create,IconList_Add): Added option
- munging to allow some control of foreground colours on Unix in the
- same way that you can influence the background. [Bug 795717]
-
-2003-10-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (GetFontAttributes): place extra check for NULL
- family against bad X servers.
-
- * win/tkWinImage.c (XGetImageZPixmap): add separate 16bpp
- XGetImage code to correctly handle 16bpp requests. This appears
- to never have worked correctly.
-
- * tests/focusTcl.test (setup1): expand frame size to allow for
- correct visibility of windows that use larger default fonts.
-
-2003-10-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/tk.tcl (::tk::PlaceWindow): Added check for empty string
- first when determining placement strategy. [Bug 819284]
-
-2003-10-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/dialog.tcl (tk_dialog): Constrain the dialog to be
- fairly sensibly sized and placed. [Bug 827535]
-
-2003-10-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkInt.h: move TkGetOptionSpec to stubs intDecls
- * generic/tkIntDecls.h:
- * generic/tkInt.decls:
- * generic/tkStubInit.c:
-
- * tests/listbox.test (13.3): correct result size
- (4.7): correct test for possible window drift [Bug #701931] (dgp)
-
- * unix/mkLinks:
- * doc/GetHWND.3: add Tk_AttachHWND docs [Bug #220803]
-
-2003-10-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * mac/tkMacButton.c (TkpDisplayButton):
- * macosx/tkMacOSXButton.c (TkpDisplayButton):
- * unix/tkUnixButton.c (TkpDisplayButton): correct imageYOffset for
- buttons with just images.
-
-2003-10-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinButton.c (TkpDisplayButton): correct imageYOffset for
- buttons with just images.
-
-2003-10-06 Don Porter <dgp@users.sourceforge.net>
-
- * doc/ConfigWidg.3: Removed reference to Tk_Offset from the
- NAME section to resolve mkLinks conflict with SetOptions.3 [Bug 404197]
-
- * unix/configure.in: Reconfigured to use $TCL_PREFIX as the
- default value of --prefix, and also added warning when a TK_PREFIX
- value different from TCL_PREFIX is selected, since [package require Tk]
- fails in that configuration. [Bugs 428627,765642]
-
- * unix/tcl.m4 (SC_PATH_TCLCONFIG): Corrected search path so
- that alpha and beta releases of Tcl are not favored. [Bug 608698]
-
- * unix/configure.in: Added check that version of Tcl header found
- by configure matches that of the Tk we wish to build. As long as
- the Tk sources insist on lockstep releases, Tk's configuration should
- verify that's what we have. [Bug 749088]
-
- * unix/configure: autoconf (2.13)
- * unix/mkLinks: make mklinks
-
-2003-10-03 Don Porter <dgp@users.sourceforge.net>
-
- * README: Bumped to patch level 8.4.5
- * generic/tk.h: to prepare for next patch
- * macosx/Wish.pbproj/project.pbxproj: release.
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf (2.13)
- * win/configure:
-
-2003-10-03 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/scale.tcl: Clear bug with chording mouse buttons.
-
-2003-10-01 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Makefile: fixed redo prebinding bug when DESTDIR="".
- Added support for all applicable customizable makefile variables
- from tcl/macosx/Makefile.
-
- * macosx/README:
- * macosx/Wish.pbproj/project.pbxproj: ensure that the versioned
- wishX.X script works correctly when Tk.framework with multiple
- versions is present by referring to a copy of 'Wish Shell.app'
- located in Tk.framework/Versions/X.X/Resources.
-
-2003-09-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * unix/tcl.m4 (SC_ENABLE_FRAMEWORK): Added note to make it clearer
- that this is an OSX feature, not a general Unix feature. [Bug 619440]
-
-2003-09-26 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
-
- * macosx/tkMacOSXWm.c (TkWmStackorderToplevelWrapperMap): Add
- GetWindowFromPort() [Bug #812415]; make function static.
-
-2003-09-25 Daniel Steffen <das@users.sourceforge.net>
-
- * library/demos/widget: don't create iconwindow on aqua, but add
- about menu like on classic.
- * macosx/Makefile: pass MAKEOVERRIDES to pxbuild.
- * macosx/tkMacOSXButton.c: added -compound support for bevel buttons.
-
-2003-09-17 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkImage.c: Stopped [image create] from generating an
- * tests/image.test: image command name that would overwrite an
- existing command name. Thanks to Michael Schlenker. [Bug 808039].
-
-2003-08-19 Joe English <jenglish@users.sourceforge.net>
- * generic/tkPanedWindow.c(PanedWindowWorldChanged):
- Set window background from the -background resource.
- Fixes [BUG #791500 "PanedWindow refresh glitches on X"]
-
-2003-08-13 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/scale.tcl: Fix for bug #787065 for Button-2 press.
- * tests/scale.test: Added test for this bug.
-
-2003-08-12 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXMenu.c: fixed C99'ism that breaks gcc 2.95.
-
-2003-07-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.4 TAGGED FOR RELEASE ***
-
- * changes: updated for 8.4.4 release
-
-2003-07-20 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/buildTkConfig.tcl: fix to TK_BUILD_* ref generation
- broken by changes to tcl buildsystem.
-
-2003-07-19 Pat Thoyts <patthoyts@users.sourceforge.net>
-
- * library/scale.tcl: Fix for bug 706765 to correctly handle the
- -sliderrelief option while moving the thumb.
-
-2003-07-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (Tk_DrawChars): do not make XGetGeometry call
- that prevents overwidth lines as it requires a roundtrip call to
- the X server for every string drawn. Hard-code max width to 32768
- until a beter solution to get max width is made.
-
- * library/panedwindow.tcl: use widget-specific Priv slots for
- pwAfterId and panecursor items to correctly handle cursor changes
- with adjacant panedwindows.
-
- * generic/tkEvent.c (Tk_HandleEvent): correct XCreateIC call for
- TK_XIM_SPOT usage. [Bug 742660] (takahashi)
-
- * win/tkWinCursor.c (TkGetCursorByName): Fix bug 420510 to provide
- consistency between unix and windows -cursor option. (thoyts)
-
- * win/tkWinDialog.c: doubled the TK_MULTI_MAX_PATH value to ~10K.
- This is a short-term solution until the -multiple option is
- extended. [Bug 641261]
-
-2003-07-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/panedwindow.test (panedwindow-30.2):
- * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): Ensure that we
- can share GCs between a panedwindow and its sash proxy, even if
- the panedwindow is in a toplevel with a different visual. [Bug 702230]
-
-2003-07-17 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Makefile: Changes for new tcl buildsystem.
-
- * macosx/Wish.pbproj/jingham.pbxuser:
- * macosx/Wish.pbproj/project.pbxproj:
- Changes for new tcl buildsystem.
- Changed build to include tk specific html help in Tk.framework
- instead of Tcl.framework.
- Set default SYMROOT in target options to simplify setting up PB
- (manually setting common build folder for tcl & tk no longer needed).
-
- * macosx/README: Updated info for changes to buildsystem,
- html help location and PB setup.
-
-2003-07-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/photo.n: [$photo put] has been able to take rectangles of
- pixel colours, specified as lists of lists, for years. Now this
- is a documented feature. [Bug 728952]
-
- * generic/tkPanedWindow.c (PanedWindowReqProc): Fix from Eric
- Boudaillier so panedwindows get their geometry right even when
- their children don't know their size initially. [Bug 738143]
- * doc/panedwindow.n: Removed sentences about the use of [update
- idletasks] with this command, as that is no longer necessary with
- the fix from Bug 738143. [Bug 747814]
-
- * generic/tkImgPhoto.c (ImgPhotoCmd): Rewrote subcommand processing
- to never jump to the end of the switch. I find that confusing as
- I can't see whether there's processing still to be done from a
- quick glance at the code, unlike with a direct return. [Bug 771988]
- (ImgPhotoCmd, ImgPhotoSetSize, ImgPhotoInstanceSetSize): Try harder
- to avoid zero-length mallocs()... [Bug 404421]
-
-2003-07-16 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkPack.c (ConfigureSlaves): silence compiler warning
- [Bug 771982]
-
-2003-07-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinImage.c (XGetImage): correct init of biSizeImage in
- bitmap header. [Bug 703697] (cap)
-
-2003-07-17 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/frame.test:
- * generic/tkFrame.c (CreateFrame): Make sure all options can be set
- to their default value. [Bug #697652]
-
-2003-07-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkPanedWindow.c (ArrangePanes): Ensure that the last pane
- * tests/panedwindow.test: shrinks instead of being clipped when
- resized below the reqsize. [Bug 748277] (spjuth)
-
- * generic/tkWindow.c (Initialize): do not free uninit'ed dstring.
- [Bug 755906] (mistachkin)
-
-2003-07-15 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/tkUnixEvent.c (TkpCloseDisplay): Don't
- test for XCloseIM bug when the XFree86 version
- is newer than 4.0 since the layout of the
- XIM structure has changed. The check is not
- needed for newer XFree86 releases since
- the bug we are checking for was fixed in
- the 4.2.99.2 release. [Bug 755530]
-
-2003-07-15 Don Porter <dgp@users.sourceforge.net>
-
- * README: Bumped patchlevel to 8.4.4 in preparation
- * generic/tk.h: for the Tk 8.4.4 release.
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in:
-
- * unix/configure: autoconf (2.13)
- * win/configure:
-
-2003-07-15 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * generic/tkMenu.c
- * generic/tkMenu.h
- * generic/tkMenuDraw.c:
- * tests/menu.test: fixed complex bug in menu clone cleanup
- [Bug#465324] and removed 'knownBug' from a test.
- (This was applied to cvs head on 2003-05-03).
-
-2003-07-09 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/send.test: Strengthened constraints to stop accidental
- smashing of Xserver access; some systems (*ahem* mine *ahem*)
- require xhost-style security for all use... :^/
-
-2003-07-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImage.c (TkDeleteAllImages,etc.): Stopped the deleting
- of hash entries from a table that has just been deleted by this
- function when some images are Tcl_Preserve()d... [Bug 749353]
-
-2003-05-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.3 TAGGED FOR RELEASE ***
-
- * changes: updated for 8.4.3
-
- * unix/Makefile.in: do not run autoconf during 'make dist' as the
- configure is now a CVS-maintained file and should be up-to-date.
-
-2003-05-19 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: changed tkConfig.sh location
- in versioned framework subdirectories to be identical to location
- in framework toplevel; fixed stub library symbolic links to be
- tk version specific.
-
-2003-05-15 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README: Bumped version to 8.4.3
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure:
- * win/configure.in:
-
- * unix/tkUnixFont.c: use gb2312-raw as the alias for gb2312*
- charset fonts. gb2312.enc was made to be euc-cn for Tcl because
- that is what is most often meant, but X really wants the original
- (-raw) gb2312 encoding. [Bug 557030]
-
-2003-05-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/msgs/fr.msg: updated msg catalog. [Bug #737790] (zolli)
-
-2003-05-13 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXInit.c (TkpInit): use new versioned bundle
- resource API to get tk runtime library for TK_VERSION. [Bug 736774]
-
-2003-05-13 Daniel Steffen <das@users.sourceforge.net>
-
- backport of Mac OS X specific changes on trunk since 8.4.2:
-
- * macosx/tkMacOSXClipboard.c (TkSelGetSelection): Convert
- '\r' to '\n' on the way into Tcl. (ingham)
-
- * macosx/tkMacOSXMenu.c (EventuallyInvokeMenu): New function,
- used to invoke menu commands at idle time.
- (TkMacOSXDispatchMenuEvent): Don't immediately dispatch menu
- commands, wait till the idle loop to do so. This is more like
- what is done on Windows, and avoids the crash from destroying
- a menu in it's command. (ingham)
-
- * macosx/tkMacOSXHLEvents.c (ReallyKillMe): Don't force the shell
- to exit. According to the OS X HI guidelines, it should be
- possible to cancel an attempt to quit, and if we force the kill,
- here, it would not be possible to implement this. (ingham)
-
- * macosx/tkMacOSXApplication.r (removed):
- * macosx/tkMacOSXLibrary.r (removed):
- * macosx/tkMacOSXResource.r (removed):
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/tkAboutDlg.r: updated copyrights, cleaned up about box,
- removed obsolete unused resource files. (steffen)
-
-2003-05-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCanvPoly.c (PolygonToPostscript):
- * tests/canvPs.test: correct crash when generating postscript for
- a single-line polygon (point) with no color. [Bug #734498] (wilm)
-
-2003-04-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXButton.c (TkpDisplayButton): correct typo for
- stippleGC [Bug #730124].
-
-2003-04-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkButton.h: Rewrote the handling
- * generic/tkButton.c (TkButtonWorldChanged): of compound *buttons
- * mac/tkMacButton.c (TkpDisplayButton): to correctly display
- * macosx/tkMacOSXButton.c (TkpDisplayButton): mixture of disabledfg,
- * unix/tkUnixButton.c (TkpDisplayButton): selectcolor, indicator,
- * win/tkWinButton.c (TkpDisplayButton): etc. *buttons will
- now only stipple the image, unless no disabledfg is given, in which
- case it will stipple the whole button.
-
- * library/bgerror.tcl: make bgerror dialog topmost on Windows to
- prevent it being covered by other windows.
-
- * unix/tkUnixButton.c (TkpDisplayButton): Use the normalTextGc when
- * win/tkWinButton.c (TkpDisplayButton): displaying disabled text
- that have images, as they get a gray50 stipple as well and the
- disabledGc is not set up correctly for font drawing. [Bug #477740]
-
-2003-04-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCanvBmap.c: s/CreateBitmap/TkcCreateBitmap as Windows
- has a CreateBitmap function already.
-
- * generic/tkCursor.c: s/GetCursor/TkcGetCursor as Windows has a
- GetCursor func already, which causes compiler warnings.
-
-2003-04-02 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/configure: Regen.
- * win/configure.in: Set stub lib flag based
- on new LIBFLAGSUFFIX variable.
- * win/tcl.m4: Update from Tcl to get new
- LIBFLAGSUFFIX variable.
-
-2003-04-02 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/configure: Regen.
- * win/configure.in: Don't set TCL_DLL_FILE,
- TCL_LIB_FILE, TCL_STUB_LIB_FILE, TCL_STUB_LIB_FLAG,
- and TCL_BUILD_STUB_LIB_SPEC. These variables are
- already set in tclConfig.sh.
- [Bug 691908]
-
-2003-03-22 Kevin Kenny <kennykb@acm.org>
-
- * win/makefile.vc:
- * win/rules.vc: Corrected several problems that prevented
- OPTS=symbols from building properly. [Patch 707792] Thanks
- to Joe Mistachkin for the fixes.
-
-2003-03-18 Don Porter <dgp@users.sourceforge.net>
-
- * tests/unixWm.test (unixWm-41.2): Corrected typo in 2003-03-13
- commit. Thanks Larry Virden. [Bug 705567]
-
-2003-03-18 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Makefile:
- * macosx/README: added support for giving 'make' the location
- of Tcl.framework and tclsh to build and link against.
-
- * macosx/tkMacOSXXStubs.c: fixed crash in [winfo server].
-
-2003-03-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/msgbox.tcl (Tk::MessageBox): Stop buttons from being
- very wide when a messageBox has a lot of content. [Bug #701812]
-
-2003-03-13 Don Porter <dgp@users.sourceforge.net>
-
- * tests/unixWm.test: Constrained all tests older than revision 1.21
- to run only on Unix. Alternative approach did not match maintainer
- habits.
- * tests/spinbox.test (spinbox-17.4): Avoid long failure message.
-
-2003-03-13 Kevin Kenny <kennykb@users.sourceforge.net>
-
- * win/makefile.vc: Backed the version to 8.4 on the 8.4 branch.
- (I just loathe sticky tags).
-
-2002-03-11 Kevin Kenny <kennykb@users.sourceforge.net>
-
- * win/makefile.vc: Backported the code that makes the makefile
- build pkgIndex.tcl as part of the install step.
-
-2003-03-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.2 TAGGED FOR RELEASE ***
-
-2003-02-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/bind.test (bind-16.44):
- * generic/tkBind.c (ExpandPercents): Only allow events to see
- those expansions that are actually valid for them, and force the
- substitution of the rest as "??". This stops some crashes on
- Windows and gets rid of bogus values everywhere. [Bug #612110]
-
-2003-02-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/README: correct 8.4.3 refs to 8.4.2.
-
- * unix/README: replace version refs with version-agnostic wording.
-
-2003-02-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinInt.h:
- * win/tkWinDraw.c:
- * win/tkWinFont.c (Tk_DrawChars): add support for simple XOR text
- drawing on Windows. [Patch #685388] (martin)
-
- * generic/tkMenu.c (TkMenuCleanup): make sure to reset static
- menusInitialized on finalize. [Bug #548729]
-
-2003-02-25 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXHLEvents.c: fixed conversion of apple event
- parameters to posix style path names.
- [Bug #621672] (steffen, Benjamin Riefenstahl)
-
- * macosx/tkMacOSXDialog.c:
- * macosx/tkMacOSXWm.c:
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/tkMacOSXUtil.c (removed):
- * macosx/tkMacOSXUtil.h (removed): removed all references to
- tkMacOSXUtil.{c,h}, made obsolete by the patch above. [Bug #621672]
-
-2003-02-24 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixFont.c (CreateClosestFont, CanUseFallback): use the
- first best font match in user font path. [Bug #647497] (dal zotto)
-
- * generic/tkListbox.c (ListboxSelectionSubCmd):
- * tests/listbox.test: Allow 'selection includes' to respond when
- disabled (but only 'includes'). [Bug #632514]
-
- * unix/tkUnixButton.c (TkpDisplayButton): Correct visual display
- of disabled check/radiobutton to be more distinctive on unix.
- * tests/unixButton.test: [Bug #669595] (hintermayer)
-
- * doc/panedwindow.n: clarified the need to use 'update idle' when
- adding unmapped windows. Needs further examination. [Bug #605105]
-
- * generic/tkEntry.c (SpinboxWidgetObjCmd, EntryWidgetObjCmd):
- * tests/entry.test: return 1 if selection is present even if
- * tests/spinbox.test: entry/spinbox is disabled, as selection get
- will still return the selection (although selection still ignore
- modify requests when entry/spinbox is disabled). [Bug #637828]
-
-2003-02-24 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
-
- * tkMacOSXDialog.c (NavServicesGetFile): Fix bug with
- kNavCtlSetSelection - control data should be a pointer
- not a handle.
-
-2003-02-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/clrpick.tcl (color::BuildDialog):
- * library/msgbox.tcl (MessageBox): Yet more places that did
- complex and fragile width calculations instead of using grid,
- though with these it is the -uniform option that saves the day.
-
- * library/tkfbox.tcl (file::Create): This procedure was really
- very crufty in how it went about creating the GUI. It is far
- easier and more robust to use the grid geometry manager than it is
- to tune the results of pack with tweaks to -width. [Bug #673722]
-
- * library/comdlg.tcl (FDGetFileTypes): Set an upper limit on how
- long a file type item description string can get due to appending
- of types. [Bug #617392]
-
- * tests/panedwindow.test (panedwindow-30.1):
- * generic/tkPanedWindow.c (DisplayPanedWindow, DisplayProxyWindow):
- Use the window's depth, not the screen's default depth. [Bug #671122]
-
-2003-02-20 Daniel Steffen <das@users.sourceforge.net>
-
- * library/console.tcl: (aqua & macintosh) added missing <Cmd-q>
- binding for corresponding Quit menu item shortcut.
-
- * macosx/README: updated instructions for embedded build,
- added various improvements by Russell Owen.
-
- * unix/tcl.m4: update from Tcl.
- * unix/configure: regen.
-
-2003-02-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinScrlbr.c (UpdateScrollbar): use SIF_DISABLENOSCROLL to
- "disable" scrollbar when on Windows when there is nothing to
- scroll. This is Windows style, and fixes [Bug #624116].
-
- * tests/panedwindow.test:
- * generic/tkPanedWindow.c (ValidSashIndex): corrected to note that
- 2 panes must exist before any one sash does. [tcllib Bug #689258]
-
-2003-02-20 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/panedwindow.test:
- * generic/tkPanedWindow.c: Fixed calculation of the last slave's
- size when increasing the size of the panedwindow. [Bug #689099]
-
-2003-02-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImgGIF.c (GetDataBlock): Removed pointless static
- variable ZeroDataBlock [Bug #664788]
-
- * unix/tkUnixFont.c (CanUseFallback): Added argument, passed
- through from callers to FindSubFontForChar(), so that pointers
- into the old subfont table to be updated when that table is
- reallocated, avoiding a (sometimes fatal) FMR.
- [Bugs #618872 and #689357]
-
-2003-02-19 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/tkMacOSXKeyEvent.c: fix for uninitialized var warning.
-
-2003-02-19 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXMouseEvents.c (GeneratePollingEvents): In the case
- where there was a capture window, we were sending the events to
- the capture window. But the capture window (return value or
- TkMacOSXGetCapture) is always a toplevel. So this is wrong in
- the case that the Event's toplevel IS the capture window - in
- which case the event should go to the subwindow most closely
- containing the event.
-
-2003-02-19 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
- & Jim Ingham <jingham@apple.com>
-
- This patch changes the default Tk behavior so that events
- are by default routed to the standard event handlers after
- Tk has looked at them.
-
- * macosx/tkMacOSXEvent.h: Rename "handledByTk" into
- "stopProcessing".
-
- * macosx/tkMacOSXEvent.c: Update erroneous comments and
- remove unused includes.
- (TkMacOSXProcessAppleEvent): Don't declare events
- handled that we didn't even look at.
- (TkMacOSXProcessEvent): Add a comment on policy for
- "stopProcessing".
- (TkMacOSXProcessEvent): Remove "handling" of events that
- are not our business.
- (TkMacOSXProcessEvent): Rename "handledByTk" into
- "stopProcessing".
- (ReceiveAndProcessEvent): Ditto.
- (ReceiveAndProcessEvent): Tune error production of
- message.
-
- * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent):
- Rename "handledByTk" into "stopProcessing".
-
- * macosx/tkMacOSXWindowEvent.c: Ditto.
-
- * macosx/tkMacOSXMouseEvent.c: Remove setting of
- "handledByTk".
- (TkMacOSXProcessMouseEvent): Handle clicks in the "traffic
- lights" in the window title when the window (or app) is
- in the background.
-
-
- This patch changes the key event handling to use the MacOS
- translation mechanisms. It also improves dead key handling.
-
- * macosx/tkMacOSXKeyEvent.c (InitKeyData): Add.
- (InitKeyEvent): Add.
- (DecodeViaUnicodeResource): Rename
- KeycodeToUnicodeViaUnicodeResource.
- (DecodeViaKCHRResource): Rename KeycodeToUnicodeViaKCHRResource.
- (GetKeyboardLayout): Use a boolean flag instead of a special
- layout id.
-
- (KeycodeToUnicodeViaUnicodeResource): Change interface and
- implementation to return a Unicode string instead of directly
- filling an XEvent.
- (KeycodeToUnicodeViaKCHRResource): Ditto.
- (KeycodeToUnicodeViaUnicodeResource): Add handling for callers
- that don't want deadkey processing (i.e. XKeycodeToKeysym).
- (KeycodeToUnicodeViaKCHRResource): Ditto.
- (KeycodeToUnicodeViaUnicodeResource): Clear deadKeyState if a
- character was produced.
- (KeycodeToUnicodeViaKCHRResource): Use CFString and current
- keyboard encoding instead of Tcl Tcl_ExternalToUtf() and fixed
- TkMacOSXCarbonEncoding.
- (TkMacOSXKeycodeToUnicode): Add.
-
- (TkMacOSXProcessKeyboardEvent): Add some heuristics to improve
- keyup events.
- (deadKeyState): Split into deadKeyStateUp and deadKeyStateDown.
- (GenerateKeyEvent): Change interface and implementation to accept
- a Unicode string instead of individual characters.
- (GenerateKeyEvent): Don't generate string representations for
- special characters.
-
- * macosx/tkMacOSXEvent.h (TkMacOSXKeycodeToUnicode): Add
- prototype.
-
- * macosx/tkMacOSXKeyboard.c (KCHRPtr): Remove.
- (XKeycodeToKeysym): Use TkMacOSXKeycodeToUnicode instead of
- KeyTranslate.
- (XKeycodeToKeysym): Support latin-1 keysyms.
-
- This patch reverts the hack to put icons in menus that Vince put
- in yesterday (but preserves the bug fix in that submission.)
-
- * macosx/tkMacOSXMenu.c (SetMenuTitle): revert treating
- "<bullet> number" as a request to put icon number <number> in
- the menu.
-
-2003-02-18 Mo DeJong <mdejong@users.sourceforge.net>
-
- * doc/entry.n:
- * doc/text.n: Update double and triple click
- docs to match implementation changes made on
- 2002-02-14.
-
-2003-02-19 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Makefile: reworked embedded build to no longer require
- relinking but to use install_name_tool instead to change the
- install_names for embedded frameworks. [Bug #644510]
-
-2003-02-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/widget: New part for the widget demo showing
- * library/demos/unicodeout.tcl: Tk's UNICODE output. [Patch #627453]
-
-2003-02-18 Andreas Kupries <andreask@activestate.com>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl (HP xnet [Bug #651811]).
-
-2003-02-18 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2003-02-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkText.c (TextWidgetCmd): remove unused lastEnd var.
- [Bug #664790]
-
- * generic/tkCanvPs.c (TkPostscriptImage): remove unused depth var.
- [Bug #664787]
-
- * generic/tkEntry.c (EntrySetValue): removed unused code var.
- [Bug #664781]
-
- * library/tk.tcl (::tk::TabToWindow): auto-highlight spinboxes as
- well as entries when tabbing in. [Patch #683813] (bron)
-
- * library/xmfbox.tcl (::tk::MotifFDialog_ActivateSEnt): correct
- sub on embedded newlines. [Patch #688572] (bonfield)
-
- * doc/colors.n: corrected B values [Bug #682714].
-
- * win/tkWinInit.c (TkpDisplayWarning): truncate MessageBox string
- to 1024 chars to prevent possible oversized window errors. May be
- necessary in other MB uses (ie Tcl_AppInit). [Tcl Bug #608559]
-
-2003-02-18 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * macosx/tkMacOSXMenu.c: (SetMenuTitle) fix to utf encoding
- problem when setting menu titles, and provisional support
- for icons. [Tcl Bug #625080]
-
-2003-02-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImgGIF.c (FileReadGIF): Ensure that the trashBuffer is
- always deallocated on function exit to stop a potential memory leak.
-
-2003-02-17 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkEvent.c (Tk_HandleEvent): Fixup button
- press state saving code, it was incorrectly converting
- normal motion events into button press and motion
- events in some cases.
- * generic/tkInt.h: Add mouseButtonWindow member
- to the TkDisplay structure.
- * tests/event.test: Add test case for faulty
- button motion logic.
-
-2003-02-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README: Bumped to 8.4.2.
- * generic/tk.h:
- * macosx/Wish.pbproj/project.pbxproj:
- * unix/configure:
- * unix/configure.in:
- * unix/tcl.m4:
- * unix/tk.spec:
- * win/configure:
- * win/configure.in:
-
- * unix/tcl.m4: correct HP-UX ia64 --enable-64bit build flags
-
-2003-02-13 Kevin Kenny <kennykb@users.sourceforge.net>
-
- * doc/wish.n: Added language to describe the handling of
- the end-of-file character \u001a in script files. [Bug 685505]
-
-2003-02-10 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXCursor.c (TkMacOSXInstallCursor): Set all theme
- cursors using SetThemeCursor or SetAnimatedThemeCursors.
- (TkGetCursorByName): Use the theme cursors for arrow, ibeam, etc.
- Allow animatedCursor{NUM} form for an animated cursor with count.
- (TkpSetCursor): Don't reset the cursor if there is no change.
- * macosx/tkMacOSXMouseEvent.c (GeneratePollingEvents): Don't
- directly call TkMacOSXInstallCursor, it gets called by the call
- to Tk_UpdatePointer immediately above.
-
-2003-02-05 Fred Fish <fnf@intrinsity.com>
-
- * macosx/tkMacOSXWm.c (Tk_SetGrid): Fix precedence problem with
- * mac/tkMacWm.c (Tk_SetGrid): '==' and '|'.
-
-2003-02-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCanvArc.c (CreateArc): Rework canvas create item
- * generic/tkCanvBmap.c (CreateBitmap): type coords handling to be
- * generic/tkCanvImg.c (CreateImage): consistent across types
- * generic/tkCanvPoly.c (CreatePolygon): and not pass empty coords
- * generic/tkCanvLine.c (CreateLine): to item creation procs.
- * generic/tkCanvText.c (CreateText):
- * generic/tkCanvWind.c (CreateWinItem):
- * generic/tkCanvas.c (CanvasWidgetCmd CANV_CREATE):
- * generic/tkRectOval.c (CreateRectOval):
- * tests/canvRect.test:
- * tests/canvText.test:
- * tests/canvas.test:
-
-2003-01-28 Joe English <jenglish@users.sourceforge.net>
-
- * generic/tkInt.h (TkDisplay,TkMainInfo):
- * generic/tkObj.c (windowObjType):
- * generic/tkWindow.c (Tk_DestroyWindow):
- * tests/wm.test (wm-deletion-epoch-1.1):
- Moved 'deletionEpoch' field from TkDisplay to TkMainInfo.
- Reworked windowObj type. Fixes Tk Bug #671330 "segfault when e.g.
- deiconifying destroyed window"
-
-2003-01-23 D. Richard Hipp <drh@hwaci.com>
-
- * library/entry.tcl: Fix the KeyPress binding on the entry widget
- so that it enters text from left to right (not right to left) even
- if the mouse button is being held down. [Bug #673687]
-
-2003-01-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkFrame.c (TkToplevelWindowForCommand): Added way of
- mapping from command names to tkwins-for-toplevels.
- * generic/tkImage.c (Tk_ImageObjCmd): Added check to make sure
- that you're not creating an image named the same as .'s command,
- which refixes 220891, even when the name of the command has been
- changed with 'rename'. The error message is better too.
- * tests/image.test (image-1.10,image-1.11): Updated to match new
- error message and added test for the rename case.
-
-2003-01-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkImage.c (DeleteImage): delete the image's entry in the
- image table correctly when there are no more instances. This
- reopens bug 220891. [Bug #669759]
-
-2003-01-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/loadTk.n: note that ::safe::loadTk has a prereq on
- ::safe::interpCreate or ::safe::interpInit. [Bug #669159]
-
- * doc/photo.n: $image put only accepts -format and -to, and note
- extended use of -to.
-
-2003-01-17 D. Richard Hipp <drh@hwaci.com>
- * generic/tkCanvUtil.c: The clipping algorithm introduced on 2003-01-08
- was unnecessarily aggressive in reducing the size of the clipping box.
- This did not cause a problem for normal display, but did create
- trouble for some extensions that attempt to render a canvas on a
- GDI printer under Windows. The patch here relaxes the constraints on
- the clipping box somewhat. [Bug #663981]
-
-2003-01-14 Joe English <jenglish@users.sourceforge.net>
- * generic/tkSelect.c (Tk_CreateSelHandler):
- Fix for #666346 "Selection handling crashes under KDE 3.0"
- * tests/unixSelect.test (unixSelect-1.20): Added test case.
-
-2003-01-13 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd,
- ChooseDirectoryValidateProc, Tk_MessageBoxObjCmd):
- Remove unused tsdPtr variable. Use TEXT macro
- instead of _T macro since _T does not work
- under Cygwin. Declare flags as UINT to avoid
- compiler warning when compiling with mingw.
-
-2003-01-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/Makefile.in: Add TCL_DEFS to AC_FLAGS
- so that compiler flags defined by Tcl get
- passed to the compiler. Add empty rule
- for cat.c so that Tk compiles under msys.
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl, this pulls
- in a subst of TCL_DEFS, it also defines
- USE_THREAD_ALLOC when threads are used
- and it updates the SC_ENABLE_SYMBOLS
- and SC_PROG_TCLSH macros to match the
- ones used in Tcl.
-
-2003-01-10 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixEvent.c (OpenIM): Remove unused variable
- (Fixes: #664780 "SGI warning: OpenIM")
-
-2003-01-08 D. Richard Hipp <drh@hwaci.com>
-
- * generic/tkCanvLine.c:
- * generic/tkCanvas.h:
- * generic/tkCanvUtil.c: Clip long lines so that they will display
- properly even on windowing systems where coordinates are expressed
- as 16-bit numbers. [Bug #663981]
-
-2003-01-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkFrame.c (CreateFrame): throw a Tcl error instead of a
- panic when we cannot get a main window and appname is NULL. This
- can indicate that a user tried to create a frame/toplevel while Tk
- was dying. [Bug #661792]
-
-2002-12-27 David Gravereaux <davygrvy@pobox.com>
-
- * generic/tkText.h: ANSI unfriendly typedef for TkTextBTree
- repaired for C++ compilers.
-
-2002-12-27 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixWm.c (WaitForEvent): process Map and Unmap events
- as well as Configure events during WaitFor{Configure|Map}Notify.
- Fixes [Bug 578569] (WaitForMapNotify could process Map and Unmap
- events out of order, making Tk think a window was unmapped when
- it really wasn't).
-
-2002-12-18 Todd M. Helfter <tmh@purdue.edu>
-
- * doc/label.n: Fixed documentation of the -compound option to
- the label widget. The option was simply missing from the
- man page [Bug 577540]
-
-2002-12-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/photo.n: Fixed documentation of the put subcommand to no
- longer talk about files and to mention that you can use colour
- names for working with solid colours. [Bug 640026]
-
-2002-12-13 Don Porter <dgp@users.sf.net>
-
- * generic/tkMain.c (Tk_Main): Call on Tcl*StartupScript*() routines
- to store the startup script, if any. [Bug 616245].
-
-2002-12-10 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: tclThreadTest.obj not required to link
- tktest.exe [Bug 651396]
-
-2002-12-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkEntry.c (ConfigureEntry): keep a flag to indicate when
- a var is traced to prevent double-traces caused by configuring the
- widget in traces with validation on. (dejong)
-2002-12-07 Jeff Hobbs <jeffh@ActiveState.com>
+ * unix/configure: autoconf-2.59
- * generic/tkInt.decls: add TkWinSetHINSTANCE decl
- * generic/tkIntPlatDecls.h: regen
- * generic/tkStubInit.c: regen
- * win/tkWinInit.c (TkpInit): While init and cleanup aren't correct
- * win/tkWinX.c (TkWinXInit): in DllMain, we had to specify the
- * win/tkWin32Dll.c (DllMain): true HINSTANCE or the resources of a
- dynamic Tk weren't being loaded correctly. Created a new function
- TkWinSetHINSTANCE for this purpose.
+2005-04-22 George Peter Staplin <GeorgePS@XMission.com>
-2002-12-06 Jeff Hobbs <jeffh@ActiveState.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.
- * win/tkWinX.c (TkWinXInit): Move cleanup into an exit handler
- * win/tkWin32Dll.c (DllMain): to ensure that it will be called
- * win/tkWinWm.c (TkWinWmCleanup): without having to unload the dll.
- Also reset the static int initialized on cleanup to allow reinit.
+2003-04-18 Joe English <jenglish@users.sourceforge.net>
-2002-12-01 Mo DeJong <mdejong@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]
- * tests/event.test (_keypress, _text_ind_to_x_y): Force focus to
- widget in _keypress method to avoid problems with window managers
- that use focus follows mouse. [Bug 526209]
+2003-04-18 Vince Darley <vincentdarley@users.sourceforge.net>
-2002-12-01 Mo DeJong <mdejong@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.
- * tests/wm.test: Add wm-transient-6.3 to check that a transient
- remains withdrawn when it is first withdrawn and then turned into
- a transient.
- * unix/tkUnixWm.c:
- * win/tkWinWm.c: Replace WM_TRANSIENT_WITHDRAWN with WM_WITHDRAWN
- and set this flag whenever a window is explicitly withdrawn. This
- fixes the test case added above. [Bug 644356]
-
-2002-11-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/textDisp.test:
- * generic/tkTextDisp.c (TkTextSeeCmd): handle see for unmapped
- text displays. [Bug #641778]
-
-2002-11-19 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c (TkpDisplayScrollbar): If the
- scrollbar width is set to 12 or less (but 12 is what you
- should use) use the small metric scrollbar.
-
- (UpdateControlValues): Fix thinko in setting off AUTO_ADJUST for
- the place geometry manager.
-
-2002-11-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in: add macosx/*.tcl (buildTkConfig.tcl in
- particular) to the dist target.
-
-2002-11-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkWindow.c (Tk_DestroyWindow, DeleteWindowsExitProc):
- Add TkHalfdeadWindow type and halfdeadWindowList to keep track of
- windows that were only partially deallocated before a call to
- exit. Finish cleaning up these windows in DeleteWindowsExitProc.
- Keep track of cleanup status in Tk_DestroyWindow so that a window
- with a Destroy binding which calls exit will get fully destroyed.
- * tests/window.test: Add Tk_DestroyWindow tests for an assortment
- of half dead window cases. [Bug 630533]
-
-2002-11-10 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: fixed erroneous
- removal of libtkstub before Wish was built.
-
-2002-11-07 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/unixWm.test: Add short delay to test unixWm-51.7
- to account for raise/lower changes in TIP 107. This allows
- the test case to pass under Window Maker on Linux.
-
-2002-11-07 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/place.test:
- * generic/tkPlace.c: place info did not return all settings,
- and didn't make sure the result was a proper list.
- Put '-in' first in result to be more consistent with how
- grid/pack info behaves. [Bug #635025][Bug #532022]
-
-2002-11-07 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in: added macosx/README to dist target.
- * macosx/Wish.pbproj/project.pbxproj: fix to 'wish' script
- to allow it to work when not installed into '/'.
-
-2002-11-06 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
- * win/configure: Regen.
- * win/configure.in: Check that AR, RANLIB, and RC
- are found on the path when building with gcc.
-
-2002-11-04 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: added Wish linker flag
- -headerpad_max_install_names to allow use of 'install_name_tool'.
- fixed tkConfig.sh generation and redo_prebinding in the case where
- Tk is not installed alongside Tcl.
-
-2002-11-03 David Gravereaux <davygrvy@pobox.com>
-
- * win/winMain.c (Tcl_AppInit): Calls Registry_Init() and
- Dde_Init() when STATIC_BUILD and TCL_USE_STATIC_PACKAGES macros
- are set.
-
- * win/makefile.vc: linkexten option now sets the
- TCL_USE_STATIC_PACKAGES macro which also adds the registry and
- dde static lib files to the link of the shell. [Patch 479697]
-
- * win/rules.vc: Matches the one from Tcl.
-
- * win/buildall.vc.bat: More useful commentary.
-
-2002-11-01 Andreas Kupries <andreask@activestate.com>
-
- * win/makefile.vc (TCLREGLIBNAME): Updated to registry 1.1.
-
-2002-10-29 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/README: added info on new package searching in
- Frameworks directories.
-
-2002-10-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.1 TAGGED FOR RELEASE ***
-
- * changes: updated for 8.4.1 release
-
-2002-10-21 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/README: revised according to Jim's suggestions
- * macosx/tkMacOSXAppInit.c: use standard PATH_MAX from <limits.h>
-
-2002-10-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/winMain.c (WinMain, main): remove obsolete SetMessageQueue call
-
- * win/configure: Regen.
- * win/tcl.m4 (SC_CONFIG_CFLAGS): Check for bug in Cygwin version
- of windres and work around that case by passing a POSIX path
- instead of a Windows native path. One can't always pass a POSIX
- path because the mingw native toolchain accepts only Windows
- native paths. (dejong)
-
- * win/tkWinPort.h: define OPEN_MAX only if not defined.
- [Patch #625472] (howell)
-
-2002-10-18 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacAppInit.c: removed tcltest dependency.
- [Bug #592639] (porter)
-
-2002-10-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/imgPhoto.test:
- * generic/tkImgPhoto.c (ImgPhotoConfigureMaster): fix arg handling
- for missing -format or -data options. [Bug #624974]
-
- * tests/text.test: properly return the number of
- * unix/tkUnixFont.c (ControlUtfProc): bytes consumed. [Bug #624732]
-
-2002-10-17 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/README: info specific to building and running
- TclTk on Mac OS X, answers to tcl-mac list FAQs.
- * macosx/Makefile: permission fix after embedded install.
- * macosx/Wish.pbproj/project.pbxproj: after install, fix
- permissions of uninstalled products.
-
-2002-10-17 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: added TEXT document
- type to plist so that files can be dragged onto Wish Shell.
-
- * macosx/tkMacOSXInt.h:
- * macosx/tkMacOSXInit.c:
- * macosx/tkMacOSXFont.c: added private proc
- TkMacOSXUseAntialiasedText() to enable/disable quickdraw
- text antialiasing where available, default is enabled.
- Added a linked boolean ::tk::mac::antialiasedtext with
- write trace to allow control of antialiasing from tcl.
-
-2002-10-16 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * macosx/tkMacOSXMenu.c: fix to accelerators shown in menus
- with non-alphanumeric keys.
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXKeyboard.c: applied first patch from [Patch
- #622582] to fix some of [Bug #616988]. Further work is needed
- in this area, but this will let foreign keyboards at least work
- reasonably with Tk.
-
-2002-10-15 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure:
- * unix/tcl.m4: add AIX-5 ppc build support. Remove unused
- SC_ENABLE_MEMDEBUG.
-
- * win/configure:
- * win/tcl.m4: Add --enable-shared=mem support.
-
-2002-10-10 Peter Spjuth <peter.spjuth@space.se>
-
- * tests/grid.test:
- * generic/tkGrid.c: The grid size was not updated properly
- when removing a widget from a grid. [Bug #621241] (forssen)
-
-2002-10-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/canvPs.test: tests for canvas embedded window ps generation
- * generic/tkCanvWind.c (CanvasPsWindow): removed dead code loop.
- * generic/tkCanvas.h: moved TkColormapData struct to tkCanvPs.c
- * generic/tkCanvPs.c (TkImageGetColor): corrected bogus use of
- TkColormapData on Windows (Windows now requires RGB pixel data
- from image).
- * win/tkWinImage.c (XGetImage, XGetImageZPixmap): added support
- for generating ps for embedded widgets on canvases on Windows,
- tested for 8, 16, 24 and 32-bit depths (XGetImageZPixmap not used).
-
- * library/tk.tcl: simplified the adding of extra <ISO_Left_Tab>
- and <hpBackTab> events to <<PrevWindow>>.
-
-2002-10-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/README: doc'ed --enable-symbols options.
- * unix/Makefile.in: comment docs
- * unix/configure: regen
- * unix/tcl.m4: replaced SC_ENABLE_MEMDEBUG with a more intelligent
- SC_ENABLE_SYMBOLS that takes yes|no|mem|all as options now.
-
-2002-10-09 Don Porter <dgp@users.sf.net>
-
- * generic/tk.h: Added reminder comment to edit
- macosx/Wish.pbproj/project.pbxproj when version number changes.
-
-2002-10-09 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Makefile: don't remove tclsh after building embedded.
-
- * macosx/Wish.pbproj/project.pbxproj: bumped version to 8.4.1;
- added missing library/mkpsenc.tcl to framework.
-
-2002-10-09 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkInt.decls(tkIntXlib): added XQueryTree declaration for
- mac & aqua, since it's now called from ParentXId via Tk_HandleEvent.
- * generic/tkIntXlibDecls.h:
- * generic/tkStubInit.c: regen.
- * mac/tkMacXStubs.c: added XQueryTree stub
-
- * mac/tkMacEmbed.c (TkpUseWindow): check that container window
- has -container option set (sync with other platforms).
-
- * mac/tkMacBitmap.c:
- * mac/tkMacFont.c:
- * mac/tkMacSend.c:
- * mac/tkMacTest.c:
- * mac/tkMacWm.c: CONSTification.
-
- * mac/tkMacProjects.sea.hqx: added tkStyle.c and tkUndo.c to
- tk library projects.
-
-2002-10-09 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImgPhoto.c (ImgPhotoSetSize): Only error-out if we
- fail to allocate a non-empty buffer; getting a NULL when we
- allocate an empty buffer is no problem since nothing will look at
- the value anyway. [Bug 619544]
- Also tidied up file to take into account the fact that we're using
- 32 bits per pixel in the master to accommodate the alpha channel
- as well as RGB.
-
-2002-10-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/winButton.test: add option clear to top to prevent option
- leakage from other tests causing problems. [Bug #582382]
-
- * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): leave the
- DestroyPanedWindow proc to free the pwPtr, add a Preserve
- reference to the pwPtr->tkwin.
- (DestroyPanedWindow): Release the pwPtr->tkwin.
-
- * generic/tkFocus.c (TkFocusFilterEvent): Ignore event if we are
- focusing into a dead window. [Bug #588831] (griffin)
-
-2002-10-02 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c (TkpDisplayScrollbar): Put the Tk scrollbar
- pointer into the control reference data for the Mac scrollbar, so we
- can get it out again in the ScrollbarActionProc.
-
-2002-10-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkText.c (TextBlinkProc): don't blink the cursor unless
- it is visible. [Bug #616791] [Patch #614474] (bonfield)
-
- * tests/entry.test: added entry-20.7
- * generic/tkEntry.c (EntryTextVarProc): check if the entry is
- being deleted before handling an associated textvariable.
- [Bug #607390 #617446]
-
-2002-10-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/unixSelect.test (unixSelect-1.1[89]): Altered these tests
- to work around [Bug #616923]
- * unix/tkUnixSelect.c (SelRcvIncrProc,TkSelPropProc): It turns out
- a much simpler and more robust solution is possible if we leverage
- Tcl's encoding engine by using the same code path as for the
- normal string selection. It might be a bit slower, but it should
- be a lot more correct. [Bug #614650]
-
-2002-09-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/panedwindow.test: added panedwindow-28.[12]
- * generic/tkPanedWindow.c (PanedWindowCmdDeletedProc):
- (Tk_PanedWindowObjCmd): when destroying the panedwindow, destroy
- the proxy before the parent to avoid dependency conflicts.
- [Bug #616589]
-
-2002-09-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/unixSelect.test: Test for various things that can fail to
- work in 8.4.0...
- * unix/tkUnixSelect.c (TkSelPropProc,SelRcvIncrProc): Incremental
- transfers of UTF8_STRING selections should now work; Tk will now
- tag them with the right size and only transfer complete UTF8
- characters. Previously, things only worked when the transfer
- could only happen in one go, and even then not always. [Bug 614650]
-
- * doc/bind.n: Doc-fix to mention that %A substitutes UNICODE
- characters rather than ASCII ones. Tk's done this ever since 8.1
- in any case; after all, it is the right thing to do.
-
-2002-09-27 Don Porter <dgp@users.sf.net>
-
- * README: Bumped to version 8.4.1 to avoid confusion
- * generic/tk.h: of CVS snapshots with release 8.4.0.
- * unix/README:
- * unix/configure.in:
- * unix/tk.spec
- * win/configure.in:
-
- * unix/configure: autoconf
- * win/configure:
-
-2002-09-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure: regen.
- * unix/tcl.m4: improve AIX-4/5 64bit compilation support.
-
- * unix/Makefile.in: add macosx subdir to dist target.
- Do not generate .Z, only .gz and .zip in alldist target.
-
-2002-09-18 Mumit Khan <khan@nanotech.wisc.edu>
-
- Added basic Cygwin support.
-
- * win/tcl.m4 (SC_PATH_TCLCONFIG): Support one-tree build.
- (SC_PATH_TKCONFIG): Likewise.
- (SC_PROG_TCLSH): Likewise.
- (SC_CONFIG_CFLAGS): Assume real Cygwin port and remove -mno-cygwin
- flags. Add -mwin32 to extra_cflags and extra_ldflags.
- Remove ``-e _WinMain@16'' from LDFLAGS_WINDOW.
- * win/configure: Regenerate.
-
- * win/tkWinPort.h (tchar.h): Do not include on Cygwin.
- (_T): Define for Cygwin.
- * win/winMain.c (main): Conditionally define.
-
-2002-09-26 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Makefile: preserve environment value of INSTALL_ROOT.
- When embedding only use deployment build. Force relink before
- embedded build to ensure new linker flags are picked up.
-
- * macosx/buildTkConfig.tcl (new):
- * macosx/Wish.pbproj/project.pbxproj: synthesize tkConfig.sh
- based on tclConfig.sh in Tcl.framework and tkConfig.sh.in.
- Add symbolic links to debug lib, stub libs and tkConfig.sh
- in framework toplevel. Made tkIntXlibDecls.h a public header
- since Headers/X11/Xlib.h includes it. Install wish8.4 script
- that runs "Wish Shell.app" and corresponding wish link.
- Use tcl headers from built Tcl.framework instead of from tcl
- source directory.
-
- * macosx/tkMacOSXPort.h: added missing standard unix includes
- and defines, similarly to tkUnixPort.h.
- * macosx/tkMacOSXNotify.c: removed dependency on internal tcl
- header "tclPort.h"
-
- * unix/Makefile.in:
- * unix/install-sh: copied support for 'install-strip' target
- over from tcl/unix/{Makefile.in,install-sh}
-
-2002-09-22 Jim Ingham <jingham@apple.com>
-
- * macosx/tkMacOSXScrlbr.c (UpdateControlValue): HiliteControl
- doesn't give the proper "nothing to scroll" look on Mac OS X.
- You have to set the min value greater than the max value to
- get this.
-
-2002-09-15 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
- * unix/tkUnixEvent.c (TkpCloseDisplay): Use PEEK_XCLOSEIM
- to examine the input context queue before invoking
- XCloseIM. Generate an assert if there is an input
- context that has not been freed.
- [Patch 570902]
-
-2002-09-13 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * generic/tk.h: Moved RC_INVOKED down so that tcl.h is still
- included when running the resource compiler. <tcl.h> excludes
- the unnecessary parts on its own. This reenables the Windows
- build. It failed because the non-inclusion of tcl.h caused the
- resource compiler to miss some vital macro definitions
- (TCL_FINAL_RELEASE, STRINGIFY, ...).
-
-2002-09-12 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tk.h:
- * mac/tkMacApplication.r:
- * mac/tkMacLibrary.r:
- * mac/tkMacResource.r:
- * macosx/tkAboutDlg.r:
- * macosx/tkMacOSXApplication.r:
- * macosx/tkMacOSXLibrary.r:
- * macosx/tkMacOSXResource.r: unified use of the two equivalent
- resource compiler header inclusion defines RC_INVOKED and
- RESOURCE_INCLUDED, now use RC_INVOKED throughout.
-
- * macosx/tkMacOSXAppInit.c: improved detection of Wish startup
- by the finder (by checking if stdin is /dev/null), in which
- case we want to bring up the Tk console window.
-
- * macosx/tkMacOSXHLEvents.c: added 'rapp' apple event handler.
-
-2002-09-12 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: reference & install
- tk/generic/prolog.ps instead of tk/library/prolog.ps.
-
-2002-09-10 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: added backwards
- compatibility for OSX 10.1 ProjectBuilder 2.0.
-
-2002-09-10 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/Makefile.in: added DYLIB_INSTALL_DIR variable for Darwin
- and set it to default value ${LIB_RUNTIME_DIR}
- * unix/tcl.m4 (Darwin): use DYLIB_INSTALL_DIR instead of
- LIB_RUNTIME_DIR in the -install_name argument to ld.
- * unix/configure: regen.
-
- * macosx/Wish.pbproj/project.pbxproj:
- * macosx/Makefile: added support for building Tcl as an embedded
- framework, i.e. using an dyld install_name containing
- @executable_path/../Frameworks via the new DYLIB_INSTALL_DIR
- unix/Makefile variable.
-
-2002-09-10 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4.0 TAGGED FOR RELEASE ***
-
-2002-09-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * macosx/tkMacOSXNotify.c (Tk_MacOSXSetupTkNotifier): corrected
- Mac Jaguar event loop issue.
-
- * library/tk.tcl: use command instead of control on Aqua bindings.
- Force dialogs to appear below fixed native Mac menubar.
- * macosx/tkMacOSXKeyEvent.c:
- * macosx/tkMacOSXKeyboard.c: Keypress/release events for pure
- modifier keys were not being passed to Tk.
- Deadkey presses were inserting null characters into text windows.
- Now they do nothing. (Still not ideal, but better than before!)
- * macosx/tkMacOSXMenu.c: Allow more than 200 menus to exist -
- increased to 2000.
- * macosx/tkMacOSXMouseEvent.c: Bad interactions between floating
- windows and ordinary ones. Ensure that local<->global coordinate
- transformations are wrt to the correct window.
- * macosx/tkMacOSXWm.c: Better error msg for 'wm attributes'.
- Remove crash in 'wm transient'.
- Add 'noActivates' and 'noUpdates' flags to unsupported command.
- [Patch #606658] (darley)
-
- * library/xmfbox.tcl (::tk::MotifFDialog_ActivateSEnt): corrected
- msgcat code with XPG specifier. [Patch #606719] (miller)
-
-2002-09-06 Don Porter <dgp@users.sf.net>
-
- * tests/unixWm.test (unixWm-50.3): Constrained test that hangs
- on Windows.
-
-2002-09-05 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: added overlooked missing
- TK_PATCH_LEVEL version bump to 8.4.0.
-
-2002-09-04 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * win/Makefile.in (install-libraries): Added code section to
- install the message catalogs. Copied same section from
- unix/Makefile.in and adapted it to the slightly different
- environment.
-
-2002-09-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/button.tcl: further restrict buttons to not resetting
- the "original" relief if it has changed in the interim. This
- prevents code that simulated overrelief buttons from not working
- in 8.4. [Bug #604270]
-
-2002-09-03 Daniel Steffen <das@users.sourceforge.net>
-
- * macosx/Wish.pbproj/project.pbxproj: Bumped version number to
- 8.4.0 and updated copyright info.
-
-2002-09-03 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * macosx/tkMacOSXWm.c: fix to 'wm attributes' error-handling bug.
-
-2002-09-03 Don Porter <dgp@users.sf.net>
-
- * changes: Updated for 8.4.0 release
-
-2002-09-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/cursor.test: reverted 2002-08-31 change for OS X to use
- 'heart' cursor because 'arrow' on windows has a pre-skewed use
- count. [Bug #602667]
-
- * tests/button.test: added button-14.1
- * win/tkWinButton.c (TkpComputeButtonGeometry): correct Win button
- sizing to be equal for one-line buttons with -height of 0 or 1, as
- well as -height 0 buttons with empty text and no image, which
- should be the same as single-line text buttons. [Bug #565485]
-
- * library/button.tcl (::tk::ButtonLeave): correctly restore state
- of button to normal for unix bindings. [Bug #597920]
-
- * doc/tk.n: added tk windowingsystem docs.
-
- * tests/wm.test:
- * unix/tkUnixWm.c: remove possible 2-second delay in 'raise'.
- [Patch #601518] (english) TIP #107
-
- * unix/tcl.m4: add support for 64-bit builds on HP-11 with gcc.
- * unix/configure.in: make sure to substitute LD_LIBRARY_PATH_VAR.
- * unix/configure: regend
-
- * README: Bumped version number to 8.4.0
- * generic/tk.h:
- * unix/configure:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure:
- * win/configure.in:
-
- * generic/tkCmds.c:
- * generic/tkWindow.c: made 'tk' available in safe interpreters,
- but only the caret and windowingsystem subcommands may be called.
- * tests/safe.test (safe-1.2): noted that tk is now available in
- safe interps, but not the appname/scaling subcommands.
-
- * tests/tk.test (tk-1.2): noted new tk windowingsystem subcommand
-
-2002-08-31 Daniel Steffen <das@users.sourceforge.net>
-
- * unix/tcl.m4: update from Tcl
-
- * unix/Makefile.in: import of TK_SHLIB_LD_EXTRAS for Tk library
- specific linker settings. Added use of new LD_LIBRARY_PATH_VAR.
-
- * unix/configure: regen
-
-2002-08-31 Daniel Steffen <das@users.sourceforge.net>
-
- *** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***
-
- * generic/tk.decls:
- * generic/tkInt.decls: added new "aqua" specific entries to the
- stubs tables. Changed all "unix" entries to "x11" to allow us to
- distinguish and build both "aqua" on MacOSX and "x11" on MacOSX.
-
- * generic/tk.h: added a #ifnded RESOURCE_INCLUDED so that tk.h can
- be passed to the resource compiler.
-
- * generic/tkCmds.c (Tk_TkObjCmd): added [tk windowingsystem]
- subcommand: returns "x11" when running on X11, "win32" on Windows,
- "classic" on MacOS9 and "aqua" on MacOSX Aqua (i.e. Carbon)
-
- * generic/tkFont.c (TkFontGetFirstTextLayout): new private function
- returning the first chunk of a Tk_TextLayout, i.e. until the first
- font change on the first line (or the whole first line if there is
- no such font change).
-
- * generic/tkMain.c: made Tcl_ThreadDataKey static
-
- * library/demos/puzzle.tcl: fixed button metrics for aqua
-
- * tests/cursor.test: check for presence of arrow cursor instead of
- heart cursor
-
- * xlib/xcolors.c: changed xColors static initialization to more
- standard C
-
- * macosx/Wish.pbproj/jingham.pbxuser (new):
- * macosx/Wish.pbproj/project.pbxproj (new): project for Apple's
- ProjectBuilder IDE.
-
- * macosx/Makefile (new): simple makefile for building the project
- from the command line via the ProjectBuilder tool 'pbxbuild'.
-
- * macosx/tkMacOSXAppInit.c (new): macosx specific AppInit looking
- for a AppMain.tcl file in its bundled Resources/Scripts folder. If
- present, argv[1] is set to that file and the Scripts folder is
- added to the auto_path. This allows tk apps to embed scripts within
- their bundle directory structure.
-
- * macosx/tkMacOSXInit.c (new): macosx adapted version of
- tkUnixInit.c: we initialize & cache the Carbon native encoding
- (e.g. 'macRoman') and try to find the tk script library files
- inside Tk packaged as a framework.
-
- * macosx/tkMacOSXNotify.c (new): new macosx specific merged
- Carbon/select-based notifier.
-
- * macosx/tkMacOSXEvent.c (new):
- * macosx/tkMacOSXEvent.h (new):
- * macosx/tkMacOSXKeyEvent.c (new):
- * macosx/tkMacOSXMouseEvent.c (new):
- * macosx/tkMacOSXWindowEvent.c (new): new macosx specific event
- handling functionality.
-
- * macosx/tkMacOSX.h (new):
- * macosx/tkMacOSXBitmap.c (new):
- * macosx/tkMacOSXButton.c (new):
- * macosx/tkMacOSXClipboard.c (new):
- * macosx/tkMacOSXColor.c (new):
- * macosx/tkMacOSXConfig.c (new):
- * macosx/tkMacOSXCursor.c (new):
- * macosx/tkMacOSXDefault.h (new):
- * macosx/tkMacOSXDialog.c (new):
- * macosx/tkMacOSXDraw.c (new):
- * macosx/tkMacOSXEmbed.c (new):
- * macosx/tkMacOSXFont.c (new):
- * macosx/tkMacOSXHLEvents.c (new):
- * macosx/tkMacOSXInt.h (new):
- * macosx/tkMacOSXKeyboard.c (new):
- * macosx/tkMacOSXMenu.c (new):
- * macosx/tkMacOSXMenubutton.c (new):
- * macosx/tkMacOSXMenus.c (new):
- * macosx/tkMacOSXPort.h (new):
- * macosx/tkMacOSXRegion.c (new):
- * macosx/tkMacOSXScale.c (new):
- * macosx/tkMacOSXScrlbr.c (new):
- * macosx/tkMacOSXSubwindows.c (new):
- * macosx/tkMacOSXTest.c (new):
- * macosx/tkMacOSXUtil.c (new):
- * macosx/tkMacOSXUtil.h (new):
- * macosx/tkMacOSXWm.c (new):
- * macosx/tkMacOSXWm.h (new):
- * macosx/tkMacOSXXStubs.c (new): macosx ports of classic mac Tk
- implementation in tk/mac.
-
- * macosx/tkMacOSXSend.c (new): only send to local interp
- implemented currently.
-
- * macosx/tkMacOSXDebug.h (new):
- * macosx/tkMacOSXDebug.c (new): new macosx specific functions for
- debugging MacOS events, regions, etc.
-
- * macosx/tkAboutDlg.r (new):
- * macosx/tkMacOSXApplication.r (new):
- * macosx/tkMacOSXCursors.r (new):
- * macosx/tkMacOSXLibrary.r (new):
- * macosx/tkMacOSXMenu.r (new):
- * macosx/tkMacOSXResource.r (new):
- * macosx/tkMacOSXXCursors.r (new):
- * macosx/tclets.r (new): sources for Rez resource compiler.
-
- * macosx/Wish.icns (new): Wish application icon.
-
- * generic/tk.h:
- * generic/default.h:
- * generic/tkBind.c:
- * generic/tkCmds.c:
- * generic/tkGrab.c:
- * generic/tkPointer.c:
- * generic/tkPort.h:
- * generic/tkSelect.c:
- * generic/tkStubLib.c:
- * generic/tkTest.c:
- * generic/tkText.c:
- * generic/tkWindow.c:
- * unix/tkUnix3d.c:
- * xlib/xgc.c:
- * xlib/X11/X.h:
- * xlib/X11/Xlib.h:
- * xlib/X11/Xutil.h: added #includes and #ifdefs for macosx
-
- * library/bgerror.tcl:
- * library/button.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/entry.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
- * library/msgbox.tcl:
- * library/scrlbar.tcl:
- * library/spinbox.tcl:
- * library/text.tcl:
- * library/tk.tcl:
- * library/demos/menu.tcl:
- * library/demos/menubu.tcl:
- * library/demos/widget: check [tk windowingsystem] instead of
- and/or in addition to $tcl_platform(platform).
-
- * generic/tkInt.h:
- * mac/tkMacBitmap.c:
- * mac/tkMacWm.c: added missing CONSTification
-
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntXlibDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkStubInit.c: regen
-
-2002-08-27 D. Richard Hipp <drh@hwaci.com>
-
- * doc/checkbutton.n: [Bug 582457] Fix the -offrelief option so
- * doc/radiobutton.n: that when -offrelief is flat and -relief is
- * mac/tkMacButton.c: sunken and -overrelief is raised, buttons
- * unix/tkUnixButton.c: work look toolbar buttons under Windows.
- * win/tkWinButton.c: See also: TIP #82.
-
-2002-08-26 Don Porter <dgp@users.sf.net>
-
- * win/Makefile.in: Removed dependence on the (parts of) the
- * win/winMain.c: tcltest executable on Windows. It was not
- used, and the dependency complicated the Makefile. [Bug 592638].
-
-2002-08-20 Don Porter <dgp@users.sf.net>
-
- * README: Bumped version number to 8.4b3 to distinguish
- * generic/tk.h: HEAD from the 8.4b2 release.
- * unix/configure.in:
- * win/configure.in:
- * unix/tk.spec:
-
- * unix/configure: autoconf
- * win/configure:
-
- * generic/tk.h: Added compile-time check that the tcl.h header file
- #included by Tk 8.4 is one from Tcl 8.4. This is needed to be sure
- that new #defines like CONST84 are available. [Bug 597432].
-
-2002-08-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (install-binaries): simplified pkgIndex.tcl
- file created on installation.
- * win/Makefile.in (install-binaries): corrected and simplified
- creation of pkgIndex.tcl file on installation.
-
-2002-08-14 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * win/tkWinDialog.c:
- * win/makefile.vc: broken compilation and link from changes
- Hobbs-08-07 fixed.
- * win/tkWinTest.c: CONST problem resolved.
-
-2002-08-13 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/button.tcl: change the bindings to use Priv($w,relief)
- instead of just Priv(relief). This ensures that neighboring
- buttons don't confuse (over)relief settings.
-
-2002-08-13 Reinhard Max <max@suse.de>
-
- * unix/tkUnixSend.c (Tk_SetAppName): Fixed a compiler warning.
-
-2002-08-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/image2.tcl: Tweaked the behaviour of the directory
- box on resize, as resizing of the overall window tends to be
- common given the sample images.
-
-2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/tkUnixWm.c (WmTransientCmd): Apply fix for
- wm transient assertion error that was applied
- to tkWinWm.c for Tk Bug #592201.
-
-2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Add deleteWindows at start of
- new transient tests so they do not fail if the
- toplevels already exist.
- * unix/tkUnixWm.c: Revert patch for Tk Bug #592201
- which incorrectly removed numTransients member.
-
-2002-08-08 Joe English <jenglish@users.sourceforge.net>
-
- * unix/tkUnixWm.c:
- * win/tkWinWm.c:
- * tests/wm.test: Fix for Tk Bug #592201 "wm transient fails with two
- masters"; fixes panic after a transient window is reassigned to
- new master and either master is subsequently destroyed.
-
-2002-08-08 Don Porter <dgp@users.sf.net>
-
- * tests/unixWm.test: Corrected packaging of unixWm-50.3 so that
- [setupbg] and [cleanupbg] always balance, no matter what tests
- are skipped.
-
-2002-08-08 Reinhard Max <max@suse.de>
-
- * unix/Makefile.in: Fixed typos in DISTNAME, and ZIPNAME.
-
-2002-08-08 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4b2 TAGGED FOR RELEASE ***
-
- * generic/tkButton.c (TkButtonWorldChanged): added GCFont handling
- to the disabledGc of buttons when compound != none. The drawing
- appears to be incorrect across platforms still. [Bug #477740]
-
- * generic/tkImgGIF.c (FileReadGIF): fixed -from handling for gifs
- [Bug #467524] (obermeier)
-
-2002-08-07 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCanvUtil.c (TkSmoothParseProc): recognize the built-in
- bezier method by name. [Bug #578654]
- * doc/canvas.n: update to note that -smooth really doesn't take
- or return just booleans.
-
- * win/tkWinMenu.c (TkpSetWindowMenuBar): fixed logic bug in when
- to idle call ReconfigureWindowsMenu.
-
- * doc/GetBitmap.3: removed doc refs to deprecated
- Tk_GetBitmapFromData. [Bug #590379]
-
- * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd):
- * library/panedwindow.tcl: changed class from PanedWindow to
- Panedwindow to not conflict with existing bwidgets, but also to be
- more regular with other names used in the core.
-
- * tests/panedwindow.test: added -text foobar to some test buttons
- to enable correct testing of panedwindow across platforms.
- [Bug #582370]
-
- * win/tkWinDialog.c: enabled use of the updated native Windows
- directory browser (tk_chooseDirectory). This does require
- shell32.dll v4.71 or greater. [Patch #468139]
-
- * win/configure:
- * win/tcl.m4: added shell32 to libs for updated native Windows
- tk_chooseDirectory dialog.
-
-2002-08-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkPanedWindow.c (RESIZE_PENDING): Separated out flag for
- indicating that a resize needs to be issued.
- (PanedWindowReqProc): Do the old behaviour when the panedwindow is
- not mapped; easiest way of making the test suite pass while still
- preserving improved behaviour in the face of children whose size
- is not known immediately.
-
-2002-08-06 Don Porter <dgp@users.sf.net>
-
- * tests/defs.tcl: removed file. No longer needed now that Tk is
- using the tcltest package to do its testing.
-
-2002-08-05 Don Porter <dgp@users.sf.net>
-
- * win/tkWinFont.c: Additional changes to fix CONST warnings on
- * win/tkWinWM.c: Windows due to latest patch. Tks Vince Darley.
-
- * doc/3DBorder.3: Applied companion patch for Tcl Patch 585105,
- * doc/BindTable.3: updating Tk to use Tcl 8.4's fully CONST-ified
- * doc/ConfigWidg.3: interface, and fully CONSTifying Tk at the
- * doc/CrtImgType.3: same time.
- * doc/CrtWindow.3:
- * doc/DeleteImg.3: This patch includes purging Tk of its last
- * doc/FindPhoto.3: direct access to interp->result. [Bug 589853]
- * doc/GetAnchor.3:
- * doc/GetBitmap.3: The substantial changes include copying
- * doc/GetCapStyl.3: event sequence strings into Tcl_DStrings
- * doc/GetClrmap.3: in tkBind.c, and copying [text] indices into
- * doc/GetColor.3: Tcl_DStrings because parsing them involved
- * doc/GetCursor.3: overwriting them. If this causes performance
- * doc/GetFont.3: trouble, that can be resolved by further
- * doc/GetImage.3: converting them to Tcl_Obj's.
- * doc/GetJoinStl.3:
- * doc/GetJustify.3: The #defines USE_NON_CONST and USE_COMPAT_CONST
- * doc/GetOption.3: have the same effect for Tk as they do for Tcl.
- * doc/GetRelief.3: (They actually change tcl.h)
- * doc/GetScroll.3:
- * doc/GetVisual.3:
- * doc/InternAtom.3:
- * doc/NameOfImg.3:
- * doc/SetAppName.3:
- * doc/WindowId.3:
- * generic/tk.decls:
- * generic/tk.h:
- * generic/tk3d.c:
- * generic/tkAtom.c:
- * generic/tkBind.c:
- * generic/tkBitmap.c:
- * generic/tkButton.c:
- * generic/tkCanvArc.c:
- * generic/tkCanvBmap.c:
- * generic/tkCanvImg.c:
- * generic/tkCanvLine.c:
- * generic/tkCanvPoly.c:
- * generic/tkCanvPs.c:
- * generic/tkCanvText.c:
- * generic/tkCanvUtil.c:
- * generic/tkCanvWind.c:
- * generic/tkCanvas.c:
- * generic/tkCanvas.h:
- * generic/tkClipboard.c:
- * generic/tkCmds.c:
- * generic/tkColor.c:
- * generic/tkConfig.c:
- * generic/tkConsole.c:
- * generic/tkCursor.c:
- * generic/tkDecls.h:
- * generic/tkEntry.c:
- * generic/tkFont.c:
- * generic/tkFrame.c:
- * generic/tkGet.c:
- * generic/tkGrid.c:
- * generic/tkImage.c:
- * generic/tkImgBmap.c:
- * generic/tkImgPhoto.c:
- * generic/tkInt.decls:
- * generic/tkInt.h:
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkListbox.c:
- * generic/tkMenu.c:
- * generic/tkMenubutton.c:
- * generic/tkMessage.c:
- * generic/tkOldConfig.c:
- * generic/tkOption.c:
- * generic/tkRectOval.c:
- * generic/tkScale.c:
- * generic/tkScrollbar.c:
- * generic/tkSelect.c:
- * generic/tkStyle.c:
- * generic/tkTest.c:
- * generic/tkText.c:
- * generic/tkText.h:
- * generic/tkTextBTree.c:
- * generic/tkTextDisp.c:
- * generic/tkTextImage.c:
- * generic/tkTextIndex.c:
- * generic/tkTextMark.c:
- * generic/tkTextTag.c:
- * generic/tkTextWind.c:
- * generic/tkUtil.c:
- * generic/tkVisual.c:
- * generic/tkWindow.c:
- * mac/tkMacConfig.c:
- * mac/tkMacCursor.c:
- * mac/tkMacEmbed.c:
- * mac/tkMacSend.c:
- * unix/tkUnixConfig.c:
- * unix/tkUnixCursor.c:
- * unix/tkUnixEmbed.c:
- * unix/tkUnixFont.c:
- * unix/tkUnixSelect.c:
- * unix/tkUnixSend.c:
- * unix/tkUnixWm.c:
- * win/tkWinConfig.c:
- * win/tkWinCursor.c:
- * win/tkWinEmbed.c:
- * win/tkWinMenu.c:
- * win/tkWinSend.c:
-
-2002-08-02 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkPanedWindow.c (DestroyPanedWindow): Idle calls need to
- be deleted on destruction of the window, or things can *really* go
- pear-shaped.
-
-2002-07-31 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkPanedWindow.c (PanedWindowReqProc): Postpone pane
- arrangement until idle, as is done in other window managers, to
- fix problems with size calculations when the children don't
- already know their sizes anyway.
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2002-07-29 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/configure.in: Remove code that was setting
- CC_SEARCH_FLAGS and LD_SEARCH_FLAGS to try to
- account for cc vs ld linking. Tcl now handles this.
- * unix/tcl.m4: Update from Tcl.
-
-2002-07-27 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Add MAJOR_VERSION, MINOR_VERSION,
- PATCH_LEVEL, INSTALL_LIBRARY, STUB_LIB_FILE, and LIB_FILE
- to support changes in tcl.m4 related to library builds.
- Use MAKE_LIB macro to avoid dealing with RANLIB issues.
- Rename TK_CC_SEARCH_FLAGS to CC_SEARCH_FLAGS and
- rename TK_LD_SEARCH_FLAGS to LD_SEARCH_FLAGS.
- Use new INSTALL_LIB and INSTALL_STUB_LIB substs to
- deal with ranlib issues when install libraries.
- * unix/configure: Regen.
- * unix/configure.in: Remove AC_PROG_RANLIB since
- this is done by tcl.m4 now. Define CC_SEARCH_FLAGS
- instead of TK_CC_SEARCH_FLAGS and so on.
- Use MAKE_LIB and MAKE_STUB_LIB from tcl.m4.
- Remove AC_SUBST calls that are no done in tcl.m4.
- * unix/tcl.m4: Update from Tcl.
- * unix/tkConfig.sh.in: Subst CC_SEARCH_FLAGS and
- LD_SEARCH_FLAGS.
-
-2002-07-25 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkInt.h:
- * generic/tkWindow.c:
- * mac/tkMacWm.c:
- * unix/tkUnixWm.c:
- * win/tkWinWm.c:
- * tests/wm.test:
- * tests/winWm.test:
- * tests/unixWm.test: Objectifed wm. [Patch #564521]
- Note: At this point the Mac file is completely untested
- and may not even compile.
-
-2002-07-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/spinbox.test: added spinbox-22.[1-3]
- * generic/tkEntry.c (ConfigureEntry): made the textvariable value
- take precedence over changed -from/-to values, unless it must be
- constrained. [Bug #559078]
-
- * library/spinbox.tcl (MouseSelect): when not in the entry, just
- return instead of invoking - ButtonUp handles invoking already.
- [Bug #499168]
-
- * library/tk.tcl (RestoreFocusGrab): handle the case where the
- FocusGrab info is not set. [Bug #553283]
-
-2002-07-24 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/canvas.test: added canvas-14.[1-6]
- * generic/tkCanvas.c (CanvasWidgetCmd): corrected handling of
- 'scan' subcommand args. Also removed early return cases to goto
- done instead where the canvasPtr would be Tcl_Release'd. This may
- solve other problems with unreleased canvasPtr's. [Bug #581560]
-
- * win/tkWinButton.c (TkpDisplayButton): corrected display of focus
- ring around the actual text when the button is a compound button.
- [Bug #583691]
-
- * unix/README: Corrected notes about running user interactive Tk
- tests. [Bug #462320]
-
- * generic/tkText.c (TextEditUndo): set isDirtyIncrement to -1 when
- reverting to note proper "dirtiness". [Bug #580362] (callewaert)
-
- * generic/tkEntry.c (DisplayEntry): correct cursor position before
- calling Tk_SetCaretPos. (yamamoto)
-
-2002-07-23 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2002-07-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * library/choosedir.tcl (tk::dialog::file::chooseDir):
- * library/clrpick.tcl (tk::dialog::file::chooseDir):
- * library/msgbox.tcl (tk::MessageBox):
- * library/tkfbox.tcl (tk::dialog::file):
- * library/xmfbox.tcl (tk::MotifFDialog):
- Revert [Tk patch 568278]. The transient window workaround
- is no longer needed since the fix for [Tk bug 570764]
- solved the problem for withdrawn transients.
-
-2002-07-19 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure:
- * unix/configure.in:
- * win/configure:
- * win/configure.in: Add AC_PREREQ(2.13) in an attempt
- to make it more clear that the configure scripts
- must be generated with autoconf version 2.13.
- [Tcl Bug 583573]
-
-2002-07-19 D. Richard Hipp <drh@hwaci.com>
-
- * library/mkpsec.tcl: Fix a bug that was causing postscript generation
- to fail under Win2K.
-
-2002-07-18 Reinhard Max <max@suse.de>
-
- * unix/tkUnixSend.c: Using Tcl_GetTime instead of TclpGetTime.
-
-2002-07-17 Reinhard Max <max@suse.de>
-
- * library/unsupported.tcl: Extended ExposePrivateVariable, and
- ExposePrivateCommand to accept patterns as well.
-
-2002-07-17 Don Porter <dgp@users.sf.net>
-
- * generic/tkFont.c: Corrected reversed logic in assert -> panic
- conversion. [Bug 582799]
-
-2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkFont.c (TkFontPkgFree): Call panic instead
- of assert since assert is not used in the rest of Tk.
- [Tk bug 579651]
-
-2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in:
- * win/Makefile.in: Add a more descriptive warning
- in the event `make genstubs` needs to be rerun.
-
-2002-07-16 Vince Darley <vincentdarley@users.sourceforge.net>
-
- * win/tkWinWm.c:
- * doc/wm.n: fix for part of [Bug 581627], and made iconbitmap
- code on Windows more flexible about reading in icons [Bug
- 220800].
-
-2002-07-15 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.bc (new): re-add of the borland makefile. Submitted
- by Helmut Giese <hgiese@ratiosoft.com>. This needs testing, still.
-
-2002-07-15 Don Porter <dgp@users.sf.net>
-
- * Fixes for [Bug 581627, 581795].
- * generic/tkTest.c: Test commands not supported on non-Unix
- platforms should not be defined there in the first place.
- * tests/constraints.tcl: Fixed "secureserver" constraint.
- * tests/unixWm.test: Some tests needed "unix" constraint.
- * win/tkWinWm.c: Typo in error message.
-
-2002-07-14 Don Porter <dgp@users.sf.net>
-
- * tests/event.test: Fixes to enable testing of only userInteraction
- * tests/visual_bb.test: tests.
-
- * README: Bumped HEAD to version 8.4b2 in order to
- * generic/tk.h: distinguish it from the 8.4b1 release.
- * unix/configure*: Also extended LOCALES to cover all message
- * unix/tk.spec: catalogs.
- * win/configure*:
-
- * tests/focustTcl.test: Conversion bug: Corrected backwards logic.
- * tests/imgPhoto.test: Conversion bug: overwrote unix/README.
-
- * tests/all.tcl: Completed conversion of Tk test suite
- * tests/constraints.tcl: to use tcltest.
- * tests/[b-v]*.test:
- * unix/Makefile.in:
-
-2002-07-12 Don Porter <dgp@users.sf.net>
-
- * tests/constraints.tcl: Converted more files to tcltest and
- * tests/[g-x]*.test: factored out common code.
-
-2002-07-11 Don Porter <dgp@users.sf.net>
-
- * tests/canvPsImg.tcl: Converted several files in the
- * tests/constraints.tcl (new file): Tk test suite for testing by
- * tests/[r-x]*.test: tcltest 2.1.
- * unix/Makefile.in:
-
-2002-07-11 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): initialize
- utfTitle to NULL, add a few more notes about limitations of
- possible new Tk_ChooseDirectoryObjCmd function.
-
-2002-07-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/imgPhoto.test (imgPhoto-15.1): Added test of mem-alloc
- failure, but this is non-portable.
- * generic/tkImgPhoto.c (ImgPhotoSetSize): Allowed this function to
- fail when it can't allocate enough memory. Note that not all the
- places that call it can fail nicely without API changes; some
- still panic but at least some of the potential failures are now
- handled gracefully.
-
- * tests/visual_bb.test (lpr): Stopped this from relying on
- external files; direct piping is much more flexible for this
- application.
-
-2002-07-09 Don Porter <dgp@users.sf.net>
-
- * generic/tkTest.c: Removed unused dependence on TclThread_Init()
- * tests/defs.tcl: and [testthread]. [Bug 578165, Tcl Bug 531413]
-
-2002-07-08 David Gravereaux <davygrvy@pobox.com>
-
- * unix/Makefile.in: Added missing win/lamp.bmp to the dist
- target.
-
-2002-07-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4b1 TAGGED FOR RELEASE ***
-
-2002-07-04 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/bgerror.tcl (bgerror): Stopped the bgerror dialog from
- getting wider than the screen; in theory really long messages
- could make it become taller than the screen now, but that's much
- less likely to happen. Also trimmed a little bit of internal
- space so that the icon-message gap is the same as the icon-frame
- and message-frame gaps.
-
-2002-07-01 Don Porter <dgp@users.sf.net>
-
- * unix/configure:
- * unix/tcl.m4: Updated to latest tcl.m4 from Tcl.
-
-2002-06-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/msgbox.tcl (MessageBox): Force all non-button widgets to
- have the same background as the containing toplevel. [Bug #552515]
-
-2002-06-27 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * win/Makefile.in (install-binaries): Fix of troubled Makefile
- quoting introduced by [Patch 521356] causing the installed to
- fail.
-
-2002-06-25 Don Porter <dgp@users.sf.net>
-
- * unix/tkUnixFont.c: (Tk_DrawChars) silence compiler warning.
-
-2002-06-26 David Gravereaux <davygrvy@pobox.com>
-
- * generic/tkStyle.c: <eol> of the committing cvs client didn't
- match the <eol> of the file itself. Windows users where getting
- \r\r\n. Problem fixed.
-
-2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * generic/tkFont.c (TkTextLayoutToPostscript): fixed potential
- buffer overflow which could be intentionally triggered from
- within safe interpreter -- malicious applet could modify
- tk::psglyphs array.
-
-2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * tests/font.test (font-32.1): updated this test
- to expect the new behavior of canvas postscript.
-
-2002-06-25 Don Porter <dgp@users.sf.net>
-
- * unix/Makefile.in: Expanded install-binaries target to create
- * win/Makefile.in: and install a pkgIndex.tcl file to enable
- Tk as a loadable package [Patch 521356]
-
-2002-06-25 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * library/mkpsenc.tcl: (added) utilities to generate
- Postscript prolog for current system encoding.
- * generic/tkCanvPs.c (TkCanvPostscriptCmd): now
- uses mkpsenc.tcl to generate Postscript prolog.
- * generic/tkFont.c (TkTextLayoutToPostscript): modified
- according to patch #546910. Now outputs system-encoded
- characters (for unibyte) or Adobe glyph names (for
- multibyte or outside-locale).
- * tests/canvText.test (canvText-17.1): updated this test
- to expect the new behavior of canvas postscript.
-
-2002-06-25 Reinhard Max <max@suse.de>
-
- * unix/tcl.m4: New macro SC_CONFIG_MANPAGES.
- * unix/configure.in: Added support for symlinks and compression
- * unix/Makefile.in: when installing the manpages. [Patch 518052]
- Default is still hardlinks and no compression.
-
- * unix/mkLinks: generated
- * unix/configure:
-
- * unix/README: Added documentation for the new features.
-
- * unix/configure: Replaced ${exec_prefix}/lib
- * unix/tcl.m4 (SC_PATH_TCLCONFIG): by ${libdir}.
-
-2002-06-24 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/winWm.test: Verify that both an unmapped
- and already mapped toplevel are raised and receive
- the focus when deiconified.
- * tests/wm.test: Add wm deiconify tests. Check that
- a toplevel that has never been mapped is not mapped
- by the deiconify command since it should be done
- at idle by MapFrame.
- * win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED
- flag while processing the wm deiconify command.
- The WM_UPDATE_PENDING flag should never be set when
- WM_NEVER_MAPPED is set, but double check so that
- the implementation is more explicit and matches
- the comment just above.
- Return without invoking TkWmRestackToplevel or
- TkSetFocusWin on a toplevel that has never been
- mapped. This fixes a bug where a toplevel is mapped
- with the wrong size and is then resized by the
- idle call to MapFrame. [Tk bug 233150]
-
-2002-06-23 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWm.c (UpdateGeometryInfo): remove the check for a null
- wrapper introduced in r1.41 on 2002-06-15 because it prevented
- geometry setting from taking effect if the window was not on the
- screen. Another check may go in it's place as IsIconic and
- IsZoomed should not be passed NULL.
-
-2002-06-22 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Remove invalid minsize test. Add update
- calls to wm transient tests so that idle handlers get
- run. This is needed to get the tests to pass under Win32.
- * unix/tkUnixWm.c (WmWaitMapProc): Move the special
- transient withdrawn check into the if body to
- make it easier to set a breakpoint on this test
- inside a debugger. No functional changes.
- * win/tkWinWm.c (WmWaitVisibilityOrMapProc): Ditto.
-
-2002-06-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/wm.n: TIP #95 Windows implementation and
- * mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs.
- * unix/tkUnixWm.c (Tk_WmCmd):
- * win/tkWinWm.c (Tk_WmCmd):
- * tests/unixWm.test:
- * tests/winWm.test: more wm attr tests will be needed.
-
- * generic/tkGrid.c (GridReqProc): check that gridPtr is not NULL
- (may be when embedded). [Bug #548791] (halliday)
-
- * generic/tkFont.c (TkFontPkgFree): changed panic on freeing fonts
- to an assert, and wrapped panic in #ifdef PURIFY. [Bug #568701]
-
- * library/menu.tcl: corrected menus from being posted offscreen
- on Windows. [Bug #464451] (darley)
-
- * library/console.tcl: corrected the defaultPrompt substitution
- [Bug #553207] and made Tab a default expansion key (like Escape).
-
- * win/tkWinEmbed.c (EmbedWindowDeleted): added a check for a null
- containerPtr. The core of this bug is likely elsewhere. [Bug #476176]
-
- * doc/text.n: TIP #93 implementation that
- * generic/tkText.c (TextWidgetCmd): enhances the text get and
- * generic/tkTextIndex.c (TkTextGetIndex): delete methods to accept
- * tests/text.test: multiple range pairs.
- This handles the delete case in an atomic, fixed-index fashion.
-
-2002-06-21 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Add tests to make sure a withdrawn
- transient does not get remapped by state changes
- in the master.
- * unix/tkUnixWm.c (Tk_WmCmd, WmWaitMapProc):
- * win/tkWinWm.c (Tk_WmCmd, WmWaitVisibilityOrMapProc):
- Add a WM_TRANSIENT_WITHDRAWN flag that gets set by the
- withdraw, deiconify, or state wm subcommands. Check
- this flag before mapping a transient when processing
- a MapNotify event. [Tk bug 570764]
-
-2002-06-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * unix/tk.spec (version), README, win/configure.in, unix/configure.in:
- * generic/tk.h (TK_RELEASE_*, TK_PATCH_LEVEL): Bumped to beta1.
-
-2002-06-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/text.n: TIP #104 implementation which generalizes the
- * generic/tkText.c: undo/redo stack to not be tied solely to the
- * generic/tkText.h: text widget. The APIs are still private.
- * generic/tkUndo.c: This also adds a stack limiting ability and
- * generic/tkUndo.h: a -maxundo option to the text widget (in
- * library/text.tcl: addition to the options from TIP #26) should
- * mac/tkMacDefault.h: users want to limit the undo/redo stack
- * tests/text.test: (should not be necessary in most cases).
- * unix/Makefile.in: [Patch #554763] (callewart)
- * unix/tkUnixDefault.h:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/tkWinDefault.h:
-
-2002-06-21 Don Porter <dgp@users.sf.net>
-
- * unix/Makefile.in: Removed unnecessary dependence of tktest
- * unix/tkAppInit.c: executable on the tcltest executable on
- Unix. If there are similar dependencies on other platforms, they
- can probably be removed as well. [Bug 572134].
-
-2002-06-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/listbox.n:
- * generic/tkListbox.c (DisplayListbox):
- * mac/tkMacDefault.h: TIP #94 implementation adding -activestyle
- * tests/listbox.test: option to the listbox. This adds the ability
- * unix/tkUnixDefault.h: to have listboxes look native on Windows, and
- * win/tkWinDefault.h: "nicer" elsewhere using the 'dotbox' style.
-
-2002-06-20 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkGrid.c: Corrected the test for grid propagate change.
- [Bug #571433]
-
-2002-06-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/panedwindow.test:
- * generic/tkPanedWindow.c: ensure that sash index is lower bounds
- checked. [Bug #548727]
-
-2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkClipboard.c (TkClipCleanup): Add code
- to set dispPtr->clipWindow to NULL, this was
- accidently removed by last commit. Fixes
- a crash while running the tests under win32.
-
-2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkBind.c (TkBindDeadWindow):
- Handle case where Tk_DestroyWindow is invoked
- on clipboard and send windows.
- * generic/tkClipboard.c (TkClipCleanup):
- Invoke Tk_DestroyWindow to cleanup the
- dispPtr->clipWindow. Call Tcl_Preserve
- and Tcl_Release on the window to avoid an
- invalid memory ref on shutdown.
- * generic/tkEvent.c (Tk_HandleEvent):
- Panic if XCreateIC is invoked twice for
- the same window. This should never happen,
- the check were just added to make sure it
- does not since this could lead to crashes
- in XCloseIM.
- * generic/tkFocus.c (TkFocusDeadWindow):
- Handle case where Tk_DestroyWindow is invoked
- on clipboard and send windows.
- * generic/tkOption.c (TkOptionDeadWindow): Ditto.
- * generic/tkWindow.c (TkCloseDisplay): Move
- deletion of dispPtr->winTable after TkpCloseDisplay
- call since Tk_DestroyWindow uses it and could
- be called by TkpCloseDisplay for clipboard/send windows.
- Also invoke ckfree for the dispPtr instead of
- doing it in TkpCloseDisplay.
- (Tk_DestroyWindow): Check for a null winPtr->mainPtr
- before doing certain cleanup tasks so the we can
- invoke Tk_DestroyWindow on clipboard and send windows.
- We need to do this so that XDestroyIC will get invoked
- for the input contexts of each window.
- * mac/tkMacXStubs.c (TkpCloseDisplay): Don't free
- the displayPtr since this is now done in TkCloseDisplay.
- * unix/tkUnixEvent.c (TkpCloseDisplay, OpenIM): Remove
- conditional compilation around calls to XCloseIM
- since I am confident that the crashes related to
- input contexts has been fixed. Don't free
- the displayPtr since this is now done in TkCloseDisplay.
- * unix/tkUnixSend.c (TkSendCleanup): Invoke the
- Tk_DestroyWindow method to cleanup the special
- send window. This will call XDestroyIC and thereby
- avoid a crash in XCloseIM. The send window needs
- to be Tcl_Preserve and Tcl_Release to avoid an
- invalid memory ref on shutdown.
- * win/tkWinX.c (TkpCloseDisplay): Don't free
- the displayPtr since this is now done in TkCloseDisplay.
- [Tk patch 570902]
-
-2002-06-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkStyle.c: TIP#48 style engine.
- See http://purl.org/tcl/tip/48.html for details.
-
- * generic/tkConfig.c (GetOptionFromObj): Split to allow for access
- to option tables via name as well as via object.
- (TkGetOptionSpec): Semi-public interface to GetOption functionality.
- (DoObjConfig, Tk_RestoreSavedOptions, FreeResources)
- (GetObjectForOption): Basic style support for configure.
-
- * generic/tkWindow.c (TkCreateMainWindow, Tk_DestroyWindow): Added
- calls to set up and tear down the style subsystem.
-
- * generic/tk.decls, generic/tk.h: Many declarations forming TIP#48
- public interface.
-
- * generic/tkInt.decls (TkStylePkgInit,TkStylePkgFree):
- * generic/tkInt.h (TkGetOptionSpec): Supporting declarations.
-
- * unix/Makefile.in, win/Makefile.in, win/makefile.vc: Added
- tkStyle.c to list of generic source files.
-
-2002-06-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/defs.tcl (makeFile): Defined the return value of this
- procedure to be the filename of the created file, as in the real
- tcltest package...
-
-2002-06-17 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkImage.c (Tk_ImageObjCmd, DeleteImage): Call
- Tcl_Preserve and Tcl_Release for the masterPtr->winPtr
- window to avoid accessing memory that had already
- been deallocated in DeleteImage.
-
-2002-06-17 David Gravereaux <davygrvy@pobox.com>
-
- Trims to support the removal of RESOURCE_INCLUDED from rc
- scripts from Tcl's accepted FR #565088.
-
- * generic/tk.h: Changed RESOURCE_INCLUDED to be RC_INVOKED
- as the RC tool defines this already by default.
-
- * win/rc/tk.rc:
- * win/rc/wish.rc: removed the #define RESOURCE_INCLUDED lines.
-
-2002-06-17 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (dist): correct installation of
- wish.exe.manifest to DISTDIR target directory.
-
- * generic/tkCmds.c (Tk_TkObjCmd):
- * generic/tkInt.h (struct TkCaret):
- * mac/tkMacXStubs.c (Tk_SetCaretPos):
- * unix/tkUnixKey.c (TkpGetString, Tk_SetCaretPos):
- * win/tkWinX.c (Tk_SetCaretPos):
- * tests/tk.test: Added 'tk caret' implementation of TIP#96
- * doc/SetCaret.3 (new): which adds a TkCaret structure element to
- * doc/tk.n: TkDisplay for maintaining state.
-
- * unix/tkUnixSend.c (TkSendCleanup): special cleanup of
- inputContext to avoid bug in XCloseIM. (dejong)
-
-2002-06-17 Don Porter <dgp@users.sf.net>
-
- * library/msgs/en_gb.msg: Added catalog for UK English.
- Currently includes only Color -> Colour translation.
-
-2002-06-17 D. Richard Hipp <drh@hwaci.com>
-
- * doc/checkbutton.n:
- * doc/radiobutton.n:
- * generic/tkButton.c:
- * generic/tkButton.h:
- * mac/tkMacButton.c:
- * tests/button.test:
- * unix/tkUnixButton.c:
- * win/tkWinButton.c: Implementation of TIP#82 - Added the
- -offrelief option to checkbutton and radiobutton.
-
-2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkWindow.c (Tk_DestroyWindow): Set the pathName
- component of a window to NULL after its memory has been
- deallocated to avoid a possible illegal memory access
- as a result of a call to Tk_PathName() on a Tk_Window
- structure of a window that has already been destroyed.
- [Tk bug 521946]
-
-2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkOption.c (Tk_GetOption): Allocate
- memory with ckalloc not malloc. This keeps
- Tk from erroring out when built with
- TCL_MEM_DEBUG.
-
-2002-06-14 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkBind.c (HandleEventGenerate):
- * generic/tkInt.h: changed warpInProgress boolean from int to a
- bit in the flags variable (TK_DISPLAY_IN_WARP)
-
- * generic/tkCmds.c (Tk_TkObjCmd):
- * unix/tkUnixKey.c (TkpGetString):
- * generic/tkEvent.c (Tk_HandleEvent):
- * generic/tkInt.h: changed useInputMethods boolean from int to a
- bit in the flags variable (TK_DISPLAY_USE_IM)
-
- * generic/tkInt.h:
- * generic/tkCmds.c (Tk_WmObjCmd):
- * unix/tkUnixWm.c (Tk_WmCmd):
- * win/tkWinWm.c (Tk_WmCmd): changed wmTracing from being an int to
- just a bit in the flags variable (TK_DISPLAY_WM_TRACING)
-
- * generic/tkEvent.c (Tk_HandleEvent):
- * unix/tkUnixEvent.c (OpenIM):
- * unix/tkUnixKey.c (TkpGetString):
- * generic/tkInt.h: added TK_DISPLAY_XIM_SPOT flag bit for TkDisplay
- and used this to allow a runtime check to see if over-the-spot XIM
- is possible. If not it will try and fallback to the old-style
- input context, which handles things like dead keys input.
-
- * generic/tk.decls: added TIP #84 implementation that adds a
- * generic/tkDecls.h: Tk_CollapseMotionEvents API which controls
- * generic/tkEvent.c: Tk's collapsing of incoming motion events
- * generic/tkInt.h: on its windows. The default remains to do
- * generic/tkStubInit.c: collapsing. Added a flags parameter to the
- * generic/tkWindow.c: internal display structure to support this
- * doc/QWinEvent.3: and be used in the future for other bits.
- [Tk patch 564642]
-
- * unix/mkLinks: updated from current docs
-
-2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkEvent.c (TkXErrorHandler): Declare static
- function to avoid compiler error with VC++.
- * generic/tkBind.c (ExpandPercents): Cast argument to
- Tk_GetAtomName in order to avoid compiler warning.
-
-2002-06-14 Joe English <jenglish@users.sf.net>
-
- * doc/bind.n:
- * generic/tk.h:
- * generic/tkBind.c:
- * generic/tkCanvWind.c:
- * generic/tkCmds.c:
- * generic/tkEvent.c:
- * generic/tkFocus.c:
- * generic/tkGrab.c:
- * generic/tkGrid.c:
- * generic/tkImage.c:
- * generic/tkPack.c:
- * generic/tkPlace.c:
- * generic/tkPointer.c:
- * generic/tkTextWind.c:
- * generic/tkWindow.c:
- * mac/tkMacSubwindows.c:
- * mac/tkMacWindowMgr.c
- * mac/tkMacWm.c:
- * unix/Makefile.in:
- * unix/tkUnixEmbed.c:
- * unix/tkUnixWm.c:
- * win/tkWinScrlbr.c:
- * win/tkWinWindow.c:
- * win/tkWinWm.c: Implementation of TIP #47 by Neil McKay
- "Modifying Tk to Allow Writing X Window managers".
- Add CirculateRequest, Create, MapRequest, ResizeRequest,
- and ConfigureRequest event types;
- Split TK_TOPLEVEL flag into TK_TOPLEVEL, TK_HAS_WRAPPER,
- TK_WIN_MANAGED, and TK_TOP_HIERARCHY. [Tk patch 572978]
-
-2002-06-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * unix/tkAppInit.c: Removed now unneeded and erroneous reference
- to 'matherr'. See Tcl ChangeLog entry 2002-05-31 Don Porter.
-
-2002-06-14 David Gravereaux <davygrvy@pobox.com>
-
- * win/rules.vc: The test for compiler optimizations was in error.
- Thanks goes to Roy Terry <royterry@earthlink.net> for his
- assistance with this.
-
-2002-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- Implement TIP 98 [Tk patch 566765]
-
- * doc/FindPhoto.3, generic/tk.h, generic/tk.decls:
- * generic/tkImgPhoto.c: Changed *_Old to *_NoComposite and
- USE_OLD_PHOTO_PUT_BLOCK to USE_COMPOSITELESS_PHOTO_PUT_BLOCK
- following a suggestion from Don Porter.
-
- * tests/imgPhoto.test: Added tests of -compositingrule
-
- * doc/photo.n: Added documentation for "-compositingrule".
- * generic/tkImgPhoto.c (ImgPhotoCmd, ParseSubcommandOptions): New
- "-compositingrule" option for [$photo copy] subcommand, using
- OPT_COMPOSITE flag and compositingRule field in SubcommandOptions
- structure.
-
- * doc/FindPhoto.3: Documented the extra argument for the
- compositing rule and the action to take if anyone wants to
- maintain total backward-compatability.
-
- * generic/tk.h (TK_PHOTO_COMPOSITE_*): Defined values for use as
- compositing rules.
- (USE_OLD_PHOTO_PUT_BLOCK): Added a way for users to select the old
- interface to Tk_PhotoPutBlock to provide an easier upgrade path.
-
- * generic/tk.decls: Alter Tk_PhotoPut*Block to Tk_PhotoPut*Block_Old
- and introduce new slots for the old name of function with an extra
- argument at the end for the compositing rule.
-
- * generic/tkImgPhoto.c (ImgPhotoCmd): Updated "transparency set"
- subcommand to use TkSubtractRegion().
-
- * win/tkWinRegion.c (TkSubtractRegion):
- * mac/tkMacRegion.c (TkSubtractRegion):
- * generic/tkInt.decls (TkSubtractRegion):
- * unix/tkUnixPort.h (TkSubtractRegion): Added function to perform
- the set-difference operation on regions; it seems all platforms
- can support it, and it makes removing rectangular bits from
- regions much easier.
-
- * generic/tkImgPPM.c (FileReadPPM): Reading a PPM/PGM always uses
- the SET compositing rule because it is faster and the format does
- not have any transparency information.
-
- * generic/tkImgGIF.c (FileReadGIF): Reading a GIF always uses the
- SET compositing rule because GIF files model transparency as a
- single special colour.
-
- * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
- Added a compositing rule to allow better control over what happens
- to transparent pixels when inserting data into a photo image.
-
-2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/winfo.test: Add basic tests for winfo ismapped.
-
-2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/unixWm.test:
- * tests/wm.test: Move wm minsize and wm maxsize
- usage tests into the cross platform wm tests.
-
-2002-06-13 Don Porter <dgp@users.sf.net>
-
- * tests/cursor.test: corrected error after cursor-2.2.
- * tests/defs.tcl: Added enhancements to Tk's fake version of
- tcltest required by recent cursor.test changes.
-
-2002-06-13 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/cursor.test (cursor-2.[34]): Tests added to ensure that
- cursor specs really are well-behaved lists. Also some general
- clean-up...
- * win/tkWinCursor.c (TkGetCursorByName): Undone Jeff's back-off
- and fixed things so that they should work now. Cursor specs are
- lists first and foremost.
-
-2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * changes: Clearly label wm transient changes as
- a POTENTIAL INCOMPATIBILITY.
- * doc/wm.n: Remove "some window managers will" text
- and explicitly state what behavior a transient
- window will display. Also mention that it is an
- error to make a window a transient of itself.
-
-2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * library/choosedir.tcl (tk::dialog::file::chooseDir):
- * library/clrpick.tcl (tk::dialog::file::chooseDir):
- * library/msgbox.tcl (tk::MessageBox):
- * library/tkfbox.tcl (tk::dialog::file):
- * library/xmfbox.tcl (tk::MotifFDialog): Remove the
- transient property on dialogs after they have been
- dismissed to insulate them from further state changes
- in the master. This keeps a withdrawn dialog from
- being mapped when the master is deiconified. [Tk patch 568278]
-
-2002-06-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinCursor.c (TkGetCursorByName): reverted fix from
- 2002-06-06 because it broke the ability to use built-in cursors
- like left_ptr.
-
-2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * library/choosedir.tcl (tk::dialog::file::chooseDir):
- * library/clrpick.tcl (tk::dialog::color):
- * library/dialog.tcl (tk_dialog):
- * library/msgbox.tcl (tk::MessageBox):
- * library/tkfbox.tcl (tk::dialog::file):
- * library/xmfbox.tcl (tk::MotifFDialog_Create):
- Only make the dialog window a transient if
- the master is visible. This check already
- appeared in some of the dialogs. This patch
- just copies the check into those that were
- lacking. [Tk patch 568253]
-
-2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * changes: Add note about new transient behavior.
- * tests/unixWm.test: Check that the WM_TRANSIENT_FOR
- property for a transient window is being cleared
- when the master is destroyed.
- * tests/wm.test: Source defs.tcl instead of using
- tcltest to match the rest of Tk's test files.
- Add new tests that ensure that a transient's state
- mirrors the state of the master.
- * unix/tkUnixWm.c (WmInfo, TkWmNewWindow, TkWmMapWindow,
- TkWmDeadWindow, Tk_WmCmd, WmWaitMapProc): Add numTransients
- member to WmInfo structure. Keep state of master and
- transient in sync using a callback that tracks MapNotify
- and UnmapNotify events. When the master is mapped, map
- the transient. When the master is unmapped or iconified,
- withdraw the transient.
- * win/tkWinWm.c (TkWmMapWindow, TkpWmSetState,
- TkWmDeadWindow, Tk_WmCmd, WmWaitVisibilityOrMapProc):
- Keep state of master and transient in sync using a
- callback that tracks MapNotify and UnmapNotify events.
- Move masterPtr check from TkpWmSetState into TkWmMapWindow
- to deal with WM_NEVER_MAPPED transients. Cleanup
- numTransients and the callback in TkWmDeadWindow.
- Cleanup numTransients and the callback only after
- deleting a master in wm transient command to avoid
- deleting the callback when an error is raised.
- Add support for MapNotify and UnmapNotify events
- to the master callback. [Tk patch 561708]
-
-2002-06-11 Joe English <jenglish@users.sf.net>
-
- * library/menu.tcl: fix for bug report #530212 "Bad Window Path
- Name in tkMenuFind"
-
-2002-06-10 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: Fixed a win98 issue where the /exclude option
- for xcopy is unsupported.
- Reported by Roy Terry <royterry@earthlink.net>.
-
-2002-06-10 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * library/tk.tcl: added utility functions to get "-underline" and
- "-text" for labels and buttons from translatable string containing
- "magic ampersand" [patch #566605]
- * library/clrpick.tcl:
- * library/msgbox.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl: some places where msgcat is used to get
- translated label are modified to handle labels with magic ampersand.
- * library/msgs/ru.msg: russian translations added
- * library/msgs/cs.msg:
- * library/msgs/de.msg:
- * library/msgs/el.msg:
- * library/msgs/es.msg:
- * library/msgs/fr.msg:
- * library/msgs/it.msg:
- * library/msgs/nl.msg: all translation files now have labels with
- 'magic ampersand' where appropriate. In el.msg some ampersands are
- missing, as I don't know which underline positions seems natural
- to "el" users.
-
-2002-06-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * library/bgerror.tcl (tk::dialog::error::bgerror):
- Don't set the bgerror dialog as a transient of
- itself since this operation is ill defined.
-
-2002-06-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * win/tkWinCursor.c (TkGetCursorByName): Fixed so that the reading
- of cursors from a file with a cursor spec was built using [list]
- works when the file has a space in instead of requiring fiddling
- with backslashes.
-
-2002-06-06 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * library/msgbox.tcl (MessageBox): Add -default normal
- when creating non-default buttons for message box.
- They already get -default normal when they're
- unfocused, and dialog window size used to change suddenly
- in such cases.
-
-2002-06-05 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
-
- * unix/tkUnixFont.c (Tk_DrawChars): Don't assume that
- one char is always one byte, and that required
- subfont for the last character in any string is
- the same as for the previous character
- [Bug #559435] [Patch #559437]
-
-2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
-
- * changes: Document [wm transient .t .t] error.
- * tests/wm.test: Check that setting a window
- as a transient of itself raises an error. Check
- that passing a non-toplevel window to the wm
- transient command uses the enclosing toplevel.
- * unix/tkUnixWm.c (Tk_WmCmd): Raise an error
- if the user tries to make a toplevel a
- transient of itself.
- * win/tkWinWm.c (Tk_WmCmd): Raise an error
- if the user tries to make a toplevel a
- transient of itself. Test for other error
- before checking for the transient self error.
-
-2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/tkUnixWm.c (WmInfo, TkWmCleanup, TkWmNewWindow,
- TkWmMapWindow, TkWmDeadWindow, Tk_WmCmd): Replace
- WmInfo's master and masterWindowName members with
- a masterPtr member. This implementation is much
- simpler and mirrors the Win32 implementation. This
- change makes it easy to check the flags of the
- master window. No user visible changes.
-
-2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
-
- * generic/tkInt.decls: Add unix decl for TkpWmSetState.
- * generic/tkIntPlatDecls.h: Regen.
- * generic/tkStubInit.c: Regen.
- * tests/wm.test: Test state changes between iconic,
- normal, and withdrawn both before and after initial
- mapping.
- * unix/tkUnixWm.c (Tk_WmCmd, TkpWmSetState): Move
- state change code into TkpWmSetState to more closely
- match the Win32 implementation. No user visible changes.
-
-2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/embed.test: Added cross platform embed tests.
- Check that window passed to -use has the -container
- option set.
- * tests/wm.test: Remove useless catch call. Deiconify
- . just in case, stackorder tests will not pass unless
- it is in the normal state. Add -container flag to
- embedded stackorder test.
- * unix/tkUnixEmbed.c (TkpUseWindow):
- * win/tkWinEmbed.c (TkpUseWindow): Lookup Tk window
- based on the id passed in as the value for -use.
- Generate an error if the Tk window did not have
- the -container option set.
-
-2002-05-26 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkButton.c (ConfigureButton): When creating
- a radiobutton with -value "" it was not drawn properly
- if the -variable was created by the radiobutton.
- [Bug #548765]
-
-2002-05-26 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkCanvText.c (ComputeTextBbox): Negative
- coordinates were rounded badly causing a 1 pixel
- displacement. [Bug #556526]
-
-2002-05-24 Mo DeJong <mdejong@users.sourceforge.net>
-
- * mac/tkMacWm.c (Tk_WmCmd):
- * tests/unixWm.test: Move wm transient checks over
- to wm.test so they will be run on all systems.
- * tests/wm.test: Add tests to check for error when
- an iconwindow is passed to the wm transient command.
- * unix/tkUnixWm.c (Tk_WmCmd):
- * win/tkWinWm.c (Tk_WmCmd): Raise an error if one
- of the windows passed to the wm transient command
- is an iconwindow for another toplevel.
-
-2002-05-23 Mo DeJong <mdejong@users.sourceforge.net>
-
- * mac/tkMacWm.c (TkWmStackorderToplevelWrapperMap):
- * tests/wm.test: Add embedded Window test case for
- the stackorder command.
- * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap):
- * win/tkWinWm.c (TkWmStackorderToplevelWrapperMap):
- Ignore embedded windows during wm stackorder command.
-
-2002-05-21 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/configure.in: Invoke SC_ENABLE_SHARED before
- calling SC_CONFIG_CFLAGS so that the SHARED_BUILD
- variable can be checked inside SC_CONFIG_CFLAGS.
- * unix/tcl.m4: Update from Tcl.
-
-2002-05-20 Don Porter <dgp@users.sourceforge.net>
-
- * library/tk.tcl: A little namespace cleanup on Daniel Steffen's
- latest revisions to avoid defining new global commands.
-
-2002-05-20 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacInit.c:
- * mac/tkMacTclCode.r: include msgcat package in resources
- as bgerror depends on it. Restores ability of mac static
- build to run standalone (except for encoding file issues).
-
- * mac/tkMacInit.c:
- * library/console.tcl:
- * library/tk.tcl: fix tk.tcl not sourcing library files
- that define bindings at startup on mac. (independent of
- tk library files being in resources or on auto_path)
-
-2002-05-08 Don Porter <dgp@users.sourceforge.net>
-
- * library/bgerror.tcl:
- * library/tclIndex: Cleaned up namespace usage of the bgerror
- dialog. Completes soft dependence on msgcat. [FR 539309]
-
-2002-05-07 David Gravereaux <davygrvy@pobox.com>
- * win/makefile.vc: Problem with TCLDIR macro not accepting
- forward slash path seperators resolved. Added the same logic
- to INSTALLDIR, too. [Bug #553208]
-
-2002-04-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure:
- * unix/tcl.m4: change HP-11 SHLIB_LD_LIBS from "" to ${LIBS} so
- that the .sl knows its dependent libs.
-
-2002-04-24 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacTclCode.r:
- * mac/tkMacResource.r: added check of
- TCLTK_NO_LIBRARY_TEXT_RESOURCES #define to allow disabling the
- inclusion of the tk library code in the resource fork of Tk
- executables and shared libraries.
- Moved tk library code inclusion to separate file like in tcl.
- Added 'panedwindow' resource.
-
-2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/button.tcl (ButtonLeave): corrected the 3
- implementations of ButtonLeave to check for Priv(relief) existing
- before trying to use it. [Patch #541849]
-
- * generic/tkTextDisp.c (DisplayLineBackground):
- * unix/tkUnix3d.c (Tk_3DHorizontalBevel):
- * unix/tkUnixFont.c (Tk_DrawChars): applied fixes to not overrun
- the X window 16-bit size limit. [Patch #541999] (bonfield)
-
-2002-04-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkTextDisp.c (GetXView, GetYView): Comparison with
- previous values of scrollbar range are now done in a way that is
- sensitive to the bizarreness of floating-point on architectures
- where IEEE-FP is not used on the processor. Also increased the
- size of the temporary buffer to take account of the fact that
- TCL_DOUBLE_SPACE is meant to only imply enough space to take a
- printed double and trailing '\0', and no more. [Bug #223739]
- (FP_EQUAL_SCALE): New macro to help compare floating-point numbers
- for equality in a sane way, used in GetXView and GetYView.
-
-2002-04-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkWindow.c (TkCloseDisplay): Added to centralize where a
- display was closed. This handles freeing memory associated with a
- display and closing it.
- (DeleteWindowsExitProc): actually close displays. This would also
- ideally be done in Tk_DestroyWindow when the last window on the
- display has been closed, but that still has unresolved order of
- cleanup problems.
- (Tk_DestroyWindow): added TkFocusFree call.
-
- * generic/tkStubInit.c:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntDecls.h:
- * generic/tkInt.decls: added TkFocusFree, TkClipCleanup and
- TkGCCleanup generic private procs, and TkWmCleanup, TkSendCleanup
- and TkFreeXId unix private procs.
-
- * generic/tkInt.h:
- * unix/tkUnixXId.c (TkFreeXId): frees XID resources.
- Made idCleanupScheduled a Tcl_TimerToken (was int) in TkDisplay
- structure to allow us to delete the timer scheduled for it.
-
- * unix/tkUnixWm.c (TkWmStackorderToplevel): ensure children
- structure is freed.
- (ConfigureEvent, ComputeReparentGeometry): Add extra wm tracing info
- (TkWmRestackToplevel): initialize changes to 0 to prevent UMR.
- Use WaitForConfigureNotify on all windows. This part still
- requires fixing as it is the root of the 2 second raise delay on
- some window managers (those that use extra wrapper windows of
- their own).
-
- * unix/tkUnixSend.c (TkSendCleanup): free send-related resources
-
- * unix/tkUnixEvent.c (TkpCloseDisplay): call TkSendCleanup and
- TkWmCleanup.
-
- * unix/tkUnixSelect.c (SelRcvIncrProc): added missing Tcl_Release
- of interp
-
- * generic/tkGet.c (FreeUidThreadExitProc): free thread-specific
- resources on thread exit
-
- * generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
- * generic/tkClipboard.c (TkClipCleanup): frees TkDisplay data
- * generic/tkGC.c (TkGCCleanup): frees TkDisplay data
-
- * unix/tkUnixFont.c (FontPkgCleanup): cleanup thread specific font
- resources on thread exit.
-
- * mac/tkMacXStubs.c (TkpOpenDisplay): memset the initial display
- structures to 0.
-
- * generic/tkOption.c (OptionThreadExitProc): freed tsd option
- stacks on thread exit.
- (Tk_GetOption): free mem used to get Tk_Uid
-
- * generic/tkMenu.c (ConfigureMenu): freed saved options in all
- error cases.
-
- * win/tkWinInt.h: declaration for TkWinGetUnicodeEncoding
- * win/tkWinDialog.c (GetFileNameW): use TkWinGetUnicodeEncoding
- * win/tkWinInit.c (TkpDisplayWarning): use TkWinGetUnicodeEncoding
- * win/tkWinFont.c: use TkWinGetUnicodeEncoding instead of static
- unicodeEncoding.
-
- * win/tkWinX.c (Tk_SetCaretPos): remove WM_IME_STARTCOMPOSITION
- and place the IME position within Tk_SetCaretPos. Cache results in
- Tk_SetCaretPos to reduce unnecessary repositioning. Also call
- DestroyCaret if we receive WM_KILLFOCUS.
- (TkpOpenDisplay): ZeroMemory the initial display structures.
- (TkWinGetUnicodeEncoding): Added so that Windows only needs to
- cache this value one, and then free it in TkWinXCleanup.
- (HandleIMEComposition): add support for Win98 and ATOK13
- IME. (yamamoto)
-
- * generic/tkConsole.c (ConsoleCmd): correct return that should
- have just set result code.
-
- * generic/tkImgPhoto.c: Added PhotoFormatThreadExitProc to clean
- up on thread exit. (Tk_PhotoPutBlock) slight code updates
-
- * generic/tkPanedWindow.c (DestroyPanedWindow, ConfigureSlaves):
- fix mem leaks in not freeing slave info
-
- * win/configure:
- * win/tcl.m4: Enabled COFF as well as CV style debug info with
- --enable-symbols to allow Dr. Watson users to see function info.
- More info on debugging levels can be obtained at:
- http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
-
-2002-04-10 Mo DeJong <mdejong@users.sourceforge.net>
-
- * doc/wm.n:
- * mac/tkMacWm.c:
- * tests/wm.test:
- * unix/tkUnixWm.c:
- * win/tkWinWm.c: Update wm stackorder usage message
- to make it clear that either 1 or 3 arguments are
- required. [Bug 540013]
-
-2002-04-08 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacProjects.sea.hqx: added tkPanedWindow.c to projects
- * mac/tkMacAppInit.c: fixes to MSL stdin/stdout hookup to the
- TkConsole when using shared MSL libraries; fix for crashing
- bug on exit: writing to stdin/sterr when console has already
- been destroyed. (both fixes need support in MSL, see
- 'CW Pro6 changes' in tcl/mac/tcltkMacBuildSupport.sea.hqx)
- * mac/tkMacDialog.c: fixes to Navigation Services Dialog filter.
- * mac/tkMacDraw.c: add panic for overwide TkImages that would
- crash Tk on mac otherwise.
-
-2002-04-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- * mac/tkMacXStubs.c: added Tk_SetCaretPos stub (does nothing).
- * win/tkWinX.c: added Tk_SetCaretPos code to position IME windows
- correctly when WM_IME_STARTCOMPOSITION is received.
- * unix/tkUnixKey.c: added Tk_SetCaretPos and code for setting
- XIM caret in TkpGetString.
-
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tk.decls: added Tk_SetCaretPos declaration. This command
- allows users to indicate the cursor position and is used by XIM
- (Unix) or IME (Windows) to place the caret box correctly. It is
- also part of correct Accessibility style on Windows to make the
- magnifier jump to the focus point.
-
- * win/tkWinButton.c (TkpDisplayButton):
- * generic/tkTextMark.c (TkTextInsertDisplayProc):
- * generic/tkCanvText.c (DisplayCanvText):
- * generic/tkEntry.c (DisplayEntry): added Tk_SetCaretPos calls
-
- * generic/tkInt.h: added TK_XIM_SPOT #define (default 1).
- Added XFontSet attribute to TkDisplay when TK_XIM_SPOT is true.
- * generic/tkEvent.c (Tk_HandleEvent): made sure inputContexts are
- not getting created on DestroyNotify events (for dead windows).
- Added over-the-spot support if TK_XIM_SPOT is defined (default).
- The is the nicer XIM behavior, but uses a bit more memory.
-
- * unix/tkUnixEvent.c:
- * generic/tkWindow.c: moved OpenIM over to tkUnixEvent.c.
- Removed setting inputContext to null in Tk_MakeWindowExist as it
- was redundant.
-
- * unix/tkUnixWm.c (CreateWrapper): Removed redundat setting of
- inputContext to null.
-
- * win/Makefile.in: changed gdb and shell targets to properly build
- all binaries before running (otherwise an error often occured).
-
-2002-03-28 David Gravereaux <davygrvy@pobox.com>
-
- * win/.cvsignore (new):
- * win/lamp.bmp (new):
- * win/makefile.vc:
- * win/nmakehlp.c (new):
- * win/rules.vc: Brought the makefile up-to-date with Tcl's one.
- This now has support for Win9x issues and the winhelp target now
- exists. Color scheme can be changed. I'm just imparting a first
- suggestion using orange :) I'll have to think about the install
- portion of the helpfile as I'll need to do some tricks to insert
- tk's contents file into Tcl's using some special winhlp32.exe
- switches. [Bug 533862 527941]
-
- * win/makefile.vc: Tk helpfile is now installing itself into Tcl's
- contents file as part of the install target and rebuilding the
- contents table as desired. [Bug 527941]
-
- * doc/console.n: Changed topic from "Tcl Built-In Commands" to
- "Tk Built-In Commands"
-
- * win/buildall.vc.bat: Update to match Tcl.
-
-2002-03-26 Andreas Kupries <andreask_kupries@users.sourceforge.net>
-
- * unix/tkUnixFont.c: Added inclusion of <arpa/inet.h>. This fixes
- a GCC/HPUX problem with missing a "htons". See also
- "tclUnixPort.h" for equivalent code.
-
-2002-03-21 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: Changed optimize flag to -0ti instead of -02.
- [Bug 528441]
-
-2002-03-20 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkButton.c (ButtonTextVarProc,ButtonVarProc):
- * generic/tkCmds.c (WaitVariableProc):
- * generic/tkEntry.c (EntryTextVarProc):
- * generic/tkListbox.c (ListboxListVarProc):
- * generic/tkMenu.c (MenuVarProc):
- * generic/tkMenubutton.c (MenuButtonTextVarProc):
- * generic/tkMessage.c (MessageTextVarProc):
- * generic/tkScale.c (ScaleVarProc): Updates to handle change in
- type of part2 argument of Tcl_VarTraceProc typedef. [TIP 27]
- [Patch 532644].
-
-2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkOldConfig.c (Tk_ConfigureValue): prevent leaving
- interp->result as NULL.
-
-2002-03-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/text.tcl (TextPasteSelection): Renaming of TextPaste to
- prevent confusion with tk_textPaste. Stopped code from inserting
- selections twice, which seems to have happened with TIP#26, and
- reorganized code to reduce amount of stuff protected by catch
- which is tricky to maintain.
- (tk_textPaste): Reduce amount of code protected by catch.
-
-2002-03-06 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/tkWinX.c: Define _WIN32_IE as 0x0300
- before including commctrl.h so that we can
- access the InitCommonControlsEx API when
- building Tk with mingw.
-
-2002-03-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * README, generic/tk.h, unix/configure.in, unix/tk.spec:
- * win/configure.in: Bumped patchlevel; this might need to change
- in the future, but it will help us distinguish between the CVS
- version and the most recent released version.
-
-2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- *** 8.4a4 TAGGED FOR RELEASE ***
-
- * unix/README: updated --* options docs.
-
- * unix/tk.spec: fixed URL refs to use www.tcl.tk or SF.
-
-2002-03-04 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README:
- * mac/README:
- * unix/README:
- * win/README: updated to use www.tcl.tk URL.
-
-2002-03-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/entry.tcl: added catch around Triple-1 binding use of
- sel.last
-
-2002-02-28 Don Porter <dgp@users.sourceforge.net>
-
- * library/console.tcl (ConsoleBind): Corrected console <<Paste>>
- binding on Unix platforms.
-
-2002-02-26 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
- * generic/tkWindow.c (Tk_MainWindow, Tk_GetNumMainWindows):
- protect against being called before Tcl stubs are init'ed.
- [Bug #220916] (porter)
-
-2002-02-25 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkText.c (ConfigureText): reenable the blinking cursor
- on state change where necessary. [Bug #503772]
-
- * tests/listbox.test:
- * generic/tkListbox.c: corrected error handling when setting to an
- invalid listvar value. [Bug #503613]
-
- * library/scale.tcl: mirror B2 bindings to B3 on Windows to better
- accomodate two button mice. [Patch #493145]
-
- * library/panedwindow.tcl: improved proxy sash handling. (boudaillier)
-
-2002-02-25 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/filebox.test: Reorganised and fixed so that tests are
- executed fewer times (!) and the automatic extension adding
- behaviour of tk_getSaveFile is tested.
-
-2002-02-23 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2002-02-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkPanedWindow.c (PanedWindowWidgetObjCmd): fixed returns
- that should have been breaks instead. Corrected .pw configure
- handling for insufficient args. [Patch #521436] (boudaillier)
-
- * mac/tkMacDefault.h:
- * unix/tkUnixDefault.h:
- * win/tkWinDefault.h: changed panedwindow default relief to flat,
- a more natural outer relief.
-
- * library/panedwindow.tcl (ReleaseSash): changed to not pass x and
- y args at all (they aren't used).
- Added proc comments. Made configuring sash cursor more efficient.
- Added Cursor timer that restores the default cursor when pointer
- is no longer over the sash. This is necessary because Leave
- events won't be seen when moving into a paned child.
-
-2002-02-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/widget: New section "Paned Windows"
- * library/demos/paned2.tcl, library/demos/paned1.tcl: New files.
-
- * library/panedwindow.tcl (ReleaseSash): Added missing arguments.
- * library/tk.tcl: Bindings for paned window were not being loaded
- by default.
-
- * unix/tkUnixMenu.c (GetMenuLabelGeometry,DrawMenuEntryLabel):
- Stop meaningless GCC warnings.
-
-2002-02-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * doc/panedwindow.n (new):
- * generic/tkPanedWindow.c (new):
- * generic/tkInt.h:
- * generic/tkWindow.c:
- * library/panedwindow.tcl (new):
- * mac/tkMacDefault.h:
- * tests/panedwindow.test (new):
- * unix/Makefile.in:
- * unix/tkUnixDefault.h:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/tkWinDefault.h: added implementation of TIP #41, panedwindow
- widget. [Patch #512503] (melski)
-
- * generic/tkOption.c (ReadOptionFile): fixed Tcl_Seek casting to
- remove warnings (we expect no option files with be > 2GB).
-
- * unix/configure: regenerated
- * unix/tcl.m4: updated to sync with Tcl's tcl.m4
- Added --enable-64bit support for AIX-4 using IBM's xlc (-q64 flag).
-
-2002-02-19 Don Porter <dgp@users.sourceforge.net>
-
- * changes: First draft of updated changes for 8.4a4 release.
-
-2002-02-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImgPhoto.c (MatchFileFormat): Tcl_Seek takes
- Tcl_WideInt offset (three places.)
- * generic/tkImgPPM.c (FileReadPPM): Tcl_Seek takes Tcl_WideInt offset.
- * generic/tkFrame.c (ConfigureFrame): Stop GCC warning.
+2005-04-14 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkImgGIF.c: Made file meet the formatting rules from the
- Tcl Engineering Manual better; mostly differences in whitespace.
+ * unix/tkUnixFont.c (FontMapLoadPage): reorder char[] decls to avoid
+ possible segv. Minimal fix for [Bug 1122671]
-2002-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+2005-04-12 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/configure: regen'd
- * unix/tcl.m4:
- * unix/configure.in: added macros and calls to SC_TCL_EARLY_FLAGS
- and SC_TCL_64BIT_FLAGS, part of TIP #72.
-
-2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * library/entry.tcl:
- * library/text.tcl: Adjust <Double-1> and <Triple-1> bindings
- so that no anchor point is set and the insertion cursor is
- set to the last character in the selection. [Bug 220943]
- * tests/event.test: Add test cases for double click and
- drag as well as triple click and drag in the text and
- entry widgets.
-
-2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/event.test (_text_ind_to_x_y, _get_selection): Fix
- incorrect use of results from bbox invocation so that
- y center point for a give index is calculated correctly.
- Add new method to return the selection and use it in
- test cases. Always lappend to the result list to avoid
- case where initial result includes a space.
-
-2002-02-07 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkMain.c:
- * mac/tkMacInit.c:
- * mac/tkMacKeyboard.c:
- * win/tkWinDialog.c:
- * win/tkWinTest.c: modified some callers of Tcl routines that
- were restored to return (char *) pointing into Tcl_DStrings.
-
-2002-02-03 eric melski <ericm@interwoven.com>
-
- * generic/tkImage.c (Tk_ImageObjCmd): Clean up bogus for loop in
- [image inuse] subcommand [Bug #485803].
-
-2002-02-01 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkCmds.c (Tk_TkObjCmd): don't use 'bool' as an arg as it
- conflicts with the C99 spec. [Bug #511956] (ingham)
-
-2002-02-01 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: unset macro located in the tktest target
- caused a failure to build. [Bug 511652]
-
-2002-01-30 Don Porter <dgp@users.sourceforge.net>
-
- * win/stubs.c (XSetCommand): Overlooked CONSTification.
-
-2002-02-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/photo.n: Documented transparency subcommand.
- * tests/imgPhoto.test (imgPhoto-4.40...imgPhoto-4.68): Tests for
- the transparency subcommand.
- * generic/tkImgPhoto.c (ImgPhotoCmd): Added transparency
- subcommand (see TIP #14.)
-
-2002-01-31 Todd Helfter <tmh@users.sourceforge.net>
- * generic/tkMenu.c (ConfigureMenuCloneEntries)
- * tests/menu.test (menu3.68)
- Correct and test for logic error when cloning menus. [Bug #508988]
-
-2002-01-30 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tk.decls: The POTENTIAL INCOMPATIBILITY in the changing
- interface of Tk_ParseArgv can now be removed by the -DUSE_NON_CONST
- compiler flag.
- * generic/tkDecls.h: make genstubs
-
-2002-01-29 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * win/tkWinInit.c (TkpGetAppName): TIP 27 fixup. The code now does
- not write into the CONST path returned by "argv0" and
- Tcl_SplitPath anymore.
-
-2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/configure.in: Don't set TCL_LIB_SPEC and
- TCL_STUB_LIB_SPEC variables since this breaks
- the AIX build. This was used in the past to
- support linking with Tcl from the build dir
- or the install dir, but it is no longer needed.
-
-2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Remove commented out vars.
- * unix/configure: Regen.
- * unix/configure.in: Don't subst vars that are already
- taken care of in SC_LOAD_TCLCONFIG.
- * unix/tcl.m4: Update from Tcl.
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2001-01-27 Daniel Steffen <das@users.sourceforge.net>
-
- * generic/tkFileFilter.c:
- * mac/tkMacInit.c:
- * mac/tkMacKeyboard.c:
- * mac/tkMacMenus.c: TIP 27 CONSTification induced changes
-
-2002-01-25 Don Porter <dgp@users.sourceforge.net>
-
- * All changes below are Patch 505159
-
- * doc/AddOption.3:
- * doc/CanvTkWin.3:
- * doc/GetPixels.3:
- * doc/Name.3:
- * doc/ParseArgv.3:
- * generic/tk.decls (Tk_AddOption,Tk_CanvasGetCoord,Tk_GetPixels,
- Tk_GetScreenMM,Tk_NameToWindow,Tk_ParseArgv):
- * generic/tkArgv.c (Tk_ParseArgv):
- * generic/tkCanvLine.c (ParseArrowShape):
- * generic/tkCanvUtil.c (Tk_CanvasGetCoord,Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc,Tk_GetDash):
- * generic/tkCanvas.c (ConfigureCanvas):
- * generic/tkGet.c (Tk_GetPixels,Tk_GetScreenMM):
- * generic/tkImgPhoto.c (ImgPhotoCmd):
- * generic/tkMain.c (Tk_MainEx):
- * generic/tkOldConfig.c (FormatConfigInfo):
- * generic/tkOption.c (Tk_AddOption):
- * generic/tkText.c (TextWidgetCmd,TkTextGetTabs,DumpSegment):
- * generic/tkText.h (TkTextCreateTag):
- * generic/tkTextTag.c (TkTextCreateTag):
- * generic/tkWindow.c (Tk_NameToWindow,Initialize):
- * mac/tkMacCursor.c (FindCursorByName,TkGetCursorByName):
- * mac/tkMacWm.c (Tk_WmCmd):
- * unix/tkUnixCursor.c (TkGetCursorByName):
- * unix/tkUnixSend.c (ValidateName):
- * unix/tkUnixWm.c (Tk_WmCmd):
- * win/tkWinCursor.c (TkGetCursorByName):
- * win/tkWinWm.c (Tk_WmCmd): Updated callers of Tcl_SplitList and
- Tcl_Merge.
- * generic/tkDecls.h: make genstubs
- ***POTENTIAL INCOMPATIBILITY***
- Includes a source incompatibility in the argv argument of Tcl_ParseArgv.
-
- * generic/tkBind.c (DeleteVirtualEvent):
- * generic/tkCanvas.c (ScrollFractions, CanvasWidgetCmd,
- CanvasUpdateScrollbars):
- * generic/tkTestTag.c (TkTextTagCmd): Updated callers of
- Tcl_GetStringResult. Rewrote PrintScrollFractions to
- ScrollFractions to stop scribbling directly on interp->result.
-
- * generic/tkInt.decls (TkGetDefaultScreenName, TkpDisplayWarning,
- TkpOpenDisplay):
- * generic/tkCanvPs.c (Tk_PostscriptColor, Tk_PostscriptFont):
- * generic/tkEntry.c (EntrySetValue, EntryValidateChange, ExpandPercents,
- EntryValueChanged, Tk_EntryObjCmd, DestroyEntry, ConfigureEntry,
- EntryComputeGeometry, InsertChars, DeleteChars, EntryFetchSelection,
- EntryTextVarProc, Tk_SpinBoxObjCmd, SpinboxWidgetObjCmd):
- * generic/tkMain.c (Prompt):
- * generic/tkMenu.c (MenuVarProc):
- * generic/tkMenubutton.c (ConfigureMenuButton, MenuButtonTextVarProc):
- * generic/tkMessage.c (ConfigureMessage, MessageTextVarProc):
- * generic/tkWindow.c (GetScreen, Initialize):
- * mac/tkMacInit.c (TkpInit, TkpDisplayWarning):
- * mac/tkMacXStubs.c (TkGetDefaultScreenName, TkpOpenDisplay):
- * unix/tkUnix.c (TkGetDefaultScreenName):
- * unix/tkUnixEvent.c (TkpOpenDisplay):
- * unix/tkUnixInit.c (TkpGetAppName, TkpDisplayWarning):
- * unix/tkUnixSend.c (SendEventProc):
- * win/tkWinInit.c (TkpGetAppName, TkpDisplayWarning):
- * win/tkWinX.c (TkGetDefaultScreenName,TkpOpenDisplay): Updated
- callers of Tcl_GetVar, Tcl_GetVar2
- * generic/tkIntDecls.h: make genstubs
-
- * generic/tkCanvPs.c (TkCanvPostscriptCmd):
- * generic/tkImgBmap.c (TkGetBitmapData):
- * generic/tkOption.c (ReadOptionFile):
- * mac/tkMacInit.c (TkpInit, TkpGetAppName):
- * win/tkWinInit.c (TkpGetAppName): Updated callers of
- Tcl_SplitPath, Tcl_JoinPath, and Tcl_TranslateFileName.
-
-2002-01-18 Mo DeJong <mdejong@users.sourceforge.net>
-
- * tests/wm.test: Rewrite stackorder tests that
- deal with toplevels that have the overrideredirect
- flag set. [Tk bug 492259]
-
-2002-01-18 Don Porter <dgp@users.sourceforge.net>
-
- * win/tkWinDialog.c: Overlooked Tcl_GetIndexFromObj callers.
-
-2001-01-18 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacDialog.c:
- * mac/tkMacSend.c: TIP 27 CONSTification broke the mac
- build in a few places.
-
-2002-01-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkListbox.c (ChangeListboxOffset): improved tracking
- when scrolling on x axis with entry/text. [Bug #225025] (voskuil)
-
-2002-01-16 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tk3d.c (Tk_GetReliefFromObj):
- * generic/tkBind.c (Tk_EventObjCmd,HandleEventGenerate):
- * generic/tkButton.c (ButtonWidgetObjCmd):
- * generic/tkCanvas.c (CanvasWidgetCmd,FindItems):
- * generic/tkClipboard.c (Tk_ClipboardObjCmd):
- * generic/tkCmds.c (Tk_BellObjCmd, Tk_TkObjCmd, Tk_TkwaitObjCmd,
- Tk_UpdateObjCmd, Tk_WinfoObjCmd, Tk_WmObjCmd):
- * generic/tkConfig.c (DoObjConfig):
- * generic/tkEntry.c (EntryWidgetObjCmd, SpinboxWidgetObjCmd):
- * generic/tkFocus.c (Tk_FocusObjCmd):
- * generic/tkFont.c (Tk_FocusObjCmd, ConfigAttributesObj):
- * generic/tkFrame.c (Tk_FrameObjCmd):
- * generic/tkGet.c (Tk_GetAnchorFromObj, Tk_GetJustifyFromObj):
- * generic/tkGrab.c (Tk_GrabObjCmd):
- * generic/tkGrid.c (Tk_GridObjCmd,GridRowColumnConfigureCommand,
- GridSlavesCommand, ConfigureSlaves):
- * generic/tkImage.c (Tk_ImageObjCmd):
- * generic/tkImgBmap.c (ImgBmapCmd):
- * generic/tkImgGIF.c (FileReadGIF):
- * generic/tkImgPhoto.c (ImgPhotoCmd):
- * generic/tkListbox.c (ListboxWidgetObjCmd, ListboxSelectionSubCmd,
- GetListboxIndex):
- * generic/tkMenu.c (MenuWidgetObjCmd, MenuAddOrInsert, MenuCmd,
- ConfigureMenu, CloneMenu):
- * generic/tkMenubutton.c (MenuButtonWidgetObjCmd):
- * generic/tkMessage.c (MessageWidgetObjCmd):
- * generic/tkOption.c (Tk_OptionObjCmd):
- * generic/tkPack.c (Tk_PackObjCmd, ConfigureSlaves):
- * generic/tkPlace.c (Tk_PlaceObjCmd):
- * generic/tkScale.c (ScaleWidgetObjCmd):
- * generic/tkSelect.c (Tk_SelectionObjCmd):
- * generic/tkSquare.c (SquareWidgetObjCmd):
- * generic/tkTest.c (TestobjconfigObjCmd, TrivialConfigObjCmd,
- TestfontObjCmd): Updates to handle change in type of tablePtr
- argument of Tcl_GetIndexFromObj(Struct) from (char **) to
- (CONST char **). [TIP 27] [Patch 504705]
-
- * generic/tkCanvText.c (GetSelText):
- * generic/tkEntry.c (Entry{FetchSelection,Setvalue},ExpandPercents):
- * generic/tkSelect.c (HandleTclCommand):
- * generic/tkText.c (TextSearchCmd):
- * generic/tkTextIndex.c (TkTextMakeByteIndex, TkTextIndexBackChars):
- * mac/tkMacFont.c (Tk_MeasureChars, BreakLine):
- * unix/tkUnixMenu.c (DrawMenuUnderline):
- * win/tkWinMenu.c (GetEntryText, DrawMenuUnderline): Updated
- callers of Tcl_Utf* and Tcl_Regexp* APIs to reflect TIP 27 API
- changes (see Tcl Patch 471509). [Patch 471513]
-
-2002-01-16 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2002-01-04 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkMain.c (Tk_MainEx): Updated callers of CONSTified
- Tcl interfaces Tcl_EvalFile and TclGetStartupScriptFileName.
-
- * generic/tkConsole.c (ConsoleOutputProc, TkConsolePrint):
- * generic/tkInt.h (TkConsolePrint):
- * mac/tkMacAppInit.c (TkConsolePrint): Updated Tk's console to
- CONSTified channel driver interface. [Tcl Patch 503565, Tk Patch
- 503983]
-
-2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
-
- Use ${libdir} instead of ${exec_prefix}/lib. [Tcl bug 489370]
-
- * unix/configure: Regen.
- * unix/configure.in: Define and use libdir.
- * win/configure: Regen.
- * win/configure.in: Define libdir.
-
-2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Burn Tcl and Tk build
- directories into tktest executable to avoid crashes
- caused by ld loading a previously installed version
- of the tcl or tk shared libraries. Remove setting
- of LD_LIBRARY_PATH, LIBPATH, and SHLIB_PATH
- before running tktest since it should no
- longer be required.
-
-2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
-
- Enable use of Tcl stubs when building Tk as
- a shared library. This should fix the build
- under AIX. [Bugs 220858, 220955, 220921]
-
- * unix/Makefile.in: Add TCL_STUB_LIB_SPEC and
- TCL_STUB_LIB_FLAG variables.
- * unix/configure: Regen.
- * unix/configure.in: Pass TCL_STUB_LIB_SPEC into
- Makefile and use it when linking the tk shared library.
- Define USE_TCL_STUBS when building shared. Subst
- TCL_STUB_LIB_SPEC and TCL_STUB_LIB_FLAG.
-
-2002-01-08 D. Richard Hipp <drh@hwaci.com>
-
- * win/tkWinMenu.c: Fix the following bug: If you select an entry
- on a cascade menu then the next time the parent menu is posted, the
- cascade entry was active. Also, if you traverse to a disabled entry
- using keystrokes and press ENTER on the disabled entry, then that
- entry appears active the next time the menu is posted. The same
- patch fixes both problems.
-
-2002-01-04 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkBind.c (TkBindFree):
- * generic/tkGrid.c (ResolveConstraints,CheckSlotData,DestroyGrid):
- * generic/tkSelect.c (Tk_DeleteSelHandler,TkSelDeadWindow): Replaced
- Tcl_Free calls with ckfree so that memory debugging is fully supported.
-
-2001-12-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * test/winButton.test:
- * win/tkWinButton.c: added updated patch #463234 which returns the
- default sizing behavior (not so native), but enables native L&F
- with negative sizing (-11 for example).
-
- * library/text.tcl (tk::TextButton1): made text receive focus even
- in disabled state for Windows to show selection and allow
- mouse-wheel scrolling.
-
- * win/tkWinInit.c (TkpDisplayWarning): added Tcl_DStringFree's
-
- * win/tkWinInt.h:
- * win/tkWinX.c: added TkWinProcs that represent a function table
- to switch between unicode and ansi procs on Windows. This is
- analogous to the TclWinProcs. Using Tcl_WinUtfToTChar, we can
- easily take advantage of using unicode functions where available
- without having to switch on the platform id each time.
-
- * win/tkWinWm.c (InitWindowClass): corrected init routines to
- allow unicode in window titles on Windows (for Win2K/XP).
- (TkWmStackorderToplevel): Corrected casts to enable debug compile
-
- * win/configure: regen'ed
- * win/tcl.m4: added shell32.lib to link libs, as these are
- necessary for new directory chooser (when enabled).
-
- * win/tkWinDialog.c (Tk_MessageBoxObjCmd): use MessageBoxW for
- proper display of unicode errors.
- Added patch which uses new OLE based directory chooser. This
- still has some issues, so is disabled by default. [Patch #468139]
- (ColorDlgHookProc) Corrected ability to use unicode chars in
- tk_chooseColor -title.
-
-2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinInit.c (TkpDisplayWarning): Use MessageBoxW in case the
- error displayed has unicode chars. [Bug #485986]
-
-2001-12-27 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacInit.c:
- * mac/tkMacResource.r: synced up tkInit features to unix/win:
- use existing tkInit proc if defined. Added spinbox.tcl resource.
- Used TclGetEnv() instead of Tcl_GetVar2(interp, env)
- * mac/tkMacApplication.r:
- * mac/tkMacLibrary.r: minor version resources cleanup
-
-2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkButton.c (ButtonTextVarProc): guard against being
- called while the *button/label is being deleted. [Bug #490051]
-
- * library/entry.tcl:
- * library/spinbox.tcl:
- * library/text.tcl: added extra checks against bug #220269 and
- made spinbox reuse more of the entry procedure code.
-
-2001-12-20 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2001-12-19 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure: Regen.
- * unix/configure.in: Move EXP file changes over from
- Tcl configure script to fix AIX build with gcc. [Bug 220955]
-
-2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in:
- * win/Makefile.in: Use $(MAKE) instead of make
- in the tcltest rule.
-
-2001-12-18 Don Porter <dgp@users.sourceforge.net>
-
- * tests/event.test (event-click-drag-1.2): Corrected test that
- failed on Solaris/CDE due to text scrolling. [Bug 413735]
-
-2001-12-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/spinbox.tcl (ButtonDown): added catch to ignore
- possible error in after cancel when Priv(afterId) isn't defined.
-
- * doc/spinbox.n: corrected spin(up|down) -> button(up|down)
-
-2001-12-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/getOpenFile.n: Documented change.
- * library/tkfbox.tcl (SetFilter): Added code to guess the correct
- default extension from whatever value was selected in the
- filetypes option menu. Adapted from code by Chris Nelson
- submitted in Patch #492220.
-
-2001-12-12 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap): added static
-
-2001-12-05 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkText.c:
- * generic/tkText.h: changed TkTextEditType enums to be prefaced
- with TK_EDIT_ to prevent name collision.
-
-2001-12-05 Daniel Steffen <das@users.sourceforge.net>
-
- * mac/tkMacWm.c: mac implementation of wm stackorder
- (patch 481148, TIP 74)
-
-2001-12-03 Mo DeJong <mdejong@users.sourceforge.net>
-
- Add TK patch 481148 to implement TIP 74, the
- wm stackorder command.
-
- * doc/winfo.n: Update documentation for the winfo
- children command to indicate that top-level windows
- are not returned in stacking order.
- * doc/wm.n: Add documentation for wm stackorder.
- * generic/tkInt.decls (TkWmStackorderToplevel):
- Add decl for new function.
- * generic/tkIntDecls.h: Regen.
- * generic/tkStubInit.c: Regen.
- * tests/unixWm.test: Add stackorder command to test
- for wm command usage message.
- * tests/wm.test: Add new set of tests for generic
- window manager methods.
- * unix/tkUnixWm.c (Tk_WmCmd,
- TkWmStackorderToplevelWrapperMap,
- TkWmStackorderToplevel): Add unix implementation of
- new wm stackorder command.
- * win/tkWinWm.c (Tk_WmCmd,
- TkWmStackorderToplevelEnumProc,
- TkWmStackorderToplevelWrapperMap,
- TkWmStackorderToplevel): Add windows implementation
- of new wm stackorder command.
-
-2001-12-03 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: install target changes by request from
- Ryan Casey <scfiead@hotmail.com>.
-
-2001-11-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/widget: Further overhauling; shrank fonts, made
- better use of fonts, added an icon, fixed the About box. Prompted
- by Bug #487442 from Vincent Wartelle.
-
-2001-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/palette.tcl (tk_setPalette): Added heuristic to guess
- from the background whether to use black or white for the
- foreground when not told specifically. Suggested by Chris Nelson,
- this makes the command fit the documentation better!
-
-2001-11-27 David Gravereaux <davygrvy@pobox.com>
-
- * win/makefile.vc: Fixed CAT32 target. cat.c is located in the Tcl
- source, not the Tk source.
-
-2001-11-27 D. Richard Hipp <drh@hwaci.com>
-
- * library/menu.tcl: Do not allow keyboard traversal of torn-off
- menus to visit the (invisible) tearoff bar.
-
-2001-11-26 D. Richard Hipp <drh@hwaci.com>
-
- * win/tkWinMenu.c: disabled menu items show the activebackground
- color in their background. This change makes menu behavior
- consistent with what native windows does.
-
-2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in: Add comments to better describe
- TCL_EXE and when it should be available. Add
- rule that prints message about running `make genstubs`
- when tkStubInit.c is out of date.
- * win/Makefile.in: Add TCL_TOOL_DIR and TCL_EXE
- variables to better match the Tcl Makefile. Add
- genstubs rule so tkSTubInit.c can be regenerated.
-
-2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/configure: Regen.
- * win/configure.in: Don't AC_SUBST CFLAGS_DEBUG, CFLAGS_OPTIMIZE,
- or CFLAGS_WARNING since it is now done in SC_CONFIG_CFLAGS.
- * win/tcl.m4 (SC_CONFIG_CFLAGS): AC_SUBST DL_LIBS, CFLAGS_DEBUG,
- CFLAGS_OPTIMIZE, and CFLAGS_WARNING.
-
-2001-11-23 Daniel Steffen <das@users.sourceforge.net>
-
- Up-port to 8.4 of mac code changes for 8.3.3 & various new
- changes for 8.4, some already backported to 8.3.4 (patch #435660)
-
- * library/tk.tcl: added <Key-F1> binding for <<Undo>> on the mac (TIP26)
-
- * library/button.tcl: fixed undefined $Priv(repeated) error for button
- without -repeatdelay support
-
- * generic/tkConsole.c:
- * library/console.tcl:
- * mac/tkMacInit.c:
- * mac/tkMacResource.r: corrected how mac deals with tcl library
- files present both in resources and in $tk_library directory.
-
- * generic/tkConsole.c: crashing bug fix when printing to console
- at program exit after the console has already been closed.
- Now setting gStdoutInterp=NULL in ConsoleClose().
-
- * mac/tkMacInit.c: correct use of Tcl_JoinPath in tk_library
- initialization
-
- * mac/tkMacMenu.c: special MDEF_PROC_OFFSET only needed for
- exactly one specific version of the MWERKS 68k compiler .
-
- * mac/tkMacShLib.exp: removed file
-
- * unix/Makefile.in: removed reference to .exp files
-
- * mac/MWTkBuildLibHeader.h:
- * mac/MW_TkBuildLibHeader.pch:
- * mac/MW_TkHeaderCommon.h:
- * mac/MW_TkOldImgStaticHeader.h:
- * mac/MW_TkStaticHeader.h:
- * mac/MW_TkStaticHeader.pch: new precompiled header files
-
- * mac/MW_TkHeader.pch:
- * mac/MW_TkOldImgHeader.h:
- * mac/MW_TkTestHeader.pch: revised precompiled header handling: now
- include a common header file 'MW_TkHeaderCommon.h' from all .pch files,
- the .pch files themselves now only setup #defines (e.g. BUILD_tk,
- STATIC_BUILD, TCL_DEBUG, TCL_THREADS) like in makefiles on other
- platforms.
-
- * mac/tkMac.h:
- * mac/tkMacPort.h:
- * mac/tkMacInt.h: use of BUILD_tk and TCL_STORAGE_CLASS like on other
- platforms, standardize #include'd files to what's done on other
- platforms, removed use of #pragma export, changed extern to EXTERN
- where appropriate to enable DLL export via the TCL_STORAGE_CLASS
- mechanism.
-
- * mac/tkMacAppearanceStubs.c: removed use of #pragma export
-
- * mac/widget.r: new resource file for 'Widget Demos'
-
- * mac/tkMacProjects.sea.hqx: updated mac build project files:
- build support for CodeWarrior Pro6, UnivIntf 3.4 & shared runtime
- libraries (see Tcl ChangeLog for details).
- changed weak linking so that CFM68k binaries now work on all OS
- versions from the free 7.5.5 onwards, with or without AppearanceMgr
- and/or NavigationMgr installed.
- added target to automatically build 'Widget Demos'
- included XML versions of the projects for CW Pro5 or Pro7 users.
- use compat/strtod.c instead of MSL's strtod()
-
- * generic/tkInt.decls:
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkStubInit.c:
-
- * mac/tkMacInt.h: MAC_TCL tk stub support was badly broken due to
- multiply defined (mac specific) names in tk.decls and tkInt.decls,
- removed the duplicates from the internal unsupported interfaces
- "interface tkInt" and "interface tkIntPlat"; moved declaration of
- TkpIsWindowFloating from tkMacInt.h to tkInt.decls: interface tkIntPlat.
- - these changes to the stub tables might require you to recompile your
- Tk extensions if they turn out to reference one of the removed routines
- in the wrong table (should be unlikely).
-
- * generic/tkMain.c: MAC_TCL: workaround for broken/non-standard isatty
- on MW Pro6, #include <unistd.h> instead of defining isatty
-
- * generic/tkPointer.c: MAC_TCL: #include tkMacInt.h
-
- * generic/tkStubLib.c: MAC_TCL: removed obsolete special casing of mac
- headers, standardize #include'd files to what's done on other platforms
-
- * mac/tclets.r:
- * mac/tkMacWindowMgr.c:
- * mac/tkMacScrlbr.c:
- * mac/tkMacMenu.c:
- * mac/tkMacMenus.c:
- * mac/tkMacFont.c:
- * mac/tkMacDialog.c:
- * mac/tkMacButton.c: renamed obsolete apple API names to modern
- equivalents; UH3.4 support: added #include <ControlDefinitions.h>;
- fixed munged non-ASCII chars in sources due to bungled latin1<->mac
- roman encoding in CVS repository.
-
- * mac/tkMacDialog.c: added support for -filetypes option (fix for bug
- tcl #221636); added update event handling for background windows while
- in a NavigationMgr dialog; fixed nasty bug when calling CustomGetFile
- (missing addr operator) (fix for bug tk #220911 & tcl #219367); renamed
- routines conflicting with standard MoreFiles headers (see Tcl ChangeLog
- for details)
-
- * mac/tkMacApplication.r:
- * mac/tkMacLibrary.r:
- * mac/tkMacResource.r: fixed obsolete copyrights/dates in version
- strings, updated version strings to standard usage, added support for
- '(Support Libraries)' subfolder for shared runtime libraries in
- unmerged binaries, commented out demo setting of "Tcl Environment
- Variables"; reorganized resources among these files to avoid
- multiple copies in applications and shared libraries, the script
- libraries/Xcursors etc are now no longer duplicated in Wish but are
- only included in the resources of Tk.shlb.
-
- * mac/tkMacMenu.c:
- * mac/tkMacMDEF.r: changes to support MW Pro 6 68k (vers 0x2400 only)
- compiler producing different offset to start of MDEF; fix to static 68k
- presence testing when calling the custom MDEF
-
- * mac/tkMacWm.c.c:
- * mac/tkMacWindowMgr.c: added/fixed AppearanceMgr checks; override
- AppearanceMgr version detection on static 68k to ensure static 68k Wish
- runs on PPCs with recent AppearanceMgr
-
- * mac/tkMacButton.c: fixed misplaced/missing variable initialization.
-
-2001-11-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkText.c (TextGetText): reworked to use DString for
- improved speed. (callewaert, darley)
- (DestroyText): plugged mem leak when not clearing stack (callewaert)
- (TextGetText): more efficient string size calculation (darley)
-
-2001-11-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/entry3.tcl: New demo showing off validation and
- password entry.
-
- * library/demos/widget: Some reorganization to make the code
- simpler, plus a new entry demo.
-
-2001-11-17 Jeff Hobbs <jeffh@ActiveState.com>
+ * 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.
- * win/tkWinButton.c (TkpComputeButtonGeometry): corrected the
- default size of Windows buttons to conform to the Windows style.
- This changes the default size of buttons on Windows.
- [Patch #463234] (nelson)
- **** POTENTIAL VISUAL INCOMPATABILITY ****
+2005-04-09 Daniel Steffen <das@users.sourceforge.net>
-2001-11-16 Jeff Hobbs <jeffh@ActiveState.com>
+ * macosx/README: updated requirements for OS & developer tool versions
+ + other small fixes/cleanup.
- * library/menu.tcl: corrected menu traversal code on Unix to
- better handle entering cascades. [Patch #481219] (oleinick)
+ * macosx/tkMacOSXEntry.c (ComputeIncDecParameters): manually define
+ constants present only in 10.3 headers so that we can build on 10.2.
-2001-11-16 David Gravereaux <davygrvy@pobox.com>
+ * macosx/Wish.pbproj/project.pbxproj: fixed absolute path to tkEntry.h
+ that confused 10.2 PBX.
- * win/makefile.vc: Install target repaired.
+ * unix/tcl.m4 (Darwin): added -single_module linker flag to
+ TCL_SHLIB_LD_EXTRAS and TK_SHLIB_LD_EXTRAS.
+ * unix/configure: autoconf-2.59
-2001-11-15 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+2005-04-07 Mo DeJong <mdejong@users.sourceforge.net>
- * library/demos/image2.tcl: Many improvements to this
- image-viewing demo; now uses labelframes and tk_chooseDirectory
+ * 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]
- * library/palette.tcl (::tk::RecolorTree): Made this work better
- with CDE, which does some extremely annoying things with the
- option database that interact badly with Tk's way of handling
- options.
-
- * doc/text.n: Overhauled the documentation of undo to make it
- easier to understand.
- * library/tk.tcl (::tk::EventMotifBindings): Added Emacs-like undo
- binding, but not behaviour (we separate undo and redo.)
- * library/demos/text.tcl: Show off our undo capability!
+2005-04-06 Donal K. Fellows <dkf@users.sf.net>
-2001-11-12 David Gravereaux <davygrvy@pobox.com>
+ * 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.
- * win/mkd.bat:
- * win/rmd.bat: Removed -kb CVS attribute and added changes
- from Llyod Lim for better stability. [Patch #456761]
+2005-04-04 Don Porter <dgp@users.sourceforge.net>
- * win/rules.vc(new):
- * win/buildall.vc.bat(new):
- * win/makefile.vc: large rewrite following Tcl's makefile.vc as
- a guide and Patch #456761. Appears BugFree(tm).
+ * library/comdlg.tcl: Added Macintosh file type validation to
+ [::tk::FDGetFileTypes]. [Bug 1083878] (Thanks, Vince Darley)
-2001-11-12 Jeff Hobbs <jeffh@ActiveState.com>
+2005-04-04 Vince Darley <vincentdarley@users.sourceforge.net>
- * doc/text.n:
* generic/tkText.c:
- * generic/tkText.h:
- * generic/tkTextTag.c:
- * library/text.tcl:
- * library/tk.tcl:
- * mac/tkMacDefault.h:
- * tests/text.test:
- * unix/tkUnixDefault.h:
- * win/tkWinDefault.h: added TIP #26 implementation of simple
- built-in undo/redo of text editing in the text widget.
- [Patch #458879] (callewaert)
-
-2001-11-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/menu.tcl: Show off -compound support in menus.
-
- * library/demos/radio.tcl: Added some code to both show off the
- extra capabilities of the buttons and also show what can be done
- with compound images on the sly.
-
-2001-11-10 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in:
- * win/Makefile.in: Add "make gdb" target. This target
- can run wish inside either gdb or insight.
-
-2001-11-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/clrpick.tcl: changed a few parameters so that the full
- 0..255 range could be accessed via the mouse. [Bug #478498]
-
- * unix/configure:
- * unix/tcl.m4: added -lc to AIX libs, fixed path to ldAix
-
- * win/configure:
- * win/tcl.m4:
- * win/makefile.vc: add comctl32.lib to build libs.
- * win/tkWinX.c (TkWinXInit): added InitCommonControlsEx call.
- * win/rc/tk.rc:
- * win/rc/wish.rc:
- * win/rc/wish.exe.manifest: added resources that specify using v6
- of the MS Common Controls library when available (WinXP+). This
- enables use of the themeable widgets (like scrollbars) to be used
- in Tk. [Patch #478933]
-
-2001-11-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure:
- * unix/tcl.m4: Update from Tcl.
-
-2001-11-08 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/Makefile.in:
- Avoid adding libc to the LIBS and WISH_LIBS
- variables since it is not needed when linking with CC.
- If required when linking with LD it should be done
- on a case by case basis in tcl.m4.
-
-2001-11-05 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/dialog2.tcl: Typo-fix.
- * library/demos/browse, library/demos/ixset, library/demos/rolodex:
- Installation does version number fixup, so we shouldn't. Thanks
- to wohnivec@iol.cz for pointing these (thankfully minor) problems
- out.
-
-2001-10-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/widget: Integrated labelframe item into the labels
- section and added a spinbox demo to the (retitled) entry section.
-
- * library/demos/labelframe.tcl: Adjusted so as to show off the
- labelframe widget to better effect and have a better description.
-
- * library/demos/spin.tcl: New demo to show off spinbox capabilities.
-
- * library/demos/rolodex: Changes up-ported from core-8-3-1-branch
- to make the script use more 8.*-isms, but not menus due to the way
- the context help system works.
-
- * library/demos/ixset: Changed to use the labelframe widget and
- the grid geometry manager.
-
-2001-10-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/browse: Changes up-ported from core-8-3-1-branch
- to make the script much more robust, particularly when neither the
- current version of wish or the script are on the path.
-
- * library/demos/hello: Added emacs trailing tag-line.
-
- * library/demos/tcolor: Changes up-ported from core-8-3-1-branch
- to make the script compliant with current good practise, as well
- as extensive use of the new labelframe widget.
-
- * library/demos/timer: Changes up-ported from core-8-3-1-branch to
- make the script look and work better.
-
- * library/demos/rmt: Changes up-ported from core-8-3-1-branch to
- use more 8.* features and make the demo script more generally
- useful to people.
-
-2001-10-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkCursor.c (Tk_GetCursorFromData): Fixed uninit nextPtr
- field. [adapted from Patch 473875]
- (GetCursor): Removed double-assignment to nextPtr field.
-
-2001-10-19 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/console.tcl: removed transpose ability until the console
- can get a proper rewrite of tag handling.
-
-2001-10-18 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/defs.tcl: removed threaded build warning under X.
-
- * library/console.tcl (ConsoleOutput): fixed undefined widget
- argument.
-
-2001-10-16 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/xmfbox.tcl: fixed filtering in motif file dialog.
- [Patch #469670] (nelson)
-
- * generic/tkWindow.c (OpenIM): Added simple XIM patch to enable
- basic XIM input on Unix. [Patch #412727] (fabian)
-
-2001-10-15 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure:
- * unix/configure.in:
- * win/configure:
- * win/configure.in:
- * win/tkConfig.sh.in: reworked to be a little cleaner in
- comparison to each other, and to AC_SUBST even empty vars for
- win/tkConfig.sh
-
-2001-10-12 Todd M. Helfter <tmh@purdue.edu>
-
- * ChangeLog:
- * doc/menu.n:
- * generic/tkMenu.c:
- * generic/tkMenu.h:
- * generic/tkMenubutton.c:
- * generic/tkMenubutton.h:
- * mac/tkMacDefault.h:
- * mac/tkMacMenu.c:
- * mac/tkMacMenubutton.c:
- * tests/menu.test:
- * unix/tkUnixDefault.h:
- * unix/tkUnixMenu.c:
- * win/makefile.vc:
- * win/tkWinDefault.h:
- * win/tkWinMenu.c:
- * win/tkWinWm.c: Implementation of TIP #63, the addition of
- a -compound option to menu entries allowing text and an image to
- be displayed at the same time.
-
-2001-10-09 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/console.tcl: added more smarts extracted from tkcon to
- the default console.
-
-2001-10-01 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinTest.c: better error reporting from testclipboard
-
- * win/tkWinDialog.c: minor cast changes to support Win64
-
- * win/tkWinWindow.c: made use of standard Tk_GetHWND instead of
- older, private TkWinGetHWND.
-
- * win/configure: regen'ed
- * win/tcl.m4:
- * win/makefile.vc: updated for Win64 SDK RC1 compilation support
-
-2001-09-30 Peter Spjuth <peter.spjuth@space.se>
-
- * doc/grid.n:
- * generic/tkGrid.c:
- * tests/grid.test: Added -uniform option to grid's row/column-
- configure. [TIP 37] [Patch 459343]
-
-2001-09-26 Peter Spjuth <peter.spjuth@space.se>
-
- * win/tkWinFont.c (Tk_DrawChars): Added support for clipping text.
-
- * doc/frame.n:
- * doc/labelframe.n:
- * doc/toplevel.n:
- * generic/tkFrame.c:
- * generic/tkInt.h:
- * generic/tkWindow.c:
- * library/demos/radio.tcl:
- * library/demos/labelframe.tcl:
- * library/demos/widget:
- * mac/tkMacDefault.h:
- * tests/frame.test:
- * unix/tkUnixDefault.h:
- * win/tkWinDefault.h: Added labelframe widget. Added -padx/y
- options to frame and toplevel.
-
- * tests/grid.test:
- * tests/pack.test:
- * tests/place.test: Used labelframe to test geometry manager changes.
- [TIP 18] [Patch 429164]
-
-2001-09-26 Peter Spjuth <peter.spjuth@space.se>
-
- * doc/GeomReq.3:
- * doc/WindowId.3:
- * generic/tk.decls:
- * generic/tk.h:
- * generic/tkDecls.h:
- * generic/tkGeometry.c:
- * generic/tkGrid.c (ArrangeGrid):
- * generic/tkInt.h:
- * generic/tkPack.c (ArrangePacking):
- * generic/tkPlace.c (RecomputePlacement):
- * generic/tkStubInit.c:
- * generic/tkUtil.c (TkComputeAnchor):
- * generic/tkWindow.c (TkAllocWindow):
- * unix/mkLinks: Geometry manager changes to support TIP#18.
- Allows a widget to set different internal border widths on
- different sides, and to set a minimum requested size.
- POTENTIAL INCOMPATIBILITY. [Patch 429164]
-
-2001-09-25 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkBind.c:
- * generic/tkInt.decls (TkpScanWindowId):
- * unix/tkUnixPort.h (Tkp{Print,Scan}WindowId):
- * unix/tkUnixXId.c (TkpScanWindowId):
- * win/tkWinWindow.c (TkpScanWindowId): Corrected definition of
- TkpScanWindowId to handle situation where types Window and int
- do not have the same number of bits. CONST-ified too.
-
- * generic/tkIntPlatDecls.h:
- * generic/tkStubInit.c: make genstubs
-
-2001-09-24 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkMain.c (StdinProc): Update to handle change in
- return type of Tcl_DStringAppend() from (char *) to (CONST char *).
- [TIP 27]
-
-2001-09-23 Peter Spjuth <peter.spjuth@space.se>
- * generic/tkPack.c (ConfigureSlaves):
- * tests/pack.test:
- * tests/grid.test: Pack accepted asymmetric values for -ipadx/y.
- Only -padx/y supports asymmetry. [Bug #462348]
-
-2001-09-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinWindow.c (TkpPrintWindowId, TkpScanWindowId): fixed to
- work on Win64 with 64bit XIDs.
-
- * generic/tkWindow.c (Tk_CreateAnonymousWindow):
- * generic/tkEntry.c (GetSpinboxElement): fixed unreachable returns.
-
- * win/tkWinX.c (TkGetServerInfo): added recognition of Win64.
-
- * xlib/X11/X.h: made XID __int64 type for Win64.
-
- * unix/tkUnixPort.h:
- * mac/tkMacPort.h: add (int*) cast to TkpScanWindowId.
- These may need to be changed to Window* (ulong).
-
- * generic/tkCmds.c (Tk_WinfoObjCmd):
- * generic/tkBind.c (NameToWindow):
- correct Window id's to be of type Window
-
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkInt.decls (TkpScanWindowId): changed decl to use
- Window* instead of int*.
-
- * xlib/xcolors.c:
- * generic/tkPack.c,tkWindow.c:
- * win/tkWinFont.c,tkWinMenu.c:
- * unix/tkUnixScale.c: minor cast fixes to prevent 64bit warnings.
-
- * tests/scrollbar.test (scrollbar-6.27): marked knownBug because
- it is skewed by bad dimensions returned by Windows.
-
- * tests/textDisp.test (textDisp-4.12): corrected test to work
- properly on Windows.
-
- * tests/id.test,macFont.test,macMenu.test,macscrollbar.test:
- * tests/send.test,winClipboard.test,winDialog.test,winFont.test:
- improved use of test constraints
-
- * win/tkWinWm.c (WinSetIcon): fixed SetClassLong for 64bit support.
-
-2001-09-20 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure: regen'ed
- * unix/tcl.m4: added --enable-64bit support for HP-11 with the
- 64-bit kernel.
-
-2001-09-17 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkGrid.c (ConfigureSlaves):
- * generic/tkPack.c (PackAfter): Corrected type definition of
- argument passed to Tcl_GetStringFromObj() from size_t to int.
- Incorrect type broke [pack] and [grid] on systems where
- sizeof(size_t) != sizeof(int). [Bugs 462375, 462342, 462338]
-
-2001-09-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/choosedir.tcl (DblClick):
- * library/tkfbox.tcl (OkCmd, ListInvoke): Rewrote so as to avoid
- the highly confusing string "text" and to be consistent about what
- is and what is not a list. [Bug 459895, reported by fandom]
-
-2001-09-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
-
- * generic/tkImgGIF.c:
- * generic/tkImgPPM.c:
- * generic/tkImgPhoto.c:
- * generic/tkMenu.c: Applied patch [461578], provided by Vincent
- Darley. This fixes several memory leaks in the image code. They
- happen if there are errors during the initialization of the
- channel the image is supposed to be read from.
-
-2001-09-12 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure:
- * unix/tcl.m4: Update from Tcl.
-
-2001-09-12 D. Richard Hipp <drh@hwaci.com>
-
- * library/tkfbox.tcl: fixed error that appeared when you would
- click on the canvas while viewing an empty directory.
-
-2001-09-10 Mo DeJong <mdejong@users.sourceforge.net>
-
- * unix/configure:
- * unix/tcl.m4: Update from Tcl.
-
-2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/Makefile.in: Fix Windows Makefile so that
- tcltest will automatically be compiled if the
- user tries to build tktest.
-
-2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
-
- * win/Makefile.in: Use TKTEST variable directly
- instead of depending on the tktest alias.
-
-2001-09-08 Mo DeJong <mdejong@users.sourceforge.net>
+ * tests/text.test: fix to elide searching problems [Bug 1174269] and
+ disappearing cursor with insertofftime 0. [Bug 1169429]
- * win/mkd.bat:
- * win/rmd.bat:
- Apply binary property (cvs admin -kb) to files and convert
- to CRLF linefeed format to fix the VC++ build. [Tcl Bug #219409]
+2005-04-03 Peter Spjuth <peter.spjuth@space.se>
-2001-08-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/menu.test:
- * tests/send.test:
- * tests/select.test: corrected to use testConfig constraints in
- the TK_ALT_DISPLAY case
-
- * tests/unixSend.test: removed test file completely identical to
- send.test. Removed platform specific named file in case somebody
- gets send working on Win/Mac in the future.
-
- * tests/config.test: added config-14.1 to test namespace import
- evaluation of widgets.
- * generic/tkButton.c (ButtonCreate):
- * generic/tkFrame.c (CreateFrame):
- * generic/tkMenubutton.c (Tk_MenubuttonObjCmd):
- * generic/tkPlace.c (Tk_PlaceObjCmd):
- * generic/tkScale.c (Tk_ScaleObjCmd):
- * generic/tkMessage.c (Tk_MessageObjCmd):
- * generic/tkEntry.c (Tk_EntryObjCmd, Tk_SpinboxObjCmd):
- * generic/tkSquare.c (SquareObjCmd): redid the handling of
- optionTables in widgets to allow them to be imported into other
- namespaces. [Bug #456632]
-
-2001-08-28 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinDialog.c (ChooseDirectoryHookProc): work-around for MS
- bug that caused crashing in tk_chooseDirectory on Win95.
- [Bug #224936] (baker)
-
- * unix/tkUnixWm.c (TkWmRestackToplevel): reworked how
- ConfigureNotify requests were handled in relation to the parent to
- avoid the problem with potential 'raise' delays on some wms.
- [Bug #220260] (baker) wms that were affected should notice the
- difference in tests unixWm-51.* not failing that failed before.
-
-2001-08-26 Don Porter <dgp@users.sourceforge.net>
-
- * library/text.tcl (<Shift-Up> binding): Corrected TIP 44 typo
- that broke binding. Thanks to "Michal" for the fix.
- [Bug 455468]
-
-2001-08-23 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/configure:
- * unix/tcl.m4: added QNX-6 build support. [Bug #219410] (loverso)
-
- * doc/CrtPhImgFmt.3: removed bogus note about including tkPhoto.h
-
-2001-08-22 Peter Spjuth <peter.spjuth@space.se>
-
- * generics/tkGrid.c (ConfigureSlaves):
- * tests/grid.test: Fixed a bug where adjacent 'x' and '^' where
- not handled properly. [Bug #452040]
-
-2001-08-22 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkPack.c (TkParsePadAmount): added lint init for sepChar.
-
- * tests/dialog.test (HitReturn): fixed failing dialog-2.1 test
- because it wasn't always getting focus properly.
-
-2001-08-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/unixFont.test (unixFont-2.[234]): fixed to be more
- sensitive on systems that have more installed fonts.
-
- * library/dialog.tcl (tk_dialog): changed dialog to show bar on
- Windows as well and added some y padding between the buttons and
- the bar. [Patch #442835] (harrismh)
-
-2001-08-20 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkInt.h:
- * generic/tkWindow.c:
- * generic/tkGrid.c:
- * generic/tkPack.c:
- * tests/grid.test:
- * tests/oldpack.test:
- * tests/pack.test: Objectified grid and pack commands.
-
-2001-08-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkObj.c (TkGetWindowFromObj): Rewrote window code to
- reuse a previously worked-out set of window information exactly
- when the reference window is the same and no window deletions have
- occurred since the object was allocated (display has same epoch
- counter.) Required changing the internal rep of the window quite
- a bit as now need to save three words-worth of information in the
- internal rep (this window, reference window, display epoch.)
- * generic/tkObj.c (SetWindowFromAny, DupWindowInternalRep,
- FreeWindowInternalRep): Code to support new internal rep for
- window objects.
- * generic/tkInt.h: Added epoch counter to TkDisplay structure
- * generic/tkWindow.c (GetScreen, Tk_DestroyWindow): Epoch counter
- is incremented every time a window is deleted.
-
-2001-08-18 Peter Spjuth <peter.spjuth@space.se>
-
- * doc/grid.n:
* tests/grid.test:
- * generic/tkGrid.c: Grid configure rejected initial "x" and "^".
- [Bug #418664]
-
-2001-08-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkObj.c (TkGetWindowFromObj): Was failing to reuse
- cached window objects, forcing a call to Tcl_GetStringFromObj and
- Tk_NameToWindow every time. This fault has been in there for
- nearly three years...
-
-2001-08-15 Don Porter <dgp@users.sourceforge.net>
-
- * changes: Labelled the TIP 44 changes as "POTENTIAL INCOMPATIBILITY".
- Although technically internal changes are not incompatible, they'll
- be perceived as such by those who get bitten, and this will help
- them find the cause of their trouble.
-
-2001-08-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tk{Util,Font,Cursor,Color,Bitmap,3d}.c: Modified
- objtype declarations so that they can be picked up in tkObj.c and
- the names are now prefixed with "tk" too.
- * generic/tkObj.c (TkRegisterObjTypes):
- * generic/tkWindow.c (Initialize):
- * generic/tkInt.h: Added code to register Tk's object types with
- the Tcl runtime. [Tcl Bug 450545]
-
-2001-08-12 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
-
-2001-08-10 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/image2.tcl (loadDir): Converted non-portable
- [glob [file join $dirName *]] to [glob -directory $dirName *]
- which is both fully portable and more reliable when directory
- names contain glob-significant characters. [Bug 223313]
-
-2001-08-08 Don Porter <dgp@users.sourceforge.net>
-
- * tests/dialog.test: New file testing [tk_dialog].
-
- * library/dialog.tcl:
- * library/tkfbox.tcl: Corrections to problems introduced by
- the TIP 44 changes. [Bug 449261]
-
- * README:
- * generic/tk.h:
- * unix/configure:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure:
- * win/configure.in: Bumped up patchlevel to 8.4a4 to distinguish
- CVS snapshots from the 8.4a3 release. This does not necessarily
- mean there will be an 8.4a4 release. [Bug 448938].
-
-2001-08-07 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/Makefile.in (dist): added {unix,win}/tcl.m4 and
- library/msgs/*.msg to dist target. [Bug: #448802]
-
-2001-08-06 Jeff Hobbs <jeffh@ActiveState.com>
-
- 8.4a3 RELEASE
-
- * changes:
- * README: updated for 8.4a3 release
-
- * unix/configure: regenerated
- * unix/tcl.m4: added GNU (HURD) configuration target. (brinkmann)
- [Patch: #442974]
-
-2001-08-06 Don Porter <dgp@users.sourceforge.net>
-
- * generic/tkConsole.c:
- * generic/tkWindow.c:
- * library/bgerror.tcl:
- * library/dialog.tcl:
- * library/msgbox.tcl:
- * library/unsupported.tcl:
- * mac/tclets.tcl:
- * mac/tkMacHLEvents.c:
- * mac/tkMacWm.c: TIP 44 changes specific to the Mac and
- Windows platforms that were overlooked before: tkOpenDocument,
- tkConsoleExit, tkConsoleOutput, unsupported1 out of namespace :: .
- Thanks to Vince Darley for prompting another look.
-
-2001-08-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/winMain.c (WishPanic): fixed CONST changes to go with
- CONST-ification in Tcl.
-
- * win/configure: regenerated
- * win/tcl.m4: fixed DLLSUFFIX definition to always be ${DBGX}.dll.
- This is necessary for TEA compliant builds that build shared
- against a static-built Tk.
- * win/Makefile.in ($(WISH)): added $(TK_STUB_LIB_FILE) to build
- target, otherwise it wouldn't get generated in a static build.
-
-2001-08-01 Don Porter <dgp@users.sourceforge.net>
-
- * doc/console.n:
- * doc/menu.n:
- * doc/text.n:
- * doc/tkvars.n:
- * generic/tkBind.c:
- * generic/tkMenu.c:
- * library/bgerror.tcl:
- * library/button.tcl:
- * library/choosedir.tcl:
- * library/clrpick.tcl:
- * library/comdlg.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/entry.tcl:
- * library/focus.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
- * library/msgbox.tcl:
- * library/optMenu.tcl:
- * library/palette.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/spinbox.tcl:
- * library/tclIndex:
- * library/tearoff.tcl:
- * library/text.tcl:
- * library/tk.tcl:
- * library/tkfbox.tcl:
- * library/unsupported.tcl:
- * library/xmfbox.tcl:
- * mac/tkMacMenu.c:
- * tests/clrpick.test:
- * tests/filebox.test:
- * tests/macMenu.test:
- * tests/menu.test:
- * tests/menuDraw.test:
- * tests/msgbox.test:
- * tests/text.test:
- * tests/unixMenu.test:
- * tests/winMenu.test:
- * tests/xmfbox.test:
- * unix/mkLinks:
- * unix/tkUnixDialog.c: Merged changes from feature branch
- dgp-privates-into-namespace, implementing TIP 44. All
- Tk commands and variables matching tk[A-Z]* are now in the
- ::tk namespace. See "BRANCH: dgp-privates-into-namespace"
- entries below for details. [FR 220936]
-
-2001-07-24 Mo DeJong <mdejong@redhat.com>
-
- * generic/default.h: Include tkWinDefault.h
- when built with Cygwin or Mingw.
-
-2001-07-18 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * doc/console.n: Updated names of private console commands.
-
-2001-07-16 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * library/console.tcl:
- * library/unsupported.tcl: Renamed tk::histNum to tk::HistNum
- as directed by the Tcl Style Guide.
-
-2001-07-10 Mo DeJong <mdejong@redhat.com>
-
- * unix/Makefile.in: Add AR and STLIB_LD variables.
- * unix/configure:
- * unix/configure.in: Use STLIB_LD when defining MAKE_LIB
- and MAKE_STUB_LIB. Subst STLIB_LD, RANLIB, and AR.
- * unix/tcl.m4: Update from Tcl.
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2001-07-06 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2001-07-05 Mo DeJong <mdejong@redhat.com>
-
- * win/Makefile.in: Subst DEPARG directly instead
- of relying on a variable. This will make Cygwin
- build faster since an extra exec will be avoided.
- * win/configure: Regen.
- * win/configure.in: Subst DEPARG.
- * win/tcl.m4: Update from Tcl.
-
-2001-07-04 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README:
- * mac/README:
- * unix/README:
- * win/README: updated READMEs with purls
-
-2001-07-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/canvas.test:
- * generic/tkCanvPoly.c (PolygonToArea): Added patch that respects
- the polygon difference of including points in the polygon even
- when fill is empty. [Bug #226357]
-
-2001-07-03 Mo DeJong <mdejong@redhat.com>
-
- * win/Makefile.in: Remove PATHTYPE variable.
- * win/configure: Regen.
- * win/configure.in: Don't subst PATHTYPE.
- * win/tcl.m4: Update from Tcl.
-
-2001-07-03 Mo DeJong <mdejong@redhat.com>
-
- * win/Makefile.in: Don't use VPSEP, instead just use :
- in the VPATH.
- * win/configure: Regen.
- * win/configure.in: Don't subst VPSEP.
-
-2001-07-03 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/xmfbox.tcl (tkMotifFDialog_ActivateSEnt): Added missing
- backslash [Bug #438247]
-
-2001-07-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * generic/tkWindow.c (Tk_DestroyWindow): changed to use
- Tcl_EventuallyFree instead of ckfree so that widgets that have
- references to a tkwin can use them.
-
- * generic/tkCanvArc.c:
- * generic/tkCanvBmap.c:
- * generic/tkCanvLine.c:
- * generic/tkCanvPoly.c:
- * generic/tkCanvText.c:
- * generic/tkCanvWind.c:
- * generic/tkRectOval.c: corrected argument handling in
- Create<Item> functions that could lead to ABRs or FMRs and
- corrected names of argc/argv to objc/objv.
-
- * generic/tkImgGIF.c (Mgetc): corrected screwy use of ternary
- operator and possible FMR.
-
- * generic/tkEntry.c: corrected missing Tcl_Release that caused
- font not freed complaints when trying valid cleanup calls.
- * generic/tkListbox.c: made use of Tcl_Preserve/Tcl_Release to
- prevent FMR errors in Display functions.
-
- * unix/tkUnixScale.c (TkpDisplayScale): corrected FMR when scale
- was deleted while calling its command.
-
- * library/console.tcl:
- * library/entry.tcl:
- * library/spinbox.tcl:
- * library/text.tcl:
- * library/tk.tcl: added private ::tk::GetSelection command to
- handle requesting selection. This is to support requesting
- UTF8_STRING before generic STRING on Unix. Changed Text, Spinbox,
- Entry and Console to use this command.
-
- * tests/select.test:
- * generic/tkSelect.c (Tk_CreateSelHandler, Tk_DeleteSelHandler):
- on Unix, a UTF8_STRING handler will be created when the user
- requests a STRING handler (in addition to the STRING handler).
- This provides implicit support for the new UTF8_STRING selection
- target.
- * unix/tkUnixSelect.c (TkSelEventProc, ConvertSelection): Added
- support for UTF8_STRING target. [RFE #418653, Patch #433283]
-
- * generic/tkInt.h: added utf8Atom to TkDisplay structure.
-
- * tests/listbox.test: changed 'darkblue' to 'white' in a test
- because it isn't a portable color name.
-
- * generic/tkEntry.c (DestroyEntry): used Tcl_EventuallyFree
- instead of ckfree for entryPtr to prevent FMRs. [Bug #413904]
-
-2001-06-26 Mo DeJong <mdejong@redhat.com>
-
- * unix/Makefile.in:
- * win/Makefile.in: Add `make shell` target. This target
- will set the proper env vars before invoking wish
- from the build directory.
-
-2001-06-26 Mo DeJong <mdejong@redhat.com>
-
- * win/configure:
- * win/configure.in: Revert cross compiling change
- accidently added during last checkin.
-
-2001-06-26 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure: Regen.
- * unix/configure.in: Fix last checkin by removing
- export since that only works in bash.
- * win/configure: Regen.
- * win/configure.in: Ditto.
-
-2001-06-26 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure: Regen.
- * unix/configure.in: Set CFLAGS to "" if the user
- did not set CFLAGS in the env. This keeps AC_PROG_CC
- from adding "-g -O2" to the CFLAGS by default.
- * win/configure: Regen.
- * win/configure.in: Ditto.
+ * 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]
-2001-06-22 Mo DeJong <mdejong@redhat.com>
+2005-03-29 Jeff Hobbs <jeffh@ActiveState.com>
- * win/configure: Regen.
- * win/configure.in: Use RC_DEFINE flag from tcl.m4.
- * win/tcl.m4: Update from Tcl.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/tcl.m4 (SC_CONFIG_CFLAGS): Link to the
- imm32 library when building with mingw gcc.
- * win/tkWinX.c: Include the imm.h header
- to fix compiling with mingw gcc.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/configure.in: Add resource compiler fix from
- 8.3.3 to fix compiling with mingw.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/tcl.m4: Fix silly typo in last checkin.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
-
- * unix/Makefile.in: Set CFLAGS to @CFLAGS@ and @CFLAGS_DEFAULT@.
- Set LDFLAGS to @LDFLAGS@ and @LDFLAGS_DEFAULT@. Add LDFLAGS_DEBUG
- and LDFLAGS_OPTIMIZE to match the way CFLAGS_DEFAULT works. Use
- new LDFLAGS variable in the Makefile instead of @LDFLAGS@.
- * unix/configure: Regen.
- * unix/configure.in: Don't set CFLAGS to CFLAGS_DEFAULT, instead
- subst CFLAGS_DEFAULT into the Makefile. Add AC_SUBST for CFLAGS_DEBUG,
- CFLAGS_OPTIMIZE, LDFLAGS_DEFAULT, LDFLAGS_DEBUG, and LDFLAGS_OPTIMIZE.
- Remove unused LD_FLAGS subst.
- * unix/tcl.m4: Update from Tcl.
- * win/Makefile.in: Set CFLAGS to @CFLAGS@ and @CFLAGS_DEFAULT@.
- Set LDFLAGS to @LDFLAGS@ and @LDFLAGS_DEFAULT@.
- * win/configure: Regen.
- * win/configure.in: Don't set CFLAGS or LDFLAGS, instead subst
- CFLAGS_DEFAULT and LDFLAGS_DEFAULT into the Makefile.
- * win/tcl.m4: Update from Tcl.
-
-2001-06-22 Mo DeJong <mdejong@redhat.com>
+ * win/tcl.m4, win/configure: do not require cygpath in macros to allow
+ msys alone as an alternative.
- * win/configure:
- * win/tcl.m4: Update From Tcl.
-
-2001-06-21 eric melski <ericm@interwoven.com>
-
- * doc/colors.n: Corrected bogus documentation with respect to
- several shades of blue, all of which were listed as RGB 0 0 0.
- [Bug #432104].
-
-2001-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * library/demos/floor.tcl, library/demos/filebox.tcl,
- * library/demos/clrpick.tcl, library/demos/vscale.tcl,
- * library/demos/twind.tcl, library/demos/ruler.tcl,
- * library/demos/plot.tcl, library/demos/items.tcl,
- * library/demos/hscale.tcl, library/demos/ctext.tcl,
- * library/demos/cscroll.tcl, library/demos/arrow.tcl,
- * library/xmfbox.tcl, library/msgbox.tcl,
- * library/clrpick.tcl, library/bgerror.tcl: Braced expressions.
-
-2001-06-06 Mo DeJong <mdejong@redhat.com>
-
- * win/configure: Regen.
- * win/configure.in: Handle the --prefix option correctly
- it should default to /usr/local like the unix version.
-
-2001-06-03 Jeff Hobbs <jeffh@ActiveState.com>
+2005-03-27 Vince Darley <vincentdarley@users.sourceforge.net>
- * doc/selection.n:
- * doc/clipboard.n: added SEE ALSOs to cross-reference selection
- and clipboard, with extra note for clipboard command in selection
- docs. [Patch #422256]
-
- * unix/tkUnixFont.c: Corrected support for iso10646 (X11 Unicode)
- fonts on Unix. This adds a ucs-2be (UCS-2 Big Endian) encoding in
- Tk on Unix that is used for those fonts (X11 requires
- big-endianness). (welch) [Patch #406411; Bug #220890 #220899]
- This differs from the 8.3.3 patch by not adding ucs-2be in the
- preferred encodingList (seems works fine without).
- Added alias for jisx0201* fonts to jis0201 encoding. [Bug #414033]
-
-2001-05-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinKey.c (TkpSetKeycodeAndState): removed old debug info
-
-2001-05-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinX.c: moved the initialization of tkPlatformId from
- TkWinXInit to TkWinGetPlatformId because static builds could call
- it before it was initialized. [Bug #427278]
-
-2001-05-28 Peter Spjuth <peter.spjuth@space.se>
-
- * generic/tkFrame.c:
- * generic/tkWindow.c:
- * tests/frame.test: Upgraded frame to use the newer TK_OPTION
- style when processing configuration options. Some cleanup of
- bad comments and bad code. [part of patch #420861]
+ * tests/textDisp.test: added test for fix of 2005-03-15.
-2001-05-23 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure:
- * unix/tcl.m4:
- * win/configure:
- * win/tcl.m4: Sync from Tcl sources.
-
-2001-05-21 Jeff Hobbs <jeffh@ActiveState.com>
-
- * unix/tcl.m4: sync'ed up wih Tcl tcl.m4. [Bug #419812]
-
- * doc/TkInitStubs.3:
- * generic/tk.h:
- * generic/tkStubLib.c: CONST'ified Tk_InitStubs to match CONST
- changes to Tcl_PkgRequireEx.
-
-2001-05-21 Todd M. Helfter <tmh@purdue.edu>
-
- * doc/menubutton.n:
- * generic/tkMenubutton.c:
- * generic/tkMenubutton.h:
- * mac/tkMacMenubutton.c:
- * tests/menubut.test:
- * unix/tkUnixMenubu.c: Implementation of TIP #11, the addition of
- a -compound option to the menubutton allowing text and an image to
- be displayed at the same time. This behavior is identical to the
- behavior of the button widget.
-
-2001-05-16 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/console.n: Added - was erroneously placed in Tcl before...
-
-2001-04-25 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure: Regen.
- * unix/tcl.m4: Update from Tcl.
- * win/configure: Regen.
- * win/tcl.m4: Update from Tcl.
-
-2001-04-25 Mo DeJong <mdejong@redhat.com>
-
- * unix/configure: Regen.
- * unix/configure.in: Use $@ in MAKE_LIB and MAKE_STUB_LIB
- commands instead of using a delayed subst variable. Replace
- instances of STUB_LIB_FILE with TK_STUB_LIB_FILE.
-
-2001-04-25 Mo DeJong <mdejong@redhat.com>
-
- * unix/Makefile.in: Use TCL_STUB_LIB_FILE instead of STUB_LIB_FILE.
- * unix/configure: Regen.
- * unix/configure.in: Don't subst STUB_LIB_FILE, use TCL_STUB_LIB_FILE
- instead.
-
-2001-04-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * generic/tkImage.c (Tk_ImageObjCmd,DeleteImage): Better detection
- of deletion when world is falling apart. [Bug #220819]
-
-2001-04-04 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/tkWinMenu.c (TkWinHandleMenuEvent): corrected reseting of
- service mode to only occur when it was set. [Bug #220948]
-
-2001-04-03 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/winClipboard.test: improved results for understanding when
- tests fail.
-
- * tests/winDialog.test: string totitle'd some results that
- expected [pwd] to return a capital drive letter.
-
- * tests/cursor.test: changed tests to use 'heart' cursor because
- 'arrow' on windows has a pre-skewed use count.
-
- * win/tkWinDialog.c (GetFileNameA): initialize multi to 0.
-
-2001-04-02 Jeff Hobbs <jeffh@ActiveState.com>
-
- * win/configure:
- * win/tcl.m4 (SHLIB_LD): added -incremental:no. [Bug #219381]
+2005-03-24 Jim Ingham <jingham@apple.com>
- * generic/tkMenu.c (TkInvokeMenu): checked for menu deletion
- before calling associated menu entry command. [Bug #220821]
+ * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): Dopey bug - do
+ not reset the width for entry widgets - we didn't change it for them.
- * doc/image.n: added warning about names chosen for images.
-
- * generic/tkImgPhoto.c (ImgPhotoCmd): corrected the src and dest
- values for $imageName put when -format and -to are used.
- [Bug #232741]
-
- * tests/listbox.test: added test listbox-27.1, delete during
- scrollbar update
- * generic/tkListbox.c (DestroyListbox, ListboxEventProc):
- corrected listbox to make proper use of Tcl_EventuallyFree and
- protect against unusual listbox deletion.
-
- * tests/entry.test: added tests entry-20.*, delete during widget
- activity
- * generic/tkEntry.c (DestroyEntry, EntryEventProc): fixed the
- entry widget to survive deletion while processing scrollbar
- updates and validation.
-
- * tests/canvas.test: test of canvas delete during event
- * generic/tkCanvas.c (DestroyCanvas, CanvasEventProc): fixed the
- canvas to survive deletion during event processing. [Bug #228024]
-
-2001-04-01 Jeff Hobbs <jeffh@ActiveState.com>
-
- * README:
- * mac/README: updated patchlevel to 8.4a3 and corrected links and
- notes.
-
- * generic/tk.h:
- * unix/configure.in (TK_PATCH_LEVEL):
- * unix/configure:
- * unix/tk.spec:
- * win/configure.in (TK_PATCH_LEVEL):
- * win/configure: updated patchlevel to 8.4a3
-
-2001-03-30 Jeff Hobbs <jeffh@ActiveState.com>
-
- * tests/safe.test: added note about correcting failures in
- safe.test.
- * library/tk.tcl: moved package require msgcat inside if case to
- not be used in safe interps.
-
- * win/makefile.vc:
- * win/configure:
- * win/tcl.m4: added imm32.lib to LIBS_GUI for Tk IME support.
- * win/tkWinInt.h:
- * win/tkWinKey.c:
- * win/tkWinX.c: added support for changing IME on the fly in
- Windows (2000). (lam) [Patch #402993]
-
- * tests/bind.test (bind-22.18):
- * generic/tkBind.c (NameToWindow): handled the error case where a
- valid-looking but invalid identifier could be passed in certain
- event generate options causing a crash. [Bug #411307]
-
- * win/tkWinWm.c (UpdateWrapper): ensured that the passed in winPtr
- had an existent window to operate on. [Bug #409172]
-
- * win/Makefile.in (install-*): improved install-* targets to use
- their base build dependency.
-
- * generic/tkImage.c (Tk_ImageObjCmd, EventuallyDeleteImage):
- added casts to allow compiling on Windows with debbuging.
-
-2001-03-29 Jeff Hobbs <jeffh@ActiveState.com>
-
- * library/msgs/de.msg: fixed translations. [Patch #403525]
-
- * doc/canvas.n: Noted ability to specify coords as a list in the
- docs. (techentin) [Patch #403660]
-
- * tests/canvas.test: added test case to check obj conversion
- * generic/tkObj.c (UpdateStringOfMM, SetMMFromAny): better
- obj-aware screen distances. (pgbaum, hobbs) [Patch #403327]
-
- * library/bgerror.tcl (bgerror): allow focus into details window
- for Windows C&P to work. [Bug #220929]
-
- * library/tk.tcl: put a catch around adding <hpBackTab> to the
- <<PrevWindow>> virtual event as it doesn't seem to work on all HP
- systems. [Bug #411669]
-
- * library/tkfbox.tcl: fixed selecting directories and single files
- with spaces using tk_getOpenFile -multiple 1. [Bug #411640]
-
- * win/tkWinDialog.c (GetFileNameA): added support for -multiple to
- ascii-based tk_getOpenFile (Win9*). (haneef) [Patch #403047]
- (GetFileNameW): increased number of files that could be returned
- by tk_getOpenFile -multiple. [Patch #412042]
-
-2001-03-29 Mo DeJong <mdejong@redhat.com>
-
- * library/entry.tcl (tkEntryMouseSelect):
- * library/text.tcl (tkTextSelectTo): When
- the mouse is dragged with the button down,
- move the insertion cursor to the current
- mouse position.
- * tests/event.test: Add a series of tests
- for event generation. Add tests for selection,
- check the position of the insertion cursor.
-
-2001-03-28 Jeff Hobbs <jeffh@gimlet.activestate.com>
-
- * unix/configure:
- * unix/tcl.m4: corrected IRIX-5.x config to not use -n32.
- (english) [Patch 403626]
-
-2001-03-28 Don Porter <dgp@users.sourceforge.net>
-
- * tests/focus.test (focus-6.1):
- * tests/macEmbed.test (unixEmbed-5.1):
- * tests/macMenu.test (macMenu-21.3):
- * tests/menu.test (menu-27.1):
- * tests/unixEmbed.test (unixEmbed-8.2):
- * tests/unixWm.test (unixWm-50.4): Replaced all [load {} tk]
- in Tk test suite with [load {} Tk]. [Bug 220940, Patch 411952]
-
-2001-03-12 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * doc/menu.n:
- * unix/mkLinks: Added documentation for [tk_menuSetFocus].
-
-2001-03-12 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * doc/text.n:
- * doc/tkvars.n:
- * unix/mkLinks: Added documentation for commands and variables
- matching tk_text*.
-
-2001-03-08 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * generic/tkTextDisp.c:
- * library/unsupported.tcl:
- * tests/textDisp.test: Restored the global variables tk_textRedraw
- and tk_textRelayout. Since they match tk_*, they should remain
- publicly available until at least Tk 9.
-
-2001-03-01 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace:
- * library/unsupported.tcl: New file for Tk's unsupported
- interfaces. Contains [tk::unsupported::ExposePrivateCommand]
- and [tk::unsupported::ExposePrivateVariable] that restore the
- availability of an old public name of one of Tk's private
- commands and variables, respectively, for those applications
- and extensions that depend on the old names against advice.
-
-2001-02-28 Don Porter <dgp@users.sourceforge.net>
-
- BRANCH dgp-privates-into-namespace: Feature branch to move all
- of Tk's private commands and variable into the ::tk namespace
- and its children.
-
- * doc/tkvars.n: Documented private variable tkPriv renamed tk::Priv.
-
- * generic/tkBind.c:
- * generic/tkMenu.c:
- * generic/tkTextDisp.c:
- * library/bgerror.tcl:
- * library/button.tcl:
- * library/choosedir.tcl:
- * library/clrpick.tcl:
- * library/comdlg.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/entry.tcl:
- * library/focus.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
- * library/msgbox.tcl:
- * library/optMenu.tcl:
- * library/palette.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/spinbox.tcl:
- * library/tclIndex:
- * library/tearoff.tcl:
- * library/text.tcl:
- * library/tk.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl:
- * mac/tkMacMenu.c:
- * tests/clrpick.test:
- * tests/filebox.test:
- * tests/macMenu.test:
- * tests/menu.test:
- * tests/menuDraw.test:
- * tests/msgbox.test:
- * tests/text.test:
- * tests/textDisp.test:
- * tests/unixMenu.test:
- * tests/winMenu.test:
- * tests/xmfbox.test:
- * unix/tkUnixDialog.c: All Tk commands matching ::tk[A-Z]* and
- all Tk private variables in the global namespace were renamed to
- live in the namespace ::tk or one of its children.
+2005-03-23 Jim Ingham <jingham@apple.com>
-2001-02-13 Eric Melski <ericm@interwoven.com>
+ These changes allow us to draw the Entry and Spinbox widget with a
+ native look and feel on Mac OS X.
- * doc/photo.n: [Bug 132213] Added clarification on interpretation
- of ranges for "photoName data -from" subcommand.
+ * 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.
-2001-02-12 D. Richard Hipp <drh@hwaci.com>
+ This is cleanup thanks to Neil Madden <nem@cs.nott.ac.uk>.
- TIP #21: Asymmetric padding in the pack and grid geometry managers.
- With this changes, you can now say "-padx {10 20}" to put 10 pixels
- of padding on the left and 20 on the right. Similar rules apply
- for vertical padding. See the revised documentation for details.
-
-2001-01-02 Andreas Kupries <a.kupries@westend.com>
-
- * Everything below belongs together and implements TIP #8
- (SF patch #102833).
-
- * win/tkWinWm.c (line 56f): Added icon structures.
- * win/tkWinWm.c (struct WmInfo, line 242): Added reference to
- optional icon for titlebar.
- * win/tkWinWm.c (struct ThreadSpecificData, line 335): Added
- reference to optional default icon for toplevel windows.
- * win/tkWinWm.c (line 387 ... 1169): All the new functions required
- to deal with icon specifications, 'InitWm' changed.
- * win/tkWinWm.c (TkWmNewWindow, UpdateWrapper, TkWmDeadWindow, Tk_WmCmd):
- Added initialization and handling of the new fields.
- * doc/wm.n: Documentation updated to explain the newly available
- functionality.
-
-2000-12-13 jeff hobbs <jhobbs@interwoven.com>
-
- * generic/tkObj.c (SetMMFromAny): Added ability to recognize
- double type object to speed up canvas coord calculations.
- [Patch 403327]
-
-2000-12-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/entry.n: Improved documentation of interplay between the
- -state and -textvariable options.
-
-2000-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * tests/image.test (image-1.10): Improved this test, which
- previously only worked if the command failed to delete the root
- window, and caused *major* trouble otherwise...
- * generic/tkImage.c (EventuallyDeleteImage): Created this function
- so that images that get deleted during the creation of an image
- won't cause a nasty core dump. Properly fixes bug #120819.
-
-2000-11-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/image.n:
- * generic/tkImage.c (Tk_ImageObjCmd): Backed out previous change.
- Bug #120819 is back again in force. Left the test in there
- though.
-
-2000-11-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/image.n:
- * tests/image.test (image-1.10):
- * generic/tkImage.c (Tk_ImageObjCmd): Prohibited image names that
- start with "." since they can cause some really obscure
- crashes. Fixes Bug #120819.
-
-2000-11-21 Eric Melski <ericm@ajubasolutions.com>
-
- Overall change: Implemented TIP 5, which exports
- TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs,
- adding a size field to Tk_ClassProcs to allow for future
- expansion, and renaming the geometryProc to worldChangedProc,
- which is more in keeping with the actual use of the callback.
-
- * unix/mkLinks: Added link for Tk_SetClassProcs.
-
- * doc/SetClassProcs.3: Documentation for
- Tk_ClassProcs/Tk_SetClassProcs.
-
- * generic/tkCanvas.c:
- * generic/tkEntry.c:
- * generic/tkFrame.c:
- * generic/tkListbox.c:
- * generic/tkMenu.c:
- * generic/tkMessage.c:
- * generic/tkScale.c:
- * generic/tkText.c: Updated to use Tk_ClassProcs/Tk_SetClassProcs
- instead of TkClassProcs/TkSetClassProcs.
-
- * generic/tkMenubutton.c:
- * generic/tkScrollbar.c:
- * generic/tkButton.c: Updated to use Tk_SetClassProcs instead of
- TkSetClassProcs.
-
- * generic/tkMenubutton.h:
- * generic/tkScrollbar.h:
- * generic/tkButton.h:
- * win/tkWinButton.c:
- * win/tkWinScrlbr.c:
- * mac/tkMacButton.c:
- * mac/tkMacMenubutton.c:
- * mac/tkMacScrlbr.c:
- * unix/tkUnixButton.c:
- * unix/tkUnixMenubu.c:
- * unix/tkUnixScrlbr.c: Updated to use Tk_ClassProcs instead of
- TkClassProcs.
-
- * generic/tkDecls.h:
- * generic/tkStubInit.c:
- * generic/tkIntDecls.h: Regenned from tk.decls, tkInt.decls.
-
- * generic/tk.h: Added declaration of Tk_ClassProcs, with size
- field. Added typedef's for Tk_ClassCreateProc,
- Tk_ClassWorldChangedProc, Tk_ClassModalProc. Added definition of
- Tk_GetClassProc macro, shorthand for extracting a member of the
- Tk_ClassProcs structure.
-
- * generic/tkInt.h: Removed declaration of TkClassProcs,
- TkClassGeometryProc, etc.
-
- * generic/tkBind.c (Tk_BindEvent): Updated to use Tk_GetClassProc
- macro to extract modalProc; added check that the modalProc is non-NULL.
-
- * generic/tkFont.c (RecomputeWidgets): Updated to use
- Tk_GetClassProc macro to extract worldChangedProc; added comment
- about the choice of a recursive versus iterative algorithm for
- propagating world changed messages.
-
- * generic/tkWindow.c (Tk_MakeWindowExist): Updated to use
- Tk_GetClassProc macro to extract createProc from Tk_ClassProcs.
-
- * generic/tk.decls: Added declaration for Tk_SetClassProcs.
-
- * generic/tkInt.decls: Commented out declaration for
- TkSetClassProcs, which is made public by this change. The entry
- is left in place, but commented, so that future developers will
- know not to reuse it's stub number.
-
-2000-11-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-
- * doc/ConfigWidg.3: Added deprecation note from Bug #120944 - use
- Tk_SetOption() instead.
-
- * generic/tkImgPhoto.c (TkPhotoGetValidRegion): Applied patch to
- create this function and add it to tkInt stubs. Should now be
- possible to write an extension that accesses the transparency data
- in a photo image. Bug #120930
-
-2000-11-03 Jeff Hobbs <hobbs@ajubasolutions.com>
-
- 8.4a2 RELEASE
-
- * generic/tkWindow.c (Initialize): added call to Tcl_SetMainLoop.
- This only has effect when tclsh is run (not wish), and then Tk is
- loaded in interactively.
-
-2000-11-02 Jeff Hobbs <hobbs@ajubasolutions.com>
-
- * win/tkWinButton.c:
- * win/tkWinDialog.c:
- * win/tkWinScrlbr.c:
- * win/tkWinWm.c: fixed up code for Win64 support. This mostly
- remains in _WIN64 #ifdef's, until updated compilers are standard.
-
- * win/tcl.m4:
- * win/makefile.vc: updated for Win64 compile support
-
- * unix/configure:
- * win/configure: checked in configure scripts so people doing
- CVS checkouts aren't required to have autoconf. Changes to
- configure.in in the future will require the corresponding
- configure script to also be re-autoconf'ed and checked in.
-
- * doc/event.n: added note that key events require window focus.
-
-2000-11-01 Jeff Hobbs <hobbs@ajubasolutions.com>
-
- * win/tkWinDialog.c (GetFileNameW, GetFileNameA,
- Tk_ChooseDirectoryObjCmd): created
- work-around for change in NT5.0/98 that caused no initialdir
- setting to open the browser up in the user's documents dir.
-
- * tests/color.test: marked color-2.6 nonPortable as we can't
- reliably assume what 'red' maps to.
-
-2000-11-01 Eric Melski <ericm@ajubasolutions.com>
-
- * tests/winDialog.test: Corrected expected results for bad option
- tests (5.2, 5.5) to include -multiple option.
-
- * win/tkWinDialog.c: Added branch for 0 return from
- CommDlgExtendedError() switches; this was formerly treated as an
- error, but it actually is not, since it just means the user hit
- cancel or closed the dialog. (GetFileNameW): Added better smarts
- such that -multiple is not considered a valid option for
- tk_getSaveFile.
- Removed CommDlgExtendedError() checks for color and choosedir
- dialogs, and removed all except the explicit invalid filename
- checks for the file dialogs.
-
-2000-10-30 David Gravereaux <davygrvy@ajubasolutions.com>
-
- * win/configure.in:
- * win/Makefile.in:
- * win/makefile.vc:
- * win/rc/tk.rc:
- * win/rc/tk_base.rc (new):
- * win/rc/wish.rc: Added logic to derive filenames better in the
- resource scripts based on compile options along with better
- support for building a static wish shell with cursor resources.
-
-2000-10-27 Jeff Hobbs <hobbs@ajubasolutions.com>
-
- * unix/tcl.m4: added support for AIX-5.
-
- * tests/tk.test:
- * doc/tk.n: updated to reflect default on status of useinputmethods.
- * library/tk.tcl: tk useinputmethods is set to 1 by default. This
- enables Kanji and dead-char input by default. Intro'd in
- 1999-12-16 with default off to avoid some problems with older X
- servers that would slow down widget creation over time.
-
- * win/Makefile.in (test, winhelp, tktest): corrected the
- TCL_LIBRARY path specification.
-
-2000-10-18 Eric Melski <ericm@ajubasolutions.com>
-
- * win/tkWinDraw.c (RenderObject): Applied patch from [Bug: 6368],
- which corrects rendering of 1-pixel wide stippled lines on Windows.
-
- * generic/tkCanvLine.c (DisplayLine): Applied patch from
- [Bug: 6368], corrects bugs relating to use of active- and
- disabledwidth values for displaying lines (disabledwidth was never
- used, and activewidth/disablewidths would only possibly be used
- when greater than default width, rather than when simply not equal
- to default width).
-
- * library/tkfbox.tcl (OkCmd): Applied patch from [Bug: 6365],
- which adds safety for directory names containing spaces or which
- are non-lists.
-
- * win/tkWinDialog.c (GetFileNameW, GetFileNameA,
- Tk_ChooseColorObjCmd, Tk_ChooseDirectoryObjCmd): Added error
- checking for the return value from the common dialog functions, so
- that the commands will not silently fail if the common dialog
- returns an error. [Bug: 6369].
-
-2000-10-10 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkConfig.c (Tk_InitOptions): Added
- Tcl_IncrRefCount/Tcl_DecrRefCount calls on valuePtr, to prevent
- memory leaks when the value object comes from the option
- database. [Bug: 6275].
-
-2000-10-06 Jeff Hobbs <hobbs@ajubasolutions.com>
-
- * win/Makefile.in (cat32.${OBJEXT}): add win/ subdirectory to
- cat32 target to correctly find the source file.
-
-2000-10-05 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkCmds.c (Tk_WinfoObjCmd): Added check for
- TK_ANONYMOUS_WINDOW flag in the [winfo children] subcommand; if
- set, the window will not be printed in the list of children.
-
- * doc/CrtWindow.3: Added entry for Tk_CreateAnonymousWindow.
-
- * generic/tkWindow.c
- (Tk_CreateAnonymousWindow): New API for creating anonymous
- windows. These windows are manipulable from C, but not from Tcl,
- because they have no pathname associated with them. They are used
- initially by widgets that do rubber-band resizing (panedwindow,
- multi-column listbox, etc.), and may be useful for other widgets
- as well (dropbox, combobox).
- (Tk_DestroyWindow): Added check for TK_ANONYMOUS_WINDOW flag when
- determining whether to generate a DestroyNotify event.
-
- * generic/tkStubInit.c:
- * generic/tkDecls.h: Regen'd from tk.decls.
-
- * generic/tk.decls: Added Tk_CreateAnonymousWindow declaration.
-
- * generic/tk.h: Added TK_ANONYMOUS_WINDOW flag for Tk_Window's.
-
-2000-10-04 Eric Melski <ericm@ajubasolutions.com>
-
- * doc/MaintGeom.3: Noted that Tk_MaintainGeometry handles direct
- descendants properly.
-
- * generic/tkGeometry.c (Tk_MaintainGeometry): Added a check for
- the case in which the slave window is a direct descendant of the
- master window. In this case, we need not set up the additional
- infrastructure normally provide by Tk_MaintainGeometry, because we
- can rely on the parent/child relationship to handle it for us
- implicitly. In this case, Tk_MaintainGeometry just calls directly
- to Tk_MoveResizeWindow. This allows geometry managers to simply
- always use Tk_MaintainGeometry to maintain geometry for slaves,
- and avoid doing the direct descendant check themselves.
- (Tk_UnmaintainGeometry): Added a matching check for the direct
- descendant case; in this case, Tk_UnmaintainGeometry simply
- returns immediately.
-
-2000-10-01 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkButton.c (ConfigureButton): Added tests for -compound
- option, so that when there is a textvariable and an image, and
- -compound is not none, the button will display both the
- textvariable and the image.
-
- * doc/SetOptions.3: Added note that restoreProc and freeProc may
- be NULL.
-
- * generic/tkConfig.c (Tk_RestoreSavedOptions): For custom options,
- added test that the restoreProc is not NULL, to allow for custom
- options that don't care about supporting Tk_RestoreSavedOptions.
-
-2000-09-29 D. Richard Hipp <drh@hwaci.com>
-
- * generic/tkBitmap.c: Changes to prevent a BadMatch error from the
- Xserver when the same bitmap is used on two or more screens of the
- same display.
-
- * tests/menu.test: Print a warning if the TK_ALT_DISPLAY environment
- variable is not configured so as to test for the bug fix above.
-
- * library/tk.tcl (::tk::SetGrabFocus): "Catch" the grab in case
- another application already holds the grab and the "grab" command
- fails.
-
-2000-09-29 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/Makefile.in: commented use of TESTFLAGS
- * unix/Makefile.in: added TESTFLAGS to test and testlang targets to
- conform with Windows makefile and TEA style.
-
-2000-09-29 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkTest.c: Fixed tests to use updated API.
-
- * doc/SetOptions.3:
- * generic/tk.h:
- * generic/tkConfig.c: Changed interface for Tk_CustomOptionSetProc
- and Tk_CustomOptionGetProc; these now take a pointer to the start
- of the widget record, and an integer offset to the slot for the
- option value, instead of just a pointer to the slot. This allows
- more sophisticated options to do interesting things based on other
- data in the widget record.
-
-2000-09-17 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tk.h: Added declaration of Tk_ObjCustomOption structure,
- used for TK_OPTION_CUSTOM, and typedef's of the functions
- Tk_CustomOptionSetProc, Tk_CustomOptionGetProc,
- Tk_CustomOptionRestoreProc, and Tk_CustomOptionFreeProc, used for
- TK_OPTION_CUSTOM.
-
- * doc/SetOptions.3: Added documentation of TK_OPTION_CUSTOM, and
- section "CUSTOM OPTION TYPES" explaining how to create and use
- custom options.
-
- * tests/config.test: Added tests for custom option type.
-
- * generic/tkTest.c: Added test support for TK_OPTION_CUSTOM to
- TestobjconfigObjCmd. Added CustomOption* functions to implement a
- test custom option.
-
- * generic/tkConfig.c: Added new option type TK_OPTION_CUSTOM,
- which allows the definition of custom option types by creating
- parsing, printing, freeing, and restoring procedures for a custom
- option. This is needed by the text and canvas widgets if they are
- to be fully objectified.
-
-2000-09-07 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/Tk_Init.3:
- * doc/bell.n:
- * doc/loadTk.n: minor doc cleanup
-
-2000-09-06 Eric Melski <ericm@ajubasolutions.com>
-
- * doc/HWNDToWindow.3:
- * doc/GetHWND.3: Changed synopsis to indicate the tkPlatDecls.h
- should be included, not tk.h.
-
- * generic/tkPlatDecls.h: Removed #include <windows.h> for Windows,
- a better solution for now is to update the docs and have extension
- authors #include <tkPlatDecls.h>.
-
- * generic/tk.h: Removed '#include "tkPlatDecls.h"', as the
- incorrect inclusion order between windows.h/tkPlatDecls.h causes
- build conflicts on Windows.
-
- * generic/tkPlatDecls.h: Added #include <windows.h> for Windows,
- so that HWND, etc., are defined properly.
-
-2000-09-06 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/canvas.n: fixed doc bug (ellson). [Bug: 6218]
-
- * README:
- * generic/tk.h:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in: updated to patchlevel 8.4a2
-
- * generic/tkMessage.c (MessageWidgetObjCmd): initialized result to
- avoid pedantic warning.
-
- * generic/tkGrab.c (Tk_GrabObjCmd): changed len arg from size_t to
- int to fix pedantic warning.
-
-2000-09-01 Eric Melski <ericm@ajubasolutions.com>
-
- * win/makefile.vc (install-libraries):
- * win/Makefile.in (install-libraries):
- * unix/Makefile.in (install-libraries): Added tkPlatDecls.h to
- list of header files to install.
-
- * generic/tk.h: Added #include "tkPlatDecls.h", which declares the
- platform specific component of the public Tk stubs API's.
-
-2000-08-29 Eric Melski <ericm@ajubasolutions.com>
-
- * win/tkWinMenu.c (DrawWindowsSystemBitmap): Use scratchDC
- for determining the source's logical coordinates. Patch from
- [Bug: 6134 (Markus Oberhumer)].
-
- * win/tkWinMenu.c (SetDefaults): Compute the indicatorDimensions[]
- under Windows NT/2000 in the same way as under Windows 95/98.
- Patch from [Bug: 6134 (Markus Oberhumer)].
-
- * win/tkWinFont.c (GetScreenFont): Added a memset() to
- pacify memory checkers. Patch from [Bug: 6134 (Markus Oberhumer)].
-
- * library/tkfbox.tcl (::tk::dialog::file::Update): Corrected
- handling of multi-pattern filters (eg, "* *.*"), which was broken
- by the getOpenFile performance patches applied earlier.
-
-2000-08-24 Eric Melski <ericm@ajubasolutions.com>
-
- * doc/toplevel.n:
- * doc/spinbox.n:
- * doc/scrollbar.n:
- * doc/scale.n:
- * doc/menubutton.n:
- * doc/menu.n:
- * doc/listbox.n:
- * doc/entry.n:
- * doc/frame.n:
- * doc/message.n:
- * doc/checkbutton.n:
- * doc/radiobutton.n:
- * doc/button.n:
- * doc/label.n:
- * doc/canvas.n:
- * doc/text.n: Fixed Standard Options section to make best use of
- new tab settings in man.macros.
-
-2000-08-24 Mo DeJong <mdejong@redhat.com>
-
- * unix/README: Update to account for removal of --enable-gcc.
- * unix/configure.in:
- * unix/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
- * win/configure.in:
- * win/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
- Remove quick hack that provided cross compile support for
- windows builds.
-
-2000-08-23 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkButton.c (ButtonTextVarProc): reversed change below,
- it was not correct.
-
-2000-08-22 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkButton.c (ButtonTextVarProc): changed order of
- incr/decr of new value object, in case they are equal.
-
-2000-08-18 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkImgPhoto.c (ImgPhotoGet): Removed redundant call to
- DitherInstance; this call was formerly being made from
- ImgPhotoGet->ImgPhotoConfigureInstance->DitherInstance, and
- ImgPhotoGet->DitherInstance. The second call was removed.
-
-2000-08-10 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/SetOptions.3: added missing ')'.
-
-2000-08-09 Eric Melski <ericm@ajubasolutions.com>
-
- * doc/SetOptions.3: Updated documentation to reflect support for
- TK_OPTION_NULL_OK for TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
-
- * generic/tkConfig.c: Added for TK_OPTION_NULL_OK support for
- TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
-
- * doc/place.n: Updated, reformatted manual entry.
-
- * tests/place.test: Added many tests.
-
- * generic/tkPlace.c (Tk_PlaceObjCmd): Updated to use Tk
- widget-option management facilities to manage place options (-x,
- -y, etc.), which simplifies the placer code. Added support for
- [place configure pathName] and [place configure pathName -option],
- similar to the behavior of the configure subcommand supported by
- widgets.
-
-2000-08-08 Eric Melski <ericm@ajubasolutions.com>
-
- * tests/place.test: Extended test suite to test error returns from
- [place].
-
- * generic/tkInt.h: Replaced Tk_PlaceCmd prototype with
- Tk_PlaceObjCmd prototype.
-
- * generic/tkWindow.c: Updated [place] command entry to use new
- Tcl_Obj interface.
-
- * generic/tkPlace.c (Tk_PlaceObjCmd): Tcl_Obj'ified [place] command.
-
-2000-08-07 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkWindow.c: Updated [selection] command entry to use
- new Tcl_Obj interface.
-
- * generic/tkInt.h: Replaced Tk_SelectionCmd prototype with
- Tk_SelectionObjCmd prototype.
-
- * tests/select.test: Updated test suite to recognize standardized
- error messages.
-
- * generic/tkSelect.c (Tk_SelectionObjCmd): Tcl_Obj'ified
- [selection] command.
-
-2000-08-07 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/cursors.n: changed .SS to more compatible macros.
-
-2000-08-05 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/safetk.tcl: rationalized the setting of tk_library when
- initialized Tk in a safe interpreter.
-
-2000-08-03 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkWindow.c: Updated "grab" command entry to use
- Tcl_Obj'ified command.
-
- * generic/tkInt.h: Replaced Tk_GrabCmd prototype with
- Tk_GrabObjCmd prototype.
-
- * tests/grab.test: Initial suite of tests for [grab] command.
-
- * generic/tkGrab.c (Tk_GrabObjCmd): Tcl_Obj'ified [grab] command.
-
- * generic/tkInt.h: Removed Tk_AfterCmd function prototype; the
- function does not exist (since 4.0p3). Cleaned up some line
- wrapping.
-
- * generic/tk.h: Removed "#define Tk_AfterCmd Tcl_AfterCmd";
- nothing in the core uses Tk_AfterCmd, and Tcl_AfterCmd doesn't exist
- anymore anyway.
-
- * generic/tkInt.h: Replace Tk_BindCmd prototype with
- Tk_BindObjCmd prototype.
-
- * generic/tkWindow.c: Updated "bind" command entry to use
- Tcl_Obj'ified command.
-
- * generic/tkCmds.c (Tk_BindObjCmd): Tcl_Obj'ified [bind] command.
-
- * tests/bind.test: Tweaked expected error messages for [bindtags]
- to comply with updated error messages.
-
- * generic/tkMenu.c (CloneMenu): Replaced calls to Tk_BindtagsCmd
- with equivalent calls to Tk_BindtagsObjCmd.
-
- * generic/tkInt.h: Replace Tk_BindtagsCmd prototype with
- Tk_BindtagsObjCmd prototype.
-
- * generic/tkWindow.c: Updated "bindtags" command entry to use
- Tcl_Obj'ified command.
-
- * generic/tkCmds.c (Tk_BindtagsObjCmd): Tcl_Obj'ified [bindtags]
- command.
-
-2000-08-02 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkCmds.c (Tk_TkwaitObjCmd): Tcl_Obj'ified [tkwait] command.
-
- * generic/tkWindow.c: Updated "tkwait" command entry to use
- Tcl_Obj'ified command.
-
- * generic/tkInt.h: Replace Tk_TkwaitCmd prototype with
- Tk_TkwaitObjCmd prototype.
-
- * generic/tkGrid.c (Tk_GridCmd): Split [grid] subcommands into
- separate functions instead of inlining them all in Tk_GridCmd.
-
-2000-08-01 Eric Melski <ericm@ajubasolutions.com>
-
- * generic/tkInt.h: Replaced prototype for Tk_MessageCmd with
- prototype for Tk_MessageObjCmd.
-
- * generic/tkWindow.c: Marked message command as using the new
- MessageObjCmd instead of the old MessageCmd.
-
- * tests/message.test: Added tests for the message widget.
-
- * generic/tkMessage.c: Obj'ified the message widget.
-
- * generic/tkInt.h: Removed prototype for Tk_ClipboardCmd, added
- prototype for Tk_ClipboardObjCmd.
-
- * generic/tkWindow.c: Updated function pointers for clipboard
- command to use Tcl_Obj version.
-
- * tests/clipboard.test: Updated tests to expect standard error
- messages.
-
- * generic/tkClipboard.c (Tk_ClipboardObjCmd): Obj'ified
- Tk_ClipboardCmd -> Tk_ClipboardObjCmd.
-
-2000-07-28 Eric Melski <ericm@ajubasolutions.com>
-
- * unix/tkUnixButton.c (TkpDisplayButton): Added bits to change
- the indicator color when radio-/check-buttons are disabled. This
- reduces the visual incongruity when a group of these controls are
- disabled together.
-
- * win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit
- for disabled menu entries, to ensure that those which are drawn by
- the system are shown grayed (such as entries on menubars) [Bug: 4372].
-
- * doc/label.n: Added -disabledforeground to list of options [Bug:
- 6053].
-
- * mac/tkMacDefault.h:
- * unix/tkUnixDefault.h: Added default values for listbox
- disabledforeground and state.
-
- * win/tkWinDefault.h: Changed default listbox background color to
- white and listbox selection borderwidth to 0, in keeping with the
- "Microsoft Windows User Experience"; added default values for
- listbox disabledforeground and listbox state.
-
- * doc/listbox.n: Added documentation for -state option.
-
- * generic/tkListbox.c: Added support for -state to listbox. [RFE:
- 6052].
-
- * tests/listbox.test: Tests for listbox disabled state.
-
-2000-07-27 Mo DeJong <mdejong@redhat.com>
-
- * win/configure.in: TCL_STUB_LIB_FLAG and
- TK_STUB_LIB_FLAG should not include ${TCL_DBGX}
- in win/tkConfig.sh, fix that.
-
-2000-07-25 Joe English <jenglish@flightlab.com>
- * doc: CanvPsY.3, ConfigWidg.3, CrtImgType.3, CrtItemType.3,
- FontId.3, GetFont.3, canvas.n, font.n, options.n, text.n:
- Documentation fix: Replaced references to XFontStruct *
- and Tk_FontStruct with Tk_Font.
-
-2000-07-24 Eric Melski <ericm@ajubasolutions.com>
-
- * tests/text.test: Added tests for -regexp -nocase searches with
- backslash character classes.
-
- * generic/tkText.c (TextSearchCmd): Text search did not work
- properly when -regexp and -nocase were used, in combination with
- backslash character classes represented by capital letters (ie,
- \W, \M); altered implementation of -regexp -nocase searches to use
- new regexp interfaces to fix this problem. [Bug: 5988].
-
-2000-07-21 Eric Melski <ericm@ajubasolutions.com>
-
- * tests/text.test: Added tests for searching when text is elided.
-
- * generic/tkText.c (TextSearchCmd): Text search was not returning
- the correct index when the search covered (but did not search)
- elided characters; corrected this by adjusting the match index by
- the number of elided characters preceeding the start of the match,
- just as is done with embedded windows, etc. [Bug: 5470].
-
-2000-07-21 Mo DeJong <mdejong@redhat.com>
-
- * win/configure.in: Add TK_STUB_LIB_FLAG and
- TK_BUILD_STUB_LIB_SPEC. These are needed to build a stub enabled
- extension.
-
-2000-07-20 Eric Melski <ericm@ajubasolutions.com>
-
- * unix/tkUnixDraw.c (TkScrollWindow): Replaced a use of a trinary
- operator with an if/else, to avoid build problems on some
- platforms [Bug: 5819].
-
- * win/makefile.vc: Applied patch from Don Porter to enhance nmake
- support on NT/Alpha [RFE: 5939].
-
-2000-07-19 Eric Melski <ericm@ajubasolutions.com>
-
- * library/text.tcl: Enhanced <Tab> binding to behave like normal
- <Tab> bindings when the text widget is disabled (ie, it advances
- focus to the next widget).
-
- * generic/tkText.c (TextSearchCmd): Added a test for a NULL
- segment pointer when doing backwards searches for "" on an empty
- text widget. [Bug: 6007].
-
-2000-07-18 Mo DeJong <mdejong@redhat.com>
-
- * unix/aclocal.m4: Use tcl.m4.
-
- * unix/configure.in: Properly quote LOCALES variable. Properly quote
- argument to m4 macro.
-
- * unix/tcl.m4: Add updated file from tcl.
-
- * win/tcl.m4: Updated file from tcl.
-
-2000-07-18 Eric Melski <ericm@ajubasolutions.com>
-
- * library/tkfbox.tcl: Fixed keyboard navigation in the iconlist.
-
- * unix/configure.in (MAKE_LIB): Corrected definition of MAKE_LIB
- for shared builds, with patch from Mike Hopkirk.
-
-2000-07-18 Mo DeJong <mdejong@redhat.com>
-
- * win/Makefile.in: Fix TCL_GENERIC_DIR variable
- so that it uses the TK_SRC_DIR in the same way
- as the unix version.
-
-2000-07-17 David Gravereaux <davygrvy@ajubasolutions.com>
-
- * generic/tkConsole.c: Added comments for a Win2K OS bug with
- GetStdHandle(STD_OUTPUT_HANDLE). No change was done to the code
- as the resulting behaviour of ShouldUseConsoleChannel() was
- correct, anyways. [BUG: 5971]
-
-2000-07-17 Eric Melski <ericm@scriptics.com>
-
- * generic/tkStubImg.c (Tk_InitImageArgs): Applied patch from [Bug:
- 5990], from Anselm Lingnau, which correctly sets the value of
- useNewImage to 0 when the new image system is not to be used,
- instead of leaving it at -1, which causes the check to be
- performed more times than is really necessary.
-
- * library/bgerror.tcl: Fixed a typo in one of the bgerror dialog
- label.
-
- * library/msgs/it.msg: Italian message catalog, from Paolo
- Brutti. [RFE: 6012].
-
-2000-07-07 Eric Melski <ericm@ajubasolutions.com>
-
- * library/msgs/el.msg: Greek message catalog, from George Petasis.
-
-2000-07-07 Mo DeJong <mdejong@redhat.com>
-
- * win/configure.in: Fix subst of TK_SHARED_BUILD
- variable in tkConfig.sh.in. Fix definition of
- TK_SRC_DIR variable so that it matches the
- unix version.
-
-2000-07-05 Mo DeJong <mdejong@redhat.com>
-
- * generic/tkFileFilter.c (AddClause): Cast to match function prototype.
- * win/stubs.c (_XInitImageFuncPtrs): Add return value for function.
- * win/tkWinButton.c (buttonStyles, ButtonBindProc, ComputeStyle):
- Remove unused declarations.
- * win/tkWinColor.c (GetColorByName, GetColorByValue): Remove unused
- function declarations.
- * win/tkWinDialog.c (TrySetDirectory): Remove unused function
- declaration.
- * win/tkWinEmbed.c (TkWinEmbeddedEventProc): Cast to match function
- prototype.
- * win/tkWinMenu.c (winMenuMutex, MenuExitProc): Remove unused
- declaration.
- * win/tkWinWindow.c (StackWindow): Remove unused declaration.
- * win/tkWinWm.c (ConfigureEvent): Remove unused declaration.
- * win/tkWinX.c (winXMutex): Remove unused declaration.
- * xlib/ximage.c (XCreateBitmapFromData): Cast to match function
- prototype.
-
-2000-07-05 Eric Melski <ericm@ajubasolutions.com>
-
- * tests/imgPhoto.test: Added test for GIF writing code [Bug: 5823].
-
- * generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a
- problem with the GIF writing code [Bug: 5823].
-
- * generic/tkCursor.c: Added initialization for nextPtr field of
- TkCursor, patch from Nijtmans/Howlett.
-
-2000-07-05 Eric Melski <ericm@ajubasolutions.com>
-
- * library/msgs/nl.msg: Dutch message catalog for dialogs, from Jan
- Nijtmans.
-
-2000-06-30 Eric Melski <ericm@scriptics.com>
-
- * doc/keysyms.n:
- * doc/colors.n: Added extra .CE/.CS pairs to break up the large
- text block, so that the generated Windows help file could
- accomodate the manual entry. [Bug: 5862]
-
- * tests/filebox.test: Adjusted tests to accomodate -multiple.
-
- * library/xmfbox.tcl: Adjusted arguments list construction such
- that -multiple is not presented as an option for tk_getSaveFile.
-
- * library/tk.tcl: Added test for safe interpreter status before
- attempting to load message catalogs (which is impossible in a
- standard safe interpreter). This means that SafeTk will not have
- localized dialogs, unless a means is found for loading the message
- catalog files.
-
-2000-06-29 Eric Melski <ericm@scriptics.com>
-
- * library/msgs/de.msg: German message catalog.
-
- * library/msgs/en.msg: English message catalog.
-
- * library/msgs/es.msg: Spanish message catalog.
-
- * library/msgs/fr.msg: French message catalog.
-
- * unix/Makefile.in:
- * unix/configure.in:
- * library/tk.tcl:
- * library/clrpick.tcl:
- * library/choosedir.tcl:
- * library/console.tcl:
- * library/msgbox.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl:
- * library/bgerror.tcl: Applied patches from Laurent Duperval to
- provide localization of Tk dialogs. [RFE: 2671].
-
-2000-06-27 Eric Melski <ericm@scriptics.com>
-
- * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from
- [Bug: 5275], which corrected a segfault-causing indexing problem
- when deleting entries from torn-off menus.
-
-2000-06-22 Eric Melski <ericm@ajubasolutions.com>
-
- * doc/getOpenFile.n: Updated with information about -multiple.
-
- * library/choosedir.tcl: Tweaked to handle modified tkIconList API's.
-
- * library/tkfbox.tcl: Preliminary implementation of multiple
- selection; based on patch from [RFE: 604]. Some of the tkIconList
- functions changed to support this and to make the dialog faster.
-
- * library/xmfbox.tcl: Added support for multiple selection, from
- patch in [RFE: 4999].
-
-2000-06-21 Eric Melski <ericm@scriptics.com>
-
- * library/text.tcl: Corrected behavior of text widget with respect
- to this sequence of events: click, shift-click. Previously, the
- shift-click just moved the cursor and anchor; now, the shift-click
- will select the text between the click and the shift-click, which
- is the behavior most users expect. [Bug: 5929].
-
-2000-06-19 Eric Melski <ericm@scriptics.com>
-
- * library/bgerror.tcl: Added auto-truncation for long error
- messages (more than 30 characters wide, or more than 4 lines
- long), so that the dialog remains a manageable size. [RFE: 5782]
-
-2000-06-15 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinDialog.c: Patched to support tk_getOpenFile
- -multiple. [RFE: 604].
-
-2000-06-13 Eric Melski <ericm@scriptics.com>
-
- * win/aclocal.m4:
- * win/configure.in:
- * win/Makefile.in: Applied patch from [RFE: 5844], to provide
- support for the mingw compile environment for Windows.
-
-2000-06-06 Jeff Hobbs <hobbs@scriptics.com>
-
- 8.4a1 RELEASE
-
-2000-06-03 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/CrtCmHdlr.3: new doc for ClientMessage handler procs
- * generic/tk.h: added typdef for Tk_ClientMessageProc
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tk.decls: Added Tk_CreateClientMessageHandler and
- Tk_DeleteClientMessageHandler declarations.
- * generic/tkEvent.c (Tk_HandleEvent): Added
- Tk_CreateClientMessageHandler and Tk_DeleteClientMessageHandler to
- allow adding event handlers that invoke for ClientMessage events.
- This is necessary to support unix dnd protocols.
-
-2000-06-02 Jeff Hobbs <hobbs@scriptics.com>
-
- * canvas.test: added test for 5783.
- * generic/tkCanvPoly.c (DisplayPolygon): added checks for the
- polygon fillGC not being empty to prevent segfault. [Bug: 5783]
-
-2000-05-31 Eric Melski <ericm@scriptics.com>
-
- * library/bgerror.tcl: Improved bgerror based on work by Donal
- K. Fellows; no longer dependant on tk_dialog; features a
- Windows-esque "Details" button, and a customizable extra function
- button that allows the user to (for example) save the stack trace
- to a file.
-
-2000-05-30 Eric Melski <ericm@scriptics.com>
-
- * generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be
- static char arrays with integer initialization, to address EBCIDIC
- vs. ASCII encoding issues and to handle compilers that don't deal
- with "\xAB" syntax for specifying hex values in strings.
-
-2000-05-28 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/spinbox.n: (new file) docs for spinbox widget
- * generic/tkInt.h: added Tk_SpinboxObjCmd declaration
- * generic/tkEntry.c: added 'spinbox' widget - an extension of the
- entry widget type.
- * generic/tkWindow.c: added 'spinbox' to core Tk commands
- * library/spinbox.tcl: (new file) binding and helper procs for spinbox
- * library/tk.tcl: added spinbox.tcl to list of files to source
- * tests/entry.test: updated changed error messages
- * tests/spinbox.test: (new file) test suite for spinbox
-
- * generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
- table init'n to prevent seg fault when using place on multiple
- displays.
-
- * generic/tk.h: added comments ot Tk_FakeWin structure
-
-2000-05-26 Eric Melski <ericm@scriptics.com>
-
- * generic/tkOption.c (Tk_GetOption): Extended Tk_GetOption to
- support a new syntax for option names in option tables. If the
- option name has an embedded ".", it indicates that the name field
- contains both an option name and an overriding widget class, in
- the form "class.option". The lookup for the option value will be
- performed as though the widget class is that specified, rather
- than the actual widget class.
- (SetupStacks): Replaced several lines of array element copying
- with a for loop for conciseness.
-
-2000-05-25 Eric Melski <ericm@scriptics.com>
-
- * library/button.tcl: Tweaks for -overrelief handling on Windows.
-
- * doc/radiobutton.n: Added documentation for -overrelief option.
-
- * doc/checkbutton.n: Added documentation for -overrelief option.
-
- * doc/label.n: Added documentation for -state option.
-
- * generic/tkButton.c: Added -overrelief option for checkbuttons,
- and radiobuttons.
-
- * library/button.tcl (tkButtonDown, macintosh version): Added
- protection against querying the -repeatdelay option from a widget
- that doesn't support it (ie, checkbuttons, radiobuttons, etc).
- Other platforms use a different binding script for checkbuttons
- and radiobuttons, so they don't have this issue.
- (tkCheckRadioEnter, windows version): Added code to handle
- -overrelief for check/radiobuttons on windows.
-
-2000-05-22 Eric Melski <ericm@scriptics.com>
-
- * generic/tkButton.c: Added -activeforeground, -activebackground
- for labels, for the -state option.
-
- * doc/label.n: Added documentation for -state option,
- -activeforeground, -activebackground.
-
-2000-05-22 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/Makefile.in (install-libraries): corrected to install X
- headers [Bug: 5516]
-
- * doc/bind.n:
- * doc/canvas.n:
- * doc/entry.n:
- * doc/listbox.n:
- * doc/photo.n: doc fix-ups [Bug: 5396]
-
-2000-05-17 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/bell.n:
- * tests/bell.test:
- * generic/tkCmds.c (Tk_BellObjCmd): added -nice option to
- optionally avoid resetting screen saver [Bug: 4279]
-
-2000-05-15 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinWm.c (Tk_WmCmd): changed wm deiconify from using idle
- callback to calling restack and focus code immediately.
-
-2000-05-17 Eric Melski <ericm@scriptics.com>
-
- Overall change: Added "-readonlybackground" option for entries,
- to enable a visual change when state goes to readonly.
-
- * mac/tkMacDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
- DEF_ENTRY_READONLY_BG_COLOR):
- * win/tkWinDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
- DEF_ENTRY_READONLY_BG_COLOR):
- * unix/tkUnixDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
- DEF_ENTRY_READONLY_BG_COLOR): Added default values for entry
- -readonlybackground option.
-
- * generic/tkEntry.c: Added -readonlybackground option, cleaned up
- excessive use of graphics contexts.
-
- * tests/entry.test: Added configuration test for
- -readonlybackground option.
-
- * doc/entry.n: Added documentation for -readonlybackground option.
-
- Overall change: changed implementation of "link" relief for
- buttons. Instead of a new relief style (-relief link), there is a
- new option, -overrelief, which if set is used when the mouse is
- over the button.
-
- * doc/SetOptions.3: Added information about TK_OPTION_NULL_OK with
- TK_OPTION_RELIEF.
-
- * win/tkWinButton.c: Removed bits about TK_RELIEF_LINK.
-
- * tests/button.test: Added tests for -overrelief; removed tests
- for -relief link.
-
- * mac/tkMacButton.c: Removed bits about TK_RELIEF_LINK.
-
- * generic/tkOldConfig.c: Removed bits about TK_RELIEF_LINK.
-
- * generic/tkConfig.c: Removed bits about TK_RELIEF_LINK; added
- support for TK_OPTION_NULL_OK for TK_OPTION_RELIEF.
-
- * library/button.tcl: Added binding support for -overrelief.
-
- * generic/tk3d.c (Tk_GetRelief): Added branch for TK_RELIEF_NULL.
-
- * generic/tkButton.c: Added -overrelief option; removed
- Enter/Leave EventProc masks and handlers.
-
- * generic/tk.h: Added TK_RELIEF_NULL definition, removed
- TK_RELIEF_LINK.
-
- * mac/tkMacDefault.h (DEF_BUTTON_OVER_RELIEF):
- * win/tkWinDefault.h (DEF_BUTTON_OVER_RELIEF):
- * unix/tkUnixDefault.h (DEF_BUTTON_OVER_RELIEF): Added default
- value for the -overrelief option.
-
-2000-05-16 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinMenu.c (ReconfigureWindowsMenu): Added code to add the
- MF_SEPARATOR bit for SEPARATOR_ENTRY menu items. This causes
- separator entries on the system menu to be drawn correctly [Bug: 5451].
-
-2000-05-15 Eric Melski <ericm@scriptics.com>
-
- * doc/image.n: Added documentation for [image inuse] command.
-
- * tests/image.test: Added tests for [image inuse] command.
-
- * generic/tkImage.c (Tk_ImageObjCmd): Added [image inuse] command,
- which provides a means for programmers to determine if a given
- image is in use by any widgets. [RFE: 3327].
-
-2000-05-14 Eric Melski <ericm@scriptics.com>
-
- * doc/clipboard.n: Added documentation for "clipboard get".
-
- * generic/tkClipboard.c (Tk_ClipboardCmd): Added "clipboard get"
- subcommand [RFE: 4628].
-
- * tests/clipboard.test: Updated to use "clipboard get" instead of
- "selection get -s CLIPBOARD".
-
- * library/entry.tcl: Adjusted Button-1 binding to set focus to the
- entry when it is readonly or normal.
-
- * doc/entry.n: Added documentation for readonly state,
- -disabledforeground, -disabledbackground.
-
- * tests/entry.test: Added tests for readonly state.
-
- * generic/tkEntry.c: Added support for "readonly" state, and
- redefined "disabled" state. A disabled entry will display its
- text in a dimmed color and possibly with a different background,
- and will be completely unusable (no selection, no editing). A
- readonly entry will look like a normal entry, but it will not be
- editable; selection is still allowed. [RFE: 4239]. To support the
- new disabled state properly, "-disabledforeground" and
- "-disabledbackground" options were added.
- *** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE ***
-
- * win/tkWinDefault.h:
- * mac/tkMacDefault.h:
- * unix/tkUnixDefault.h: Added DEF_ENTRY_DISABLED_FG,
- DEF_ENTRY_DISABLED_BG_COLOR, DEF_ENTRY_DISABLED_BG_MONO.
-
-2000-05-12 Eric Melski <ericm@scriptics.com>
-
- * unix/tkUnixButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
- * mac/tkMacButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
- * win/tkWinButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
- Added code for drawing compound buttons.
-
- * tests/button.test: Added configuration tests for -repeatdelay,
- -repeatinterval, -compound.
-
- * library/button.tcl: Added support for -repeatedelay,
- -repeatinterval options.
-
- * generic/tkOldConfig.c: Changed handling of link relief so that
- proper error messages are used.
-
- * generic/tkButton.h: Added -compound, -repeatdelay,
- -repeatinterval options.
-
- * generic/tkButton.c: Added event watchers for enter/leave events,
- for link relief support.
-
- * generic/tk3d.c: Changed handling of link relief so that proper
- error messages are used.
-
- * generic/tk.h: Changed values of
- TK_OPTION_LINK_OK/TK_CONFIG_LINK_OK for link relief support.
-
-2000-05-12 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinFont.c (LoadFontRanges): improved support for all chars
- in 0-255 range for bitmap ANSI fonts. May be improved to handle
- bitmap non-ANSI fonts in the future. [Bug: 2172]
-
- * win/tkWinWm.c (RaiseWinWhenIdle): added TK_DONT_DESTROY_WINDOW
- to flag check to prevent timing related core dump. [Bug: 5438]
-
-2000-05-11 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinTest.c (TestclipboardObjCmd): ensured CloseClipboard
- would always get called for each OpenClipboard.
-
- * tests/focus.test (focusSetupAlt): removed wm withdraw from proc
- as it would cause a hang for tkwait visibility
-
- * tests/menu.test:
- * generic/tk3d.c:
- * generic/tkColor.c:
- * generic/tkCursor.c: corrected handling of 3DBorder, Cursor and
- Color objects on multiple screens. [Bug: 5454]
-
-2000-05-09 Eric Melski <ericm@scriptics.com>
-
- * doc/button.n: Added documentation for link relief.
-
- * tests/button.test: Added tests for link relief for buttons.
-
- * generic/tk.h (TK_CONFIG_LINK_OK): Added definition of
- TK_RELIEF_LINK, TK_OPTION_LINK_OK and TK_CONFIG_LINK_OK. [RFE: 4348]
-
- * generic/tk3d.c: Added support for link relief. [RFE: 4348]
-
- * mac/tkMacButton.c (TkpDisplayButton):
- * unix/tkUnixButton.c (TkpDisplayButton): Added support for link
- relief. [RFE: 4348]
-
- * generic/tkOldConfig.c (Tk_ConfigureWidget):
- * generic/tkConfig.c (DoObjConfig): Added understanding of link
- relief, which is allowed only for widgets that have
- TK_OPTION_LINK_OK or TK_CONFIG_LINK_OK set for the "-relief"
- option. [RFE: 4348]
-
- * generic/tkButton.c: Added TK_OPTION_LINK_OK to "-relief" option
- for buttons. [RFE: 4348]
-
- * win/tkWinWm.c (EX_TRANSIENT_STYLE): Removed WS_EX_TOOLWINDOW
- style bit, so that transient windows have full-size titlebars
- (like the tk_getOpenFile dialog).
-
- * win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height
- requested for separator bars to be (linespace - (2*descent))
- instead of just (linespace); this makes the separator occupy a
- more correct amount of vertical space. [Bug: 5303].
-
-2000-05-09 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]
-
-2000-05-02 Jeff Hobbs <hobbs@scriptics.com>
-
- * README:
- * generic/tk.h:
- * library/tk.tcl:
- * mac/README:
- * unix/README:
- * unix/configure.in:
- * unix/tk.spec:
- * win/README:
- * win/aclocal.m4:
- * win/configure.in:
- * win/makefile.vc: updated patchlevel to 8.4a1
-
- * unix/Makefile.in: added tk.spec to dist target
-
-2000-04-27 Eric Melski <ericm@scriptics.com>
-
- * doc/Tk_Init.3: Added Tk_SafeInit information [Bug: 1884].
-
- * doc/keysyms.n: Man page enumerating keysyms [RFE: 1645].
-
- * doc/colors.n: Man page enumerating valid color names [RFE: 1645].
-
- * doc/cursors.n: Man page enumerating valid cursor values [RFE: 1645].
-
- * library/msgbox.tcl: Corrected Unix tk_messageBox implementation
- to make the first button the default when no default is specified
- [Bug: 2218].
-
- * doc/messageBox.n: Updated documentation with regards to
- selection of default button when none is specified (now it will
- use the first button as the default in that case) [Bug: 2218].
-
-2000-04-26 Jeff Hobbs <hobbs@scriptics.com>
-
- 8.3.1 RELEASE
-
- * README:
- * mac/README:
- * unix/README:
- * unix/tk.spec:
- * win/README: Updating URLs to reference dev.scriptics.com
-
-2000-04-25 Jeff Hobbs <hobbs@scriptics.com>
-
- * unix/Makefile.in:
- * win/Makefile.in: makefile cleanup
-
-2000-04-25 Eric Melski <ericm@scriptics.com>
-
- * generic/tkMain.c: Fixed function header comment for Tk_MainEx.
-
- * unix/mkLinks:
- * doc/GetScroll.3: Added information about Tk_GetScrollInfoObj
- [Bug: 1866].
-
-2000-04-24 Eric Melski <ericm@scriptics.com>
-
- * unix/mkLinks:
- * doc/Grab.3: Man page for Tk_Grab and Tk_Ungrab [Bug: 1868, 1889]
-
- * unix/mkLinks:
- * doc/MainWin.3: Added entry for Tk_GetNumMainWindows [Bug: 1865].
-
- * unix/mkLinks:
- * doc/GetHINSTANCE.3: Man page for Tk_GetHINSTANCE [Bug: 1862].
-
-2000-04-24 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkImage.c (Tk_PostscriptImage): added check to create
- necessary prolog for photos
- * generic/tkCanvPs.c: added Tk_PostscriptPhoto that outputs PS for
- photo images
- * generic/tkImgPhoto.c: new func ImgPhotoPostscript and added that
- in as ps proc in tkPhotoImageType.
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tk.decls: added Tk_PostscriptPhoto
-
- * generic/tkConfig.c (DoObjConfig): removed direct setting of
- interp->result.
-
- * mac/tkMacWm.c (Tk_WmCmd): initialized gotToplevel in
- colormapwindows case (bug found by Reasoning, Inc's automated code
- testing).
-
-2000-04-24 Eric Melski <ericm@scriptics.com>
-
- * unix/mkLinks:
- * doc/GetHWND.3: Man page for Tk_GetHWND [Bug: 1863].
-
- * unix/mkLinks:
- * doc/HWNDToWindow.3: Man page for Tk_HWNDToWindow [Bug: 1869].
-
- * unix/mkLinks:
- * doc/AddOption.3: Man page for Tk_AddOption [Bug: 1854]
-
-2000-04-22 Jim Ingham <jingham@cygnus.com>
-
- * mac/tkMacDialog.c (Tk_MacGetOpenFile): Add empty bodies for the
- "-initialfile" and "-defaultextension" options.
-
- * mac/tkMacDialog.c (NavServicesGetFile): Only cons the result up
- into a list if multiple is true.
-
- * mac/tkMacMenus.c (SourceDialog): Use the "tk_getOpenFile"
- instead of hand-coding the dialog with StandardGetFile. This way
- we get the Navigation dialogs for free.
-
- * doc/getOpenFile.n: Document the -multiple and -message flags
- which are only implemented on the Mac. Also note that the -title
- works on the Mac with Nav Services installed.
-
-2000-04-19 Eric Melski <ericm@scriptics.com>
-
- * doc/WinViewable.3:
- * unix/mkLinks: Removed docs for Tk_IsViewable.
-
- * win/tkWinDialog.c: Removed calls to Tk_IsViewable.
-
- * generic/tkUtil.c:
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tkCmds.c:
- * generic/tk.decls: Removed Tk_IsViewable function (it was not
- actually needed).
-
-2000-04-19 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/aclocal.m4: made SC_PROG_TCLSH search specifically for
- tclsh*.exe type files to find an executable.
-
- * win/Makefile.in: fixed up cleanup, winhelp, cat32 targets
-
- * library/console.tcl: made console use systemfixed font on Win
-
- * generic/tkEntry.c: removed unnecessary ENTRY_VALIDATE #define
-
-2000-04-19 Eric Melski <ericm@scriptics.com>
-
- * generic/tkRectOval.c (ConfigureRectOval): Added checks for valid
- outline settings before creating of outline GC; this means that it
- is really possible now to have an oval or rectangle with no
- outline. [Bug: 5029].
-
-2000-04-19 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/choosedir.tcl (::tk::dialog::file::chooseDir::Config):
- * library/tkfbox.tcl (::tk::dialog::file::Config): removed the
- extraneous glob on -initialdir after file isdir already returned 1
- and moved cd trick into this case as the else already uses [pwd].
- [Bug: 5181]
-
- * win/winMain.c: moved extern call out of WinMain func
-
- * README:
- * generic/tk.h:
- * unix/configure.in:
- * unix/tk.spec:
- * win/configure.in: bumped to version 8.3.1
-
- * library/msgbox.tcl (tkMessageBox): changed to use grid in some
- places, realign icon to anchor nw.
-
- * mac/tkMacScale.c: reverted tkMacScale.c to 1.5 equivalent (it
- was accidentally bumped forward).
-
-2000-04-18 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinPointer.c: Changed Mod2Mask in TkWinGetModifierState to
- ALT_MASK, to fix some event problems [Bugs: 1160, 5088].
-
- * win/tkWinX.c: Changed Mod2Mask in GetState to ALT_MASK, to fix
- some event problems [Bugs: 1160, 5088].
-
- * generic/tkInt.h: Moved definition of ALT_MASK and META_MASK here
- so that it would be accessible from other modules than tkBind.c.
-
- * generic/tkBind.c: Added code in BindEvent to check for ALT_MASK
- and META_MASK in the event state field, as this field may not be
- set up with the correct display modifier mask bits if the XEvent
- structure was created by [event generate] or by the Windows X
- emulation. [Bugs: 1160, 5088].
-
-2000-04-18 Scott Redman <redman@HILO>
-
- * win/tk.rc:
- * win/wish.rc:
- * win/wish.ico: Modified copyright dates in Windows resource
- files. Updated the icon for wish.exe.
-
-2000-04-17 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinDialog.c: Added checks for visibility of parent window
- before creating MessageBox and ChooseColor dialogs; this prevents
- the application from locking when the parent is withdrawn and the
- message box is created. In these cases, the window will be
- created without a parent.
-
- * unix/mkLinks: Added WinViewable.3.
-
- * tests/msgbox.test: Added tests for patch from [Bug: 4997].
-
- * library/msgbox.tcl:
- * library/dialog.tcl: Applied patch from [Bug: 4997]; detaches
- dialog window from parent if parent is not viewable.
-
- * library/bgerror.tcl: Removed workaround from [Bug: 4370]; this
- is superceeded by patches to dialog.tcl.
-
- * generic/tkCmds.c: Changed WinfoObjCmd to use Tk_IsViewable
- function to determine visibility of windows instead of inlining
- the code.
-
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tk.decls: Added Tk_IsViewable declaration.
-
-2000-04-17 Eric Melski <ericm@scriptics.com>
-
- * library/text.tcl: Tweaked double-/triple-click selection;
- previously, anchor and insert marks were placed in unexpected
- locations following a double or triple click. Now they are placed
- logically. Also tweaked the extension of selection via
- shift-double-clicks so that it no longer selects the contiguous
- whitespace on the side of the selection opposite the
- double-click. [RFE: 4253].
-
- * doc/menu.n: Added note regarding rendering of
- checkbuttons/radiobuttons in menubars on different platforms --
- some systems do not draw indicators for check/radiobuttons in
- menubars.
-
- * library/menu.tcl: Corrected behavior of
- checkbuttons/commands/radiobuttons in menubars [Bug: 630].
-
- * tests/grid.test: Added test for [grid propagate . 0] to not toggle.
-
- * generic/tkGrid.c: Fixed bogus logic in [grid propagate] that
- caused [grid propagate . 0] to act as a toggle instead of an
- absolute set. [Bug: 2286].
-
-2000-04-16 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinColor.c (FindSystemColor): correct calculation of
- colors when shifting value. [Bug: 4919]
-
-2000-04-16 Jim Ingham <jingham@cygnus.com>
-
- * mac/tkMacPort.h: protect against strncasecmp already defined -
- it is in the Pro5 version of MSL.
-
- * mac/tkMacWindowMgr.c (GenerateKeyEvent): Check for a null tkWin.
- If the hidden window we use for double-buffering controls manages
- to percolate to the top (should never happen, but...) this will
- keep us from crashing.
-
- * mac/tkMacButton.c (InitSampleControls): Hide the
- double-buffering window BEHIND the first "." window you can find.
- This will keep it from ever being the front window, and thus a
- black hole for events. * mac/tkMacButton.c (ButtonEventProc):
- Disable the controls when the window is in the background. This
- is required by the MacOS HIG. This doesn't always get called when
- it should, it still needs more work.
-
- * mac/tkMacDialog.c: Pretty substantial rewrite to include
- Navigation Services support for systems which have it.
-
-2000-04-14 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinKey.c: Added check for ASCII delete character in
- KeycodeToKeysym, to fix [Bug: 5090]. See comment in code for more
- information.
-
- * generic/ks_names.h: Added Scroll_Lock and Sys_Req definitions.
-
- * win/tkWinKey.c: Changed implementation of KeycodeToKeysym,
- et. al., to use a keycode table for lookups; this will result in
- faster keycode -> keysym translations for non-ASCII keys like
- Control, Alt, etc.
-
-2000-04-14 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinWm.c (WmProc): added check in WM_MOUSEACTIVATE so we
- correctly activate native menus when clicking in when we didn't
- have focus [Bug: 2272]
-
- * generic/tkCanvas.c (CanvasEventProc:2451): corrected cast
-
- * generic/tkEntry.c (Tk_EntryObjCmd): adjusted finishing error
- cases and changed TK_CONFIG_NULL_OK to TK_OPTION_NULL_OK
-
- * tests/scale.test:
- * generic/tkScale.c:
- * generic/tkScale.h:
- * unix/tkUnixScale.c:
- * mac/tkMacScale.c: moved (PixelToValue|ValueToPixel|SetScaleValue)
- to tkScale.c. Caused an associated variable to be immediately set
- [Bug: 4833]
-
- * library/scale.tcl (tkScaleActivate): reduced number of scale
- redisplays by checking current value of state before setting it
- again. [Bug: 4191]
-
- * tests/winDialog.test: tk_chooseDirectory seems to get a noop
- from GetOpenFileName in the static build, hanging some tests.
- The tests were fixed to timeout (noop cause unknown).
-
- * unix/aclocal.m4 (SC_ENABLE_THREADS): enhanced the detection of
- pthread_mutex_init [Bug: 4359] and (SC_CONFIG_CFLAGS) added
- --enable-64bit-vis switch for Sparc VIS compilation [Bug: 4995]
-
-2000-04-13 Eric Melski <ericm@scriptics.com>
-
- * win/tkWinKey.c: Added smarts to check whether the left or right
- Control, Shift, or Alt key was pressed. [Bug: 870].
-
- * win/tkWinMenu.c: Corrected code that created separator items on
- menus; originally, it requested that the system be responsible for
- drawing those items, so it would ignore configuration items like
- the widget background. Now, we draw the separators ourselves (as
- we do with every other kind of menu item already). [Bug: 1166].
-
- * win/tkWin3d.c:
- * unix/tkUnix3d.c: Applied patch from [RFE: 2501]: adds more
- sophisticated smarts to TkpGetShadows, so that the highlight of a
- very bright color is actually distinguishable from the color, and
- the shadow of a very dark color is similarly distinguishable from
- the color.
-
- * generic/tkCanvas.c: Applied patch from [Bug: 4202]; adds a check
- for NULL tkwin in Tk_CanvasEventuallyRedraw.
-
-2000-04-12 Jeff Hobbs <hobbs@scriptics.com>
-
- * test/winClipboard.test:
- * win/tkWinInt.h:
- * win/tkWinClipboard.c (UpdateClipboard):
- * win/tkWinX.c (GenerateXEvent): added updatingClipboard tsd and
- TkWinUpdatingClipboard accessor function to allow us to flag
- ourselves when we are the ones updating the clipboard. This
- corrected inability to create our own clipboard types within a Tk
- application. [Bug: 2338 4318]
- * win/tkWinTest.c (TestclipboardCmd): improved TestclipboardCmd
- with better error handling and obj'ification
-
-2000-04-11 Eric Melski <ericm@scriptics.com>
-
- * msgcat.n: Added docs for new behavior from patch in [Bug: 4158].
-
- * msgcat.test: Added tests for new behavior from patch in [Bug:
- 4158].
-
- * msgcat.tcl: Applied patch from [Bug: 4158], which enables
- msgcat::mc to search the entire namespace ancestry chain for
- message translations (ie, first it checks the current namespace,
- then the parent, then the parent's parent, etc). Also allows the
- specification of additional args for msgcat::mc; if extra args are
- given, the [format] command is used to substitute the additional
- args in the translated message.
-
- * library/bgerror.tcl: Moved check for withdrawn state after check
- for tkerror; this was causing problems when tkerror was used.
-
-2000-04-10 Eric Melski <ericm@scriptics.com>
-
- * library/bgerror.tcl: Added check for withdrawn state of . and
- unsetting of transient bit for .bgerrorDialog if . is not
- viewable; this protects against the application hanging on systems
- like Windows, where transient windows are withdrawn with their
- parents. [Bug: 4370].
-
- * tests/event.test: Added test for [event generate $widget
- <Alt-z>] [Bug: 4611].
-
- * tests/choosedir.test: Changed "namespace import ::tcltest" to
- "namespace import -force ::tcltest".
-
- * win/tkWinKey.c:
- * unix/tkUnixKey.c:
- * mac/tkMacKeyboard.c: Changed InitKeymapInfo to
- TkpInitKeymapInfo. [Bug: 4611].
-
- * generic/tkStubInit.c:
- * generic/tkIntDecls.h: Re-gen'd from tkInt.decls.
-
- * generic/tkInt.decls: Added TkpInitKeymapInfo to list of function
- decls.
-
- * generic/tkBind.c (HandleEventGenerate): Added code to initialize
- keymap info if necessary, and to correctly set modifier bits in
- XEvent structure create to handle [event generate] calls.
- Previously, the alt/meta bits were not set correctly, so [event
- generate $widget <Alt-z>] would always fail. [Bug: 4611]
-
-2000-04-07 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkGrid.c (InitMasterData): fixed uninit'd data in
- GridMaster struct [Bug: 4387]
-
- * library/safetk.tcl (disallowTk): made disallowTk work in the
- simple case.
-
- * library/comdlg.tcl (tkFocusGroup_In): fixed key navigation
- problems in dialogs under CDE [Bug: 2960]
-
- * tests/winDialog.test: removed knownBug constraint from 5.16
-
- * win/tkWinFont.c (GetScreenFont): corrected adjustment against
- LC_FACESIZE limitation for NT [Bug: 4931]
-
- * win/makefile.vc (TKTEST_OBJS):
- * win/Makefile.in (TKTEST_OBJS): moved tkWinTest.c from normal
- objs to TKTEST_OBJS where it belonged.
-
-2000-04-03 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkTest.c: fixed incorrect platform inclusion for
- TkplatformtestInit (it would never get called).
-
- * unix/Makefile.in (MAN_INSTALL_DIR): patch to accept --mandir
- correctly [Bug: 4085]
-
- * library/clrpick.tcl (tkColorDialog_Config): error now thrown
- when -initialcolor "" specified. [Bug: 4198]
-
-2000-03-31 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/DrawFocHlt.3: doc name correction
-
- * generic/tkEntry.c: set TK_OPTION_NULL_OK bit on -invcmd option
- and removed #ifdef ENTRY_VALIDATE expressions
-
- * library/menu.tcl (tkMenuInvoke): corrected naming of tearoffs
- [Bug: 4506]
-
- * library/tkfbox.tcl (tkIconList_Goto): caused browsecmd to be
- called in tkIconList_Select. This causes the entry to be set
- properly when using the type-in-name-in-listbox bindings.
-
- * win/tkWinDialog.c: added unicode-aware open/save file dialogs
-
- * win/tkWinFont.c (TkpFontPkgInit): move private ref to platformId
- to TkWinGetPlatformId
-
- * win/tkWinMenu.c (SetDefaults): moved private use of versionInfo
- to TkWinGetPlatformId and removed all code for
- (versionInfo.dwMajorVersion < 4) (== Win32s)
-
- * win/tkWinX.c:
- * win/tkWin32Dll.c: moved TkWinGetPlatformId to tkWinX.c
- * win/tkWinInit.c: added TkWinXInit to TkpInit to ensure that its
- called for static Windows shells. [Bug: 3647]
-
- * win/tkWinInt.h:
- * win/tkWinX.c:
- * win/tkWinDraw.c (SetUpGraphicsPort):
- * win/tkWinScrlbr.c (UpdateScrollbar): removed use of tkpIsWin32s
-
- * win/tkWinInt.h (TkWinDCState struct): added bkmode value
- * win/tkWinDraw.c (TkWinGetDrawableDC, et al): added support for
- properly transparent dashed lines on Windows. [Bug: 4617]
-
-2000-03-30 Eric Melski <ericm@scriptics.com>
-
- * generic/tkImgGIF.c: Fixed some ANSI specific bits to avoid
- compile problems with non-ANSI compilers (ie, replace const with
- CONST, etc). [Bug: 4223].
-
- * unix/configure.in: Applied patch from [Bug: 4237]; ensures that
- srcdir is fully qualified.
-
- * unix/Makefile.in: Applied patch from [Bug: 4237]; if tcltest was
- not compiled, make test/tktest failed. Now it has a rule to build
- tcltest if it has not been built.
-
-2000-03-28 Eric Melski <ericm@scriptics.com>
-
- * library/tkfbox.tcl: Moved an overlooked tkFDialog* function in
- ::tk::dialog::file namespace.
-
- * tests/unixWm.test: Added tests for memory leak conditions in
- tkUnixWm.c.
-
- * tests/canvas.test: Added test for bad configuration options on
- empty and non-empty canvas.
-
- * generic/tkCanvas.c: Removed bad code in CANV_CONFIGURE block of
- CanvasWidgetCmd; this was causing non-empty canvases to improperly
- handle bad configuration options [Bug: 4456].
-
-2000-03-27 Eric Melski <ericm@scriptics.com>
-
- * unix/tkUnixWm.c: Applied patch from [Bug: 4405]; fixes memory
- leak in Unix wm command.
-
-2000-03-24 Eric Melski <ericm@scriptics.com>
-
- * tests/filebox.test:
- * tests/choosedir.test: Updated tests.
-
- * library/xmfbox.tcl: Updated to stash data array in
- ::tk::dialog::file namespace instead of in global namespace.
-
- * library/tkfbox.tcl: Extended some functions to support creation
- of a choosedir dialog, to allow greater code reuse between the two
- dialogs. Moved tkFDialog* functions into a namespace
- (::tk::dialog::file). Because these are private Tk functions (and
- should thus not be used directly by users), this should not impact
- anybody (the tk_getOpenFile and tk_getSaveFile commands still
- exist at the global scope).
-
- * library/tk.tcl:
- * library/tclIndex: Updated function names for tkFDialog*
- functions and choosedir functions.
-
- * library/choosedir.tcl: New and improved implementation of
- tk_chooseDirectory dialog. Based on tk_getOpenFile dialog.
-
-2000-03-23 Eric Melski <ericm@scriptics.com>
-
- * generic/tkWindow.c:
- * generic/tkInt.h: Updated Tcl_OptionCmd -> Tcl_OptionObjCmd
-
- * generic/tkOption.c: Tcl_Obj'ectified the "option" command.
-
-2000-03-22 Eric Melski <ericm@scriptics.com>
-
- * library/listbox.tcl (tkListboxCancel): Added a check for empty
- string value for tkPriv(listboxPrev). Without this check, it's
- possible to get a stack trace under certain conditions. [Bug: 4373].
-
-2000-03-15 Sven Delmas <sven@scriptics.com>
-
- * win/tkWinDialog.c: Changed the behavior for the
- tk_chooseDirectory dialog under Windows. Instead of trying to
- return the currently selected listbox entry (which didn't work in
- case the user selected the initial directory anyway), we now
- return the value shown in the entry. This seems to be in
- accordance with the expected behavior for this dialog.
-
-2000-03-14 Eric Melski <ericm@scriptics.com>
-
- * tests/choosedir.test: Marked test 3.1 and 3.2 as bad until the
- issue with those tests on IRIX can be determined.
-
-2000-03-10 Eric Melski <ericm@scriptics.com>
-
- * library/menu.tcl: Applied patch from [Bug: 4155]; protects
- against grabs on non-viewable windows.
-
-2000-03-08 Eric Melski <ericm@scriptics.com>
-
- * tests/choosedir.test: Modified test 3.1 (-mustexist works) to be
- more careful about cleaning up its potentially troublesome after
- events.
-
-2000-03-07 Eric Melski <ericm@scriptics.com>
-
- * tests/button.test:
- * generic/tkButton.c: Added -disabledforeground/-state to labels.
-
-2000-03-07 Jeff Hobbs <hobbs@scriptics.com>
-
- * tests/entry.test:
- * generic/tkEntry.c (EntrySetValue): malloc the value when
- validating because validation could cause the pointer to become
- invalid. Also fixed configure to not trigger focus-based
- validation. Improved use of Tcl_WrongNumArgs. [Bug: 4320]
-
-2000-03-06 Eric Melski <ericm@scriptics.com>
-
- * library/menu.tcl: Added a check in tkMenuFirstEntry that changes
- menu behavior to only auto-post an immediate child cascade if we
- are currently on a menubar menu. This prevents massive
- auto-cascading in cases where the first entry of the cascade is
- itself a cascade, and the first entry of that cascade is a
- cascade, and the first entry of that cascade is a cascade
- ... [Bug: 676].
-
- * generic/tkOldConfig.c: Added check for NULL tkwin value in
- Tk_ConfigureWidget [Bug: 4079]
-
- * generic/tkWindow.c: Added check for NULL tkwin value in
- Tk_NameToWindow [Bug: 4079]
-
-2000-03-02 Jeff Hobbs <hobbs@scriptics.com>
-
- * tests/color.test:
- * xlib/xcolors.c (XParseColor FindColor):
- * win/tkWinColor.c (XAllocColor): Fixed bit fiddling for colors to
- return "correct" values for color mapping. [Bug: 4282]
-
- * unix/Makefile.in (SCRIPT_INSTALL_DIR): removed extraneous '/'
- * unix/aclocal.m4: corrected TCL_NEEDS_EXP_FILE to be 1 for AIX
-
- * win/tkWinInt.h: change extern to EXTERN for TkWinChildProc
- declaration with extra #defs. [Bug: 4240]
-
- * library/focus.tcl: fixed tkFocusOK to protect $w in
- uplevel with list. [Bug: 4208]
-
- * doc/CrtItemType.3: fixed docs for Tk_CreateItemType to reflect
- changes made in 8.3.0 (but old style would still work as well).
- [Bug: 4252]
-
- * tests/config.test: extra test to check object cleanup when
- destroying the widget
- * generic/tkListbox.c (DestroyListbox): fixed crash in
- DestroyListbox due to null tkwin. [Bug: 4207]
-
- * tests/entry.test: added test suite for entry validation
- * doc/entry.n: improved docs discussing caveats and gotchas when
- mixing textvar with widget validation
- * generic/tkEntry.c (EntryValidateChange): improved handling of
- validation with relation to -textvariable. Previously, it would
- turn off whenever the textvar was set. Now it will it will turn
- off only when the textvar is set and validation returns 0. Added
- %V (type of validation occuring) to %-subs to help work with
- trickier validation.
-
-2000-03-01 Eric Melski <ericm@scriptics.com>
-
- * tests/clrpick.test:
- * library/clrpick.tcl: Added code to make color chooser dialog
- inherit screen setting from parent (bug #2334)
-
-2000-02-25 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinWm.c (RaiseWinWhenIdle): Checked for the possibility
- that the window could be destroyed (can occur with
- wm deiconify .toplevel; destroy .toplevel).
-
-2000-02-25 Eric Melski <ericm@scriptics.com>
-
- * generic/tkImgGIF.c: Applied "spirit of" the patch in 1605 (the
- submitted patch was more complicated than necessary and did not
- extend to writing GIF's, only reading), to allow reading/writing
- of GIF files on EBCDIC and other non-ASCII based systems.
-
-2000-02-14 Eric Melski <ericm@scriptics.com>
-
- * unix/tk.spec: RPM specification for producing a binary Tk RPM
- for Linux.
-
- * unix/Makefile.in: Added rpm target to generate Tk
- binary RPM.
-
-2000-02-10 Jeff Hobbs <hobbs@scriptics.com>
-
- 8.3.0 RELEASE
-
- * changes: updated for 8.3.0 release
-
- * generic/tkImgGIF.c (FileReadGIF): added cast for trashBuffer
-
- * generic/tkIntXlibDecls.h:
- * generic/tkInt.decls: declared some Xlib emulation calls for
- the Mac
-
- * generic/tkFrame.c (TkInstallFrameMenu): added extra panic to
- inform user of bad call when framePtr is NULL [Bug: 2530]
-
- * generic/tkMenu.c (DestroyMenuInstance): Placed checks around
- menu name objects before trying to incr the ref. [Bug: 3402]
-
- * generic/tkTest.c: removed USE_OLD_IMAGE def for Mac
-
- * library/listbox.tcl:
- * library/text.tcl: added support for <4> and <5> for mousewheel
- style scrolling on Unix for mice that map to these buttons.
-
- * tests/scrollbar.test: fixed check of testmetrics command to
- allow unix tests to run (testmetrics is mac/pc only)
-
- * unix/tkUnixWm.c (Tk_CoordsToWindow): qualified delete of error
- handler as the goto label is reached from above and below.
-
- * unix/configure.in:
- * unix/aclocal.m4: cleaned up macros to coincide with tcl.m4,
- added -export-dynamic to LDFLAGS for FreeBSD-3+ [Bug: 2998]
-
- * unix/README:
- * unix/Makefile.in (dist): removed porting.notes and porting.old
- from distribution and CVS. The information was very outdated. Now
- refer to http://dev.scriptics.com/services/support/platforms.html
-
- * xlib/xgc.c: #def'd out XDrawSegments for the Mac, and added
- some extra include info for the Mac
-
-2000-02-09 Jim Ingham <jingham@cygnus.com>
-
- * mac/tkMacButton.c: Stop removing the appearance window from the
- Window List. It is not clear why Ray did this, and it causes the
- Appearance manager to crash at random times.
-
- * mac/tkMacWM.c: Add support in unsupported1 style for the Appearance
- specification of window styles, including floating window support.
- * mac/tkMacWindowMgr.c: Operate on the front non-floating window,
- unless the mouse is directly over the floating window. Also,
- keystrokes go to the front non-floating window.
- * mac/tkMacAppInit.c: Initialize floating window support.
- * mac/tkMacScrlbr.c:
- * mac/tkMacmenu.c: Fixes for floating windows - operate on the
- FrontNonFloatingWindow.
- * mac/tkMacLibrary.r: Fix typo in File info string.
- * mac/tkMacApplication.r: Fix typo in file info string. Add
- Finder balloon help for no apparent reason.
-
- * mac/tkMacSubwindows.c: Change panic in tkMacGetDrawablePort to
- Debugger. This is only a temporary fix. The panic is only
- triggered when a safeTk interpreter is torn down, and ignoring it
- does no harm. I haven't figured out how to avoid it yet, however.
- Also use the Appearance MoveWindowStructure call when available.
-
- New Files:
- * MW_TkOldImageHeader.h: Handle #defining USE_OLD_IMAGE for tkImgPPM.c.
- * MW_TkTestHeader.h:
- * MW_TkTestHeader.pch:
- * MW_TkHeader.h: Add separate prefix files for test & release
- versions of Tk, so we can just have separate targets w/o having to
- edit files.
-
- * tclets.r: The D&D Tclets icon in rez form so we can have a
- target for this.
-
- The above are curtesy of Daniel Steffen (steffen@math.mq.edu.au)
-
- * tkMacAppearanceStubs.c: Stubs of the Mac Appearance calls I use
- so I can link the static 68K Shell without putting ifdef's all
- over the code.
-
-2000-02-08 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tk.decls:
- * generic/tkBind.c:
- * generic/tkInt.decls:
- * generic/tkIntDecls.h:
- * generic/tkStubInit.c:
- * mac/tkMacKeyboard.c:
- * unix/tkUnixKey.c:
- * win/tkWinKey.c: Fix for keyboard handling of "dead" keys and
- caps lock from Peter Spjuth. [Bug: 4105 3359 2493]
- Split functions into platform specific files:
- Static functions GetKeySym(), SetKeycodeAndState() and InitKeymapInfo()
- from tkBind.c moved into platform files tkWinKey.c tkUnixKey.c and
- tkMacKeyboard.c. GetKeySym() and SetKeycodeAndState() renamed to
- Tkp* and made public (as private functions) in tkInt.decls.
-
- Step 2, fixes in tkWinKey.c
- New static function: KeycodeToKeysym(), based on XKeycodeToKeysym()
- but with different arguments, and a lot of improvements.
- TkpGetString() changed to use KeycodeToKeysym() + other fixes.
- TkpGetKeySym() changed to use KeycodeToKeysym() + other fixes.
- InitKeymapInfo() changed to use KeycodeToKeysym().
- TkpSetKeycodeAndState() rewritten, mostly by copying code from
- XKeysymToKeycode().
- XKeycodeToKeysym() rewritten. Preferably it should be removed.
-
- EXPLANATION: The main problem is ToAscii() which has a lot of side
- effects, and also that XKeycodeToKeysym() is not provided enough
- input to do a proper job. The changes' main goal is to avoid
- calling ToAscii() if not necessary, and to provide it with as
- correct information as possible when called. Also some attempts
- to clean up what ToAscii() did are done. See the code for details.
-
- BUGS FIXED: Typing shifted (and AltGr) dead keys did not work.
- Keyboard lock lamps did not work on Win98.
- Events regarding AltGr-keys behaved badly.
- Example: On a Swedish keyboard, $ is typed with AltGr-4.
- That keyboard event would get the keysym '4' not 'dollar'.
- Also, doing [event generete . <Key-dollar>] would send keysym '4'.
- Translation to ascii in TkpGetString did not handle return and
- tab correctly. I.e. [event generate . <Key-Return>] gave wrong %A
-
- * generic/tkDecls.h:
- * generic/tk.decls:
- * generic/tk.h: moved new public functions created in dash patch
- to the stubs interface [Bug: 4062]
-
- * generic/tk.h:
- * doc/CrtImgType.3:
- * doc/CrtPhImgFmt.3:
- * generic/tk.h:
- * generic/tkImgGIF.c:
- * generic/tkImgPhoto.c:
- * generic/tkStubImg.c (new file):
- * generic/tkTest.c:
- * unix/Makefile.in:
- * win/Makefile.in:
- * win/makefile.vc: improved support for moving from the old style
- image C API to the new obj'ified one with new Tk_InitImageArgs
- command and stub'ing of image code. See docs for how to make the
- transition. [Bug: 4060]
-
- * library/tk.tcl: wrapped check for tcl_platform(os) around info
- exists because it won't in safe interpreters
-
- * win/tkWinFont.c: corrected symbol font use to only work on 8-bit
- characters [Bug: 2406]
-
- * unix/aclocal.m4: changed all -fpic to -fPIC
-
- * README:
- * unix/configure.in:
- * win/configure.in:
- * generic/tk.h (TK_RELEASE_SERIAL): Moved to 8.3.0 patchlevel
-
-2000-02-07 Eric Melski <ericm@scriptics.com>
-
- * library/tkfbox.tcl: Applied patch from bug #4117,
- tk_getOpenFile/getSaveFile doesn't do the right thing when user
- types a directory name in the entry and a default extension is
- specified.
-
-2000-02-05 Jeff Hobbs <hobbs@scriptics.com>
-
- * unix/tkUnixScale.c (TkpDestroyScale): changed ckfree to
- Tcl_EventuallyFree to behave with Tcl_Preserve in TkpDisplayScale
- (prevents possible segfault).
-
-2000-02-03 Eric Melski <ericm@scriptics.com>
-
- * tests/canvText.test: test for fix for bug #2525.
-
- * generic/tkFont.c (Tk_ComputeTextLayout): Was erroneously setting
- the width of newline-only text display chunks to some arbitrary
- huge number, instead of 0; this was interfering with things like
- the canvas find enclosed feature. (bug #2525).
-
- * tests/text.test:
- * generic/tkText.c (DumpLine/DumpSegment): Changed DumpSegment to
- take a TkTextIndex instead of two integer offsets, so that it
- could use TkTextPrintIndex to format the offsets into an index,
- which makes it UTF smart (bug #2582).
-
-2000-02-01 Eric Melski <ericm@scriptics.com>
-
- * library/tk.tcl:
- * library/tclIndex:
- * library/choosedir.tcl: Moved choosedir functions into the
- ::tk::dialog::chooseDir namespace instead of a toplevel
- ::tkChooseDirectory namespace. Additional cleanup on the
- chooseDir dialog.
-
-2000-02-01 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/text.n: clarified docs on what happens during a search with
- -count when images/windows are embedded
-
- * win/Makefile.in (install-*): reduced verbosity of install
-
- * win/tkWinPixmap.c (XGetGeometry): added support for windows in
- XGetGeometry [Bug: 4069]
-
- * win/tkWinFont.c (GetScreenFont): fixed possible mem overrun with
- long font names [Bug: 4108]
-
- * win/tkWinDialog.c: added EnableWindow calls to dialogs to
- correct for possible loss of control in parent Tk toplevel
- [Bug: 1212 et al]
-
- * generic/tkRectOval.c (ConfigureRectOval):
- * generic/tkCanvLine.c (ConfigureLine):
- * generic/tkCanvPoly.c (ConfigurePoly):
- * generic/tkCanvArc.c (Configure/DisplayArc): fixed handling for
- negative dash values [Bug: 4104]
-
- * generic/tkScale.c (TkRoundToResolution): fixed incorrect
- assumption that (N+1)*delta = N*delta + delta with floating point
- math [Bug: 3689, 4099]
- (DestroyScale) Fixed check for cancelling TkpDisplayScale (was
- REDRAW_ALL, is now REDRAW_PENDING)
-
- * tests/listbox.test: corrected test case for listbox itemconfigure
-
- * unix/aclocal.m4: added *BSD ELF recognition for
- SHARED_LIB_SUFFIX determination (from Tcl's tcl.m4)
-
-2000-01-27 Eric Melski <ericm@scriptics.com>
-
- * generic/tkImgPhoto.c: Removed unneccesary object translation in
- MatchStringFormat (bug #4103).
-
-2000-01-27 Eric Melski <ericm@scriptics.com>
-
- * generic/tkImgGIF.c: Additional code cleanup (now we only have
- one decoder! neat!)
-
-2000-01-26 Eric Melski <ericm@scriptics.com>
-
- * doc/getOpenFile.n:
- * doc/chooseDirectory.n: Man page/cross links for
- tk_chooseDirectory (bug #1786).
-
- * library/tk.tcl:
- * library/tclIndex: Added hooks for tk_chooseDirectory. (bug #1786)
-
- * library/choosedir.tcl: tk_chooseDirectory implementation for
- Unix/Mac (bug #1786).
-
- * generic/tkImgPhoto.c: Added some comments regarding slow
- processing of transparent images.
-
- * generic/tkImgGIF.c: Improved GIF decoder for ~60% speed
- increase. Added some comments on how to further improve the
- implementation, time permitting.
+ * 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.
- * doc/photo.n: Added a description of what the -data string can
- contain (base64 or binary data).
+ 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>
- * generic/tkImgPhoto.c: Fixed bug with use of binary data for
- "-data" option to "image create" command.
+ * macosx/tkMacOSXWm.c (WmAttrGetNotifyStatus, WmAttrSetNotifyStatus):
+ New functions.
+ (WmAttributesCmd): Add the -notify.
+ * doc/wm.n: Document -notify.
-2000-01-21 Eric Melski <ericm@scriptics.com>
+2005-03-19 Donal K. Fellows <dkf@users.sf.net>
- * library/tkfbox.tcl: Fixed bug relating to incorrect parent
- values for error message boxes displayed by the file dialog (bug
- #3616).
+ * generic/tkConsole.c (Tk_CreateConsoleWindow,TkConsolePrint): Rewrite
+ so that TkConsolePrint cannot become detached from the console when the
+ [console] command is renamed. [Bug 1016385]
- * tests/text.test:
- * generic/tkText.c: Fixed bug relating to regexp searching for
- empty lines; previously, the starting line was ignored. (bug #1643).
+2005-03-15 Vince Darley <vincentdarley@users.sourceforge.net>
-2000-01-20 Jeff Hobbs <hobbs@scriptics.com>
+ * generic/tkTextDisp.c: fix for [Bug 1143776] in adjusting displayed
+ lines when running into the bottom of the window.
- * library/text.tcl: fixed double-click selection behavior where
- there were embedded windows/widgets in the same line. [Bug: 3989]
+2005-03-14 Jim Ingham <jingham@apple.com>
- * win/tkWinWm.c (TkWmProtocolEventProc): cached atom name as the
- window could get destroyed during eval [Bug: 2513]
+ * macosx/tkMacOSXScrlbr.c (ThumbActionProc): No need to use "update
+ idletasks" here, TclServiceIdle will do as well and it is simpler.
- * generic/tkCanvLine.c (LineCoords): fixed segfault when too few
- coords were passed to a line with certain options set (it should
- always have thrown an error anyway). [Bug: 4042]
+ 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]
- * tests/text.test:
- * generic/tkText.c: fixed missing " in error case and missing
- 'dump' in subcommand listing [Bug: 4036]
+ * macosx/tkMacOSXInt.h: Added TK_MAPPED_IN_PARENT
+ * macosx/tkMacOSXSubwindows.c (FixMappingFlags): New function.
+ (XMapWindow): Call FixMappingFlags.
+ (XUnMapWindow): Ditto.
- * generic/tkListbox.c: adjusted use of basic string concatenation
- in (non-K&R behavior) [Bug: 4027]
- Swapped bg/fg class for -select(bg|fg) for listbox and their
- items [Bug: 4039]
+ * 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.
- * unix/mkLinks:
- * doc/WindowId.3: added docs for Tk_IsContainer and Tk_IsEmbedded
+2005-03-15 Pat Thoyts <patthoyts@users.sourceforge.net>
- * doc/text.n: clarified mark gravity definition and usage of
- ``word'' in binding definitions. [Bug: 2004 2277 1388]
+ * unix/tcl.m4: Updated the OpenBSD configuration and regenerated the
+ * unix/configure: configure script.
- * generic/tkInt.h: moved new TkDisplay useInputMethods structure
- element to end to not disturb position of previous elements in
- the structure (as compared to Tk <=8.2).
+2005-03-14 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-2000-01-20 Eric Melski <ericm@scriptics.com>
+ * generic/tkEvent.c (InvokeClientMessageHandlers): Ensure that client
+ messages are handled correctly. Thanks to George Petasis for tracking
+ this down. [Bug 1162356]
- * tests/grid.test: Added a test for the consecutive ^ and multiple
- widget case (bug #1386).
+2005-03-11 Jim Ingham <jingham@apple.com>
- * generic/tkGrid.c: Fixed interpretation of consecutive ^
- characters in grid command. Previously, ^ ^ was interpreted as
- meaning that there must be a 2-column widget above to extend,
- neglecting the case where there was actually 2 1-column widgets
- above. Now, ^ ^ is interpreted as a possible width; the gridder
- will consume as many ^'s as there are columns in the widget, and
- leave the rest for the extension of other widgets. (bug #1386).
+ * 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.
-2000-01-19 Eric Melski <ericm@scriptics.com>
+ * 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.
- * library/tk.tcl: Created a virtual event <<PrevWindow>> for
- reverse tab traversals, with one default binding <Shift-Tab>, and
- OS specific bindings for Linux, HP-UX, and IRIX. (bug #3163)
+ * 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]
-2000-01-13 Jeff Hobbs <hobbs@scriptics.com>
+2005-03-10 Jim Ingham <jingham@apple.com>
- * changes: updated changes file to reflect 8.3b2 mods
- * README:
- * generic/tk.h:
- * unix/configure.in:
- * win/configure.in: updated to patchlevel 8.3b2
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): In the
+ inDrag section, set the GrafPort to the drag window's GrafPort before
+ doing LocalToGlobal. [Bug 1160025]
- * win/tkWinWm.c: added visibility event handler to make sure
- that transient window wrappers would be updated when the master
- was initially mapped.
+2005-03-09 Jim Ingham <jingham@apple.com>
-2000-01-12 Jeff Hobbs <hobbs@scriptics.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.
- * tests/text.test: changed test to reflect change of -hidden
- to -elide in search options.
+2005-03-08 Jeff Hobbs <jeffh@ActiveState.com>
- * win/tkWinScrlbr.c: added check for valid hwnd in ModalLoopProc
- to avoid crash when building statically
+ * win/tkWinWm.c (WinSetIcon): fix GCLP_ICONSM -> GCLP_HICONSM.
- * doc/event.n:
- * generic/tkBind.c: prevented core with event -warp on Windows
- when window wasn't mapped [Bug: 4004] and added docs stating
- the requirement for mapped windows.
+ * win/makefile.vc: clarify necessary defined vars that can come from
+ MSVC or the Platform SDK.
- * generic/tkCanvas.c: fixed mem leak with TagSearchExprInit
- [Bug: 3977]
+2005-02-28 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkStubInit.c:
- * generic/tkDecls.h: remove non-existent
- Tk_(Get|Create)CanvasVisitor prototypes
+ * win/tkWinX.c (GenerateXEvent): correct %A translation on MouseWheel.
+ [Bug 1118340]
- * generic/tkText.c:
- * generic/tkEntry.c: fixed cursor to not blink when widget was
- disabled [Bug: 1807]
+2005-02-24 Daniel Steffen <das@users.sourceforge.net>
- * generic/tkRectOval.c: added note about change to bloat for
- RectOval bounds calculation for WIN32 only
+ * macosx/tkMacOSX.h: fixed incorrect inclusion of internal header.
+ * macosx/tkMacOSXNotify.c: corrected included headers.
- * library/dialog.tcl: improved handling of $default arg to allow
- for name of given button, as well as bounds checking
+2005-02-22 Daniel Steffen <das@users.sourceforge.net>
- * doc/wm.n:
- * tests/winWm.test:
- * tests/unixWm.test:
- * mac/tkMacWm.c:
- * unix/tkUnixWm.c: fixed possible X error being raised [Bug: 3377]
- * win/tkWinWm.c: wm deiconify in zoom state [Bug: 2077],
- fixed possible flashing of unmapped toplevel in deiconify [Bug: 3338]
- and fixed mapping of transient window [Bug: 572]
- Also, for all wm's, extended 'wm state' command to allow setting
- of the state, and added official support of 'zoomed' state on Win.
+ * macosx/tkMacOSXDialog.c (Tk_GetSaveFileObjCmd, NavServicesGetFile):
+ fixed encoding problems with -initialfile & -filetypes and corrected
+ potential buffer overrun with -initialdir/-initialfile. [Bug 1146057]
- * unix/aclocal.m4: strtod bug on Tru64 [Bug: 3378]
+2005-02-16 Mo DeJong <mdejong@users.sourceforge.net>
- * unix/Makefile.in: added tests to prevent unnecessary chmod +x
- in source dirs while installing [Bug: 3367]
+ TIP#223 IMPLEMENTATION
- * unix/configure.in: properly sub'ed in TK_SHARED_BUILD [Bug: 3385]
+ * 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].
-2000-01-05 Jeff Hobbs <hobbs@scriptics.com>
+2005-02-14 Vince Darley <vincentdarley@users.sourceforge.net>
- * doc/text.n:
* generic/tkText.c:
* generic/tkText.h:
- * generic/tkTextBTree.c:
* generic/tkTextDisp.c:
- * generic/tkTextTag.c: removed the -state option for text tags,
- and reoriented it around -elide, as -state disabled was never
- implemented, and -state hidden is better as -elide.
-
- * mac/tkMacClipboard.c: fixed i18n problems with clipboard [Bug: 3544]
-
- * library/entry.tcl:
- * library/focus.tcl:
- * library/listbox.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/tearoff.tcl:
- * library/text.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl: fixed unprotected arg parsing through eval/after
- [Bug: 3943]
-
- * unix/Makefile.in: added unix/aclocal.m4 to distribution [Bug: 3938]
- * unix/aclocal.m4: changed NetBSD SHLIB_CFLAGS from -fpic to -fPIC
-
- * win/tkWinImage.c: added static declaration to function
-
-1999-12-22 Jeff Hobbs <hobbs@scriptics.com>
-
- * changes: updated changes file
-
- * generic/tkScale.c:
- * generic/tkScale.h:
- * mac/tkMacScale.c:
- * unix/tkUnixScale.c: fixed potential segv from patch in 3897
-
- * tests/unixWm.test: nonPOrtable -> nonPortable
-
-1999-12-21 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tk.h:
- * unix/configure.in:
- * win/configure.in:
- * win/aclocal.m4:
- * README: updated for patch level 8.3b1
-
- * unix/tkUnixWm.c: fixed panic in Tk_CoordsToWindow to print error
- and continue instead (for Tix) [Bug: 716 et al]
-
- * scale.test:
- * generic/tkScale.c:
- * generic/tkScale.h: fixed possible core when freeing options
- (cursor) associated with scale widget [Bug: 3897]
-
- * doc/MeasureChar.3: fixed docs for Tk_MeasureChars to reflect code
- * doc/listbox.n: fixed formatting problem
-
- * generic/tk3d.c: added extra calculations to ensure that thin
- frames get refreshed too [Bug: 3596]
-
- * unix/tkUnixMenu.c:
- * unix/tkUnixFont.c:
- * generic/tkCanvText.c:
- * generic/tkEntry.c:
- * generic/tkFont.c:
- * generic/tkImgPPM.c: removed extranneous vars that were set but
- never used.
-
- * mac/tclMacHLEvents.c: fixed applescript for I18N [Bug: 3644]
-
- * unix/aclocal.m4: removed -O flag for AIX when using the IBM
- compiler (several versions have a bug that crops up in the text
- widget). [Bug: 2316]
-
- * unix/Makefile.in: removed extra slash in SCRIPT_INSTALL_DIR
- [Bug: 3896]
-
- * library/listbox.tcl: added extra checks for existence of
- tkPriv(listboxSelection) before it was used. [Bug: 3892]
-
-1999-12-16 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/GetCursor.3:
- * win/tkWinCursor.c: added support for Windows cursors to
- TkGetCursorByName (.ani, .cur) using -cursor @<filename>
- (Ascher) [Bug: 1350]
-
- * win/tkWinWm.c: fixed 'wm deiconify' to update position of the
- toplevel if event is waiting before mapping. (Mao) [Bug: 3687]
- This removes the need for 'update idle' before 'wm deiconify' on
- Windows.
-
- * doc/listbox.n: added doc for <<ListboxSelect>> [Bug: 3500]
-
- * doc/getOpenFile.n: removed note that -initialfile didn't work
- for tk_getOpenFile
- * library/tkfbox.tcl: updated tk_get*File to better match the
- Windows file box it emulates, give proper support to -initialfile,
- and fixes lack of global tkPriv call. [Bug: 3735 3882]
-
- * doc/tk.n: added doc for 'tk useinputmethods ...'
- * tests/tk.test:
- * unix/tkUnixKey.c:
- * generic/tkCmds.c:
- * generic/tkEvent.c:
- * generic/tkWindow.c:
- * generic/tkInt.h: add 'tk useinputmethods ?-display win? ?bool?'
- call to provide support for disabling/enabling the use of XIM on
- X. This was previously all done at compile time, and always on.
- Now it is turned off by default, even when available, and the user
- must turn it on to use XIM (per display).
-
- * generic/tkCanvUtil.c: fixed bug in Tk_CanvasPsOutline that freed
- mem it shouldn't.
-
- * generic/tkFont.c: added "bitstream cyberbit" (popular Windows
- CJK font) to list of font fallbacks. (kenny) [Bug: 2407]
-
- * mac/tkMacMenu.c: finished bug 3075 by changing the char values of
- what was checked (verified correctness on Mac).
-
-1999-12-13 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/canvas.n: added docs for items added by dash patch (-*dash*,
- -state, -active*, -disabled*, -offset, essentially rewrote the
- man patch for completely updated 8.3 canvas widget.
- * doc/entry.n: added docs for entry widget validation
- * doc/event.n: added docs for -warp
- * doc/text.n: doc'ed new -state value 'hidden'
- * doc/GetDash.3: (new file) man page explaining Tk_GetDash
- * generic/tkStubInit.c:
- * generic/tkDecls.h:
- * generic/tkIntXlibDecls.h:
- * generic/tkInt.decls: added XSetDashes and XWarpPointer
- * generic/tk.decls: added Tk_CreateSmoothMethod, and reserved
- two spots
- * generic/tk.h: added Tk_SmoothMethod struct,
- state item to canvas record, #defines for item state,
- support for using old char*-based canvas item C creation
- procedures with -DUSE_OLD_CANVAS,
- Tk_Dash, Tk_TSOffset (-offsets) & Tk_Outline structs and #defs,
- decls for dash, outline and postscript routines
- * generic/tkBind.c: added support for Quadruple clicks, and added
- the -warp option to 'event' with pointer warping routines
- * xlib/xgc.c:
- * generic/tkRectOval.c:
- * generic/tkCanvArc.c:
- * generic/tkCanvBmap.c:
- * generic/tkCanvImg.c:
- * generic/tkCanvLine.c:
- * generic/tkCanvPoly.c:
- * generic/tkCanvPs.c:
- * generic/tkCanvText.c:
- * generic/tkCanvUtil.c:
- * generic/tkCanvWind.c:
- * generic/tkCanvas.c:
- * generic/tkCanvas.h: Canvas and items received overhaul to with
- the addition of the dash patch (Nijtmans, et al) This includes
- objectification of the 'canvas' command, as well as support for
- (where appropriate) dashes in items, extended stipple support,
- state for all items, and postscript generation of images and
- windows. See the new canvas man page for related docs.
- * generic/tkEntry.c: added entry widget validation, see entry.n
- * generic/tkEvent.c: on simulated events, ButtonPress should
- be matched with ButtonRelease to be correct
- * generic/tkFont.c: corrected possible null reference
- * generic/tkFrame.c: made frame a Tcl_Obj based command
- * generic/tkGet.c: added TkGetDoublePixels
- * generic/tkImage.c: bug fixes from Img patch and new
- Tk_PostscriptImage and Tk_SetTSOrigin functions
- * generic/tkImgBmap.c: new ImgBmapPostscript function
- * generic/tkImgPhoto.c: new Tk_CreatePhotoOption, Tk_DitherPhoto
- * generic/tkInt.h: declarations for some new functions
- * generic/tkMessage.c: reworked relief drawing
- * generic/tkOldConfig.c: added TK_CONFIG_OBJS so old style
- ConfigureWidget calls can pass in Tcl_Obj arrays
- * generic/tkScrollbar.c:
- * generic/tkScrollbar.h: made -orient use an option table
- * generic/tkText.c:
- * generic/tkText.h: made -wrap and -state use option tables
+ * generic/tkTextIndex.c:
* generic/tkTextBTree.c:
- * generic/tkTextDisp.c:
- * generic/tkTextImage.c:
- * generic/tkTextMark.c:
- * generic/tkTextTag.c:
- * generic/tkTextWind.c: added support for -elide and -state hidden
- * generic/tkTrig.c: changed TkMakeBezierCurve to support returning
- the upper limit of points needed for spline
- * generic/tkUtil.c: new option table parsing routines
- * generic/tkWindow.c: init'ing of warp stuff, mouseButtonState
-
- related bug ids for the fixes:
- [Bug: 648 1541 1540 1779 2168 2311 2297 2340 2348 2578 3386]
-
- * tests/bind.test:
- * tests/canvImg.test:
- * tests/canvPsArc.tcl:
- * tests/canvPsImg.tcl: (new file)
- * tests/canvRect.test:
- * tests/canvText.test:
- * tests/canvas.test:
- * tests/defs.tcl:
- * tests/entry.test:
- * tests/event.test:
- * tests/font.test:
- * tests/frame.test:
- * tests/imgPhoto.test:
- * tests/safe.test:
- * tests/scale.test:
- * tests/scrollbar.test:
- * tests/select.test:
- * tests/text.test:
+ * doc/text.n:
* tests/textDisp.test:
- * tests/textTag.test:
- * tests/unixFont.test:
- * tests/unixWm.test:
- * tests/visual_bb.test:
- * tests/winClipboard.test: tests for the dash patch changes
-
- * unix/mkLinks: added GetDash.3 into the mkLink step
-
- * mac/tkMacDraw.c: mac still needs pointer warping routine
- * mac/tkMacXStubs.c:
- * win/tkWinDraw.c:
- * win/tkWinPointer.c: added support for pointer warping and
- platform specific support for dash patch items
-
-1999-12-12 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkText.c: fixed bug in TextSearchCmd for multibyte chars
- (Darley) [Bug: 3839]
-
- * unix/aclocal.m4: added warning when configuring with
- --enable-threads that Tk may have problems
-
-1999-12-09 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkImgGIF.c: updated casting
-
- * win/makefile.vc: removed 16bit stuff, simplified makefile.
-
-1999-12-06 Scott Redman <redman@scriptics.com>
-
- * generic/tkMain.c: need to include tclInt.h for new hook
- functions that are internal-use-only.
-
-1999-12-06 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/comdlg.tcl: removed tclVerifyInteger and tclSortNoCase,
- they weren't used, and were not actually correct
-
- * mac/tkMacFont.c:
- * mac/tkMacMenu.c:
- * mac/tkMacWindowMgr.c: fixed greyed out menu items, handling of
- ... elipsis, font mapping problem, and enabled generated menu
- posting [Bug: 3705]
-
-1999-12-02 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkInt.h:
- * generic/tkWindow.c:
- * generic/tkCmds.c: converted Tk_DestroyCmd, Tk_LowerCmd and
- Tk_RaiseCmd to their ObjCmd equivalent.
-
- * library/msgbox.tcl: added color icons for tk_messageBox on Unix
- and Mac when tk_strictMotif isn't set. (Hipp)
- * library/tk.tcl: added window bounds checking to ::tk::PlaceWindow
-
- * tests/imgPPM.test: fixed test 2.2 to use -format ppm (since
- we know have GIF write capability)
-
-1999-12-01 Scott Redman <redman@scriptics.com>
-
- * generic/tkMain.c :
- * unix/tkAppInit.c:
- * win/winMain.c: Added added hooks into the main() code for
- supporting TclPro and other "big" shells more easily without
- requiring a copy of the main() code.
-
-1999-11-29 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkImgGIF.c: added GIF writing that uses miGIF RLE
- [Bug: 2039, new patch]
-
- * library/entry.tcl: fixed up tkEntrySeeInsert (Nemthi)
-
- * generic/tkListbox.c: fixed 'get' of listbox to return a string
- when only one item is requested.
-
- * tests/clrpick.test:
- * tests/filebox.test: minor whitespace cleanup
-
- * library/tk.tcl: fixed missing $w in ::tk::PlaceWindow
-
-1999-11-24 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/clrpick.tcl:
- * library/msgbox.tcl:
- * library/tk.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl: fixed dialogs to center over -parent,
- added utility functions ::tk::PlaceWindow, ::tk::SetFocusGrab,
- ::tk::RestoreFocusGrab to tk.tcl to help
-
-1999-11-23 Eric Melski <ericm@scriptics.com>
-
- * tests/listbox.test: Added a test to check that the topIndex is
- update when items are removed from the listvar variable.
-
- * generic/tkListbox.c: Added a check the updates the topIndex when
- items are removed from the listvar variable.
-
- * tests/listbox.test: Added a test to check that the vertical
- scrollbar is updated when the listvar changes.
-
- * generic/tkListbox.c (ListboxListVarProc): added a check that
- sets the UPDATE_V_SCROLLBAR flag if the length of the listvar has
- changed.
-
-1999-11-23 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tk.h:
- * generic/tkConfig.c: added support for TK_OPTION_DONT_SET_DEFAULT
- as equiv for TK_CONFIG_DONT_SET_DEFAULT
- * generic/tkListbox.c: added TK_OPTION_DONT_SET_DEFAULT to the
- item specs
-
-1999-11-19 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkColor.c:
- * generic/tkColor.h: fixed Tk_NameOfColor to work correctly,
- with minor change to TkColor struct.
-
- * generic/tkConsole.c: added static declaration to
- ConsoleDeleteProc function (proto already had it)
-
- * win/tkWinInt.h: removed TkFontAttributes typedef (was
- redundant with tkFont.h).
- * win/tkWinPort.h: put #ifndef __GNUC__ around redefinition
- of str[n]casecmp, as cygwin uses the originals.
- * win/tkWinX.c: changed GetCurrentTime to GetTickCount (the
- former is deprecated). [Bug: 2053]
-
-1999-11-19 Eric Melski <ericm@scriptics.com>
-
- * tests/listbox.test: Added tests for itemcget and itemconfigure.
-
- * doc/listbox.n: Added documentation for -listvar option and for
- itemconfigure and itemcget commands.
-
- * generic/tkListbox.c: Added support for itemconfigure/itemcget
- listbox subcommands (addresses rfe #936)
-
-1999-11-17 Eric Melski <ericm@scriptics.com>
-
- * tests/listbox.test: Updated tests for new error messages.
-
- * generic/tkListbox.c: Improved error messages for bad -listvar's.
-
- * tests/listbox.test: Added tests for bad -listvar's.
-
- * generic/tkListbox.c: Added handlers for bad -listvar's (ie, bad
- lists)
-
- * tests/listbox.test: Added tests for ListboxUpdateHScrollbar.
-
- * generic/tkListbox.c: Changed some old static buffers to base
- size on TCL_DOUBLLE_SPACE instead of (completely) hardcoding the size.
-
- * tests/listbox.test: New tests for -listvar functionality, and an
- odd extra case that wasn't covered before.
-
- * generic/tkListbox.c: Tests exposed some bugs, now fixed.
-
-1999-11-16 Eric Melski <ericm@scriptics.com>
-
- * tests/listbox.test: Fixed tests to comply with new objectified
- error messages. No -listvar specific tests yet.
-
- * win/tkWinDefault.h:
- * unix/tkUnixDefault.h:
- * mac/tkMacDefault.h: Added default value for -listvar option.
-
- * generic/tkWindow.c: Changed "listbox" mapping from old-school to
- new-school objectified command.
-
- * generic/tkListbox.c: Objectified listbox; added support for
- -listvar option. Converted internal structure to use a Tcl list
- object to store the data.
-
- * generic/tkInt.h: Changed reference to Tk_ListboxCmd to
- Tk_ListboxObjCmd.
-
-1999-11-09 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkGrid.c: changed Tcl_Alloc to ckalloc
-
- * generic/tkEntry.c: fixed C expr error in destroy of entry
- that could lead to 'malformed bucket chain' error
-
- * win/winMain.c: corrected winMain to not do a DebugBreak when
- returning an error message from the top level
-
-1999-10-30 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinKey.c: fixed XKeysymToKeycode to handle mapping of
- symbolic keysyms (Left, Home, ...) with event generate
-
- * library/entry.tcl: change tkEntrySeeInsert to avoid the use
- of a while loop that could eat CPU tremendously. Behavior of
- moving the cursor at the right edge changes slightly (previously
- it tried to keep the cursor at the right edge, now it moves the
- cursor to a "central right" location - better IMHO).
-
-1999-10-28 Jeff Hobbs <hobbs@scriptics.com>
-
- * doc/CrtImgType.3:
- * doc/CrtPhImgFmt.3:
- * doc/FindPhoto.3:
- * doc/photo.n:
- * generic/tk.h:
- * generic/tkCmds.c:
- * generic/tkImage.c:
- * generic/tkImgBmap.c:
- * generic/tkImgGIF.c:
- * generic/tkImgPPM.c:
- * generic/tkImgPhoto.c:
- * generic/tkInt.h:
- * generic/tkTest.c:
- * generic/tkWindow.c:
- * tests/imgPhoto.test: added Img patch (Nijtmans) with docs,
- headers #def'd with USE_OLD_IMAGE. Upgrades image stuff to
- Tcl_Obj API, adds alpha channel (images are now 32 bpp)
-
- * makefile.vc: changed 'c:/program files' to c:/progra~1
-
-1999-10-19 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/scrlbar.tcl: changed tkScrollButtonUp to check for
- existence of tkPriv(relief) in order to avoid spurious release
- events
-
- * unix/Makefile.in: added ChangeLog to dist archive
-
-1999-09-24 Jeff Hobbs <hobbs@scriptics.com>
-
- * */README:
- * win/makefile.vc:
- * */configure.in:
- * generic/tk.h:
- * library/tk.tcl: up'd to 8.3a1
-
- * unix/Makefile.in: changed 'mkdir' to 'mkdir -p'
-
- * library/dialog.tcl: changed {Times 18} to {Times 12} for
- dialog font.
-
-1999-09-16 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkFont.c: fixed processing of font options and error
- returned [Bug: 2075]
-
- * win/tkWinWm.c: fixed bug in 'wm deiconify' that raised the
- wrong toplevel, and changed it to not set focus on overridden
- toplevels
-
-1999-09-15 Jeff Hobbs <hobbs@scriptics.com>
-
- * unix/aclocal.m4: added fix for FreeBSD-[1-2] recognition [Bug: 2070]
- and fix to AIX-* to get ldAix right [Bug: 2624], fixed AIX
- version check (readjust from 8-21 fix) and several other config
- fixes for AIX
- * mac/tkMacMenubutton.c:
- * unix/tkUnixMenubu.c: fixed permanently stippled menubutton image
- * win/tkWinButton.c: fixed possible pointer smash [Bug: 2733]
-
-1999-09-14 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinMenu.c: fix for stack overrun in GetTextFace [Bug: 909]
-
-1999-09-01 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinDraw.c:
- * unix/tkUnixDraw.c: fixed header style for TkpDrawHighlightBorder
- * generic/tkCanvas.c: fixed GC error (bg <> fg) in tkCanvas.c
- (from code added to support TkpDrawHighlightBorder) [Bug: 2676]
- * unix/aclocal.m4: added -bnoentry to the AIX-* flags
- * library/msgbox.tcl: changed the behavior of tk_messageBox on
- Unix to be more Windows like in handling of <Return> and the
- default button
- * library/button.tcl:
- * library/clrpick.tcl:
- * library/comdlg.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/entry.tcl:
- * library/focus.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
- * library/msgbox.tcl:
- * library/palette.tcl:
- * library/safetk.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/tearoff.tcl:
- * library/text.tcl:
- * library/tk.tcl:
- * library/tkfbox.tcl:
- * library/xmfbox.tcl: updated commands to use [string] ops
- instead of expr equality operators
-
-1999-08-21 Jeff Hobbs <hobbs@scriptics.com>
-
- * unix/aclocal.m4: Changed AIX-4.[2-9] check to AIX-4.[1-9]
- [Bug: 1909]
-
-1999-08-20 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkCursor.c: fixed bug in GetCursorFromObj that caused
- panic [Bug: 2562]
-
- * TK 8.2.0 RELEASED
-
-1999-08-13 Jim Ingham <jingham@cygnus.com>
-
- * mac/tkMacMenu.c: Tk_DrawChars ends up setting the menu background
- wrong. There is no clean way to stop it, so I use lower level routines
- here to draw the text.
- * mac/tkMacProjects.sea.hqx: Rearrange the projects so that the build
- directory is separate from the sources. Much more convenient!
-
-1999-08-10 Jeff Hobbs <hobbs@scriptics.com>
-
- * win/tkWinWm.c: changed "wm deiconify" on Windows to raise and
- force the focus on the deiconified window (behavioral change from
- 8.1 to comply better with Windows style) [Bug: 1609]
- * doc/wm.n: clarified behavior of "wm deiconify".
- * generic/tkInt.decls: added TkSetFocusWin
- * generic/tkFocus.c: changed static SetFocus to TkSetFocusWin
-
- * library/clrpick.tcl:
- * library/console.tcl:
- * library/tk.tcl: fixed code where abbreviations where used
- in calling widget methods (confuses iWidgets) [Bug: 2422]
-
-1999-08-09 Jeff Hobbs <hobbs@scriptics.com>
-
- * library/button.tcl: cleaned up programming (config -> configure)
- and fixed Windows relief bug [Bug: 664]
- * library/entry.tcl: changed Entry C/C/P to not use global data
- (now uses tkPriv(data)) [Bug: 1475]
- * library/listbox.tcl: fixed extended mode script error [Bug: 866]
- * doc/options.n: clarified that -troughcolor doesn't work on Windows
- * doc/wm.n: fixed wm positionfrom docs [Bug: 2284]
-
-1999-08-01 Jeff Hobbs <hobbs@scriptics.com>
-
- * mac/tkMacPort.h: wrapped panic in #ifndef panic to avoid
- compiler errors when used with stubs-#defines, from Vince Darley.
- [Bug: 2389]
-
-1999-07-31 Scott Redman <redman@scriptics.com>
-
- * xlib/X11/Xlib.h: Remove XFillRectangle since it is now in the
- stub tables.
-
-1999-07-30 Jeff Hobbs <hobbs@scriptics.com>
-
- * generic/tkInt.decls: Added stub entry for XFillRectangle [Bug: 2446]
-
-1999-07-30 <redman@scriptics.com>
-
- * win/makefile.vc: Corrected building threaded tktest.exe on
- Windows. Needed to link in .obj files from Tcl, needs to change
- later so that code is in Tk and doesn't require a Tcl build.
- Also added runtest target.
-
-1999-07-29 <redman@scriptics.com>
-
- * generic/tkConsole.c: Allow tcl to open CON and NUL, even for std
- channels. Checking for bad/unusable std channels was moved to Tk
- since its only purpose was to check whether to use the Tk Console
- Window for the std channels. [Bug: 2393 2392 2209 2458]
-
- * win/Makefile.in: Corrected building threaded tktest.exe on
- Windows. Needed to link in .obj files from Tcl, needs to change
- later so that code is in Tk and doesn't require a Tcl build.
-
-1999-07-22 <redman@scriptics.com>
-
- * Changed version to 8.2b2
-
- * win/tkWinPort.h: Block out include of sys/stat.h in order to
- build extensions with MetroWerks compiler for Win32. [Bug: 2385]
-
- * unix/Makefile.in: Need to make install-sh executable before
- calling (with chmod +x). [Bug: 2413]
-
- * library/menu.tcl: Applied patch from Jeff Hobbs to fix typo.
- [Bug: 2425]
-
-1999-07-21 <redman@scriptics.com>
-
- * unix/Makefile.in: Add Windows configure script to distribution.
-
-1999-07-16 <redman@scriptics.com>
-
- * unix/Makefile.in:
- * win/Makefile.in: Copy the prolog.ps from the generic directory
- for install-libraries.
-
- * unix/aclocal.m4: Check for Alpha/Linux to set the IEEE flag to
- the compiler to be -mieee. Patch from Don Porter.
-
-1999-07-08 <stanton@scriptics.com>
-
- * tests/unixSelect.test: Fixed broken test.
-
- * win/makefile.vc: Added special case target to ensure that
- tkStubLib.obj is built with -DSTATIC_BUILD.
-
- * win/tkWinX.c (TkWinChildProc): Changed to pass
- WM_WINDOWPOSCHANGED through to DefWindowProc to make OpenGL
- sub-windows happy. This allows Windows to generate the WM_SIZE
- and WM_MOVE messages.
-
-1999-07-08 <redman@scriptics.com>
-
- * unix/configure.in: Fix Tk stub lib file names and flags.
-
-1999-06-30 <redman@scriptics.com>
-
- * generic/tkGrid.c: removed deprecated functions (applied patch
- from Jan Nijtmans). [Bug: 2080]
-
- * generic/tkImgGIF.c:
- * generic/tkImgPPM.c:
- * generic/tkImgPhoto.c: Applied patch to allow Img extension to
- work with 8.2, from Jan Nijtmans. [Bug: 2068]
-
- * win/tkWinWm.c: Applied patch from Don Porter to prevent the
- windows code from calling the Tcl functions when the stub table
- has not been initialized in TkWinWmCleanup. [Bug: 2269]
-
-1999-06-16 <wart@scriptics.com>
-
- * unix/configure.in:
- * unix/Makefile.in:
- * unix/aclocal.m4: Numerous build changes to make Tk conform to
- the proposed TEA spec
-
- * tkConsole.c: changed some variable types from (int) to (size_t)
- to prevent compiler warnings. Cast return value from strlen()
- to (int) in one place for the same reason.
-
-1999-06-03 <stanton@scriptics.com>
-
- * unix/tkUnixSelect.c:
- * tests/unixSelect.test:
- * generic/tkSelect.c: Fixed selection code to handle Unicode data
- in COMPOUND_TEXT and STRING selections. [Bug: 1791]
-
-1999-06-02 <stanton@scriptics.com>
-
- * generic/tkIntXlibDecls.h:
- * xlib/X11/Xlib.h: Added Mac specific defines to help with
- compilation.
-
- * generic/tkFont.c: lint
-
-1999-06-01 <stanton@scriptics.com>
-
- * unix/tkUnixSelect.c: Improved I18N selection support.
- COMPOUND_TEXT is converted to/from iso2022, and STRING is
- converted to/from iso8859-1. There are still a few loose ends to
- tie up before this is completely done.
-
- * unix/tkUnixFont.c: Eliminated redundant case folding code.
-
- * generic/tkFont.c: Eliminated use of isupper/tolower in favor of
- Unicode variants.
-
-1999-05-24 <stanton@scriptics.com>
-
- * generic/tkStubLib.c:
- * generic/tkStubInit.c:
- * generic/tkIntXlibDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntDecls.h:
- * generic/tkInt.decls:
- * generic/tkConsole.c: Various changes to try to get the Mac
- builds working.
-
-1999-05-21 <stanton@scriptics.com>
-
- * win/tkWinClipboard.c: Fixed clipboard code to handle lack of
- CF_LOCALE information (e.g. from command.com).
-
-1999-05-20 <redman@scriptics.com>
-
- * library/console.tcl: Changed copyright string to read 1999
- Scriptics Corp. in wish console about box.
-
-1999-05-19 <redman@scriptics.com>
-
- * generic/tk.h: Add extern "C" block around entire header file for
- C++ compilers to fix linkage issues. Submitted by Don Porter and
- Paul Duffin.
-
-1999-05-18 <stanton@scriptics.com>
-
- * tests/winClipboard.test:
- * win/tkWinClipboard.c: Fixed clipboard code so it handles Unicode
- data properly on Windows NT and 95. [Bug: 1791]
-
-1999-05-07 <stanton@scriptics.com>
-
- * library/menu.tcl: Fixed bug where tk_popup fails when called too
- quickly. [Bug: 2009]
-
-1999-04-30 <stanton@scriptics.com>
-
- * Changed version number to 8.1.1.
-
-1999-04-30 <stanton@scriptics.com>
-
- * Merged changes from 8.1.0 branch:
-
- * generic/tkDecls.h:
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntXlibDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkStubInit.c: Changed to avoid the need for forward
- declarations in stub initializers. Added extern "C" blocks around
- stub table pointer declarations so the stubs can be used from C++
- code. [Bug: 1934]
-
- * generic/tkInt.decls: Added TkClipBox, XDrawSegments, and
- XForceScreenSaver to stubs.
-
- * generic/tkStubLib.c: Reordered declarations to avoid
- circularities and forward references.
-
- * generic/tkStubInit.c: Added includes for Mac.
-
- * generic/tkMenubutton.c: lint
-
- * generic/tkEntry.c: Fixed bad option table entry.
-
- * generic/tkImgBmap.c:
- * generic/tkImgPPM.c:
- * generic/tkImgPhoto.c: Set the -translation and -encoding options
- to binary for image files. (reported by Marco Gazzetta)
-
-1999-04-23 <stanton@scriptics.com>
-
- * generic/tkInt.decls: Added TkClipBox, XDrawSegments, and
- XForceScreenSaver to stubs.
-
- * generic/tkStubLib.c: Reordered declarations to avoid
- circularities and forward references.
-
- * generic/tkStubInit.c: Added includes for Mac.
-
- * generic/tkMenubutton.c: lint
-
- * generic/tkEntry.c: Fixed bad option table entry.
-
-1999-04-22 <redman@scriptics.com>
-
- * generic/tkImgBmap.c:
- * generic/tkImgPPM.c:
- * generic/tkImgPhoto.c: Set the -translation and -encoding options
- to binary for image files. (reported by Marco Gazzetta)
-
-1999-04-20 <redman@scriptics.com>
-
- * xlib/X11/Xlib.h: changed definition of Status type to use a
- typedef instead of a #define to avoid conflicting with the cygwin
- win32 headers [Bug 1804]
-
-1999-04-15 <stanton@scriptics.com>
-
- * Merged 8.1 branch into the main trunk
-
-1999-04-09 <redman@scriptics.com>
-
- * generic/tkWindow.c: Fixed deadlock situation when the Initialize()
- function returns without releasing the mutex. Found while testing
- Bug 1700, during safe.test (tk).
-
-1999-04-06 <stanton@scriptics.com>
-
- * generic/tkMain.c (Tk_MainEx): Changed to reset result before
- calling Tcl_EvalFile. The ensures that error messages will be
- generated cleanly.
-
- * tests/winfo.test: Enabled tests that previously failed.
-
-1999-04-05 <stanton@scriptics.com>
-
- * library/bgerror.tcl:
- * library/button.tcl:
- * library/clrpick.tcl:
- * library/console.tcl:
- * library/dialog.tcl:
- * library/entry.tcl:
- * library/focus.tcl:
- * library/listbox.tcl:
- * library/menu.tcl:
- * library/msgbox.tcl:
- * library/palette.tcl:
- * library/scale.tcl:
- * library/scrlbar.tcl:
- * library/tearoff.tcl:
- * library/text.tcl:
- * library/tk.tcl: Lots of minor performance improvements
- contributed by Jeffrey Hobbs. [Bug: 1118]
-
- * win/tkWinWm.c (Tk_WmCmd): Fixed bad code in tracing
- suboption. [Bug: 1519]
-
- * library/tkfbox.tcl: Change to restore button text after an
- action to avoid the sticky "Open" button in a save dialog.
- [Bug: 1640]
-
- * library/entry.tcl: Fixed so selection is returned using the
- -show character during cut and paste operations. [Bug: 1687]
-
-1999-04-5 <redman@scriptics.com>
-
- * generic/tkInt.decls:
- * generic/tkIntXlibDecls.h:
- * generic/tkStubInit.c:
- * xlib/xgc.c:
- * xlib/X11/Xlib.h:
- * xlib/X11/Xutil.h: Added more X functions to the Win & Mac stubs
- tables.
-
-1999-04-05 <stanton@scriptics.com>
-
- * unix/configure.in:
- * generic/tkCanvPs.c: Added configure test for pw_gecos field in
- pwd to support OS/390. [Bug: 1724]
+ * tests/textIndex.test: fix of longstanding elide problem when eliding
+ a newline without eliding the entire logical line. [Bug 443848]
-1999-04-02 <stanton@scriptics.com>
+2005-02-14 Jeff Hobbs <jeffh@ActiveState.com>
- * tests/text.test:
- * generic/tkText.c: Fixed handling of Unicode in text searches.
- The -count option was returning byte counts instead of character
- counts. [Bug: 1056, 1148, 1666]
+ * doc/options.n: note -cursor {} behavior. [Bug 965618]
-1999-04-01 <redman@scriptics.com>
-
- * generic/tk.decls:
- * generic/tk.h:
- * generic/tkStubInit.c:
- * generic/tkWindow.c:
- * unix/Makefile.in:
- * win/makefile.vc: Tk now uses its own stub library to store
- pointers to its own stubs table.
-
- * doc/dde.n: (removed)
- * doc/send.n:
- * generic/tk.decls:
- * tests/winSend.test:
- * generic/tkPlatDecls.h:
- * win/tkWinSend.c: Removed the DDE-based send and dde commands,
- they were causing Tk to lock up when any window on the system was
- not processing its message queue (more importantly, windows in Tcl
- and Tk). The send command needs to be rewritten to prevent the
- deadlock situation (soon). The dde command is being pushed into
- its own package and will provide almost all of the capabilities
- that send did before (using a "dde eval" command), not yet
- completed.
-
-1999-03-31 <redman@scriptics.com>
-
- * win/tkWinSend.c: Modified dde/send code to work properly on
- Win95/Win98. String lengths are not returned properly by DDE, so
- NULL terminate all strings going in and ignore the string length
- coming back out. Do not destroy handles until all necessary work
- on those handles (and child handles) is done.
-
-1999-03-30 <stanton@scriptics.com>
-
- * generic/tkWindow.c (Tk_DestroyWindow): Image handlers are now
- finalized before the font subsystem since complex image handlers
- may contain references to fonts (e.g. Tix compound images).
- [Bug: 1603]
-
-1999-03-29 <stanton@scriptics.com>
-
- * doc/MeasureChar.3:
- * doc/TextLayout.3:
- * generic/tk.decls:
- * generic/tkCanvText.c:
- * generic/tkEntry.c:
- * generic/tkFont.c:
- * generic/tkListbox.c:
- * generic/tkMessage.c:
- * mac/tkMacFont.c:
- * unix/tkUnixButton.c:
- * unix/tkUnixFont.c:
- * unix/tkUnixMenu.c:
- * win/tkWinFont.c:
- * win/tkWinMenu.c: Standardized text layout and font interfaces
- so they are consistent with respect to byte versus character
- oriented indices. The layout functions all manipulate character
- oriented values while the lower level measurement functions all
- operate on byte oriented values. This distinction was not clear
- and so the functions were being used improperly in a number of
- places. [Bug: 1053, 747, 749, 1646]
-
- * generic/tk.decls: Eliminated uses of C++ STL types string and
- list from declarations.
-
- * generic/tkFont.c: Changes to named fonts were not being
- propagated in some cases. [Bug: 1144]
-
- * xlib/X11/Xlib.h:
- * generic/tkInt.decls: Added XParseColor to xlib stub
- tables. [Bug: 1574]
-
- * doc/GetBitmap.3:
- * generic/tkBitmap.c (BitmapInit): Eliminated use of Tk_Uid's in
- bitmaps. Added a few CONST declarations.
-
-1999-03-29 <redman@scriptics.com>
-
- * unix/configure.in:
- * unix/Makefile.in:
- * win/makefile.vc:
- * generic/tkDecls.h:
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkIntXlibDecls.h: Removed stub functions. Always use the
- Tcl stubs when building with --enable-shared.
-
-
-1999-03-26 <redman@scriptics.com>
-
- * generic/tkTextIndex.c:
- * tests/testIndex.test: Avoid looking past the beginning of the
- array storing data for the text widget (.t index end-2c). Added
- test case to check for the bug. [Bug 991]
-
- * generic/tkConsole.c: Copy static strings into a Tcl_DString
- before passing to Tcl_Eval, in case the compiler puts static
- strings into read-only memory.
-
-1999-03-26 <suresh@scriptics.com>
-
- * unix/configure.in:
- --nameble-shared is now the default and builds Tk as a shared
- library; specify --disable-shared to build a static Tk library
- and shell.
-
-1999-03-26 <surles@scriptics.com>
-
- * library/menu.tcl: Fixed bug reported by Bryan Oakley in the
- menubutton bindings. There was a false assumption that there was
- always a menu attached to the button. [Bug 1116]
-
-1999-03-26 <redman@scriptics.com>
-
- * unix/configure.in: Removed --enable-tcl-stub. Linking Tk to Tcl
- stubs is causing too many problems when linking executables like wish.
- Until the Tk is a fully loadable extension, linking against the Tcl
- stubs is not supported in Tk.
-
-1999-03-19 <redman@scriptics.com>
-
- * generic/tkBitmap.c:
- * generic/tkCursor.c:
- * generic/tkGC.c: When creating hash tables that key off of XID
- handles, make sure to pass TCL_ONE_WORD_KEYS. XIDs are guaranteed
- to be 32bit numbers, although on some 64bit systems (including 64bit
- Solaris 7) they are packed into a 64bit value where the upper 32bits
- are zero. The normal method of sizeof(XID)/sizeof(int) causes the
- hash table code to assume that the XID is a pointer to an array of
- two ints, which it is not. Tk now supports 64bit Solaris 7.
-
-1999-03-17 <stanton@scriptics.com>
-
- * win/makefile.vc:
- * generic/tk.h: Changed to use TCL_BETA_RELEASE macro, and fixed
- so this works in rc files.
-
- * win/makefile.vc:
- * win/makefile.bc:
- * win/README:
- * unix/configure.in:
- * generic/tk.h:
- * README: Updated version to 8.1b3.
-
-1999-03-14 <stanton@GASPODE>
-
- * unix/configure.in: Added missing stub related definitions.
-
- * unix/Makefile.in: Install tkDecls.h in addition to tk.h.
-
- * generic/tkStubLib.c: Added flags to ensure we are using Tcl
- stub macros.
-
-1999-03-11 <stanton@GASPODE>
-
- * generic/tkInt.decls: Added reserved slot for XSetDashes for use
- by the dash patch.
-
-1999-03-10 <redman@scriptics.com>
-
- * xlib/xdraw.c:
- * xlib/X11/Xlib.h:
- * mac/tkMac.h:
- * mac/tkMacInt.h:
- * mac/tkMacPort.h:
- * mac/tkMacXStubs.c:
- * mac/tkMacAppInit.c:
- * mac/tkMacCursor.c:
- * win/makefile.vc:
- * win/tkWin.h:
- * win/tkWinInt.h:
- * win/tkWinPort.h:
- * win/winMain.c:
- * generic/tk.h:
- * generic/tkInt.h:
- * generic/tk.decls:
- * generic/tkInt.decls:
- * generic/tkDecls.h:
- * generic/tkPlatDecls.h:
- * generic/tkIntDecls.h:
- * generic/tkIntPlatDecls.h:
- * generic/tkIntXlibDecls.h:
- * generic/tkStubs.c:
- * generic/tkPlatStubs.c:
- * generic/tkIntStubs.c:
- * generic/tkIntPlatStubs.c:
- * generic/tkIntXlibStubs.c:
- * generic/tkStubInit.c:
- * generic/tkStubLib.c:
- * generic/tkBind.c:
- * generic/tkCmds.c:
- * generic/tkConfig.c:
- * generic/tkConsole.c:
- * generic/tkCursor.c:
- * generic/tkGrab.c:
- * generic/tkImgPhoto.c:
- * generic/tkMain.c:
- * generic/tkMenu.c:
- * generic/tkPointer.c:
- * generic/tkTextDisp.c:
- * generic/tkWindow.c:
- * unix/tkUnixInt.h:
- * unix/tkUnixPort.h:
- * unix/Makefile.in:
- * unix/configure.in:
- * unix/tkConfig.sh.in:
- * unix/tkUnix.c:
- * unix/tkUnix3d.c:
- * unix/tkUnixDraw.c:
- * unix/tkUnixFont.c:
- * unix/tkUnixMenubu.c: Stubs implementation for 8.1. Tk_Main() is
- replaced with a macro which calls Tk_MainEx(). Tk can link to the Tcl
- stubs library, wish links directly to Tcl and Tk. Use
- --enable-tcl-stubs to link Tk to the Tcl stubs library (Unix), on
- by default on Windows. Exported all public functions through the
- stubs mechanism (see the *.decls files) and many of the internal
- functions. Most of the changes dealt with shifting around the
- function declarations in the header files. Mac code may not
- compile, but it shouldn't take much work to fix this.
-
- * mac/tkMacMenu.c: Added dummy TkpMenuThreadInit for Mac to be
- consistent with Unix and Windows versions.
-
-1999-03-08 <lfb@scriptics.com>
-
- * win/tkWinWm.c: Toplevel class no longer shared between
- threads.
-
- * win/tkWinX.c: Multiple threads no longer share the same
- TkDisplay structure. Required because TkDisplay stores much
- thread-specific data for a given thread.
-
- * win/tkWinSend.c: Moved application instance handle out
- out thread-local storage. DDE was failing to initialize
- when the instance handles were different between threads.
-
- * win/makefile.vc: Added THREADDEFINES for building with
- threads enabled.
-
- * generic/tkMenu.c:
- * win/tkWinMenu.c:
- * unix/tkUnixMenu.c: Added TkpMenuThreadInit for initializing
- thread-specific Menu state.
-
-1999-03-01 <redman@scriptics.com>
-
- * win/tkWinWm.c:
- * win/tkWinPointer.c:
- * win/tkWinInt.h: Fix "focus -force" for Windows. The Win32 API
- function SetForegroundWindow() does not work unless the window
- handle is a toplevel window (a Windows toplevel). The handle
- being passed was a Tk toplevel, which is a child of the Windows
- toplevel.
-
-1999-02-26 <redman@scriptics.com>
-
- * win/cat.c: Remove this file, use the one in the Tcl source directory.
-
- * win/makefile.vc: Remove the wishc.exe from the default targets. Add
- a separate console-wish target to build it. The need for a
- console-wish will go away soon, so we don't want to encourage its
- use.
-
-1999-02-25 <redman@scriptics.com>
-
- * win/tkWinWm.c: Properly initialize the tsdPtr->firstWindow field.
-
- * win/cat.c: Code for cat32.exe, copied from the Tcl sources. Required
- in order to run the test suite from the makefile
-
- * win/winMain.c: Add main() for a console-based wishc.exe, which meant
- adding code to disable the call to Tk_ConsoleInit().
-
- * generic/tkConsole.c: Check the standard handles before creating the
- new standard channels. This allows a windows app that has stdin,
- stdout, or stderr to correctly connect to them.
-
- * generic/tkMain.c: Add a proper check for the interactive mode, since
- the standard channels may actually be connected in windows mode or
- even in the console-based wish.
-
- * win/makefile.vc: Add targets for wishc.exe (console-based wish) and
- cat32.exe (for testing). Fix the test suite target so it can be run
- from the makefile (which can happen since the standard handles have
- been fixed).
-
-1999-02-12 <lfb@scriptics.com>
-
- * generic/tkMenuButton.h:
- * generic/tkMenuButton.c:
- * mac/tkMacMenubutton.c:
- * mac/tkMacDefault.h
- * unix/tkUnixMenubu.c: Eliminated Tk_Uids used by -state option.
- * unix/tkUnixDefault.h
- * win/tkWinDefault.h
-
-
- * generic/tk.h:
- * generic/tkScale.h:
- * generic/tkScale.c:
- * generic/tkWindow.c:
- * unix/tkUnixScale.c:
- * unix/tkUnixDefault.h:
- * unix/tkWinDefault.h:
- * mac/tkMacDefault.h: Objectified scale widget.
-
- * win/tkWinX.c: Removed Thread-specific data from process
- initialization code that was stopping the Tk Dll from
- loading.
-
-1999-02-11 <stanton@GASPODE>
-
- * README:
- * generic/tk.h:
- * unix/configure.in:
- * win/README:
- * win/makefile.bc:
- * win/makefile.vc: Updated version to 8.1b2.
-
- * unix/tkUnixSend.c: Fixed one more Tcl_*ObjVar instance.
-
-1999-02-04 <stanton@GASPODE>
-
- * Various cleanup related to the Tcl_Eval and Tcl_ObjSetVar
- changes in Tcl.
-
- INTEGRATED PATCHES FROM 8.0.5b2:
-
- * win/tkWinMenu.c (TkpDestroyMenu): Changed so modalMenuPtr is
- cleared when it is being destroyed.
-
- * generic/tkImgPhoto.c: Changed so color tables are freed
- immediately instead of being delayed. This ensures that color
- tables are properly disposed at process exit.
-
- * library/prolog.ps: Changed string that determines font height to
- include European character with an umlaut.
-
- * generic/tkImgBmap.c (ImgBmapConfigureInstance): If an image
- mask changed but ended up with the same XID, the GC failed to be
- updated and so the new mask was not used. [Bug: 970]
-
- * generic/tkFocus.c (SetFocus): Changed so focus window is always
- set if -force is specified. This fixes the problem on Windows
- where Tk does not activate the window if it already has focus.
+2005-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * generic/tkConsole.c: Fixed so errors in console eval are
- reported properly. Eliminated duplicate result messages. [Bug: 973]
+ * 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.
- * win/tkWinWm.c: Changed so windows that aren't resizable don't
- have resize handles and the zoom box is disabled.
+2005-02-11 Jeff Hobbs <jeffh@ActiveState.com>
- * win/tkWinInt.h:
- * win/tkWinPointer.c: Changed to cancel the mouse timer when a
- user initiated move/resize loop begins.
+ * library/panedwindow.tcl (::tk::panedwindow::Cursor): check window
+ existence on delayed call. [Bug 949792]
- * unix/configure.in: TK_LD_SEARCH_FLAGS was set incorrectly if
- SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through
- the C compiler. Systems affected are Linux, MP-RAS and NEXTSTEP,
- but also with gcc on many more systems. [Bug: 908]
+ * doc/text.n: note 'image' key in 'dump' command. [Bug 1115907]
- * win/makefile.vc: First stab at install target. Fixed quoting so
- paths with spaces work.
+ * win/tkWinWm.c (TkWinGetIcon): fix toplevel retrieval for determining
+ icon ref (potential crash). [Bug 1105738]
- * tests/main.test:
- * tests/unixWm.test: Better cleanup of temporary files.
+ * generic/tkCanvBmap.c (ConfigureBitmap, ComputeBitmapBbox): Fixed
+ possible crash with disabled bmap and bbox handling [Bug 1119460]
+ (BitmapToPostscript): made aware of various bitmap types
- * mac/tkMacAppInit.c:
- * generic/tkTest.c:
- * generic/tkAppInit.c:
- * win/winMain.c: Changed some EXTERN declarations to extern
- since they are not defining exported interfaces. This avoids
- generating useless declspec() attributes and makes the windows
- makefile simpler.
+ * 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.
- * library/menu.tcl (tkMenuFind): Changed so keyboard shortcuts
- will only be found in the current toplevel. Previously, they
- might be found in menus attached to other toplevels that might not
- even be mapped. [Bug: 924]
+2005-02-09 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * generic/tkCanvLine.c: Changed to treat zero width lines like
- they have width 1 for purposes of selection. [Bug: 925]
+ * tests/wm.test: Convert to use more tcltest2 features.
- * win/tkWinFont.c (Tk_MeasureChars): Added a workaround for a bug
- in GetTextExtentExPoint on Win NT 4.0/Japanese. [Bug: 1006]
+2005-02-07 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * unix/tkUnixSend.c (Tk_SetAppName): Fixed uninitialized memory
- access bug. [Bug: 919]
+ * generic/tkCanvas.c (CanvasWidgetCmd): Fix stupid mistake in variable
+ names, reported by Andreas Leitgeb.
-1999-1-28 <stanton@GASPODE>
+2005-02-03 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
- * generic/tkGrid.c: Fixed bug in "grid forget" that failed to cancel
- pending idle handlers, resulting in a crash in a few odd cases.
+ * 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]
-1999-01-06 <lfb@JUSTICE>
+2005-01-31 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tk.h, generic/tkGet.c, generic/tkConfig.c,
- * generic/tkOldConfig.c, generic/tkEntry.c, generic/tkMenubutton.c,
- * generic/tkMenubutton.h, generic/tkScale.c, generic/tkScale.h,
- * generic/tkTextDisplay.c, generic/tkText.c, unix/tkUnixMenubu.c,
- * unix/tkUnixScale.c, mac/tkMacMenu.c, mac/tkMacMenubutton.c,
+ * unix/tcl.m4, unix/configure: add solaris-64 gcc build support. [Bug
+ 1021871]
- Removed global Tk_Uids dealing with "-state" configuration option
- and added new TK_CONFIG_STATE configSpec that doesn't use
- Tk_Uids.
+2005-01-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
-1998-12-11 === Tk 8.1b1 Release ===
+ * generic/tkImgPhoto.c (PhotoFormatThreadExitProc): Made the comments
+ in the code more relevant to the function they were documenting! [Bug
+ 1110553]
-1998-12-11 <stanton@GASPODE>
+ * library/msgs/es_ES.msg: Added more localization for Spanish Spanish.
+ [Bug 1111213]
- * generic/tkMain.c (Tk_Main): Fixed improper command line encoding
- handling.
+2005-01-25 Daniel Steffen <das@users.sourceforge.net>
-1998-12-08 <stanton@GASPODE>
+ * macosx/tkMacOSXInit.c (TkpInit): set tcl_interactive to 1 to show
+ console at startup instead of directly calling [console show].
- * win/tkWinClipboard.c (TkSelGetSelection, TkWinClipboardRender):
- Changed to handle multibyte characters properly. [Bug: 935]
+ * 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
-1998-12-07 <stanton@GASPODE>
+2005-01-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * library/xmfbox.tcl (tkMotifFDialog_Create): In the cached case,
- the data array was not being initialized with the correct set of
- widgets.
+ * 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>
-1998-12-4 <welch@SAGE>
+2005-01-13 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * Changed patchLevel to 8.1b1
+ * library/tkfbox.tcl (IconList_Selection, IconList_Create):
+ (IconList_Arrange): Assorted tk_getOpenFile fixes. [part of Bug 600313]
+ (IconList_ShiftMotion1): Also fix shift-drag.
- * generic/tkMenu.c (ConfigureMenuCloneEntries): The -menu configuration
- option was being incorrectly specified as just "menu".
+2005-01-12 Don Porter <dgp@users.sourceforge.net>
-1998-11-30 <stanton@GASPODE>
+ * unix/tcl.m4: Sync'ed to Tcl's copy.
+ * unix/configure: autoconf-2.57
- * generic/tkButton.c (ConfigureButton): The error result was
- getting lost when restoring configuration options. [Bug: 619]
+2005-01-12 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-1998-11-25 <stanton@GASPODE>
+ * doc/event.n: Added section on predefined virtual events. [Bug 608115]
- * unix/tkUnixFont.c (GetFontAttributes): Initialize an unspecified
- family to an empty string.
- (FontMapLoadPage): if the font included characters below 32, the
- index computation was incorrect because the range was shifted up
- to 32.
- (CreateClosestFont): check for empty locale as well as NULL.
+2005-01-11 Vince Darley <vincentdarley@users.sourceforge.net>
- * generic/tkFont.c (TkFontParseXLFD): initialize charset to
- iso8859-1 if no charset is specified.
+ * 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].
- * mac/tkMacHLEvents.c (OdocHandler): added conversion from
- external string to UTF [Bug: 869]
+2005-01-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
- * integrated tk8.0.4 changes.
+ * 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]
- * generic/tkBind.c: fixed deletion order bug where a crash would
- result if a binding deleted "."
+2005-01-10 Joe English <jenglish@users.sourceforge.net>
- * generic/tkMenu.c (MenuWidgetObjCmd): disabled menu entries were
- getting reenabled whenever the mouse passed over the entry [Bug: 860]
+ * 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.
- * unix/tkUnixMenu.c (TkpComputeStandardMenuGeometry): hidemargin
- option was not honored properly in menus [Bug: 859]
+2005-01-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-1998-11-24 <stanton@GASPODE>
+ * generic/tkWindow.c (GetScreen): Make sure the result is reset on all
+ error paths to stop strange errors. [Bug 697915]
- * tkMacMenu.c, tkUnixMenu.c, tkWinMenu.c, tkMenuDraw.c, tkMenu.h,
- * tkMenu.c: Backed out the previous fix for bug 620 and
- eliminated a bunch of code that created unnecessary objects.
- Changed back to using internal types instead of objects for many
- configuration options. There are many more fixes like this that
- could be made, but some require a little restructuring of the
- code. In any case the leaks are fixed and there is a lot less
- allocation happening. [Bug: 620]
+2005-01-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
-1998-11-19 <stanton@GASPODE>
+ * 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]
- * tkMenu.c (DestroyMenuEntry): fixed memory leaks [Bug: 620]
+2005-01-03 Jeff Hobbs <jeffh@ActiveState.com>
- * tkWinX.c (GetTranslatedKey): fixed bad code merge
+ * win/tkWinWm.c (TkWinWmCleanup): clean up layered window class. This
+ caused crash in reinit of Tk (as seen in plugin).
- * tkWinWm.c, tkWinMenu.c: fixed titles and menus so they properly
- display Unicode [Bug: 819]
+ ******************************************************************
+ *** CHANGELOG ENTRIES FOR 2004 AND 2003 IN "ChangeLog.2004" ***
+ *** CHANGELOG ENTRIES FOR 2002 AND EARLIER IN "ChangeLog.2002" ***
+ ******************************************************************
diff --git a/ChangeLog.2002 b/ChangeLog.2002
new file mode 100644
index 0000000..b523e7d
--- /dev/null
+++ b/ChangeLog.2002
@@ -0,0 +1,7877 @@
+2002-12-27 David Gravereaux <davygrvy@pobox.com>
+
+ * generic/tkText.h: ANSI unfriendly typedef for TkTextBTree
+ repaired for C++ compilers.
+
+2002-12-27 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c (WaitForEvent): process Map and Unmap events
+ as well as Configure events during WaitFor{Configure|Map}Notify.
+ Fixes [Bug 578569] (WaitForMapNotify could process Map and Unmap
+ events out of order, making Tk think a window was unmapped when
+ it really wasn't).
+
+2002-12-18 Todd M. Helfter <tmh@purdue.edu>
+
+ * doc/label.n: Fixed documentation of the -compound option to
+ the label widget. The option was simply missing from the
+ man page [Bug 577540]
+
+2002-12-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/photo.n: Fixed documentation of the put subcommand to no
+ longer talk about files and to mention that you can use colour
+ names for working with solid colours. [Bug 640026]
+
+2002-12-13 Don Porter <dgp@users.sf.net>
+
+ * generic/tkMain.c (Tk_Main): Call on Tcl*StartupScript*() routines
+ to store the startup script, if any. [Bug 616245].
+
+2002-12-10 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: tclThreadTest.obj not required to link
+ tktest.exe [Bug 651396]
+
+2002-12-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkEntry.c (ConfigureEntry): keep a flag to indicate when
+ a var is traced to prevent double-traces caused by configuring the
+ widget in traces with validation on. (dejong)
+
+2002-12-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkInt.decls: add TkWinSetHINSTANCE decl
+ * generic/tkIntPlatDecls.h: regen
+ * generic/tkStubInit.c: regen
+ * win/tkWinInit.c (TkpInit): While init and cleanup aren't correct
+ * win/tkWinX.c (TkWinXInit): in DllMain, we had to specify the
+ * win/tkWin32Dll.c (DllMain): true HINSTANCE or the resources of a
+ dynamic Tk weren't being loaded correctly. Created a new function
+ TkWinSetHINSTANCE for this purpose.
+
+2002-12-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinX.c (TkWinXInit): Move cleanup into an exit handler
+ * win/tkWin32Dll.c (DllMain): to ensure that it will be called
+ * win/tkWinWm.c (TkWinWmCleanup): without having to unload the dll.
+ Also reset the static int initialized on cleanup to allow reinit.
+
+2002-12-01 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/event.test (_keypress, _text_ind_to_x_y): Force focus to
+ widget in _keypress method to avoid problems with window managers
+ that use focus follows mouse. [Bug 526209]
+
+2002-12-01 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add wm-transient-6.3 to check that a transient
+ remains withdrawn when it is first withdrawn and then turned into
+ a transient.
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c: Replace WM_TRANSIENT_WITHDRAWN with WM_WITHDRAWN
+ and set this flag whenever a window is explicitly withdrawn. This
+ fixes the test case added above. [Bug 644356]
+
+2002-11-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/textDisp.test:
+ * generic/tkTextDisp.c (TkTextSeeCmd): handle see for unmapped
+ text displays. [Bug #641778]
+
+2002-11-19 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c (TkpDisplayScrollbar): If the
+ scrollbar width is set to 12 or less (but 12 is what you
+ should use) use the small metric scrollbar.
+
+ (UpdateControlValues): Fix thinko in setting off AUTO_ADJUST for
+ the place geometry manager.
+
+2002-11-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in: add macosx/*.tcl (buildTkConfig.tcl in
+ particular) to the dist target.
+
+2002-11-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkWindow.c (Tk_DestroyWindow, DeleteWindowsExitProc):
+ Add TkHalfdeadWindow type and halfdeadWindowList to keep track of
+ windows that were only partially deallocated before a call to
+ exit. Finish cleaning up these windows in DeleteWindowsExitProc.
+ Keep track of cleanup status in Tk_DestroyWindow so that a window
+ with a Destroy binding which calls exit will get fully destroyed.
+ * tests/window.test: Add Tk_DestroyWindow tests for an assortment
+ of half dead window cases. [Bug 630533]
+
+2002-11-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: fixed erroneous
+ removal of libtkstub before Wish was built.
+
+2002-11-07 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/unixWm.test: Add short delay to test unixWm-51.7
+ to account for raise/lower changes in TIP 107. This allows
+ the test case to pass under Window Maker on Linux.
+
+2002-11-07 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/place.test:
+ * generic/tkPlace.c: place info did not return all settings,
+ and didn't make sure the result was a proper list.
+ Put '-in' first in result to be more consistent with how
+ grid/pack info behaves. [Bug #635025][Bug #532022]
+
+2002-11-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: added macosx/README to dist target.
+ * macosx/Wish.pbproj/project.pbxproj: fix to 'wish' script
+ to allow it to work when not installed into '/'.
+
+2002-11-06 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/configure.in: Check that AR, RANLIB, and RC
+ are found on the path when building with gcc.
+
+2002-11-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added Wish linker flag
+ -headerpad_max_install_names to allow use of 'install_name_tool'.
+ fixed tkConfig.sh generation and redo_prebinding in the case where
+ Tk is not installed alongside Tcl.
+
+2002-11-03 David Gravereaux <davygrvy@pobox.com>
+
+ * win/winMain.c (Tcl_AppInit): Calls Registry_Init() and
+ Dde_Init() when STATIC_BUILD and TCL_USE_STATIC_PACKAGES macros
+ are set.
+
+ * win/makefile.vc: linkexten option now sets the
+ TCL_USE_STATIC_PACKAGES macro which also adds the registry and
+ dde static lib files to the link of the shell. [Patch 479697]
+
+ * win/rules.vc: Matches the one from Tcl.
+
+ * win/buildall.vc.bat: More useful commentary.
+
+2002-11-01 Andreas Kupries <andreask@activestate.com>
+
+ * win/makefile.vc (TCLREGLIBNAME): Updated to registry 1.1.
+
+2002-10-29 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/README: added info on new package searching in
+ Frameworks directories.
+
+2002-10-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4.1 TAGGED FOR RELEASE ***
+
+ * changes: updated for 8.4.1 release
+
+2002-10-21 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/README: revised according to Jim's suggestions
+ * macosx/tkMacOSXAppInit.c: use standard PATH_MAX from <limits.h>
+
+2002-10-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/winMain.c (WinMain, main): remove obsolete SetMessageQueue call
+
+ * win/configure: Regen.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): Check for bug in Cygwin version
+ of windres and work around that case by passing a POSIX path
+ instead of a Windows native path. One can't always pass a POSIX
+ path because the mingw native toolchain accepts only Windows
+ native paths. (dejong)
+
+ * win/tkWinPort.h: define OPEN_MAX only if not defined.
+ [Patch #625472] (howell)
+
+2002-10-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacAppInit.c: removed tcltest dependency.
+ [Bug #592639] (porter)
+
+2002-10-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/imgPhoto.test:
+ * generic/tkImgPhoto.c (ImgPhotoConfigureMaster): fix arg handling
+ for missing -format or -data options. [Bug #624974]
+
+ * tests/text.test: properly return the number of
+ * unix/tkUnixFont.c (ControlUtfProc): bytes consumed. [Bug #624732]
+
+2002-10-17 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/README: info specific to building and running
+ TclTk on Mac OS X, answers to tcl-mac list FAQs.
+ * macosx/Makefile: permission fix after embedded install.
+ * macosx/Wish.pbproj/project.pbxproj: after install, fix
+ permissions of uninstalled products.
+
+2002-10-17 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added TEXT document
+ type to plist so that files can be dragged onto Wish Shell.
+
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXFont.c: added private proc
+ TkMacOSXUseAntialiasedText() to enable/disable quickdraw
+ text antialiasing where available, default is enabled.
+ Added a linked boolean ::tk::mac::antialiasedtext with
+ write trace to allow control of antialiasing from tcl.
+
+2002-10-16 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXMenu.c: fix to accelerators shown in menus
+ with non-alphanumeric keys.
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXKeyboard.c: applied first patch from [Patch
+ #622582] to fix some of [Bug #616988]. Further work is needed
+ in this area, but this will let foreign keyboards at least work
+ reasonably with Tk.
+
+2002-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: add AIX-5 ppc build support. Remove unused
+ SC_ENABLE_MEMDEBUG.
+
+ * win/configure:
+ * win/tcl.m4: Add --enable-shared=mem support.
+
+2002-10-10 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/grid.test:
+ * generic/tkGrid.c: The grid size was not updated properly
+ when removing a widget from a grid. [Bug #621241] (forssen)
+
+2002-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/canvPs.test: tests for canvas embedded window ps generation
+ * generic/tkCanvWind.c (CanvasPsWindow): removed dead code loop.
+ * generic/tkCanvas.h: moved TkColormapData struct to tkCanvPs.c
+ * generic/tkCanvPs.c (TkImageGetColor): corrected bogus use of
+ TkColormapData on Windows (Windows now requires RGB pixel data
+ from image).
+ * win/tkWinImage.c (XGetImage, XGetImageZPixmap): added support
+ for generating ps for embedded widgets on canvases on Windows,
+ tested for 8, 16, 24 and 32-bit depths (XGetImageZPixmap not used).
+
+ * library/tk.tcl: simplified the adding of extra <ISO_Left_Tab>
+ and <hpBackTab> events to <<PrevWindow>>.
+
+2002-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/README: doc'ed --enable-symbols options.
+ * unix/Makefile.in: comment docs
+ * unix/configure: regen
+ * unix/tcl.m4: replaced SC_ENABLE_MEMDEBUG with a more intelligent
+ SC_ENABLE_SYMBOLS that takes yes|no|mem|all as options now.
+
+2002-10-09 Don Porter <dgp@users.sf.net>
+
+ * generic/tk.h: Added reminder comment to edit
+ macosx/Wish.pbproj/project.pbxproj when version number changes.
+
+2002-10-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: don't remove tclsh after building embedded.
+
+ * macosx/Wish.pbproj/project.pbxproj: bumped version to 8.4.1;
+ added missing library/mkpsenc.tcl to framework.
+
+2002-10-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkInt.decls(tkIntXlib): added XQueryTree declaration for
+ mac & aqua, since it's now called from ParentXId via Tk_HandleEvent.
+ * generic/tkIntXlibDecls.h:
+ * generic/tkStubInit.c: regen.
+ * mac/tkMacXStubs.c: added XQueryTree stub
+
+ * mac/tkMacEmbed.c (TkpUseWindow): check that container window
+ has -container option set (sync with other platforms).
+
+ * mac/tkMacBitmap.c:
+ * mac/tkMacFont.c:
+ * mac/tkMacSend.c:
+ * mac/tkMacTest.c:
+ * mac/tkMacWm.c: CONSTification.
+
+ * mac/tkMacProjects.sea.hqx: added tkStyle.c and tkUndo.c to
+ tk library projects.
+
+2002-10-09 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgPhoto.c (ImgPhotoSetSize): Only error-out if we
+ fail to allocate a non-empty buffer; getting a NULL when we
+ allocate an empty buffer is no problem since nothing will look at
+ the value anyway. [Bug 619544]
+ Also tidied up file to take into account the fact that we're using
+ 32 bits per pixel in the master to accommodate the alpha channel
+ as well as RGB.
+
+2002-10-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/winButton.test: add option clear to top to prevent option
+ leakage from other tests causing problems. [Bug #582382]
+
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): leave the
+ DestroyPanedWindow proc to free the pwPtr, add a Preserve
+ reference to the pwPtr->tkwin.
+ (DestroyPanedWindow): Release the pwPtr->tkwin.
+
+ * generic/tkFocus.c (TkFocusFilterEvent): Ignore event if we are
+ focusing into a dead window. [Bug #588831] (griffin)
+
+2002-10-02 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c (TkpDisplayScrollbar): Put the Tk scrollbar
+ pointer into the control reference data for the Mac scrollbar, so we
+ can get it out again in the ScrollbarActionProc.
+
+2002-10-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (TextBlinkProc): don't blink the cursor unless
+ it is visible. [Bug #616791] [Patch #614474] (bonfield)
+
+ * tests/entry.test: added entry-20.7
+ * generic/tkEntry.c (EntryTextVarProc): check if the entry is
+ being deleted before handling an associated textvariable.
+ [Bug #607390 #617446]
+
+2002-10-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/unixSelect.test (unixSelect-1.1[89]): Altered these tests
+ to work around [Bug #616923]
+ * unix/tkUnixSelect.c (SelRcvIncrProc,TkSelPropProc): It turns out
+ a much simpler and more robust solution is possible if we leverage
+ Tcl's encoding engine by using the same code path as for the
+ normal string selection. It might be a bit slower, but it should
+ be a lot more correct. [Bug #614650]
+
+2002-09-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/panedwindow.test: added panedwindow-28.[12]
+ * generic/tkPanedWindow.c (PanedWindowCmdDeletedProc):
+ (Tk_PanedWindowObjCmd): when destroying the panedwindow, destroy
+ the proxy before the parent to avoid dependency conflicts.
+ [Bug #616589]
+
+2002-09-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/unixSelect.test: Test for various things that can fail to
+ work in 8.4.0...
+ * unix/tkUnixSelect.c (TkSelPropProc,SelRcvIncrProc): Incremental
+ transfers of UTF8_STRING selections should now work; Tk will now
+ tag them with the right size and only transfer complete UTF8
+ characters. Previously, things only worked when the transfer
+ could only happen in one go, and even then not always. [Bug 614650]
+
+ * doc/bind.n: Doc-fix to mention that %A substitutes UNICODE
+ characters rather than ASCII ones. Tk's done this ever since 8.1
+ in any case; after all, it is the right thing to do.
+
+2002-09-27 Don Porter <dgp@users.sf.net>
+
+ * README: Bumped to version 8.4.1 to avoid confusion
+ * generic/tk.h: of CVS snapshots with release 8.4.0.
+ * unix/README:
+ * unix/configure.in:
+ * unix/tk.spec
+ * win/configure.in:
+
+ * unix/configure: autoconf
+ * win/configure:
+
+2002-09-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen.
+ * unix/tcl.m4: improve AIX-4/5 64bit compilation support.
+
+ * unix/Makefile.in: add macosx subdir to dist target.
+ Do not generate .Z, only .gz and .zip in alldist target.
+
+2002-09-18 Mumit Khan <khan@nanotech.wisc.edu>
+
+ Added basic Cygwin support.
+
+ * win/tcl.m4 (SC_PATH_TCLCONFIG): Support one-tree build.
+ (SC_PATH_TKCONFIG): Likewise.
+ (SC_PROG_TCLSH): Likewise.
+ (SC_CONFIG_CFLAGS): Assume real Cygwin port and remove -mno-cygwin
+ flags. Add -mwin32 to extra_cflags and extra_ldflags.
+ Remove ``-e _WinMain@16'' from LDFLAGS_WINDOW.
+ * win/configure: Regenerate.
+
+ * win/tkWinPort.h (tchar.h): Do not include on Cygwin.
+ (_T): Define for Cygwin.
+ * win/winMain.c (main): Conditionally define.
+
+2002-09-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: preserve environment value of INSTALL_ROOT.
+ When embedding only use deployment build. Force relink before
+ embedded build to ensure new linker flags are picked up.
+
+ * macosx/buildTkConfig.tcl (new):
+ * macosx/Wish.pbproj/project.pbxproj: synthesize tkConfig.sh
+ based on tclConfig.sh in Tcl.framework and tkConfig.sh.in.
+ Add symbolic links to debug lib, stub libs and tkConfig.sh
+ in framework toplevel. Made tkIntXlibDecls.h a public header
+ since Headers/X11/Xlib.h includes it. Install wish8.4 script
+ that runs "Wish Shell.app" and corresponding wish link.
+ Use tcl headers from built Tcl.framework instead of from tcl
+ source directory.
+
+ * macosx/tkMacOSXPort.h: added missing standard unix includes
+ and defines, similarly to tkUnixPort.h.
+ * macosx/tkMacOSXNotify.c: removed dependency on internal tcl
+ header "tclPort.h"
+
+ * unix/Makefile.in:
+ * unix/install-sh: copied support for 'install-strip' target
+ over from tcl/unix/{Makefile.in,install-sh}
+
+2002-09-22 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c (UpdateControlValue): HiliteControl
+ doesn't give the proper "nothing to scroll" look on Mac OS X.
+ You have to set the min value greater than the max value to
+ get this.
+
+2002-09-15 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+ * unix/tkUnixEvent.c (TkpCloseDisplay): Use PEEK_XCLOSEIM
+ to examine the input context queue before invoking
+ XCloseIM. Generate an assert if there is an input
+ context that has not been freed.
+ [Patch 570902]
+
+2002-09-13 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * generic/tk.h: Moved RC_INVOKED down so that tcl.h is still
+ included when running the resource compiler. <tcl.h> excludes the
+ unnecessary parts on its own. This reenables the Windows build. It
+ failed because the non-inclusion of tcl.h caused the resource
+ compiler to miss some vital macro definitions (TCL_FINAL_RELEASE,
+ STRINGIFY, ...).
+
+2002-09-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tk.h:
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r:
+ * mac/tkMacResource.r:
+ * macosx/tkAboutDlg.r:
+ * macosx/tkMacOSXApplication.r:
+ * macosx/tkMacOSXLibrary.r:
+ * macosx/tkMacOSXResource.r: unified use of the two equivalent
+ resource compiler header inclusion defines RC_INVOKED and
+ RESOURCE_INCLUDED, now use RC_INVOKED throughout.
+
+ * macosx/tkMacOSXAppInit.c: improved detection of Wish startup
+ by the finder (by checking if stdin is /dev/null), in which
+ case we want to bring up the Tk console window.
+
+ * macosx/tkMacOSXHLEvents.c: added 'rapp' apple event handler.
+
+2002-09-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: reference & install
+ tk/generic/prolog.ps instead of tk/library/prolog.ps.
+
+2002-09-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added backwards
+ compatibility for OSX 10.1 ProjectBuilder 2.0.
+
+2002-09-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: added DYLIB_INSTALL_DIR variable for Darwin
+ and set it to default value ${LIB_RUNTIME_DIR}
+ * unix/tcl.m4 (Darwin): use DYLIB_INSTALL_DIR instead of
+ LIB_RUNTIME_DIR in the -install_name argument to ld.
+ * unix/configure: regen.
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Makefile: added support for building Tcl as an embedded
+ framework, i.e. using an dyld install_name containing
+ @executable_path/../Frameworks via the new DYLIB_INSTALL_DIR
+ unix/Makefile variable.
+
+2002-09-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4.0 TAGGED FOR RELEASE ***
+
+2002-09-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXNotify.c (Tk_MacOSXSetupTkNotifier): corrected
+ Mac Jaguar event loop issue.
+
+ * library/tk.tcl: use command instead of control on Aqua bindings.
+ Force dialogs to appear below fixed native Mac menubar.
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXKeyboard.c: Keypress/release events for pure
+ modifier keys were not being passed to Tk.
+ Deadkey presses were inserting null characters into text windows.
+ Now they do nothing. (Still not ideal, but better than before!)
+ * macosx/tkMacOSXMenu.c: Allow more than 200 menus to exist -
+ increased to 2000.
+ * macosx/tkMacOSXMouseEvent.c: Bad interactions between floating
+ windows and ordinary ones. Ensure that local<->global coordinate
+ transformations are wrt to the correct window.
+ * macosx/tkMacOSXWm.c: Better error msg for 'wm attributes'.
+ Remove crash in 'wm transient'.
+ Add 'noActivates' and 'noUpdates' flags to unsupported command.
+ [Patch #606658] (darley)
+
+ * library/xmfbox.tcl (::tk::MotifFDialog_ActivateSEnt): corrected
+ msgcat code with XPG specifier. [Patch #606719] (miller)
+
+2002-09-06 Don Porter <dgp@users.sf.net>
+
+ * tests/unixWm.test (unixWm-50.3): Constrained test that hangs
+ on Windows.
+
+2002-09-05 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added overlooked missing
+ TK_PATCH_LEVEL version bump to 8.4.0.
+
+2002-09-04 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/Makefile.in (install-libraries): Added code section to
+ install the message catalogs. Copied same section from
+ unix/Makefile.in and adapted it to the slightly different
+ environment.
+
+2002-09-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl: further restrict buttons to not resetting
+ the "original" relief if it has changed in the interim. This
+ prevents code that simulated overrelief buttons from not working
+ in 8.4. [Bug #604270]
+
+2002-09-03 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: Bumped version number to
+ 8.4.0 and updated copyright info.
+
+2002-09-03 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c: fix to 'wm attributes' error-handling bug.
+
+2002-09-03 Don Porter <dgp@users.sf.net>
+
+ * changes: Updated for 8.4.0 release
+
+2002-09-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/cursor.test: reverted 2002-08-31 change for OS X to use
+ 'heart' cursor because 'arrow' on windows has a pre-skewed use
+ count. [Bug #602667]
+
+ * tests/button.test: added button-14.1
+ * win/tkWinButton.c (TkpComputeButtonGeometry): correct Win button
+ sizing to be equal for one-line buttons with -height of 0 or 1, as
+ well as -height 0 buttons with empty text and no image, which
+ should be the same as single-line text buttons. [Bug #565485]
+
+ * library/button.tcl (::tk::ButtonLeave): correctly restore state
+ of button to normal for unix bindings. [Bug #597920]
+
+ * doc/tk.n: added tk windowingsystem docs.
+
+ * tests/wm.test:
+ * unix/tkUnixWm.c: remove possible 2-second delay in 'raise'.
+ [Patch #601518] (english) TIP #107
+
+ * unix/tcl.m4: add support for 64-bit builds on HP-11 with gcc.
+ * unix/configure.in: make sure to substitute LD_LIBRARY_PATH_VAR.
+ * unix/configure: regend
+
+ * README: Bumped version number to 8.4.0
+ * generic/tk.h:
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure:
+ * win/configure.in:
+
+ * generic/tkCmds.c:
+ * generic/tkWindow.c: made 'tk' available in safe interpreters,
+ but only the caret and windowingsystem subcommands may be called.
+ * tests/safe.test (safe-1.2): noted that tk is now available in
+ safe interps, but not the appname/scaling subcommands.
+
+ * tests/tk.test (tk-1.2): noted new tk windowingsystem subcommand
+
+2002-08-31 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: update from Tcl
+
+ * unix/Makefile.in: import of TK_SHLIB_LD_EXTRAS for Tk library
+ specific linker settings. Added use of new LD_LIBRARY_PATH_VAR.
+
+ * unix/configure: regen
+
+2002-08-31 Daniel Steffen <das@users.sourceforge.net>
+
+ *** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***
+
+ * generic/tk.decls:
+ * generic/tkInt.decls: added new "aqua" specific entries to the
+ stubs tables. Changed all "unix" entries to "x11" to allow us to
+ distinguish and build both "aqua" on MacOSX and "x11" on MacOSX.
+
+ * generic/tk.h: added a #ifnded RESOURCE_INCLUDED so that tk.h can
+ be passed to the resource compiler.
+
+ * generic/tkCmds.c (Tk_TkObjCmd): added [tk windowingsystem]
+ subcommand: returns "x11" when running on X11, "win32" on Windows,
+ "classic" on MacOS9 and "aqua" on MacOSX Aqua (i.e. Carbon)
+
+ * generic/tkFont.c (TkFontGetFirstTextLayout): new private function
+ returning the first chunk of a Tk_TextLayout, i.e. until the first
+ font change on the first line (or the whole first line if there is
+ no such font change).
+
+ * generic/tkMain.c: made Tcl_ThreadDataKey static
+
+ * library/demos/puzzle.tcl: fixed button metrics for aqua
+
+ * tests/cursor.test: check for presence of arrow cursor instead of
+ heart cursor
+
+ * xlib/xcolors.c: changed xColors static initialization to more
+ standard C
+
+ * macosx/Wish.pbproj/jingham.pbxuser (new):
+ * macosx/Wish.pbproj/project.pbxproj (new): project for Apple's
+ ProjectBuilder IDE.
+
+ * macosx/Makefile (new): simple makefile for building the project
+ from the command line via the ProjectBuilder tool 'pbxbuild'.
+
+ * macosx/tkMacOSXAppInit.c (new): macosx specific AppInit looking
+ for a AppMain.tcl file in its bundled Resources/Scripts folder. If
+ present, argv[1] is set to that file and the Scripts folder is
+ added to the auto_path. This allows tk apps to embed scripts within
+ their bundle directory structure.
+
+ * macosx/tkMacOSXInit.c (new): macosx adapted version of
+ tkUnixInit.c: we initialize & cache the Carbon native encoding
+ (e.g. 'macRoman') and try to find the tk script library files
+ inside Tk packaged as a framework.
+
+ * macosx/tkMacOSXNotify.c (new): new macosx specific merged
+ Carbon/select-based notifier.
+
+ * macosx/tkMacOSXEvent.c (new):
+ * macosx/tkMacOSXEvent.h (new):
+ * macosx/tkMacOSXKeyEvent.c (new):
+ * macosx/tkMacOSXMouseEvent.c (new):
+ * macosx/tkMacOSXWindowEvent.c (new): new macosx specific event
+ handling functionality.
+
+ * macosx/tkMacOSX.h (new):
+ * macosx/tkMacOSXBitmap.c (new):
+ * macosx/tkMacOSXButton.c (new):
+ * macosx/tkMacOSXClipboard.c (new):
+ * macosx/tkMacOSXColor.c (new):
+ * macosx/tkMacOSXConfig.c (new):
+ * macosx/tkMacOSXCursor.c (new):
+ * macosx/tkMacOSXDefault.h (new):
+ * macosx/tkMacOSXDialog.c (new):
+ * macosx/tkMacOSXDraw.c (new):
+ * macosx/tkMacOSXEmbed.c (new):
+ * macosx/tkMacOSXFont.c (new):
+ * macosx/tkMacOSXHLEvents.c (new):
+ * macosx/tkMacOSXInt.h (new):
+ * macosx/tkMacOSXKeyboard.c (new):
+ * macosx/tkMacOSXMenu.c (new):
+ * macosx/tkMacOSXMenubutton.c (new):
+ * macosx/tkMacOSXMenus.c (new):
+ * macosx/tkMacOSXPort.h (new):
+ * macosx/tkMacOSXRegion.c (new):
+ * macosx/tkMacOSXScale.c (new):
+ * macosx/tkMacOSXScrlbr.c (new):
+ * macosx/tkMacOSXSubwindows.c (new):
+ * macosx/tkMacOSXTest.c (new):
+ * macosx/tkMacOSXUtil.c (new):
+ * macosx/tkMacOSXUtil.h (new):
+ * macosx/tkMacOSXWm.c (new):
+ * macosx/tkMacOSXWm.h (new):
+ * macosx/tkMacOSXXStubs.c (new): macosx ports of classic mac Tk
+ implementation in tk/mac.
+
+ * macosx/tkMacOSXSend.c (new): only send to local interp
+ implemented currently.
+
+ * macosx/tkMacOSXDebug.h (new):
+ * macosx/tkMacOSXDebug.c (new): new macosx specific functions for
+ debugging MacOS events, regions, etc.
+
+ * macosx/tkAboutDlg.r (new):
+ * macosx/tkMacOSXApplication.r (new):
+ * macosx/tkMacOSXCursors.r (new):
+ * macosx/tkMacOSXLibrary.r (new):
+ * macosx/tkMacOSXMenu.r (new):
+ * macosx/tkMacOSXResource.r (new):
+ * macosx/tkMacOSXXCursors.r (new):
+ * macosx/tclets.r (new): sources for Rez resource compiler.
+
+ * macosx/Wish.icns (new): Wish application icon.
+
+ * generic/tk.h:
+ * generic/default.h:
+ * generic/tkBind.c:
+ * generic/tkCmds.c:
+ * generic/tkGrab.c:
+ * generic/tkPointer.c:
+ * generic/tkPort.h:
+ * generic/tkSelect.c:
+ * generic/tkStubLib.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkWindow.c:
+ * unix/tkUnix3d.c:
+ * xlib/xgc.c:
+ * xlib/X11/X.h:
+ * xlib/X11/Xlib.h:
+ * xlib/X11/Xutil.h: added #includes and #ifdefs for macosx
+
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/demos/menu.tcl:
+ * library/demos/menubu.tcl:
+ * library/demos/widget: check [tk windowingsystem] instead of
+ and/or in addition to $tcl_platform(platform).
+
+ * generic/tkInt.h:
+ * mac/tkMacBitmap.c:
+ * mac/tkMacWm.c: added missing CONSTification
+
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c: regen
+
+2002-08-27 D. Richard Hipp <drh@hwaci.com>
+
+ * doc/checkbutton.n: [Bug 582457] Fix the -offrelief option so
+ * doc/radiobutton.n: that when -offrelief is flat and -relief is
+ * mac/tkMacButton.c: sunken and -overrelief is raised, buttons
+ * unix/tkUnixButton.c: work look toolbar buttons under Windows.
+ * win/tkWinButton.c: See also: TIP #82.
+
+2002-08-26 Don Porter <dgp@users.sf.net>
+
+ * win/Makefile.in: Removed dependence on the (parts of) the
+ * win/winMain.c: tcltest executable on Windows. It was not
+ used, and the dependency complicated the Makefile. [Bug 592638].
+
+2002-08-20 Don Porter <dgp@users.sf.net>
+
+ * README: Bumped version number to 8.4b3 to distinguish
+ * generic/tk.h: HEAD from the 8.4b2 release.
+ * unix/configure.in:
+ * win/configure.in:
+ * unix/tk.spec:
+
+ * unix/configure: autoconf
+ * win/configure:
+
+ * generic/tk.h: Added compile-time check that the tcl.h header file
+ #included by Tk 8.4 is one from Tcl 8.4. This is needed to be sure
+ that new #defines like CONST84 are available. [Bug 597432].
+
+2002-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (install-binaries): simplified pkgIndex.tcl
+ file created on installation.
+ * win/Makefile.in (install-binaries): corrected and simplified
+ creation of pkgIndex.tcl file on installation.
+
+2002-08-14 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinDialog.c:
+ * win/makefile.vc: broken compilation and link from changes
+ Hobbs-08-07 fixed.
+ * win/tkWinTest.c: CONST problem resolved.
+
+2002-08-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl: change the bindings to use Priv($w,relief)
+ instead of just Priv(relief). This ensures that neighboring
+ buttons don't confuse (over)relief settings.
+
+2002-08-13 Reinhard Max <max@suse.de>
+
+ * unix/tkUnixSend.c (Tk_SetAppName): Fixed a compiler warning.
+
+2002-08-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl: Tweaked the behaviour of the directory
+ box on resize, as resizing of the overall window tends to be
+ common given the sample images.
+
+2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/tkUnixWm.c (WmTransientCmd): Apply fix for
+ wm transient assertion error that was applied
+ to tkWinWm.c for Tk Bug #592201.
+
+2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add deleteWindows at start of
+ new transient tests so they do not fail if the
+ toplevels already exist.
+ * unix/tkUnixWm.c: Revert patch for Tk Bug #592201
+ which incorrectly removed numTransients member.
+
+2002-08-08 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c:
+ * tests/wm.test: Fix for Tk Bug #592201 "wm transient fails with
+ two masters"; fixes panic after a transient window is reassigned
+ to new master and either master is subsequently destroyed.
+
+2002-08-08 Don Porter <dgp@users.sf.net>
+
+ * tests/unixWm.test: Corrected packaging of unixWm-50.3 so that
+ [setupbg] and [cleanupbg] always balance, no matter what tests
+ are skipped.
+
+2002-08-08 Reinhard Max <max@suse.de>
+
+ * unix/Makefile.in: Fixed typos in DISTNAME, and ZIPNAME.
+
+2002-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4b2 TAGGED FOR RELEASE ***
+
+ * generic/tkButton.c (TkButtonWorldChanged): added GCFont handling
+ to the disabledGc of buttons when compound != none. The drawing
+ appears to be incorrect across platforms still. [Bug #477740]
+
+ * generic/tkImgGIF.c (FileReadGIF): fixed -from handling for gifs
+ [Bug #467524] (obermeier)
+
+2002-08-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCanvUtil.c (TkSmoothParseProc): recognize the built-in
+ bezier method by name. [Bug #578654]
+ * doc/canvas.n: update to note that -smooth really doesn't take
+ or return just booleans.
+
+ * win/tkWinMenu.c (TkpSetWindowMenuBar): fixed logic bug in when
+ to idle call ReconfigureWindowsMenu.
+
+ * doc/GetBitmap.3: removed doc refs to deprecated
+ Tk_GetBitmapFromData. [Bug #590379]
+
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd):
+ * library/panedwindow.tcl: changed class from PanedWindow to
+ Panedwindow to not conflict with existing bwidgets, but also to be
+ more regular with other names used in the core.
+
+ * tests/panedwindow.test: added -text foobar to some test buttons
+ to enable correct testing of panedwindow across platforms.
+ [Bug #582370]
+
+ * win/tkWinDialog.c: enabled use of the updated native Windows
+ directory browser (tk_chooseDirectory). This does require
+ shell32.dll v4.71 or greater. [Patch #468139]
+
+ * win/configure:
+ * win/tcl.m4: added shell32 to libs for updated native Windows
+ tk_chooseDirectory dialog.
+
+2002-08-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (RESIZE_PENDING): Separated out flag for
+ indicating that a resize needs to be issued.
+ (PanedWindowReqProc): Do the old behaviour when the panedwindow is
+ not mapped; easiest way of making the test suite pass while still
+ preserving improved behaviour in the face of children whose size
+ is not known immediately.
+
+2002-08-06 Don Porter <dgp@users.sf.net>
+
+ * tests/defs.tcl: removed file. No longer needed now that Tk is
+ using the tcltest package to do its testing.
+
+2002-08-05 Don Porter <dgp@users.sf.net>
+
+ * win/tkWinFont.c: Additional changes to fix CONST warnings on
+ * win/tkWinWM.c: Windows due to latest patch. Tks Vince Darley.
+
+ * doc/3DBorder.3: Applied companion patch for Tcl Patch 585105,
+ * doc/BindTable.3: updating Tk to use Tcl 8.4's fully CONST-ified
+ * doc/ConfigWidg.3: interface, and fully CONSTifying Tk at the
+ * doc/CrtImgType.3: same time.
+ * doc/CrtWindow.3:
+ * doc/DeleteImg.3: This patch includes purging Tk of its last
+ * doc/FindPhoto.3: direct access to interp->result. [Bug 589853]
+ * doc/GetAnchor.3:
+ * doc/GetBitmap.3: The substantial changes include copying
+ * doc/GetCapStyl.3: event sequence strings into Tcl_DStrings
+ * doc/GetClrmap.3: in tkBind.c, and copying [text] indices into
+ * doc/GetColor.3: Tcl_DStrings because parsing them involved
+ * doc/GetCursor.3: overwriting them. If this causes performance
+ * doc/GetFont.3: trouble, that can be resolved by further
+ * doc/GetImage.3: converting them to Tcl_Obj's.
+ * doc/GetJoinStl.3:
+ * doc/GetJustify.3: The #defines USE_NON_CONST and USE_COMPAT_CONST
+ * doc/GetOption.3: have the same effect for Tk as they do for Tcl.
+ * doc/GetRelief.3: (They actually change tcl.h)
+ * doc/GetScroll.3:
+ * doc/GetVisual.3:
+ * doc/InternAtom.3:
+ * doc/NameOfImg.3:
+ * doc/SetAppName.3:
+ * doc/WindowId.3:
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tk3d.c:
+ * generic/tkAtom.c:
+ * generic/tkBind.c:
+ * generic/tkBitmap.c:
+ * generic/tkButton.c:
+ * generic/tkCanvArc.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvPs.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvUtil.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCanvas.c:
+ * generic/tkCanvas.h:
+ * generic/tkClipboard.c:
+ * generic/tkCmds.c:
+ * generic/tkColor.c:
+ * generic/tkConfig.c:
+ * generic/tkConsole.c:
+ * generic/tkCursor.c:
+ * generic/tkDecls.h:
+ * generic/tkEntry.c:
+ * generic/tkFont.c:
+ * generic/tkFrame.c:
+ * generic/tkGet.c:
+ * generic/tkGrid.c:
+ * generic/tkImage.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkInt.decls:
+ * generic/tkInt.h:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkListbox.c:
+ * generic/tkMenu.c:
+ * generic/tkMenubutton.c:
+ * generic/tkMessage.c:
+ * generic/tkOldConfig.c:
+ * generic/tkOption.c:
+ * generic/tkRectOval.c:
+ * generic/tkScale.c:
+ * generic/tkScrollbar.c:
+ * generic/tkSelect.c:
+ * generic/tkStyle.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextIndex.c:
+ * generic/tkTextMark.c:
+ * generic/tkTextTag.c:
+ * generic/tkTextWind.c:
+ * generic/tkUtil.c:
+ * generic/tkVisual.c:
+ * generic/tkWindow.c:
+ * mac/tkMacConfig.c:
+ * mac/tkMacCursor.c:
+ * mac/tkMacEmbed.c:
+ * mac/tkMacSend.c:
+ * unix/tkUnixConfig.c:
+ * unix/tkUnixCursor.c:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixSelect.c:
+ * unix/tkUnixSend.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinConfig.c:
+ * win/tkWinCursor.c:
+ * win/tkWinEmbed.c:
+ * win/tkWinMenu.c:
+ * win/tkWinSend.c:
+
+2002-08-02 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (DestroyPanedWindow): Idle calls need to
+ be deleted on destruction of the window, or things can *really* go
+ pear-shaped.
+
+2002-07-31 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (PanedWindowReqProc): Postpone pane
+ arrangement until idle, as is done in other window managers, to
+ fix problems with size calculations when the children don't
+ already know their sizes anyway.
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-07-29 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Remove code that was setting
+ CC_SEARCH_FLAGS and LD_SEARCH_FLAGS to try to
+ account for cc vs ld linking. Tcl now handles this.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-07-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Add MAJOR_VERSION, MINOR_VERSION,
+ PATCH_LEVEL, INSTALL_LIBRARY, STUB_LIB_FILE, and LIB_FILE
+ to support changes in tcl.m4 related to library builds.
+ Use MAKE_LIB macro to avoid dealing with RANLIB issues.
+ Rename TK_CC_SEARCH_FLAGS to CC_SEARCH_FLAGS and
+ rename TK_LD_SEARCH_FLAGS to LD_SEARCH_FLAGS.
+ Use new INSTALL_LIB and INSTALL_STUB_LIB substs to
+ deal with ranlib issues when install libraries.
+ * unix/configure: Regen.
+ * unix/configure.in: Remove AC_PROG_RANLIB since
+ this is done by tcl.m4 now. Define CC_SEARCH_FLAGS
+ instead of TK_CC_SEARCH_FLAGS and so on.
+ Use MAKE_LIB and MAKE_STUB_LIB from tcl.m4.
+ Remove AC_SUBST calls that are no done in tcl.m4.
+ * unix/tcl.m4: Update from Tcl.
+ * unix/tkConfig.sh.in: Subst CC_SEARCH_FLAGS and
+ LD_SEARCH_FLAGS.
+
+2002-07-25 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * mac/tkMacWm.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c:
+ * tests/wm.test:
+ * tests/winWm.test:
+ * tests/unixWm.test: Objectifed wm. [Patch #564521]
+ Note: At this point the Mac file is completely untested
+ and may not even compile.
+
+2002-07-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/spinbox.test: added spinbox-22.[1-3]
+ * generic/tkEntry.c (ConfigureEntry): made the textvariable value
+ take precedence over changed -from/-to values, unless it must be
+ constrained. [Bug #559078]
+
+ * library/spinbox.tcl (MouseSelect): when not in the entry, just
+ return instead of invoking - ButtonUp handles invoking already.
+ [Bug #499168]
+
+ * library/tk.tcl (RestoreFocusGrab): handle the case where the
+ FocusGrab info is not set. [Bug #553283]
+
+2002-07-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/canvas.test: added canvas-14.[1-6]
+ * generic/tkCanvas.c (CanvasWidgetCmd): corrected handling of
+ 'scan' subcommand args. Also removed early return cases to goto
+ done instead where the canvasPtr would be Tcl_Release'd. This may
+ solve other problems with unreleased canvasPtr's. [Bug #581560]
+
+ * win/tkWinButton.c (TkpDisplayButton): corrected display of focus
+ ring around the actual text when the button is a compound button.
+ [Bug #583691]
+
+ * unix/README: Corrected notes about running user interactive Tk
+ tests. [Bug #462320]
+
+ * generic/tkText.c (TextEditUndo): set isDirtyIncrement to -1 when
+ reverting to note proper "dirtiness". [Bug #580362] (callewaert)
+
+ * generic/tkEntry.c (DisplayEntry): correct cursor position before
+ calling Tk_SetCaretPos. (yamamoto)
+
+2002-07-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-07-22 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::file::chooseDir):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog):
+ Revert [Tk patch 568278]. The transient window workaround
+ is no longer needed since the fix for [Tk bug 570764]
+ solved the problem for withdrawn transients.
+
+2002-07-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/configure.in:
+ * win/configure:
+ * win/configure.in: Add AC_PREREQ(2.13) in an attempt
+ to make it more clear that the configure scripts
+ must be generated with autoconf version 2.13.
+ [Tcl Bug 583573]
+
+2002-07-19 D. Richard Hipp <drh@hwaci.com>
+
+ * library/mkpsec.tcl: Fix a bug that was causing postscript generation
+ to fail under Win2K.
+
+2002-07-18 Reinhard Max <max@suse.de>
+
+ * unix/tkUnixSend.c: Using Tcl_GetTime instead of TclpGetTime.
+
+2002-07-17 Reinhard Max <max@suse.de>
+
+ * library/unsupported.tcl: Extended ExposePrivateVariable, and
+ ExposePrivateCommand to accept patterns as well.
+
+2002-07-17 Don Porter <dgp@users.sf.net>
+
+ * generic/tkFont.c: Corrected reversed logic in assert -> panic
+ conversion. [Bug 582799]
+
+2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkFont.c (TkFontPkgFree): Call panic instead
+ of assert since assert is not used in the rest of Tk.
+ [Tk bug 579651]
+
+2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add a more descriptive warning
+ in the event `make genstubs` needs to be rerun.
+
+2002-07-16 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinWm.c:
+ * doc/wm.n: fix for part of [Bug 581627], and made iconbitmap
+ code on Windows more flexible about reading in icons [Bug
+ 220800].
+
+2002-07-15 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.bc (new): re-add of the borland makefile. Submitted
+ by Helmut Giese <hgiese@ratiosoft.com>. This needs testing, still.
+
+2002-07-15 Don Porter <dgp@users.sf.net>
+
+ * Fixes for [Bug 581627, 581795].
+ * generic/tkTest.c: Test commands not supported on non-Unix
+ platforms should not be defined there in the first place.
+ * tests/constraints.tcl: Fixed "secureserver" constraint.
+ * tests/unixWm.test: Some tests needed "unix" constraint.
+ * win/tkWinWm.c: Typo in error message.
+
+2002-07-14 Don Porter <dgp@users.sf.net>
+
+ * tests/event.test: Fixes to enable testing of only userInteraction
+ * tests/visual_bb.test: tests.
+
+ * README: Bumped HEAD to version 8.4b2 in order to
+ * generic/tk.h: distinguish it from the 8.4b1 release.
+ * unix/configure*: Also extended LOCALES to cover all message
+ * unix/tk.spec: catalogs.
+ * win/configure*:
+
+ * tests/focustTcl.test: Conversion bug: Corrected backwards logic.
+ * tests/imgPhoto.test: Conversion bug: overwrote unix/README.
+
+ * tests/all.tcl: Completed conversion of Tk test suite
+ * tests/constraints.tcl: to use tcltest.
+ * tests/[b-v]*.test:
+ * unix/Makefile.in:
+
+2002-07-12 Don Porter <dgp@users.sf.net>
+
+ * tests/constraints.tcl: Converted more files to tcltest and
+ * tests/[g-x]*.test: factored out common code.
+
+2002-07-11 Don Porter <dgp@users.sf.net>
+
+ * tests/canvPsImg.tcl: Converted several files in the
+ * tests/constraints.tcl (new file): Tk test suite for testing by
+ * tests/[r-x]*.test: tcltest 2.1.
+ * unix/Makefile.in:
+
+2002-07-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): initialize
+ utfTitle to NULL, add a few more notes about limitations of
+ possible new Tk_ChooseDirectoryObjCmd function.
+
+2002-07-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/imgPhoto.test (imgPhoto-15.1): Added test of mem-alloc
+ failure, but this is non-portable.
+ * generic/tkImgPhoto.c (ImgPhotoSetSize): Allowed this function to
+ fail when it can't allocate enough memory. Note that not all the
+ places that call it can fail nicely without API changes; some
+ still panic but at least some of the potential failures are now
+ handled gracefully.
+
+ * tests/visual_bb.test (lpr): Stopped this from relying on
+ external files; direct piping is much more flexible for this
+ application.
+
+2002-07-09 Don Porter <dgp@users.sf.net>
+
+ * generic/tkTest.c: Removed unused dependence on TclThread_Init()
+ * tests/defs.tcl: and [testthread]. [Bug 578165, Tcl Bug 531413]
+
+2002-07-08 David Gravereaux <davygrvy@pobox.com>
+
+ * unix/Makefile.in: Added missing win/lamp.bmp to the dist
+ target.
+
+2002-07-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4b1 TAGGED FOR RELEASE ***
+
+2002-07-04 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/bgerror.tcl (bgerror): Stopped the bgerror dialog from
+ getting wider than the screen; in theory really long messages
+ could make it become taller than the screen now, but that's much
+ less likely to happen. Also trimmed a little bit of internal
+ space so that the icon-message gap is the same as the icon-frame
+ and message-frame gaps.
+
+2002-07-01 Don Porter <dgp@users.sf.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Updated to latest tcl.m4 from Tcl.
+
+2002-06-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/msgbox.tcl (MessageBox): Force all non-button widgets to
+ have the same background as the containing toplevel. [Bug #552515]
+
+2002-06-27 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/Makefile.in (install-binaries): Fix of troubled Makefile
+ quoting introduced by [Patch 521356] causing the installed to
+ fail.
+
+2002-06-25 Don Porter <dgp@users.sf.net>
+
+ * unix/tkUnixFont.c: (Tk_DrawChars) silence compiler warning.
+
+2002-06-26 David Gravereaux <davygrvy@pobox.com>
+
+ * generic/tkStyle.c: <eol> of the committing cvs client didn't
+ match the <eol> of the file itself. Windows users where getting
+ \r\r\n. Problem fixed.
+
+2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * generic/tkFont.c (TkTextLayoutToPostscript): fixed potential
+ buffer overflow which could be intentionally triggered from
+ within safe interpreter -- malicious applet could modify
+ tk::psglyphs array.
+
+2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * tests/font.test (font-32.1): updated this test
+ to expect the new behavior of canvas postscript.
+
+2002-06-25 Don Porter <dgp@users.sf.net>
+
+ * unix/Makefile.in: Expanded install-binaries target to create
+ * win/Makefile.in: and install a pkgIndex.tcl file to enable
+ Tk as a loadable package [Patch 521356]
+
+2002-06-25 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/mkpsenc.tcl: (added) utilities to generate
+ Postscript prolog for current system encoding.
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd): now
+ uses mkpsenc.tcl to generate Postscript prolog.
+ * generic/tkFont.c (TkTextLayoutToPostscript): modified
+ according to patch #546910. Now outputs system-encoded
+ characters (for unibyte) or Adobe glyph names (for
+ multibyte or outside-locale).
+ * tests/canvText.test (canvText-17.1): updated this test
+ to expect the new behavior of canvas postscript.
+
+2002-06-25 Reinhard Max <max@suse.de>
+
+ * unix/tcl.m4: New macro SC_CONFIG_MANPAGES.
+ * unix/configure.in: Added support for symlinks and compression
+ * unix/Makefile.in: when installing the manpages. [Patch 518052]
+ Default is still hardlinks and no compression.
+
+ * unix/mkLinks: generated
+ * unix/configure:
+
+ * unix/README: Added documentation for the new features.
+
+ * unix/configure: Replaced ${exec_prefix}/lib
+ * unix/tcl.m4 (SC_PATH_TCLCONFIG): by ${libdir}.
+
+2002-06-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/winWm.test: Verify that both an unmapped
+ and already mapped toplevel are raised and receive
+ the focus when deiconified.
+ * tests/wm.test: Add wm deiconify tests. Check that
+ a toplevel that has never been mapped is not mapped
+ by the deiconify command since it should be done
+ at idle by MapFrame.
+ * win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED
+ flag while processing the wm deiconify command.
+ The WM_UPDATE_PENDING flag should never be set when
+ WM_NEVER_MAPPED is set, but double check so that
+ the implementation is more explicit and matches
+ the comment just above.
+ Return without invoking TkWmRestackToplevel or
+ TkSetFocusWin on a toplevel that has never been
+ mapped. This fixes a bug where a toplevel is mapped
+ with the wrong size and is then resized by the
+ idle call to MapFrame. [Tk bug 233150]
+
+2002-06-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (UpdateGeometryInfo): remove the check for a null
+ wrapper introduced in r1.41 on 2002-06-15 because it prevented
+ geometry setting from taking effect if the window was not on the
+ screen. Another check may go in it's place as IsIconic and
+ IsZoomed should not be passed NULL.
+
+2002-06-22 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Remove invalid minsize test. Add update
+ calls to wm transient tests so that idle handlers get
+ run. This is needed to get the tests to pass under Win32.
+ * unix/tkUnixWm.c (WmWaitMapProc): Move the special
+ transient withdrawn check into the if body to
+ make it easier to set a breakpoint on this test
+ inside a debugger. No functional changes.
+ * win/tkWinWm.c (WmWaitVisibilityOrMapProc): Ditto.
+
+2002-06-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/wm.n: TIP #95 Windows implementation and
+ * mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs.
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd):
+ * tests/unixWm.test:
+ * tests/winWm.test: more wm attr tests will be needed.
+
+ * generic/tkGrid.c (GridReqProc): check that gridPtr is not NULL
+ (may be when embedded). [Bug #548791] (halliday)
+
+ * generic/tkFont.c (TkFontPkgFree): changed panic on freeing fonts
+ to an assert, and wrapped panic in #ifdef PURIFY. [Bug #568701]
+
+ * library/menu.tcl: corrected menus from being posted offscreen
+ on Windows. [Bug #464451] (darley)
+
+ * library/console.tcl: corrected the defaultPrompt substitution
+ [Bug #553207] and made Tab a default expansion key (like Escape).
+
+ * win/tkWinEmbed.c (EmbedWindowDeleted): added a check for a null
+ containerPtr. The core of this bug is likely elsewhere. [Bug #476176]
+
+ * doc/text.n: TIP #93 implementation that
+ * generic/tkText.c (TextWidgetCmd): enhances the text get and
+ * generic/tkTextIndex.c (TkTextGetIndex): delete methods to accept
+ * tests/text.test: multiple range pairs.
+ This handles the delete case in an atomic, fixed-index fashion.
+
+2002-06-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add tests to make sure a withdrawn
+ transient does not get remapped by state changes
+ in the master.
+ * unix/tkUnixWm.c (Tk_WmCmd, WmWaitMapProc):
+ * win/tkWinWm.c (Tk_WmCmd, WmWaitVisibilityOrMapProc):
+ Add a WM_TRANSIENT_WITHDRAWN flag that gets set by the
+ withdraw, deiconify, or state wm subcommands. Check
+ this flag before mapping a transient when processing
+ a MapNotify event. [Tk bug 570764]
+
+2002-06-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * unix/tk.spec (version), README, win/configure.in, unix/configure.in:
+ * generic/tk.h (TK_RELEASE_*, TK_PATCH_LEVEL): Bumped to beta1.
+
+2002-06-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n: TIP #104 implementation which generalizes the
+ * generic/tkText.c: undo/redo stack to not be tied solely to the
+ * generic/tkText.h: text widget. The APIs are still private.
+ * generic/tkUndo.c: This also adds a stack limiting ability and
+ * generic/tkUndo.h: a -maxundo option to the text widget (in
+ * library/text.tcl: addition to the options from TIP #26) should
+ * mac/tkMacDefault.h: users want to limit the undo/redo stack
+ * tests/text.test: (should not be necessary in most cases).
+ * unix/Makefile.in: [Patch #554763] (callewart)
+ * unix/tkUnixDefault.h:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/tkWinDefault.h:
+
+2002-06-21 Don Porter <dgp@users.sf.net>
+
+ * unix/Makefile.in: Removed unnecessary dependence of tktest
+ * unix/tkAppInit.c: executable on the tcltest executable on
+ Unix. If there are similar dependencies on other platforms, they
+ can probably be removed as well. [Bug 572134].
+
+2002-06-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/listbox.n:
+ * generic/tkListbox.c (DisplayListbox):
+ * mac/tkMacDefault.h: TIP #94 implementation adding -activestyle
+ * tests/listbox.test: option to the listbox. This adds the ability
+ * unix/tkUnixDefault.h: to have listboxes look native on Windows, and
+ * win/tkWinDefault.h: "nicer" elsewhere using the 'dotbox' style.
+
+2002-06-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkGrid.c: Corrected the test for grid propagate change.
+ [Bug #571433]
+
+2002-06-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/panedwindow.test:
+ * generic/tkPanedWindow.c: ensure that sash index is lower bounds
+ checked. [Bug #548727]
+
+2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkClipboard.c (TkClipCleanup): Add code
+ to set dispPtr->clipWindow to NULL, this was
+ accidently removed by last commit. Fixes
+ a crash while running the tests under win32.
+
+2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindDeadWindow):
+ Handle case where Tk_DestroyWindow is invoked
+ on clipboard and send windows.
+ * generic/tkClipboard.c (TkClipCleanup):
+ Invoke Tk_DestroyWindow to cleanup the
+ dispPtr->clipWindow. Call Tcl_Preserve
+ and Tcl_Release on the window to avoid an
+ invalid memory ref on shutdown.
+ * generic/tkEvent.c (Tk_HandleEvent):
+ Panic if XCreateIC is invoked twice for
+ the same window. This should never happen,
+ the check were just added to make sure it
+ does not since this could lead to crashes
+ in XCloseIM.
+ * generic/tkFocus.c (TkFocusDeadWindow):
+ Handle case where Tk_DestroyWindow is invoked
+ on clipboard and send windows.
+ * generic/tkOption.c (TkOptionDeadWindow): Ditto.
+ * generic/tkWindow.c (TkCloseDisplay): Move
+ deletion of dispPtr->winTable after TkpCloseDisplay
+ call since Tk_DestroyWindow uses it and could
+ be called by TkpCloseDisplay for clipboard/send windows.
+ Also invoke ckfree for the dispPtr instead of
+ doing it in TkpCloseDisplay.
+ (Tk_DestroyWindow): Check for a null winPtr->mainPtr
+ before doing certain cleanup tasks so the we can
+ invoke Tk_DestroyWindow on clipboard and send windows.
+ We need to do this so that XDestroyIC will get invoked
+ for the input contexts of each window.
+ * mac/tkMacXStubs.c (TkpCloseDisplay): Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ * unix/tkUnixEvent.c (TkpCloseDisplay, OpenIM): Remove
+ conditional compilation around calls to XCloseIM
+ since I am confident that the crashes related to
+ input contexts has been fixed. Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ * unix/tkUnixSend.c (TkSendCleanup): Invoke the
+ Tk_DestroyWindow method to cleanup the special
+ send window. This will call XDestroyIC and thereby
+ avoid a crash in XCloseIM. The send window needs
+ to be Tcl_Preserve and Tcl_Release to avoid an
+ invalid memory ref on shutdown.
+ * win/tkWinX.c (TkpCloseDisplay): Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ [Tk patch 570902]
+
+2002-06-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkStyle.c: TIP#48 style engine.
+ See http://purl.org/tcl/tip/48.html for details.
+
+ * generic/tkConfig.c (GetOptionFromObj): Split to allow for access
+ to option tables via name as well as via object.
+ (TkGetOptionSpec): Semi-public interface to GetOption functionality.
+ (DoObjConfig, Tk_RestoreSavedOptions, FreeResources)
+ (GetObjectForOption): Basic style support for configure.
+
+ * generic/tkWindow.c (TkCreateMainWindow, Tk_DestroyWindow): Added
+ calls to set up and tear down the style subsystem.
+
+ * generic/tk.decls, generic/tk.h: Many declarations forming TIP#48
+ public interface.
+
+ * generic/tkInt.decls (TkStylePkgInit,TkStylePkgFree):
+ * generic/tkInt.h (TkGetOptionSpec): Supporting declarations.
+
+ * unix/Makefile.in, win/Makefile.in, win/makefile.vc: Added
+ tkStyle.c to list of generic source files.
+
+2002-06-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/defs.tcl (makeFile): Defined the return value of this
+ procedure to be the filename of the created file, as in the real
+ tcltest package...
+
+2002-06-17 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkImage.c (Tk_ImageObjCmd, DeleteImage): Call
+ Tcl_Preserve and Tcl_Release for the masterPtr->winPtr
+ window to avoid accessing memory that had already
+ been deallocated in DeleteImage.
+
+2002-06-17 David Gravereaux <davygrvy@pobox.com>
+
+ Trims to support the removal of RESOURCE_INCLUDED from rc
+ scripts from Tcl's accepted FR #565088.
+
+ * generic/tk.h: Changed RESOURCE_INCLUDED to be RC_INVOKED
+ as the RC tool defines this already by default.
+
+ * win/rc/tk.rc:
+ * win/rc/wish.rc: removed the #define RESOURCE_INCLUDED lines.
+
+2002-06-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): correct installation of
+ wish.exe.manifest to DISTDIR target directory.
+
+ * generic/tkCmds.c (Tk_TkObjCmd):
+ * generic/tkInt.h (struct TkCaret):
+ * mac/tkMacXStubs.c (Tk_SetCaretPos):
+ * unix/tkUnixKey.c (TkpGetString, Tk_SetCaretPos):
+ * win/tkWinX.c (Tk_SetCaretPos):
+ * tests/tk.test: Added 'tk caret' implementation of TIP#96
+ * doc/SetCaret.3 (new): which adds a TkCaret structure element to
+ * doc/tk.n: TkDisplay for maintaining state.
+
+ * unix/tkUnixSend.c (TkSendCleanup): special cleanup of
+ inputContext to avoid bug in XCloseIM. (dejong)
+
+2002-06-17 Don Porter <dgp@users.sf.net>
+
+ * library/msgs/en_gb.msg: Added catalog for UK English.
+ Currently includes only Color -> Colour translation.
+
+2002-06-17 D. Richard Hipp <drh@hwaci.com>
+
+ * doc/checkbutton.n:
+ * doc/radiobutton.n:
+ * generic/tkButton.c:
+ * generic/tkButton.h:
+ * mac/tkMacButton.c:
+ * tests/button.test:
+ * unix/tkUnixButton.c:
+ * win/tkWinButton.c: Implementation of TIP#82 - Added the
+ -offrelief option to checkbutton and radiobutton.
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkWindow.c (Tk_DestroyWindow): Set the pathName
+ component of a window to NULL after its memory has been
+ deallocated to avoid a possible illegal memory access
+ as a result of a call to Tk_PathName() on a Tk_Window
+ structure of a window that has already been destroyed.
+ [Tk bug 521946]
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkOption.c (Tk_GetOption): Allocate
+ memory with ckalloc not malloc. This keeps
+ Tk from erroring out when built with
+ TCL_MEM_DEBUG.
+
+2002-06-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkBind.c (HandleEventGenerate):
+ * generic/tkInt.h: changed warpInProgress boolean from int to a
+ bit in the flags variable (TK_DISPLAY_IN_WARP)
+
+ * generic/tkCmds.c (Tk_TkObjCmd):
+ * unix/tkUnixKey.c (TkpGetString):
+ * generic/tkEvent.c (Tk_HandleEvent):
+ * generic/tkInt.h: changed useInputMethods boolean from int to a
+ bit in the flags variable (TK_DISPLAY_USE_IM)
+
+ * generic/tkInt.h:
+ * generic/tkCmds.c (Tk_WmObjCmd):
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd): changed wmTracing from being an int to
+ just a bit in the flags variable (TK_DISPLAY_WM_TRACING)
+
+ * generic/tkEvent.c (Tk_HandleEvent):
+ * unix/tkUnixEvent.c (OpenIM):
+ * unix/tkUnixKey.c (TkpGetString):
+ * generic/tkInt.h: added TK_DISPLAY_XIM_SPOT flag bit for TkDisplay
+ and used this to allow a runtime check to see if over-the-spot XIM
+ is possible. If not it will try and fallback to the old-style
+ input context, which handles things like dead keys input.
+
+ * generic/tk.decls: added TIP #84 implementation that adds a
+ * generic/tkDecls.h: Tk_CollapseMotionEvents API which controls Tk's
+ * generic/tkEvent.c: collapsing of incoming motion events on its
+ * generic/tkInt.h: windows. The default remains to do collapsing.
+ * generic/tkStubInit.c: Added a flags parameter to the internal display
+ * generic/tkWindow.c: structure to support this and be used in the
+ * doc/QWinEvent.3: future for other bits. [Tk patch 564642]
+
+ * unix/mkLinks: updated from current docs
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkEvent.c (TkXErrorHandler): Declare static
+ function to avoid compiler error with VC++.
+ * generic/tkBind.c (ExpandPercents): Cast argument to
+ Tk_GetAtomName in order to avoid compiler warning.
+
+2002-06-14 Joe English <jenglish@users.sf.net>
+
+ * doc/bind.n:
+ * generic/tk.h:
+ * generic/tkBind.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCmds.c:
+ * generic/tkEvent.c:
+ * generic/tkFocus.c:
+ * generic/tkGrab.c:
+ * generic/tkGrid.c:
+ * generic/tkImage.c:
+ * generic/tkPack.c:
+ * generic/tkPlace.c:
+ * generic/tkPointer.c:
+ * generic/tkTextWind.c:
+ * generic/tkWindow.c:
+ * mac/tkMacSubwindows.c:
+ * mac/tkMacWindowMgr.c
+ * mac/tkMacWm.c:
+ * unix/Makefile.in:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWindow.c:
+ * win/tkWinWm.c: Implementation of TIP #47 by Neil McKay
+ "Modifying Tk to Allow Writing X Window managers".
+ Add CirculateRequest, Create, MapRequest, ResizeRequest,
+ and ConfigureRequest event types;
+ Split TK_TOPLEVEL flag into TK_TOPLEVEL, TK_HAS_WRAPPER,
+ TK_WIN_MANAGED, and TK_TOP_HIERARCHY. [Tk patch 572978]
+
+2002-06-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * unix/tkAppInit.c: Removed now unneeded and erroneous reference
+ to 'matherr'. See Tcl ChangeLog entry 2002-05-31 Don Porter.
+
+2002-06-14 David Gravereaux <davygrvy@pobox.com>
+
+ * win/rules.vc: The test for compiler optimizations was in error.
+ Thanks goes to Roy Terry <royterry@earthlink.net> for his
+ assistance with this.
+
+2002-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ Implement TIP 98 [Tk patch 566765]
+
+ * doc/FindPhoto.3, generic/tk.h, generic/tk.decls:
+ * generic/tkImgPhoto.c: Changed *_Old to *_NoComposite and
+ USE_OLD_PHOTO_PUT_BLOCK to USE_COMPOSITELESS_PHOTO_PUT_BLOCK
+ following a suggestion from Don Porter.
+
+ * tests/imgPhoto.test: Added tests of -compositingrule
+
+ * doc/photo.n: Added documentation for "-compositingrule".
+ * generic/tkImgPhoto.c (ImgPhotoCmd, ParseSubcommandOptions): New
+ "-compositingrule" option for [$photo copy] subcommand, using
+ OPT_COMPOSITE flag and compositingRule field in SubcommandOptions
+ structure.
+
+ * doc/FindPhoto.3: Documented the extra argument for the
+ compositing rule and the action to take if anyone wants to
+ maintain total backward-compatability.
+
+ * generic/tk.h (TK_PHOTO_COMPOSITE_*): Defined values for use as
+ compositing rules.
+ (USE_OLD_PHOTO_PUT_BLOCK): Added a way for users to select the old
+ interface to Tk_PhotoPutBlock to provide an easier upgrade path.
+
+ * generic/tk.decls: Alter Tk_PhotoPut*Block to Tk_PhotoPut*Block_Old
+ and introduce new slots for the old name of function with an extra
+ argument at the end for the compositing rule.
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Updated "transparency set"
+ subcommand to use TkSubtractRegion().
+
+ * win/tkWinRegion.c (TkSubtractRegion):
+ * mac/tkMacRegion.c (TkSubtractRegion):
+ * generic/tkInt.decls (TkSubtractRegion):
+ * unix/tkUnixPort.h (TkSubtractRegion): Added function to perform
+ the set-difference operation on regions; it seems all platforms
+ can support it, and it makes removing rectangular bits from
+ regions much easier.
+
+ * generic/tkImgPPM.c (FileReadPPM): Reading a PPM/PGM always uses
+ the SET compositing rule because it is faster and the format does
+ not have any transparency information.
+
+ * generic/tkImgGIF.c (FileReadGIF): Reading a GIF always uses the
+ SET compositing rule because GIF files model transparency as a
+ single special colour.
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
+ Added a compositing rule to allow better control over what happens
+ to transparent pixels when inserting data into a photo image.
+
+2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/winfo.test: Add basic tests for winfo ismapped.
+
+2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/unixWm.test:
+ * tests/wm.test: Move wm minsize and wm maxsize
+ usage tests into the cross platform wm tests.
+
+2002-06-13 Don Porter <dgp@users.sf.net>
+
+ * tests/cursor.test: corrected error after cursor-2.2.
+ * tests/defs.tcl: Added enhancements to Tk's fake version of
+ tcltest required by recent cursor.test changes.
+
+2002-06-13 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/cursor.test (cursor-2.[34]): Tests added to ensure that
+ cursor specs really are well-behaved lists. Also some general
+ clean-up...
+ * win/tkWinCursor.c (TkGetCursorByName): Undone Jeff's back-off
+ and fixed things so that they should work now. Cursor specs are
+ lists first and foremost.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Clearly label wm transient changes as
+ a POTENTIAL INCOMPATIBILITY.
+ * doc/wm.n: Remove "some window managers will" text
+ and explicitly state what behavior a transient
+ window will display. Also mention that it is an
+ error to make a window a transient of itself.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::file::chooseDir):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog): Remove the
+ transient property on dialogs after they have been
+ dismissed to insulate them from further state changes
+ in the master. This keeps a withdrawn dialog from
+ being mapped when the master is deiconified. [Tk patch 568278]
+
+2002-06-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinCursor.c (TkGetCursorByName): reverted fix from
+ 2002-06-06 because it broke the ability to use built-in cursors
+ like left_ptr.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::color):
+ * library/dialog.tcl (tk_dialog):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog_Create):
+ Only make the dialog window a transient if
+ the master is visible. This check already
+ appeared in some of the dialogs. This patch
+ just copies the check into those that were
+ lacking. [Tk patch 568253]
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Add note about new transient behavior.
+ * tests/unixWm.test: Check that the WM_TRANSIENT_FOR
+ property for a transient window is being cleared
+ when the master is destroyed.
+ * tests/wm.test: Source defs.tcl instead of using
+ tcltest to match the rest of Tk's test files.
+ Add new tests that ensure that a transient's state
+ mirrors the state of the master.
+ * unix/tkUnixWm.c (WmInfo, TkWmNewWindow, TkWmMapWindow)
+ (TkWmDeadWindow, Tk_WmCmd, WmWaitMapProc): Add numTransients
+ member to WmInfo structure. Keep state of master and
+ transient in sync using a callback that tracks MapNotify
+ and UnmapNotify events. When the master is mapped, map
+ the transient. When the master is unmapped or iconified,
+ withdraw the transient.
+ * win/tkWinWm.c (TkWmMapWindow, TkpWmSetState)
+ (TkWmDeadWindow, Tk_WmCmd, WmWaitVisibilityOrMapProc):
+ Keep state of master and transient in sync using a
+ callback that tracks MapNotify and UnmapNotify events.
+ Move masterPtr check from TkpWmSetState into TkWmMapWindow
+ to deal with WM_NEVER_MAPPED transients. Cleanup
+ numTransients and the callback in TkWmDeadWindow.
+ Cleanup numTransients and the callback only after
+ deleting a master in wm transient command to avoid
+ deleting the callback when an error is raised.
+ Add support for MapNotify and UnmapNotify events
+ to the master callback. [Tk patch 561708]
+
+2002-06-11 Joe English <jenglish@users.sf.net>
+
+ * library/menu.tcl: fix for bug report #530212 "Bad Window Path
+ Name in tkMenuFind"
+
+2002-06-10 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Fixed a win98 issue where the /exclude option
+ for xcopy is unsupported.
+ Reported by Roy Terry <royterry@earthlink.net>.
+
+2002-06-10 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/tk.tcl: added utility functions to get "-underline" and
+ "-text" for labels and buttons from translatable string containing
+ "magic ampersand" [patch #566605]
+ * library/clrpick.tcl:
+ * library/msgbox.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl: some places where msgcat is used to get
+ translated label are modified to handle labels with magic ampersand.
+ * library/msgs/ru.msg: russian translations added
+ * library/msgs/cs.msg:
+ * library/msgs/de.msg:
+ * library/msgs/el.msg:
+ * library/msgs/es.msg:
+ * library/msgs/fr.msg:
+ * library/msgs/it.msg:
+ * library/msgs/nl.msg: all translation files now have labels with
+ 'magic ampersand' where appropriate. In el.msg some ampersands are
+ missing, as I don't know which underline positions seems natural
+ to "el" users.
+
+2002-06-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/bgerror.tcl (tk::dialog::error::bgerror):
+ Don't set the bgerror dialog as a transient of
+ itself since this operation is ill defined.
+
+2002-06-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * win/tkWinCursor.c (TkGetCursorByName): Fixed so that the reading
+ of cursors from a file with a cursor spec was built using [list]
+ works when the file has a space in instead of requiring fiddling
+ with backslashes.
+
+2002-06-06 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/msgbox.tcl (MessageBox): Add -default normal
+ when creating non-default buttons for message box.
+ They already get -default normal when they're
+ unfocused, and dialog window size used to change suddenly
+ in such cases.
+
+2002-06-05 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * unix/tkUnixFont.c (Tk_DrawChars): Don't assume that
+ one char is always one byte, and that required
+ subfont for the last character in any string is
+ the same as for the previous character
+ [Bug #559435] [Patch #559437]
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Document [wm transient .t .t] error.
+ * tests/wm.test: Check that setting a window
+ as a transient of itself raises an error. Check
+ that passing a non-toplevel window to the wm
+ transient command uses the enclosing toplevel.
+ * unix/tkUnixWm.c (Tk_WmCmd): Raise an error
+ if the user tries to make a toplevel a
+ transient of itself.
+ * win/tkWinWm.c (Tk_WmCmd): Raise an error
+ if the user tries to make a toplevel a
+ transient of itself. Test for other error
+ before checking for the transient self error.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/tkUnixWm.c (WmInfo, TkWmCleanup, TkWmNewWindow)
+ (TkWmMapWindow, TkWmDeadWindow, Tk_WmCmd): Replace
+ WmInfo's master and masterWindowName members with
+ a masterPtr member. This implementation is much
+ simpler and mirrors the Win32 implementation. This
+ change makes it easy to check the flags of the
+ master window. No user visible changes.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkInt.decls: Add unix decl for TkpWmSetState.
+ * generic/tkIntPlatDecls.h: Regen.
+ * generic/tkStubInit.c: Regen.
+ * tests/wm.test: Test state changes between iconic,
+ normal, and withdrawn both before and after initial
+ mapping.
+ * unix/tkUnixWm.c (Tk_WmCmd, TkpWmSetState): Move
+ state change code into TkpWmSetState to more closely
+ match the Win32 implementation. No user visible changes.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/embed.test: Added cross platform embed tests.
+ Check that window passed to -use has the -container
+ option set.
+ * tests/wm.test: Remove useless catch call. Deiconify
+ . just in case, stackorder tests will not pass unless
+ it is in the normal state. Add -container flag to
+ embedded stackorder test.
+ * unix/tkUnixEmbed.c (TkpUseWindow):
+ * win/tkWinEmbed.c (TkpUseWindow): Lookup Tk window
+ based on the id passed in as the value for -use.
+ Generate an error if the Tk window did not have
+ the -container option set.
+
+2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkButton.c (ConfigureButton): When creating
+ a radiobutton with -value "" it was not drawn properly
+ if the -variable was created by the radiobutton.
+ [Bug #548765]
+
+2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkCanvText.c (ComputeTextBbox): Negative
+ coordinates were rounded badly causing a 1 pixel
+ displacement. [Bug #556526]
+
+2002-05-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * mac/tkMacWm.c (Tk_WmCmd):
+ * tests/unixWm.test: Move wm transient checks over
+ to wm.test so they will be run on all systems.
+ * tests/wm.test: Add tests to check for error when
+ an iconwindow is passed to the wm transient command.
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd): Raise an error if one
+ of the windows passed to the wm transient command
+ is an iconwindow for another toplevel.
+
+2002-05-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * mac/tkMacWm.c (TkWmStackorderToplevelWrapperMap):
+ * tests/wm.test: Add embedded Window test case for
+ the stackorder command.
+ * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap):
+ * win/tkWinWm.c (TkWmStackorderToplevelWrapperMap):
+ Ignore embedded windows during wm stackorder command.
+
+2002-05-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Invoke SC_ENABLE_SHARED before
+ calling SC_CONFIG_CFLAGS so that the SHARED_BUILD
+ variable can be checked inside SC_CONFIG_CFLAGS.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-05-20 Don Porter <dgp@users.sourceforge.net>
+
+ * library/tk.tcl: A little namespace cleanup on Daniel Steffen's
+ latest revisions to avoid defining new global commands.
+
+2002-05-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacInit.c:
+ * mac/tkMacTclCode.r: include msgcat package in resources
+ as bgerror depends on it. Restores ability of mac static
+ build to run standalone (except for encoding file issues).
+
+ * mac/tkMacInit.c:
+ * library/console.tcl:
+ * library/tk.tcl: fix tk.tcl not sourcing library files
+ that define bindings at startup on mac. (independent of
+ tk library files being in resources or on auto_path)
+
+2002-05-08 Don Porter <dgp@users.sourceforge.net>
+
+ * library/bgerror.tcl:
+ * library/tclIndex: Cleaned up namespace usage of the bgerror
+ dialog. Completes soft dependence on msgcat. [FR 539309]
+
+2002-05-07 David Gravereaux <davygrvy@pobox.com>
+ * win/makefile.vc: Problem with TCLDIR macro not accepting
+ forward slash path seperators resolved. Added the same logic
+ to INSTALLDIR, too. [Bug #553208]
+
+2002-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: change HP-11 SHLIB_LD_LIBS from "" to ${LIBS} so
+ that the .sl knows its dependent libs.
+
+2002-04-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacTclCode.r:
+ * mac/tkMacResource.r: added check of
+ TCLTK_NO_LIBRARY_TEXT_RESOURCES #define to allow disabling the
+ inclusion of the tk library code in the resource fork of Tk
+ executables and shared libraries.
+ Moved tk library code inclusion to separate file like in tcl.
+ Added 'panedwindow' resource.
+
+2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl (ButtonLeave): corrected the 3
+ implementations of ButtonLeave to check for Priv(relief) existing
+ before trying to use it. [Patch #541849]
+
+ * generic/tkTextDisp.c (DisplayLineBackground):
+ * unix/tkUnix3d.c (Tk_3DHorizontalBevel):
+ * unix/tkUnixFont.c (Tk_DrawChars): applied fixes to not overrun
+ the X window 16-bit size limit. [Patch #541999] (bonfield)
+
+2002-04-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkTextDisp.c (GetXView, GetYView): Comparison with
+ previous values of scrollbar range are now done in a way that is
+ sensitive to the bizarreness of floating-point on architectures
+ where IEEE-FP is not used on the processor. Also increased the
+ size of the temporary buffer to take account of the fact that
+ TCL_DOUBLE_SPACE is meant to only imply enough space to take a
+ printed double and trailing '\0', and no more. [Bug #223739]
+ (FP_EQUAL_SCALE): New macro to help compare floating-point numbers
+ for equality in a sane way, used in GetXView and GetYView.
+
+2002-04-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkWindow.c (TkCloseDisplay): Added to centralize where a
+ display was closed. This handles freeing memory associated with a
+ display and closing it.
+ (DeleteWindowsExitProc): actually close displays. This would also
+ ideally be done in Tk_DestroyWindow when the last window on the
+ display has been closed, but that still has unresolved order of
+ cleanup problems.
+ (Tk_DestroyWindow): added TkFocusFree call.
+
+ * generic/tkStubInit.c:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkInt.decls: added TkFocusFree, TkClipCleanup and
+ TkGCCleanup generic private procs, and TkWmCleanup, TkSendCleanup
+ and TkFreeXId unix private procs.
+
+ * generic/tkInt.h:
+ * unix/tkUnixXId.c (TkFreeXId): frees XID resources.
+ Made idCleanupScheduled a Tcl_TimerToken (was int) in TkDisplay
+ structure to allow us to delete the timer scheduled for it.
+
+ * unix/tkUnixWm.c (TkWmStackorderToplevel): ensure children
+ structure is freed.
+ (ConfigureEvent, ComputeReparentGeometry): Add extra wm tracing info
+ (TkWmRestackToplevel): initialize changes to 0 to prevent UMR.
+ Use WaitForConfigureNotify on all windows. This part still
+ requires fixing as it is the root of the 2 second raise delay on
+ some window managers (those that use extra wrapper windows of
+ their own).
+
+ * unix/tkUnixSend.c (TkSendCleanup): free send-related resources
+
+ * unix/tkUnixEvent.c (TkpCloseDisplay): call TkSendCleanup and
+ TkWmCleanup.
+
+ * unix/tkUnixSelect.c (SelRcvIncrProc): added missing Tcl_Release
+ of interp
+
+ * generic/tkGet.c (FreeUidThreadExitProc): free thread-specific
+ resources on thread exit
+
+ * generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
+ * generic/tkClipboard.c (TkClipCleanup): frees TkDisplay data
+ * generic/tkGC.c (TkGCCleanup): frees TkDisplay data
+
+ * unix/tkUnixFont.c (FontPkgCleanup): cleanup thread specific font
+ resources on thread exit.
+
+ * mac/tkMacXStubs.c (TkpOpenDisplay): memset the initial display
+ structures to 0.
+
+ * generic/tkOption.c (OptionThreadExitProc): freed tsd option
+ stacks on thread exit.
+ (Tk_GetOption): free mem used to get Tk_Uid
+
+ * generic/tkMenu.c (ConfigureMenu): freed saved options in all
+ error cases.
+
+ * win/tkWinInt.h: declaration for TkWinGetUnicodeEncoding
+ * win/tkWinDialog.c (GetFileNameW): use TkWinGetUnicodeEncoding
+ * win/tkWinInit.c (TkpDisplayWarning): use TkWinGetUnicodeEncoding
+ * win/tkWinFont.c: use TkWinGetUnicodeEncoding instead of static
+ unicodeEncoding.
+
+ * win/tkWinX.c (Tk_SetCaretPos): remove WM_IME_STARTCOMPOSITION
+ and place the IME position within Tk_SetCaretPos. Cache results in
+ Tk_SetCaretPos to reduce unnecessary repositioning. Also call
+ DestroyCaret if we receive WM_KILLFOCUS.
+ (TkpOpenDisplay): ZeroMemory the initial display structures.
+ (TkWinGetUnicodeEncoding): Added so that Windows only needs to
+ cache this value one, and then free it in TkWinXCleanup.
+ (HandleIMEComposition): add support for Win98 and ATOK13
+ IME. (yamamoto)
+
+ * generic/tkConsole.c (ConsoleCmd): correct return that should
+ have just set result code.
+
+ * generic/tkImgPhoto.c: Added PhotoFormatThreadExitProc to clean
+ up on thread exit. (Tk_PhotoPutBlock) slight code updates
+
+ * generic/tkPanedWindow.c (DestroyPanedWindow, ConfigureSlaves):
+ fix mem leaks in not freeing slave info
+
+ * win/configure:
+ * win/tcl.m4: Enabled COFF as well as CV style debug info with
+ --enable-symbols to allow Dr. Watson users to see function info.
+ More info on debugging levels can be obtained at:
+ http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+
+2002-04-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * doc/wm.n:
+ * mac/tkMacWm.c:
+ * tests/wm.test:
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c: Update wm stackorder usage message
+ to make it clear that either 1 or 3 arguments are
+ required. [Bug 540013]
+
+2002-04-08 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacProjects.sea.hqx: added tkPanedWindow.c to projects
+ * mac/tkMacAppInit.c: fixes to MSL stdin/stdout hookup to the
+ TkConsole when using shared MSL libraries; fix for crashing
+ bug on exit: writing to stdin/sterr when console has already
+ been destroyed. (both fixes need support in MSL, see
+ 'CW Pro6 changes' in tcl/mac/tcltkMacBuildSupport.sea.hqx)
+ * mac/tkMacDialog.c: fixes to Navigation Services Dialog filter.
+ * mac/tkMacDraw.c: add panic for overwide TkImages that would
+ crash Tk on mac otherwise.
+
+2002-04-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * mac/tkMacXStubs.c: added Tk_SetCaretPos stub (does nothing).
+ * win/tkWinX.c: added Tk_SetCaretPos code to position IME windows
+ correctly when WM_IME_STARTCOMPOSITION is received.
+ * unix/tkUnixKey.c: added Tk_SetCaretPos and code for setting
+ XIM caret in TkpGetString.
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: added Tk_SetCaretPos declaration. This command
+ allows users to indicate the cursor position and is used by XIM
+ (Unix) or IME (Windows) to place the caret box correctly. It is
+ also part of correct Accessibility style on Windows to make the
+ magnifier jump to the focus point.
+
+ * win/tkWinButton.c (TkpDisplayButton):
+ * generic/tkTextMark.c (TkTextInsertDisplayProc):
+ * generic/tkCanvText.c (DisplayCanvText):
+ * generic/tkEntry.c (DisplayEntry): added Tk_SetCaretPos calls
+
+ * generic/tkInt.h: added TK_XIM_SPOT #define (default 1).
+ Added XFontSet attribute to TkDisplay when TK_XIM_SPOT is true.
+ * generic/tkEvent.c (Tk_HandleEvent): made sure inputContexts are
+ not getting created on DestroyNotify events (for dead windows).
+ Added over-the-spot support if TK_XIM_SPOT is defined (default).
+ The is the nicer XIM behavior, but uses a bit more memory.
+
+ * unix/tkUnixEvent.c:
+ * generic/tkWindow.c: moved OpenIM over to tkUnixEvent.c.
+ Removed setting inputContext to null in Tk_MakeWindowExist as it
+ was redundant.
+
+ * unix/tkUnixWm.c (CreateWrapper): Removed redundat setting of
+ inputContext to null.
+
+ * win/Makefile.in: changed gdb and shell targets to properly build
+ all binaries before running (otherwise an error often occured).
+
+2002-03-28 David Gravereaux <davygrvy@pobox.com>
+
+ * win/.cvsignore (new):
+ * win/lamp.bmp (new):
+ * win/makefile.vc:
+ * win/nmakehlp.c (new):
+ * win/rules.vc: Brought the makefile up-to-date with Tcl's one.
+ This now has support for Win9x issues and the winhelp target now
+ exists. Color scheme can be changed. I'm just imparting a first
+ suggestion using orange :) I'll have to think about the install
+ portion of the helpfile as I'll need to do some tricks to insert
+ tk's contents file into Tcl's using some special winhlp32.exe
+ switches. [Bug 533862 527941]
+
+ * win/makefile.vc: Tk helpfile is now installing itself into Tcl's
+ contents file as part of the install target and rebuilding the
+ contents table as desired. [Bug 527941]
+
+ * doc/console.n: Changed topic from "Tcl Built-In Commands" to
+ "Tk Built-In Commands"
+
+ * win/buildall.vc.bat: Update to match Tcl.
+
+2002-03-26 Andreas Kupries <andreask_kupries@users.sourceforge.net>
+
+ * unix/tkUnixFont.c: Added inclusion of <arpa/inet.h>. This fixes
+ a GCC/HPUX problem with missing a "htons". See also
+ "tclUnixPort.h" for equivalent code.
+
+2002-03-21 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Changed optimize flag to -0ti instead of -02.
+ [Bug 528441]
+
+2002-03-20 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkButton.c (ButtonTextVarProc,ButtonVarProc):
+ * generic/tkCmds.c (WaitVariableProc):
+ * generic/tkEntry.c (EntryTextVarProc):
+ * generic/tkListbox.c (ListboxListVarProc):
+ * generic/tkMenu.c (MenuVarProc):
+ * generic/tkMenubutton.c (MenuButtonTextVarProc):
+ * generic/tkMessage.c (MessageTextVarProc):
+ * generic/tkScale.c (ScaleVarProc): Updates to handle change in
+ type of part2 argument of Tcl_VarTraceProc typedef. [TIP 27]
+ [Patch 532644].
+
+2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkOldConfig.c (Tk_ConfigureValue): prevent leaving
+ interp->result as NULL.
+
+2002-03-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/text.tcl (TextPasteSelection): Renaming of TextPaste to
+ prevent confusion with tk_textPaste. Stopped code from inserting
+ selections twice, which seems to have happened with TIP#26, and
+ reorganized code to reduce amount of stuff protected by catch
+ which is tricky to maintain.
+ (tk_textPaste): Reduce amount of code protected by catch.
+
+2002-03-06 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinX.c: Define _WIN32_IE as 0x0300
+ before including commctrl.h so that we can
+ access the InitCommonControlsEx API when
+ building Tk with mingw.
+
+2002-03-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * README, generic/tk.h, unix/configure.in, unix/tk.spec:
+ * win/configure.in: Bumped patchlevel; this might need to change
+ in the future, but it will help us distinguish between the CVS
+ version and the most recent released version.
+
+2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4a4 TAGGED FOR RELEASE ***
+
+ * unix/README: updated --* options docs.
+
+ * unix/tk.spec: fixed URL refs to use www.tcl.tk or SF.
+
+2002-03-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README:
+ * unix/README:
+ * win/README: updated to use www.tcl.tk URL.
+
+2002-03-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/entry.tcl: added catch around Triple-1 binding use of
+ sel.last
+
+2002-02-28 Don Porter <dgp@users.sourceforge.net>
+
+ * library/console.tcl (ConsoleBind): Corrected console <<Paste>>
+ binding on Unix platforms.
+
+2002-02-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+ * generic/tkWindow.c (Tk_MainWindow, Tk_GetNumMainWindows):
+ protect against being called before Tcl stubs are init'ed.
+ [Bug #220916] (porter)
+
+2002-02-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (ConfigureText): reenable the blinking cursor
+ on state change where necessary. [Bug #503772]
+
+ * tests/listbox.test:
+ * generic/tkListbox.c: corrected error handling when setting to an
+ invalid listvar value. [Bug #503613]
+
+ * library/scale.tcl: mirror B2 bindings to B3 on Windows to better
+ accomodate two button mice. [Patch #493145]
+
+ * library/panedwindow.tcl: improved proxy sash handling. (boudaillier)
+
+2002-02-25 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/filebox.test: Reorganised and fixed so that tests are
+ executed fewer times (!) and the automatic extension adding
+ behaviour of tk_getSaveFile is tested.
+
+2002-02-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-02-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPanedWindow.c (PanedWindowWidgetObjCmd): fixed returns
+ that should have been breaks instead. Corrected .pw configure
+ handling for insufficient args. [Patch #521436] (boudaillier)
+
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: changed panedwindow default relief to flat,
+ a more natural outer relief.
+
+ * library/panedwindow.tcl (ReleaseSash): changed to not pass x and
+ y args at all (they aren't used).
+ Added proc comments. Made configuring sash cursor more efficient.
+ Added Cursor timer that restores the default cursor when pointer
+ is no longer over the sash. This is necessary because Leave
+ events won't be seen when moving into a paned child.
+
+2002-02-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: New section "Paned Windows"
+ * library/demos/paned2.tcl, library/demos/paned1.tcl: New files.
+
+ * library/panedwindow.tcl (ReleaseSash): Added missing arguments.
+ * library/tk.tcl: Bindings for paned window were not being loaded
+ by default.
+
+ * unix/tkUnixMenu.c (GetMenuLabelGeometry,DrawMenuEntryLabel):
+ Stop meaningless GCC warnings.
+
+2002-02-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/panedwindow.n (new):
+ * generic/tkPanedWindow.c (new):
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * library/panedwindow.tcl (new):
+ * mac/tkMacDefault.h:
+ * tests/panedwindow.test (new):
+ * unix/Makefile.in:
+ * unix/tkUnixDefault.h:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/tkWinDefault.h: added implementation of TIP #41, panedwindow
+ widget. [Patch #512503] (melski)
+
+ * generic/tkOption.c (ReadOptionFile): fixed Tcl_Seek casting to
+ remove warnings (we expect no option files with be > 2GB).
+
+ * unix/configure: regenerated
+ * unix/tcl.m4: updated to sync with Tcl's tcl.m4
+ Added --enable-64bit support for AIX-4 using IBM's xlc (-q64 flag).
+
+2002-02-19 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: First draft of updated changes for 8.4a4 release.
+
+2002-02-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgPhoto.c (MatchFileFormat): Tcl_Seek takes
+ Tcl_WideInt offset (three places.)
+ * generic/tkImgPPM.c (FileReadPPM): Tcl_Seek takes Tcl_WideInt offset.
+ * generic/tkFrame.c (ConfigureFrame): Stop GCC warning.
+
+ * generic/tkImgGIF.c: Made file meet the formatting rules from the
+ Tcl Engineering Manual better; mostly differences in whitespace.
+
+2002-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen'd
+ * unix/tcl.m4:
+ * unix/configure.in: added macros and calls to SC_TCL_EARLY_FLAGS
+ and SC_TCL_64BIT_FLAGS, part of TIP #72.
+
+2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/entry.tcl:
+ * library/text.tcl: Adjust <Double-1> and <Triple-1> bindings
+ so that no anchor point is set and the insertion cursor is
+ set to the last character in the selection. [Bug 220943]
+ * tests/event.test: Add test cases for double click and
+ drag as well as triple click and drag in the text and
+ entry widgets.
+
+2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/event.test (_text_ind_to_x_y, _get_selection): Fix
+ incorrect use of results from bbox invocation so that
+ y center point for a give index is calculated correctly.
+ Add new method to return the selection and use it in
+ test cases. Always lappend to the result list to avoid
+ case where initial result includes a space.
+
+2002-02-07 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c:
+ * mac/tkMacInit.c:
+ * mac/tkMacKeyboard.c:
+ * win/tkWinDialog.c:
+ * win/tkWinTest.c: modified some callers of Tcl routines that
+ were restored to return (char *) pointing into Tcl_DStrings.
+
+2002-02-03 eric melski <ericm@interwoven.com>
+
+ * generic/tkImage.c (Tk_ImageObjCmd): Clean up bogus for loop in
+ [image inuse] subcommand [Bug #485803].
+
+2002-02-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCmds.c (Tk_TkObjCmd): don't use 'bool' as an arg as it
+ conflicts with the C99 spec. [Bug #511956] (ingham)
+
+2002-02-01 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: unset macro located in the tktest target
+ caused a failure to build. [Bug 511652]
+
+2002-01-30 Don Porter <dgp@users.sourceforge.net>
+
+ * win/stubs.c (XSetCommand): Overlooked CONSTification.
+
+2002-02-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/photo.n: Documented transparency subcommand.
+ * tests/imgPhoto.test (imgPhoto-4.40...imgPhoto-4.68): Tests for
+ the transparency subcommand.
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Added transparency
+ subcommand (see TIP #14.)
+
+2002-01-31 Todd Helfter <tmh@users.sourceforge.net>
+ * generic/tkMenu.c (ConfigureMenuCloneEntries)
+ * tests/menu.test (menu3.68)
+ Correct and test for logic error when cloning menus. [Bug #508988]
+
+2002-01-30 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.decls: The POTENTIAL INCOMPATIBILITY in the changing
+ interface of Tk_ParseArgv can now be removed by the -DUSE_NON_CONST
+ compiler flag.
+ * generic/tkDecls.h: make genstubs
+
+2002-01-29 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/tkWinInit.c (TkpGetAppName): TIP 27 fixup. The code now does
+ not write into the CONST path returned by "argv0" and
+ Tcl_SplitPath anymore.
+
+2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Don't set TCL_LIB_SPEC and
+ TCL_STUB_LIB_SPEC variables since this breaks
+ the AIX build. This was used in the past to
+ support linking with Tcl from the build dir
+ or the install dir, but it is no longer needed.
+
+2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Remove commented out vars.
+ * unix/configure: Regen.
+ * unix/configure.in: Don't subst vars that are already
+ taken care of in SC_LOAD_TCLCONFIG.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2001-01-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkFileFilter.c:
+ * mac/tkMacInit.c:
+ * mac/tkMacKeyboard.c:
+ * mac/tkMacMenus.c: TIP 27 CONSTification induced changes
+
+2002-01-25 Don Porter <dgp@users.sourceforge.net>
+
+ * All changes below are Patch 505159
+
+ * doc/AddOption.3:
+ * doc/CanvTkWin.3:
+ * doc/GetPixels.3:
+ * doc/Name.3:
+ * doc/ParseArgv.3:
+ * generic/tk.decls (Tk_AddOption,Tk_CanvasGetCoord,Tk_GetPixels)
+ (Tk_GetScreenMM,Tk_NameToWindow,Tk_ParseArgv):
+ * generic/tkArgv.c (Tk_ParseArgv):
+ * generic/tkCanvLine.c (ParseArrowShape):
+ * generic/tkCanvUtil.c (Tk_CanvasGetCoord,Tk_CanvasTagsParseProc)
+ (Tk_CanvasTagsPrintProc,Tk_GetDash):
+ * generic/tkCanvas.c (ConfigureCanvas):
+ * generic/tkGet.c (Tk_GetPixels,Tk_GetScreenMM):
+ * generic/tkImgPhoto.c (ImgPhotoCmd):
+ * generic/tkMain.c (Tk_MainEx):
+ * generic/tkOldConfig.c (FormatConfigInfo):
+ * generic/tkOption.c (Tk_AddOption):
+ * generic/tkText.c (TextWidgetCmd,TkTextGetTabs,DumpSegment):
+ * generic/tkText.h (TkTextCreateTag):
+ * generic/tkTextTag.c (TkTextCreateTag):
+ * generic/tkWindow.c (Tk_NameToWindow,Initialize):
+ * mac/tkMacCursor.c (FindCursorByName,TkGetCursorByName):
+ * mac/tkMacWm.c (Tk_WmCmd):
+ * unix/tkUnixCursor.c (TkGetCursorByName):
+ * unix/tkUnixSend.c (ValidateName):
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinCursor.c (TkGetCursorByName):
+ * win/tkWinWm.c (Tk_WmCmd): Updated callers of Tcl_SplitList and
+ Tcl_Merge.
+ * generic/tkDecls.h: make genstubs
+ ***POTENTIAL INCOMPATIBILITY***
+ Includes a source incompatibility in the argv argument of Tcl_ParseArgv.
+
+ * generic/tkBind.c (DeleteVirtualEvent):
+ * generic/tkCanvas.c (ScrollFractions, CanvasWidgetCmd)
+ (CanvasUpdateScrollbars):
+ * generic/tkTestTag.c (TkTextTagCmd): Updated callers of
+ Tcl_GetStringResult. Rewrote PrintScrollFractions to
+ ScrollFractions to stop scribbling directly on interp->result.
+
+ * generic/tkInt.decls (TkGetDefaultScreenName, TkpDisplayWarning)
+ (TkpOpenDisplay):
+ * generic/tkCanvPs.c (Tk_PostscriptColor, Tk_PostscriptFont):
+ * generic/tkEntry.c (EntrySetValue, EntryValidateChange)
+ (ExpandPercents, EntryValueChanged, Tk_EntryObjCmd, DestroyEntry)
+ (ConfigureEntry, EntryComputeGeometry, InsertChars, DeleteChars)
+ (EntryFetchSelection, EntryTextVarProc, Tk_SpinBoxObjCmd)
+ (SpinboxWidgetObjCmd):
+ * generic/tkMain.c (Prompt):
+ * generic/tkMenu.c (MenuVarProc):
+ * generic/tkMenubutton.c (ConfigureMenuButton, MenuButtonTextVarProc):
+ * generic/tkMessage.c (ConfigureMessage, MessageTextVarProc):
+ * generic/tkWindow.c (GetScreen, Initialize):
+ * mac/tkMacInit.c (TkpInit, TkpDisplayWarning):
+ * mac/tkMacXStubs.c (TkGetDefaultScreenName, TkpOpenDisplay):
+ * unix/tkUnix.c (TkGetDefaultScreenName):
+ * unix/tkUnixEvent.c (TkpOpenDisplay):
+ * unix/tkUnixInit.c (TkpGetAppName, TkpDisplayWarning):
+ * unix/tkUnixSend.c (SendEventProc):
+ * win/tkWinInit.c (TkpGetAppName, TkpDisplayWarning):
+ * win/tkWinX.c (TkGetDefaultScreenName,TkpOpenDisplay): Updated
+ callers of Tcl_GetVar, Tcl_GetVar2
+ * generic/tkIntDecls.h: make genstubs
+
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd):
+ * generic/tkImgBmap.c (TkGetBitmapData):
+ * generic/tkOption.c (ReadOptionFile):
+ * mac/tkMacInit.c (TkpInit, TkpGetAppName):
+ * win/tkWinInit.c (TkpGetAppName): Updated callers of
+ Tcl_SplitPath, Tcl_JoinPath, and Tcl_TranslateFileName.
+
+2002-01-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Rewrite stackorder tests that
+ deal with toplevels that have the overrideredirect
+ flag set. [Tk bug 492259]
+
+2002-01-18 Don Porter <dgp@users.sourceforge.net>
+
+ * win/tkWinDialog.c: Overlooked Tcl_GetIndexFromObj callers.
+
+2001-01-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacDialog.c:
+ * mac/tkMacSend.c: TIP 27 CONSTification broke the mac
+ build in a few places.
+
+2002-01-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkListbox.c (ChangeListboxOffset): improved tracking
+ when scrolling on x axis with entry/text. [Bug #225025] (voskuil)
+
+2002-01-16 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk3d.c (Tk_GetReliefFromObj):
+ * generic/tkBind.c (Tk_EventObjCmd, HandleEventGenerate):
+ * generic/tkButton.c (ButtonWidgetObjCmd):
+ * generic/tkCanvas.c (CanvasWidgetCmd, FindItems):
+ * generic/tkClipboard.c (Tk_ClipboardObjCmd):
+ * generic/tkCmds.c (Tk_BellObjCmd, Tk_TkObjCmd, Tk_TkwaitObjCmd)
+ (Tk_UpdateObjCmd, Tk_WinfoObjCmd, Tk_WmObjCmd):
+ * generic/tkConfig.c (DoObjConfig):
+ * generic/tkEntry.c (EntryWidgetObjCmd, SpinboxWidgetObjCmd):
+ * generic/tkFocus.c (Tk_FocusObjCmd):
+ * generic/tkFont.c (Tk_FocusObjCmd, ConfigAttributesObj):
+ * generic/tkFrame.c (Tk_FrameObjCmd):
+ * generic/tkGet.c (Tk_GetAnchorFromObj, Tk_GetJustifyFromObj):
+ * generic/tkGrab.c (Tk_GrabObjCmd):
+ * generic/tkGrid.c (Tk_GridObjCmd, GridRowColumnConfigureCommand)
+ (GridSlavesCommand, ConfigureSlaves):
+ * generic/tkImage.c (Tk_ImageObjCmd):
+ * generic/tkImgBmap.c (ImgBmapCmd):
+ * generic/tkImgGIF.c (FileReadGIF):
+ * generic/tkImgPhoto.c (ImgPhotoCmd):
+ * generic/tkListbox.c (ListboxWidgetObjCmd, ListboxSelectionSubCmd)
+ (GetListboxIndex):
+ * generic/tkMenu.c (MenuWidgetObjCmd, MenuAddOrInsert, MenuCmd)
+ (ConfigureMenu, CloneMenu):
+ * generic/tkMenubutton.c (MenuButtonWidgetObjCmd):
+ * generic/tkMessage.c (MessageWidgetObjCmd):
+ * generic/tkOption.c (Tk_OptionObjCmd):
+ * generic/tkPack.c (Tk_PackObjCmd, ConfigureSlaves):
+ * generic/tkPlace.c (Tk_PlaceObjCmd):
+ * generic/tkScale.c (ScaleWidgetObjCmd):
+ * generic/tkSelect.c (Tk_SelectionObjCmd):
+ * generic/tkSquare.c (SquareWidgetObjCmd):
+ * generic/tkTest.c (TestobjconfigObjCmd, TrivialConfigObjCmd)
+ (TestfontObjCmd): Updates to handle change in type of tablePtr
+ argument of Tcl_GetIndexFromObj(Struct) from (char **) to
+ (CONST char **). [TIP 27] [Patch 504705]
+
+ * generic/tkCanvText.c (GetSelText):
+ * generic/tkEntry.c (Entry{FetchSelection,Setvalue},ExpandPercents):
+ * generic/tkSelect.c (HandleTclCommand):
+ * generic/tkText.c (TextSearchCmd):
+ * generic/tkTextIndex.c (TkTextMakeByteIndex, TkTextIndexBackChars):
+ * mac/tkMacFont.c (Tk_MeasureChars, BreakLine):
+ * unix/tkUnixMenu.c (DrawMenuUnderline):
+ * win/tkWinMenu.c (GetEntryText, DrawMenuUnderline): Updated
+ callers of Tcl_Utf* and Tcl_Regexp* APIs to reflect TIP 27 API
+ changes (see Tcl Patch 471509). [Patch 471513]
+
+2002-01-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2002-01-04 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c (Tk_MainEx): Updated callers of CONSTified
+ Tcl interfaces Tcl_EvalFile and TclGetStartupScriptFileName.
+
+ * generic/tkConsole.c (ConsoleOutputProc, TkConsolePrint):
+ * generic/tkInt.h (TkConsolePrint):
+ * mac/tkMacAppInit.c (TkConsolePrint): Updated Tk's console to
+ CONSTified channel driver interface. [Tcl Patch 503565, Tk Patch
+ 503983]
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Use ${libdir} instead of ${exec_prefix}/lib. [Tcl bug 489370]
+
+ * unix/configure: Regen.
+ * unix/configure.in: Define and use libdir.
+ * win/configure: Regen.
+ * win/configure.in: Define libdir.
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Burn Tcl and Tk build
+ directories into tktest executable to avoid crashes
+ caused by ld loading a previously installed version
+ of the tcl or tk shared libraries. Remove setting
+ of LD_LIBRARY_PATH, LIBPATH, and SHLIB_PATH
+ before running tktest since it should no
+ longer be required.
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Enable use of Tcl stubs when building Tk as
+ a shared library. This should fix the build
+ under AIX. [Bugs 220858, 220955, 220921]
+
+ * unix/Makefile.in: Add TCL_STUB_LIB_SPEC and
+ TCL_STUB_LIB_FLAG variables.
+ * unix/configure: Regen.
+ * unix/configure.in: Pass TCL_STUB_LIB_SPEC into
+ Makefile and use it when linking the tk shared library.
+ Define USE_TCL_STUBS when building shared. Subst
+ TCL_STUB_LIB_SPEC and TCL_STUB_LIB_FLAG.
+
+2002-01-08 D. Richard Hipp <drh@hwaci.com>
+
+ * win/tkWinMenu.c: Fix the following bug: If you select an entry
+ on a cascade menu then the next time the parent menu is posted, the
+ cascade entry was active. Also, if you traverse to a disabled entry
+ using keystrokes and press ENTER on the disabled entry, then that
+ entry appears active the next time the menu is posted. The same
+ patch fixes both problems.
+
+2002-01-04 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindFree):
+ * generic/tkGrid.c (ResolveConstraints,CheckSlotData,DestroyGrid):
+ * generic/tkSelect.c (Tk_DeleteSelHandler,TkSelDeadWindow): Replaced
+ Tcl_Free calls with ckfree so that memory debugging is fully supported.
+
+2001-12-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * test/winButton.test:
+ * win/tkWinButton.c: added updated patch #463234 which returns the
+ default sizing behavior (not so native), but enables native L&F
+ with negative sizing (-11 for example).
+
+ * library/text.tcl (tk::TextButton1): made text receive focus even
+ in disabled state for Windows to show selection and allow
+ mouse-wheel scrolling.
+
+ * win/tkWinInit.c (TkpDisplayWarning): added Tcl_DStringFree's
+
+ * win/tkWinInt.h:
+ * win/tkWinX.c: added TkWinProcs that represent a function table
+ to switch between unicode and ansi procs on Windows. This is
+ analogous to the TclWinProcs. Using Tcl_WinUtfToTChar, we can
+ easily take advantage of using unicode functions where available
+ without having to switch on the platform id each time.
+
+ * win/tkWinWm.c (InitWindowClass): corrected init routines to
+ allow unicode in window titles on Windows (for Win2K/XP).
+ (TkWmStackorderToplevel): Corrected casts to enable debug compile
+
+ * win/configure: regen'ed
+ * win/tcl.m4: added shell32.lib to link libs, as these are
+ necessary for new directory chooser (when enabled).
+
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): use MessageBoxW for
+ proper display of unicode errors.
+ Added patch which uses new OLE based directory chooser. This
+ still has some issues, so is disabled by default. [Patch #468139]
+ (ColorDlgHookProc) Corrected ability to use unicode chars in
+ tk_chooseColor -title.
+
+2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinInit.c (TkpDisplayWarning): Use MessageBoxW in case the
+ error displayed has unicode chars. [Bug #485986]
+
+2001-12-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacInit.c:
+ * mac/tkMacResource.r: synced up tkInit features to unix/win:
+ use existing tkInit proc if defined. Added spinbox.tcl resource.
+ Used TclGetEnv() instead of Tcl_GetVar2(interp, env)
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r: minor version resources cleanup
+
+2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): guard against being
+ called while the *button/label is being deleted. [Bug #490051]
+
+ * library/entry.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl: added extra checks against bug #220269 and
+ made spinbox reuse more of the entry procedure code.
+
+2001-12-20 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2001-12-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Move EXP file changes over from
+ Tcl configure script to fix AIX build with gcc. [Bug 220955]
+
+2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Use $(MAKE) instead of make
+ in the tcltest rule.
+
+2001-12-18 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/event.test (event-click-drag-1.2): Corrected test that
+ failed on Solaris/CDE due to text scrolling. [Bug 413735]
+
+2001-12-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/spinbox.tcl (ButtonDown): added catch to ignore
+ possible error in after cancel when Priv(afterId) isn't defined.
+
+ * doc/spinbox.n: corrected spin(up|down) -> button(up|down)
+
+2001-12-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/getOpenFile.n: Documented change.
+ * library/tkfbox.tcl (SetFilter): Added code to guess the correct
+ default extension from whatever value was selected in the
+ filetypes option menu. Adapted from code by Chris Nelson
+ submitted in Patch #492220.
+
+2001-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap): added static
+
+2001-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c:
+ * generic/tkText.h: changed TkTextEditType enums to be prefaced
+ with TK_EDIT_ to prevent name collision.
+
+2001-12-05 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacWm.c: mac implementation of wm stackorder
+ (patch 481148, TIP 74)
+
+2001-12-03 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Add TK patch 481148 to implement TIP 74, the
+ wm stackorder command.
+
+ * doc/winfo.n: Update documentation for the winfo
+ children command to indicate that top-level windows
+ are not returned in stacking order.
+ * doc/wm.n: Add documentation for wm stackorder.
+ * generic/tkInt.decls (TkWmStackorderToplevel):
+ Add decl for new function.
+ * generic/tkIntDecls.h: Regen.
+ * generic/tkStubInit.c: Regen.
+ * tests/unixWm.test: Add stackorder command to test
+ for wm command usage message.
+ * tests/wm.test: Add new set of tests for generic
+ window manager methods.
+ * unix/tkUnixWm.c (Tk_WmCmd, TkWmStackorderToplevelWrapperMap)
+ (TkWmStackorderToplevel): Add unix implementation of
+ new wm stackorder command.
+ * win/tkWinWm.c (Tk_WmCmd, TkWmStackorderToplevelEnumProc)
+ (TkWmStackorderToplevelWrapperMap, TkWmStackorderToplevel): Add
+ windows implementation of new wm stackorder command.
+
+2001-12-03 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: install target changes by request from
+ Ryan Casey <scfiead@hotmail.com>.
+
+2001-11-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: Further overhauling; shrank fonts, made
+ better use of fonts, added an icon, fixed the About box. Prompted
+ by Bug #487442 from Vincent Wartelle.
+
+2001-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/palette.tcl (tk_setPalette): Added heuristic to guess
+ from the background whether to use black or white for the
+ foreground when not told specifically. Suggested by Chris Nelson,
+ this makes the command fit the documentation better!
+
+2001-11-27 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Fixed CAT32 target. cat.c is located in the Tcl
+ source, not the Tk source.
+
+2001-11-27 D. Richard Hipp <drh@hwaci.com>
+
+ * library/menu.tcl: Do not allow keyboard traversal of torn-off
+ menus to visit the (invisible) tearoff bar.
+
+2001-11-26 D. Richard Hipp <drh@hwaci.com>
+
+ * win/tkWinMenu.c: disabled menu items show the activebackground
+ color in their background. This change makes menu behavior
+ consistent with what native windows does.
+
+2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Add comments to better describe
+ TCL_EXE and when it should be available. Add
+ rule that prints message about running `make genstubs`
+ when tkStubInit.c is out of date.
+ * win/Makefile.in: Add TCL_TOOL_DIR and TCL_EXE
+ variables to better match the Tcl Makefile. Add
+ genstubs rule so tkSTubInit.c can be regenerated.
+
+2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/configure.in: Don't AC_SUBST CFLAGS_DEBUG, CFLAGS_OPTIMIZE,
+ or CFLAGS_WARNING since it is now done in SC_CONFIG_CFLAGS.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): AC_SUBST DL_LIBS, CFLAGS_DEBUG,
+ CFLAGS_OPTIMIZE, and CFLAGS_WARNING.
+
+2001-11-23 Daniel Steffen <das@users.sourceforge.net>
+
+ Up-port to 8.4 of mac code changes for 8.3.3 & various new
+ changes for 8.4, some already backported to 8.3.4 (patch #435660)
+
+ * library/tk.tcl: added <Key-F1> binding for <<Undo>> on the mac (TIP26)
+
+ * library/button.tcl: fixed undefined $Priv(repeated) error for button
+ without -repeatdelay support
+
+ * generic/tkConsole.c:
+ * library/console.tcl:
+ * mac/tkMacInit.c:
+ * mac/tkMacResource.r: corrected how mac deals with tcl library
+ files present both in resources and in $tk_library directory.
+
+ * generic/tkConsole.c: crashing bug fix when printing to console
+ at program exit after the console has already been closed.
+ Now setting gStdoutInterp=NULL in ConsoleClose().
+
+ * mac/tkMacInit.c: correct use of Tcl_JoinPath in tk_library
+ initialization
+
+ * mac/tkMacMenu.c: special MDEF_PROC_OFFSET only needed for
+ exactly one specific version of the MWERKS 68k compiler .
+
+ * mac/tkMacShLib.exp: removed file
+
+ * unix/Makefile.in: removed reference to .exp files
+
+ * mac/MWTkBuildLibHeader.h:
+ * mac/MW_TkBuildLibHeader.pch:
+ * mac/MW_TkHeaderCommon.h:
+ * mac/MW_TkOldImgStaticHeader.h:
+ * mac/MW_TkStaticHeader.h:
+ * mac/MW_TkStaticHeader.pch: new precompiled header files
+
+ * mac/MW_TkHeader.pch:
+ * mac/MW_TkOldImgHeader.h:
+ * mac/MW_TkTestHeader.pch: revised precompiled header handling: now
+ include a common header file 'MW_TkHeaderCommon.h' from all .pch files,
+ the .pch files themselves now only setup #defines (e.g. BUILD_tk,
+ STATIC_BUILD, TCL_DEBUG, TCL_THREADS) like in makefiles on other
+ platforms.
+
+ * mac/tkMac.h:
+ * mac/tkMacPort.h:
+ * mac/tkMacInt.h: use of BUILD_tk and TCL_STORAGE_CLASS like on other
+ platforms, standardize #include'd files to what's done on other
+ platforms, removed use of #pragma export, changed extern to EXTERN
+ where appropriate to enable DLL export via the TCL_STORAGE_CLASS
+ mechanism.
+
+ * mac/tkMacAppearanceStubs.c: removed use of #pragma export
+
+ * mac/widget.r: new resource file for 'Widget Demos'
+
+ * mac/tkMacProjects.sea.hqx: updated mac build project files:
+ build support for CodeWarrior Pro6, UnivIntf 3.4 & shared runtime
+ libraries (see Tcl ChangeLog for details).
+ changed weak linking so that CFM68k binaries now work on all OS
+ versions from the free 7.5.5 onwards, with or without AppearanceMgr
+ and/or NavigationMgr installed.
+ added target to automatically build 'Widget Demos'
+ included XML versions of the projects for CW Pro5 or Pro7 users.
+ use compat/strtod.c instead of MSL's strtod()
+
+ * generic/tkInt.decls:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c:
+
+ * mac/tkMacInt.h: MAC_TCL tk stub support was badly broken due to
+ multiply defined (mac specific) names in tk.decls and tkInt.decls,
+ removed the duplicates from the internal unsupported interfaces
+ "interface tkInt" and "interface tkIntPlat"; moved declaration of
+ TkpIsWindowFloating from tkMacInt.h to tkInt.decls: interface tkIntPlat.
+ - these changes to the stub tables might require you to recompile your
+ Tk extensions if they turn out to reference one of the removed routines
+ in the wrong table (should be unlikely).
+
+ * generic/tkMain.c: MAC_TCL: workaround for broken/non-standard isatty
+ on MW Pro6, #include <unistd.h> instead of defining isatty
+
+ * generic/tkPointer.c: MAC_TCL: #include tkMacInt.h
+
+ * generic/tkStubLib.c: MAC_TCL: removed obsolete special casing of mac
+ headers, standardize #include'd files to what's done on other platforms
+
+ * mac/tclets.r:
+ * mac/tkMacWindowMgr.c:
+ * mac/tkMacScrlbr.c:
+ * mac/tkMacMenu.c:
+ * mac/tkMacMenus.c:
+ * mac/tkMacFont.c:
+ * mac/tkMacDialog.c:
+ * mac/tkMacButton.c: renamed obsolete apple API names to modern
+ equivalents; UH3.4 support: added #include <ControlDefinitions.h>;
+ fixed munged non-ASCII chars in sources due to bungled latin1<->mac
+ roman encoding in CVS repository.
+
+ * mac/tkMacDialog.c: added support for -filetypes option (fix for bug
+ tcl #221636); added update event handling for background windows while
+ in a NavigationMgr dialog; fixed nasty bug when calling CustomGetFile
+ (missing addr operator) (fix for bug tk #220911 & tcl #219367); renamed
+ routines conflicting with standard MoreFiles headers (see Tcl ChangeLog
+ for details)
+
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r:
+ * mac/tkMacResource.r: fixed obsolete copyrights/dates in version
+ strings, updated version strings to standard usage, added support for
+ '(Support Libraries)' subfolder for shared runtime libraries in
+ unmerged binaries, commented out demo setting of "Tcl Environment
+ Variables"; reorganized resources among these files to avoid
+ multiple copies in applications and shared libraries, the script
+ libraries/Xcursors etc are now no longer duplicated in Wish but are
+ only included in the resources of Tk.shlb.
+
+ * mac/tkMacMenu.c:
+ * mac/tkMacMDEF.r: changes to support MW Pro 6 68k (vers 0x2400 only)
+ compiler producing different offset to start of MDEF; fix to static 68k
+ presence testing when calling the custom MDEF
+
+ * mac/tkMacWm.c.c:
+ * mac/tkMacWindowMgr.c: added/fixed AppearanceMgr checks; override
+ AppearanceMgr version detection on static 68k to ensure static 68k Wish
+ runs on PPCs with recent AppearanceMgr
+
+ * mac/tkMacButton.c: fixed misplaced/missing variable initialization.
+
+2001-11-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (TextGetText): reworked to use DString for
+ improved speed. (callewaert, darley)
+ (DestroyText): plugged mem leak when not clearing stack (callewaert)
+ (TextGetText): more efficient string size calculation (darley)
+
+2001-11-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/entry3.tcl: New demo showing off validation and
+ password entry.
+
+ * library/demos/widget: Some reorganization to make the code
+ simpler, plus a new entry demo.
+
+2001-11-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinButton.c (TkpComputeButtonGeometry): corrected the
+ default size of Windows buttons to conform to the Windows style.
+ This changes the default size of buttons on Windows.
+ [Patch #463234] (nelson)
+ **** POTENTIAL VISUAL INCOMPATABILITY ****
+
+2001-11-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/menu.tcl: corrected menu traversal code on Unix to
+ better handle entering cascades. [Patch #481219] (oleinick)
+
+2001-11-16 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Install target repaired.
+
+2001-11-15 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl: Many improvements to this
+ image-viewing demo; now uses labelframes and tk_chooseDirectory
+
+ * library/palette.tcl (::tk::RecolorTree): Made this work better
+ with CDE, which does some extremely annoying things with the
+ option database that interact badly with Tk's way of handling
+ options.
+
+ * doc/text.n: Overhauled the documentation of undo to make it
+ easier to understand.
+ * library/tk.tcl (::tk::EventMotifBindings): Added Emacs-like undo
+ binding, but not behaviour (we separate undo and redo.)
+ * library/demos/text.tcl: Show off our undo capability!
+
+2001-11-12 David Gravereaux <davygrvy@pobox.com>
+
+ * win/mkd.bat:
+ * win/rmd.bat: Removed -kb CVS attribute and added changes
+ from Llyod Lim for better stability. [Patch #456761]
+
+ * win/rules.vc(new):
+ * win/buildall.vc.bat(new):
+ * win/makefile.vc: large rewrite following Tcl's makefile.vc as
+ a guide and Patch #456761. Appears BugFree(tm).
+
+2001-11-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n:
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextTag.c:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * mac/tkMacDefault.h:
+ * tests/text.test:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: added TIP #26 implementation of simple
+ built-in undo/redo of text editing in the text widget.
+ [Patch #458879] (callewaert)
+
+2001-11-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/menu.tcl: Show off -compound support in menus.
+
+ * library/demos/radio.tcl: Added some code to both show off the
+ extra capabilities of the buttons and also show what can be done
+ with compound images on the sly.
+
+2001-11-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add "make gdb" target. This target
+ can run wish inside either gdb or insight.
+
+2001-11-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/clrpick.tcl: changed a few parameters so that the full
+ 0..255 range could be accessed via the mouse. [Bug #478498]
+
+ * unix/configure:
+ * unix/tcl.m4: added -lc to AIX libs, fixed path to ldAix
+
+ * win/configure:
+ * win/tcl.m4:
+ * win/makefile.vc: add comctl32.lib to build libs.
+ * win/tkWinX.c (TkWinXInit): added InitCommonControlsEx call.
+ * win/rc/tk.rc:
+ * win/rc/wish.rc:
+ * win/rc/wish.exe.manifest: added resources that specify using v6
+ of the MS Common Controls library when available (WinXP+). This
+ enables use of the themeable widgets (like scrollbars) to be used
+ in Tk. [Patch #478933]
+
+2001-11-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-11-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ Avoid adding libc to the LIBS and WISH_LIBS
+ variables since it is not needed when linking with CC.
+ If required when linking with LD it should be done
+ on a case by case basis in tcl.m4.
+
+2001-11-05 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/dialog2.tcl: Typo-fix.
+ * library/demos/browse, library/demos/ixset, library/demos/rolodex:
+ Installation does version number fixup, so we shouldn't. Thanks
+ to wohnivec@iol.cz for pointing these (thankfully minor) problems
+ out.
+
+2001-10-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: Integrated labelframe item into the labels
+ section and added a spinbox demo to the (retitled) entry section.
+
+ * library/demos/labelframe.tcl: Adjusted so as to show off the
+ labelframe widget to better effect and have a better description.
+
+ * library/demos/spin.tcl: New demo to show off spinbox capabilities.
+
+ * library/demos/rolodex: Changes up-ported from core-8-3-1-branch
+ to make the script use more 8.*-isms, but not menus due to the way
+ the context help system works.
+
+ * library/demos/ixset: Changed to use the labelframe widget and
+ the grid geometry manager.
+
+2001-10-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/browse: Changes up-ported from core-8-3-1-branch
+ to make the script much more robust, particularly when neither the
+ current version of wish or the script are on the path.
+
+ * library/demos/hello: Added emacs trailing tag-line.
+
+ * library/demos/tcolor: Changes up-ported from core-8-3-1-branch
+ to make the script compliant with current good practise, as well
+ as extensive use of the new labelframe widget.
+
+ * library/demos/timer: Changes up-ported from core-8-3-1-branch to
+ make the script look and work better.
+
+ * library/demos/rmt: Changes up-ported from core-8-3-1-branch to
+ use more 8.* features and make the demo script more generally
+ useful to people.
+
+2001-10-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkCursor.c (Tk_GetCursorFromData): Fixed uninit nextPtr
+ field. [adapted from Patch 473875]
+ (GetCursor): Removed double-assignment to nextPtr field.
+
+2001-10-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/console.tcl: removed transpose ability until the console
+ can get a proper rewrite of tag handling.
+
+2001-10-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/defs.tcl: removed threaded build warning under X.
+
+ * library/console.tcl (ConsoleOutput): fixed undefined widget
+ argument.
+
+2001-10-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/xmfbox.tcl: fixed filtering in motif file dialog.
+ [Patch #469670] (nelson)
+
+ * generic/tkWindow.c (OpenIM): Added simple XIM patch to enable
+ basic XIM input on Unix. [Patch #412727] (fabian)
+
+2001-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/configure.in:
+ * win/configure:
+ * win/configure.in:
+ * win/tkConfig.sh.in: reworked to be a little cleaner in
+ comparison to each other, and to AC_SUBST even empty vars for
+ win/tkConfig.sh
+
+2001-10-12 Todd M. Helfter <tmh@purdue.edu>
+
+ * ChangeLog:
+ * doc/menu.n:
+ * generic/tkMenu.c:
+ * generic/tkMenu.h:
+ * generic/tkMenubutton.c:
+ * generic/tkMenubutton.h:
+ * mac/tkMacDefault.h:
+ * mac/tkMacMenu.c:
+ * mac/tkMacMenubutton.c:
+ * tests/menu.test:
+ * unix/tkUnixDefault.h:
+ * unix/tkUnixMenu.c:
+ * win/makefile.vc:
+ * win/tkWinDefault.h:
+ * win/tkWinMenu.c:
+ * win/tkWinWm.c: Implementation of TIP #63, the addition of
+ a -compound option to menu entries allowing text and an image to
+ be displayed at the same time.
+
+2001-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/console.tcl: added more smarts extracted from tkcon to
+ the default console.
+
+2001-10-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinTest.c: better error reporting from testclipboard
+
+ * win/tkWinDialog.c: minor cast changes to support Win64
+
+ * win/tkWinWindow.c: made use of standard Tk_GetHWND instead of
+ older, private TkWinGetHWND.
+
+ * win/configure: regen'ed
+ * win/tcl.m4:
+ * win/makefile.vc: updated for Win64 SDK RC1 compilation support
+
+2001-09-30 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/grid.n:
+ * generic/tkGrid.c:
+ * tests/grid.test: Added -uniform option to grid's row/column-
+ configure. [TIP 37] [Patch 459343]
+
+2001-09-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * win/tkWinFont.c (Tk_DrawChars): Added support for clipping text.
+
+ * doc/frame.n:
+ * doc/labelframe.n:
+ * doc/toplevel.n:
+ * generic/tkFrame.c:
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * library/demos/radio.tcl:
+ * library/demos/labelframe.tcl:
+ * library/demos/widget:
+ * mac/tkMacDefault.h:
+ * tests/frame.test:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: Added labelframe widget. Added -padx/y
+ options to frame and toplevel.
+
+ * tests/grid.test:
+ * tests/pack.test:
+ * tests/place.test: Used labelframe to test geometry manager changes.
+ [TIP 18] [Patch 429164]
+
+2001-09-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/GeomReq.3:
+ * doc/WindowId.3:
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tkDecls.h:
+ * generic/tkGeometry.c:
+ * generic/tkGrid.c (ArrangeGrid):
+ * generic/tkInt.h:
+ * generic/tkPack.c (ArrangePacking):
+ * generic/tkPlace.c (RecomputePlacement):
+ * generic/tkStubInit.c:
+ * generic/tkUtil.c (TkComputeAnchor):
+ * generic/tkWindow.c (TkAllocWindow):
+ * unix/mkLinks: Geometry manager changes to support TIP#18.
+ Allows a widget to set different internal border widths on
+ different sides, and to set a minimum requested size.
+ POTENTIAL INCOMPATIBILITY. [Patch 429164]
+
+2001-09-25 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkBind.c:
+ * generic/tkInt.decls (TkpScanWindowId):
+ * unix/tkUnixPort.h (Tkp{Print,Scan}WindowId):
+ * unix/tkUnixXId.c (TkpScanWindowId):
+ * win/tkWinWindow.c (TkpScanWindowId): Corrected definition of
+ TkpScanWindowId to handle situation where types Window and int
+ do not have the same number of bits. CONST-ified too.
+
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c: make genstubs
+
+2001-09-24 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c (StdinProc): Update to handle change in
+ return type of Tcl_DStringAppend() from (char *) to (CONST char *).
+ [TIP 27]
+
+2001-09-23 Peter Spjuth <peter.spjuth@space.se>
+ * generic/tkPack.c (ConfigureSlaves):
+ * tests/pack.test:
+ * tests/grid.test: Pack accepted asymmetric values for -ipadx/y.
+ Only -padx/y supports asymmetry. [Bug #462348]
+
+2001-09-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWindow.c (TkpPrintWindowId, TkpScanWindowId): fixed to
+ work on Win64 with 64bit XIDs.
+
+ * generic/tkWindow.c (Tk_CreateAnonymousWindow):
+ * generic/tkEntry.c (GetSpinboxElement): fixed unreachable returns.
+
+ * win/tkWinX.c (TkGetServerInfo): added recognition of Win64.
+
+ * xlib/X11/X.h: made XID __int64 type for Win64.
+
+ * unix/tkUnixPort.h:
+ * mac/tkMacPort.h: add (int*) cast to TkpScanWindowId.
+ These may need to be changed to Window* (ulong).
+
+ * generic/tkCmds.c (Tk_WinfoObjCmd):
+ * generic/tkBind.c (NameToWindow):
+ correct Window id's to be of type Window
+
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkInt.decls (TkpScanWindowId): changed decl to use
+ Window* instead of int*.
+
+ * xlib/xcolors.c:
+ * generic/tkPack.c,tkWindow.c:
+ * win/tkWinFont.c,tkWinMenu.c:
+ * unix/tkUnixScale.c: minor cast fixes to prevent 64bit warnings.
+
+ * tests/scrollbar.test (scrollbar-6.27): marked knownBug because
+ it is skewed by bad dimensions returned by Windows.
+
+ * tests/textDisp.test (textDisp-4.12): corrected test to work
+ properly on Windows.
+
+ * tests/id.test,macFont.test,macMenu.test,macscrollbar.test:
+ * tests/send.test,winClipboard.test,winDialog.test,winFont.test:
+ improved use of test constraints
+
+ * win/tkWinWm.c (WinSetIcon): fixed SetClassLong for 64bit support.
+
+2001-09-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen'ed
+ * unix/tcl.m4: added --enable-64bit support for HP-11 with the
+ 64-bit kernel.
+
+2001-09-17 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkGrid.c (ConfigureSlaves):
+ * generic/tkPack.c (PackAfter): Corrected type definition of
+ argument passed to Tcl_GetStringFromObj() from size_t to int.
+ Incorrect type broke [pack] and [grid] on systems where
+ sizeof(size_t) != sizeof(int). [Bugs 462375, 462342, 462338]
+
+2001-09-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/choosedir.tcl (DblClick):
+ * library/tkfbox.tcl (OkCmd, ListInvoke): Rewrote so as to avoid
+ the highly confusing string "text" and to be consistent about what
+ is and what is not a list. [Bug 459895, reported by fandom]
+
+2001-09-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * generic/tkImgGIF.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkMenu.c: Applied patch [461578], provided by Vincent
+ Darley. This fixes several memory leaks in the image code. They
+ happen if there are errors during the initialization of the
+ channel the image is supposed to be read from.
+
+2001-09-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-09-12 D. Richard Hipp <drh@hwaci.com>
+
+ * library/tkfbox.tcl: fixed error that appeared when you would
+ click on the canvas while viewing an empty directory.
+
+2001-09-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/Makefile.in: Fix Windows Makefile so that
+ tcltest will automatically be compiled if the
+ user tries to build tktest.
+
+2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/Makefile.in: Use TKTEST variable directly
+ instead of depending on the tktest alias.
+
+2001-09-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/mkd.bat:
+ * win/rmd.bat:
+ Apply binary property (cvs admin -kb) to files and convert
+ to CRLF linefeed format to fix the VC++ build. [Tcl Bug #219409]
+
+2001-08-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/menu.test:
+ * tests/send.test:
+ * tests/select.test: corrected to use testConfig constraints in
+ the TK_ALT_DISPLAY case
+
+ * tests/unixSend.test: removed test file completely identical to
+ send.test. Removed platform specific named file in case somebody
+ gets send working on Win/Mac in the future.
+
+ * tests/config.test: added config-14.1 to test namespace import
+ evaluation of widgets.
+ * generic/tkButton.c (ButtonCreate):
+ * generic/tkFrame.c (CreateFrame):
+ * generic/tkMenubutton.c (Tk_MenubuttonObjCmd):
+ * generic/tkPlace.c (Tk_PlaceObjCmd):
+ * generic/tkScale.c (Tk_ScaleObjCmd):
+ * generic/tkMessage.c (Tk_MessageObjCmd):
+ * generic/tkEntry.c (Tk_EntryObjCmd, Tk_SpinboxObjCmd):
+ * generic/tkSquare.c (SquareObjCmd): redid the handling of
+ optionTables in widgets to allow them to be imported into other
+ namespaces. [Bug #456632]
+
+2001-08-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (ChooseDirectoryHookProc): work-around for MS
+ bug that caused crashing in tk_chooseDirectory on Win95.
+ [Bug #224936] (baker)
+
+ * unix/tkUnixWm.c (TkWmRestackToplevel): reworked how
+ ConfigureNotify requests were handled in relation to the parent to
+ avoid the problem with potential 'raise' delays on some wms.
+ [Bug #220260] (baker) wms that were affected should notice the
+ difference in tests unixWm-51.* not failing that failed before.
+
+2001-08-26 Don Porter <dgp@users.sourceforge.net>
+
+ * library/text.tcl (<Shift-Up> binding): Corrected TIP 44 typo
+ that broke binding. Thanks to "Michal" for the fix.
+ [Bug 455468]
+
+2001-08-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: added QNX-6 build support. [Bug #219410] (loverso)
+
+ * doc/CrtPhImgFmt.3: removed bogus note about including tkPhoto.h
+
+2001-08-22 Peter Spjuth <peter.spjuth@space.se>
+
+ * generics/tkGrid.c (ConfigureSlaves):
+ * tests/grid.test: Fixed a bug where adjacent 'x' and '^' where
+ not handled properly. [Bug #452040]
+
+2001-08-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPack.c (TkParsePadAmount): added lint init for sepChar.
+
+ * tests/dialog.test (HitReturn): fixed failing dialog-2.1 test
+ because it wasn't always getting focus properly.
+
+2001-08-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/unixFont.test (unixFont-2.[234]): fixed to be more
+ sensitive on systems that have more installed fonts.
+
+ * library/dialog.tcl (tk_dialog): changed dialog to show bar on
+ Windows as well and added some y padding between the buttons and
+ the bar. [Patch #442835] (harrismh)
+
+2001-08-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * generic/tkGrid.c:
+ * generic/tkPack.c:
+ * tests/grid.test:
+ * tests/oldpack.test:
+ * tests/pack.test: Objectified grid and pack commands.
+
+2001-08-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkObj.c (TkGetWindowFromObj): Rewrote window code to
+ reuse a previously worked-out set of window information exactly
+ when the reference window is the same and no window deletions have
+ occurred since the object was allocated (display has same epoch
+ counter.) Required changing the internal rep of the window quite
+ a bit as now need to save three words-worth of information in the
+ internal rep (this window, reference window, display epoch.)
+ * generic/tkObj.c (SetWindowFromAny, DupWindowInternalRep)
+ (FreeWindowInternalRep): Code to support new internal rep for
+ window objects.
+ * generic/tkInt.h: Added epoch counter to TkDisplay structure
+ * generic/tkWindow.c (GetScreen, Tk_DestroyWindow): Epoch counter
+ is incremented every time a window is deleted.
+
+2001-08-18 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/grid.n:
+ * tests/grid.test:
+ * generic/tkGrid.c: Grid configure rejected initial "x" and "^".
+ [Bug #418664]
+
+2001-08-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkObj.c (TkGetWindowFromObj): Was failing to reuse
+ cached window objects, forcing a call to Tcl_GetStringFromObj and
+ Tk_NameToWindow every time. This fault has been in there for
+ nearly three years...
+
+2001-08-15 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Labelled the TIP 44 changes as "POTENTIAL INCOMPATIBILITY".
+ Although technically internal changes are not incompatible, they'll
+ be perceived as such by those who get bitten, and this will help
+ them find the cause of their trouble.
+
+2001-08-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tk{Util,Font,Cursor,Color,Bitmap,3d}.c: Modified
+ objtype declarations so that they can be picked up in tkObj.c and
+ the names are now prefixed with "tk" too.
+ * generic/tkObj.c (TkRegisterObjTypes):
+ * generic/tkWindow.c (Initialize):
+ * generic/tkInt.h: Added code to register Tk's object types with
+ the Tcl runtime. [Tcl Bug 450545]
+
+2001-08-12 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2001-08-10 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl (loadDir): Converted non-portable
+ [glob [file join $dirName *]] to [glob -directory $dirName *]
+ which is both fully portable and more reliable when directory
+ names contain glob-significant characters. [Bug 223313]
+
+2001-08-08 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/dialog.test: New file testing [tk_dialog].
+
+ * library/dialog.tcl:
+ * library/tkfbox.tcl: Corrections to problems introduced by
+ the TIP 44 changes. [Bug 449261]
+
+ * README:
+ * generic/tk.h:
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure:
+ * win/configure.in: Bumped up patchlevel to 8.4a4 to distinguish
+ CVS snapshots from the 8.4a3 release. This does not necessarily
+ mean there will be an 8.4a4 release. [Bug 448938].
+
+2001-08-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): added {unix,win}/tcl.m4 and
+ library/msgs/*.msg to dist target. [Bug: #448802]
+
+2001-08-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ 8.4a3 RELEASE
+
+ * changes:
+ * README: updated for 8.4a3 release
+
+ * unix/configure: regenerated
+ * unix/tcl.m4: added GNU (HURD) configuration target. (brinkmann)
+ [Patch: #442974]
+
+2001-08-06 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c:
+ * generic/tkWindow.c:
+ * library/bgerror.tcl:
+ * library/dialog.tcl:
+ * library/msgbox.tcl:
+ * library/unsupported.tcl:
+ * mac/tclets.tcl:
+ * mac/tkMacHLEvents.c:
+ * mac/tkMacWm.c: TIP 44 changes specific to the Mac and
+ Windows platforms that were overlooked before: tkOpenDocument,
+ tkConsoleExit, tkConsoleOutput, unsupported1 out of namespace :: .
+ Thanks to Vince Darley for prompting another look.
+
+2001-08-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/winMain.c (WishPanic): fixed CONST changes to go with
+ CONST-ification in Tcl.
+
+ * win/configure: regenerated
+ * win/tcl.m4: fixed DLLSUFFIX definition to always be ${DBGX}.dll.
+ This is necessary for TEA compliant builds that build shared
+ against a static-built Tk.
+ * win/Makefile.in ($(WISH)): added $(TK_STUB_LIB_FILE) to build
+ target, otherwise it wouldn't get generated in a static build.
+
+2001-08-01 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/console.n:
+ * doc/menu.n:
+ * doc/text.n:
+ * doc/tkvars.n:
+ * generic/tkBind.c:
+ * generic/tkMenu.c:
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/choosedir.tcl:
+ * library/clrpick.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/optMenu.tcl:
+ * library/palette.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/tclIndex:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/unsupported.tcl:
+ * library/xmfbox.tcl:
+ * mac/tkMacMenu.c:
+ * tests/clrpick.test:
+ * tests/filebox.test:
+ * tests/macMenu.test:
+ * tests/menu.test:
+ * tests/menuDraw.test:
+ * tests/msgbox.test:
+ * tests/text.test:
+ * tests/unixMenu.test:
+ * tests/winMenu.test:
+ * tests/xmfbox.test:
+ * unix/mkLinks:
+ * unix/tkUnixDialog.c: Merged changes from feature branch
+ dgp-privates-into-namespace, implementing TIP 44. All
+ Tk commands and variables matching tk[A-Z]* are now in the
+ ::tk namespace. See "BRANCH: dgp-privates-into-namespace"
+ entries below for details. [FR 220936]
+
+2001-07-24 Mo DeJong <mdejong@redhat.com>
+
+ * generic/default.h: Include tkWinDefault.h
+ when built with Cygwin or Mingw.
+
+2001-07-18 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/console.n: Updated names of private console commands.
+
+2001-07-16 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * library/console.tcl:
+ * library/unsupported.tcl: Renamed tk::histNum to tk::HistNum
+ as directed by the Tcl Style Guide.
+
+2001-07-10 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in: Add AR and STLIB_LD variables.
+ * unix/configure:
+ * unix/configure.in: Use STLIB_LD when defining MAKE_LIB
+ and MAKE_STUB_LIB. Subst STLIB_LD, RANLIB, and AR.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2001-07-06 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2001-07-05 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Subst DEPARG directly instead
+ of relying on a variable. This will make Cygwin
+ build faster since an extra exec will be avoided.
+ * win/configure: Regen.
+ * win/configure.in: Subst DEPARG.
+ * win/tcl.m4: Update from Tcl.
+
+2001-07-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README:
+ * unix/README:
+ * win/README: updated READMEs with purls
+
+2001-07-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/canvas.test:
+ * generic/tkCanvPoly.c (PolygonToArea): Added patch that respects
+ the polygon difference of including points in the polygon even
+ when fill is empty. [Bug #226357]
+
+2001-07-03 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Remove PATHTYPE variable.
+ * win/configure: Regen.
+ * win/configure.in: Don't subst PATHTYPE.
+ * win/tcl.m4: Update from Tcl.
+
+2001-07-03 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Don't use VPSEP, instead just use :
+ in the VPATH.
+ * win/configure: Regen.
+ * win/configure.in: Don't subst VPSEP.
+
+2001-07-03 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/xmfbox.tcl (tkMotifFDialog_ActivateSEnt): Added missing
+ backslash [Bug #438247]
+
+2001-07-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkWindow.c (Tk_DestroyWindow): changed to use
+ Tcl_EventuallyFree instead of ckfree so that widgets that have
+ references to a tkwin can use them.
+
+ * generic/tkCanvArc.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkRectOval.c: corrected argument handling in
+ Create<Item> functions that could lead to ABRs or FMRs and
+ corrected names of argc/argv to objc/objv.
+
+ * generic/tkImgGIF.c (Mgetc): corrected screwy use of ternary
+ operator and possible FMR.
+
+ * generic/tkEntry.c: corrected missing Tcl_Release that caused
+ font not freed complaints when trying valid cleanup calls.
+ * generic/tkListbox.c: made use of Tcl_Preserve/Tcl_Release to
+ prevent FMR errors in Display functions.
+
+ * unix/tkUnixScale.c (TkpDisplayScale): corrected FMR when scale
+ was deleted while calling its command.
+
+ * library/console.tcl:
+ * library/entry.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl:
+ * library/tk.tcl: added private ::tk::GetSelection command to
+ handle requesting selection. This is to support requesting
+ UTF8_STRING before generic STRING on Unix. Changed Text, Spinbox,
+ Entry and Console to use this command.
+
+ * tests/select.test:
+ * generic/tkSelect.c (Tk_CreateSelHandler, Tk_DeleteSelHandler):
+ on Unix, a UTF8_STRING handler will be created when the user
+ requests a STRING handler (in addition to the STRING handler).
+ This provides implicit support for the new UTF8_STRING selection
+ target.
+ * unix/tkUnixSelect.c (TkSelEventProc, ConvertSelection): Added
+ support for UTF8_STRING target. [RFE #418653, Patch #433283]
+
+ * generic/tkInt.h: added utf8Atom to TkDisplay structure.
+
+ * tests/listbox.test: changed 'darkblue' to 'white' in a test
+ because it isn't a portable color name.
+
+ * generic/tkEntry.c (DestroyEntry): used Tcl_EventuallyFree
+ instead of ckfree for entryPtr to prevent FMRs. [Bug #413904]
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add `make shell` target. This target
+ will set the proper env vars before invoking wish
+ from the build directory.
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure:
+ * win/configure.in: Revert cross compiling change
+ accidently added during last checkin.
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Fix last checkin by removing
+ export since that only works in bash.
+ * win/configure: Regen.
+ * win/configure.in: Ditto.
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Set CFLAGS to "" if the user
+ did not set CFLAGS in the env. This keeps AC_PROG_CC
+ from adding "-g -O2" to the CFLAGS by default.
+ * win/configure: Regen.
+ * win/configure.in: Ditto.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/configure.in: Use RC_DEFINE flag from tcl.m4.
+ * win/tcl.m4: Update from Tcl.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): Link to the
+ imm32 library when building with mingw gcc.
+ * win/tkWinX.c: Include the imm.h header
+ to fix compiling with mingw gcc.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/configure.in: Add resource compiler fix from
+ 8.3.3 to fix compiling with mingw.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/tcl.m4: Fix silly typo in last checkin.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in: Set CFLAGS to @CFLAGS@ and @CFLAGS_DEFAULT@.
+ Set LDFLAGS to @LDFLAGS@ and @LDFLAGS_DEFAULT@. Add LDFLAGS_DEBUG
+ and LDFLAGS_OPTIMIZE to match the way CFLAGS_DEFAULT works. Use
+ new LDFLAGS variable in the Makefile instead of @LDFLAGS@.
+ * unix/configure: Regen.
+ * unix/configure.in: Don't set CFLAGS to CFLAGS_DEFAULT, instead
+ subst CFLAGS_DEFAULT into the Makefile. Add AC_SUBST for CFLAGS_DEBUG,
+ CFLAGS_OPTIMIZE, LDFLAGS_DEFAULT, LDFLAGS_DEBUG, and LDFLAGS_OPTIMIZE.
+ Remove unused LD_FLAGS subst.
+ * unix/tcl.m4: Update from Tcl.
+ * win/Makefile.in: Set CFLAGS to @CFLAGS@ and @CFLAGS_DEFAULT@.
+ Set LDFLAGS to @LDFLAGS@ and @LDFLAGS_DEFAULT@.
+ * win/configure: Regen.
+ * win/configure.in: Don't set CFLAGS or LDFLAGS, instead subst
+ CFLAGS_DEFAULT and LDFLAGS_DEFAULT into the Makefile.
+ * win/tcl.m4: Update from Tcl.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure:
+ * win/tcl.m4: Update From Tcl.
+
+2001-06-21 eric melski <ericm@interwoven.com>
+
+ * doc/colors.n: Corrected bogus documentation with respect to
+ several shades of blue, all of which were listed as RGB 0 0 0.
+ [Bug #432104].
+
+2001-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/floor.tcl, library/demos/filebox.tcl,
+ * library/demos/clrpick.tcl, library/demos/vscale.tcl,
+ * library/demos/twind.tcl, library/demos/ruler.tcl,
+ * library/demos/plot.tcl, library/demos/items.tcl,
+ * library/demos/hscale.tcl, library/demos/ctext.tcl,
+ * library/demos/cscroll.tcl, library/demos/arrow.tcl,
+ * library/xmfbox.tcl, library/msgbox.tcl,
+ * library/clrpick.tcl, library/bgerror.tcl: Braced expressions.
+
+2001-06-06 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/configure.in: Handle the --prefix option correctly
+ it should default to /usr/local like the unix version.
+
+2001-06-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/selection.n:
+ * doc/clipboard.n: added SEE ALSOs to cross-reference selection
+ and clipboard, with extra note for clipboard command in selection
+ docs. [Patch #422256]
+
+ * unix/tkUnixFont.c: Corrected support for iso10646 (X11 Unicode)
+ fonts on Unix. This adds a ucs-2be (UCS-2 Big Endian) encoding in
+ Tk on Unix that is used for those fonts (X11 requires
+ big-endianness). (welch) [Patch #406411; Bug #220890 #220899]
+ This differs from the 8.3.3 patch by not adding ucs-2be in the
+ preferred encodingList (seems works fine without).
+ Added alias for jisx0201* fonts to jis0201 encoding. [Bug #414033]
+
+2001-05-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinKey.c (TkpSetKeycodeAndState): removed old debug info
+
+2001-05-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinX.c: moved the initialization of tkPlatformId from
+ TkWinXInit to TkWinGetPlatformId because static builds could call
+ it before it was initialized. [Bug #427278]
+
+2001-05-28 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkFrame.c:
+ * generic/tkWindow.c:
+ * tests/frame.test: Upgraded frame to use the newer TK_OPTION
+ style when processing configuration options. Some cleanup of
+ bad comments and bad code. [part of patch #420861]
+
+2001-05-23 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure:
+ * unix/tcl.m4:
+ * win/configure:
+ * win/tcl.m4: Sync from Tcl sources.
+
+2001-05-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tcl.m4: sync'ed up wih Tcl tcl.m4. [Bug #419812]
+
+ * doc/TkInitStubs.3:
+ * generic/tk.h:
+ * generic/tkStubLib.c: CONST'ified Tk_InitStubs to match CONST
+ changes to Tcl_PkgRequireEx.
+
+2001-05-21 Todd M. Helfter <tmh@purdue.edu>
+
+ * doc/menubutton.n:
+ * generic/tkMenubutton.c:
+ * generic/tkMenubutton.h:
+ * mac/tkMacMenubutton.c:
+ * tests/menubut.test:
+ * unix/tkUnixMenubu.c: Implementation of TIP #11, the addition of
+ a -compound option to the menubutton allowing text and an image to
+ be displayed at the same time. This behavior is identical to the
+ behavior of the button widget.
+
+2001-05-16 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/console.n: Added - was erroneously placed in Tcl before...
+
+2001-04-25 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
+
+2001-04-25 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Use $@ in MAKE_LIB and MAKE_STUB_LIB
+ commands instead of using a delayed subst variable. Replace
+ instances of STUB_LIB_FILE with TK_STUB_LIB_FILE.
+
+2001-04-25 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in: Use TCL_STUB_LIB_FILE instead of STUB_LIB_FILE.
+ * unix/configure: Regen.
+ * unix/configure.in: Don't subst STUB_LIB_FILE, use TCL_STUB_LIB_FILE
+ instead.
+
+2001-04-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImage.c (Tk_ImageObjCmd,DeleteImage): Better detection
+ of deletion when world is falling apart. [Bug #220819]
+
+2001-04-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinMenu.c (TkWinHandleMenuEvent): corrected reseting of
+ service mode to only occur when it was set. [Bug #220948]
+
+2001-04-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/winClipboard.test: improved results for understanding when
+ tests fail.
+
+ * tests/winDialog.test: string totitle'd some results that
+ expected [pwd] to return a capital drive letter.
+
+ * tests/cursor.test: changed tests to use 'heart' cursor because
+ 'arrow' on windows has a pre-skewed use count.
+
+ * win/tkWinDialog.c (GetFileNameA): initialize multi to 0.
+
+2001-04-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure:
+ * win/tcl.m4 (SHLIB_LD): added -incremental:no. [Bug #219381]
+
+ * generic/tkMenu.c (TkInvokeMenu): checked for menu deletion
+ before calling associated menu entry command. [Bug #220821]
+
+ * doc/image.n: added warning about names chosen for images.
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): corrected the src and dest
+ values for $imageName put when -format and -to are used.
+ [Bug #232741]
+
+ * tests/listbox.test: added test listbox-27.1, delete during
+ scrollbar update
+ * generic/tkListbox.c (DestroyListbox, ListboxEventProc):
+ corrected listbox to make proper use of Tcl_EventuallyFree and
+ protect against unusual listbox deletion.
+
+ * tests/entry.test: added tests entry-20.*, delete during widget
+ activity
+ * generic/tkEntry.c (DestroyEntry, EntryEventProc): fixed the
+ entry widget to survive deletion while processing scrollbar
+ updates and validation.
+
+ * tests/canvas.test: test of canvas delete during event
+ * generic/tkCanvas.c (DestroyCanvas, CanvasEventProc): fixed the
+ canvas to survive deletion during event processing. [Bug #228024]
+
+2001-04-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README: updated patchlevel to 8.4a3 and corrected links and
+ notes.
+
+ * generic/tk.h:
+ * unix/configure.in (TK_PATCH_LEVEL):
+ * unix/configure:
+ * unix/tk.spec:
+ * win/configure.in (TK_PATCH_LEVEL):
+ * win/configure: updated patchlevel to 8.4a3
+
+2001-03-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/safe.test: added note about correcting failures in
+ safe.test.
+ * library/tk.tcl: moved package require msgcat inside if case to
+ not be used in safe interps.
+
+ * win/makefile.vc:
+ * win/configure:
+ * win/tcl.m4: added imm32.lib to LIBS_GUI for Tk IME support.
+ * win/tkWinInt.h:
+ * win/tkWinKey.c:
+ * win/tkWinX.c: added support for changing IME on the fly in
+ Windows (2000). (lam) [Patch #402993]
+
+ * tests/bind.test (bind-22.18):
+ * generic/tkBind.c (NameToWindow): handled the error case where a
+ valid-looking but invalid identifier could be passed in certain
+ event generate options causing a crash. [Bug #411307]
+
+ * win/tkWinWm.c (UpdateWrapper): ensured that the passed in winPtr
+ had an existent window to operate on. [Bug #409172]
+
+ * win/Makefile.in (install-*): improved install-* targets to use
+ their base build dependency.
+
+ * generic/tkImage.c (Tk_ImageObjCmd, EventuallyDeleteImage):
+ added casts to allow compiling on Windows with debbuging.
+
+2001-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/msgs/de.msg: fixed translations. [Patch #403525]
+
+ * doc/canvas.n: Noted ability to specify coords as a list in the
+ docs. (techentin) [Patch #403660]
+
+ * tests/canvas.test: added test case to check obj conversion
+ * generic/tkObj.c (UpdateStringOfMM, SetMMFromAny): better
+ obj-aware screen distances. (pgbaum, hobbs) [Patch #403327]
+
+ * library/bgerror.tcl (bgerror): allow focus into details window
+ for Windows C&P to work. [Bug #220929]
+
+ * library/tk.tcl: put a catch around adding <hpBackTab> to the
+ <<PrevWindow>> virtual event as it doesn't seem to work on all HP
+ systems. [Bug #411669]
+
+ * library/tkfbox.tcl: fixed selecting directories and single files
+ with spaces using tk_getOpenFile -multiple 1. [Bug #411640]
+
+ * win/tkWinDialog.c (GetFileNameA): added support for -multiple to
+ ascii-based tk_getOpenFile (Win9*). (haneef) [Patch #403047]
+ (GetFileNameW): increased number of files that could be returned
+ by tk_getOpenFile -multiple. [Patch #412042]
+
+2001-03-29 Mo DeJong <mdejong@redhat.com>
+
+ * library/entry.tcl (tkEntryMouseSelect):
+ * library/text.tcl (tkTextSelectTo): When
+ the mouse is dragged with the button down,
+ move the insertion cursor to the current
+ mouse position.
+ * tests/event.test: Add a series of tests
+ for event generation. Add tests for selection,
+ check the position of the insertion cursor.
+
+2001-03-28 Jeff Hobbs <jeffh@gimlet.activestate.com>
+
+ * unix/configure:
+ * unix/tcl.m4: corrected IRIX-5.x config to not use -n32.
+ (english) [Patch 403626]
+
+2001-03-28 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/focus.test (focus-6.1):
+ * tests/macEmbed.test (unixEmbed-5.1):
+ * tests/macMenu.test (macMenu-21.3):
+ * tests/menu.test (menu-27.1):
+ * tests/unixEmbed.test (unixEmbed-8.2):
+ * tests/unixWm.test (unixWm-50.4): Replaced all [load {} tk]
+ in Tk test suite with [load {} Tk]. [Bug 220940, Patch 411952]
+
+2001-03-12 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/menu.n:
+ * unix/mkLinks: Added documentation for [tk_menuSetFocus].
+
+2001-03-12 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/text.n:
+ * doc/tkvars.n:
+ * unix/mkLinks: Added documentation for commands and variables
+ matching tk_text*.
+
+2001-03-08 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * generic/tkTextDisp.c:
+ * library/unsupported.tcl:
+ * tests/textDisp.test: Restored the global variables tk_textRedraw
+ and tk_textRelayout. Since they match tk_*, they should remain
+ publicly available until at least Tk 9.
+
+2001-03-01 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * library/unsupported.tcl: New file for Tk's unsupported
+ interfaces. Contains [tk::unsupported::ExposePrivateCommand]
+ and [tk::unsupported::ExposePrivateVariable] that restore the
+ availability of an old public name of one of Tk's private
+ commands and variables, respectively, for those applications
+ and extensions that depend on the old names against advice.
+
+2001-02-28 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace: Feature branch to move all
+ of Tk's private commands and variable into the ::tk namespace
+ and its children.
+
+ * doc/tkvars.n: Documented private variable tkPriv renamed tk::Priv.
+
+ * generic/tkBind.c:
+ * generic/tkMenu.c:
+ * generic/tkTextDisp.c:
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/choosedir.tcl:
+ * library/clrpick.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/optMenu.tcl:
+ * library/palette.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/tclIndex:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+ * mac/tkMacMenu.c:
+ * tests/clrpick.test:
+ * tests/filebox.test:
+ * tests/macMenu.test:
+ * tests/menu.test:
+ * tests/menuDraw.test:
+ * tests/msgbox.test:
+ * tests/text.test:
+ * tests/textDisp.test:
+ * tests/unixMenu.test:
+ * tests/winMenu.test:
+ * tests/xmfbox.test:
+ * unix/tkUnixDialog.c: All Tk commands matching ::tk[A-Z]* and
+ all Tk private variables in the global namespace were renamed to
+ live in the namespace ::tk or one of its children.
+
+2001-02-13 Eric Melski <ericm@interwoven.com>
+
+ * doc/photo.n: [Bug 132213] Added clarification on interpretation
+ of ranges for "photoName data -from" subcommand.
+
+2001-02-12 D. Richard Hipp <drh@hwaci.com>
+
+ TIP #21: Asymmetric padding in the pack and grid geometry managers.
+ With this changes, you can now say "-padx {10 20}" to put 10 pixels
+ of padding on the left and 20 on the right. Similar rules apply
+ for vertical padding. See the revised documentation for details.
+
+2001-01-02 Andreas Kupries <a.kupries@westend.com>
+
+ Everything below belongs together and implements TIP#8 (SF patch#102833)
+
+ * win/tkWinWm.c (line 56f): Added icon structures.
+ * win/tkWinWm.c (struct WmInfo, line 242): Added reference to
+ optional icon for titlebar.
+ * win/tkWinWm.c (struct ThreadSpecificData, line 335): Added
+ reference to optional default icon for toplevel windows.
+ * win/tkWinWm.c (line 387 ... 1169): All the new functions required
+ to deal with icon specifications, 'InitWm' changed.
+ * win/tkWinWm.c (TkWmNewWindow, UpdateWrapper, TkWmDeadWindow, Tk_WmCmd):
+ Added initialization and handling of the new fields.
+ * doc/wm.n: Documentation updated to explain the newly available
+ functionality.
+
+2000-12-13 jeff hobbs <jhobbs@interwoven.com>
+
+ * generic/tkObj.c (SetMMFromAny): Added ability to recognize
+ double type object to speed up canvas coord calculations.
+ [Patch 403327]
+
+2000-12-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/entry.n: Improved documentation of interplay between the
+ -state and -textvariable options.
+
+2000-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/image.test (image-1.10): Improved this test, which
+ previously only worked if the command failed to delete the root
+ window, and caused *major* trouble otherwise...
+ * generic/tkImage.c (EventuallyDeleteImage): Created this function
+ so that images that get deleted during the creation of an image
+ won't cause a nasty core dump. Properly fixes bug #120819.
+
+2000-11-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/image.n:
+ * generic/tkImage.c (Tk_ImageObjCmd): Backed out previous change.
+ Bug #120819 is back again in force. Left the test in there
+ though.
+
+2000-11-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/image.n:
+ * tests/image.test (image-1.10):
+ * generic/tkImage.c (Tk_ImageObjCmd): Prohibited image names that
+ start with "." since they can cause some really obscure crashes.
+ Fixes Bug #120819.
+
+2000-11-21 Eric Melski <ericm@ajubasolutions.com>
+
+ Overall change: Implemented TIP 5, which exports
+ TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs,
+ adding a size field to Tk_ClassProcs to allow for future
+ expansion, and renaming the geometryProc to worldChangedProc,
+ which is more in keeping with the actual use of the callback.
+
+ * unix/mkLinks: Added link for Tk_SetClassProcs.
+
+ * doc/SetClassProcs.3: Documentation for
+ Tk_ClassProcs/Tk_SetClassProcs.
+
+ * generic/tkCanvas.c:
+ * generic/tkEntry.c:
+ * generic/tkFrame.c:
+ * generic/tkListbox.c:
+ * generic/tkMenu.c:
+ * generic/tkMessage.c:
+ * generic/tkScale.c:
+ * generic/tkText.c: Updated to use Tk_ClassProcs/Tk_SetClassProcs
+ instead of TkClassProcs/TkSetClassProcs.
+
+ * generic/tkMenubutton.c:
+ * generic/tkScrollbar.c:
+ * generic/tkButton.c: Updated to use Tk_SetClassProcs instead of
+ TkSetClassProcs.
+
+ * generic/tkMenubutton.h:
+ * generic/tkScrollbar.h:
+ * generic/tkButton.h:
+ * win/tkWinButton.c:
+ * win/tkWinScrlbr.c:
+ * mac/tkMacButton.c:
+ * mac/tkMacMenubutton.c:
+ * mac/tkMacScrlbr.c:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixMenubu.c:
+ * unix/tkUnixScrlbr.c: Updated to use Tk_ClassProcs instead of
+ TkClassProcs.
+
+ * generic/tkDecls.h:
+ * generic/tkStubInit.c:
+ * generic/tkIntDecls.h: Regenned from tk.decls, tkInt.decls.
+
+ * generic/tk.h: Added declaration of Tk_ClassProcs, with size
+ field. Added typedef's for Tk_ClassCreateProc,
+ Tk_ClassWorldChangedProc, Tk_ClassModalProc. Added definition of
+ Tk_GetClassProc macro, shorthand for extracting a member of the
+ Tk_ClassProcs structure.
+
+ * generic/tkInt.h: Removed declaration of TkClassProcs,
+ TkClassGeometryProc, etc.
+
+ * generic/tkBind.c (Tk_BindEvent): Updated to use Tk_GetClassProc
+ macro to extract modalProc; added check that the modalProc is non-NULL.
+
+ * generic/tkFont.c (RecomputeWidgets): Updated to use
+ Tk_GetClassProc macro to extract worldChangedProc; added comment
+ about the choice of a recursive versus iterative algorithm for
+ propagating world changed messages.
+
+ * generic/tkWindow.c (Tk_MakeWindowExist): Updated to use
+ Tk_GetClassProc macro to extract createProc from Tk_ClassProcs.
+
+ * generic/tk.decls: Added declaration for Tk_SetClassProcs.
+
+ * generic/tkInt.decls: Commented out declaration for
+ TkSetClassProcs, which is made public by this change. The entry
+ is left in place, but commented, so that future developers will
+ know not to reuse it's stub number.
+
+2000-11-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/ConfigWidg.3: Added deprecation note from Bug #120944 - use
+ Tk_SetOption() instead.
+
+ * generic/tkImgPhoto.c (TkPhotoGetValidRegion): Applied patch to
+ create this function and add it to tkInt stubs. Should now be
+ possible to write an extension that accesses the transparency data
+ in a photo image. Bug #120930
+
+2000-11-03 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ 8.4a2 RELEASE
+
+ * generic/tkWindow.c (Initialize): added call to Tcl_SetMainLoop.
+ This only has effect when tclsh is run (not wish), and then Tk is
+ loaded in interactively.
+
+2000-11-02 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/tkWinButton.c:
+ * win/tkWinDialog.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWm.c: fixed up code for Win64 support. This mostly
+ remains in _WIN64 #ifdef's, until updated compilers are standard.
+
+ * win/tcl.m4:
+ * win/makefile.vc: updated for Win64 compile support
+
+ * unix/configure:
+ * win/configure: checked in configure scripts so people doing
+ CVS checkouts aren't required to have autoconf. Changes to
+ configure.in in the future will require the corresponding
+ configure script to also be re-autoconf'ed and checked in.
+
+ * doc/event.n: added note that key events require window focus.
+
+2000-11-01 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/tkWinDialog.c (GetFileNameW, GetFileNameA)
+ (Tk_ChooseDirectoryObjCmd): created
+ work-around for change in NT5.0/98 that caused no initialdir
+ setting to open the browser up in the user's documents dir.
+
+ * tests/color.test: marked color-2.6 nonPortable as we can't
+ reliably assume what 'red' maps to.
+
+2000-11-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/winDialog.test: Corrected expected results for bad option
+ tests (5.2, 5.5) to include -multiple option.
+
+ * win/tkWinDialog.c: Added branch for 0 return from
+ CommDlgExtendedError() switches; this was formerly treated as an
+ error, but it actually is not, since it just means the user hit
+ cancel or closed the dialog. (GetFileNameW): Added better smarts
+ such that -multiple is not considered a valid option for
+ tk_getSaveFile.
+ Removed CommDlgExtendedError() checks for color and choosedir
+ dialogs, and removed all except the explicit invalid filename
+ checks for the file dialogs.
+
+2000-10-30 David Gravereaux <davygrvy@ajubasolutions.com>
+
+ * win/configure.in:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/rc/tk.rc:
+ * win/rc/tk_base.rc (new):
+ * win/rc/wish.rc: Added logic to derive filenames better in the
+ resource scripts based on compile options along with better
+ support for building a static wish shell with cursor resources.
+
+2000-10-27 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * unix/tcl.m4: added support for AIX-5.
+
+ * tests/tk.test:
+ * doc/tk.n: updated to reflect default on status of useinputmethods.
+ * library/tk.tcl: tk useinputmethods is set to 1 by default. This
+ enables Kanji and dead-char input by default. Intro'd in
+ 1999-12-16 with default off to avoid some problems with older X
+ servers that would slow down widget creation over time.
+
+ * win/Makefile.in (test, winhelp, tktest): corrected the
+ TCL_LIBRARY path specification.
+
+2000-10-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/tkWinDraw.c (RenderObject): Applied patch from [Bug: 6368],
+ which corrects rendering of 1-pixel wide stippled lines on Windows.
+
+ * generic/tkCanvLine.c (DisplayLine): Applied patch from
+ [Bug: 6368], corrects bugs relating to use of active- and
+ disabledwidth values for displaying lines (disabledwidth was never
+ used, and activewidth/disablewidths would only possibly be used
+ when greater than default width, rather than when simply not equal
+ to default width).
+
+ * library/tkfbox.tcl (OkCmd): Applied patch from [Bug: 6365],
+ which adds safety for directory names containing spaces or which
+ are non-lists.
+
+ * win/tkWinDialog.c (GetFileNameW, GetFileNameA)
+ (Tk_ChooseColorObjCmd, Tk_ChooseDirectoryObjCmd): Added error
+ checking for the return value from the common dialog functions, so
+ that the commands will not silently fail if the common dialog
+ returns an error. [Bug: 6369].
+
+2000-10-10 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkConfig.c (Tk_InitOptions): Added
+ Tcl_IncrRefCount/Tcl_DecrRefCount calls on valuePtr, to prevent
+ memory leaks when the value object comes from the option
+ database. [Bug: 6275].
+
+2000-10-06 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/Makefile.in (cat32.${OBJEXT}): add win/ subdirectory to
+ cat32 target to correctly find the source file.
+
+2000-10-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkCmds.c (Tk_WinfoObjCmd): Added check for
+ TK_ANONYMOUS_WINDOW flag in the [winfo children] subcommand; if
+ set, the window will not be printed in the list of children.
+
+ * doc/CrtWindow.3: Added entry for Tk_CreateAnonymousWindow.
+
+ * generic/tkWindow.c
+ (Tk_CreateAnonymousWindow): New API for creating anonymous
+ windows. These windows are manipulable from C, but not from Tcl,
+ because they have no pathname associated with them. They are used
+ initially by widgets that do rubber-band resizing (panedwindow,
+ multi-column listbox, etc.), and may be useful for other widgets
+ as well (dropbox, combobox).
+ (Tk_DestroyWindow): Added check for TK_ANONYMOUS_WINDOW flag when
+ determining whether to generate a DestroyNotify event.
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h: Regen'd from tk.decls.
+
+ * generic/tk.decls: Added Tk_CreateAnonymousWindow declaration.
+
+ * generic/tk.h: Added TK_ANONYMOUS_WINDOW flag for Tk_Window's.
+
+2000-10-04 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/MaintGeom.3: Noted that Tk_MaintainGeometry handles direct
+ descendants properly.
+
+ * generic/tkGeometry.c (Tk_MaintainGeometry): Added a check for
+ the case in which the slave window is a direct descendant of the
+ master window. In this case, we need not set up the additional
+ infrastructure normally provide by Tk_MaintainGeometry, because we
+ can rely on the parent/child relationship to handle it for us
+ implicitly. In this case, Tk_MaintainGeometry just calls directly
+ to Tk_MoveResizeWindow. This allows geometry managers to simply
+ always use Tk_MaintainGeometry to maintain geometry for slaves,
+ and avoid doing the direct descendant check themselves.
+ (Tk_UnmaintainGeometry): Added a matching check for the direct
+ descendant case; in this case, Tk_UnmaintainGeometry simply
+ returns immediately.
+
+2000-10-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkButton.c (ConfigureButton): Added tests for -compound
+ option, so that when there is a textvariable and an image, and
+ -compound is not none, the button will display both the
+ textvariable and the image.
+
+ * doc/SetOptions.3: Added note that restoreProc and freeProc may
+ be NULL.
+
+ * generic/tkConfig.c (Tk_RestoreSavedOptions): For custom options,
+ added test that the restoreProc is not NULL, to allow for custom
+ options that don't care about supporting Tk_RestoreSavedOptions.
+
+2000-09-29 D. Richard Hipp <drh@hwaci.com>
+
+ * generic/tkBitmap.c: Changes to prevent a BadMatch error from the
+ Xserver when the same bitmap is used on two or more screens of the
+ same display.
+
+ * tests/menu.test: Print a warning if the TK_ALT_DISPLAY environment
+ variable is not configured so as to test for the bug fix above.
+
+ * library/tk.tcl (::tk::SetGrabFocus): "Catch" the grab in case
+ another application already holds the grab and the "grab" command
+ fails.
+
+2000-09-29 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/Makefile.in: commented use of TESTFLAGS
+ * unix/Makefile.in: added TESTFLAGS to test and testlang targets to
+ conform with Windows makefile and TEA style.
+
+2000-09-29 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkTest.c: Fixed tests to use updated API.
+
+ * doc/SetOptions.3:
+ * generic/tk.h:
+ * generic/tkConfig.c: Changed interface for Tk_CustomOptionSetProc
+ and Tk_CustomOptionGetProc; these now take a pointer to the start
+ of the widget record, and an integer offset to the slot for the
+ option value, instead of just a pointer to the slot. This allows
+ more sophisticated options to do interesting things based on other
+ data in the widget record.
+
+2000-09-17 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tk.h: Added declaration of Tk_ObjCustomOption structure,
+ used for TK_OPTION_CUSTOM, and typedef's of the functions
+ Tk_CustomOptionSetProc, Tk_CustomOptionGetProc,
+ Tk_CustomOptionRestoreProc, and Tk_CustomOptionFreeProc, used for
+ TK_OPTION_CUSTOM.
+
+ * doc/SetOptions.3: Added documentation of TK_OPTION_CUSTOM, and
+ section "CUSTOM OPTION TYPES" explaining how to create and use
+ custom options.
+
+ * tests/config.test: Added tests for custom option type.
+
+ * generic/tkTest.c: Added test support for TK_OPTION_CUSTOM to
+ TestobjconfigObjCmd. Added CustomOption* functions to implement a
+ test custom option.
+
+ * generic/tkConfig.c: Added new option type TK_OPTION_CUSTOM,
+ which allows the definition of custom option types by creating
+ parsing, printing, freeing, and restoring procedures for a custom
+ option. This is needed by the text and canvas widgets if they are
+ to be fully objectified.
+
+2000-09-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/Tk_Init.3:
+ * doc/bell.n:
+ * doc/loadTk.n: minor doc cleanup
+
+2000-09-06 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/HWNDToWindow.3:
+ * doc/GetHWND.3: Changed synopsis to indicate the tkPlatDecls.h
+ should be included, not tk.h.
+
+ * generic/tkPlatDecls.h: Removed #include <windows.h> for Windows,
+ a better solution for now is to update the docs and have extension
+ authors #include <tkPlatDecls.h>.
+
+ * generic/tk.h: Removed '#include "tkPlatDecls.h"', as the
+ incorrect inclusion order between windows.h/tkPlatDecls.h causes
+ build conflicts on Windows.
+
+ * generic/tkPlatDecls.h: Added #include <windows.h> for Windows,
+ so that HWND, etc., are defined properly.
+
+2000-09-06 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/canvas.n: fixed doc bug (ellson). [Bug: 6218]
+
+ * README:
+ * generic/tk.h:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in: updated to patchlevel 8.4a2
+
+ * generic/tkMessage.c (MessageWidgetObjCmd): initialized result to
+ avoid pedantic warning.
+
+ * generic/tkGrab.c (Tk_GrabObjCmd): changed len arg from size_t to
+ int to fix pedantic warning.
+
+2000-09-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/makefile.vc (install-libraries):
+ * win/Makefile.in (install-libraries):
+ * unix/Makefile.in (install-libraries): Added tkPlatDecls.h to
+ list of header files to install.
+
+ * generic/tk.h: Added #include "tkPlatDecls.h", which declares the
+ platform specific component of the public Tk stubs API's.
+
+2000-08-29 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/tkWinMenu.c (DrawWindowsSystemBitmap): Use scratchDC
+ for determining the source's logical coordinates. Patch from
+ [Bug: 6134 (Markus Oberhumer)].
+
+ * win/tkWinMenu.c (SetDefaults): Compute the indicatorDimensions[]
+ under Windows NT/2000 in the same way as under Windows 95/98.
+ Patch from [Bug: 6134 (Markus Oberhumer)].
+
+ * win/tkWinFont.c (GetScreenFont): Added a memset() to
+ pacify memory checkers. Patch from [Bug: 6134 (Markus Oberhumer)].
+
+ * library/tkfbox.tcl (::tk::dialog::file::Update): Corrected
+ handling of multi-pattern filters (eg, "* *.*"), which was broken
+ by the getOpenFile performance patches applied earlier.
+
+2000-08-24 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/toplevel.n:
+ * doc/spinbox.n:
+ * doc/scrollbar.n:
+ * doc/scale.n:
+ * doc/menubutton.n:
+ * doc/menu.n:
+ * doc/listbox.n:
+ * doc/entry.n:
+ * doc/frame.n:
+ * doc/message.n:
+ * doc/checkbutton.n:
+ * doc/radiobutton.n:
+ * doc/button.n:
+ * doc/label.n:
+ * doc/canvas.n:
+ * doc/text.n: Fixed Standard Options section to make best use of
+ new tab settings in man.macros.
+
+2000-08-24 Mo DeJong <mdejong@redhat.com>
+
+ * unix/README: Update to account for removal of --enable-gcc.
+ * unix/configure.in:
+ * unix/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
+ * win/configure.in:
+ * win/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
+ Remove quick hack that provided cross compile support for
+ windows builds.
+
+2000-08-23 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): reversed change below,
+ it was not correct.
+
+2000-08-22 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): changed order of
+ incr/decr of new value object, in case they are equal.
+
+2000-08-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkImgPhoto.c (ImgPhotoGet): Removed redundant call to
+ DitherInstance; this call was formerly being made from
+ ImgPhotoGet->ImgPhotoConfigureInstance->DitherInstance, and
+ ImgPhotoGet->DitherInstance. The second call was removed.
+
+2000-08-10 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/SetOptions.3: added missing ')'.
+
+2000-08-09 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/SetOptions.3: Updated documentation to reflect support for
+ TK_OPTION_NULL_OK for TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
+
+ * generic/tkConfig.c: Added for TK_OPTION_NULL_OK support for
+ TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
+
+ * doc/place.n: Updated, reformatted manual entry.
+
+ * tests/place.test: Added many tests.
+
+ * generic/tkPlace.c (Tk_PlaceObjCmd): Updated to use Tk
+ widget-option management facilities to manage place options (-x,
+ -y, etc.), which simplifies the placer code. Added support for
+ [place configure pathName] and [place configure pathName -option],
+ similar to the behavior of the configure subcommand supported by
+ widgets.
+
+2000-08-08 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/place.test: Extended test suite to test error returns from
+ [place].
+
+ * generic/tkInt.h: Replaced Tk_PlaceCmd prototype with
+ Tk_PlaceObjCmd prototype.
+
+ * generic/tkWindow.c: Updated [place] command entry to use new
+ Tcl_Obj interface.
+
+ * generic/tkPlace.c (Tk_PlaceObjCmd): Tcl_Obj'ified [place] command.
+
+2000-08-07 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkWindow.c: Updated [selection] command entry to use
+ new Tcl_Obj interface.
+
+ * generic/tkInt.h: Replaced Tk_SelectionCmd prototype with
+ Tk_SelectionObjCmd prototype.
+
+ * tests/select.test: Updated test suite to recognize standardized
+ error messages.
+
+ * generic/tkSelect.c (Tk_SelectionObjCmd): Tcl_Obj'ified
+ [selection] command.
+
+2000-08-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/cursors.n: changed .SS to more compatible macros.
+
+2000-08-05 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/safetk.tcl: rationalized the setting of tk_library when
+ initialized Tk in a safe interpreter.
+
+2000-08-03 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkWindow.c: Updated "grab" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkInt.h: Replaced Tk_GrabCmd prototype with
+ Tk_GrabObjCmd prototype.
+
+ * tests/grab.test: Initial suite of tests for [grab] command.
+
+ * generic/tkGrab.c (Tk_GrabObjCmd): Tcl_Obj'ified [grab] command.
+
+ * generic/tkInt.h: Removed Tk_AfterCmd function prototype; the
+ function does not exist (since 4.0p3). Cleaned up some line
+ wrapping.
+
+ * generic/tk.h: Removed "#define Tk_AfterCmd Tcl_AfterCmd";
+ nothing in the core uses Tk_AfterCmd, and Tcl_AfterCmd doesn't exist
+ anymore anyway.
+
+ * generic/tkInt.h: Replace Tk_BindCmd prototype with
+ Tk_BindObjCmd prototype.
+
+ * generic/tkWindow.c: Updated "bind" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkCmds.c (Tk_BindObjCmd): Tcl_Obj'ified [bind] command.
+
+ * tests/bind.test: Tweaked expected error messages for [bindtags]
+ to comply with updated error messages.
+
+ * generic/tkMenu.c (CloneMenu): Replaced calls to Tk_BindtagsCmd
+ with equivalent calls to Tk_BindtagsObjCmd.
+
+ * generic/tkInt.h: Replace Tk_BindtagsCmd prototype with
+ Tk_BindtagsObjCmd prototype.
+
+ * generic/tkWindow.c: Updated "bindtags" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkCmds.c (Tk_BindtagsObjCmd): Tcl_Obj'ified [bindtags]
+ command.
+
+2000-08-02 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkCmds.c (Tk_TkwaitObjCmd): Tcl_Obj'ified [tkwait] command.
+
+ * generic/tkWindow.c: Updated "tkwait" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkInt.h: Replace Tk_TkwaitCmd prototype with
+ Tk_TkwaitObjCmd prototype.
+
+ * generic/tkGrid.c (Tk_GridCmd): Split [grid] subcommands into
+ separate functions instead of inlining them all in Tk_GridCmd.
+
+2000-08-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkInt.h: Replaced prototype for Tk_MessageCmd with
+ prototype for Tk_MessageObjCmd.
+
+ * generic/tkWindow.c: Marked message command as using the new
+ MessageObjCmd instead of the old MessageCmd.
+
+ * tests/message.test: Added tests for the message widget.
+
+ * generic/tkMessage.c: Obj'ified the message widget.
+
+ * generic/tkInt.h: Removed prototype for Tk_ClipboardCmd, added
+ prototype for Tk_ClipboardObjCmd.
+
+ * generic/tkWindow.c: Updated function pointers for clipboard
+ command to use Tcl_Obj version.
+
+ * tests/clipboard.test: Updated tests to expect standard error
+ messages.
+
+ * generic/tkClipboard.c (Tk_ClipboardObjCmd): Obj'ified
+ Tk_ClipboardCmd -> Tk_ClipboardObjCmd.
+
+2000-07-28 Eric Melski <ericm@ajubasolutions.com>
+
+ * unix/tkUnixButton.c (TkpDisplayButton): Added bits to change
+ the indicator color when radio-/check-buttons are disabled. This
+ reduces the visual incongruity when a group of these controls are
+ disabled together.
+
+ * win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit
+ for disabled menu entries, to ensure that those which are drawn by
+ the system are shown grayed (such as entries on menubars) [Bug: 4372].
+
+ * doc/label.n: Added -disabledforeground to list of options [Bug:
+ 6053].
+
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h: Added default values for listbox
+ disabledforeground and state.
+
+ * win/tkWinDefault.h: Changed default listbox background color to
+ white and listbox selection borderwidth to 0, in keeping with the
+ "Microsoft Windows User Experience"; added default values for
+ listbox disabledforeground and listbox state.
+
+ * doc/listbox.n: Added documentation for -state option.
+
+ * generic/tkListbox.c: Added support for -state to listbox. [RFE:
+ 6052].
+
+ * tests/listbox.test: Tests for listbox disabled state.
+
+2000-07-27 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure.in: TCL_STUB_LIB_FLAG and
+ TK_STUB_LIB_FLAG should not include ${TCL_DBGX}
+ in win/tkConfig.sh, fix that.
+
+2000-07-25 Joe English <jenglish@flightlab.com>
+
+ * doc: CanvPsY.3, ConfigWidg.3, CrtImgType.3, CrtItemType.3,
+ FontId.3, GetFont.3, canvas.n, font.n, options.n, text.n:
+ Documentation fix: Replaced references to XFontStruct *
+ and Tk_FontStruct with Tk_Font.
+
+2000-07-24 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/text.test: Added tests for -regexp -nocase searches with
+ backslash character classes.
+
+ * generic/tkText.c (TextSearchCmd): Text search did not work
+ properly when -regexp and -nocase were used, in combination with
+ backslash character classes represented by capital letters (ie,
+ \W, \M); altered implementation of -regexp -nocase searches to use
+ new regexp interfaces to fix this problem. [Bug: 5988].
+
+2000-07-21 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/text.test: Added tests for searching when text is elided.
+
+ * generic/tkText.c (TextSearchCmd): Text search was not returning
+ the correct index when the search covered (but did not search)
+ elided characters; corrected this by adjusting the match index by
+ the number of elided characters preceeding the start of the match,
+ just as is done with embedded windows, etc. [Bug: 5470].
+
+2000-07-21 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure.in: Add TK_STUB_LIB_FLAG and
+ TK_BUILD_STUB_LIB_SPEC. These are needed to build a stub enabled
+ extension.
+
+2000-07-20 Eric Melski <ericm@ajubasolutions.com>
+
+ * unix/tkUnixDraw.c (TkScrollWindow): Replaced a use of a trinary
+ operator with an if/else, to avoid build problems on some
+ platforms [Bug: 5819].
+
+ * win/makefile.vc: Applied patch from Don Porter to enhance nmake
+ support on NT/Alpha [RFE: 5939].
+
+2000-07-19 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/text.tcl: Enhanced <Tab> binding to behave like normal
+ <Tab> bindings when the text widget is disabled (ie, it advances
+ focus to the next widget).
+
+ * generic/tkText.c (TextSearchCmd): Added a test for a NULL
+ segment pointer when doing backwards searches for "" on an empty
+ text widget. [Bug: 6007].
+
+2000-07-18 Mo DeJong <mdejong@redhat.com>
+
+ * unix/aclocal.m4: Use tcl.m4.
+
+ * unix/configure.in: Properly quote LOCALES variable. Properly quote
+ argument to m4 macro.
+
+ * unix/tcl.m4: Add updated file from tcl.
+
+ * win/tcl.m4: Updated file from tcl.
+
+2000-07-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/tkfbox.tcl: Fixed keyboard navigation in the iconlist.
+
+ * unix/configure.in (MAKE_LIB): Corrected definition of MAKE_LIB
+ for shared builds, with patch from Mike Hopkirk.
+
+2000-07-18 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Fix TCL_GENERIC_DIR variable
+ so that it uses the TK_SRC_DIR in the same way
+ as the unix version.
+
+2000-07-17 David Gravereaux <davygrvy@ajubasolutions.com>
+
+ * generic/tkConsole.c: Added comments for a Win2K OS bug with
+ GetStdHandle(STD_OUTPUT_HANDLE). No change was done to the code
+ as the resulting behaviour of ShouldUseConsoleChannel() was
+ correct, anyways. [BUG: 5971]
+
+2000-07-17 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkStubImg.c (Tk_InitImageArgs): Applied patch from [Bug:
+ 5990], from Anselm Lingnau, which correctly sets the value of
+ useNewImage to 0 when the new image system is not to be used,
+ instead of leaving it at -1, which causes the check to be
+ performed more times than is really necessary.
+
+ * library/bgerror.tcl: Fixed a typo in one of the bgerror dialog
+ label.
+
+ * library/msgs/it.msg: Italian message catalog, from Paolo
+ Brutti. [RFE: 6012].
+
+2000-07-07 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/msgs/el.msg: Greek message catalog, from George Petasis.
+
+2000-07-07 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure.in: Fix subst of TK_SHARED_BUILD
+ variable in tkConfig.sh.in. Fix definition of
+ TK_SRC_DIR variable so that it matches the
+ unix version.
+
+2000-07-05 Mo DeJong <mdejong@redhat.com>
+
+ * generic/tkFileFilter.c (AddClause): Cast to match function prototype.
+ * win/stubs.c (_XInitImageFuncPtrs): Add return value for function.
+ * win/tkWinButton.c (buttonStyles, ButtonBindProc, ComputeStyle):
+ Remove unused declarations.
+ * win/tkWinColor.c (GetColorByName, GetColorByValue): Remove unused
+ function declarations.
+ * win/tkWinDialog.c (TrySetDirectory): Remove unused function
+ declaration.
+ * win/tkWinEmbed.c (TkWinEmbeddedEventProc): Cast to match function
+ prototype.
+ * win/tkWinMenu.c (winMenuMutex, MenuExitProc): Remove unused
+ declaration.
+ * win/tkWinWindow.c (StackWindow): Remove unused declaration.
+ * win/tkWinWm.c (ConfigureEvent): Remove unused declaration.
+ * win/tkWinX.c (winXMutex): Remove unused declaration.
+ * xlib/ximage.c (XCreateBitmapFromData): Cast to match function
+ prototype.
+
+2000-07-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/imgPhoto.test: Added test for GIF writing code [Bug: 5823].
+
+ * generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a
+ problem with the GIF writing code [Bug: 5823].
+
+ * generic/tkCursor.c: Added initialization for nextPtr field of
+ TkCursor, patch from Nijtmans/Howlett.
+
+2000-07-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/msgs/nl.msg: Dutch message catalog for dialogs, from Jan
+ Nijtmans.
+
+2000-06-30 Eric Melski <ericm@scriptics.com>
+
+ * doc/keysyms.n:
+ * doc/colors.n: Added extra .CE/.CS pairs to break up the large
+ text block, so that the generated Windows help file could
+ accomodate the manual entry. [Bug: 5862]
+
+ * tests/filebox.test: Adjusted tests to accomodate -multiple.
+
+ * library/xmfbox.tcl: Adjusted arguments list construction such
+ that -multiple is not presented as an option for tk_getSaveFile.
+
+ * library/tk.tcl: Added test for safe interpreter status before
+ attempting to load message catalogs (which is impossible in a
+ standard safe interpreter). This means that SafeTk will not have
+ localized dialogs, unless a means is found for loading the message
+ catalog files.
+
+2000-06-29 Eric Melski <ericm@scriptics.com>
+
+ * library/msgs/de.msg: German message catalog.
+
+ * library/msgs/en.msg: English message catalog.
+
+ * library/msgs/es.msg: Spanish message catalog.
+
+ * library/msgs/fr.msg: French message catalog.
+
+ * unix/Makefile.in:
+ * unix/configure.in:
+ * library/tk.tcl:
+ * library/clrpick.tcl:
+ * library/choosedir.tcl:
+ * library/console.tcl:
+ * library/msgbox.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+ * library/bgerror.tcl: Applied patches from Laurent Duperval to
+ provide localization of Tk dialogs. [RFE: 2671].
+
+2000-06-27 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from
+ [Bug: 5275], which corrected a segfault-causing indexing problem
+ when deleting entries from torn-off menus.
+
+2000-06-22 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/getOpenFile.n: Updated with information about -multiple.
+
+ * library/choosedir.tcl: Tweaked to handle modified tkIconList API's.
+
+ * library/tkfbox.tcl: Preliminary implementation of multiple
+ selection; based on patch from [RFE: 604]. Some of the tkIconList
+ functions changed to support this and to make the dialog faster.
+
+ * library/xmfbox.tcl: Added support for multiple selection, from
+ patch in [RFE: 4999].
+
+2000-06-21 Eric Melski <ericm@scriptics.com>
+
+ * library/text.tcl: Corrected behavior of text widget with respect
+ to this sequence of events: click, shift-click. Previously, the
+ shift-click just moved the cursor and anchor; now, the shift-click
+ will select the text between the click and the shift-click, which
+ is the behavior most users expect. [Bug: 5929].
+
+2000-06-19 Eric Melski <ericm@scriptics.com>
+
+ * library/bgerror.tcl: Added auto-truncation for long error
+ messages (more than 30 characters wide, or more than 4 lines
+ long), so that the dialog remains a manageable size. [RFE: 5782]
+
+2000-06-15 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinDialog.c: Patched to support tk_getOpenFile
+ -multiple. [RFE: 604].
+
+2000-06-13 Eric Melski <ericm@scriptics.com>
+
+ * win/aclocal.m4:
+ * win/configure.in:
+ * win/Makefile.in: Applied patch from [RFE: 5844], to provide
+ support for the mingw compile environment for Windows.
+
+2000-06-06 Jeff Hobbs <hobbs@scriptics.com>
+
+ 8.4a1 RELEASE
+
+2000-06-03 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/CrtCmHdlr.3: new doc for ClientMessage handler procs
+ * generic/tk.h: added typdef for Tk_ClientMessageProc
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: Added Tk_CreateClientMessageHandler and
+ Tk_DeleteClientMessageHandler declarations.
+ * generic/tkEvent.c (Tk_HandleEvent): Added
+ Tk_CreateClientMessageHandler and Tk_DeleteClientMessageHandler to
+ allow adding event handlers that invoke for ClientMessage events.
+ This is necessary to support unix dnd protocols.
+
+2000-06-02 Jeff Hobbs <hobbs@scriptics.com>
+
+ * canvas.test: added test for 5783.
+ * generic/tkCanvPoly.c (DisplayPolygon): added checks for the
+ polygon fillGC not being empty to prevent segfault. [Bug: 5783]
+
+2000-05-31 Eric Melski <ericm@scriptics.com>
+
+ * library/bgerror.tcl: Improved bgerror based on work by Donal
+ K. Fellows; no longer dependant on tk_dialog; features a
+ Windows-esque "Details" button, and a customizable extra function
+ button that allows the user to (for example) save the stack trace
+ to a file.
+
+2000-05-30 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be
+ static char arrays with integer initialization, to address EBCIDIC
+ vs. ASCII encoding issues and to handle compilers that don't deal
+ with "\xAB" syntax for specifying hex values in strings.
+
+2000-05-28 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/spinbox.n: (new file) docs for spinbox widget
+ * generic/tkInt.h: added Tk_SpinboxObjCmd declaration
+ * generic/tkEntry.c: added 'spinbox' widget - an extension of the
+ entry widget type.
+ * generic/tkWindow.c: added 'spinbox' to core Tk commands
+ * library/spinbox.tcl: (new file) binding and helper procs for spinbox
+ * library/tk.tcl: added spinbox.tcl to list of files to source
+ * tests/entry.test: updated changed error messages
+ * tests/spinbox.test: (new file) test suite for spinbox
+
+ * generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
+ table init'n to prevent seg fault when using place on multiple
+ displays.
+
+ * generic/tk.h: added comments ot Tk_FakeWin structure
+
+2000-05-26 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkOption.c (Tk_GetOption): Extended Tk_GetOption to
+ support a new syntax for option names in option tables. If the
+ option name has an embedded ".", it indicates that the name field
+ contains both an option name and an overriding widget class, in
+ the form "class.option". The lookup for the option value will be
+ performed as though the widget class is that specified, rather
+ than the actual widget class.
+ (SetupStacks): Replaced several lines of array element copying
+ with a for loop for conciseness.
+
+2000-05-25 Eric Melski <ericm@scriptics.com>
+
+ * library/button.tcl: Tweaks for -overrelief handling on Windows.
+
+ * doc/radiobutton.n: Added documentation for -overrelief option.
+
+ * doc/checkbutton.n: Added documentation for -overrelief option.
+
+ * doc/label.n: Added documentation for -state option.
+
+ * generic/tkButton.c: Added -overrelief option for checkbuttons,
+ and radiobuttons.
+
+ * library/button.tcl (tkButtonDown, macintosh version): Added
+ protection against querying the -repeatdelay option from a widget
+ that doesn't support it (ie, checkbuttons, radiobuttons, etc).
+ Other platforms use a different binding script for checkbuttons
+ and radiobuttons, so they don't have this issue.
+ (tkCheckRadioEnter, windows version): Added code to handle
+ -overrelief for check/radiobuttons on windows.
+
+2000-05-22 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkButton.c: Added -activeforeground, -activebackground
+ for labels, for the -state option.
+
+ * doc/label.n: Added documentation for -state option,
+ -activeforeground, -activebackground.
+
+2000-05-22 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/Makefile.in (install-libraries): corrected to install X
+ headers [Bug: 5516]
+
+ * doc/bind.n:
+ * doc/canvas.n:
+ * doc/entry.n:
+ * doc/listbox.n:
+ * doc/photo.n: doc fix-ups [Bug: 5396]
+
+2000-05-17 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/bell.n:
+ * tests/bell.test:
+ * generic/tkCmds.c (Tk_BellObjCmd): added -nice option to
+ optionally avoid resetting screen saver [Bug: 4279]
+
+2000-05-15 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinWm.c (Tk_WmCmd): changed wm deiconify from using idle
+ callback to calling restack and focus code immediately.
+
+2000-05-17 Eric Melski <ericm@scriptics.com>
+
+ Overall change: Added "-readonlybackground" option for entries,
+ to enable a visual change when state goes to readonly.
+
+ * mac/tkMacDefault.h (DEF_ENTRY_READONLY_BG_COLOR)
+ (DEF_ENTRY_READONLY_BG_COLOR):
+ * win/tkWinDefault.h (DEF_ENTRY_READONLY_BG_COLOR)
+ (DEF_ENTRY_READONLY_BG_COLOR):
+ * unix/tkUnixDefault.h (DEF_ENTRY_READONLY_BG_COLOR)
+ (DEF_ENTRY_READONLY_BG_COLOR): Added default values for entry
+ -readonlybackground option.
+
+ * generic/tkEntry.c: Added -readonlybackground option, cleaned up
+ excessive use of graphics contexts.
+
+ * tests/entry.test: Added configuration test for
+ -readonlybackground option.
+
+ * doc/entry.n: Added documentation for -readonlybackground option.
+
+ Overall change: changed implementation of "link" relief for
+ buttons. Instead of a new relief style (-relief link), there is a
+ new option, -overrelief, which if set is used when the mouse is
+ over the button.
+
+ * doc/SetOptions.3: Added information about TK_OPTION_NULL_OK with
+ TK_OPTION_RELIEF.
+
+ * win/tkWinButton.c: Removed bits about TK_RELIEF_LINK.
+
+ * tests/button.test: Added tests for -overrelief; removed tests
+ for -relief link.
+
+ * mac/tkMacButton.c: Removed bits about TK_RELIEF_LINK.
+
+ * generic/tkOldConfig.c: Removed bits about TK_RELIEF_LINK.
+
+ * generic/tkConfig.c: Removed bits about TK_RELIEF_LINK; added
+ support for TK_OPTION_NULL_OK for TK_OPTION_RELIEF.
+
+ * library/button.tcl: Added binding support for -overrelief.
+
+ * generic/tk3d.c (Tk_GetRelief): Added branch for TK_RELIEF_NULL.
+
+ * generic/tkButton.c: Added -overrelief option; removed
+ Enter/Leave EventProc masks and handlers.
+
+ * generic/tk.h: Added TK_RELIEF_NULL definition, removed
+ TK_RELIEF_LINK.
+
+ * mac/tkMacDefault.h (DEF_BUTTON_OVER_RELIEF):
+ * win/tkWinDefault.h (DEF_BUTTON_OVER_RELIEF):
+ * unix/tkUnixDefault.h (DEF_BUTTON_OVER_RELIEF): Added default
+ value for the -overrelief option.
+
+2000-05-16 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinMenu.c (ReconfigureWindowsMenu): Added code to add the
+ MF_SEPARATOR bit for SEPARATOR_ENTRY menu items. This causes
+ separator entries on the system menu to be drawn correctly [Bug: 5451].
+
+2000-05-15 Eric Melski <ericm@scriptics.com>
+
+ * doc/image.n: Added documentation for [image inuse] command.
+
+ * tests/image.test: Added tests for [image inuse] command.
+
+ * generic/tkImage.c (Tk_ImageObjCmd): Added [image inuse] command,
+ which provides a means for programmers to determine if a given
+ image is in use by any widgets. [RFE: 3327].
+
+2000-05-14 Eric Melski <ericm@scriptics.com>
+
+ * doc/clipboard.n: Added documentation for "clipboard get".
+
+ * generic/tkClipboard.c (Tk_ClipboardCmd): Added "clipboard get"
+ subcommand [RFE: 4628].
+
+ * tests/clipboard.test: Updated to use "clipboard get" instead of
+ "selection get -s CLIPBOARD".
+
+ * library/entry.tcl: Adjusted Button-1 binding to set focus to the
+ entry when it is readonly or normal.
+
+ * doc/entry.n: Added documentation for readonly state,
+ -disabledforeground, -disabledbackground.
+
+ * tests/entry.test: Added tests for readonly state.
+
+ * generic/tkEntry.c: Added support for "readonly" state, and
+ redefined "disabled" state. A disabled entry will display its
+ text in a dimmed color and possibly with a different background,
+ and will be completely unusable (no selection, no editing). A
+ readonly entry will look like a normal entry, but it will not be
+ editable; selection is still allowed. [RFE: 4239]. To support the
+ new disabled state properly, "-disabledforeground" and
+ "-disabledbackground" options were added.
+ *** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE ***
+
+ * win/tkWinDefault.h:
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h: Added DEF_ENTRY_DISABLED_FG,
+ DEF_ENTRY_DISABLED_BG_COLOR, DEF_ENTRY_DISABLED_BG_MONO.
+
+2000-05-12 Eric Melski <ericm@scriptics.com>
+
+ * unix/tkUnixButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ * mac/tkMacButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ * win/tkWinButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ Added code for drawing compound buttons.
+
+ * tests/button.test: Added configuration tests for -repeatdelay,
+ -repeatinterval, -compound.
+
+ * library/button.tcl: Added support for -repeatedelay,
+ -repeatinterval options.
+
+ * generic/tkOldConfig.c: Changed handling of link relief so that
+ proper error messages are used.
+
+ * generic/tkButton.h: Added -compound, -repeatdelay,
+ -repeatinterval options.
+
+ * generic/tkButton.c: Added event watchers for enter/leave events,
+ for link relief support.
+
+ * generic/tk3d.c: Changed handling of link relief so that proper
+ error messages are used.
+
+ * generic/tk.h: Changed values of
+ TK_OPTION_LINK_OK/TK_CONFIG_LINK_OK for link relief support.
+
+2000-05-12 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinFont.c (LoadFontRanges): improved support for all chars
+ in 0-255 range for bitmap ANSI fonts. May be improved to handle
+ bitmap non-ANSI fonts in the future. [Bug: 2172]
+
+ * win/tkWinWm.c (RaiseWinWhenIdle): added TK_DONT_DESTROY_WINDOW
+ to flag check to prevent timing related core dump. [Bug: 5438]
+
+2000-05-11 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinTest.c (TestclipboardObjCmd): ensured CloseClipboard
+ would always get called for each OpenClipboard.
+
+ * tests/focus.test (focusSetupAlt): removed wm withdraw from proc
+ as it would cause a hang for tkwait visibility
+
+ * tests/menu.test:
+ * generic/tk3d.c:
+ * generic/tkColor.c:
+ * generic/tkCursor.c: corrected handling of 3DBorder, Cursor and
+ Color objects on multiple screens. [Bug: 5454]
+
+2000-05-09 Eric Melski <ericm@scriptics.com>
+
+ * doc/button.n: Added documentation for link relief.
+
+ * tests/button.test: Added tests for link relief for buttons.
+
+ * generic/tk.h (TK_CONFIG_LINK_OK): Added definition of
+ TK_RELIEF_LINK, TK_OPTION_LINK_OK and TK_CONFIG_LINK_OK. [RFE: 4348]
+
+ * generic/tk3d.c: Added support for link relief. [RFE: 4348]
+
+ * mac/tkMacButton.c (TkpDisplayButton):
+ * unix/tkUnixButton.c (TkpDisplayButton): Added support for link
+ relief. [RFE: 4348]
+
+ * generic/tkOldConfig.c (Tk_ConfigureWidget):
+ * generic/tkConfig.c (DoObjConfig): Added understanding of link
+ relief, which is allowed only for widgets that have
+ TK_OPTION_LINK_OK or TK_CONFIG_LINK_OK set for the "-relief"
+ option. [RFE: 4348]
+
+ * generic/tkButton.c: Added TK_OPTION_LINK_OK to "-relief" option
+ for buttons. [RFE: 4348]
+
+ * win/tkWinWm.c (EX_TRANSIENT_STYLE): Removed WS_EX_TOOLWINDOW
+ style bit, so that transient windows have full-size titlebars
+ (like the tk_getOpenFile dialog).
+
+ * win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height
+ requested for separator bars to be (linespace - (2*descent))
+ instead of just (linespace); this makes the separator occupy a
+ more correct amount of vertical space. [Bug: 5303].
+
+2000-05-09 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]
+
+2000-05-02 Jeff Hobbs <hobbs@scriptics.com>
+
+ * README:
+ * generic/tk.h:
+ * library/tk.tcl:
+ * mac/README:
+ * unix/README:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/README:
+ * win/aclocal.m4:
+ * win/configure.in:
+ * win/makefile.vc: updated patchlevel to 8.4a1
+
+ * unix/Makefile.in: added tk.spec to dist target
+
+2000-04-27 Eric Melski <ericm@scriptics.com>
+
+ * doc/Tk_Init.3: Added Tk_SafeInit information [Bug: 1884].
+
+ * doc/keysyms.n: Man page enumerating keysyms [RFE: 1645].
+
+ * doc/colors.n: Man page enumerating valid color names [RFE: 1645].
+
+ * doc/cursors.n: Man page enumerating valid cursor values [RFE: 1645].
+
+ * library/msgbox.tcl: Corrected Unix tk_messageBox implementation
+ to make the first button the default when no default is specified
+ [Bug: 2218].
+
+ * doc/messageBox.n: Updated documentation with regards to
+ selection of default button when none is specified (now it will
+ use the first button as the default in that case) [Bug: 2218].
+
+2000-04-26 Jeff Hobbs <hobbs@scriptics.com>
+
+ 8.3.1 RELEASE
+
+ * README:
+ * mac/README:
+ * unix/README:
+ * unix/tk.spec:
+ * win/README: Updating URLs to reference dev.scriptics.com
+
+2000-04-25 Jeff Hobbs <hobbs@scriptics.com>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: makefile cleanup
+
+2000-04-25 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkMain.c: Fixed function header comment for Tk_MainEx.
+
+ * unix/mkLinks:
+ * doc/GetScroll.3: Added information about Tk_GetScrollInfoObj
+ [Bug: 1866].
+
+2000-04-24 Eric Melski <ericm@scriptics.com>
+
+ * unix/mkLinks:
+ * doc/Grab.3: Man page for Tk_Grab and Tk_Ungrab [Bug: 1868, 1889]
+
+ * unix/mkLinks:
+ * doc/MainWin.3: Added entry for Tk_GetNumMainWindows [Bug: 1865].
+
+ * unix/mkLinks:
+ * doc/GetHINSTANCE.3: Man page for Tk_GetHINSTANCE [Bug: 1862].
+
+2000-04-24 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkImage.c (Tk_PostscriptImage): added check to create
+ necessary prolog for photos
+ * generic/tkCanvPs.c: added Tk_PostscriptPhoto that outputs PS for
+ photo images
+ * generic/tkImgPhoto.c: new func ImgPhotoPostscript and added that
+ in as ps proc in tkPhotoImageType.
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: added Tk_PostscriptPhoto
+
+ * generic/tkConfig.c (DoObjConfig): removed direct setting of
+ interp->result.
+
+ * mac/tkMacWm.c (Tk_WmCmd): initialized gotToplevel in
+ colormapwindows case (bug found by Reasoning, Inc's automated code
+ testing).
+
+2000-04-24 Eric Melski <ericm@scriptics.com>
+
+ * unix/mkLinks:
+ * doc/GetHWND.3: Man page for Tk_GetHWND [Bug: 1863].
+
+ * unix/mkLinks:
+ * doc/HWNDToWindow.3: Man page for Tk_HWNDToWindow [Bug: 1869].
+
+ * unix/mkLinks:
+ * doc/AddOption.3: Man page for Tk_AddOption [Bug: 1854]
+
+2000-04-22 Jim Ingham <jingham@cygnus.com>
+
+ * mac/tkMacDialog.c (Tk_MacGetOpenFile): Add empty bodies for the
+ "-initialfile" and "-defaultextension" options.
+
+ * mac/tkMacDialog.c (NavServicesGetFile): Only cons the result up
+ into a list if multiple is true.
+
+ * mac/tkMacMenus.c (SourceDialog): Use the "tk_getOpenFile"
+ instead of hand-coding the dialog with StandardGetFile. This way
+ we get the Navigation dialogs for free.
+
+ * doc/getOpenFile.n: Document the -multiple and -message flags
+ which are only implemented on the Mac. Also note that the -title
+ works on the Mac with Nav Services installed.
+
+2000-04-19 Eric Melski <ericm@scriptics.com>
+
+ * doc/WinViewable.3:
+ * unix/mkLinks: Removed docs for Tk_IsViewable.
+
+ * win/tkWinDialog.c: Removed calls to Tk_IsViewable.
+
+ * generic/tkUtil.c:
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tkCmds.c:
+ * generic/tk.decls: Removed Tk_IsViewable function (it was not
+ actually needed).
+
+2000-04-19 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/aclocal.m4: made SC_PROG_TCLSH search specifically for
+ tclsh*.exe type files to find an executable.
+
+ * win/Makefile.in: fixed up cleanup, winhelp, cat32 targets
+
+ * library/console.tcl: made console use systemfixed font on Win
+
+ * generic/tkEntry.c: removed unnecessary ENTRY_VALIDATE #define
+
+2000-04-19 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkRectOval.c (ConfigureRectOval): Added checks for valid
+ outline settings before creating of outline GC; this means that it
+ is really possible now to have an oval or rectangle with no
+ outline. [Bug: 5029].
+
+2000-04-19 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/choosedir.tcl (::tk::dialog::file::chooseDir::Config):
+ * library/tkfbox.tcl (::tk::dialog::file::Config): removed the
+ extraneous glob on -initialdir after file isdir already returned 1
+ and moved cd trick into this case as the else already uses [pwd].
+ [Bug: 5181]
+
+ * win/winMain.c: moved extern call out of WinMain func
+
+ * README:
+ * generic/tk.h:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in: bumped to version 8.3.1
+
+ * library/msgbox.tcl (tkMessageBox): changed to use grid in some
+ places, realign icon to anchor nw.
+
+ * mac/tkMacScale.c: reverted tkMacScale.c to 1.5 equivalent (it
+ was accidentally bumped forward).
+
+2000-04-18 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinPointer.c: Changed Mod2Mask in TkWinGetModifierState to
+ ALT_MASK, to fix some event problems [Bugs: 1160, 5088].
+
+ * win/tkWinX.c: Changed Mod2Mask in GetState to ALT_MASK, to fix
+ some event problems [Bugs: 1160, 5088].
+
+ * generic/tkInt.h: Moved definition of ALT_MASK and META_MASK here
+ so that it would be accessible from other modules than tkBind.c.
+
+ * generic/tkBind.c: Added code in BindEvent to check for ALT_MASK
+ and META_MASK in the event state field, as this field may not be
+ set up with the correct display modifier mask bits if the XEvent
+ structure was created by [event generate] or by the Windows X
+ emulation. [Bugs: 1160, 5088].
+
+2000-04-18 Scott Redman <redman@HILO>
+
+ * win/tk.rc:
+ * win/wish.rc:
+ * win/wish.ico: Modified copyright dates in Windows resource
+ files. Updated the icon for wish.exe.
+
+2000-04-17 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinDialog.c: Added checks for visibility of parent window
+ before creating MessageBox and ChooseColor dialogs; this prevents
+ the application from locking when the parent is withdrawn and the
+ message box is created. In these cases, the window will be
+ created without a parent.
+
+ * unix/mkLinks: Added WinViewable.3.
+
+ * tests/msgbox.test: Added tests for patch from [Bug: 4997].
+
+ * library/msgbox.tcl:
+ * library/dialog.tcl: Applied patch from [Bug: 4997]; detaches
+ dialog window from parent if parent is not viewable.
+
+ * library/bgerror.tcl: Removed workaround from [Bug: 4370]; this
+ is superceeded by patches to dialog.tcl.
+
+ * generic/tkCmds.c: Changed WinfoObjCmd to use Tk_IsViewable
+ function to determine visibility of windows instead of inlining
+ the code.
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: Added Tk_IsViewable declaration.
+
+2000-04-17 Eric Melski <ericm@scriptics.com>
+
+ * library/text.tcl: Tweaked double-/triple-click selection;
+ previously, anchor and insert marks were placed in unexpected
+ locations following a double or triple click. Now they are placed
+ logically. Also tweaked the extension of selection via
+ shift-double-clicks so that it no longer selects the contiguous
+ whitespace on the side of the selection opposite the
+ double-click. [RFE: 4253].
+
+ * doc/menu.n: Added note regarding rendering of
+ checkbuttons/radiobuttons in menubars on different platforms --
+ some systems do not draw indicators for check/radiobuttons in
+ menubars.
+
+ * library/menu.tcl: Corrected behavior of
+ checkbuttons/commands/radiobuttons in menubars [Bug: 630].
+
+ * tests/grid.test: Added test for [grid propagate . 0] to not toggle.
+
+ * generic/tkGrid.c: Fixed bogus logic in [grid propagate] that
+ caused [grid propagate . 0] to act as a toggle instead of an
+ absolute set. [Bug: 2286].
+
+2000-04-16 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinColor.c (FindSystemColor): correct calculation of
+ colors when shifting value. [Bug: 4919]
+
+2000-04-16 Jim Ingham <jingham@cygnus.com>
+
+ * mac/tkMacPort.h: protect against strncasecmp already defined -
+ it is in the Pro5 version of MSL.
+
+ * mac/tkMacWindowMgr.c (GenerateKeyEvent): Check for a null tkWin.
+ If the hidden window we use for double-buffering controls manages
+ to percolate to the top (should never happen, but...) this will
+ keep us from crashing.
+
+ * mac/tkMacButton.c (InitSampleControls): Hide the
+ double-buffering window BEHIND the first "." window you can find.
+ This will keep it from ever being the front window, and thus a
+ black hole for events. * mac/tkMacButton.c (ButtonEventProc):
+ Disable the controls when the window is in the background. This
+ is required by the MacOS HIG. This doesn't always get called when
+ it should, it still needs more work.
+
+ * mac/tkMacDialog.c: Pretty substantial rewrite to include
+ Navigation Services support for systems which have it.
+
+2000-04-14 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinKey.c: Added check for ASCII delete character in
+ KeycodeToKeysym, to fix [Bug: 5090]. See comment in code for more
+ information.
+
+ * generic/ks_names.h: Added Scroll_Lock and Sys_Req definitions.
+
+ * win/tkWinKey.c: Changed implementation of KeycodeToKeysym,
+ et. al., to use a keycode table for lookups; this will result in
+ faster keycode -> keysym translations for non-ASCII keys like
+ Control, Alt, etc.
+
+2000-04-14 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinWm.c (WmProc): added check in WM_MOUSEACTIVATE so we
+ correctly activate native menus when clicking in when we didn't
+ have focus [Bug: 2272]
+
+ * generic/tkCanvas.c (CanvasEventProc:2451): corrected cast
+
+ * generic/tkEntry.c (Tk_EntryObjCmd): adjusted finishing error
+ cases and changed TK_CONFIG_NULL_OK to TK_OPTION_NULL_OK
+
+ * tests/scale.test:
+ * generic/tkScale.c:
+ * generic/tkScale.h:
+ * unix/tkUnixScale.c:
+ * mac/tkMacScale.c: moved (PixelToValue|ValueToPixel|SetScaleValue)
+ to tkScale.c. Caused an associated variable to be immediately set
+ [Bug: 4833]
+
+ * library/scale.tcl (tkScaleActivate): reduced number of scale
+ redisplays by checking current value of state before setting it
+ again. [Bug: 4191]
+
+ * tests/winDialog.test: tk_chooseDirectory seems to get a noop
+ from GetOpenFileName in the static build, hanging some tests.
+ The tests were fixed to timeout (noop cause unknown).
+
+ * unix/aclocal.m4 (SC_ENABLE_THREADS): enhanced the detection of
+ pthread_mutex_init [Bug: 4359] and (SC_CONFIG_CFLAGS) added
+ --enable-64bit-vis switch for Sparc VIS compilation [Bug: 4995]
+
+2000-04-13 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinKey.c: Added smarts to check whether the left or right
+ Control, Shift, or Alt key was pressed. [Bug: 870].
+
+ * win/tkWinMenu.c: Corrected code that created separator items on
+ menus; originally, it requested that the system be responsible for
+ drawing those items, so it would ignore configuration items like
+ the widget background. Now, we draw the separators ourselves (as
+ we do with every other kind of menu item already). [Bug: 1166].
+
+ * win/tkWin3d.c:
+ * unix/tkUnix3d.c: Applied patch from [RFE: 2501]: adds more
+ sophisticated smarts to TkpGetShadows, so that the highlight of a
+ very bright color is actually distinguishable from the color, and
+ the shadow of a very dark color is similarly distinguishable from
+ the color.
+
+ * generic/tkCanvas.c: Applied patch from [Bug: 4202]; adds a check
+ for NULL tkwin in Tk_CanvasEventuallyRedraw.
+
+2000-04-12 Jeff Hobbs <hobbs@scriptics.com>
+
+ * test/winClipboard.test:
+ * win/tkWinInt.h:
+ * win/tkWinClipboard.c (UpdateClipboard):
+ * win/tkWinX.c (GenerateXEvent): added updatingClipboard tsd and
+ TkWinUpdatingClipboard accessor function to allow us to flag
+ ourselves when we are the ones updating the clipboard. This
+ corrected inability to create our own clipboard types within a Tk
+ application. [Bug: 2338 4318]
+ * win/tkWinTest.c (TestclipboardCmd): improved TestclipboardCmd
+ with better error handling and obj'ification
+
+2000-04-11 Eric Melski <ericm@scriptics.com>
+
+ * msgcat.n: Added docs for new behavior from patch in [Bug: 4158].
+
+ * msgcat.test: Added tests for new behavior from patch in [Bug:
+ 4158].
+
+ * msgcat.tcl: Applied patch from [Bug: 4158], which enables
+ msgcat::mc to search the entire namespace ancestry chain for
+ message translations (ie, first it checks the current namespace,
+ then the parent, then the parent's parent, etc). Also allows the
+ specification of additional args for msgcat::mc; if extra args are
+ given, the [format] command is used to substitute the additional
+ args in the translated message.
+
+ * library/bgerror.tcl: Moved check for withdrawn state after check
+ for tkerror; this was causing problems when tkerror was used.
+
+2000-04-10 Eric Melski <ericm@scriptics.com>
+
+ * library/bgerror.tcl: Added check for withdrawn state of . and
+ unsetting of transient bit for .bgerrorDialog if . is not
+ viewable; this protects against the application hanging on systems
+ like Windows, where transient windows are withdrawn with their
+ parents. [Bug: 4370].
+
+ * tests/event.test: Added test for [event generate $widget
+ <Alt-z>] [Bug: 4611].
+
+ * tests/choosedir.test: Changed "namespace import ::tcltest" to
+ "namespace import -force ::tcltest".
+
+ * win/tkWinKey.c:
+ * unix/tkUnixKey.c:
+ * mac/tkMacKeyboard.c: Changed InitKeymapInfo to
+ TkpInitKeymapInfo. [Bug: 4611].
+
+ * generic/tkStubInit.c:
+ * generic/tkIntDecls.h: Re-gen'd from tkInt.decls.
+
+ * generic/tkInt.decls: Added TkpInitKeymapInfo to list of function
+ decls.
+
+ * generic/tkBind.c (HandleEventGenerate): Added code to initialize
+ keymap info if necessary, and to correctly set modifier bits in
+ XEvent structure create to handle [event generate] calls.
+ Previously, the alt/meta bits were not set correctly, so [event
+ generate $widget <Alt-z>] would always fail. [Bug: 4611]
+
+2000-04-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkGrid.c (InitMasterData): fixed uninit'd data in
+ GridMaster struct [Bug: 4387]
+
+ * library/safetk.tcl (disallowTk): made disallowTk work in the
+ simple case.
+
+ * library/comdlg.tcl (tkFocusGroup_In): fixed key navigation
+ problems in dialogs under CDE [Bug: 2960]
+
+ * tests/winDialog.test: removed knownBug constraint from 5.16
+
+ * win/tkWinFont.c (GetScreenFont): corrected adjustment against
+ LC_FACESIZE limitation for NT [Bug: 4931]
+
+ * win/makefile.vc (TKTEST_OBJS):
+ * win/Makefile.in (TKTEST_OBJS): moved tkWinTest.c from normal
+ objs to TKTEST_OBJS where it belonged.
+
+2000-04-03 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkTest.c: fixed incorrect platform inclusion for
+ TkplatformtestInit (it would never get called).
+
+ * unix/Makefile.in (MAN_INSTALL_DIR): patch to accept --mandir
+ correctly [Bug: 4085]
+
+ * library/clrpick.tcl (tkColorDialog_Config): error now thrown
+ when -initialcolor "" specified. [Bug: 4198]
+
+2000-03-31 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/DrawFocHlt.3: doc name correction
+
+ * generic/tkEntry.c: set TK_OPTION_NULL_OK bit on -invcmd option
+ and removed #ifdef ENTRY_VALIDATE expressions
+
+ * library/menu.tcl (tkMenuInvoke): corrected naming of tearoffs
+ [Bug: 4506]
+
+ * library/tkfbox.tcl (tkIconList_Goto): caused browsecmd to be
+ called in tkIconList_Select. This causes the entry to be set
+ properly when using the type-in-name-in-listbox bindings.
+
+ * win/tkWinDialog.c: added unicode-aware open/save file dialogs
+
+ * win/tkWinFont.c (TkpFontPkgInit): move private ref to platformId
+ to TkWinGetPlatformId
+
+ * win/tkWinMenu.c (SetDefaults): moved private use of versionInfo
+ to TkWinGetPlatformId and removed all code for
+ (versionInfo.dwMajorVersion < 4) (== Win32s)
+
+ * win/tkWinX.c:
+ * win/tkWin32Dll.c: moved TkWinGetPlatformId to tkWinX.c
+ * win/tkWinInit.c: added TkWinXInit to TkpInit to ensure that its
+ called for static Windows shells. [Bug: 3647]
+
+ * win/tkWinInt.h:
+ * win/tkWinX.c:
+ * win/tkWinDraw.c (SetUpGraphicsPort):
+ * win/tkWinScrlbr.c (UpdateScrollbar): removed use of tkpIsWin32s
+
+ * win/tkWinInt.h (TkWinDCState struct): added bkmode value
+ * win/tkWinDraw.c (TkWinGetDrawableDC, et al): added support for
+ properly transparent dashed lines on Windows. [Bug: 4617]
+
+2000-03-30 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgGIF.c: Fixed some ANSI specific bits to avoid
+ compile problems with non-ANSI compilers (ie, replace const with
+ CONST, etc). [Bug: 4223].
+
+ * unix/configure.in: Applied patch from [Bug: 4237]; ensures that
+ srcdir is fully qualified.
+
+ * unix/Makefile.in: Applied patch from [Bug: 4237]; if tcltest was
+ not compiled, make test/tktest failed. Now it has a rule to build
+ tcltest if it has not been built.
+
+2000-03-28 Eric Melski <ericm@scriptics.com>
+
+ * library/tkfbox.tcl: Moved an overlooked tkFDialog* function in
+ ::tk::dialog::file namespace.
+
+ * tests/unixWm.test: Added tests for memory leak conditions in
+ tkUnixWm.c.
+
+ * tests/canvas.test: Added test for bad configuration options on
+ empty and non-empty canvas.
+
+ * generic/tkCanvas.c: Removed bad code in CANV_CONFIGURE block of
+ CanvasWidgetCmd; this was causing non-empty canvases to improperly
+ handle bad configuration options [Bug: 4456].
+
+2000-03-27 Eric Melski <ericm@scriptics.com>
+
+ * unix/tkUnixWm.c: Applied patch from [Bug: 4405]; fixes memory
+ leak in Unix wm command.
+
+2000-03-24 Eric Melski <ericm@scriptics.com>
+
+ * tests/filebox.test:
+ * tests/choosedir.test: Updated tests.
+
+ * library/xmfbox.tcl: Updated to stash data array in
+ ::tk::dialog::file namespace instead of in global namespace.
+
+ * library/tkfbox.tcl: Extended some functions to support creation
+ of a choosedir dialog, to allow greater code reuse between the two
+ dialogs. Moved tkFDialog* functions into a namespace
+ (::tk::dialog::file). Because these are private Tk functions (and
+ should thus not be used directly by users), this should not impact
+ anybody (the tk_getOpenFile and tk_getSaveFile commands still
+ exist at the global scope).
+
+ * library/tk.tcl:
+ * library/tclIndex: Updated function names for tkFDialog*
+ functions and choosedir functions.
+
+ * library/choosedir.tcl: New and improved implementation of
+ tk_chooseDirectory dialog. Based on tk_getOpenFile dialog.
+
+2000-03-23 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkWindow.c:
+ * generic/tkInt.h: Updated Tcl_OptionCmd -> Tcl_OptionObjCmd
+
+ * generic/tkOption.c: Tcl_Obj'ectified the "option" command.
+
+2000-03-22 Eric Melski <ericm@scriptics.com>
+
+ * library/listbox.tcl (tkListboxCancel): Added a check for empty
+ string value for tkPriv(listboxPrev). Without this check, it's
+ possible to get a stack trace under certain conditions. [Bug: 4373].
+
+2000-03-15 Sven Delmas <sven@scriptics.com>
+
+ * win/tkWinDialog.c: Changed the behavior for the
+ tk_chooseDirectory dialog under Windows. Instead of trying to
+ return the currently selected listbox entry (which didn't work in
+ case the user selected the initial directory anyway), we now
+ return the value shown in the entry. This seems to be in
+ accordance with the expected behavior for this dialog.
+
+2000-03-14 Eric Melski <ericm@scriptics.com>
+
+ * tests/choosedir.test: Marked test 3.1 and 3.2 as bad until the
+ issue with those tests on IRIX can be determined.
+
+2000-03-10 Eric Melski <ericm@scriptics.com>
+
+ * library/menu.tcl: Applied patch from [Bug: 4155]; protects
+ against grabs on non-viewable windows.
+
+2000-03-08 Eric Melski <ericm@scriptics.com>
+
+ * tests/choosedir.test: Modified test 3.1 (-mustexist works) to be
+ more careful about cleaning up its potentially troublesome after
+ events.
+
+2000-03-07 Eric Melski <ericm@scriptics.com>
+
+ * tests/button.test:
+ * generic/tkButton.c: Added -disabledforeground/-state to labels.
+
+2000-03-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * tests/entry.test:
+ * generic/tkEntry.c (EntrySetValue): malloc the value when
+ validating because validation could cause the pointer to become
+ invalid. Also fixed configure to not trigger focus-based
+ validation. Improved use of Tcl_WrongNumArgs. [Bug: 4320]
+
+2000-03-06 Eric Melski <ericm@scriptics.com>
+
+ * library/menu.tcl: Added a check in tkMenuFirstEntry that changes
+ menu behavior to only auto-post an immediate child cascade if we
+ are currently on a menubar menu. This prevents massive
+ auto-cascading in cases where the first entry of the cascade is
+ itself a cascade, and the first entry of that cascade is a
+ cascade, and the first entry of that cascade is a cascade
+ ... [Bug: 676].
+
+ * generic/tkOldConfig.c: Added check for NULL tkwin value in
+ Tk_ConfigureWidget [Bug: 4079]
+
+ * generic/tkWindow.c: Added check for NULL tkwin value in
+ Tk_NameToWindow [Bug: 4079]
+
+2000-03-02 Jeff Hobbs <hobbs@scriptics.com>
+
+ * tests/color.test:
+ * xlib/xcolors.c (XParseColor FindColor):
+ * win/tkWinColor.c (XAllocColor): Fixed bit fiddling for colors to
+ return "correct" values for color mapping. [Bug: 4282]
+
+ * unix/Makefile.in (SCRIPT_INSTALL_DIR): removed extraneous '/'
+ * unix/aclocal.m4: corrected TCL_NEEDS_EXP_FILE to be 1 for AIX
+
+ * win/tkWinInt.h: change extern to EXTERN for TkWinChildProc
+ declaration with extra #defs. [Bug: 4240]
+
+ * library/focus.tcl: fixed tkFocusOK to protect $w in
+ uplevel with list. [Bug: 4208]
+
+ * doc/CrtItemType.3: fixed docs for Tk_CreateItemType to reflect
+ changes made in 8.3.0 (but old style would still work as well).
+ [Bug: 4252]
+
+ * tests/config.test: extra test to check object cleanup when
+ destroying the widget
+ * generic/tkListbox.c (DestroyListbox): fixed crash in
+ DestroyListbox due to null tkwin. [Bug: 4207]
+
+ * tests/entry.test: added test suite for entry validation
+ * doc/entry.n: improved docs discussing caveats and gotchas when
+ mixing textvar with widget validation
+ * generic/tkEntry.c (EntryValidateChange): improved handling of
+ validation with relation to -textvariable. Previously, it would
+ turn off whenever the textvar was set. Now it will it will turn
+ off only when the textvar is set and validation returns 0. Added
+ %V (type of validation occuring) to %-subs to help work with
+ trickier validation.
+
+2000-03-01 Eric Melski <ericm@scriptics.com>
+
+ * tests/clrpick.test:
+ * library/clrpick.tcl: Added code to make color chooser dialog
+ inherit screen setting from parent (bug #2334)
+
+2000-02-25 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinWm.c (RaiseWinWhenIdle): Checked for the possibility
+ that the window could be destroyed (can occur with
+ wm deiconify .toplevel; destroy .toplevel).
+
+2000-02-25 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgGIF.c: Applied "spirit of" the patch in 1605 (the
+ submitted patch was more complicated than necessary and did not
+ extend to writing GIF's, only reading), to allow reading/writing
+ of GIF files on EBCDIC and other non-ASCII based systems.
+
+2000-02-14 Eric Melski <ericm@scriptics.com>
+
+ * unix/tk.spec: RPM specification for producing a binary Tk RPM
+ for Linux.
+
+ * unix/Makefile.in: Added rpm target to generate Tk
+ binary RPM.
+
+2000-02-10 Jeff Hobbs <hobbs@scriptics.com>
+
+ 8.3.0 RELEASE
+
+ * changes: updated for 8.3.0 release
+
+ * generic/tkImgGIF.c (FileReadGIF): added cast for trashBuffer
+
+ * generic/tkIntXlibDecls.h:
+ * generic/tkInt.decls: declared some Xlib emulation calls for
+ the Mac
+
+ * generic/tkFrame.c (TkInstallFrameMenu): added extra panic to
+ inform user of bad call when framePtr is NULL [Bug: 2530]
+
+ * generic/tkMenu.c (DestroyMenuInstance): Placed checks around
+ menu name objects before trying to incr the ref. [Bug: 3402]
+
+ * generic/tkTest.c: removed USE_OLD_IMAGE def for Mac
+
+ * library/listbox.tcl:
+ * library/text.tcl: added support for <4> and <5> for mousewheel
+ style scrolling on Unix for mice that map to these buttons.
+
+ * tests/scrollbar.test: fixed check of testmetrics command to
+ allow unix tests to run (testmetrics is mac/pc only)
+
+ * unix/tkUnixWm.c (Tk_CoordsToWindow): qualified delete of error
+ handler as the goto label is reached from above and below.
+
+ * unix/configure.in:
+ * unix/aclocal.m4: cleaned up macros to coincide with tcl.m4,
+ added -export-dynamic to LDFLAGS for FreeBSD-3+ [Bug: 2998]
+
+ * unix/README:
+ * unix/Makefile.in (dist): removed porting.notes and porting.old
+ from distribution and CVS. The information was very outdated. Now
+ refer to http://dev.scriptics.com/services/support/platforms.html
+
+ * xlib/xgc.c: #def'd out XDrawSegments for the Mac, and added
+ some extra include info for the Mac
+
+2000-02-09 Jim Ingham <jingham@cygnus.com>
+
+ * mac/tkMacButton.c: Stop removing the appearance window from the
+ Window List. It is not clear why Ray did this, and it causes the
+ Appearance manager to crash at random times.
+
+ * mac/tkMacWM.c: Add support in unsupported1 style for the Appearance
+ specification of window styles, including floating window support.
+ * mac/tkMacWindowMgr.c: Operate on the front non-floating window,
+ unless the mouse is directly over the floating window. Also,
+ keystrokes go to the front non-floating window.
+ * mac/tkMacAppInit.c: Initialize floating window support.
+ * mac/tkMacScrlbr.c:
+ * mac/tkMacmenu.c: Fixes for floating windows - operate on the
+ FrontNonFloatingWindow.
+ * mac/tkMacLibrary.r: Fix typo in File info string.
+ * mac/tkMacApplication.r: Fix typo in file info string. Add
+ Finder balloon help for no apparent reason.
+
+ * mac/tkMacSubwindows.c: Change panic in tkMacGetDrawablePort to
+ Debugger. This is only a temporary fix. The panic is only
+ triggered when a safeTk interpreter is torn down, and ignoring it
+ does no harm. I haven't figured out how to avoid it yet, however.
+ Also use the Appearance MoveWindowStructure call when available.
+
+ New Files:
+ * MW_TkOldImageHeader.h: Handle #defining USE_OLD_IMAGE for tkImgPPM.c.
+ * MW_TkTestHeader.h:
+ * MW_TkTestHeader.pch:
+ * MW_TkHeader.h: Add separate prefix files for test & release
+ versions of Tk, so we can just have separate targets w/o having to
+ edit files.
+
+ * tclets.r: The D&D Tclets icon in rez form so we can have a
+ target for this.
+
+ The above are curtesy of Daniel Steffen (steffen@math.mq.edu.au)
+
+ * tkMacAppearanceStubs.c: Stubs of the Mac Appearance calls I use
+ so I can link the static 68K Shell without putting ifdef's all
+ over the code.
+
+2000-02-08 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tk.decls:
+ * generic/tkBind.c:
+ * generic/tkInt.decls:
+ * generic/tkIntDecls.h:
+ * generic/tkStubInit.c:
+ * mac/tkMacKeyboard.c:
+ * unix/tkUnixKey.c:
+ * win/tkWinKey.c: Fix for keyboard handling of "dead" keys and
+ caps lock from Peter Spjuth. [Bug: 4105 3359 2493]
+ Split functions into platform specific files:
+ Static functions GetKeySym(), SetKeycodeAndState() and InitKeymapInfo()
+ from tkBind.c moved into platform files tkWinKey.c tkUnixKey.c and
+ tkMacKeyboard.c. GetKeySym() and SetKeycodeAndState() renamed to
+ Tkp* and made public (as private functions) in tkInt.decls.
+
+ Step 2, fixes in tkWinKey.c
+ New static function: KeycodeToKeysym(), based on XKeycodeToKeysym()
+ but with different arguments, and a lot of improvements.
+ TkpGetString() changed to use KeycodeToKeysym() + other fixes.
+ TkpGetKeySym() changed to use KeycodeToKeysym() + other fixes.
+ InitKeymapInfo() changed to use KeycodeToKeysym().
+ TkpSetKeycodeAndState() rewritten, mostly by copying code from
+ XKeysymToKeycode().
+ XKeycodeToKeysym() rewritten. Preferably it should be removed.
+
+ EXPLANATION: The main problem is ToAscii() which has a lot of side
+ effects, and also that XKeycodeToKeysym() is not provided enough
+ input to do a proper job. The changes' main goal is to avoid
+ calling ToAscii() if not necessary, and to provide it with as
+ correct information as possible when called. Also some attempts
+ to clean up what ToAscii() did are done. See the code for details.
+
+ BUGS FIXED: Typing shifted (and AltGr) dead keys did not work.
+ Keyboard lock lamps did not work on Win98.
+ Events regarding AltGr-keys behaved badly.
+ Example: On a Swedish keyboard, $ is typed with AltGr-4.
+ That keyboard event would get the keysym '4' not 'dollar'.
+ Also, doing [event generete . <Key-dollar>] would send keysym '4'.
+ Translation to ascii in TkpGetString did not handle return and
+ tab correctly. I.e. [event generate . <Key-Return>] gave wrong %A
+
+ * generic/tkDecls.h:
+ * generic/tk.decls:
+ * generic/tk.h: moved new public functions created in dash patch
+ to the stubs interface [Bug: 4062]
+
+ * generic/tk.h:
+ * doc/CrtImgType.3:
+ * doc/CrtPhImgFmt.3:
+ * generic/tk.h:
+ * generic/tkImgGIF.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkStubImg.c (new file):
+ * generic/tkTest.c:
+ * unix/Makefile.in:
+ * win/Makefile.in:
+ * win/makefile.vc: improved support for moving from the old style
+ image C API to the new obj'ified one with new Tk_InitImageArgs
+ command and stub'ing of image code. See docs for how to make the
+ transition. [Bug: 4060]
+
+ * library/tk.tcl: wrapped check for tcl_platform(os) around info
+ exists because it won't in safe interpreters
+
+ * win/tkWinFont.c: corrected symbol font use to only work on 8-bit
+ characters [Bug: 2406]
+
+ * unix/aclocal.m4: changed all -fpic to -fPIC
+
+ * README:
+ * unix/configure.in:
+ * win/configure.in:
+ * generic/tk.h (TK_RELEASE_SERIAL): Moved to 8.3.0 patchlevel
+
+2000-02-07 Eric Melski <ericm@scriptics.com>
+
+ * library/tkfbox.tcl: Applied patch from bug #4117,
+ tk_getOpenFile/getSaveFile doesn't do the right thing when user
+ types a directory name in the entry and a default extension is
+ specified.
+
+2000-02-05 Jeff Hobbs <hobbs@scriptics.com>
+
+ * unix/tkUnixScale.c (TkpDestroyScale): changed ckfree to
+ Tcl_EventuallyFree to behave with Tcl_Preserve in TkpDisplayScale
+ (prevents possible segfault).
+
+2000-02-03 Eric Melski <ericm@scriptics.com>
+
+ * tests/canvText.test: test for fix for bug #2525.
+
+ * generic/tkFont.c (Tk_ComputeTextLayout): Was erroneously setting
+ the width of newline-only text display chunks to some arbitrary
+ huge number, instead of 0; this was interfering with things like
+ the canvas find enclosed feature. (bug #2525).
+
+ * tests/text.test:
+ * generic/tkText.c (DumpLine/DumpSegment): Changed DumpSegment to
+ take a TkTextIndex instead of two integer offsets, so that it
+ could use TkTextPrintIndex to format the offsets into an index,
+ which makes it UTF smart (bug #2582).
+
+2000-02-01 Eric Melski <ericm@scriptics.com>
+
+ * library/tk.tcl:
+ * library/tclIndex:
+ * library/choosedir.tcl: Moved choosedir functions into the
+ ::tk::dialog::chooseDir namespace instead of a toplevel
+ ::tkChooseDirectory namespace. Additional cleanup on the
+ chooseDir dialog.
+
+2000-02-01 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/text.n: clarified docs on what happens during a search with
+ -count when images/windows are embedded
+
+ * win/Makefile.in (install-*): reduced verbosity of install
+
+ * win/tkWinPixmap.c (XGetGeometry): added support for windows in
+ XGetGeometry [Bug: 4069]
+
+ * win/tkWinFont.c (GetScreenFont): fixed possible mem overrun with
+ long font names [Bug: 4108]
+
+ * win/tkWinDialog.c: added EnableWindow calls to dialogs to
+ correct for possible loss of control in parent Tk toplevel
+ [Bug: 1212 et al]
+
+ * generic/tkRectOval.c (ConfigureRectOval):
+ * generic/tkCanvLine.c (ConfigureLine):
+ * generic/tkCanvPoly.c (ConfigurePoly):
+ * generic/tkCanvArc.c (Configure/DisplayArc): fixed handling for
+ negative dash values [Bug: 4104]
+
+ * generic/tkScale.c (TkRoundToResolution): fixed incorrect
+ assumption that (N+1)*delta = N*delta + delta with floating point
+ math [Bug: 3689, 4099]
+ (DestroyScale) Fixed check for cancelling TkpDisplayScale (was
+ REDRAW_ALL, is now REDRAW_PENDING)
+
+ * tests/listbox.test: corrected test case for listbox itemconfigure
+
+ * unix/aclocal.m4: added *BSD ELF recognition for
+ SHARED_LIB_SUFFIX determination (from Tcl's tcl.m4)
+
+2000-01-27 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgPhoto.c: Removed unneccesary object translation in
+ MatchStringFormat (bug #4103).
+
+2000-01-27 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgGIF.c: Additional code cleanup (now we only have
+ one decoder! neat!)
+
+2000-01-26 Eric Melski <ericm@scriptics.com>
+
+ * doc/getOpenFile.n:
+ * doc/chooseDirectory.n: Man page/cross links for
+ tk_chooseDirectory (bug #1786).
+
+ * library/tk.tcl:
+ * library/tclIndex: Added hooks for tk_chooseDirectory. (bug #1786)
+
+ * library/choosedir.tcl: tk_chooseDirectory implementation for
+ Unix/Mac (bug #1786).
+
+ * generic/tkImgPhoto.c: Added some comments regarding slow
+ processing of transparent images.
+
+ * generic/tkImgGIF.c: Improved GIF decoder for ~60% speed
+ increase. Added some comments on how to further improve the
+ implementation, time permitting.
+
+ * doc/photo.n: Added a description of what the -data string can
+ contain (base64 or binary data).
+
+ * generic/tkImgPhoto.c: Fixed bug with use of binary data for
+ "-data" option to "image create" command.
+
+2000-01-21 Eric Melski <ericm@scriptics.com>
+
+ * library/tkfbox.tcl: Fixed bug relating to incorrect parent
+ values for error message boxes displayed by the file dialog (bug
+ #3616).
+
+ * tests/text.test:
+ * generic/tkText.c: Fixed bug relating to regexp searching for
+ empty lines; previously, the starting line was ignored. (bug #1643).
+
+2000-01-20 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/text.tcl: fixed double-click selection behavior where
+ there were embedded windows/widgets in the same line. [Bug: 3989]
+
+ * win/tkWinWm.c (TkWmProtocolEventProc): cached atom name as the
+ window could get destroyed during eval [Bug: 2513]
+
+ * generic/tkCanvLine.c (LineCoords): fixed segfault when too few
+ coords were passed to a line with certain options set (it should
+ always have thrown an error anyway). [Bug: 4042]
+
+ * tests/text.test:
+ * generic/tkText.c: fixed missing " in error case and missing
+ 'dump' in subcommand listing [Bug: 4036]
+
+ * generic/tkListbox.c: adjusted use of basic string concatenation
+ in (non-K&R behavior) [Bug: 4027]
+ Swapped bg/fg class for -select(bg|fg) for listbox and their
+ items [Bug: 4039]
+
+ * unix/mkLinks:
+ * doc/WindowId.3: added docs for Tk_IsContainer and Tk_IsEmbedded
+
+ * doc/text.n: clarified mark gravity definition and usage of
+ ``word'' in binding definitions. [Bug: 2004 2277 1388]
+
+ * generic/tkInt.h: moved new TkDisplay useInputMethods structure
+ element to end to not disturb position of previous elements in
+ the structure (as compared to Tk <=8.2).
+
+2000-01-20 Eric Melski <ericm@scriptics.com>
+
+ * tests/grid.test: Added a test for the consecutive ^ and multiple
+ widget case (bug #1386).
+
+ * generic/tkGrid.c: Fixed interpretation of consecutive ^
+ characters in grid command. Previously, ^ ^ was interpreted as
+ meaning that there must be a 2-column widget above to extend,
+ neglecting the case where there was actually 2 1-column widgets
+ above. Now, ^ ^ is interpreted as a possible width; the gridder
+ will consume as many ^'s as there are columns in the widget, and
+ leave the rest for the extension of other widgets. (bug #1386).
+
+2000-01-19 Eric Melski <ericm@scriptics.com>
+
+ * library/tk.tcl: Created a virtual event <<PrevWindow>> for
+ reverse tab traversals, with one default binding <Shift-Tab>, and
+ OS specific bindings for Linux, HP-UX, and IRIX. (bug #3163)
+
+2000-01-13 Jeff Hobbs <hobbs@scriptics.com>
+
+ * changes: updated changes file to reflect 8.3b2 mods
+ * README:
+ * generic/tk.h:
+ * unix/configure.in:
+ * win/configure.in: updated to patchlevel 8.3b2
+
+ * win/tkWinWm.c: added visibility event handler to make sure
+ that transient window wrappers would be updated when the master
+ was initially mapped.
+
+2000-01-12 Jeff Hobbs <hobbs@scriptics.com>
+
+ * tests/text.test: changed test to reflect change of -hidden
+ to -elide in search options.
+
+ * win/tkWinScrlbr.c: added check for valid hwnd in ModalLoopProc
+ to avoid crash when building statically
+
+ * doc/event.n:
+ * generic/tkBind.c: prevented core with event -warp on Windows
+ when window wasn't mapped [Bug: 4004] and added docs stating
+ the requirement for mapped windows.
+
+ * generic/tkCanvas.c: fixed mem leak with TagSearchExprInit
+ [Bug: 3977]
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h: remove non-existent
+ Tk_(Get|Create)CanvasVisitor prototypes
+
+ * generic/tkText.c:
+ * generic/tkEntry.c: fixed cursor to not blink when widget was
+ disabled [Bug: 1807]
+
+ * generic/tkRectOval.c: added note about change to bloat for
+ RectOval bounds calculation for WIN32 only
+
+ * library/dialog.tcl: improved handling of $default arg to allow
+ for name of given button, as well as bounds checking
+
+ * doc/wm.n:
+ * tests/winWm.test:
+ * tests/unixWm.test:
+ * mac/tkMacWm.c:
+ * unix/tkUnixWm.c: fixed possible X error being raised [Bug: 3377]
+ * win/tkWinWm.c: wm deiconify in zoom state [Bug: 2077],
+ fixed possible flashing of unmapped toplevel in deiconify [Bug: 3338]
+ and fixed mapping of transient window [Bug: 572]
+ Also, for all wm's, extended 'wm state' command to allow setting
+ of the state, and added official support of 'zoomed' state on Win.
+
+ * unix/aclocal.m4: strtod bug on Tru64 [Bug: 3378]
+
+ * unix/Makefile.in: added tests to prevent unnecessary chmod +x
+ in source dirs while installing [Bug: 3367]
+
+ * unix/configure.in: properly sub'ed in TK_SHARED_BUILD [Bug: 3385]
+
+2000-01-05 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/text.n:
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextTag.c: removed the -state option for text tags,
+ and reoriented it around -elide, as -state disabled was never
+ implemented, and -state hidden is better as -elide.
+
+ * mac/tkMacClipboard.c: fixed i18n problems with clipboard [Bug: 3544]
+
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl: fixed unprotected arg parsing through eval/after
+ [Bug: 3943]
+
+ * unix/Makefile.in: added unix/aclocal.m4 to distribution [Bug: 3938]
+ * unix/aclocal.m4: changed NetBSD SHLIB_CFLAGS from -fpic to -fPIC
+
+ * win/tkWinImage.c: added static declaration to function
+
+1999-12-22 Jeff Hobbs <hobbs@scriptics.com>
+
+ * changes: updated changes file
+
+ * generic/tkScale.c:
+ * generic/tkScale.h:
+ * mac/tkMacScale.c:
+ * unix/tkUnixScale.c: fixed potential segv from patch in 3897
+
+ * tests/unixWm.test: nonPOrtable -> nonPortable
+
+1999-12-21 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tk.h:
+ * unix/configure.in:
+ * win/configure.in:
+ * win/aclocal.m4:
+ * README: updated for patch level 8.3b1
+
+ * unix/tkUnixWm.c: fixed panic in Tk_CoordsToWindow to print error
+ and continue instead (for Tix) [Bug: 716 et al]
+
+ * scale.test:
+ * generic/tkScale.c:
+ * generic/tkScale.h: fixed possible core when freeing options
+ (cursor) associated with scale widget [Bug: 3897]
+
+ * doc/MeasureChar.3: fixed docs for Tk_MeasureChars to reflect code
+ * doc/listbox.n: fixed formatting problem
+
+ * generic/tk3d.c: added extra calculations to ensure that thin
+ frames get refreshed too [Bug: 3596]
+
+ * unix/tkUnixMenu.c:
+ * unix/tkUnixFont.c:
+ * generic/tkCanvText.c:
+ * generic/tkEntry.c:
+ * generic/tkFont.c:
+ * generic/tkImgPPM.c: removed extranneous vars that were set but
+ never used.
+
+ * mac/tclMacHLEvents.c: fixed applescript for I18N [Bug: 3644]
+
+ * unix/aclocal.m4: removed -O flag for AIX when using the IBM
+ compiler (several versions have a bug that crops up in the text
+ widget). [Bug: 2316]
+
+ * unix/Makefile.in: removed extra slash in SCRIPT_INSTALL_DIR
+ [Bug: 3896]
+
+ * library/listbox.tcl: added extra checks for existence of
+ tkPriv(listboxSelection) before it was used. [Bug: 3892]
+
+1999-12-16 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/GetCursor.3:
+ * win/tkWinCursor.c: added support for Windows cursors to
+ TkGetCursorByName (.ani, .cur) using -cursor @<filename>
+ (Ascher) [Bug: 1350]
+
+ * win/tkWinWm.c: fixed 'wm deiconify' to update position of the
+ toplevel if event is waiting before mapping. (Mao) [Bug: 3687]
+ This removes the need for 'update idle' before 'wm deiconify' on
+ Windows.
+
+ * doc/listbox.n: added doc for <<ListboxSelect>> [Bug: 3500]
+
+ * doc/getOpenFile.n: removed note that -initialfile didn't work
+ for tk_getOpenFile
+ * library/tkfbox.tcl: updated tk_get*File to better match the
+ Windows file box it emulates, give proper support to -initialfile,
+ and fixes lack of global tkPriv call. [Bug: 3735 3882]
+
+ * doc/tk.n: added doc for 'tk useinputmethods ...'
+ * tests/tk.test:
+ * unix/tkUnixKey.c:
+ * generic/tkCmds.c:
+ * generic/tkEvent.c:
+ * generic/tkWindow.c:
+ * generic/tkInt.h: add 'tk useinputmethods ?-display win? ?bool?'
+ call to provide support for disabling/enabling the use of XIM on
+ X. This was previously all done at compile time, and always on.
+ Now it is turned off by default, even when available, and the user
+ must turn it on to use XIM (per display).
+
+ * generic/tkCanvUtil.c: fixed bug in Tk_CanvasPsOutline that freed
+ mem it shouldn't.
+
+ * generic/tkFont.c: added "bitstream cyberbit" (popular Windows
+ CJK font) to list of font fallbacks. (kenny) [Bug: 2407]
+
+ * mac/tkMacMenu.c: finished bug 3075 by changing the char values of
+ what was checked (verified correctness on Mac).
+
+1999-12-13 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/canvas.n: added docs for items added by dash patch (-*dash*,
+ -state, -active*, -disabled*, -offset, essentially rewrote the
+ man patch for completely updated 8.3 canvas widget.
+ * doc/entry.n: added docs for entry widget validation
+ * doc/event.n: added docs for -warp
+ * doc/text.n: doc'ed new -state value 'hidden'
+ * doc/GetDash.3: (new file) man page explaining Tk_GetDash
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkInt.decls: added XSetDashes and XWarpPointer
+ * generic/tk.decls: added Tk_CreateSmoothMethod, and reserved
+ two spots
+ * generic/tk.h: added Tk_SmoothMethod struct,
+ state item to canvas record, #defines for item state,
+ support for using old char*-based canvas item C creation
+ procedures with -DUSE_OLD_CANVAS,
+ Tk_Dash, Tk_TSOffset (-offsets) & Tk_Outline structs and #defs,
+ decls for dash, outline and postscript routines
+ * generic/tkBind.c: added support for Quadruple clicks, and added
+ the -warp option to 'event' with pointer warping routines
+ * xlib/xgc.c:
+ * generic/tkRectOval.c:
+ * generic/tkCanvArc.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvPs.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvUtil.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCanvas.c:
+ * generic/tkCanvas.h: Canvas and items received overhaul to with
+ the addition of the dash patch (Nijtmans, et al) This includes
+ objectification of the 'canvas' command, as well as support for
+ (where appropriate) dashes in items, extended stipple support,
+ state for all items, and postscript generation of images and
+ windows. See the new canvas man page for related docs.
+ * generic/tkEntry.c: added entry widget validation, see entry.n
+ * generic/tkEvent.c: on simulated events, ButtonPress should
+ be matched with ButtonRelease to be correct
+ * generic/tkFont.c: corrected possible null reference
+ * generic/tkFrame.c: made frame a Tcl_Obj based command
+ * generic/tkGet.c: added TkGetDoublePixels
+ * generic/tkImage.c: bug fixes from Img patch and new
+ Tk_PostscriptImage and Tk_SetTSOrigin functions
+ * generic/tkImgBmap.c: new ImgBmapPostscript function
+ * generic/tkImgPhoto.c: new Tk_CreatePhotoOption, Tk_DitherPhoto
+ * generic/tkInt.h: declarations for some new functions
+ * generic/tkMessage.c: reworked relief drawing
+ * generic/tkOldConfig.c: added TK_CONFIG_OBJS so old style
+ ConfigureWidget calls can pass in Tcl_Obj arrays
+ * generic/tkScrollbar.c:
+ * generic/tkScrollbar.h: made -orient use an option table
+ * generic/tkText.c:
+ * generic/tkText.h: made -wrap and -state use option tables
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextMark.c:
+ * generic/tkTextTag.c:
+ * generic/tkTextWind.c: added support for -elide and -state hidden
+ * generic/tkTrig.c: changed TkMakeBezierCurve to support returning
+ the upper limit of points needed for spline
+ * generic/tkUtil.c: new option table parsing routines
+ * generic/tkWindow.c: init'ing of warp stuff, mouseButtonState
+
+ related bug ids for the fixes:
+ [Bug: 648 1541 1540 1779 2168 2311 2297 2340 2348 2578 3386]
+
+ * tests/bind.test:
+ * tests/canvImg.test:
+ * tests/canvPsArc.tcl:
+ * tests/canvPsImg.tcl: (new file)
+ * tests/canvRect.test:
+ * tests/canvText.test:
+ * tests/canvas.test:
+ * tests/defs.tcl:
+ * tests/entry.test:
+ * tests/event.test:
+ * tests/font.test:
+ * tests/frame.test:
+ * tests/imgPhoto.test:
+ * tests/safe.test:
+ * tests/scale.test:
+ * tests/scrollbar.test:
+ * tests/select.test:
+ * tests/text.test:
+ * tests/textDisp.test:
+ * tests/textTag.test:
+ * tests/unixFont.test:
+ * tests/unixWm.test:
+ * tests/visual_bb.test:
+ * tests/winClipboard.test: tests for the dash patch changes
+
+ * unix/mkLinks: added GetDash.3 into the mkLink step
+
+ * mac/tkMacDraw.c: mac still needs pointer warping routine
+ * mac/tkMacXStubs.c:
+ * win/tkWinDraw.c:
+ * win/tkWinPointer.c: added support for pointer warping and
+ platform specific support for dash patch items
+
+1999-12-12 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkText.c: fixed bug in TextSearchCmd for multibyte chars
+ (Darley) [Bug: 3839]
+
+ * unix/aclocal.m4: added warning when configuring with
+ --enable-threads that Tk may have problems
+
+1999-12-09 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkImgGIF.c: updated casting
+
+ * win/makefile.vc: removed 16bit stuff, simplified makefile.
+
+1999-12-06 Scott Redman <redman@scriptics.com>
+
+ * generic/tkMain.c: need to include tclInt.h for new hook
+ functions that are internal-use-only.
+
+1999-12-06 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/comdlg.tcl: removed tclVerifyInteger and tclSortNoCase,
+ they weren't used, and were not actually correct
+
+ * mac/tkMacFont.c:
+ * mac/tkMacMenu.c:
+ * mac/tkMacWindowMgr.c: fixed greyed out menu items, handling of
+ ... elipsis, font mapping problem, and enabled generated menu
+ posting [Bug: 3705]
+
+1999-12-02 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * generic/tkCmds.c: converted Tk_DestroyCmd, Tk_LowerCmd and
+ Tk_RaiseCmd to their ObjCmd equivalent.
+
+ * library/msgbox.tcl: added color icons for tk_messageBox on Unix
+ and Mac when tk_strictMotif isn't set. (Hipp)
+ * library/tk.tcl: added window bounds checking to ::tk::PlaceWindow
+
+ * tests/imgPPM.test: fixed test 2.2 to use -format ppm (since
+ we know have GIF write capability)
+
+1999-12-01 Scott Redman <redman@scriptics.com>
+
+ * generic/tkMain.c :
+ * unix/tkAppInit.c:
+ * win/winMain.c: Added added hooks into the main() code for
+ supporting TclPro and other "big" shells more easily without
+ requiring a copy of the main() code.
+
+1999-11-29 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkImgGIF.c: added GIF writing that uses miGIF RLE
+ [Bug: 2039, new patch]
+
+ * library/entry.tcl: fixed up tkEntrySeeInsert (Nemthi)
+
+ * generic/tkListbox.c: fixed 'get' of listbox to return a string
+ when only one item is requested.
+
+ * tests/clrpick.test:
+ * tests/filebox.test: minor whitespace cleanup
+
+ * library/tk.tcl: fixed missing $w in ::tk::PlaceWindow
+
+1999-11-24 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/clrpick.tcl:
+ * library/msgbox.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl: fixed dialogs to center over -parent,
+ added utility functions ::tk::PlaceWindow, ::tk::SetFocusGrab,
+ ::tk::RestoreFocusGrab to tk.tcl to help
+
+1999-11-23 Eric Melski <ericm@scriptics.com>
+
+ * tests/listbox.test: Added a test to check that the topIndex is
+ update when items are removed from the listvar variable.
+
+ * generic/tkListbox.c: Added a check the updates the topIndex when
+ items are removed from the listvar variable.
+
+ * tests/listbox.test: Added a test to check that the vertical
+ scrollbar is updated when the listvar changes.
+
+ * generic/tkListbox.c (ListboxListVarProc): added a check that
+ sets the UPDATE_V_SCROLLBAR flag if the length of the listvar has
+ changed.
+
+1999-11-23 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tk.h:
+ * generic/tkConfig.c: added support for TK_OPTION_DONT_SET_DEFAULT
+ as equiv for TK_CONFIG_DONT_SET_DEFAULT
+ * generic/tkListbox.c: added TK_OPTION_DONT_SET_DEFAULT to the
+ item specs
+
+1999-11-19 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkColor.c:
+ * generic/tkColor.h: fixed Tk_NameOfColor to work correctly,
+ with minor change to TkColor struct.
+
+ * generic/tkConsole.c: added static declaration to
+ ConsoleDeleteProc function (proto already had it)
+
+ * win/tkWinInt.h: removed TkFontAttributes typedef (was
+ redundant with tkFont.h).
+ * win/tkWinPort.h: put #ifndef __GNUC__ around redefinition
+ of str[n]casecmp, as cygwin uses the originals.
+ * win/tkWinX.c: changed GetCurrentTime to GetTickCount (the
+ former is deprecated). [Bug: 2053]
+
+1999-11-19 Eric Melski <ericm@scriptics.com>
+
+ * tests/listbox.test: Added tests for itemcget and itemconfigure.
+
+ * doc/listbox.n: Added documentation for -listvar option and for
+ itemconfigure and itemcget commands.
+
+ * generic/tkListbox.c: Added support for itemconfigure/itemcget
+ listbox subcommands (addresses rfe #936)
+
+1999-11-17 Eric Melski <ericm@scriptics.com>
+
+ * tests/listbox.test: Updated tests for new error messages.
+
+ * generic/tkListbox.c: Improved error messages for bad -listvar's.
+
+ * tests/listbox.test: Added tests for bad -listvar's.
+
+ * generic/tkListbox.c: Added handlers for bad -listvar's (ie, bad
+ lists)
+
+ * tests/listbox.test: Added tests for ListboxUpdateHScrollbar.
+
+ * generic/tkListbox.c: Changed some old static buffers to base
+ size on TCL_DOUBLLE_SPACE instead of (completely) hardcoding the size.
+
+ * tests/listbox.test: New tests for -listvar functionality, and an
+ odd extra case that wasn't covered before.
+
+ * generic/tkListbox.c: Tests exposed some bugs, now fixed.
+
+1999-11-16 Eric Melski <ericm@scriptics.com>
+
+ * tests/listbox.test: Fixed tests to comply with new objectified
+ error messages. No -listvar specific tests yet.
+
+ * win/tkWinDefault.h:
+ * unix/tkUnixDefault.h:
+ * mac/tkMacDefault.h: Added default value for -listvar option.
+
+ * generic/tkWindow.c: Changed "listbox" mapping from old-school to
+ new-school objectified command.
+
+ * generic/tkListbox.c: Objectified listbox; added support for
+ -listvar option. Converted internal structure to use a Tcl list
+ object to store the data.
+
+ * generic/tkInt.h: Changed reference to Tk_ListboxCmd to
+ Tk_ListboxObjCmd.
+
+1999-11-09 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkGrid.c: changed Tcl_Alloc to ckalloc
+
+ * generic/tkEntry.c: fixed C expr error in destroy of entry
+ that could lead to 'malformed bucket chain' error
+
+ * win/winMain.c: corrected winMain to not do a DebugBreak when
+ returning an error message from the top level
+
+1999-10-30 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinKey.c: fixed XKeysymToKeycode to handle mapping of
+ symbolic keysyms (Left, Home, ...) with event generate
+
+ * library/entry.tcl: change tkEntrySeeInsert to avoid the use
+ of a while loop that could eat CPU tremendously. Behavior of
+ moving the cursor at the right edge changes slightly (previously
+ it tried to keep the cursor at the right edge, now it moves the
+ cursor to a "central right" location - better IMHO).
+
+1999-10-28 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/CrtImgType.3:
+ * doc/CrtPhImgFmt.3:
+ * doc/FindPhoto.3:
+ * doc/photo.n:
+ * generic/tk.h:
+ * generic/tkCmds.c:
+ * generic/tkImage.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgGIF.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkInt.h:
+ * generic/tkTest.c:
+ * generic/tkWindow.c:
+ * tests/imgPhoto.test: added Img patch (Nijtmans) with docs,
+ headers #def'd with USE_OLD_IMAGE. Upgrades image stuff to
+ Tcl_Obj API, adds alpha channel (images are now 32 bpp)
+
+ * makefile.vc: changed 'c:/program files' to c:/progra~1
+
+1999-10-19 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/scrlbar.tcl: changed tkScrollButtonUp to check for
+ existence of tkPriv(relief) in order to avoid spurious release
+ events
+
+ * unix/Makefile.in: added ChangeLog to dist archive
+
+1999-09-24 Jeff Hobbs <hobbs@scriptics.com>
+
+ * */README:
+ * win/makefile.vc:
+ * */configure.in:
+ * generic/tk.h:
+ * library/tk.tcl: up'd to 8.3a1
+
+ * unix/Makefile.in: changed 'mkdir' to 'mkdir -p'
+
+ * library/dialog.tcl: changed {Times 18} to {Times 12} for
+ dialog font.
+
+1999-09-16 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkFont.c: fixed processing of font options and error
+ returned [Bug: 2075]
+
+ * win/tkWinWm.c: fixed bug in 'wm deiconify' that raised the
+ wrong toplevel, and changed it to not set focus on overridden
+ toplevels
+
+1999-09-15 Jeff Hobbs <hobbs@scriptics.com>
+
+ * unix/aclocal.m4: added fix for FreeBSD-[1-2] recognition [Bug: 2070]
+ and fix to AIX-* to get ldAix right [Bug: 2624], fixed AIX
+ version check (readjust from 8-21 fix) and several other config
+ fixes for AIX
+ * mac/tkMacMenubutton.c:
+ * unix/tkUnixMenubu.c: fixed permanently stippled menubutton image
+ * win/tkWinButton.c: fixed possible pointer smash [Bug: 2733]
+
+1999-09-14 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinMenu.c: fix for stack overrun in GetTextFace [Bug: 909]
+
+1999-09-01 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinDraw.c:
+ * unix/tkUnixDraw.c: fixed header style for TkpDrawHighlightBorder
+ * generic/tkCanvas.c: fixed GC error (bg <> fg) in tkCanvas.c
+ (from code added to support TkpDrawHighlightBorder) [Bug: 2676]
+ * unix/aclocal.m4: added -bnoentry to the AIX-* flags
+ * library/msgbox.tcl: changed the behavior of tk_messageBox on
+ Unix to be more Windows like in handling of <Return> and the
+ default button
+ * library/button.tcl:
+ * library/clrpick.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/palette.tcl:
+ * library/safetk.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl: updated commands to use [string] ops
+ instead of expr equality operators
+
+1999-08-21 Jeff Hobbs <hobbs@scriptics.com>
+
+ * unix/aclocal.m4: Changed AIX-4.[2-9] check to AIX-4.[1-9]
+ [Bug: 1909]
+
+1999-08-20 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkCursor.c: fixed bug in GetCursorFromObj that caused
+ panic [Bug: 2562]
+
+ * TK 8.2.0 RELEASED
+
+1999-08-13 Jim Ingham <jingham@cygnus.com>
+
+ * mac/tkMacMenu.c: Tk_DrawChars ends up setting the menu background
+ wrong. There is no clean way to stop it, so I use lower level routines
+ here to draw the text.
+ * mac/tkMacProjects.sea.hqx: Rearrange the projects so that the build
+ directory is separate from the sources. Much more convenient!
+
+1999-08-10 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinWm.c: changed "wm deiconify" on Windows to raise and
+ force the focus on the deiconified window (behavioral change from
+ 8.1 to comply better with Windows style) [Bug: 1609]
+ * doc/wm.n: clarified behavior of "wm deiconify".
+ * generic/tkInt.decls: added TkSetFocusWin
+ * generic/tkFocus.c: changed static SetFocus to TkSetFocusWin
+
+ * library/clrpick.tcl:
+ * library/console.tcl:
+ * library/tk.tcl: fixed code where abbreviations where used
+ in calling widget methods (confuses iWidgets) [Bug: 2422]
+
+1999-08-09 Jeff Hobbs <hobbs@scriptics.com>
+
+ * library/button.tcl: cleaned up programming (config -> configure)
+ and fixed Windows relief bug [Bug: 664]
+ * library/entry.tcl: changed Entry C/C/P to not use global data
+ (now uses tkPriv(data)) [Bug: 1475]
+ * library/listbox.tcl: fixed extended mode script error [Bug: 866]
+ * doc/options.n: clarified that -troughcolor doesn't work on Windows
+ * doc/wm.n: fixed wm positionfrom docs [Bug: 2284]
+
+1999-08-01 Jeff Hobbs <hobbs@scriptics.com>
+
+ * mac/tkMacPort.h: wrapped panic in #ifndef panic to avoid
+ compiler errors when used with stubs-#defines, from Vince Darley.
+ [Bug: 2389]
+
+1999-07-31 Scott Redman <redman@scriptics.com>
+
+ * xlib/X11/Xlib.h: Remove XFillRectangle since it is now in the
+ stub tables.
+
+1999-07-30 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkInt.decls: Added stub entry for XFillRectangle [Bug: 2446]
+
+1999-07-30 Scott Redman <redman@scriptics.com>
+
+ * win/makefile.vc: Corrected building threaded tktest.exe on
+ Windows. Needed to link in .obj files from Tcl, needs to change
+ later so that code is in Tk and doesn't require a Tcl build.
+ Also added runtest target.
+
+1999-07-29 Scott Redman <redman@scriptics.com>
+
+ * generic/tkConsole.c: Allow tcl to open CON and NUL, even for std
+ channels. Checking for bad/unusable std channels was moved to Tk
+ since its only purpose was to check whether to use the Tk Console
+ Window for the std channels. [Bug: 2393 2392 2209 2458]
+
+ * win/Makefile.in: Corrected building threaded tktest.exe on
+ Windows. Needed to link in .obj files from Tcl, needs to change
+ later so that code is in Tk and doesn't require a Tcl build.
+
+1999-07-22 Scott Redman <redman@scriptics.com>
+
+ * Changed version to 8.2b2
+
+ * win/tkWinPort.h: Block out include of sys/stat.h in order to
+ build extensions with MetroWerks compiler for Win32. [Bug: 2385]
+
+ * unix/Makefile.in: Need to make install-sh executable before
+ calling (with chmod +x). [Bug: 2413]
+
+ * library/menu.tcl: Applied patch from Jeff Hobbs to fix typo.
+ [Bug: 2425]
+
+1999-07-21 Scott Redman <redman@scriptics.com>
+
+ * unix/Makefile.in: Add Windows configure script to distribution.
+
+1999-07-16 Scott Redman <redman@scriptics.com>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Copy the prolog.ps from the generic directory
+ for install-libraries.
+
+ * unix/aclocal.m4: Check for Alpha/Linux to set the IEEE flag to
+ the compiler to be -mieee. Patch from Don Porter.
+
+1999-07-08 Scott Stanton <stanton@scriptics.com>
+
+ * tests/unixSelect.test: Fixed broken test.
+
+ * win/makefile.vc: Added special case target to ensure that
+ tkStubLib.obj is built with -DSTATIC_BUILD.
+
+ * win/tkWinX.c (TkWinChildProc): Changed to pass
+ WM_WINDOWPOSCHANGED through to DefWindowProc to make OpenGL
+ sub-windows happy. This allows Windows to generate the WM_SIZE
+ and WM_MOVE messages.
+
+1999-07-08 Scott Redman <redman@scriptics.com>
+
+ * unix/configure.in: Fix Tk stub lib file names and flags.
+
+1999-06-30 Scott Redman <redman@scriptics.com>
+
+ * generic/tkGrid.c: removed deprecated functions (applied patch
+ from Jan Nijtmans). [Bug: 2080]
+
+ * generic/tkImgGIF.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c: Applied patch to allow Img extension to
+ work with 8.2, from Jan Nijtmans. [Bug: 2068]
+
+ * win/tkWinWm.c: Applied patch from Don Porter to prevent the
+ windows code from calling the Tcl functions when the stub table
+ has not been initialized in TkWinWmCleanup. [Bug: 2269]
+
+1999-06-16 Michael Thomas <wart@scriptics.com>
+
+ * unix/configure.in:
+ * unix/Makefile.in:
+ * unix/aclocal.m4: Numerous build changes to make Tk conform to
+ the proposed TEA spec
+
+ * tkConsole.c: changed some variable types from (int) to (size_t)
+ to prevent compiler warnings. Cast return value from strlen()
+ to (int) in one place for the same reason.
+
+1999-06-03 Scott Stanton <stanton@scriptics.com>
+
+ * unix/tkUnixSelect.c:
+ * tests/unixSelect.test:
+ * generic/tkSelect.c: Fixed selection code to handle Unicode data
+ in COMPOUND_TEXT and STRING selections. [Bug: 1791]
+
+1999-06-02 Scott Stanton <stanton@scriptics.com>
+
+ * generic/tkIntXlibDecls.h:
+ * xlib/X11/Xlib.h: Added Mac specific defines to help with
+ compilation.
+
+ * generic/tkFont.c: lint
+
+1999-06-01 Scott Stanton <stanton@scriptics.com>
+
+ * unix/tkUnixSelect.c: Improved I18N selection support.
+ COMPOUND_TEXT is converted to/from iso2022, and STRING is
+ converted to/from iso8859-1. There are still a few loose ends to
+ tie up before this is completely done.
+
+ * unix/tkUnixFont.c: Eliminated redundant case folding code.
+
+ * generic/tkFont.c: Eliminated use of isupper/tolower in favor of
+ Unicode variants.
+
+1999-05-24 Scott Stanton <stanton@scriptics.com>
+
+ * generic/tkStubLib.c:
+ * generic/tkStubInit.c:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkInt.decls:
+ * generic/tkConsole.c: Various changes to try to get the Mac
+ builds working.
+
+1999-05-21 Scott Stanton <stanton@scriptics.com>
+
+ * win/tkWinClipboard.c: Fixed clipboard code to handle lack of
+ CF_LOCALE information (e.g. from command.com).
+
+1999-05-20 Scott Redman <redman@scriptics.com>
+
+ * library/console.tcl: Changed copyright string to read 1999
+ Scriptics Corp. in wish console about box.
+
+1999-05-19 Scott Redman <redman@scriptics.com>
+
+ * generic/tk.h: Add extern "C" block around entire header file for
+ C++ compilers to fix linkage issues. Submitted by Don Porter and
+ Paul Duffin.
+
+1999-05-18 Scott Stanton <stanton@scriptics.com>
+
+ * tests/winClipboard.test:
+ * win/tkWinClipboard.c: Fixed clipboard code so it handles Unicode
+ data properly on Windows NT and 95. [Bug: 1791]
+
+1999-05-07 Scott Stanton <stanton@scriptics.com>
+
+ * library/menu.tcl: Fixed bug where tk_popup fails when called too
+ quickly. [Bug: 2009]
+
+1999-04-30 Scott Stanton <stanton@scriptics.com>
+
+ * Changed version number to 8.1.1.
+
+1999-04-30 Scott Stanton <stanton@scriptics.com>
+
+ * Merged changes from 8.1.0 branch:
+
+ * generic/tkDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c: Changed to avoid the need for forward
+ declarations in stub initializers. Added extern "C" blocks around
+ stub table pointer declarations so the stubs can be used from C++
+ code. [Bug: 1934]
+
+ * generic/tkInt.decls: Added TkClipBox, XDrawSegments, and
+ XForceScreenSaver to stubs.
+
+ * generic/tkStubLib.c: Reordered declarations to avoid
+ circularities and forward references.
+
+ * generic/tkStubInit.c: Added includes for Mac.
+
+ * generic/tkMenubutton.c: lint
+
+ * generic/tkEntry.c: Fixed bad option table entry.
+
+ * generic/tkImgBmap.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c: Set the -translation and -encoding options
+ to binary for image files. (reported by Marco Gazzetta)
+
+1999-04-23 Scott Stanton <stanton@scriptics.com>
+
+ * generic/tkInt.decls: Added TkClipBox, XDrawSegments, and
+ XForceScreenSaver to stubs.
+
+ * generic/tkStubLib.c: Reordered declarations to avoid
+ circularities and forward references.
+
+ * generic/tkStubInit.c: Added includes for Mac.
+
+ * generic/tkMenubutton.c: lint
+
+ * generic/tkEntry.c: Fixed bad option table entry.
+
+1999-04-22 Scott Redman <redman@scriptics.com>
+
+ * generic/tkImgBmap.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c: Set the -translation and -encoding options
+ to binary for image files. (reported by Marco Gazzetta)
+
+1999-04-20 Scott Redman <redman@scriptics.com>
+
+ * xlib/X11/Xlib.h: changed definition of Status type to use a
+ typedef instead of a #define to avoid conflicting with the cygwin
+ win32 headers [Bug 1804]
+
+1999-04-15 Scott Stanton <stanton@scriptics.com>
+
+ * Merged 8.1 branch into the main trunk
+
+1999-04-09 Scott Redman <redman@scriptics.com>
+
+ * generic/tkWindow.c: Fixed deadlock situation when the Initialize()
+ function returns without releasing the mutex. Found while testing
+ Bug 1700, during safe.test (tk).
+
+1999-04-06 Scott Stanton <stanton@scriptics.com>
+
+ * generic/tkMain.c (Tk_MainEx): Changed to reset result before
+ calling Tcl_EvalFile. The ensures that error messages will be
+ generated cleanly.
+
+ * tests/winfo.test: Enabled tests that previously failed.
+
+1999-04-05 Scott Stanton <stanton@scriptics.com>
+
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/clrpick.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/palette.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl: Lots of minor performance improvements
+ contributed by Jeffrey Hobbs. [Bug: 1118]
+
+ * win/tkWinWm.c (Tk_WmCmd): Fixed bad code in tracing
+ suboption. [Bug: 1519]
+
+ * library/tkfbox.tcl: Change to restore button text after an
+ action to avoid the sticky "Open" button in a save dialog.
+ [Bug: 1640]
+
+ * library/entry.tcl: Fixed so selection is returned using the
+ -show character during cut and paste operations. [Bug: 1687]
+
+1999-04-5 Scott Redman <redman@scriptics.com>
+
+ * generic/tkInt.decls:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkStubInit.c:
+ * xlib/xgc.c:
+ * xlib/X11/Xlib.h:
+ * xlib/X11/Xutil.h: Added more X functions to the Win & Mac stubs
+ tables.
+
+1999-04-05 Scott Stanton <stanton@scriptics.com>
+
+ * unix/configure.in:
+ * generic/tkCanvPs.c: Added configure test for pw_gecos field in
+ pwd to support OS/390. [Bug: 1724]
+
+1999-04-02 Scott Stanton <stanton@scriptics.com>
+
+ * tests/text.test:
+ * generic/tkText.c: Fixed handling of Unicode in text searches.
+ The -count option was returning byte counts instead of character
+ counts. [Bug: 1056, 1148, 1666]
+
+1999-04-01 Scott Redman <redman@scriptics.com>
+
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tkStubInit.c:
+ * generic/tkWindow.c:
+ * unix/Makefile.in:
+ * win/makefile.vc: Tk now uses its own stub library to store
+ pointers to its own stubs table.
+
+ * doc/dde.n: (removed)
+ * doc/send.n:
+ * generic/tk.decls:
+ * tests/winSend.test:
+ * generic/tkPlatDecls.h:
+ * win/tkWinSend.c: Removed the DDE-based send and dde commands,
+ they were causing Tk to lock up when any window on the system was
+ not processing its message queue (more importantly, windows in Tcl
+ and Tk). The send command needs to be rewritten to prevent the
+ deadlock situation (soon). The dde command is being pushed into
+ its own package and will provide almost all of the capabilities
+ that send did before (using a "dde eval" command), not yet
+ completed.
+
+1999-03-31 Scott Redman <redman@scriptics.com>
+
+ * win/tkWinSend.c: Modified dde/send code to work properly on
+ Win95/Win98. String lengths are not returned properly by DDE, so
+ NULL terminate all strings going in and ignore the string length
+ coming back out. Do not destroy handles until all necessary work
+ on those handles (and child handles) is done.
+
+1999-03-30 Scott Stanton <stanton@scriptics.com>
+
+ * generic/tkWindow.c (Tk_DestroyWindow): Image handlers are now
+ finalized before the font subsystem since complex image handlers
+ may contain references to fonts (e.g. Tix compound images).
+ [Bug: 1603]
+
+1999-03-29 Scott Stanton <stanton@scriptics.com>
+
+ * doc/MeasureChar.3:
+ * doc/TextLayout.3:
+ * generic/tk.decls:
+ * generic/tkCanvText.c:
+ * generic/tkEntry.c:
+ * generic/tkFont.c:
+ * generic/tkListbox.c:
+ * generic/tkMessage.c:
+ * mac/tkMacFont.c:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixMenu.c:
+ * win/tkWinFont.c:
+ * win/tkWinMenu.c: Standardized text layout and font interfaces
+ so they are consistent with respect to byte versus character
+ oriented indices. The layout functions all manipulate character
+ oriented values while the lower level measurement functions all
+ operate on byte oriented values. This distinction was not clear
+ and so the functions were being used improperly in a number of
+ places. [Bug: 1053, 747, 749, 1646]
+
+ * generic/tk.decls: Eliminated uses of C++ STL types string and
+ list from declarations.
+
+ * generic/tkFont.c: Changes to named fonts were not being
+ propagated in some cases. [Bug: 1144]
+
+ * xlib/X11/Xlib.h:
+ * generic/tkInt.decls: Added XParseColor to xlib stub
+ tables. [Bug: 1574]
+
+ * doc/GetBitmap.3:
+ * generic/tkBitmap.c (BitmapInit): Eliminated use of Tk_Uid's in
+ bitmaps. Added a few CONST declarations.
+
+1999-03-29 Scott Redman <redman@scriptics.com>
+
+ * unix/configure.in:
+ * unix/Makefile.in:
+ * win/makefile.vc:
+ * generic/tkDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkIntXlibDecls.h: Removed stub functions. Always use the
+ Tcl stubs when building with --enable-shared.
+
+1999-03-26 Scott Redman <redman@scriptics.com>
+
+ * generic/tkTextIndex.c:
+ * tests/testIndex.test: Avoid looking past the beginning of the
+ array storing data for the text widget (.t index end-2c). Added
+ test case to check for the bug. [Bug 991]
+
+ * generic/tkConsole.c: Copy static strings into a Tcl_DString
+ before passing to Tcl_Eval, in case the compiler puts static
+ strings into read-only memory.
+
+1999-03-26 Suresh Ankolekar <suresh@scriptics.com>
+
+ * unix/configure.in:
+ --nameble-shared is now the default and builds Tk as a shared
+ library; specify --disable-shared to build a static Tk library
+ and shell.
+
+1999-03-26 Bryan Surles <surles@scriptics.com>
+
+ * library/menu.tcl: Fixed bug reported by Bryan Oakley in the
+ menubutton bindings. There was a false assumption that there was
+ always a menu attached to the button. [Bug 1116]
+
+1999-03-26 Scott Redman <redman@scriptics.com>
+
+ * unix/configure.in: Removed --enable-tcl-stub. Linking Tk to Tcl
+ stubs is causing too many problems when linking executables like wish.
+ Until the Tk is a fully loadable extension, linking against the Tcl
+ stubs is not supported in Tk.
+
+1999-03-19 Scott Redman <redman@scriptics.com>
+
+ * generic/tkBitmap.c:
+ * generic/tkCursor.c:
+ * generic/tkGC.c: When creating hash tables that key off of XID
+ handles, make sure to pass TCL_ONE_WORD_KEYS. XIDs are guaranteed
+ to be 32bit numbers, although on some 64bit systems (including 64bit
+ Solaris 7) they are packed into a 64bit value where the upper 32bits
+ are zero. The normal method of sizeof(XID)/sizeof(int) causes the
+ hash table code to assume that the XID is a pointer to an array of
+ two ints, which it is not. Tk now supports 64bit Solaris 7.
+
+1999-03-17 Scott Stanton <stanton@scriptics.com>
+
+ * win/makefile.vc:
+ * generic/tk.h: Changed to use TCL_BETA_RELEASE macro, and fixed
+ so this works in rc files.
+
+ * win/makefile.vc:
+ * win/makefile.bc:
+ * win/README:
+ * unix/configure.in:
+ * generic/tk.h:
+ * README: Updated version to 8.1b3.
+
+1999-03-14 Scott Stanton <stanton@GASPODE>
+
+ * unix/configure.in: Added missing stub related definitions.
+
+ * unix/Makefile.in: Install tkDecls.h in addition to tk.h.
+
+ * generic/tkStubLib.c: Added flags to ensure we are using Tcl
+ stub macros.
+
+1999-03-11 Scott Stanton <stanton@GASPODE>
+
+ * generic/tkInt.decls: Added reserved slot for XSetDashes for use
+ by the dash patch.
+
+1999-03-10 Scott Redman <redman@scriptics.com>
+
+ * xlib/xdraw.c:
+ * xlib/X11/Xlib.h:
+ * mac/tkMac.h:
+ * mac/tkMacInt.h:
+ * mac/tkMacPort.h:
+ * mac/tkMacXStubs.c:
+ * mac/tkMacAppInit.c:
+ * mac/tkMacCursor.c:
+ * win/makefile.vc:
+ * win/tkWin.h:
+ * win/tkWinInt.h:
+ * win/tkWinPort.h:
+ * win/winMain.c:
+ * generic/tk.h:
+ * generic/tkInt.h:
+ * generic/tk.decls:
+ * generic/tkInt.decls:
+ * generic/tkDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkStubs.c:
+ * generic/tkPlatStubs.c:
+ * generic/tkIntStubs.c:
+ * generic/tkIntPlatStubs.c:
+ * generic/tkIntXlibStubs.c:
+ * generic/tkStubInit.c:
+ * generic/tkStubLib.c:
+ * generic/tkBind.c:
+ * generic/tkCmds.c:
+ * generic/tkConfig.c:
+ * generic/tkConsole.c:
+ * generic/tkCursor.c:
+ * generic/tkGrab.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkMain.c:
+ * generic/tkMenu.c:
+ * generic/tkPointer.c:
+ * generic/tkTextDisp.c:
+ * generic/tkWindow.c:
+ * unix/tkUnixInt.h:
+ * unix/tkUnixPort.h:
+ * unix/Makefile.in:
+ * unix/configure.in:
+ * unix/tkConfig.sh.in:
+ * unix/tkUnix.c:
+ * unix/tkUnix3d.c:
+ * unix/tkUnixDraw.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixMenubu.c: Stubs implementation for 8.1. Tk_Main() is
+ replaced with a macro which calls Tk_MainEx(). Tk can link to the Tcl
+ stubs library, wish links directly to Tcl and Tk. Use
+ --enable-tcl-stubs to link Tk to the Tcl stubs library (Unix), on
+ by default on Windows. Exported all public functions through the
+ stubs mechanism (see the *.decls files) and many of the internal
+ functions. Most of the changes dealt with shifting around the
+ function declarations in the header files. Mac code may not
+ compile, but it shouldn't take much work to fix this.
+
+ * mac/tkMacMenu.c: Added dummy TkpMenuThreadInit for Mac to be
+ consistent with Unix and Windows versions.
+
+1999-03-08 Lee Bernhard <lfb@scriptics.com>
+
+ * win/tkWinWm.c: Toplevel class no longer shared between
+ threads.
+
+ * win/tkWinX.c: Multiple threads no longer share the same
+ TkDisplay structure. Required because TkDisplay stores much
+ thread-specific data for a given thread.
+
+ * win/tkWinSend.c: Moved application instance handle out
+ out thread-local storage. DDE was failing to initialize
+ when the instance handles were different between threads.
+
+ * win/makefile.vc: Added THREADDEFINES for building with
+ threads enabled.
+
+ * generic/tkMenu.c:
+ * win/tkWinMenu.c:
+ * unix/tkUnixMenu.c: Added TkpMenuThreadInit for initializing
+ thread-specific Menu state.
+
+1999-03-01 Scott Redman <redman@scriptics.com>
+
+ * win/tkWinWm.c:
+ * win/tkWinPointer.c:
+ * win/tkWinInt.h: Fix "focus -force" for Windows. The Win32 API
+ function SetForegroundWindow() does not work unless the window
+ handle is a toplevel window (a Windows toplevel). The handle
+ being passed was a Tk toplevel, which is a child of the Windows
+ toplevel.
+
+1999-02-26 Scott Redman <redman@scriptics.com>
+
+ * win/cat.c: Remove this file, use the one in the Tcl source directory.
+
+ * win/makefile.vc: Remove the wishc.exe from the default targets. Add
+ a separate console-wish target to build it. The need for a
+ console-wish will go away soon, so we don't want to encourage its
+ use.
+
+1999-02-25 Scott Redman <redman@scriptics.com>
+
+ * win/tkWinWm.c: Properly initialize the tsdPtr->firstWindow field.
+
+ * win/cat.c: Code for cat32.exe, copied from the Tcl sources. Required
+ in order to run the test suite from the makefile
+
+ * win/winMain.c: Add main() for a console-based wishc.exe, which meant
+ adding code to disable the call to Tk_ConsoleInit().
+
+ * generic/tkConsole.c: Check the standard handles before creating the
+ new standard channels. This allows a windows app that has stdin,
+ stdout, or stderr to correctly connect to them.
+
+ * generic/tkMain.c: Add a proper check for the interactive mode, since
+ the standard channels may actually be connected in windows mode or
+ even in the console-based wish.
+
+ * win/makefile.vc: Add targets for wishc.exe (console-based wish) and
+ cat32.exe (for testing). Fix the test suite target so it can be run
+ from the makefile (which can happen since the standard handles have
+ been fixed).
+
+1999-02-12 Lee Bernhard <lfb@scriptics.com>
+
+ * generic/tkMenuButton.h:
+ * generic/tkMenuButton.c:
+ * mac/tkMacMenubutton.c:
+ * mac/tkMacDefault.h
+ * unix/tkUnixMenubu.c: Eliminated Tk_Uids used by -state option.
+ * unix/tkUnixDefault.h
+ * win/tkWinDefault.h
+
+ * generic/tk.h:
+ * generic/tkScale.h:
+ * generic/tkScale.c:
+ * generic/tkWindow.c:
+ * unix/tkUnixScale.c:
+ * unix/tkUnixDefault.h:
+ * unix/tkWinDefault.h:
+ * mac/tkMacDefault.h: Objectified scale widget.
+
+ * win/tkWinX.c: Removed Thread-specific data from process
+ initialization code that was stopping the Tk Dll from
+ loading.
+
+1999-02-11 Scott Stanton <stanton@GASPODE>
+
+ * README:
+ * generic/tk.h:
+ * unix/configure.in:
+ * win/README:
+ * win/makefile.bc:
+ * win/makefile.vc: Updated version to 8.1b2.
+
+ * unix/tkUnixSend.c: Fixed one more Tcl_*ObjVar instance.
+
+1999-02-04 Scott Stanton <stanton@GASPODE>
+
+ * Various cleanup related to the Tcl_Eval and Tcl_ObjSetVar
+ changes in Tcl.
+
+ INTEGRATED PATCHES FROM 8.0.5b2:
+
+ * win/tkWinMenu.c (TkpDestroyMenu): Changed so modalMenuPtr is
+ cleared when it is being destroyed.
+
+ * generic/tkImgPhoto.c: Changed so color tables are freed
+ immediately instead of being delayed. This ensures that color
+ tables are properly disposed at process exit.
+
+ * library/prolog.ps: Changed string that determines font height to
+ include European character with an umlaut.
+
+ * generic/tkImgBmap.c (ImgBmapConfigureInstance): If an image
+ mask changed but ended up with the same XID, the GC failed to be
+ updated and so the new mask was not used. [Bug: 970]
+
+ * generic/tkFocus.c (SetFocus): Changed so focus window is always
+ set if -force is specified. This fixes the problem on Windows
+ where Tk does not activate the window if it already has focus.
+
+ * generic/tkConsole.c: Fixed so errors in console eval are
+ reported properly. Eliminated duplicate result messages. [Bug: 973]
+
+ * win/tkWinWm.c: Changed so windows that aren't resizable don't
+ have resize handles and the zoom box is disabled.
+
+ * win/tkWinInt.h:
+ * win/tkWinPointer.c: Changed to cancel the mouse timer when a
+ user initiated move/resize loop begins.
+
+ * unix/configure.in: TK_LD_SEARCH_FLAGS was set incorrectly if
+ SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through
+ the C compiler. Systems affected are Linux, MP-RAS and NEXTSTEP,
+ but also with gcc on many more systems. [Bug: 908]
+
+ * win/makefile.vc: First stab at install target. Fixed quoting so
+ paths with spaces work.
+
+ * tests/main.test:
+ * tests/unixWm.test: Better cleanup of temporary files.
+
+ * mac/tkMacAppInit.c:
+ * generic/tkTest.c:
+ * generic/tkAppInit.c:
+ * win/winMain.c: Changed some EXTERN declarations to extern
+ since they are not defining exported interfaces. This avoids
+ generating useless declspec() attributes and makes the windows
+ makefile simpler.
+
+ * library/menu.tcl (tkMenuFind): Changed so keyboard shortcuts
+ will only be found in the current toplevel. Previously, they
+ might be found in menus attached to other toplevels that might not
+ even be mapped. [Bug: 924]
+
+ * generic/tkCanvLine.c: Changed to treat zero width lines like
+ they have width 1 for purposes of selection. [Bug: 925]
+
+ * win/tkWinFont.c (Tk_MeasureChars): Added a workaround for a bug
+ in GetTextExtentExPoint on Win NT 4.0/Japanese. [Bug: 1006]
+
+ * unix/tkUnixSend.c (Tk_SetAppName): Fixed uninitialized memory
+ access bug. [Bug: 919]
+
+1999-1-28 Scott Stanton <stanton@GASPODE>
+
+ * generic/tkGrid.c: Fixed bug in "grid forget" that failed to cancel
+ pending idle handlers, resulting in a crash in a few odd cases.
+
+1999-01-06 Lee Bernhard <lfb@JUSTICE>
+
+ * generic/tk.h, generic/tkGet.c, generic/tkConfig.c,
+ * generic/tkOldConfig.c, generic/tkEntry.c, generic/tkMenubutton.c,
+ * generic/tkMenubutton.h, generic/tkScale.c, generic/tkScale.h,
+ * generic/tkTextDisplay.c, generic/tkText.c, unix/tkUnixMenubu.c,
+ * unix/tkUnixScale.c, mac/tkMacMenu.c, mac/tkMacMenubutton.c,
+
+ Removed global Tk_Uids dealing with "-state" configuration option
+ and added new TK_CONFIG_STATE configSpec that doesn't use
+ Tk_Uids.
+
+1998-12-11 === Tk 8.1b1 Release ===
+
+1998-12-11 Scott Stanton <stanton@GASPODE>
+
+ * generic/tkMain.c (Tk_Main): Fixed improper command line encoding
+ handling.
+
+1998-12-08 Scott Stanton <stanton@GASPODE>
+
+ * win/tkWinClipboard.c (TkSelGetSelection, TkWinClipboardRender):
+ Changed to handle multibyte characters properly. [Bug: 935]
+
+1998-12-07 Scott Stanton <stanton@GASPODE>
+
+ * library/xmfbox.tcl (tkMotifFDialog_Create): In the cached case,
+ the data array was not being initialized with the correct set of
+ widgets.
+
+1998-12-4 Brent Welch <welch@SAGE>
+
+ * Changed patchLevel to 8.1b1
+
+ * generic/tkMenu.c (ConfigureMenuCloneEntries): The -menu configuration
+ option was being incorrectly specified as just "menu".
+
+1998-11-30 Scott Stanton <stanton@GASPODE>
+
+ * generic/tkButton.c (ConfigureButton): The error result was
+ getting lost when restoring configuration options. [Bug: 619]
+
+1998-11-25 Scott Stanton <stanton@GASPODE>
+
+ * unix/tkUnixFont.c (GetFontAttributes): Initialize an unspecified
+ family to an empty string.
+ (FontMapLoadPage): if the font included characters below 32, the
+ index computation was incorrect because the range was shifted up
+ to 32.
+ (CreateClosestFont): check for empty locale as well as NULL.
+
+ * generic/tkFont.c (TkFontParseXLFD): initialize charset to
+ iso8859-1 if no charset is specified.
+
+ * mac/tkMacHLEvents.c (OdocHandler): added conversion from
+ external string to UTF [Bug: 869]
+
+ * integrated tk8.0.4 changes.
+
+ * generic/tkBind.c: fixed deletion order bug where a crash would
+ result if a binding deleted "."
+
+ * generic/tkMenu.c (MenuWidgetObjCmd): disabled menu entries were
+ getting reenabled whenever the mouse passed over the entry [Bug: 860]
+
+ * unix/tkUnixMenu.c (TkpComputeStandardMenuGeometry): hidemargin
+ option was not honored properly in menus [Bug: 859]
+
+1998-11-24 Scott Stanton <stanton@GASPODE>
+
+ * tkMacMenu.c, tkUnixMenu.c, tkWinMenu.c, tkMenuDraw.c, tkMenu.h,
+ * tkMenu.c: Backed out the previous fix for bug 620 and
+ eliminated a bunch of code that created unnecessary objects.
+ Changed back to using internal types instead of objects for many
+ configuration options. There are many more fixes like this that
+ could be made, but some require a little restructuring of the
+ code. In any case the leaks are fixed and there is a lot less
+ allocation happening. [Bug: 620]
+
+1998-11-19 Scott Stanton <stanton@GASPODE>
+
+ * tkMenu.c (DestroyMenuEntry): fixed memory leaks [Bug: 620]
+
+ * tkWinX.c (GetTranslatedKey): fixed bad code merge
+
+ * tkWinWm.c, tkWinMenu.c: fixed titles and menus so they properly
+ display Unicode [Bug: 819]
diff --git a/ChangeLog.2004 b/ChangeLog.2004
new file mode 100644
index 0000000..5a02238
--- /dev/null
+++ b/ChangeLog.2004
@@ -0,0 +1,3653 @@
+2004-12-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tcl.m4, win/configure: update MSVC CFLAGS_OPT to -O2, remove -Gs
+ (included in -O2) and -GD (outdated). Use "link -lib" instead of "lib"
+ binary and remove -YX for MSVC7 portability. Add -fomit-frame-pointer
+ for gcc OPT compiles. [Bug 1092952, 1091967]
+
+2004-12-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/*.tcl: Add [package require Tk] to all the widget demo
+ scripts so they follow standard practice better. [FRQ 815118]
+
+2004-12-20 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkFileFilter.c:
+ * generic/tkFileFilter.h:
+ * macosx/tkMacOSXDialog.c:
+ * win/tkWinDialog.c:
+ * tests/filebox.test:
+ * tests/winDialog.test: Corrected handling of MacOS file types in
+ tk_*file dialogs [Bug 1083878].
+
+2004-12-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/panedwindow.n: Fix silly typo. [Bug 1087842]
+
+2004-12-19 Chengye Mao <chengye.geo@yahoo.com>
+
+ * win/tkWin.h, win/tkWinEmbed.h: Make embedding work better on Windows.
+ * win/tkWinWm.c, win/tkWinX.c: [Bugs 222677, 831627, 842945, 1024364]
+
+2004-12-17 Chengye Mao <chengye.geo@yahoo.com>
+
+ * generic/tkFrame.c: Make container windows display their
+ * generic/tkWindow.c: background when they don't have content.
+
+2004-12-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * unix/tk.spec, macosx/Tk-Info.plist, macosx/Wish-Info.plist:
+ * macosx/Wish.pbproj/project.pbxproj, README, win/configure.in:
+ * unix/configure.in, generic/tk.h: Bump version to 8.5a3.
+
+2004-12-09 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: synced with tcl/unix/tcl.m4
+ * unix/configure: regen
+
+2004-12-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
+ Added guards so that rescanning for the complex-alpha check is not done
+ in the common case of creating a simple image a bit at a time, or any
+ other time where the image was simple before and the input data has no
+ alpha channel. [Bug 1081966]
+
+2004-12-07 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/canvPs.test: Cleaned up the matching of [makeFile] and
+ * tests/choosedir.test: [removeFile] commands as indicated by the
+ * tests/filebox.test: results of a -debug 1 run of the test suite.
+ * tests/imgPPM.test: Tk test suite is now -debug 1 clean. This
+ * tests/imgPhoto.test: completes fixing [1078648].
+ * tests/listbox.test:
+ * tests/main.test:
+
+2004-12-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/bind.test, tests/button.test, tests/canvas.test:
+ * tests/cursor.test, tests/scrollbar.test: Eliminate all duplicate test
+ names. [Bug 1078648 again]
+
+2004-12-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.5a2 TAGGED FOR RELEASE ***
+
+2004-12-06 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/safe.test: Trim auto_path to improve performance [1080039]
+
+2004-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * changes: updated for 8.5a2 release
+
+2004-12-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/*.test: Resolve duplicate test names. [Bug 1078648]
+
+2004-12-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Make
+ overlay compositing where the target is empty no longer set the target
+ to magical gray, and also make sure that the complex-alpha flag is
+ toggled when necessary. [Patch 848161]
+
+2004-12-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixButton.c (TkpDisplayButton): constrain coords to
+ Tk_RedrawImage to display only portion that is valid.
+ * generic/tkImgPhoto.c (ImgPhotoDisplay): add X error suppression
+ around XGetImage to prevent app abort. [Bug 979239]
+
+2004-11-28 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c(Tk_DrawChars): Check for short integer overflow in
+ x,y coordinates [Fixes: Bug 942320 "Tk, Xft, text and long lines"]
+
+2004-11-26 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Shell targets needed more stack space. [Bug 1066755]
+
+2004-11-20 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/text.test: fix to test's platform sensitivities [Bug 1025871]
+ * tests/textDisp.test: made test less timing sensitive [Bug 1034171],
+ and fixed a platform-sensitive test [Bug 966845]
+
+2004-11-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: reverted earlier changes for
+ tclConfig.h changes to tcl, since those have been reverted for now.
+
+ Note that newly added macosx/Wish.xcode will not work without
+ tclConfig.h, this project has not been removed again.
+
+2004-11-18 Reinhard Max <max@suse.de>
+
+ * unix/tcl.m4 (SC_CONFIG_MANPAGES): Applied an improved version of
+ * unix/configure.in: [Patch 996085], that introduces
+ * unix/Makefile.in: --enable-man-suffix.
+
+ * unix/installManPage: added
+ * unix/mkLinks.tcl: removed
+ * unix/mkLinks: removed
+ * unix/configure: generated
+
+2004-11-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCanvWind.c (ConfigureWinItem): unmap windows immediately
+ when state hidden is requested. [Bug 982248]
+
+ * generic/tkCanvImg.c (ImageToPostscript): don't try ps generation of
+ canvas image item without image specified. [Bug 1032300]
+
+ * library/console.tcl (::tk::console::ExpandVariable): correct array
+ keyname expansion. [Bug 1004508] (bold)
+
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): set save_under X attr
+ to prevent expose events when moving sash. [Bug 1036963]
+
+2004-11-16 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * doc/text.n: clarified documentation on use of -tabs option.
+
+2004-11-16 Don Porter <dgp@users.sourceforge.net>
+
+ * library/msgs/it.msg: Updated Italian message catalog. Thanks to
+ Roberto Ugoccioni [Bug 1063675].
+
+2004-11-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/buildTkConfig.tcl: fixes for tclConfig.h changes.
+
+ * macosx/Wish.pbproj/project.pbxproj: fixed references to renamed
+ bitmap files.
+
+ * macosx/Wish.xcode/project.pbxproj (new):
+ * macosx/Wish.xcode/default.pbxuser (new):
+ * macosx/Wish-Info.plist (new):
+ * macosx/Tk-Info.plist (new): added new Xcode 1.5 project using native
+ targets, made possible by tclConfig.h changes.
+
+ * generic/tk.h: added version number change comments for new files.
+
+2004-11-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c: fix to multi-line search problem and removed
+ * tests/text.test: 'knownBug' from one test.
+
+2004-11-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * unix/tcl.m4, unix/configure.in: Expanded all AC_DEFINE calls to the
+ three-argument form and ported recent changes to the tcl.m4 from the
+ Tcl distribution. *No* call to AC_CONFIG_HEADERS has been added; this
+ change should be virtually entirely cosmetic.
+
+2004-11-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXXStubs.c: implemented XGetGeometry().
+
+2004-11-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCmds.c (Tk_TkObjCmd): use correct screen data when
+ -displayof arg is passed to [tk scaling]. [Bug 800178]
+
+2004-11-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * doc/SetOptions.3:
+ * doc/text.n: fixed *roff errors uncovered by running 'make html'.
+
+ * macosx/tkMacOSXFont.c (Tk_MeasureChars,Tk_DrawChars,etc): Make sure
+ that the lastSubFontPtr remains valid even when the subfont array is
+ reallocated. [Bug 618872]
+
+2004-11-11 Reinhard Max <max@suse.de>
+
+ * generic/tkEvent.c (InvokeInputMethods): Call XSetICFocus whenever the
+ window receives focus. This fixes [Bug 905830] but avoids [Bug 1000051]
+
+2004-11-11 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkMain.c:
+ * macosx/tkMacOSXAppInit.c (removed):
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXInt.h: changes to make TkAqua dynamically loadable,
+ enabling [package require Tk] from tclsh. Startup code from
+ tkMacOSXAppInit.c moved into tkMacOSXInit.c, added code that notifies
+ the window server that an unbundled executable is a full GUI
+ application after loading Tk. [Patch 1035348]
+
+ * doc/wm.n: documented [wm attributes] on Mac OS X. [Bug 606665]
+ * macosx/tkMacOSXWm.c: implemented TIP 222 [wm attributes -alpha] on
+ Mac OS X. [Patch 892194]
+ WmIconbitmapCmd: adopted FSRef changes from [wm atttrs -titlepath].
+
+ * macosx/tkMacOSXSubwindows.c: synced spacing/formatting with
+ core-8-4-branch.
+
+ * generic/tkRectOval.c:
+ * macosx/README:
+ * macosx/tkMacOSXDefault.h:
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXInit.c:
+ * macosx/tkMacOSXInt.h:
+ * macosx/tkMacOSXMenu.c:
+ * macosx/tkMacOSXWm.c: forward port from core-8-4-branch of Jim's and
+ my changes for CG drawing and [wm attributes] (corresponds to 8.4
+ changes dating from 09-18, 07-27, 07-24).
+
+ * macosx/tkMacOSXMouseEvent.c: endianness fixes.
+
+ * macosx/Wish.pbproj/project.pbxproj: corrected path to html help
+ inside framework.
+
+ * macosx/Makefile: prevent parallel make from building several targets
+ at the same time.
+
+2004-11-09 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXButton.c: fix to dynamic reconfiguration of button
+ '-compound' options (cosmetic problem), [Bug 1055023]
+
+ * tests/text.test: added 'knownBug' 20.172.1 in text widget multiline
+ search routines.
+
+2004-11-08 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/goldberg.tcl: Added slightly adapted version of Keith
+ Vetter's tkGoldberg as the final animation demo. Many many thanks to
+ Keith for giving his permission! [FRQ 627466]
+
+2004-11-07 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/frame.n: Added some info for -width/-height options. [Bug
+ 1055423]
+
+2004-11-07 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/grid.test:
+ * generic/tkGrid.c: Made handling of ^ a bit more consistent in corner
+ cases. This makes ^ work without any widgets in the same command. [Bug
+ 962589]
+
+2004-11-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/pendulum.tcl: Added demonstrations of how to do
+ * library/demos/aniwave.tcl: animations using Tcl/Tk to the widget
+ * library/demos/anilabel.tcl: demo.
+
+2004-11-03 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/button.test: Update expected results to account for more
+ verbose errorinfo from errors in variable traces [Tcl Bug 572164]
+
+2004-11-01 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/dialog.test (dialog-1.1): Update expected result to changes in
+ the error messages produced by procs.
+
+2004-10-29 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add Win32 test cases for attributes subcommand.
+ * win/tkWinWm.c (WmAttributesCmd): Fixup broken option processing logic
+ for attributes subcommand.
+
+2004-10-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWin32Dll.c (DllMain, _except_dllmain_detach_handler): Rework
+ pushing of exception handler function pointer so that compiling with
+ gcc -O3 works. Remove empty function call to avoid compiler warning.
+ Mark the DllMain function as noinline to avoid compiler error from
+ duplicated asm labels in generated code.
+
+2004-10-28 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * unix/tkUnixScale.c (DisplayHorizontalValue): Fix for [Bug 220927] by
+ Michael Schlenker to keep the labels within the window.
+
+2004-10-28 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/*.n: Assorted minor documentation fixes.
+
+2004-10-26 David Gravereaux <davygrvy@pobox.com>
+
+ * win/tkWinX.c: Signature for tkWinXCleanup needed to be
+ * generic/tkInt.decls: changed so it matches the Tcl_ExitProc
+ * generic/tkIntPlatDecls.h: typedef to avoid a bad-style cast.
+
+ * win/makefile.vc: Force TCL_LIBRARY envar when calling tclsh
+
+2004-10-26 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinRegion.c (TkpBuildRegionFromAlphaData): Fixed syntax error
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock): Removed unreferences vars.
+
+2004-10-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * macosx/tkMacOSXRegion.c (TkpBuildRegionFromAlphaData):
+ * win/tkWinRegion.c (TkpBuildRegionFromAlphaData): Factor out the
+ * unix/tkUnix.c (TkpBuildRegionFromAlphaData): building of region
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock): data to permit
+ better implementations on particular platforms. [Bug 919066]
+
+2004-10-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#177 AND TIP#179 IMPLEMENTATIONS
+
+ * doc/panedwindow.n: Docs for -hide and -stretch options.
+ * tests/panedwindow.test: Basic tests of -hide and -stretch options.
+ * generic/tkPanedWindow.c (Slave,slaveOptionSpecs,ComputeGeometry):
+ (DisplayPanedWindow,ArrangePanes,MoveSash,PanedWindowIdentifyCoords):
+ Add hide flag and stretch setting to list of options supported on a
+ panedwindow's slaves. [Patch 983886] Much thanks to Brian Griffin for
+ these options.
+
+2004-10-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (UpdateWrapper): pass SWP_NOOWNERZORDER to SetWindowPos
+ when maintaining win Z order, to prevent parent from flashing (when
+ adjusting Z order).
+
+2004-10-19 Joe English <jenglish@users.sourceforge.net>
+
+ TIP#204 IMPLEMENTATION
+
+ * library/tk.tcl, library/entry.tcl, library/spinbox.tcl:
+ TIP #204 "Virtual Events for Keyboard Traversal" [Patch 976928]
+
+2004-10-19 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/canvPsImg.tcl, tests/canvPsBmap.tcl:
+ * generic/tkBitmap.c, bitmaps/*.bmp:
+ * library/demos/icon.tcl, library/demos/items.tcl:
+ * library/demos/label.tcl, library/demos/menu.tcl:
+ * library/demos/ruler.tcl, library/demos/twind.tcl:
+ * library/demos/images/*.bmp: Renamed all X bitmap files files to have
+ an .xbm extension so Windows users won't get confused when wandering
+ around the Tcl source tree. [Bug 733835]
+
+2004-10-11 Miguel Bañon <bagnonm@users.sourceforge.net>
+
+ * library/msgs/sv.msg: Swedish message catalog from Mats Bengtsson.
+
+2004-10-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/wm.n: Recorded what attribute values are supported on OSX though
+ I don't know what they do.
+
+2004-10-08 Joe English <jenglish@users.sourceforge.net>
+
+ TIP#205 IMPLEMENTATION
+
+ * unix/tkUnixRFont.c: TIP #205 "Use pkgconfig Database to Register Xft
+ Support".
+
+2004-10-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ TIP#159 IMPLEMENTATION
+
+ * doc/wm.n (iconphoto): Added support for Tk photo images as
+ * generic/tkInt.h (TkDisplay): title-bar icons. TIP #159
+ * win/tkWinWm.c (WmIconphotoCmd): "wm iconphoto ?-default? image1 ..."
+ * macosx/tkMacOSXWm.c (WmIconphotoCmd): Implemented for Win/Unix,
+ * unix/tkUnixWm.c (WmIconphotoCmd): stubbed out for OS X.
+ * tests/wm.test, tests/unixWm.test, tests/winWm.test: [Bug 815751]
+
+2004-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkTextWind.c (EmbWinDelayedUnmap): Fix init warnings
+ * generic/tkTextTag.c (TkTextCreateTag):
+ * generic/tkTextMark.c (TkTextSetMark):
+ * generic/tkTextIndex.c (GetIndex):
+ * generic/tkUndo.c (EvaluateActionList):
+
+2004-09-24 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkCursor.c: Add missing initialization in debug routine.
+
+2004-09-24 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * library/text.tcl: corrected mousewheel scrolling [Bug 960190]
+
+ * tests/textDisp.test: made some tests more robust to slowness in
+ asynchronous height calculation callbacks [Bug 1025781]
+
+2004-09-24 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinX.c: Added declaration for advapi32 now that this file uses
+ the Reg* functions (req'd for nmake build system).
+
+2004-09-23 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTest.c
+ * tests/text.test: fix and tests for [Bug 1026485] - negative text
+ search ranges should not lead to any matches.
+
+2004-09-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinInt.h (TkWinDisplayChanged): added decl
+ * win/tkWinX.c (TkWinDisplayChanged, TkpOpenDisplay): Correctly handle
+ * win/tkWinWm.c (InvalidateSubTreeDepth, WmProc): color and screen
+ resolution changes. Tested for 16/24/32 bpp changes on XP. May need
+ more fixes for 8bpp switch, use of special colormaps, or other special
+ palette handling cases. [Bug 223689]
+
+2004-09-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkInt.decls: Add decl for TkWinGetPlatformTheme. It is only
+ defined under Win32.
+ * generic/tkIntPlatDecls.h: Regen.
+ * generic/tkStubInit.c: Regen.
+ * win/tkWinInt.h: Define TK_THEME_WIN_CLASSIC and TK_THEME_WIN_XP.
+ * win/tkWinMenu.c (DrawMenuEntryAccelerator, DrawMenuEntryLabel): Draw
+ a disabled 3D text highlight for the accelerator only with the Win95/98
+ look. Same goes for the menu entry text.
+ * win/tkWinX.c (TkWinGetPlatformId, TkWinGetPlatformTheme):
+ Automatically detect the Windows theme in use and return either
+ TK_THEME_WIN_CLASSIC or TK_THEME_WIN_XP when the TkWinGetPlatformTheme
+ function is invoked. [Patch 866194]
+
+2004-09-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinWm.c: Rework WS_EX_LAYERED and LWA_ALPHA defines so that
+ compiling with mingw works again.
+
+2004-09-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (UpdateWrapper, WmAttributesCmd): handle attribute
+ settings prior to window mapping and resort to more forceful wrapper
+ update again for -toolwindow (to remove it from taskbar).
+
+2004-09-19 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/*: Standardize style of references to manual sections and public
+ Tcl symbols along the lines of what I set out in [Tcl Patch 1022527].
+
+2004-09-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (WmAttributesCmd): correct -alpha 0.0/1.0 setting and
+ round the value.
+ (UpdateWrapper): don't adjust Z order of TOPMOST window.
+ (WmAttributesCmd): don't call UpdateWrapper for -disabled or
+ -toolwindow attr changes.
+
+2004-09-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ TIP#222 IMPLEMENTATION
+
+ * doc/wm.n:
+ * tests/winWm.test: Add 'wm attributes -alpha' to control toplevel
+ * win/tkWinInt.h: alpha transparency on Win2K/XP+.
+ * win/tkWinWm.c: TIP #222 [Patch 892194]
+
+ * win/tkWinWm.c (UpdateWrapper): Ensure that we maintain Z order and
+ * tests/winWm.test: focus of preexisting window when
+ replacing the wrapper window.
+
+2004-09-16 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc : added VC7-safe environment check as used in the Tcl
+ makefile.vc [Bug 1029349]
+
+2004-09-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenu.c (MenuWorldChanged): ensure that we recompute the
+ menu geometry on WorldChanged to handle font size changes. [Bug 607649]
+
+2004-09-16 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/place.test:
+ * generic/tkPlace.c: Fixed a memory leak when a placed widget was
+ forgotten. [Bug 1028888]
+
+2004-09-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinWm.c (WmIconwindowCmd): Replace bogus call to
+ XWithdrawWindow with proper code. This avoids a "couldn't send withdraw
+ message to window manager" error when the iconwindow is already mapped.
+ The wm iconwindow command does not seem to do much under Win32, but at
+ least this avoids an error message.
+
+2004-09-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (ReadIconFromFile): fix mem alloc to get the right size
+ for both icons ('?:' order of precedence mistake).
+
+2004-09-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/tkfbox.tcl (::tk::dialog::file::): Make sure that the state
+ is reset properly when starting to run the dialog. [Bug 845189]
+
+ * library/demos/filebox.tcl: Stop the use of tk_strictMotif from
+ poisoning the rest of the widget demo. [Bug 1013942]
+
+2004-09-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (ActivateWindow): SetFocus to grab window when clicking
+ outside the grab window hierarchy. [Bug 220908]
+ (UpdateWrapper): update to 2004-06-12 Kovalenko to account for whether
+ the override window has a transient parent, and apply WS_POPUP in the
+ correct case. The makes splash screens pop up as well as making
+ dropdowns not grab focus away from the parent.
+
+2004-09-10 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ TIP#169 IMPLEMENTATION
+
+ * doc/text.n, generic/tkTest.c, generic/tkText.c, generic/tkText.h:
+ * generic/tkTextBTree.c, generic/tkTextDisp.c, generic/tkTextImage.c:
+ * generic/tkTextIndex.c, generic/tkTextMark.c, generic/tkTextTag.c:
+ * generic/tkTextWind.c, generic/tkUndo.c, generic/tkUndo.h:
+ * library/text.tcl, library/demos/twind.tcl, library/demos/widget:
+ * tests/text.test, tests/textImage.test, tests/textIndex.test:
+ * tests/textWind.test: implementation of TIP#169, which provides the
+ new '$text peer' widget subcommand. This includes new documentation,
+ tests, and an extension to the text widget demos to illustrate some of
+ the new features. Many thanks also to Brian Griffin for the initial
+ implementation.
+
+2004-09-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/panedwindow.test: bulletproof 23.2 result [Bug 1019100]
+
+ * win/tkWinWm.c (ReadIconFromFile): when using SHGetFileInfo to
+ retrieve icon, get regular icon as well for correct Alt-Tab icon.
+
+2004-09-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/wish.1: Added note that the -use option is linked to the frame's
+ -container option to help with [Bug 1024364]
+
+2004-09-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/tkfbox.tcl (::tk::dialog::file::Create): use label instead of
+ button for "File of type", as it properly handles -state disabled now.
+
+2004-09-06 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Set TK_LIBRARY when execing Tk apps (test, runtest,
+ rundemo).
+
+2004-09-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * macosx/tkMacOSXMenus.c (GenerateEditEvent):
+ * macosx/tkMacOSXMenu.c (MenuSelectEvent):
+ * win/tkWinMenu.c (MenuSelectEvent): Make sure everywhere that needs to
+ NULL-out the user_data field does actually do so. (Code that uses
+ bzero() or memset() for the task just needs to be rebuilt to work).
+ [Bug 1021812]
+
+2004-09-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/bind.test (bind-22.163): Fix inadvertent minor breakage from
+ TIP#165. [Bug 1019085]
+
+ * doc/toplevel.n, doc/loadTk.n: More spelling/abbreviation fixes from
+ Mikhail Kolesnitchenko.
+
+2004-08-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#165 IMPLEMENTATION
+
+ * generic/tk.h (XVirtualEvent): Added user_data field to structure.
+ * generic/tkBind.c (ExpandPercents, HandleEventGenerate):
+ * generic/tkEvent.c (Tk_HandleEvent): Handle putting data into the
+ user_data field, passing it to scripts as %d substitution, and
+ releasing the field's contents once the event has been processed.
+ * doc/bind.n, doc/event.n, tests/bind.test: Docs + tests.
+
+2004-08-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/text.tcl (::tk::TextTranspose): Ensure that Transpose is an
+ atomic op to undo.
+
+2004-08-25 Don Porter <dgp@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c: Made use of Tcl_WrongNumArgs in a few
+ * win/tkWinMenu.c: appropriate spots.
+
+2004-08-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/SetOptions.3, doc/SetClassProcs.3, doc/MeasureChar.3:
+ * doc/GetVRoot.3, doc/GetHWND.3, doc/GetDash.3, doc/GetBitmap.3:
+ * doc/FontId.3, doc/CrtItemType.3, doc/ConfigWidg.3, doc/GetCursor.3:
+ More doc fixes from Mikhail Kolesnitchenko. [Patch 1013520]
+
+2004-08-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/TkInitStubs.3, doc/photo.n, doc/ParseArgv.3, doc/options.n:
+ * doc/keysyms.n, doc/font.n: More doc fixes. [Patch 1012837]
+
+ * doc/place.n, doc/pack.n, doc/grid.n, doc/getOpenFile.n:
+ * doc/event.n, doc/chooseDirectory.n, doc/bind.n:
+ Spelling and grammar fixes from Mikhail Kolesnitchenko. [Patch 1012083]
+
+ * tests/canvas.test (canvas-17.1): Report the result of the test so
+ that it can be compared. [Bug 1012331]
+
+2004-08-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): Inherit the icon from the
+ * win/tkWinInt.h: -parent window for the
+ * win/tkWinWm.c (TkWinGetIcon): MessageBox.
+
+2004-08-19 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: Cast argument 7 of XChangeProperty to 'const
+ unsigned char *' (from 'const char *') to satisfy Solaris 8 Forte C
+ compiler [Bug 1012325]
+
+2004-08-19 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/safe.test (safe-1.3): Made test less sensitve to the full set
+ of existing aliases in an interp, so the it only tests whether the
+ tested ones are present.
+
+ * unix/Makefile.in: Copied LD_LIBRARY_PATH machinery from `make shell`
+ target to other similar targets so that just built libraries are
+ tested, rather than previous installations.
+
+2004-08-19 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#168 IMPLEMENTATION
+
+ * generic/tkTrig.c (TkMakeRawCurve, TkMakeRawCurvePostscript):
+ * generic/tkInt.decls: New functions to handle the geometry for "raw"
+ bezier curves.
+ * generic/tkCanvUtil.c (tkRawSmoothMethod, InitSmoothMethods)
+ (TkSmoothParseProc): Add new type of smoothing method, simplify the
+ method initialization, and change the old smoothing method to be called
+ "true" and just keep "bezier" as an alias.
+ * tests/canvas.test (canvas-17.1): Basic test of built-in smoothing
+ method support.
+ * doc/canvas.n: Documentation updates.
+
+2004-08-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkPanedWindow.c (optionSpecs): Add missing GEOMETRY flag to
+ -handlepad option. [Bug 1010938]
+
+2004-08-17 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/menu.n, doc/text.n: Assorted fixes, including spelling fixes from
+ Mikhail Kolesnitschenko. [Patch 1010083]
+
+ * doc/spinbox.n, doc/scrollbar.n, doc/scale.n, doc/panedwindow.n:
+ * doc/message.n, doc/listbox.n, doc/entry.n, doc/button.n:
+ More spelling fixes from Mikhail Kolesnitschenko. [Patch 1010607]
+
+2004-08-16 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/button.n, doc/checkbutton.n, doc/label.n, doc/menubutton.n:
+ * doc/radiobutton.n: Added cross-reference to new standard option.
+ * doc/options.n: Added standard documentation for the -compound
+ option. [Bug 712588]
+
+ * doc/canvas.n: Spelling and grammar fixes from Mikhail
+ Kolesnitschenko. [Bug 1009636]
+
+2004-08-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/tkfbox.tcl (ResolveFile): Added some environment variable
+ handling; this isn't perfect, but should do what most people want most
+ of the time. [FRQ 979101]
+ * library/xmfbox.tcl (MotifFDialog_BuildUI): Fix [Bug 987169] in the
+ Motif file dialogs as well.
+
+2004-08-10 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: Fix for [Bug 1006686] "wm resizable command not
+ working on Solaris/CDE" (patch from Colin McDonald).
+
+2004-08-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/canvText.test:
+ * win/tkWinFont.c (Tk_MeasureChars): Fix for text wrapping problem that
+ appeared using canvas text under Win32. A long wrapping string that had
+ leading spaces was being incorrectly wrapped. This change makes the
+ Win32 implementation behave the same as the Unix implementation. [Patch
+ 1006286]
+
+2004-08-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/clrpick.tcl (BuildDialog):
+ * library/msgbox.tcl (MessageBox): Add scheme for cancelling dialog
+ boxes with Escape and also handle what happens when the window gets
+ nuked from outside. [Bug 987169]
+
+2004-08-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): Clean the code up a
+ bit and add a few more comments.
+ (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): Clarified the code,
+ corrected the compositing rule now that I have looked up what the right
+ thing to do is, and factorized out the compositing rule code into a few
+ simpler macros.
+
+2004-07-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4 (SC_CONFIG_CFLAGS): Darwin: instead of setting PLAT_OBJS
+ to explict object files in tcl.m4, refer to MAC_OSX_OBJS makefile var.
+
+2004-07-29 George Peter Staplin <georgeps@xmission.com>
+
+ * generic/tkEvent.c (TkQueueEventForAllChildren): Code from the
+ core-8-4-branch to not queue events for unmapped windows was added.
+
+2004-07-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkImgGIF.c (FileReadGIF): fix crash reported by Reinhard
+ Max: in case of premature end of image data, return error instead of
+ passing nil buffer to Tk_PhotoPutBlock().
+
+2004-07-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/tkfbox.tcl (::tk::dialog::file::Update): use -directory [pwd]
+ (instead of .) to get around some VFS edge case bugs. Correct args
+ passes to tk_messageBox when failing to cd. Add -force back to
+ namespace import of msgcat.
+
+2004-07-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkEvent.c (InvokeInputMethods): ensure IC focus is set after
+ creation. [Bug 905830]
+
+2004-07-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: added support to tk framework build to optionally
+ install tk manpages in addition to html help, similarly to
+ tcl/macosx/Makefile.
+
+ * macosx/Wish.pbproj/project.pbxproj: fixes for building with
+ non-default SYMROOT/OBJROOT/SRCROOT, added support for using a
+ Tcl.framework in DYLIB_INSTALL_PATH != /Library/Frameworks, added
+ optional support for building html help without tcl sources present by
+ giving explicit location of tcltk-man2html script.
+
+ * macosx/tkMacOSXMenu.c: fixed #include case sensitivity bug.
+
+ * unix/Makefile.in:
+ * win/Makefile.in: added 'install-private-headers' makefile target to
+ allow optionally installing private tk headers. [Tcl FR 922727]
+
+2004-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in, unix/tcl.m4: move (C|LD)FLAGS after their
+ * unix/configure.in, unix/configure: _DEFAULT to allow for env setting
+ to override m4 switches.
+ Consolidate header checks to limit redundancy in configure.
+ (CFLAGS_WARNING): Remove -Wconversion
+ (SC_ENABLE_THREADS): Set m4 to force threaded build when built against
+ a threaded Tcl core.
+ Reorder configure.in for better 64-bit build configuration, replacing
+ EXTRA_CFLAGS with CFLAGS. [Bug 874058]
+
+2004-07-14 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXCursor.c (TkpSetCursor): The code to not reset the
+ cursor more often than necessary was getting fooled when the current
+ cursor was nulled out when the current cursor gets freed. So in the
+ case where the input cursor was NULL, we have to just always set it.
+ [Bug 894550]
+
+2004-07-13 Don Porter <dgp@users.sourceforge.net>
+
+ * library/tkfbox.tcl: Corrected coding errors in most recent change.
+ Use [bind $w], not [$w configure] to modify bindings.
+
+2004-07-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/tkfbox.tcl (::tk::dialog::file::Create): Watch out for users
+ destroying the dialog indirectly. [Bug 987169]
+
+2004-07-07 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/canvas.n: Add paragraph to make clearer what is going on with the
+ default canvas origin. [Bug 956681]
+
+2004-07-05 George Peter Staplin <GeorgePS@XMission.com>
+
+ * generic/tkEvent.c: TK_XIM_SPOT preprocessor usage was modified
+ slightly to fix a bug that occured when TK_XIM_SPOT was defined as 0.
+ Thanks to Joe Mistachkin for reporting this bug.
+
+2004-07-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#158 IMPLEMENTATION
+
+ * tests/bind.test: Allow Win apps to distinguish keys
+ * win/tkWinX.c (GetState): on the keypad using the Extended
+ * generic/tkInt.h (EXTENDED_MASK): modifier. Thanks to Wolfgang
+ * generic/tkBind.c: Grossbauer and Kevin Kenny for
+ * doc/bind.n: developing this patch [Patch 797404]
+
+2004-07-05 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: Set _NET_WM_NAME and _NET_WM_ICON_NAME
+ (freedesktop.org) in addition to WM_NAME and WM_ICON_NAME (ICCCM). This
+ allows the full Unicode character set to be used in window manager
+ strings (but only for newer WMs that support the EWMH spec). [Bug
+ 959973]
+
+2004-07-02 George Peter Staplin <GeorgePS@XMission.com>
+
+ * generic/tkEvent.c: Tk_HandleEvent was refactored to be more readable,
+ and during this process two bugs were found.
+ 1) Button 4 and 5 masks will now be synchronized with the TkDisplay.
+ 2) ClientMessage handlers will use the proper last pointer rather than
+ writing to the last GenericHandler pointer.
+
+ Thanks to Joe English for his help and encouragement, and DKF for
+ review.
+
+2004-07-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/place.n, doc/pack.n: Doc fixes. [Tcl Bug 983146]
+
+2004-06-30 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#153 IMPLEMENTATION
+
+ * generic/tkCmds.c (GetTopHierarchy): Modified from GetToplevel so
+ * doc/winfo.n: that [winfo toplevel] does not
+ assume that it is really working with toplevels. Occasionally this is
+ important. Thanks to Neil McKay for this patch!
+
+2004-06-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCmds.c (Tk_WinfoObjCmd): refetch interp result obj for
+ 'winfo id' as it can change when making the window exist.
+
+2004-06-26 Joe Mistachkin <joe@mistachkin.com>
+
+ * generic/tkConsole.c (ConsoleDeleteProc): Set tsdPtr->gStdoutInterp to
+ NULL when the console command is deleted [Bug 756840]. Also, added
+ Tcl_Preserve/Tcl_Release for consoleInterp in InterpreterCmd in case it
+ gets deleted during the calls to Tcl_GlobalEval and Tcl_RecordAndEval.
+
+2004-06-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/canvPs.test, etc: Use standard tcltest constraint names.
+
+2004-06-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: autoconf 2.5 fixes in Darwin section.
+ * unix/configure: autoconf-2.57
+
+2004-06-17 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/constraints.tcl, tests/*.test: Systematization of test
+ constraints so many common and basic constraints are defined once with
+ a single name.
+
+2004-06-16 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c, win/tkWinWm.c, macosx/tkMacOSXWm.c, tests/wm.test
+ * tests/unixWm.test: Fix for [Bug 742882] "Potential division by zero
+ in gridded wm geometry"
+
+2004-06-15 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * win/tkWinButton.c: Add a 3D highlight to disabled *buttons and
+ labels, the same way as it's now done for disabled menu entries.
+
+2004-06-15 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/image.n: Enhanced the documentation to take into account the
+ concerns raised in [RFE 803060]
+
+ * tests/canvas.test: Updated tests affected by the change to
+ ScrollFractions, which is now clean about result generation.
+
+ * generic/tkCanvas.c: Make tag search subsystem use symbolic names for
+ type flags for easier maintenance.
+ (FIRST_CANVAS_ITEM_MATCHING,FOR_EVERY_CANVAS_ITEM_MATCHING): Factorize
+ out searching idioms into macros to reduce the #ifdef count and make
+ braces match.
+ (ScrollFractions): Really create a list Tcl_Obj.
+
+2004-06-12 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * win/tkWinWm.c (UpdateWrapper): Let overrideredirect'ed window's
+ wrapper be the child of desktop window, thus making it to behave more
+ similarly to X11 Override Redirect. Esp. useful for combobox-like
+ megawidgets.
+
+2004-06-09 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c:
+ * tests/text.test: fix to multi-line regexp search bugs in text widget
+ (reported against Alphatk editor, not on sf). Addded 3 new tests.
+
+2004-06-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkUndo.c (TkUndoSetDepth): Delete the unlinked element and
+ not the next element. Stops a crash in some situations and a memory
+ leak in others. Thanks to Jiang Wu for spotting this. [Bug 969358]
+
+2004-06-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkCanvText.c (DisplayCanvText): Fix text rendering problem
+ with canvas text items that have a selected region. The previous
+ implementation would render the whole line and then redraw the
+ selected text if it was a different color. This caused problems when
+ the selected text foreground differs from the normal text foreground,
+ the anti-aliasing alpha pixels for the two text strings would blend
+ together resulting in strange looking text. The fix is to draw the
+ normal text and the selected text separately. This problem has only
+ been observed under Windows, with anti-aliased text. [Patch 968725]
+
+2004-06-07 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c:
+ * generic/tkTextBTree.c: fix to (Bug 965186) in which the text widget's
+ record of partial-line-height calculations (for very long wrapped
+ lines) was being incorrectly reused. This resulted in confusing
+ scrollbar-text interactions.
+
+2004-06-06 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/frame.test: Fix frame-2.8 for ![info exists env(DISPLAY)]
+
+2004-06-04 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/filebox.test: A few typo corrections in dkf's recent style
+ * tests/frame.test: upgrade for the test suite.
+ * tests/select.test:
+ * tests/visual.test:
+
+2004-06-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextIndex.c:
+ * generic/tkText.c:
+ * generic/tkTextDisp.c:
+ * doc/text.n: fix to shimmering infinite loop scrolling problem in text
+ widget under some rare circumstances (Bug 965398). Improved comments
+ and documentation.
+
+ * tests/textDisp.test: corrected rounding from float to int in test,
+ fixing occasional failures
+
+ * library/text.tcl: corrected mousewheel bindings for TkAqua
+
+2004-05-29 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/messageBox.n: Fix minor markup errors (backslash is \e, not \b).
+
+2004-05-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/messageBox.n: Added documentation for the -detail option.
+ * tests/msgbox.test: Updated test suite with correct list of options.
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): Added "support" for the
+ -detail option by concatenating it onto the end of the message.
+
+2004-05-24 Jim Ingham <jingham@apple.com>
+
+ * tkMacOSXDialog.c (Tk_MessageBoxObjCmd): Turn on the -detail option
+ for Mac OS X.
+
+2004-05-23 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * ChangeLog.2002: Split older ChangeLog entries off into a separate
+ file.
+ * doc/bindtags.n: Added example.
+
+ * tests/*.test: Many minor fixes aiming towards making the Tk test
+ suite have better style. (A very large fraction of test files were
+ modified.)
+
+ * generic/tkVisual.c (Tk_GetVisual): Minor fix for error message.
+
+2004-05-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ TIP#152 IMPLEMENTATION (Unix only)
+
+ * library/msgbox.tcl (MessageBox): Added TIP#152's -detail option for
+ Unix/X11 platforms. Also shrank the size of the main -message text
+ which was grossly large.
+
+2004-05-12 Chengye Mao <chengye.geo@yahoo.com>
+
+ * generic/tkBind.c <HandleEventGenerate>: Modified to fix wish crash
+ due to incorrectly generate <Destroy> event. This bug was reported in
+ comp.lang.tcl but not logged.
+
+2004-05-07 Chengye Mao <chengye.geo@yahoo.com>
+
+ * win/tkWinWm.c <UpdateWrapper>: handle and destroy old wrapper
+ correctly and fix crash problem in wish exiting [Bug 767176].
+
+2004-05-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinFont.c (FindSubFontForChar): corrections to dkf patch to
+ handle subFontPtrPtr in EnumFontFamilies callback.
+
+2004-05-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * win/tkWinFont.c (Tk_MeasureChars,Tk_DrawChars,etc): Make sure that
+ the lastSubFontPtr remains valid even when the subfont array is
+ reallocated. [Bug 618872]
+
+2004-05-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixButton.c (TkpDrawCheckIndicator): allow radiobuttons to be
+ drawn when disabledforeground and/or selectcolor are NULL.
+ [Bug 826850] (griffin)
+
+ * win/tkWinMenu.c, unix/tkUnixMenu.c (DrawMenuEntryLabel): place images
+ of compound menu entries in indicator space if not a radio of
+ checkbutton. [Bug 756952] (eserte)
+
+ * win/tkWinX.c: fix drawing of unicode chars in menu
+ * win/tkWinInt.h (TkWinProcs): titles. [Bug 904371] (riefenstahl)
+ * win/tkWinMenu.c (ReconfigureWindowsMenu):
+
+ * generic/tkClipboard.c: Move TkClipCleanup from tkClipboard.c to
+ * macosx/tkMacOSXXStubs.c: being implemented in a platform-specific
+ * unix/tkUnixEvent.c: manner. The cleanup order was bad at least
+ * win/tkWinX.c: on Windows, where we reset/cleared display
+ info that was still needed for the clipboard to render. [Bug 939389,
+ 822002, 732662]
+
+ * library/panedwindow.tcl (MarkSash): call DragSash to stop sash jump
+ when B1 is pressed and released without moving. [Bug 932155]
+
+ * tests/panedwindow.test: panedwindow-25.1
+ * generic/tkPanedWindow.c (Unlink): clean up -before/-after refs to a
+ slave when removing it. [Bug 928413] (griffin)
+
+ * generic/tkImgPhoto.c (ImgPhotoConfigureMaster): force -data into
+ ByteArray and -format into String to correctly handle them if they
+ have been shimmered or created as some other object type.
+
+2004-04-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkPort.h:
+ * unix/Makefile.in:
+ * win/makefile.bc:
+ * win/Makefile.in: followup on tcl header reform [FR 922727]: removed
+ use of relative #include paths in tkPort.h to allow installation of
+ private headers outside of tk source tree; added tcl plaform source dir
+ to compiler header search path.
+
+2004-04-23 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/bind.n: Added examples (in line with the parallel programme for
+ adding examples to Tcl manual pages) and made assorted minor
+ alterations to improve the overall look.
+
+2004-04-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tests/textDisp.test: Get rid of windows that are no longer needed so
+ single-proc tests don't have extra windows hanging around unexpectedly.
+
+2004-04-21 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ Mac OS X: Fix several problems with Icelandic (and Faroese) keyboards
+ reported by Jérôme Gagnon-Voyer <gagnonje5000<at>mac<dot>com> on
+ tcl-mac on 2004-03-22.
+
+ * macosx/tkMacOSXKeyEvent.c (KLSInit): Add.
+ (GetKeyboardLayout): Add calls to Keyboard Layout Services, if present.
+ Rework classic handling. Use GetKCHREncoding(). Add parameter
+ encodingPtr.
+ (GetKCHREncoding): Add.
+
+2004-04-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/bgerror.tcl (bgerror): rework to only set -topmost bit on
+ Windows if necessary. Also use existing ::tk functions for placing
+ dialog and managing focus/grab.
+
+2004-04-04 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c: Fix for [Bug 915350] "Tk sets min, max size in
+ WM_HINTS when it shouldn't" and [Bug 922336] "Tk apps have no maximize
+ window button under KDE-3.2.1"
+
+2004-03-31 Jim Ingham <jingham@apple.com>
+
+ * tkMacOSXCarbonEvents.c (AppEventHandlerProc): Handle the
+ kEventAppHidden and kEventAppShown events.
+ (TkMacOSXInitCarbonEvents): Register for the above events.
+ * tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): Steal the
+ Command-H menu key event and allow the Application handler to have it.
+ This is currently the only way to get the Hide behavior to work. [Bug
+ 917557]
+
+ * tkMacOSMenus.c (TkMacOSXHandleMenuSelect): Remove the Quit menu
+ handler - this was for the Quit item in the File menu, but it doesn't
+ belong there.
+ (TkMacOSXInitMenus): Remove the Quit menu item from the File menu.
+
+ * tkMacOSXMenu.c (EventuallyInvokeMenu): Report errors from invoking
+ menu commands as background errors. [Bug 220871]
+
+2004-03-31 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkImgPhoto.c: Removed outdated #include's of the tclMath.h
+ * generic/tkScale.c: header file. All tk*Port.h files have long had
+ a #include <math.h>, and other parts of Tk routinely make use of
+ libm-supplied math routines.
+
+2004-03-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tclets.r (removed): obsolete holdover from mac classic.
+
+2004-03-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPPM.c (ReadPPMStringHeader): Code to read PPM/PGM data
+ (StringReadPPM, StringMatchPPM): from strings/bytearrays. [FRQ 540375]
+
+2004-03-26 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tcl.m4: Replaced -Wno-strict-alias with more portable
+ -fno-strict-alias alternative.
+
+ * README: Bump version to 8.5a2.
+ * generic/tk.h:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in:
+
+ * unix/configure: autoconf-2.57
+ * win/configure:
+
+2004-03-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPPM.c (StringWritePPM): New function to support
+ converting of images to PPM strings. Other direction not yet done. Rest
+ of file converted to use new image API.
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Restored support for the
+ stringWriteProc of old photo formats. [Bug 923555]
+
+2004-03-25 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/winfo.n: Clarified the range of colour intensities returned by
+ [winfo rgb]. [Bug 922610]
+
+2004-03-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/ConfigWidg.3: Converted malloc/free to Tcl_Alloc/Tcl_Free to help
+ avoid confusion and crashes on Windows. [Bug 920695]
+
+2004-03-20 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXSubwindows.c (GenerateConfigureNotify): New function.
+ (XMoveWindow): Generate configure notify events for child widgets on
+ move.
+ (XMoveResizeWindow): Ditto.
+
+2004-03-18 Daniel Steffen <das@users.sourceforge.net>
+
+ Removed support for Mac OS Classic platform [Patch 918139]
+
+ * doc/console.n:
+ * doc/tk.n:
+ * generic/README:
+ * generic/default.h:
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tkBind.c:
+ * generic/tkCmds.c:
+ * generic/tkConsole.c:
+ * generic/tkFileFilter.h:
+ * generic/tkGrab.c:
+ * generic/tkInitScript.h:
+ * generic/tkInt.decls:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkMain.c:
+ * generic/tkPlatDecls.h:
+ * generic/tkPointer.c:
+ * generic/tkPort.h:
+ * generic/tkSelect.c:
+ * generic/tkStubInit.c:
+ * generic/tkStubLib.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkWindow.c:
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/msgbox.tcl:
+ * library/spinbox.tcl:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/demos/text.tcl:
+ * library/demos/widget:
+ * mac/MW_TkBuildLibHeader.h (removed):
+ * mac/MW_TkBuildLibHeader.pch (removed):
+ * mac/MW_TkHeader.h (removed):
+ * mac/MW_TkHeader.pch (removed):
+ * mac/MW_TkHeaderCommon.h (removed):
+ * mac/MW_TkOldImgHeader.h (removed):
+ * mac/MW_TkOldImgStaticHeader.h (removed):
+ * mac/MW_TkStaticHeader.h (removed):
+ * mac/MW_TkStaticHeader.pch (removed):
+ * mac/MW_TkTestHeader.h (removed):
+ * mac/MW_TkTestHeader.pch (removed):
+ * mac/README (removed):
+ * mac/bugs.doc (removed):
+ * mac/tclets.r (removed):
+ * mac/tclets.tcl (removed):
+ * mac/tkMac.h (removed):
+ * mac/tkMacAppInit.c (removed):
+ * mac/tkMacAppearanceStubs.c (removed):
+ * mac/tkMacApplication.r (removed):
+ * mac/tkMacBitmap.c (removed):
+ * mac/tkMacButton.c (removed):
+ * mac/tkMacClipboard.c (removed):
+ * mac/tkMacColor.c (removed):
+ * mac/tkMacConfig.c (removed):
+ * mac/tkMacCursor.c (removed):
+ * mac/tkMacCursors.r (removed):
+ * mac/tkMacDefault.h (removed):
+ * mac/tkMacDialog.c (removed):
+ * mac/tkMacDraw.c (removed):
+ * mac/tkMacEmbed.c (removed):
+ * mac/tkMacFont.c (removed):
+ * mac/tkMacHLEvents.c (removed):
+ * mac/tkMacInit.c (removed):
+ * mac/tkMacInt.h (removed):
+ * mac/tkMacKeyboard.c (removed):
+ * mac/tkMacLibrary.r (removed):
+ * mac/tkMacMDEF.c (removed):
+ * mac/tkMacMDEF.r (removed):
+ * mac/tkMacMenu.c (removed):
+ * mac/tkMacMenu.r (removed):
+ * mac/tkMacMenubutton.c (removed):
+ * mac/tkMacMenus.c (removed):
+ * mac/tkMacPort.h (removed):
+ * mac/tkMacProjects.sea.hqx (removed):
+ * mac/tkMacRegion.c (removed):
+ * mac/tkMacResource.r (removed):
+ * mac/tkMacScale.c (removed):
+ * mac/tkMacScrlbr.c (removed):
+ * mac/tkMacSend.c (removed):
+ * mac/tkMacSubwindows.c (removed):
+ * mac/tkMacTclCode.r (removed):
+ * mac/tkMacTest.c (removed):
+ * mac/tkMacWindowMgr.c (removed):
+ * mac/tkMacWm.c (removed):
+ * mac/tkMacXCursors.r (removed):
+ * mac/tkMacXStubs.c (removed):
+ * mac/widget.r (removed):
+ * tests/clrpick.test:
+ * tests/cursor.test:
+ * tests/entry.test:
+ * tests/font.test:
+ * tests/macEmbed.test (removed):
+ * tests/macFont.test (removed):
+ * tests/macMenu.test (removed):
+ * tests/macWinMenu.test (removed):
+ * tests/macscrollbar.test (removed):
+ * tests/menuDraw.test:
+ * tests/safe.test:
+ * tests/scrollbar.test:
+ * tests/select.test:
+ * tests/spinbox.test:
+ * tests/text.test:
+ * tests/tk.test:
+ * tests/winfo.test:
+ * tests/wm.test:
+ * unix/Makefile.in:
+ * unix/README:
+ * unix/tk.spec:
+ * unix/tkUnix3d.c:
+ * unix/tkUnixDraw.c:
+ * xlib/xgc.c:
+ * xlib/xutil.c:
+ * xlib/X11/X.h:
+ * xlib/X11/Xlib.h:
+ * xlib/X11/Xutil.h:
+ * xlib/X11/keysym.h:
+
+2004-03-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixButton.c (TkpDrawCheckIndicator): correct crash condition
+ for new radio/checkbuttons when colors are exhausted.
+ [Bug 915330] (griffin)
+
+ * generic/tkGrid.c (GridRowColumnConfigureCommand): fix lint warning
+
+ * generic/tkCanvUtil.c: fix cast warnings
+
+ * generic/tkTextImage.c (EmbImageConfigure): fix casts
+
+ * unix/tkUnixSelect.c (ConvertSelection, TkSelPropProc): fix casts
+
+ * unix/configure, unix/tcl.m4: add -Wno-strict-aliasing for GCC to
+ suppress useless type puning warnings.
+
+2004-03-08 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc:
+ * win/buildall.vc.bat: Checks MSDevDir, not MSVCDir envar.
+
+2004-03-04 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWin32Dll.c: Add variables needed when compiling with mem debug
+ under Mingw. This fixes the checking from 2003-12-25.
+
+2004-03-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.5a1 TAGGED FOR RELEASE ***
+
+ * unix/Makefile.in (dist): don't require win/lamp.bmp copy in dist
+ target (it's already handled by win/rc/*.bmp copy)
+
+ * changes: updated for 8.5a1
+
+2004-03-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README: update to patchlevel 8.5a1
+ * generic/tk.h:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * unix/configure, unix/configure.in, unix/tk.spec:
+ * win/configure, win/configure.in:
+
+ * unix/tcl.m4: update HP-11 build libs setup
+
+2004-03-01 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tcl.m4 (SC_CONFIG_CFLAGS): Allow 64-bit enabling on
+ IRIX64-6.5* systems. [Bug 218561]
+ * unix/configure: autoconf-2.57
+
+2004-02-28 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextIndex.c: remove use of internal Tcl interface
+ 'TclUtfToUniChar'
+
+2004-02-25 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * library/demos/widget (addFormattedText): Correct off-by-one error.
+
+2004-02-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: ensure that xcodebuild will use the Wish.pbproj
+ project even if a .xcode project is also present.
+
+ * macosx/tkMacOSXMouseEvent.c: fixed modifiers for MouseWheel events.
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/tkAboutDlg.r: changed year in copyright strings to 2004.
+
+2004-02-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXDraw.c:
+ * macosx/tkMacOSXXStubs.c:
+ * xlib/ximage.c: fixed MacOSX XGetImage/XPutImage and related functions
+ to deal properly with XImages copied from screen.
+ * generic/tkCanvPs.c (TkImageGetColor): MacOSX fix. [Bug 809157]
+
+2004-02-18 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/grid.test:
+ * generic/tkGrid.c: Fixed a bug in grid geometry calculations for a
+ shrinking grid. [Bug 899246]
+
+2004-02-17 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * macosx/tkMacOSXKeyboard.c (TkpInitKeymapInfo): Don't make <Alt> and
+ <Meta> synonyms for <Command> and <Option> for now.
+
+2004-02-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkBind.c (HandleEventGenerate): only modify root[xy] with
+ [xy] when they haven't been otherwise set.
+
+ TIP#110 IMPLEMENTATION
+
+ * doc/checkbutton.n: Tristate Checkbutton and Radiobuttons
+ * doc/radiobutton.n:
+ * generic/tkButton.c:
+ * generic/tkButton.h:
+ * library/demos/check.tcl:
+ * library/demos/radio.tcl:
+ * macosx/tkMacOSXButton.c:
+ * macosx/tkMacOSXDefault.h:
+ * tests/button.test:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixDefault.h:
+ * win/tkWinButton.c:
+ * win/tkWinDefault.h:
+
+2004-02-17 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/imgPhoto.test (imgPhoto-16.1): Corrected incorrect variable
+ name [Bug 899010].
+
+2004-02-15 Jim Ingham <jingham@apple.com>
+
+ * tkMacOSXDialog.c (MatchOneType): If the Macintosh filetype is 0, then
+ automatically pass the fileType check.
+
+ * tkMacOSXCarbonEvents.c: New file - this doesn't do anything yet -
+ just registers for a couple of App Events.
+
+ * tkMacOSXInit.c (TkpInit.c): Call TkMacOSXInitCarbonEvents.c.
+
+ * tkMacOSXAppInit.c: Formatting cleanups.
+ * tkMacOSXButton.c: Ditto
+ * tkMacOSXClipboard.c: Ditto
+ * tkMacOSXDebug.c: Ditto
+ * tkMacOSXDialog.c: Ditto
+ * tkMacOSXDraw.c: Ditto
+ * tkMacOSXEvent.c: Ditto
+ * tkMacOSXFont.c: Ditto
+ * tkMacOSXHLEvents.c: Ditto
+ * tkMacOSXInit.c: Ditto
+ * tkMacOSXInt.h
+ * tkMacOSXKeyEvent.c: Ditto
+ * tkMacOSXMenu.c: Ditto
+ * tkMacOSXMenubutton.c: Ditto
+ * tkMacOSXMouseEvent.c: Ditto
+ * tkMacOSXNotify.c: Ditto
+ * tkMacOSXScale.c: Ditto
+ * tkMacOSXScrlbr.c: Ditto
+ * tkMacOSXSubwindows.c: Ditto
+ * tkMacOSXWindowEvent.c: Ditto
+ * tkMacOSXWm.c: Ditto
+
+2004-02-13 Jim Ingham <jingham@apple.com>
+
+ * tkMacOSXDialog.c (Tk_GetOpenFileObjCmd): Use CFStringRef for title &
+ message options, not pascal strings.
+ (Tk_GetSaveFileObjCmd): Ditto
+ (Tk_ChooseDirectoryObjCmd): Ditto
+ (NavServicesGetFile): Now that we get CFStrings, we don't need to
+ convert them here.
+
+ * tkMacOSXMenu.c (TkMacOSXDispatchMenuEvent): Cleanup, we don't need to
+ handle the Apple Menu picks any more, but the code didn't reflect that.
+
+ * tkMacOSXWm.c (TkSetWMName): Use CFStrings for the Window Title name,
+ not Pascal strings.
+
+2004-02-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (ChooseDirectoryValidateProc): create a pidl for
+ -initialdir if we have a UNC path because BFFM_SETSELECTION doesn't
+ support UNC paths in strings.
+
+2004-02-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/msgs/eo.msg: Language support for Esperanto and Polish from
+ * library/msgs/pl.msg: Artur Trzewik <mail@xdobry.de> with thanks.
+
+2004-02-09 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
+ * tests/imgPhoto.test (imgPhoto-16.1): Better handling of the case when
+ copying from one area of a photo to another triggers a resizing of the
+ image. [Bug 877950]
+
+2004-02-07 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc:
+ * win/rules.vc:
+ * win/rc/tk.rc:
+ * win/rc/wish.rc: Now supports the 'unchecked' option when building.
+
+2004-02-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/menubutton.n:
+ * library/menu.tcl (::tk::MbPost): make menubuttons that post above or
+ below reverse direction when not enough space is available.
+
+2004-02-01 David Gravereaux <davygrvy@pobox.com>
+
+ * win/lamp.bmp (deleted): using win/rc/lamp.bmp instead.
+
+ * win/winMain.c: Removed our custom setargv() in favor of __argc and
+ __argv exported by the C run-time.
+
+ * win/makefile.vc:
+ * win/rc/tk.rc:
+ * win/rc/wish.rc: General clean-up.
+
+ * win/rules.vc:
+ * win/nmakehlp.c: sync'd to Tcl.
+
+2004-01-31 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c, unix/tkUnixEvent.c: Replaced TclpGetTime() with
+ Tcl_GetTime(), to remove dependency on tclInt.h [Bug 874745].
+
+2004-01-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkTextIndex.c: added '#include <tclInt.h>' since the code
+ uses the TclUtfToUniChar macro from that file. [Bug 874745]
+
+ * macosx/Wish.pbproj/project.pbxproj: removed erroneous reference to
+ mkpsenc.tcl in bundle resources phase (mkpsenc.tcl is already part of
+ the copy files phase to Resources/Scripts).
+
+ * macosx/Makefile: added support for 'xcodebuild' on Mac OS X 10.3.
+
+2004-01-25 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * macosx/tkMacOSXKeyboard.c: Fix regressions due to the last patches.
+
+2004-01-25 Peter Spjuth <peter.spjuth@space.se>
+
+ * library/dialog.tcl:
+ * library/msgbox.tcl: The dialogs were affected by the TIP#146
+ implementation. Added grid anchor commands to restore original
+ behaviour.
+
+2004-01-15 David Gravereaux <davygrvy@pobox.com>
+
+ * win/tkWinSendCom.c: Placed the requirement for the special COM
+ libraries into the object file itself with #pragma comment (lib, ...)
+ when built with VC++. This will simplify linking for users of the
+ static library. uuid.lib is required for VC5.2, but is implicit with
+ VC6.
+
+ * win/makefile.vc: Removed 'ole32.lib oleaut32.lib uuid.lib' from
+ $(baselibs).
+
+2004-01-12 David Gravereaux <davygrvy@pobox.com>
+
+ * generic/tk3d.c: All uses of 'panic' (the macro) changed to
+ * generic/tkBind.c: 'Tcl_Panic' (the function). The #define of
+ * generic/tkBitmap.c: panic in tcl.h clearly states it is deprecated
+ * generic/tkCanvArc.c: in the comments. [Tcl Patch 865264]
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkColor.c:
+ * generic/tkConfig.c:
+ * generic/tkCursor.c:
+ * generic/tkError.c:
+ * generic/tkEvent.c:
+ * generic/tkFocus.c:
+ * generic/tkFont.c:
+ * generic/tkFrame.c:
+ * generic/tkGC.c:
+ * generic/tkGrid.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkImgUtil.c:
+ * generic/tkMenu.c:
+ * generic/tkObj.c:
+ * generic/tkPack.c:
+ * generic/tkPlace.c:
+ * generic/tkRectOval.c:
+ * generic/tkSelect.c:
+ * generic/tkText.c:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextIndex.c:
+ * generic/tkTextMark.c:
+ * generic/tkTextWind.c:
+ * generic/tkVisual.c:
+ * generic/tkWindow.c:
+ * mac/tkMacAppInit.c:
+ * mac/tkMacAppearanceStubs.c:
+ * mac/tkMacButton.c:
+ * mac/tkMacDraw.c:
+ * mac/tkMacEmbed.c:
+ * mac/tkMacFont.c:
+ * mac/tkMacInit.c:
+ * mac/tkMacMenus.c:
+ * mac/tkMacPort.h:
+ * mac/tkMacSubwindows.c:
+ * mac/tkMacWm.c:
+ * mac/tkMacXStubs.c:
+ * macosx/tkMacOSXEmbed.c:
+ * macosx/tkMacOSXFont.c:
+ * macosx/tkMacOSXMenus.c:
+ * macosx/tkMacOSXNotify.c:
+ * macosx/tkMacOSXPort.h:
+ * macosx/tkMacOSXSubwindows.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/tkMacOSXXStubs.c:
+ * unix/tkUnix3d.c:
+ * unix/tkUnixColor.c:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixEvent.c:
+ * unix/tkUnixFocus.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixSelect.c:
+ * unix/tkUnixSend.c:
+ * unix/tkUnixWm.c:
+ * win/tkWin3d.c:
+ * win/tkWinButton.c:
+ * win/tkWinColor.c:
+ * win/tkWinDialog.c:
+ * win/tkWinDraw.c:
+ * win/tkWinEmbed.c:
+ * win/tkWinFont.c:
+ * win/tkWinPixmap.c:
+ * win/tkWinPointer.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWm.c:
+ * win/tkWinX.c:
+
+ * win/rc/tk.rc:
+ * win/rc/tk_base.rc:
+ * win/rc/wish.rc:
+ * win/makefile.vc: Refreshed how the resource files are built. Should
+ be a bit easier for people linking with a static Tk library.
+
+ * win/lamp.bmp (deleted):
+ * win/rc/lamp.bmp (new): Moved.
+
+ * win/rules.vc: Sync'd to Tcl, respects the CHECKS=nodep command line
+ macro and was used to verify the Tcl_Panic change above.
+
+2004-01-09 Peter Spjuth <peter.spjuth@space.se>
+
+ TIP#146 IMPLEMENTATION
+
+ * doc/grid.n:
+ * tests/grid.test:
+ * generic/tkGrid.c: Implementation of TIP#146, "Add Overall Anchoring
+ to the Grid Geometry Manager", adding [grid anchor] subcommand.
+ **** POTENTIAL VISUAL INCOMPATABILITY ****
+
+2004-01-07 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c:
+ * generic/tkTextBTree.c:
+ * tests/text.test: fixed crashing [Bug 872299] in yview code, and added
+ tests and better error checking in the B-tree.
+
+2004-01-07 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextIndex.c:
+ * tests/textIndex.test: fixed bug in which 'wordstart' and 'wordend'
+ were not utf-8 aware (they haven't been changed since Tk 8.0), and
+ added tests.
+
+2004-01-07 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinMenu.c: only provide a submenu handle when the MF_POPUP flag
+ is given, fixing a recently-introduced crash when submenus are
+ disabled. Also better error checking for this sort of situation in the
+ future.
+
+2003-12-31 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added missing private headers to
+ installed Tk.framework, so that tkInt.h can be included sucessfully
+ from Tk.framework/PrivateHeaders.
+ * generic/tkPort.h: corrected include of tkMacOSXPort.h
+
+2003-12-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (ReconfigureWindowsMenu): Fix drawing of a disabled
+ (TkWinHandleMenuEvent, DrawMenuEntryArrow): cascade menu arrow. Tk was
+ displaying a disabled cascade menu arrow in black instead of gray. This
+ was caused by a bug in the Win32 code for user drawn menu items. The
+ fix is to avoid telling Windows that the menu item is a cascade type
+ and then draw the gray arrow bitmap on our own. [Patch 865842]
+
+2003-12-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (DrawWindowsSystemBitmap): Fix a strange Win32 bug
+ where the logical coordinates returned by a call to DPtoLP are wrong
+ the first time a menu is posted. This bug manifested itself by drawing
+ the bitmap in the wrong place in a menu. The fix was to pass the newly
+ created DC instead of the DC from the window.
+
+2003-12-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (DrawMenuEntryAccelerator):
+ (DrawMenuEntryLabel): When drawing the label text and accelerator text
+ for a disabled menu entry be sure to draw a 3D highlight. The only
+ exception to this is when a disabled menu entry is highlighted, in that
+ case do not draw a 3D hightlight.
+
+2003-12-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (DrawMenuEntryAccelerator, DrawMenuEntryArrow): Move
+ the unused menu arrow drawing code in DrawMenuEntryAccelerator into a
+ new function named DrawMenuEntryArrow. This makes no functional change
+ but it will make it easier to fix things in the future.
+
+2003-12-25 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWin32Dll.c (DllMain): Add HAVE_NO_SEH blocks in place of __try
+ and __except statements to support gcc builds. This is needed after
+ David's changes on 2003-12-21. [Tcl patch 858493]
+
+2003-12-22 David Gravereaux <davygrvy@pobox.com>
+
+ * win/nmakehlp.c:
+ * win/rules.vc: sync'd to Tcl.
+
+ * win/makefile.vc: Uses new features of nmakehlp to get the version
+ strings from header files without the use of hardcoded values.
+
+ * generic/tk.h: removed the note about having to update makefile.vc
+ when the version changes.
+
+2003-12-22 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/text.n: Fix markup errors (".t" at beginning of line).
+
+2003-12-21 David Gravereaux <davygrvy@pobox.com>
+
+ * generic/tkEvent.c: Added three new functions: TkCreateExitHandler,
+ * generic/tkInt.h: TkDeleteExitHandler, and TkFinalize. This adds an
+ * generic/tkMenu.c: insertion point so Tk's exit handlers can be
+ * generic/tkWindow.c: called on their own from tk85.dll's DllMain for
+ * mac/tkMacButton.c: DLL_PROCESS_DETACH. These are private to the
+ * unix/tkUnixEvent.c: binary and not exported. It is possible the
+ * win/tkWin32Dll.c: Windows OS can unload Tk _prior_ to Tcl under
+ * win/tkWinEmbed.c: some conditions such as ExitProcess(). This
+ * win/tkWinMenu.c: avoids a dangling pointer problem when Tcl does
+ * win/tkWinX.c: Tcl_Finalize after Tk has been unloaded.
+ * win/winMain.c: DllMain's DLL_PROCESS_DETACH now protected with
+ SEH as DeleteWindowsExitProc is causing an exception of its own under
+ some teardown conditions. AT&T assembly syntax has not been added for
+ MinGW yet. [Tcl Patch 858493]
+
+2003-12-20 Joe English <jenglish@users.sourceforge.net>
+
+ * library/bgerror.tcl: Truncate displayed error message if it's too
+ long. [Bug 231251]
+
+2003-12-16 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/rc/wish.exe.manifest: It seems that Windows XP insists on a
+ strict format for the version value. 8.5.a0 or 8.5.0 results in an
+ unloadable executable -- must be 4 numbers.
+
+ * win/tkWinSend.c: Removed some misleading comments [Bug 846134] and
+ disabled the send package until [Bug 858822] is resolved.
+
+2003-12-16 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * win/tkWinWm.c (InstallColormaps): Check for TK_ALREADY_DEAD to avoid
+ handling of dead windows.
+
+2003-12-15 David Gravereaux <davygrvy@pobox.com>
+
+ Some silent invalid handle issues discovered with NuMega's
+ BoundsChecker [Patch 699022]
+
+ * win/tkWinMenu.c (ReconfigureWindowsMenu): Only redraw the menubar
+ when a menubar exists.
+
+ * win/tkWinWm.c (UpdateGeometryInfo): wmPtr->wrapper might be NULL. No
+ exception is thrown, but it isn't correct to ignore.
+
+2003-12-15 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * macosx/tkMacOSXKeyboard.c: General cleanup. Add support for [event
+ generate]. [Bug 860454]
+
+2003-12-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.h:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextIndex.c: improved documentation in comments to explain
+ how pixel heights are kept track of. Also ensured correct clean-up of
+ elide-state calculation, even with very large numbers of tags. Also
+ provided slightly better updating of cache for totally elided display
+ lines.
+
+2003-12-12 David Gravereaux <davygrvy@pobox.com>
+
+ * win/tkWinEmbed.c (TkWinEmbeddedEventProc) : for loop dereferences
+ containerPtr but can't get to the if (containerPtr == NULL) test due to
+ the unhandled read memory exception for when it really is NULL.
+
+ * win/tkWinX.c (TkWinXInit): Don't restrict InitCommonControlsEx. It's
+ valid on all platforms given IE 3.0+ is installed. As tkWinX.c does set
+ #define _WIN32_IE 0x0300, I guess we can accept IE3 as the lowest
+ denominator and use the version 4.71 features of Comctl32.dll
+
+ * win/rc/wish.exe.manifest: updated version string. This file isn't
+ compiled.
+
+2003-12-10 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/textWind.test: fixed 2 tests so they run on Windows as well as
+ unix, and so their results take account of -padx/-pady settings for the
+ text widget.
+
+2003-12-10 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/CrtImgType.3: Fixed line-transposition error found by Eric
+ Raymond. [Bug 857159]
+
+2003-12-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: updated OpenBSD build configuration based on [Patch
+ 775246] (cassoff)
+
+2003-12-09 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinWm.c: fix to memory leak on certain error cases.
+
+ * generic/tkTextTag.c: fix reading of freed tag memory, by removing all
+ references to freed tags.
+
+2003-12-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/entry.n: clean up usage of 'edition' as a verb.
+
+2003-12-05 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/text.test:
+ * generic/tkText.c: after debate on sf, allow decreasing tab-stops,
+ hence removing any potential backwards incompatibility, even for buggy
+ code. Added new test. [Bug 852949]
+
+ * generic/tkText.h:
+ * generic/tkTextDisp.c:
+ * generic/tkTextTag.c: fix to performance problems in the text widget
+ when inserting lines which wrap thousands of times [Bug 853003]. Note
+ that the text widget must now perform additional calculations (pixel
+ heights) compared to Tk <= 8.4, and so some actions will be slower, by
+ necessity.
+
+2003-12-05 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * win/tkWinFont.c (Tk_MeasureChars): Fix indentation. Fix memory leak.
+ Fix handling of TK_WHOLE_WORDS.
+
+2003-12-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c: disallow negative or decreasing tab-stops, which
+ fixes [Bug 852949], but is a
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ with Tk 8.4.5 or earlier, but only for code which assumed (incorrectly)
+ that tab stops are relative to each other instead of relative to the
+ widget's left edge. Such code will now throw an error instead of doing
+ the wrong thing.
+
+ [[MAINTAINER NOTE: SEE TIP#256]]
+
+ * generic/tkTextDisp.c: restore previous meaning of -[xy]scrollcommand
+ [Bug 852954], and remove unused argument to 'MeasureChars'
+
+ * generic/tkTextWind.c:
+ * generic/tkTextImage.c: better border handling and fixed typos in
+ comments.
+
+ * tests/text.test: tests for negative and decreasing tab stops.
+
+ * doc/text.n: documentation of '-tabs', to clarify Tk's longstanding
+ interpretation of all distances as relative to the left edge of the
+ widget.
+
+ * library/demos/twind.tcl:
+ * library/demos/widget: minor enhancements to text widget demo, showing
+ embedded images, for example.
+
+2003-12-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinFont.c: applied [Patch 852669] which fixes [Bug 478568] with
+ certain bold or italic fonts on Windows.
+ * tests/textDisp.test: added test for the font measurement problem.
+
+2003-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenu.c (MenuVarProc): prevent this from triggering while
+ interp is being destroyed.
+
+2003-11-25 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * generic/tkPointer.c (Tk_UpdatePointer): corrected targetWinPtr check
+ (line 369) so any pointer event with winPtr==0 is really redirected to
+ the grab or restrict window (if any).
+
+2003-11-21 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c:
+ * generic/tkText.h:
+ * generic/tkText.c:
+ * tests/textDisp.test: ensure interpolated tabs are at the same
+ location as the equivalent real tabs, by making use of fractional
+ rather than integer pixel calculations.
+
+2003-11-21 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c: prevent wrapped line height calculations until
+ the widget has actually been given a geometry.
+
+ * tests/textWind.test:
+ * tests/textDisp.test: fix to [Bug 843752], allowing tests to complete
+ cross-platform. Thanks to dgp for extensive testing.
+
+2003-11-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/FindPhoto.3: Removed reference to long-gone header file.
+
+2003-11-20 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinSend.c:
+ * win/tkWinSendCom.c: ensure object is not shared before lappend (fix
+ for crash in Windows test suite), and clean up of files to bring them
+ closer to Tcl standards.
+
+2003-11-20 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * macosx/tkMacOSXKeyboard.c: Add PowerBook keycode 0x34 as <Return>.
+
+2003-11-18 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXScrlbr.c: Reworking Vince's fix to [Bug 842952]. This
+ version is clearer, and works helps keep the mouse better pinned to the
+ scrollbar. I also removed the glitch where the scrollbar would jump get
+ its middle over the mouse when you first moved it.
+
+2003-11-17 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/constraints.tcl:When running the test suite in a process where
+ * tests/image.test: Tk has been [load]ed, there's no guarantee that
+ * tests/select.test: child processes created by [exec [interpreter]]
+ * tests/unixWm.test: will have Tk in them. Made modifications to
+ * tests/window.test: force a [load] of Tk in those situations.
+
+2003-11-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenubutton.h: fixed compound menubutton handling like
+ * generic/tkMenubutton.c: *button corrections of 2003-04-25.
+ * mac/tkMacMenubutton.c (TkpDisplayMenuButton):
+ * unix/tkUnixMenubu.c (TkpDisplayMenuButton):
+
+2003-11-16 Don Porter <dgp@users.sourceforge.net>
+
+ * win/makefile.vc: Restored consistency of pkgIndex.tcl file with that
+ generated by Makefile.
+
+2003-11-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXScrlbr.c: [Bug 842952] correct scrollbar tracking with
+ mouse. Also increased scrollbar resolution for better scrolling in very
+ large text widgets.
+
+ * generic/tkTextDisp.c: cleanup and clarify some comments
+ * doc/text.n: cleanup some of the markup.
+
+2003-11-15 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Fixes pkgIndex.tcl generation so a symbols build is
+ loaded when Tcl is symbols.
+
+2003-11-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c:
+ * tests/textDisp.test: fixes to one more old Tk [Bug 422411] this time
+ concerning inconsistent tab interpretation. Also fixed an unreported
+ new problem if a single logical line wraps to fill more than the
+ entire display.
+
+ * macosx/tkMacOSXScrlbr.c: fix to [Bug 840978] where the size of the
+ proportional scrollbar was calculated wrongly.
+
+2003-11-14 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/text.n: Fix markup errors.
+
+2003-11-15 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.h:
+ * generic/tkText.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextWind.c:
+ * generic/tkTextTag.c:
+ * tests/textDisp.test: fixes to another pair of old Tk bugs [Bug
+ 220816] (can't scroll horizontally to display all of last character),
+ [Bug 842498] (xview confused on window creation), and more efficiency
+ in tag creation. Added new tests.
+
+2003-11-14 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkTextDisp.c (TkTextRedrawTag): Get the correct number of
+ lines in the region to be updated. This fix due to Vince Darley.
+ (TkTextUpdateLineMetrics): Return the correct marker value when we know
+ the update loop should terminate. [Bug 837300]
+
+2003-11-13 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/event.test:
+ * library/text.tcl: fixed the text widget portion of [Bug 542199]
+
+2003-11-13 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkMenuDraw.c (TkPostSubmenu,AdjustMenuCoords): Rewrote to use
+ Tcl_EvalObjv instead of Tcl_VarEval for greater robustness. A side
+ benefit is that this should all be faster now too. [Bug 723856]
+
+2003-11-12 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.h:
+ * generic/tkText.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextIndex.c:
+ * generic/tkTextTag.c:
+ * tests/textTag.test: fixes to two very old Tk bugs [Bug 583286]
+ (focus handling with embedded windows), [Bug 220780] (tag bindings
+ trigger on window borders), and made two more functions static in
+ tkTextDisp.c.
+
+ * library/text.tcl: fixed [Tcl Bug 699642] with double/triple-click
+ insert positioning.
+
+2003-11-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/configure.in: use xft-config instead of pkg-config to determine
+ xft info.
+ * unix/tcl.m4: improve AIX --enable-64bit handling remove
+ -D__NO_STRING_INLINES -D__NO_MATH_INLINES from CFLAGS_OPTIMIZE on
+ Linux. Make default opt -O2 (was -O).
+
+ * generic/tkButton.c (ConfigureButton): abort option processing if the
+ button was deleted. [Bug 824479]
+
+ * generic/tkMenuDraw.c (TkPostSubmenu): add {} around menu name in case
+ it has spaces when calling Tcl_VarEval. This is a hack until this is
+ rewritten for proper Tcl_Obj handling. [Bug 723856]
+
+ * library/tkfbox.tcl (::tk::dialog::file::Update): optimize the
+ dir/files list separation by using the -tails, -directory and -type
+ option of 'glob'. Also passes the glob the -filetypes filters instead
+ of calling string match over each file. [Patch 833819]
+ (::tk::dialog::file::ActivateEnt): allow typing filename into entry
+ when tk_getOpenFile -multiple 1 is specified. [Bug 788069]
+
+ * generic/tkListbox.c (ListboxDeleteSubCmd, ListboxListVarProc): free
+ itemconfig data when removing it from table. [Bug 836483]
+
+ * macosx/tkMacOSXClipboard.c (TkSuspendClipboard, TkSelGetSelection):
+ add unicode clipboard support. [Patch 840107] (senn)
+
+2003-11-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure:
+ * win/tcl.m4: add necessary ole libs to VC LIBS_GUI line.
+
+ * win/tkWinDraw.c (XFillRectangles): correctly handle the
+ XGCValues.function parameter when filling rectangles. [Bug 820278]
+ [Patch 820282]
+
+ * win/configure:
+ * win/configure.in: define TK_LIB_FLAG, TK_LIB_SPEC,
+ TK_BUILD_LIB_SPEC, TK_STUB_LIB_SPEC, TK_STUB_LIB_PATH, and
+ TK_BUILD_STUB_LIB_PATH for tkConfig.sh [Bug 826614]
+
+ * unix/Makefile.in (SHLIB_LD_FLAGS): include in Makefile as it is used
+ in MAKE_LIB sometimes (ie: AIX-64) [Bug 829686] (jimix)
+
+2003-11-10 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c: correct yview handling of text widgets
+ containing no vertical pixels at all.
+
+2003-11-08 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tclWinSend.c: Fixed an error returning the registered name.
+
+2003-11-08 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/textDisp.test:
+ * tests/text.test:
+ * generic/tkText.h:
+ * generic/tkTextIndex.c:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c: fix to another version of [Bug 833627] (crash
+ in tkchat), adding more tests. I believe the handling of nested elide
+ tags of all types is now correct!
+
+2003-11-07 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/textDisp.test:
+ * generic/tkTextDisp.c: fix to another version of [Bug 833627] (crash
+ in tkchat), adding two new tests.
+
+ * generic/tkText.c
+ * generic/tkTextIndex.c
+ * generic/tkTextDisp.c
+ * generic/tkTextWind.c
+ * generic/tkTextImage.c
+ * generic/tkTextTag.c
+ * generic/tkTextMark.c
+ * generic/tkTextBTree.c
+ * generic/tkText.h
+ * doc/text.n
+ * tests/text.test
+ * tests/textWind.test: better handling of 'elide' tags, especially
+ during line layout, counting and forward/backward index movement. Added
+ new tests to ensure correct behaviour with multiple tags of multiple
+ priorities.
+
+2003-11-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/nl.msg: Dutch messages from Arjen Markus [Patch 836368]
+ * library/demos/widget: Added mechanism to support some l10n of the
+ actual hotkeys used.
+
+2003-11-04 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * tests/textDisp.test:
+ * tests/textWind.test: fix to rest of test suite problems reported in
+ [Bug 833761]. This also has the nice effect that many more tests are
+ now run on Windows.
+
+2003-11-04 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/widget (showCode,printCode): Added code to print the
+ source code on Unix and Win, courtesy of Arjen Markus and the Wiki.
+ [Patch 835644]
+
+2003-11-03 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkTextDisp.c
+ * tests/textDisp.test: test and fix to a panic reported in [Bug
+ 833627], with tkchat, and an unused variable [Bug 835010]. Also fixes
+ substantial parts of [Bug 833761]
+
+2003-11-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/demos/widget, etc.: Made widget demos locate themselves
+ independently of the main Tk library using the new global variable
+ tk_demoDirectory. [Patch 832691, adapted]
+
+ * generic/tkTextDisp.c (TextGetScrollInfoObj): Stop complaints about
+ signed vs. unsigned for the length of strings.
+
+2003-11-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/msgs/nl.msg: Updated messages from Arjen Markus and Pascal
+ Scheffers. Thanks! [Patch 820519]
+
+2003-10-31 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): OS X uses 32bpp
+ images internally always, so make use of the assumption.
+
+2003-10-31 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ TIP#155 IMPLEMENTATION
+
+ * generic/tkText.c, generic/tkTextIndex.c, generic/tkTextDisp.c
+ * generic/tkTextWind.c, generic/tkTextImage.c, generic/tkTextTag.c
+ * generic/tkTextMark.c, generic/tkTextBTree.c, generic/tkText.h
+ * doc/text.n, tests/text.test, tests/textDisp.test
+ * tests/textImage.test, tests/textIndex.test, tests/textWind.test
+ * library/text.tcl, generic/tkCanvas.c, unix/tkUnixDefault.h
+ * win/tkWinDefault.h, mac/tkMacDefault.h, macosx/tkMacOSXDefault.h
+
+ This adds the 'count' and 'replace' subcommands to the text widget, the
+ '-blockcursor' option, and in particular provides correct, smooth
+ pixel-based scrolling of the widget under all circumstances. See the
+ text.n man page for the complete new documentation. This also fixes
+ [Bugs 559450 778511 779174].
+
+ * generic/tkTextDisp.c
+ * tests/textDisp.test: tests and fix to the promptly reported [Bug
+ 833627]
+
+2003-10-31 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinMenu.c: more correct placing of images in compound menu
+ entries.
+
+2003-10-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkImgPhoto.c (ImgPhotoBlendComplexAlpha): add alpha blending
+ for images with partial transparency. Only operates for 15bpp+ display.
+ [Bug 809157]
+
+2003-10-29 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * unix/tkUnixRFont.c: Some cleaning up to get the file more in lines
+ with the general style guidelines. [Bug 832091] Still many comments
+ needed (from someone who knows the code!) for the style guide to be
+ satisfied, so bug still open.
+
+ * library/tkfbox.tcl (IconList_Create,IconList_Add): Added option
+ munging to allow some control of foreground colours on Unix in the same
+ way that you can influence the background. [Bug 795717]
+
+2003-10-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (GetFontAttributes): place extra check for NULL
+ family against bad X servers.
+
+ * win/tkWinImage.c (XGetImageZPixmap): add separate 16bpp XGetImage
+ code to correctly handle 16bpp requests. This appears to never have
+ worked correctly.
+
+ * tests/focusTcl.test (setup1): expand frame size to allow for correct
+ visibility of windows that use larger default fonts.
+
+2003-10-28 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * library/tk.tcl (::tk::PlaceWindow): Added check for empty string
+ first when determining placement strategy. [Bug 819284]
+
+2003-10-23 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXDialog.c (NavServicesGetFile): Minor cleanups.
+ (OpenFileFilterProc): Handle FSRef's as well as FSSpec's in the input
+ file. Also convert the FSSpec filename to an C-string before passing to
+ MatchOneFile. [Bug 517600]
+ (MatchOneFile): Require the input filename to be a C-string, not a
+ pascal string.
+
+2003-10-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/dialog.tcl (tk_dialog): Constrain the dialog to be fairly
+ sensibly sized and placed. [Bug 827535]
+
+2003-10-15 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c, tests/unixWm.test: Delete WM_TRANSIENT_FOR property
+ instead of setting it to None when making a window nontransient [Bug
+ 632816 "cannot remove transient"]
+
+2003-10-14 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixPort.h(TkPutImage): changed macro argument names to match
+ function argument names ('dest' and 'src' were swapped, which was
+ confusing) [GPS]
+
+2003-10-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/makefile.vc: Applied patches from tcl bug 801467 from
+ * win/winMain.c: Joe Mistachkin
+
+2003-10-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkInt.h: move TkGetOptionSpec to stubs intDecls
+ * generic/tkIntDecls.h:
+ * generic/tkInt.decls:
+ * generic/tkStubInit.c:
+ * tkDecls.h: updated with latest genstubs
+ * tkIntPlatDecls.h:
+ * tkIntXlibDecls.h:
+ * tkPlatDecls.h:
+
+ * tests/listbox.test (13.3): correct result size
+ (4.7): correct test for possible window drift [Bug 701931] (dgp)
+
+ * unix/mkLinks:
+ * doc/GetHWND.3: add Tk_AttachHWND docs [Bug 220803]
+
+2003-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * mac/tkMacButton.c (TkpDisplayButton):
+ * macosx/tkMacOSXButton.c (TkpDisplayButton):
+ * unix/tkUnixButton.c (TkpDisplayButton): correct imageYOffset for
+ buttons with just images.
+
+2003-10-10 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkObj.c (TkRegisterObjTypes): Register the type of text
+ indexes.
+
+2003-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinButton.c (TkpDisplayButton): correct imageYOffset for
+ buttons with just images.
+
+2003-10-08 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tcl.m4: Add TIP #150 items to the TEA makefiles.
+ * win/configure:
+ * win/Makefile.in:
+
+ * win/tkWinSend.c: Clean up some warnings from gcc -Wall.
+ * win/tkWinSendCom.c:
+
+2003-10-06 Joe English <jenglish@users.sourceforge.net>
+
+ * library/text.tcl, doc/text.n: Text widget binding for Control-v is
+ now Mac-only, since it conflicts with standard <<Paste>> binding on
+ other platforms. [Bug 605277]
+
+2003-10-06 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkStyle.c: Fix double-free in style engine [Bug 798211]
+
+2003-10-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure:
+ * win/tcl.m4: removed incorrect checks for existence of optimization.
+ TCL_CFG_OPTIMIZED is now defined whenever the user does not build with
+ --enable-symbols.
+
+2003-10-06 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/ConfigWidg.3: Removed reference to Tk_Offset from the NAME
+ section to resolve mkLinks conflict with SetOptions.3 [Bug 404197]
+
+ * unix/configure.in: Reconfigured to use $TCL_PREFIX as the default
+ value of --prefix, and also added warning when a TK_PREFIX value
+ different from TCL_PREFIX is selected, since [package require Tk] fails
+ in that configuration. [Bugs 428627,765642]
+
+ * unix/tcl.m4 (SC_PATH_TCLCONFIG): Corrected search path so that
+ alpha and beta releases of Tcl are not favored. [Bug 608698]
+
+ * unix/configure.in: Added check that version of Tcl header found by
+ configure matches that of the Tk we wish to build. As long as the Tk
+ sources insist on lockstep releases, Tk's configuration should verify
+ that's what we have. [Bug 749088]
+
+ * unix/configure: autoconf (2.57)
+ * unix/mkLinks: make mklinks
+
+2003-10-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/scale.tcl: Clear bug with chording mouse buttons.
+
+ * library/console.tcl: Avoid including the console in the list of
+ interpreters exposed by [winfo interps].
+
+2003-10-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Makefile: fixed redo prebinding bug when DESTDIR="". Added
+ support for all applicable customizable makefile variables from
+ tcl/macosx/Makefile.
+
+ * macosx/README:
+ * macosx/Wish.pbproj/project.pbxproj: ensure that the versioned wishX.X
+ script works correctly when Tk.framework with multiple versions is
+ present by referring to a copy of 'Wish Shell.app' located in
+ Tk.framework/Versions/X.X/Resources.
+
+2003-09-30 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): Use the tk text drawing
+ for checkbuttons & radiobuttons as well as for labels.
+ * macosx/tkMacOSXEvent.c (XSync): New function, need to implement this
+ so drawing will get flushed in "update idletasks".
+ * tkMacOSXPort.h: convert #define of XSync to function def'n.
+
+2003-09-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/browse: Added suitable [package require] lines
+ * library/demos/hello: to all the Tk demo scripts which are
+ * library/demos/ixset: not run as part of something larger.
+ * library/demos/rmt: [FRQ 815118]
+ * library/demos/rolodex:
+ * library/demos/square:
+ * library/demos/tcolor:
+ * library/demos/timer:
+ * library/demos/widget:
+
+2003-09-30 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * tests/safe.test: Accomodate TIP #150 in the results.
+ * tests/textWind.test: Fix a dependancy on font size in 10.1
+
+2003-09-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkCanvas.c (TkGetStringsFromObjs):
+ * generic/tkPanedWindow.c (PanedWindowWorldChanged): Private functions
+ should be either static or prefixed with 'Tk' (thanks to George Staplin
+ for spotting this.)
+
+2003-09-27 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ TIP#150 IMPLEMENTATION
+
+ * win/makefile.vc: Implementation of TIP #150, "Provide 'send'
+ * win/tkWinSend.c: command for Windows"
+ * win/tkWinSendCom.h:
+ * win/tkWinSendCom.c:
+
+2003-09-26 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * macosx/tkMacOSXWm.c (TkWmStackorderToplevelWrapperMap): Add
+ GetWindowFromPort() [Bug 812415]; make function static.
+
+2003-09-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/demos/widget: don't create iconwindow on aqua, but add about
+ menu like on classic.
+ * macosx/Makefile: pass MAKEOVERRIDES to pxbuild.
+ * macosx/tkMacOSXButton.c: added -compound support for bevel buttons.
+
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tkConfig.sh.in: added TK_INCLUDE_SPEC to allow extensions to
+ find installed Tk headers, parallel to TCL_INCLUDE_SPEC. [Bug 777203]
+
+2003-09-18 Chengye Mao <chengye.geo@yahoo.com>
+
+ * generic/tkConsole.c: Fixed memory leak [Bug 802435]
+
+2003-09-18 Peter Spjuth <peter.spjuth@space.se>
+
+ TIP#147 IMPLEMENTATION
+
+ * doc/grid.n:
+ * tests/grid.test:
+ * generic/tkGrid.c: Implementation of TIP#147, "Make Grid's Column/Row
+ Configure Easier".
+
+2003-09-17 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkImage.c: Stopped [image create] from generating an image
+ * tests/image.test: command name that would overwrite an existing
+ command name. Thanks to Michael Schlenker. [Bug 808039].
+
+2003-09-16 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/grid.test:
+ * generic/tkGrid.c: Reworked a part of grid's geometry computations to
+ handle some tricky cases better. [Bug 792387]
+
+2003-09-05 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/bind.n: Describe %P and %s substitution for Property events.
+ [Bug 577906 "%P substitution not documented"]
+
+2003-09-05 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/wish.1: Implementation of TIPs 137/151.
+ * generic/tkMain.c (Tk_MainEx): Added recognition of the -encoding
+ * tests/main.test: command line option by Tk_MainEx() and
+ thus by wish and any other program built on Tk_MainEx(). [Patch 800139]
+ This is a ***POTENTIAL INCOMPATIBILITY*** only for those C programs
+ that embed Tcl and Tk, build on Tk_MainEx(), and make use of
+ Tk_MainEx's former ability to pass a leading "-encoding" option to
+ interactive shell operations.
+
+2003-08-27 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkListbox.c (ListboxSelect): Remove unused variable
+ 'increment'. [Bug 664783]
+
+2003-08-25 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Don't do a string compare on the $(DBGX) variable,
+ use the $(DEBUG) boolean directly. Also, don't try to regen the stubs
+ table if $(TCLSH) doesn't exist.
+
+2003-08-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/msgbox.tcl: Brought into line with the newer
+ look-and-feel for the demos.
+ * library/demos/widget (addSeeDismiss): Added support for an extra
+ button defined by the caller.
+
+2003-08-21 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWin3d.c: Applied Tk patch 791273 from Jeremy Collins which
+ improves the 3d lines for sunken widgets under windows.
+
+2003-08-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/demos/widget: Redo code view dialog, use named fonts,
+ * library/demos/arrow.tcl: add basic see/dismiss routine with images
+ * library/demos/bind.tcl: for better look & feel
+ * library/demos/bitmap.tcl:
+ * library/demos/button.tcl:
+ * library/demos/check.tcl:
+ * library/demos/clrpick.tcl:
+ * library/demos/colors.tcl:
+ * library/demos/cscroll.tcl:
+ * library/demos/ctext.tcl:
+ * library/demos/entry1.tcl:
+ * library/demos/entry2.tcl:
+ * library/demos/entry3.tcl:
+ * library/demos/filebox.tcl:
+ * library/demos/floor.tcl:
+ * library/demos/form.tcl:
+ * library/demos/hscale.tcl:
+ * library/demos/icon.tcl:
+ * library/demos/image1.tcl:
+ * library/demos/image2.tcl:
+ * library/demos/items.tcl:
+ * library/demos/label.tcl:
+ * library/demos/labelframe.tcl:
+ * library/demos/menu.tcl:
+ * library/demos/menubu.tcl:
+ * library/demos/paned1.tcl:
+ * library/demos/paned2.tcl:
+ * library/demos/plot.tcl:
+ * library/demos/puzzle.tcl:
+ * library/demos/radio.tcl:
+ * library/demos/ruler.tcl:
+ * library/demos/sayings.tcl:
+ * library/demos/search.tcl:
+ * library/demos/spin.tcl:
+ * library/demos/states.tcl:
+ * library/demos/style.tcl:
+ * library/demos/text.tcl:
+ * library/demos/twind.tcl:
+ * library/demos/unicodeout.tcl:
+ * library/demos/vscale.tcl:
+
+2003-08-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkCanvPs.c (Tk_PostscriptFont): Use Tcl_Obj-based interfaces
+ for working with user-supplied font maps.
+
+2003-08-19 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkPanedWindow.c (PanedWindowWorldChanged): Set window
+ background from the -background resource. Fixes [Bug 791500
+ "PanedWindow refresh glitches on X"]
+
+2003-08-19 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/bind.n: Added more information on event types and details [FRQ
+ 523593 "bind(n) manpage needs more detail"]
+
+2003-08-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl to fix Tcl bug 781109.
+
+2003-08-15 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Faster color data parsing code
+ for the [$photo put] subcommand. Now doesn't do everything through the
+ pre-8.0 list handling routines!
+
+2003-08-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * unix/tkUnixButton.c (TkpDisplayButton): Stopped accesses to NULL
+ * unix/tkUnixMenu.c (TkpDrawMenuEntry): pointers that crashed tests.
+
+ TIP #109 IMPLEMENTATION FROM Brian Griffin <bgriffin@model.com>
+ * unix/tkUnixButton.c (TkpDrawCheckIndicator, TkpDisplayButton):
+ * unix/tkUnixMenu.c (DrawMenuEntryIndicator, TkpDrawMenuEntry):
+ Much improved display of checkbuttons and radiobuttons on UNIX/X.
+
+2003-08-13 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/scale.tcl: Fix for [Bug 787065] for Button-2 press.
+ * tests/scale.test: Added test for this bug.
+
+2003-08-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXMenu.c: fixed C99'ism that breaks gcc 2.95.
+
+2003-07-28 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinDialog.c: Applied patch from [Bug 611615] which fixes a
+ problem with double clicks in file dialogs falling through to the
+ window underneath in win32.
+
+ * library/panedwindow.tcl: Apply patch from [Bug 778893] to make the
+ panedwindow -opaqueresize option work as per the docs.
+
+ * library/tk.tcl: Apply fix for [Bug 778840] for window placement when
+ using multiple desktops on windows.
+
+2003-07-24 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinCursor.c: Fix for [Bug 776646] for a native hand2 and fleur
+ (move) cursor under win.
+ * tests/cursor.test: Check that documented cursors are available.
+
+2003-07-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/buildTkConfig.tcl: fix to TK_BUILD_* ref generation broken by
+ changes to tcl buildsystem.
+
+2003-07-19 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * win/tkWinCursor.c (TkGetCursorByName): Fix bug 420510 to provide
+ consistency between unix and windows -cursor option.
+
+ * library/scale.tcl: Fix for bug 706765 to correctly handle the
+ -sliderrelief option while moving the thumb.
+
+2003-07-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (Tk_DrawChars): do not make XGetGeometry call that
+ prevents overwidth lines as it requires a roundtrip call to the X
+ server for every string drawn. Hard-code max width to 32768 until a
+ better solution to get max width is made.
+
+ * library/panedwindow.tcl: use widget-specific Priv slots for pwAfterId
+ and panecursor items to correctly handle cursor changes with adjacant
+ panedwindows.
+
+ * generic/tkEvent.c (Tk_HandleEvent): correct XCreateIC call for
+ TK_XIM_SPOT usage. [Bug 742660] (takahashi)
+
+ * win/tkWinDialog.c: doubled the TK_MULTI_MAX_PATH value to ~10K. This
+ is a short-term solution until the -multiple option is extended. [Bug
+ 641261]
+
+2003-07-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkWindow.c:
+ * macosx/tkMacOSXDialog.c: added native tk_messageBox command,
+ (Tk_MessageBoxObjCmd) for MacOS X platform.
+
+ * macosx/tkMacOSXMenu.c: corrected encoding conversion for torn-off
+ menu entries (but many other display problems still exist with these)
+
+ * macosx/tkMacOSXMouseEvent.c: improved handling of events in the
+ presence of grabs, particularly activation events.
+
+2003-07-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/panedwindow.test (panedwindow-30.2):
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd): Ensure that we can
+ share GCs between a panedwindow and its sash proxy, even if the
+ panedwindow is in a toplevel with a different visual. [Bug 702230]
+
+2003-07-17 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Makefile: Changes for new tcl buildsystem.
+
+ * macosx/Wish.pbproj/jingham.pbxuser:
+ * macosx/Wish.pbproj/project.pbxproj:
+ Changes for new tcl buildsystem. Changed build to include tk specific
+ html help in Tk.framework instead of Tcl.framework. Set default SYMROOT
+ in target options to simplify setting up PB (manually setting common
+ build folder for tcl & tk no longer needed).
+
+ * macosx/README: Updated info for changes to buildsystem, html help
+ location and PB setup.
+
+2003-07-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/photo.n: [$photo put] has been able to take rectangles of pixel
+ colours, specified as lists of lists, for years. Now this is a
+ documented feature. [Bug 728952]
+
+ * doc/panedwindow.n: Removed warning invalidated by fix from Bug
+ 738143. [Bug 747814]
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Rewrote subcommand processing to
+ never jump to the end of the switch. I find that confusing as I can't
+ see whether there's processing still to be done from a quick glance at
+ the code, unlike with a direct return. [Bug 771988]
+ (ImgPhotoCmd, ImgPhotoSetSize, ImgPhotoInstanceSetSize): Try harder to
+ avoid zero-length mallocs()... [Bug 404421]
+
+2003-07-16 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkPack.c (ConfigureSlaves): silence compiler warning
+ [Bug 771982]
+
+2003-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinImage.c (XGetImage): correct init of biSizeImage in bitmap
+ header. [Bug 703697] (cap)
+
+2003-07-17 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/frame.test:
+ * generic/tkFrame.c (CreateFrame): Make sure all options can be set to
+ their default value. [Bug 697652]
+
+2003-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPanedWindow.c (ArrangePanes): Ensure that the last pane
+ * tests/panedwindow.test: shrinks instead of being clipped when resized
+ below the reqsize. [Bug 748277] (spjuth)
+
+ * generic/tkWindow.c (Initialize): do not free uninit'ed dstring.
+ [Bug 755906] (mistachkin)
+
+2003-07-09 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/send.test: Strengthened constraints to stop accidental smashing
+ of Xserver access; some systems (*ahem* mine *ahem*) require
+ xhost-style security for all use... :^/
+
+2003-07-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkTextDisp.c (DisplayText): correct use of textPtr data with
+ respect to Tcl_Release time. [Bug 767009]
+
+2003-07-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImage.c (TkDeleteAllImages,etc.): Stopped the deleting of
+ hash entries from a table that has just been deleted by this function
+ when some images are Tcl_Preserve()d... [Bug 749353]
+
+2003-07-03 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXColor.c (GetControlPartColor): Use the ThemeBrushes to
+ get the control text color for buttons.
+
+2003-07-02 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/tkUnixEvent.c (TkpCloseDisplay): Don't test for XCloseIM bug
+ when the XFree86 version is newer than 4.0 since the layout of the XIM
+ structure has changed. The check is not needed for newer XFree86
+ releases since the bug we are checking for was fixed in the 4.2.99.2
+ release. [Bug 755530]
+
+2003-06-26 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * library/menu.tcl: workaround problem on some Windows systems by
+ trying to avoid posting a menu offscreen.
+
+2003-06-09 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: fix for [Bug 751553] "Xft: [font configure] does
+ not update in-use fonts". Fixed TkpGetSubFonts() to return information
+ about all subfonts, not just the first one.
+
+2003-06-01 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/configure.in: BUGFIX, --enable-xft test was broken.
+ * unix/configure: regen
+
+2003-05-31 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c (InitFont): Fill in TkFontAttributes from pattern
+ returned from GetFont (actual font) instead of the query pattern
+ (requested font).
+
+2003-05-31 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixRFont.c: New file
+ * unix/tkUnixDefault.h: Use different default fonts if HAVE_XFT
+ * unix/Makefile.in:
+ * unix/configure.in: Add --enable-xft flag
+ * unix/configure: regen
+ Experimental support for antialiased text under X11 [Patch 535541]
+
+2003-05-30 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkMenu.c
+ * generic/tkMenu.h
+ * generic/tkMenuDraw.c:
+ * tests/menu.test: fixed complex bug in menu clone cleanup [Bug 465324]
+ and removed 'knownBug' from a test.
+
+2003-05-29 Joe English <jenglish@users.sourceforge.net>
+
+ * doc/text.n: Fixed markup errors.
+
+2003-05-28 Miguel Bañón <bagnonm@users.sourceforge.net>
+
+ * library/msgs/cs.msg: Updated messages from wohnivec@iol.cz
+
+2003-05-27 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tkText.c
+ * generic/tkTextTag.c
+ * generic/tkTextDisp.c
+ * generic/tkText.h: refactoring of text widget cleanup code to ensure
+ all resources are freed. [Bug 741179]
+
+ * library/tearoff.tcl: ensure torn-off menus do not appear underneath
+ the MacOS/MacOS X main menu bar.
+
+2003-05-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/mkLinks: Set the var S to "" at the top of the file to avoid
+ error when user has set S to something. [Bug 739833]
+
+2003-05-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (PanedWindowReqProc): Thanks very much to
+ Eric Boudaillier for making panes resize correctly! [Bug 738143]
+
+ * generic/tkText.c (TextSearchCmd): Forwards and backwards aren't the
+ same. [Bug 740558] Also edited SearchCore to get it closer to the
+ Engineering Manual style guidelines.
+
+2003-05-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/textImage.test: Fixed faults in option parsing and made
+ * tests/text.test: tests conformant. [Bug 739965]
+ * generic/tkText.c (TextSearchCmd):
+
+ * library/demos/en.msg: Base catalog for the widget demo.
+ * library/demos/widget: Added message-catalog support.
+ * library/console.tcl: Reworked to use tk::AmpMenuArgs and be more "in
+ style".
+ * library/tk.tcl (tk::AmpMenuArgs): New procedure for doing
+ tk::AmpWidget-like processing for menus.
+
+ * generic/tkTextMark.c: Removed complaints about signed vs.
+ * generic/tkTextImage.c: unsigned in arguments to strncmp() by
+ * generic/tkText.c: using Tcl_GetIndexFromObj() more.
+
+2003-05-19 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ TIP#113 IMPLEMENTATION
+
+ * doc/text.n
+ * generic/tkCanvas.c
+ * generic/tkInt.h
+ * generic/tkTest.c
+ * generic/tkText.c
+ * generic/tkText.h
+ * generic/tkTextBTree.c
+ * generic/tkTextDisp.c
+ * generic/tkTextImage.c
+ * generic/tkTextIndex.c
+ * generic/tkTextMark.c
+ * generic/tkTextTag.c
+ * generic/tkTextWind.c
+ * generic/tkUndo.c
+ * generic/tkUndo.h
+ * generic/tkWindow.c
+ * library/text.tcl
+ * tests/text.test
+ * tests/textIndex.test
+ * tests/textMark.test
+ * tests/textTag.test
+ * tests/textWind.test: This adds multi-line searching and '-all'
+ searching to the text widget. In addition the changes contain a
+ complete 'objectification' of the text widget. Includes documentation
+ and new tests.
+
+2003-05-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: changed tkConfig.sh location in
+ versioned framework subdirectories to be identical to location in
+ framework toplevel; fixed stub library symbolic links to be tk version
+ specific.
+
+2003-05-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c: use gb2312-raw as the alias for gb2312* charset
+ fonts. gb2312.enc was made to be euc-cn for Tcl because that is what
+ is most often meant, but X really wants the original (-raw) gb2312
+ encoding. [Bug 557030]
+
+2003-05-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/msgs/fr.msg: updated msg catalog. [Bug 737790] (zolli)
+
+2003-05-13 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/makefile.vc: fix to installation of winhelp into path containing
+ a space (Bug 693512)
+
+2003-05-13 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXInit.c (TkpInit): use new versioned bundle resource
+ API to get tk runtime library for TK_VERSION. [Bug 736774]
+
+2003-05-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCanvPoly.c (PolygonToPostscript):
+ * tests/canvPs.test: correct crash when generating postscript for a
+ single-line polygon (point) with no color. [Bug 734498] (wilm)
+
+2003-05-10 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXClipboard.c (TkSelGetSelection): Convert '\r' to '\n'
+ on the way into Tcl.
+
+2003-05-08 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/image.test (image-15.1): Test to ensure that widgets pick up
+ image information even if the image is deleted and recreated.
+
+ * generic/tkImage.c (Tk_ImageObjCmd): Use the ImageMaster's deleted
+ flag to stop deleted images from showing up in the various [image *]
+ operations. Can't delete directly from the table because that makes us
+ lose the information about what widgets want to use the image. [Bug
+ 634864]
+
+2003-04-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): correct typo for
+ stippleGC [Bug 730124].
+
+2003-04-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkButton.h: Rewrote the handling of
+ * generic/tkButton.c (TkButtonWorldChanged): compound *buttons to
+ * mac/tkMacButton.c (TkpDisplayButton): correctly display mixture
+ * macosx/tkMacOSXButton.c (TkpDisplayButton): of disabledfg,
+ * unix/tkUnixButton.c (TkpDisplayButton): selectcolor, indicator,
+ * win/tkWinButton.c (TkpDisplayButton): etc. *buttons will now
+ only stipple the image, unless no disabledfg is given, in which case it
+ will stipple the whole button.
+
+ * library/bgerror.tcl: make bgerror dialog topmost on Windows to
+ prevent it being covered by other windows.
+
+ * unix/tkUnixButton.c (TkpDisplayButton): Use the normalTextGc when
+ * win/tkWinButton.c (TkpDisplayButton): displaying disabled text that
+ have images, as they get a gray50 stipple as well and the disabledGc is
+ not set up correctly for font drawing. [Bug 477740]
+
+2003-04-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure: regen
+ * win/configure.in (SHELL): force it to /bin/sh as autoconf 2.5x uses
+ /bin/bash, which can fail to find exes in the path (ie: lib).
+
+ * generic/tkCanvBmap.c: s/CreateBitmap/TkcCreateBitmap as Windows has a
+ CreateBitmap function already.
+
+ * generic/tkCursor.c: s/GetCursor/TkcGetCursor as Windows has a
+ GetCursor func already, which causes compiler warnings.
+
+2003-04-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (TkpInitializeMenuBindings): Rename the private menu
+ helper cmd from tk::tkWinMenuKey to tk::WinMenuKey. [Bug 721514]
+
+2003-04-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkBind.c (TkpGetBindingXEvent): Add helper method that can be
+ used to query the XEvent* for the currently executing binding.
+ * generic/tkInt.h: Declare TkpGetBindingXEvent.
+ * win/tkWinMenu.c (MenuKeyBindProc, TkWinMenuKeyObjCmd)
+ (TkpInitializeMenuBindings): Rename MenuKeyBindProc to
+ TkWinMenuKeyObjCmd and convert it into a Tcl command named
+ tk::tkWinMenuKey. Bind keyboard accelerator actions to this Tcl command
+ instead of using a native C binding. This makes it possible to extend
+ the existing binding with Tcl code and makes the Windows version work
+ just like the unix version.
+
+2003-04-04 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Subst TCL_LIBS instead of DL_LIBS and MATH_LIBS.
+ * unix/configure: Regen.
+ * unix/configure.in: Remove SC_ENABLE_THREADS invocation. Thread
+ support in an extension should be automatic when Tcl is compiled with
+ thread support. Add AC_DEFINE calls to set TCL_THREADS, _REENTRANT, and
+ _THREAD_SAFE since this was done in SC_ENABLE_THREADS. Remove socket
+ and math lib checks since these are already done in the Tcl configure
+ script.
+ * unix/tcl.m4: Update from Tcl to get TCL_LIBS fix. This fixes [Bug
+ 597847] which was caused by improper linking.
+ * unix/tkConfig.sh.in: Subst TCL_LIBS instead of MATH_LIBS and DL_LIBS.
+ [Bug 597847]
+
+2003-04-02 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/configure.in: Set stub lib flag based on new LIBFLAGSUFFIX
+ variable.
+ * win/tcl.m4: Update from Tcl to get new LIBFLAGSUFFIX variable.
+
+2003-04-02 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/configure.in: Don't set TCL_DLL_FILE, TCL_LIB_FILE,
+ TCL_STUB_LIB_FILE, TCL_STUB_LIB_FLAG, and TCL_BUILD_STUB_LIB_SPEC.
+ These variables are already set in tclConfig.sh. Don't subst vars that
+ are either not used, or already covered by a subst in
+ SC_LOAD_TCLCONFIG. [Bug 691908]
+
+2003-04-01 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2003-04-01 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/all.tcl: Made better use of a common -loadfile
+ * tests/constraints.tcl: to hold definitions common to all test
+ * tests/*.test: files.
+
+2003-03-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2003-03-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl to get BeOS changes.
+
+2003-03-22 Kevin Kenny <kennykb@acm.org>
+
+ * win/makefile.vc:
+ * win/rules.vc: Corrected several problems that prevented OPTS=symbols
+ from building properly. [Patch 707792] Thanks to Joe Mistachkin for the
+ fixes.
+
+2003-03-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXApplication.r (removed):
+ * macosx/tkMacOSXLibrary.r (removed):
+ * macosx/tkMacOSXResource.r (removed):
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/tkAboutDlg.r: updated copyrights, cleaned up about box,
+ removed obsolete unused resource files.
+
+ * macosx/buildTkConfig.tcl: TK_DEFS space fix.
+
+2003-03-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkConfig.sh.in: Add TK_DLL_FILE entry to mirror the TCL_DLL_FILE
+ entry in tclConfig.sh. [Patch 694271]
+
+2003-03-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/configure.in: Don't run the AC_CYGWIN macro since it uses
+ AC_CANONICAL_HOST under autoconf 2.5X. Just check to see if __CYGWIN__
+ is defined by the compiler and set the ac_cv_cygwin variable based on
+ that. [Tcl Bug 705912]
+
+2003-03-18 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/unixWm.test (unixWm-41.2): Corrected typo in 2003-03-13 commit.
+ Thanks Larry Virden. [Bug 705567]
+
+2003-03-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Makefile:
+ * macosx/README: added support for giving 'make' the location of
+ Tcl.framework and tclsh to build and link against.
+
+ * macosx/tkMacOSXXStubs.c: fixed crash in [winfo server].
+
+2003-03-13 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/unixWm.test: Constrained all tests older than revision 1.21 to
+ run only on Unix. Alternative approach did not match maintainer habits.
+ * tests/spinbox.test (spinbox-17.4): Avoid long failure message.
+
+2003-03-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Require autoconf 2.57 or newer, see TIP 34 for a detailed explanation
+ of why this is good. This will no doubt break the build on some
+ platforms, let the flaming begin.
+
+ * unix/configure: Regen with autoconf 2.57.
+ * unix/configure.in: Require autoconf 2.57.
+ * unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen with autoconf 2.57.
+ * win/configure.in: Require autoconf 2.57.
+ * win/tcl.m4: Update from Tcl.
+
+2003-03-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/msgbox.tcl (tk::MessageBox): Stopped message box buttons from
+ getting very wide, and added some compensatory space so that the
+ smaller buttons still look nice (well, to me). [Bug 701812]
+
+2003-03-11 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXMenu.c (EventuallyInvokeMenu): New function, used to
+ invoke menu commands at idle time.
+ (TkMacOSXDispatchMenuEvent): Don't immediately dispatch menu commands,
+ wait till the idle loop to do so. This is more like what is done on
+ Windows, and avoids the crash from destroying a menu in it's command.
+
+ * macosx/tkMacOSXHLEvents.c (ReallyKillMe): Don't force the shell to
+ exit. According to the OS X HI guidelines, it should be possible to
+ cancel an attempt to quit, and if we force the kill, here, it would not
+ be possible to implement this.
+
+2003-03-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/unixWm.test: Add the testwrapper constraint to tests that
+ depend on the testwrapper command. These tests should not be run under
+ Windows for example.
+
+2003-03-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * doc/wm.n (minimize, maximize): Remove claim that the resizable
+ command keeps scripts from changing the size of windows since it is not
+ true. The resizable command only applies to user sizing via user
+ interaction.
+ * tests/unixWm.test: Replace broken tests with the nonPortable
+ constraint with new tests for maxsize and minsize options. These tests
+ verify that setting the minsize and maxsize will resize the window if
+ needed, and that the wm hints will be updated with the new sizes.
+ * tests/wm.test: Add an exhaustive set of tests for the wm maxsize and
+ wm minsize commands. These tests verify that setting the minsize and
+ maxsize will resize the window if needed. These tests have only been
+ run under Win98 and Window Maker under Linux, so further tweaking may
+ be needed for other systems.
+ * unix/tkUnixWm.c (UpdateGeometryInfo, UpdateSizeHints): Fixup
+ comments and initialization for the minWidth, minHeight, maxWidth,
+ maxHeight, width, and height members of the WmInfo struct. Check to
+ ensure that a new toplevel window size is not larger than the maxsize
+ or smaller than the minsize when updating the geometry at idle time.
+ Pass new width and height values to the UpdateSizeHints method so that
+ it can properly set the window min and max sizes for a window that
+ cannot be resized by the user. This fixes a bug where the window
+ resizes back to the original size when the user clicks on the window
+ border.
+ * win/tkWinWm.c (UpdateGeometryInfo): Fixup comments and
+ initialization for the minWidth, minHeight, maxWidth, maxHeight, width,
+ and height members of the WmInfo struct. Check to ensure that a new
+ toplevel window size is not larger than the maxsize or smaller than the
+ minsize when updating the geometry at idle time. [Patch 568861]
+
+2003-03-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkGrid.c (GridStructureProc, ConfigureSlaves): Check for a
+ NULL masterPtr and slavePtr in the GridStructureProc code to ensure
+ that a Gridder created before some error condition is ignored when it
+ comes to geometry calculations. This approach closely matches the pack
+ implementation. Keep track of a -in argument to a grid command in order
+ to detect the case of an already gridded widget that wants to change
+ some options. The previous implementation could make repeated and
+ unnecessary calls to Tk_ManageGeometry. Replace use of "parent" with
+ "master" in comments throughout the file.
+ * generic/tkPack.c (PackStructureProc): Check for a NULL masterPtr
+ before other checks so that a slave created under certain error
+ conditions is cleaned up properly. Replace use of "parent" with
+ "master" in comments throughout the file.
+ * generic/tkPlace.c (CreateSlave, ConfigureSlave, SlaveStructureProc):
+ Don't call Tk_ManageGeometry in CreateSlave since this was causing
+ incorrect results in some error cases. Rework the ConfigureSlave method
+ so that slave setup is done in one place. The call to Tk_ManageGeometry
+ was added to the one place where a slave is setup. When a slave is
+ configured but the master is not changed, simply goto the
+ scheduleLayout label. Check for a NULL master in SlaveStructureProc for
+ the sake of readability.
+ * tests/grid.test:
+ * tests/pack.test:
+ * tests/place.test: Add test to check that a winfo manager call does
+ not return incorrect results after an error condition is hit. [Patch
+ 693063]
+
+2003-03-11 Kevin Kenny <kennykb@users.sourceforge.net>
+
+ * win/makefile.vc: Backported the code that makes the makefile build
+ pkgIndex.tcl as part of the install step.
+
+2003-03-07 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): No longer need to call
+ TkMacOSXSetHelpMenuItemCount.
+ * macosx/tkMacOSXMenu.c (TkMacOSXHelpMenuItemCount): Stub out since it
+ is no longer need (but is in the stubs table...).
+ (TkMacOSXDispatchMenuEvent): Get the number of system help menu items
+ from HMGetHelpMenu.
+ (ReconfigureMacintoshMenu): Ditto.
+ (TkpDestroyMenu): Ditto.
+
+2003-03-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ TIP#116 IMPLEMENTATION
+
+ * doc/FindPhoto.3: Documentation of the photo API changes due to
+ TIP#116
+
+ * generic/tkImgPhoto.c (Tk_PhotoExpand, Tk_PhotoPutBlock)
+ (Tk_PhotoPutZoomedBlock, Tk_PhotoSetSize): Added interp argument to
+ these functions and made them return a standard Tcl result, with error
+ indicating memory allocation failure instead of panic()ing.
+ [See TIP #116 at http://purl.org/tcl/tip/116.html for discussion.]
+ Each of these functions has also acquired a backward-compatability
+ variant as well, named with a _Panic suffix.
+ * generic.tk.decls: New API in new slots, back-compat API in old ones.
+ * generic/tk.h (USE_PANIC_ON_PHOTO_ALLOC_FAILURE): Allow users to
+ define this symbol to get the old 8.4 photo image API, including
+ panic() calls when things go wrong.
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Adjusted to use the new API
+ * generic/tkImgGIF.c (FileReadGIF): discussed above.
+ * generic/tkImgPPM.c (FileReadPPM):
+
+2003-03-05 David Gravereaux <davygrvy@pobox.com>
+
+ * win/rules.vc: updated default tcl version to 8.5.
+
+2003-03-04 Don Porter <dgp@users.sf.net>
+
+ * README: Bumped version number of Tk to
+ * generic/tk.h: 8.5a0.
+ * library/tk.tcl:
+ * mac/README:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * unix/README:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/README:
+ * win/configure.in:
+ * win/makefile.vc:
+ * win/tcl.m4:
+
+ * unix/configure: autoconf
+ * win/configure:
+
+2003-03-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4.2 TAGGED FOR RELEASE ***
+
+2003-02-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/bind.test (bind-16.44):
+ * generic/tkBind.c (ExpandPercents): Only allow events to see those
+ expansions that are actually valid for them, and force the substitution
+ of the rest as "??". This stops some crashes on Windows and gets rid of
+ bogus values everywhere. [Bug 612110]
+
+2003-02-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/README: correct 8.4.3 refs to 8.4.2.
+
+ * unix/README: replace version refs with version-agnostic wording.
+
+2003-02-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinInt.h:
+ * win/tkWinDraw.c:
+ * win/tkWinFont.c (Tk_DrawChars): add support for simple XOR text
+ drawing on Windows. [Patch 685388] (martin)
+
+ * generic/tkMenu.c (TkMenuCleanup): make sure to reset static
+ menusInitialized on finalize. [Bug 548729]
+
+2003-02-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXHLEvents.c: fixed conversion of apple event parameters
+ to posix style path names. [Bug 621672] (steffen, Benjamin Riefenstahl)
+
+ * macosx/tkMacOSXDialog.c:
+ * macosx/tkMacOSXWm.c:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/tkMacOSXUtil.c (removed):
+ * macosx/tkMacOSXUtil.h (removed): removed all references to
+ tkMacOSXUtil.{c,h}, made obsolete by the patch above. [Bug 621672]
+
+2003-02-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixFont.c (CreateClosestFont, CanUseFallback): use the first
+ best font match in user font path. [Bug 647497] (dal zotto)
+
+ * generic/tkListbox.c (ListboxSelectionSubCmd):
+ * tests/listbox.test: Allow 'selection includes' to respond when
+ disabled (but only 'includes'). [Bug 632514]
+
+ * unix/tkUnixButton.c (TkpDisplayButton): Correct visual display of
+ disabled check/radiobutton to be more distinctive on unix.
+ * tests/unixButton.test: [Bug 669595] (hintermayer)
+
+ * doc/panedwindow.n: clarified the need to use 'update idle' when
+ adding unmapped windows. Needs further examination. [Bug 605105]
+
+ * generic/tkEntry.c (SpinboxWidgetObjCmd, EntryWidgetObjCmd):
+ * tests/entry.test: return 1 if selection is present even if
+ * tests/spinbox.test: entry/spinbox is disabled, as selection get will
+ still return the selection (although selection still ignore modify
+ requests when entry/spinbox is disabled). [Bug 637828]
+
+2003-02-24 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+
+ * tkMacOSXDialog.c (NavServicesGetFile): Fix bug with
+ kNavCtlSetSelection - control data should be a pointer not a handle.
+
+2003-02-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/clrpick.tcl (color::BuildDialog):
+ * library/msgbox.tcl (MessageBox): Yet more places that did complex
+ and fragile width calculations instead of using grid, though with these
+ it is the -uniform option that saves the day.
+
+ * library/tkfbox.tcl (file::Create): This procedure was really very
+ crufty in how it went about creating the GUI. It is far easier and more
+ robust to use the grid geometry manager than it is to tune the results
+ of pack with tweaks to -width. [Bug 673722]
+
+ * library/comdlg.tcl (FDGetFileTypes): Set an upper limit on how long a
+ file type item description string can get due to appending of types.
+ [Bug 617392]
+
+ * tests/panedwindow.test (panedwindow-30.1):
+ * generic/tkPanedWindow.c (DisplayPanedWindow, DisplayProxyWindow):
+ Use the window's depth, not the screen's default depth. [Bug 671122]
+
+2003-02-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/console.tcl: (aqua & macintosh) added missing <Cmd-q> binding
+ for corresponding Quit menu item shortcut.
+
+ * macosx/README: updated instructions for embedded build, added various
+ improvements by Russell Owen.
+
+ * unix/tcl.m4: update from Tcl.
+ * unix/configure: regen.
+
+2003-02-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinScrlbr.c (UpdateScrollbar): use SIF_DISABLENOSCROLL to
+ "disable" scrollbar when on Windows when there is nothing to scroll.
+ This is Windows style, and fixes [Bug 624116].
+
+ * tests/panedwindow.test:
+ * generic/tkPanedWindow.c (ValidSashIndex): corrected to note that 2
+ panes must exist before any one sash does. [tcllib Bug 689258]
+
+2003-02-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/panedwindow.test:
+ * generic/tkPanedWindow.c: Fixed calculation of the last slave's size
+ when increasing the size of the panedwindow. [Bug 689099]
+
+2003-02-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgGIF.c (GetDataBlock): Removed pointless static variable
+ ZeroDataBlock [Bug 664788]
+
+ * unix/tkUnixFont.c (CanUseFallback): Added argument, passed through
+ from callers to FindSubFontForChar(), so that pointers into the old
+ subfont table to be updated when that table is reallocated, avoiding a
+ (sometimes fatal) FMR. [Bugs 618872, 689357]
+
+2003-02-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXKeyEvent.c: fix for uninitialized var warning.
+
+2003-02-19 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXMouseEvents.c (GeneratePollingEvents): In the case
+ where there was a capture window, we were sending the events to the
+ capture window. But the capture window (return value or
+ TkMacOSXGetCapture) is always a toplevel. So this is wrong in the case
+ that the Event's toplevel IS the capture window - in which case the
+ event should go to the subwindow most closely containing the event.
+
+2003-02-19 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
+ and Jim Ingham <jingham@apple.com>
+
+ This patch changes the default Tk behavior so that events are by
+ default routed to the standard event handlers after Tk has looked at
+ them.
+
+ * macosx/tkMacOSXEvent.h: Rename "handledByTk" into "stopProcessing".
+
+ * macosx/tkMacOSXEvent.c: Update erroneous comments and remove unused
+ includes.
+ (TkMacOSXProcessAppleEvent): Don't declare events handled that we did
+ not even look at.
+ (TkMacOSXProcessEvent): Add a comment on policy for "stopProcessing".
+ (TkMacOSXProcessEvent): Remove "handling" of events that are not our
+ business.
+ (TkMacOSXProcessEvent): Rename "handledByTk" into "stopProcessing".
+ (ReceiveAndProcessEvent): Ditto.
+ (ReceiveAndProcessEvent): Tune error production of message.
+
+ * macosx/tkMacOSXKeyEvent.c (TkMacOSXProcessKeyboardEvent): Rename
+ "handledByTk" into "stopProcessing".
+
+ * macosx/tkMacOSXWindowEvent.c: Ditto.
+
+ * macosx/tkMacOSXMouseEvent.c: Remove setting of "handledByTk".
+ (TkMacOSXProcessMouseEvent): Handle clicks in the "traffic lights" in
+ the window title when the window (or app) is in the background.
+
+ This patch changes the key event handling to use the MacOS translation
+ mechanisms. It also improves dead key handling.
+
+ * macosx/tkMacOSXKeyEvent.c (InitKeyData): Add.
+ (InitKeyEvent): Add.
+ (DecodeViaUnicodeResource): Rename KeycodeToUnicodeViaUnicodeResource.
+ (DecodeViaKCHRResource): Rename KeycodeToUnicodeViaKCHRResource.
+ (GetKeyboardLayout): Use a boolean flag instead of a special layout id.
+ (KeycodeToUnicodeViaUnicodeResource): Change interface and
+ implementation to return a Unicode string instead of directly filling
+ an XEvent.
+ (KeycodeToUnicodeViaKCHRResource): Ditto.
+ (KeycodeToUnicodeViaUnicodeResource): Add handling for callers that
+ don't want deadkey processing (i.e. XKeycodeToKeysym).
+ (KeycodeToUnicodeViaKCHRResource): Ditto.
+ (KeycodeToUnicodeViaUnicodeResource): Clear deadKeyState if a character
+ was produced.
+ (KeycodeToUnicodeViaKCHRResource): Use CFString and current keyboard
+ encoding instead of Tcl Tcl_ExternalToUtf() and fixed
+ TkMacOSXCarbonEncoding.
+ (TkMacOSXKeycodeToUnicode): Add.
+
+ (TkMacOSXProcessKeyboardEvent): Add some heuristics to improve keyup
+ events.
+ (deadKeyState): Split into deadKeyStateUp and deadKeyStateDown.
+ (GenerateKeyEvent): Change interface and implementation to accept a
+ Unicode string instead of individual characters.
+ (GenerateKeyEvent): Don't generate string representations for special
+ characters.
+
+ * macosx/tkMacOSXEvent.h (TkMacOSXKeycodeToUnicode): Add prototype.
+
+ * macosx/tkMacOSXKeyboard.c (KCHRPtr): Remove.
+ (XKeycodeToKeysym): Use TkMacOSXKeycodeToUnicode instead of
+ KeyTranslate.
+ (XKeycodeToKeysym): Support latin-1 keysyms.
+
+ This patch reverts the hack to put icons in menus that Vince put in
+ yesterday (but preserves the bug fix in that submission.)
+
+ * macosx/tkMacOSXMenu.c (SetMenuTitle): revert treating "<bullet>
+ number" as a request to put icon number <number> in the menu.
+
+2003-02-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * doc/entry.n:
+ * doc/text.n: Update double and triple click docs to match
+ implementation changes made on 2002-02-14.
+
+2003-02-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Makefile: reworked embedded build to no longer require
+ relinking but to use install_name_tool instead to change the
+ install_names for embedded frameworks. [Bug 644510]
+
+2003-02-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: New part for the widget demo showing
+ * library/demos/unicodeout.tcl: Tk's UNICODE output. [Patch 627453]
+
+2003-02-18 Andreas Kupries <andreask@activestate.com>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl (HP xnet [Bug 651811]).
+
+2003-02-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2003-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (TextWidgetCmd): remove unused lastEnd var. [Bug
+ 664790]
+
+ * generic/tkCanvPs.c (TkPostscriptImage): remove unused depth var. [Bug
+ 664787]
+
+ * generic/tkEntry.c (EntrySetValue): removed unused code var. [Bug
+ 664781]
+
+ * library/tk.tcl (::tk::TabToWindow): auto-highlight spinboxes as well
+ as entries when tabbing in. [Patch 683813] (bron)
+
+ * library/xmfbox.tcl (::tk::MotifFDialog_ActivateSEnt): correct sub on
+ embedded newlines. [Patch 688572] (bonfield)
+
+ * doc/colors.n: corrected B values [Bug 682714].
+
+ * win/tkWinInit.c (TkpDisplayWarning): truncate MessageBox string to
+ 1024 chars to prevent possible oversized window errors. May be
+ necessary in other MB uses (ie Tcl_AppInit). [Tcl Bug 608559]
+
+2003-02-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXMenu.c: (SetMenuTitle) fix to utf encoding problem
+ when setting menu titles, and provisional support for icons. [Tcl Bug
+ 625080]
+
+2003-02-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgGIF.c (FileReadGIF): Ensure that the trashBuffer is
+ always deallocated on function exit to stop a potential memory leak.
+
+2003-02-17 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkEvent.c (Tk_HandleEvent): Fixup button press state saving
+ code, it was incorrectly converting normal motion events into button
+ press and motion events in some cases.
+ * generic/tkInt.h: Add mouseButtonWindow member to the TkDisplay
+ structure.
+ * tests/event.test: Add test case for faulty button motion logic.
+
+2003-02-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README: Bumped to 8.4.2.
+ * generic/tk.h:
+ * macosx/Wish.pbproj/project.pbxproj:
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tcl.m4:
+ * unix/tk.spec:
+ * win/configure:
+ * win/configure.in:
+
+ * unix/tcl.m4: correct HP-UX ia64 --enable-64bit build flags
+
+2003-02-13 Kevin Kenny <kennykb@users.sourceforge.net>
+
+ * doc/wish.n: Added language to describe the handling of the
+ end-of-file character \u001a in script files. [Bug 685505]
+
+2003-02-10 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXCursor.c (TkMacOSXInstallCursor): Set all theme
+ cursors using SetThemeCursor or SetAnimatedThemeCursors.
+ (TkGetCursorByName): Use the theme cursors for arrow, ibeam, etc. Allow
+ animatedCursor{NUM} form for an animated cursor with count.
+ (TkpSetCursor): Don't reset the cursor if there is no change.
+ * macosx/tkMacOSXMouseEvent.c (GeneratePollingEvents): Don't directly
+ call TkMacOSXInstallCursor, it gets called by the call to
+ Tk_UpdatePointer immediately above.
+
+2003-02-05 Fred Fish <fnf@intrinsity.com>
+
+ * macosx/tkMacOSXWm.c (Tk_SetGrid): Fix precedence problem with
+ * mac/tkMacWm.c (Tk_SetGrid): '==' and '|'.
+
+2003-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCanvArc.c (CreateArc): Rework canvas create item type
+ * generic/tkCanvBmap.c (CreateBitmap): coords handling to be
+ * generic/tkCanvImg.c (CreateImage): consistent across types and
+ * generic/tkCanvPoly.c (CreatePolygon): not pass empty coords to item
+ * generic/tkCanvLine.c (CreateLine): creation procs.
+ * generic/tkCanvText.c (CreateText):
+ * generic/tkCanvWind.c (CreateWinItem):
+ * generic/tkCanvas.c (CanvasWidgetCmd CANV_CREATE):
+ * generic/tkRectOval.c (CreateRectOval):
+ * tests/canvRect.test:
+ * tests/canvText.test:
+ * tests/canvas.test:
+
+2003-01-28 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkInt.h (TkDisplay,TkMainInfo):
+ * generic/tkObj.c (windowObjType):
+ * generic/tkWindow.c (Tk_DestroyWindow):
+ * tests/wm.test (wm-deletion-epoch-1.1): Moved 'deletionEpoch' field
+ from TkDisplay to TkMainInfo. Reworked windowObj type. Fixes [Bug
+ 671330] "segfault when e.g. deiconifying destroyed window"
+
+2003-01-23 D. Richard Hipp <drh@hwaci.com>
+
+ * library/entry.tcl: Fix the KeyPress binding on the entry widget so
+ that it enters text from left to right (not right to left) even if the
+ mouse button is being held down. [Bug 673687]
+
+2003-01-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkFrame.c (TkToplevelWindowForCommand): Added way of mapping
+ from command names to tkwins-for-toplevels.
+ * generic/tkImage.c (Tk_ImageObjCmd): Added check to make sure that
+ you're not creating an image named the same as .'s command, which
+ refixes 220891, even when the name of the command has been changed with
+ 'rename'. The error message is better too.
+ * tests/image.test (image-1.10,image-1.11): Updated to match new error
+ message and added test for the rename case.
+
+2003-01-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkImage.c (DeleteImage): delete the image's entry in the
+ image table correctly when there are no more instances. This reopens
+ bug 220891. [Bug 669759]
+
+2003-01-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/loadTk.n: note that ::safe::loadTk has a prereq on
+ ::safe::interpCreate or ::safe::interpInit. [Bug 669159]
+
+ * doc/photo.n: $image put only accepts -format and -to, and note
+ extended use of -to.
+
+2003-01-17 D. Richard Hipp <drh@hwaci.com>
+
+ * generic/tkCanvUtil.c: The clipping algorithm introduced on 2003-01-08
+ was unnecessarily aggressive in reducing the size of the clipping box.
+ This did not cause a problem for normal display, but did create trouble
+ for some extensions that attempt to render a canvas on a GDI printer
+ under Windows. The patch here relaxes the constraints on the clipping
+ box somewhat. [Bug 663981]
+
+2003-01-14 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tkSelect.c (Tk_CreateSelHandler): Fix for [Bug 666346]
+ "Selection handling crashes under KDE 3.0"
+ * tests/unixSelect.test (unixSelect-1.20): Added test case.
+
+2003-01-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd)
+ (ChooseDirectoryValidateProc, Tk_MessageBoxObjCmd): Remove unused
+ tsdPtr variable. Use TEXT macro instead of _T macro since _T does not
+ work under Cygwin. Declare flags as UINT to avoid compiler warning when
+ compiling with mingw.
+
+2003-01-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/Makefile.in: Add TCL_DEFS to AC_FLAGS so that compiler flags
+ defined by Tcl get passed to the compiler. Add empty rule for cat.c so
+ that Tk compiles under msys.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl, this pulls in a subst of TCL_DEFS, it
+ also defines USE_THREAD_ALLOC when threads are used and it updates the
+ SC_ENABLE_SYMBOLS and SC_PROG_TCLSH macros to match the ones used in
+ Tcl.
+
+2003-01-10 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixEvent.c (OpenIM): Remove unused variable (Fixes: [Bug
+ 664780] "SGI warning: OpenIM")
+
+2003-01-08 D. Richard Hipp <drh@hwaci.com>
+
+ * generic/tkCanvLine.c:
+ * generic/tkCanvas.h:
+ * generic/tkCanvUtil.c: Clip long lines so that they will display
+ properly even on windowing systems where coordinates are expressed as
+ 16-bit numbers. [Bug 663981]
+
+2003-01-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkFrame.c (CreateFrame): throw a Tcl error instead of a panic
+ when we cannot get a main window and appname is NULL. This can indicate
+ that a user tried to create a frame/toplevel while Tk was dying. [Bug
+ 661792]
+
+ ******************************************************************
+ *** CHANGELOG ENTRIES FOR 2002 AND EARLIER IN "ChangeLog.2002" ***
+ ******************************************************************
diff --git a/README b/README
index 0794023..d94cde8 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
README: Tk
- This is the Tk 8.4.19 source distribution.
+ This is the Tk 8.5.9 source distribution.
Tcl/Tk is also available through NetCVS:
http://tcl.sourceforge.net/
You can get any source release of Tcl from the file distributions
@@ -12,9 +12,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.4 Web page at
+this release, see the Tcl/Tk 8.5 Web page at
- http://www.tcl.tk/software/tcltk/8.4.html
+ http://www.tcl.tk/software/tcltk/8.5.html
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
diff --git a/bitmaps/error.bmp b/bitmaps/error.xbm
index 5a1331f..5a1331f 100644
--- a/bitmaps/error.bmp
+++ b/bitmaps/error.xbm
diff --git a/bitmaps/gray12.bmp b/bitmaps/gray12.xbm
index a0eafa1..a0eafa1 100644
--- a/bitmaps/gray12.bmp
+++ b/bitmaps/gray12.xbm
diff --git a/bitmaps/gray25.bmp b/bitmaps/gray25.xbm
index fdaef49..fdaef49 100644
--- a/bitmaps/gray25.bmp
+++ b/bitmaps/gray25.xbm
diff --git a/bitmaps/gray50.bmp b/bitmaps/gray50.xbm
index 1f9fbc0..1f9fbc0 100644
--- a/bitmaps/gray50.bmp
+++ b/bitmaps/gray50.xbm
diff --git a/bitmaps/gray75.bmp b/bitmaps/gray75.xbm
index f700b2c..f700b2c 100644
--- a/bitmaps/gray75.bmp
+++ b/bitmaps/gray75.xbm
diff --git a/bitmaps/hourglass.bmp b/bitmaps/hourglass.xbm
index bb1d8ad..bb1d8ad 100644
--- a/bitmaps/hourglass.bmp
+++ b/bitmaps/hourglass.xbm
diff --git a/bitmaps/info.bmp b/bitmaps/info.xbm
index 801476e..801476e 100644
--- a/bitmaps/info.bmp
+++ b/bitmaps/info.xbm
diff --git a/bitmaps/questhead.bmp b/bitmaps/questhead.xbm
index 17b2929..17b2929 100644
--- a/bitmaps/questhead.bmp
+++ b/bitmaps/questhead.xbm
diff --git a/bitmaps/question.bmp b/bitmaps/question.xbm
index ceba2ab..ceba2ab 100644
--- a/bitmaps/question.bmp
+++ b/bitmaps/question.xbm
diff --git a/bitmaps/warning.bmp b/bitmaps/warning.xbm
index 7925440..7925440 100644
--- a/bitmaps/warning.bmp
+++ b/bitmaps/warning.xbm
diff --git a/changes b/changes
index 0270bfc..d02adc8 100644
--- a/changes
+++ b/changes
@@ -1,4 +1,4 @@
-This file summarizes all changes made to Tk since version 1.0 was
+hhis file summarizes all changes made to Tk since version 1.0 was
released on March 13, 1991. Changes that aren't backward compatible
are marked specially.
@@ -5614,13 +5614,63 @@ with spaces in their names.
2004-02-18 (bug fix)[899246] fix shrinking grid geometry calculations
-2004-02-23 (platform support)[809157] Mac OS X: Add alpha blending for
+2003-02-23 (platform support)[809157] Mac OS X: Add alpha blending for
images with partial transparency.
2004-03-01 (platform support)[218561] Allow 64-bit configure on IRIX64-6.5*
--- Released 8.4.6, March 1, 2004 --- See ChangeLog for details ---
+Changes to 8.5a1 include all changes to the 8.4 line through 8.4.6,
+plus the following, which focuses on the high-level feature changes
+in this changeset (new minor version) rather than bug fixes:
+
+ * Tk is no longer guaranteed to work for Win95 (not tested 8.5+)
+
+ * configure scripts now require autoconf 2.57 for regeneration
+
+ * added support for anti-aliased test under X11 (already existed for
+ Win/Mac) using --enable-xft
+
+ * improved speed of 'photo put' handling
+
+ * updated demos for consistency and improved look & feel
+
+ * improve 3D line drawing for sunken widgets on Windows
+
+ * [792387] reworked 'grid' to handle some tricky geometry computations
+ better
+
+ * [TIP #109] updated look of radiobuttons and checkbuttons on X11
+
+ * [TIP #110] tristate value option for checkbuttons and radiobuttons
+
+ * [TIP #113] add multi-line searching and -all searching to the text widget
+ Full Tcl_Obj-ification of the text widget
+ * [TIP #155] add 'count' and 'replace' subcommands and a '-blockcursor'
+ option to text widgets and support smooth-scrolling of them
+ *** POTENTIAL INCOMPATIBILITY ***
+ Negative or decreasing tab-stops are explicitly disallowed
+
+ * [TIP #116] more safety for large image creation through use of attempted
+ allocation of large memory blocks
+
+ * [TIP #137/151] add -encoding option to 'wish' executable (through
+ Tk_MainEX())
+ *** POTENTIAL INCOMPATIBILITY ***
+ For Tk embedders that build on Tk_MainEx() and make use of Tk_MainEx's
+ former ability to pass a leading "-encoding" option to interactive shell
+ operations, this will now be consumed by Tk.
+
+ * [TIP #146] added 'grid anchor' subcommand for overall grid anchoring
+
+ * [TIP #147] recognize widget names and "all" as keywords in grid's
+ 'columnconfigure' and 'rowconfigure' subcommands
+
+ * [TIP #150] make 'send' available on Windows
+
+--- Released 8.5a1, March 3, 2004 --- See ChangeLog for details ---
+
2004-03-17 (platform support) Mac OS X: Grab the Command-H &
Command-Shift-H keys and use them for Hide and Hide Others before passing
keystrokes on to the generic keyboard event processing.
@@ -5740,21 +5790,176 @@ compositing of partially transparent areas.
--- Released 8.4.9, December 6, 2004 --- See ChangeLog for details ---
-2004-12-09 (performance)[1081966] BMP, JPG image load speed (fellows)
+Changes to 8.5a2 include all changes to the 8.4 line through 8.4.9, plus
+the following, which focuses on the 8.5-only changes since 8.5a1:
-2004-12-29 (platform support)[1092952,1091967] MSVC7, gcc OPT compiles (hobbs)
+2004-03-16 (bug fix)[915330] correct crash condition for new
+radio/checkbuttons when colors are exhausted (griffin)
-2005-01-11 (bug fix)[1098779] -pady accept all lists (fellows,kirkham)
+2004-03-18 (platform removal)[918139] Removed support for Mac OS Classic
+platform (steffen)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2004-03-26 (new feature)[FRQ 540375] support for
+[image create photo -format PPM -data] (fellows)
+
+2004-05-14 (bug fix)[TIP 152] -detail option for tk_messageBox (fellows)
+
+2004-06-04 (bug fix)[965398] Fix to shimmering infinite loop scrolling in
+text widget under rare circumstances (darley)
+
+2004-06-04 (bug fix) Fixed mousewheel bindings for OS X/Aqua (darley)
+
+2004-06-07 (bug fix)[965186] Fix text widget's record of
+partial-line-height calculations for very long wrapped lines, correcting
+scrollbar-text interactions (darley)
-2005-01-14 (bug fix)[959973] Set _NET_WM_NAME and _NET_WM_ICON_NAME
+2004-06-08 (bug fix)[968725] Fix text rendering problem with canvas text
+items that have a selected region. (dejong)
+
+2004-06-09 (bug fix) Fix multi-line regexp search bugs in text widget
+(darley)
+
+2004-06-15 (feature enhancement) Add 3D highlight to disabled *buttons and
+labels, as is done for disabled menu entries (kovalenko)
+
+2004-06-16 (bug fix)[742882] Fix potential division by zero in gridded wm
+geometry (english)
+
+2004-06-26 (bug fix)[756840] Fix Tk console cleanup on exit/reinit
+(mistachkin)
+
+2004-06-30 (new feature)[TIP 153] enhanced 'winfo toplevel' to recognize
+non-Tk windows (mckay)
+
+2004-07-02 (bug fix) Button 4 and 5 masks synchronized with Tk display
+(staplin)
+
+2004-07-05 (bug fix)[959973] Set _NET_WM_NAME and _NET_WM_ICON_NAME
(freedesktop.org) in addition to WM_NAME and WM_ICON_NAME (ICCCM). Allows
Unicode characters in wm titlebar on X11. (english)
-2005-01-14 (bug fix)[742882] division by zero in gridded wm geometry (english)
+2004-07-05 (new feature)[TIP 158][797404] Allow Win apps to distinguish
+keys on the keypad using the Extended modifier (grossbauer, kenny)
+
+2004-07-20 (feature enhancement)[922727] add install-private-headers target
+(steffen)
+
+2004-07-27 (bug fix) Fix segfault in case of premature end of GIF image
+data (steffen)
-2005-01-14 (bug fix)[632816] cannot remove transient (english)
+2004-08-11 (feature)[979101] [tk_getOpenFile] consults env vars (fellows)
-2005-01-14 (bug fix)[568861] [wm minsize|maxsize] fix (dejong,english)
+2004-08-19 (new feature)[TIP 168] Add -smooth method for alternative bezier
+curve implementations on canvas items (hellstroem, fellows)
+
+2004-08-29 (new feature)[TIP 165] Add %d binding substitution for
+user-controlled data field (fellows)
+
+2004-09-10 (new feature)[TIP 169] Allow for text peering with '$text peer'
+widget subcommand (griffin, darley)
+
+2004-10-08 (new feature)[TIP 205] Use pkgconfig Database to register Xft
+support (english)
+
+2004-10-11 (new language) Swedish message catalog from Mats Bengtsson
+
+2004-10-19 (new feature)[TIP 204][976928] Virtual events for keyboard
+traversal (english)
+
+2004-10-24 (new feature)[TIP 177, 179][983886] Add -hide and -stretch
+options to panedwindow widget (griffin)
+
+2004-10-26 (bug fix)[919066] Improve region handling functions
+
+2004-10-28 (bug fix)[220927] Fix scale labels to stay in window (schlenker,
+thoyts)
+
+2004-11-07 (bug fix)[962589] Made handling of ^ more consistent in grid
+(spjuth)
+
+2004-11-28 (bug fix)[942320] Fix short integer overflow in x,y coordinates
+for long lines using unix AA fonts (english)
+
+Updated test suite, documentation, and demos.
+
+--- Released 8.5a2, December 7, 2004 --- See ChangeLog for details ---
+
+2004-12-09 (performance)[1081966] BMP, JPG image load speed (fellows)
+
+2004-12-17 (feature change) Modified DisplayFrame to draw a container's
+background when the embedded window is NULL (chengyemao)
+
+2004-12-17 (bug fix)[842945][831627] Fixed a bug in ContainerEventProc
+to handle ConfigureNotify event properly; Changed CleanupContainList to
+TkWinCleanupContainerList to be invoked in TkWinXCleanup; Changed Intialize
+and CreateTopLevelWindow to create the DeleteWindowsExitProc after TkpInit
+so that finalization will be done in a proper sequence (to avoid painics
+and potential crashes in exit). (chengyemao)
+
+2004-12-17 (platform support) Added TkWinClenupContainerList into stublib.
+(chengyemao)
+
+2004-12-18 (buf fix)[222677] Close the embedded window (of a different
+process) when its container is destroyed. (chengyemao)
+
+2004-12-19 (Windows feature implementation of embedded/embedding
+Tk and bug fix) Implemented container identification, focus, raise, set
+title of and move window so that an embedded widget is able to identify
+a container, to get focus and to receive key press input. Fixed bugs include
+[1024364][1096047] and an incorrect wm overrideredirect for an embedded
+window. (chengyemao)
+
+2004-12-20 (Windows feature implementation of embedded/embedding Tk)
+Implemented overrideredirect for an embedded toplevel; correctly updated a
+frame's upper left x and y of an embedded toplevel after its container
+(of another process) moved. (chengyemao)
+
+2004-12-28 (feature implementatoin of embedded/embedding Tk of Windows)
+Implemented embedded/embedding toplevel menu. A menu may be embedded in
+a container of either the same process or a different process. Working
+fine with Windows 98. But having a problem when invoked with a mouse click
+(Windows XP): if an embedded menu is in a different process, the menu items
+may show as a blank window at the pull-down time and require the mouse
+moves over the menu items to complete display. (chengyemao)
+
+2004-12-29 (platform support)[1092952,1091967] MSVC7, gcc OPT compiles (hobbs)
+
+2005-01-03 (feature implementation of embedded/embedding Tk of Windows) Added
+a separated window handler for an embedded menu; solved the problem of
+a blank menu display with a mouse click in XP. (chengyemao)
+
+2005-01-07 (feature implementation of embedded/embedding Tk of Window) Added
+TK_STATE message (Windows) to support {wm state} for embedded windows; forced
+redraw of container after the embedded window detached; removed unnecessary
+panic in using embedded window; embeded toplevel menu of an embedded window
+automatically in wrapper updating. Modified and added functions: WmStateCmd,
+UpdateWrapper, TkpWmGetState (added) in tkWinWm.c; TkpUseWindow,
+TkWinEmbeddedEventProc in tkWinEmbed.c; TkWinChildProc in tkWinX.c.
+(chengyemao)
+
+2005-01-08 (bug fix)[1098625] Wrong toplevel geometry when created with a menu;
+[637653] Deleting a popup menu crashes wish (chengyemao)
+
+2005-01-09 (feature implementation of embedded/embedding Tk of Windows)
+Changed FrameWidgetObjCmd (tkFrame.c), TkpUseWindow (tkMacOSXEmbed.c,
+tkUnixEmbed.c, tkWinEmbed.c) to make implementation ready for a
+configurable toplevel -use option and completed the implementation for
+Windows (tkWinWm.c, tkWinEmbed.c, tkWinInt.h). Embedding with a frame
+container needs further debugging (chengyemao).
+
+2005-01-10 (enhancement)[1081595] stopped use of TK_DBGX (english)
+
+2005-01-11 (bug fix)[1098779] -pady accept all lists (fellows,kirkham)
+
+2005-01-11 (bug fix)[1093631] [text] scroll long wrapped line (darley)
+
+2005-01-18 (feature implementation of embedded/embedding Tk of Windows)
+Simplified TkpUseWindow, added Tk_DetachEmbeddedWindow and got rid of code
+for saving an embedded window object which is never used. Fixed a bug in
+TkWinHandleMenuEvent for processing WM_MENUSELECT. Wish crashed due to an
+invalid index in a case of MF_POPUP. The -use option of a toplevel can be
+configured after the toplevel is created.
2005-01-18 (bug fix) dialog visibility in demos (nash,fellows)
@@ -5762,7 +5967,7 @@ Unicode characters in wm titlebar on X11. (english)
2005-01-31 (enhancement)[1111213] msg catalog for Spain's Spanish. (poser)
-2005-02-10 (platform support) Correct gcc builds for AIX-4+, HP-UX-11 (hobbs)
+2005-02-03 (bug fix)[1114977] UID thread-safety in canvas (fellows)
2005-02-11 (bug fix)[949792] Fix error during panedwindow destroy (hobbs)
@@ -5771,21 +5976,57 @@ segfault (hobbs)
2005-02-11 (bug fix)[1119460] Disabled canvas bmap/bbox segfault (hobbs)
+2005-02-11 (platform support) Correct gcc builds for AIX-4+, HP-UX-11 (hobbs)
+
+2005-02-14 (bug fix)[443848] [text] elide newline, but not line (darley)
+
+2005-02-16 (new feature)[TIP 223] Windows: [wm attributes -fullscreen] (dejong)
+
2005-02-22 (bug fix)[1146057] Aqua: [tk_getOpenFile] encoding (steffen)
2005-02-28 (bug fix)[1118340] Fix Mousewheel %A translation (davis,hobbs)
+2005-03-09 (bug fix) Mac OS X: remote debugging under Xcode (ingham)
+
2005-03-10 (bug fix)[1160025] Aqua: offset in mouse coords (davies,ingham)
2005-03-10 (bug fix)[1124237] Aqua: floating window focus (davies,ingham)
+2005-03-14 (bug fix)[1162356] ClientMessageHandlers work now (petasis,fellows)
+
+2005-03-14 (bug fix)[1124237] Aqua: (un)map of subwindows (ingham)
+
+2005-03-14 (bug fix)[700305] Aqua: child window updates before creation
+(ingham)
+
2005-03-15 (platform support) OpenBSD ports patch (thoyts)
-2005-03-24 (enhancment) Aqua: native L&F for entry and spinbox (ingham)
+2005-03-15 (bug fix)[1143776] [text] display panic (revar,darley)
+
+2005-03-19 (bug fix)[1016385] allow [rename console] (fellows)
+
+2005-03-23 (enhancment) Aqua: native L&F for entry and spinbox (ingham)
+
+2005-03-23 (new feature) Aqua: [wm attributes -notify] (ingham)
2005-03-29 (platform support) Allow msys builds without cygwin (hobbs)
-2005-04-12 (bug fix)[1122671] font encoding alignment issue (brubaker,hobbs)
+2005-04-03 (bug fix)[1175092] grid geometry calculations (spjuth)
+
+2005-04-04 (bug fix)[1174269] [text] elide search (darley)
+
+2005-04-04 (bug fix)[1169429] [text] invisible cursor (darley)
+
+2005-04-04 (bug fix)[1083878] \0 char in [tk_getOpenFile -filetypes] (darley)
+
+2005-04-07 (bug fix)[1152809] [wm stackorder] panic; multi-DISPLAY (dejong)
+
+2005-04-14 (bug fix)[1122671] font encoding alignment issue (brubaker,hobbs)
+
+2005-04-18 (bug fix) [text] <Home> and <End> bindings (darley)
+
+2005-04-18 (bug fix)[1185640] [text] passed bogus utf-8 to Tk_MeasureChars
+(petasis,english)
2005-04-25 (platform support) Fix builds on Mac OS X 10.1 (steffen)
@@ -5803,40 +6044,36 @@ support (hobbs)
2005-05-15 (bug fix)[1202223] Aqua: [text] window -> scroll lock (kirkham)
+2005-05-22 (bug fix)[1206133] TkGetFileFilters: add all (dionizio,fellows)
+
2005-05-24 (platform support) Darwin/Aqua builds merged into unix (steffen)
2005-05-27 (behavior change) tk_popup menus now "sticky" (helfter)
+2005-05-28 (new feature)[TIP 245] [tk inactive] (max,fellows)
+
2005-05-30 (bug fix)[1161543,1010941,795869,690169] panedwindow
display/resizing (south)
2005-05-30 (bug fix)[1159367] [menu] creation segfault (schofield,hobbs)
-2005-05-31 (bug fix)[1152809] [wm stackorder] panic; multi-DISPLAY (dejong)
-
Documentation improvements [1087842,1081527,1115907,etc.]
---- Released 8.4.10, June 4, 2005 --- See ChangeLog for details ---
-
-2005-06-03 (bug fix)[1016385] allow [rename console] (fellows)
-
-2005-06-04 (bug fix)[1114977] UID thread-safety in canvas (fellows)
-
-2005-06-20 (bug fix) Eliminate buffer overflow in GIF decoder (fellows)
+--- Released 8.5a3, June 4, 2005 --- See ChangeLog for details ---
2005-06-23 (bug fix)[1176610] Aqua: default [entry] borderwidth (steffen)
-2005-06-23 (bug fix)[756840] Fix Tk console cleanup on exit/reinit (mistachkin)
-
---- Released 8.4.11, June 28, 2005 --- See ChangeLog for details ---
+2005-07-18 (bug fix)[1240221] [$text mark prev] crash (darley)
-2005-07-24 (enhancement)[1244153] use SC_PROG_TCLSH, SC_BUILD_TCLSH (dejong)
+2005-07-22 (platform support) msys build now requires msys_mingw7.zip (dejong)
2005-08-09 (Aqua enhancement) Carbon events (steffen)
-2005-08-11 (bug fix)[1252702] portable Tcl_GetStringFromObj() calls (fellows)
+2005-08-10 (bug fix)[1252702] portable Tcl_GetStringFromObj() calls (fellows)
-2005-08-16 (bug fix)[749908] per-thread Tk_ConfigSpec tables (fellows)
+2005-08-12 (bug fix)[749908] per-thread Tk_ConfigSpec tables (fellows)
+
+2005-08-23 (enhancement)[1244153] use SC_PROG_TCLSH, SC_BUILD_TCLSH (dejong)
2005-08-23 (bug fix)[1235544] adopt Tcl's SEH implementation (kenny,dejong)
@@ -5846,39 +6083,54 @@ Documentation improvements [1087842,1081527,1115907,etc.]
2005-10-04 (bug fix)[1309218] [tk_chooseDirectory -mustexist] (lemburg,hobbs)
+2005-10-04 (bug fix)[1311734] Fixed the problems that an embedded windows failed
+to respond to display changes (Windows platform) (chengyemao)
+
+2005-10-10 (new feature)[TIP 256] [$text config -tabstyle] (darley)
+
2005-10-10 (bug fix)[1319720] Tk_DeleteOptionTable() mem leak (melbardis)
+2005-10-12 (new feature) one directory test suite (starpackable) (zolli,fellows)
+
2005-10-18 (bug fix)[1328926] $argv encoding and list formatting (porter)
2005-11-06 (platform support) OpenBSD missing LIBS (thoyts)
+2005-11-10 (bug fix)[1353022] minor potential memleaks (fellows)
+
2005-11-22 (bug fix)[1353414] [selection get] compat w/OpenOffice.org (fellows)
+2005-11-14 (feature change) [bgerror] msg truncation at 45 chars (english)
+
+2005-11-15 (new feature)[TIP 231] [wm attributes] on X11 (english)
+
2005-11-22 (bug fix)[1335485] dialog and space in widget name (taylor,fellows)
-2005-11-29 (enhancement)[1369597] Win 64: --enable-64bit=amd64|ia64 (hobbs)
+2005-11-27 (platform support) Darwin 64bit, Tiger copyfile(), and
+Max OSX universal binaries support (steffen)
2005-11-29 (bug fix)[1252259] clear initial % from console (lawlor,hobbs)
-2005-11-30 (bug fix)[1289565] ClientMessage handling (staplin,hobbs)
-
2005-11-30 (bug fix)[1086049] [wm attributes -topmost] fix (courtney,hobbs)
-2005-12-01 (bug fix)[1353416] [tk_popup] wrong post location (fvogelnew1,hobbs)
-
-2005-12-01 (workaround)[905830] Disable SCIM usage by Tk until properly
-handled (max)
+2005-12-08 (enhancement)[1369597] Win 64: --enable-64bit=amd64|ia64 (hobbs)
---- Released 8.4.12, December 5, 2005 --- See ChangeLog for details ---
+2005-12-08 (bug fix)[1374935] [$text tag names] crash with peer (hobbs)
2005-12-12 (bug fix)[1377619] configure syntax error exposed in bash-3.1 (hobbs)
-2005-12-13 (Aqua) MouseWheel bindings; kEventMouseScroll events (steffen)
+2005-12-13 (Aqua) MouseWheel bindings; kEventMouseScroll events (steffen)
+
+2005-12-28 (bug fix)[1380427] text widget undo/redo crash (callewaert)
+
+2006-01-12 (new feature)[TIP 260] canvas text item -underline option (fellows)
2006-01-20 (bug fix)[905830] all events to XFilterEvent (SCIM compat) (english)
2006-01-25 (feature enhance)[1237759] update script lib to 8.4 (fradin,porter)
+2006-01-25 (feature enhance)[1409264] I10N of [bgerror] dialog (fellows)
+
2006-02-27 (bug fix)[480862] [$img configure -data] no display change (fellows)
2006-02-27 (bug fix)[470322] BitmapInit() thread safety (griffin,fellows)
@@ -5891,23 +6143,17 @@ handled (max)
2006-03-17 (bug fix)[1451587] no abbreviations in script library (thoyts)
-2006-03-20 (bug fix)[1380427] crash in undo stack (lz_ufo,callewaert,fellows)
+2006-03-21 (enhancement)[638966] Aqua: ATSUI text render (reifenstahl,steffen)
+
+2006-03-23 (platform support) new tk.spec file (max)
+
+2006-03-26 (bug fix)[1414171] crash in [$text dump -command] (macdonald,darley)
2006-03-27 (bug fix)[1458234] crash in animated GIFs (bron,fellows)
2006-03-29 (platform support)[917433] tolerate X servers that do not
accept the color names "Black" and "White" (porter)
-2006-04-05 (bug fix) several finalization issues corrected (hobbs)
-
-2006-04-05 (bug fix)[1442102] crash on full -elide [text] (hobbs)
-
-2006-04-05 (bug fix)[1374119] default keyboard charset init (hobbs)
-
-2006-04-05 (bug fix)[1414171] stop $text dump if change detected (hobbs)
-
-2006-04-05 (bug fix)[1422430] [grid] empty index list crash (hobbs)
-
2006-04-06 (bug fix)[1455241] Aqua: [wm attributes -titlepath] fix (steffen)
2006-04-07 (bug fix)[934524] Aqua: background window dragging/growing (steffen)
@@ -5925,13 +6171,13 @@ accept the color names "Black" and "White" (porter)
2006-04-11 (enhancement)[1105284] Aqua: call ::tk::mac::* procs for all
registered applevents (steffen)
-2006-04-11 (bug fix)[1212056] fix panic on safe window exit on Windows (hobbs)
-
2006-04-12 (bug fix)[1432666] grid row/col out of bounds crash (spjuth)
---- Released 8.4.13, April 19, 2006 --- See ChangeLog for details ---
+2006-04-25 (bug fix)[1475865] crash on invalid font name (fellows)
-2006-04-25 (bug fix)[1475865] crash on invalid font name from XServer (fellows)
+Documentation improvements [1224983,1247835,1151523,1357575,1083838]
+
+--- Released 8.5a4, April 27, 2006 --- See ChangeLog for details ---
2006-04-28 (bug fix)[1243318] Aqua: incorrect cursor pos in bindings (steffen)
@@ -5955,16 +6201,12 @@ registered applevents (steffen)
2006-06-01 (bug fix)[912571] [console] std chan refcount (mistachkin,hobbs)
-2006-06-05 (bug fix)[1188340] [console] thread safety (porter)
-
2006-06-14 (bug fix)[950121] Aqua: crash in draw of very wide images (steffen)
2006-06-14 (bug fix)[1501922] Aqua: invalid clip regions on redraw (steffen)
2006-06-14 (bug fix)[891141] excess variable writes by [scale] (porter)
-2006-06-15 (platform support)[1424909] MS VS2005 support (thoyts)
-
2006-07-20 (platform support) Mac OS X weak linking (steffen)
2006-07-21 (bug fix)[700311, 1525905] Aqua: pure modifier keysyms (steffen)
@@ -5981,8 +6223,6 @@ registered applevents (steffen)
2006-08-30 (new feature)[1518677] WM_UNICHAR window message (hobbs,petasis)
-2006-09-06 (bug fix)[1456342] speedier [text] delete (hobbs)
-
2006-09-10 (bug fix) Aqua: active/inactive text selection color&relief (steffen)
2006-09-10 (bug fix)[1472624] Aqua: mouse events in overrideredir wins (steffen)
@@ -5991,20 +6231,29 @@ registered applevents (steffen)
2006-09-22 (bug fix)[1562528] NULL terminates variadic calls (fellows,ryazanov)
-2006-09-26 (platform support) MSVC8 AMD64 support (thoyts)
+2006-09-22 (new feature)[TIP 268] [package provide] full patchlevel (kupries)
2006-10-05 (bug fix)[1122671] alignment fixes in ucs-2be encoding routines
(hobbs,staplin)
+2006-10-08 (new feature)[TIP 264] New public routine Tk_Interp() (thoyts)
+
2006-10-16 (bug fix)[1558051] Aqua: CG drawing matches X11 (steffen)
---- Released 8.4.14, October 19, 2006 --- See ChangeLog for details ---
+--- Released 8.5a5, October 20, 2006 --- See ChangeLog for details ---
-2006-10-31 (platform support)[1582769] Fix build with VC2003 (thoyts)
+2006-10-30 (new feature)[TIP 48] Addition of themed tk widgets to Tk as Ttk
+(themed Tk). Adds ttk::notebook, ttk::sizegrip, ttk::combobox,
+ttk::panedwindow, ttk::progressbar, ttk::menubutton, ttk::button,
+ttk::radiobutton, ttk::checkbutton, ttk::treeview, ttk::separator,
+ttk::scrollbar, ttk::entry, ttk::frame and ttk::labelframe widgets. Adds
+ttk::style command.
-2006-11-02 (enhancement) Improve OS X Carbon Update event handling (steffen).
+2006-11-02 (enhancement) Improve OS X Carbon Update event handling (steffen)
-2006-11-23 (bug fix)[1599877] Win: multibyte menu item underlines (hobbs)
+2006-11-07 (configure change) Unix --enable-xft is enabled by default (kenny)
+
+2006-11-23 (bug fix)[1599877] Fix unicode character underline in menus (hobbs)
2006-11-24 (bug fix)[1487701] Better handling of tcl_interactive on OS X to
control display of console (hobbs, steffen)
@@ -6013,17 +6262,21 @@ control display of console (hobbs, steffen)
2006-11-30 (bug fix) Fix handling of Escape binding on OS X dialogs (steffen)
-2006-12-01 (new feature) Win: [wm attributes -transparentcolor] (hobbs)
+2006-12-01 (new feature) Add -transparentcolor wm attribute on Windows (hobbs)
+
+2006-12-01 (new feature)[TIP 300] Added [font actual $font $char] (kenny)
-2006-12-04 (performance)[1608046] [$listbox itemconfigure] (rezic,hobbs)
+2006-12-04 (new feature)[TIP 286] Added [$menu xposition] subcommand (bron)
-2006-12-22 (bug fix)[1522467] use fd_mask for 64bit support (fellow,vriezen)
+2006-12-11 (enhancement) Improved EWMH support for _NET_WM_PID and
+_NET_WM_PING (fellows)
2007-01-25 (configure change) ensure CPPFLAGS env var used when set (steffen)
-2007-01-30 (enhancement) new target: `install-private-headers` (hobbs, steffen)
+2007-02-19 (configure change) Use SHLIB_SUFFIX=".so" on HP-UX IA64 (was
+".sl") (hobbs)
-2007-02-19 (bug fix)[1662959] [tk_getOpenFile] in empty dir (hobbs)
+2007-04-10 (platform support) Correctly handle theming on Vista/Aero (english)
2007-04-23 (enhancement) Allow empty value for -selectforeground opt (steffen)
@@ -6070,9 +6323,15 @@ window class of already existing windows (steffen)
2007-04-23 (platform support) Aqua: add tcl document extensions and mime type
to Wish.app's Info.plist (steffen)
-2007-05-15 (bug fix)[1677608] list shimmer crash [grid *configure] (porter)
+--- Released 8.5a6, April 25, 2007 --- See ChangeLog for details ---
---- Released 8.4.15, May 25, 2007 --- See ChangeLog for details ---
+2007-05-04 (new feature)[TIP 145] Enhanced font handling (thoyts)
+
+2007-05-14 (bug fix)[1712081] restored USE_OLD_IMAGE support (porter)
+
+2007-05-15 (bug fix)[1717830,800149] memory leaks (jenglish)
+
+2007-05-15 (bug fix)[1677608] [grid *configure] crash (porter)
2007-05-31 (platform support) Aqua: improve interaction of Expose events and
idle-time redraws (steffen)
@@ -6100,32 +6359,69 @@ installed tkMacOSXInt.h header (steffen)
2007-07-09 (bug fix) Aqua: window click activation & titlebar click handling
in presence of grabs or modal windows (steffen)
-2007-07-25 (bug fix)[1743786] Aqua: tk_getOpenFile result (steffen)
+2007-07-25 (bug fix)[1743786] Aqua: [tk_getOpenFile] result (steffen)
-2007-08-27 (bug fix)[1782105] Aqua: tk_chooseColor result (steffen)
+2007-08-01 (bug fix)[1692927] [tk_messageBox -detail] buffer (davies,thoyts)
-2007-09-11 (platform support) Windows AMD64 support (thoyts)
+2007-08-27 (bug fix)[1782105] Aqua: tk_chooseColor result (steffen)
-2007-09-11 (bug fix)[777203] add TK_INCLUDE_SPEC to tkConfig.sh (steffen)
+2007-09-06 (platform support) Aqua: drop support for Xcode 1.5 project, add
+project for Xcode 3.0 (steffen)
2007-09-11 (bug fix) Animated GIF buffer overrun (max)
2007-09-15 (platform support) SunOS-5.1x link with cc, not ld (steffen)
---- Released 8.4.16, September 21, 2007 --- See ChangeLog for details ---
+2007-09-17 (enhancement)[1780286] Aqua: combobox appearance (english)
+
+2007-09-17 (platform support)[1748251] Fix NetBSD link failures (english)
+
+2007-09-20 (bug fix)[1791052] [text] DLine layout crash (khomoutov,fellows)
+
+--- Released 8.5b1, September 26, 2007 --- See ChangeLog for details ---
+
+2007-09-26 (enhancement)[1800742] msg catalog for Hungarian. (reszo)
2007-10-11 (bug fix)[1810818] Aqua: [wm resizeable] (steffen)
-2007-10-11 (enhancement)[1800742] msg catalog for Hungarian. (reszo)
+2007-10-12 (platform support) Aqua: replace RgnHandles by HIShapeRefs (steffen)
+ *** POTENTIAL INCOMPATIBILITY for C code acessing MacDrawable Rgns ***
+
+2007-10-15 (platform support) Mac OS X: 64-bit X11 support (steffen)
+
+2007-10-15 (new feature)[TIP 125][998125] dockable frame support (hobbs)
+
+2007-10-22 (bug fix)[1814778,1780286,1609168,1349586] combobox overhaul(english)
+
+2007-10-22 (platform support) Aqua: TIP 145 and Aqua Theme fonts (steffen)
+
+2007-10-23 (bug fix)[1818441] combobox & reparentable frames (hobbs)
+
+2007-10-24 (bug fix)[1723362] Win: transparent bitmaps (mcdonald,thoyts)
2007-10-25 (bug fix)[1818491] crash in [place] manager (mcdonald)
-2007-10-26 (platform support) Mac OS X: 64-bit X11 support (steffen)
+2007-10-25 (new feature)[TIP 242][1156388] file dialog filter (hobbs)
-2007-11-09 (platform support) Aqua: replace RgnHandles by HIShapeRefs (steffen)
- *** POTENTIAL INCOMPATIBILITY for C code acessing MacDrawable Rgns ***
+2007-10-25 (bug fix)[1817596] ttk::notebook (english)
+
+2007-10-26 (bug fix)[1816252] Aqua: [wm transient] (steffen)
+
+Improvements to demo suite to make more use of Tk 8.5 features (fellows,steffen)
+
+--- Released 8.5b2, October 26, 2007 --- See ChangeLog for details ---
+
+2007-10-29 (appearance change) Default look and fonts on X11 (hobbs)
+ *** POTENTIAL INCOMPATIBILITY; [::tk::classic::restore] to undo ***
+
+2007-10-30 (bug fix)[1803723] Win: Arabic and Hebrew rendering (fellows)
-2007-11-09 (enhancement) Aqua: "Run Widget Demo" menu item (steffen)
+2007-10-30 (bug fix)[1550528] [tk_chooseDirectory -mustexist true] disables
+the "OK" until valid selection (hobbs)
+
+2007-11-03 (new feature) adjustable [console] fonts (thoyts)
+
+2007-11-04 (enhancement) Aqua: "Run Widget Demo" menu item (steffen)
2007-11-09 (bug fix) Aqua: activate event after window expansion (steffen)
@@ -6137,26 +6433,335 @@ look&feel; menubutton size with -image/-bitmap (steffen)
2007-11-09 (bug fix) Aqua: [tk_getOpenFile] (et al.) and help menu crashes on
Mac OS X Leopard (steffen)
+2007-11-11 (bug fix)[1824638] Aqua: small max-width text measuring (riefenstahl)
+
+2007-11-14 (bug fix)[1831803] sv.msg catalog for "sv" locale (fellows)
+
+Many significant improvements to the documentation and demos (fellows, hobbs,
+steffen, kupries)
+
+--- Released 8.5b3, Novemeber 19, 2007 --- See ChangeLog for details ---
+
+2007-11-25 (bug fix)[1343984] ttk::notebook bugs (english,boudaillier)
+
2007-11-26 (bug fix)[1822391] [photo put] segfault w/ PPM data (kenny)
+2007-11-26 (bug fix)[1822076] [tk_saveFile] and path w/spaces (bauer,kenny)
+
+2007-12-04 (new feature)[1844143] Danish message catalog (berg)
+
+2007-12-11 (bug fix)[1602537] crash in [$text replace] (goth,porter,fellows)
+
+2007-12-12 (bug fix)[1845899] Aqua: [wm transient] (steffen)
+
2007-12-12 (bug fix)[1809538,1799782,1737288] fixes for the <<Modified>>
virtual event on [text] widgets (hobbs)
2007-12-13 (bug fix) correctly trace menubutton -textvariable for -compound
use (hobbs)
-2007-12-18 (bug fix)[1845899] Aqua: [wm transient] (steffen)
+Several documentation and release notes improvements
+
+--- Released 8.5.0, December 18, 2007 --- See ChangeLog for details ---
+
+2007-12-30 (bug fix)[1860802] fixed Dutch message catalog (markus,fellows)
+
+2008-01-06 (bug fix)[1442006,1821939,18862692] MouseWheel for treeview (english)
---- Released 8.4.17, January 4, 2008 --- See ChangeLog for details ---
+2008-01-08 (bug fix)[1865898,1679067] button size & state (english)
+
+2008-01-08 (bug fix)[1867122] [labelframe -style] crash (english,rib)
+
+2008-01-27 (bug fix)[1835848] size value returned by [font actual] (english)
+
+2008-01-27 (bug fix)[1878298] [notebook] redraws on tab visibility (english)
+
+2008-01-31 (bug fix)[1881892] messagebox default title (hobbs)
2008-02-01 (bug fix)[CVE-2008-0553] buffer overflow in GIF format (max)
---- Released 8.4.18, February 8, 2008 --- See ChangeLog for details ---
+--- Released 8.5.1, February 5, 2008 --- See ChangeLog for details ---
2008-02-27 (bug fix)[1863346] Aqua: memleak in QD drawing (steffen)
+2008-02-29 (enhancement) Knight's tour demo (thoyts)
+
+2008-03-12 (bug fix)[1090382] crash when GetFont() fails (jenglish)
+
+2008-03-13 (enhancement) support space in INSTALL_ROOT or $builddir (steffen)
+
+2008-03-21 (bug fix)[1863007,1920030] Export Ttk stubs table (english)
+
+2008-03-26 (bug fix)[1922466] crash in [. configure -cursor] (gavilán)
+
2008-03-27 (platform support)[1921166] Solaris 64bit build fixes (steffen)
-2008-04-07 (bug fix)[1937135] Fix double-free with argv error (hobbs)
+2008-03-27 (bug fix) restored [::safe::loadTk] (hobbs)
+
+--- Released 8.5.2, March 28, 2008 --- See ChangeLog for details ---
+
+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-14 (bug fix)[1941740] [tk_chooseColor -title] (thoyts)
+
+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)
+
+2008-06-10 (enhancement)[1986818] Use Xutf8LookupString when possible (english)
+
+2008-06-12 (bug fix)[1991932] global grab segfault (steffen)
+
+2008-06-12 (platform support) Solaris/amd64 gcc 64bit support (steffen)
+
+2008-06-18 (bug fix) Aqua: missing focus on first map (steffen)
+
+--- Released 8.5.3, June 30, 2008 --- See ChangeLog for details ---
+
+2008-07-04 (bug fix)[2009213] crash in [ttk::scale] (polo,english)
+
+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
+
+2008-08-01 (bug fix)[2009788,2028703] unmapped toplevel crashes (thoyts)
+
+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 (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-25 (bug fix)[1936220] fix [tk_getOpenFile -multiple 1] on unix (helfter)
+
+2008-08-25 (bug fix)[1023955] default menu cursor: no more Motif (helfter)
+
+2008-08-28 (bug fix) correct TK_LIBS value to include Xft (porter)
+
+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)
+
+--- Released 8.5.5, October 15, 2008 --- See ChangeLog for details ---
+
+2008-10-17 (enhancement) keyboard bindings for ttk::scale (thoyts)
+
+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-19 (bug fix)[2312027] Tk_Create*ImageType() thread safety (nijtmans)
+
+2008-11-22 (bug fix)[1939129,1991930] combobox behind other windows (thoyts)
+
+2008-12-22 (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-22 (bug fix)[2264732] crash using nondefault visual (english)
+
+2008-12-22 (bug fix)[2207435] [ttk::entry .t -textvar ::noexist::x] (english)
+
+--- Released 8.5.6, December 23, 2008 --- See ChangeLog for details ---
+
+2009-01-07 (bug fix)[1847002] Win: prevent grab bypass (thoyts)
+
+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 (platform support) better tools for BSD ports (cassoff)
+
+2009-02-17 (platform support) MSVC and _WIN64 (hobbs)
+
+2009-02-23 (bug fix)[1329198,456299,2507419] menu image display (mcdonald)
+
+2009-02-23 (bug fix)[2513104] fix cursor hotspots (mcdonald)
+
+2009-02-23 (bug fix)[2542828] Win: standard question_arrow cursor (danckaert)
+
+2009-02-27 (bug fix)[2645457] crash in Tk_MakeWindowExist() (thoyts)
+
+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-10 (bug fix)[2116837] std virtual events with Caps Lock (fellows)
+
+--- Released 8.5.7, April 15, 2009 --- See ChangeLog for details ---
+
+2009-04-23 (bug fix)[2779910] updated Win chooseDir (hobbs)
+
+2009-04-24 (bug fix) prevent delete of selected folder in Win dialog (hobbs)
+
+2009-04-30 (bug fix)[2080533] panedwindow sash draw crash (fellows)
+
+2009-04-30 (bug fix)[2504402] iconphoto on non-32-bit displays (mcdonald,thoyts)
+
+2009-05-03 (bug fix)[2785744] broken flag twiddling (baker,fellows)
+
+2009-05-13 (bug fix)[2791352] XLFD parsing error (thoyts)
+
+2009-05-14 (new feature) Vista theme support (thoyts)
+
+2009-05-14 (bug fix)[1923684] confused checkbutton state (thoyts)
+
+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-07-15 (bug fix)[2821962] photo image copy/paste (rib,fellows)
+
+2009-07-22 (bug fix)[2496114] focus in dead window crash (griffin,fellows)
+
+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-24 (bug fix) tk::MessageBox bindings for ttk::buttons (steiner,fellows)
+
+2009-08-25 (bug fix)[1909931] [send] update for Fedora 8 (fellows)
+
+2009-09-10 (bug fix) font allocation crash (berezhnoy,fellows)
+
+2009-09-14 (bug fix)[873608] win tearoff menu, no submenu arrows (traum,hobbs)
+
+2009-09-14 (bug fix)[873613] win tearoff menu repeat select (traum,hobbs)
+
+2009-09-25 (bug fix) grayscale from images (vetter,fellows)
+
+2009-10-07 (bug fix)[2088597] min scrollbar slider size (danckaert,fellows)
+
+2009-10-07 (bug fix)[2787164] combobox/menubutton arrow size (thoyts)
+
+2009-10-08 (bug fix)[2870648] file dialog cursor (danckaert,fellows)
+
+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-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-24 (bug fix)[1530276] X checkbutton -selectcolor (danckaert)
+
+2009-10-25 (bug fix)[1854913] [.t delete] before -startindex (danckaert)
+
+2009-10-25 (bug fix)[2809525] prevent X crash on overlong color name (goth)
+
+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)
+
+--- Released 8.5.8, November 16, 2009 --- See ChangeLog for details ---
+
+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-12-06 (bug fix)[2864685] Compiz menu item animation (gavilan,thoyts)
+
+2009-12-09 (bug fix)[2902573] Update Safe Tk to new Safe Base (kurpies)
+
+2009-12-11 (bug fix)[2912473] accept :: in DISPLAY name (fellows)
+
+2009-12-16 (bug fix)[2496162] crash calling Tk_DeleteOptionTable() (english)
+
+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-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-05 (bug fix)[220950] [$menu delete] bounds check (fellows)
+
+2010-01-05 [2898255] unlimited multi-file select (pawlak,fellows,thoyts)
+
+2010-01-06 (bug fix)[1163496] X: [wm transient] fix (bateman,fellows)
+
+2010-01-09 (new feature)[TIP 360] Modernize X11 Menus (thoyts)
+
+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-02-17 (bug fix)[2952745] crash in menu deletion (english)
+
+2010-03-11 (bug fix)[2968379] crash in peer text dump (fellows)
+
+2010-05-31 (bug fix)[3006842] crash on empty bind scripts (english)
+
+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-25 (feature)[3053320] update Ttk to tile 0.8.6 feature set (hobbs)
+
+--- Released 8.5.9, September 6, 2010 --- See ChangeLog for details ---
+
+2010-09-02 (bug fix)[3057573] disabled ttk::combobox colors (godfrey,english)
+
+2010-09-08 (bug fix)[2829363] [$treeview see] redisplay (barden,english)
+
+2010-10-11 (bug fix)[3085489] crash in [$treeview add] with no -tags (english)
+
+2010-11-04 (enhancement) Updated German messages. (haertel,nijtmans)
+
+2010-11-16 (platform) VS 2005 SP1 MSVC compiler (nijtmans)
+
+2010-11-24 (bug fix)[3071836] crash in tk_getSaveFile (twylite)
+
+2010-12-12 (platform) OpenBSD build improvements (cassoff)
+
+2010-12-17 (platform) Revisions to support rpm 4.4.2 (cassoff)
+
+2011-01-13 (bug fix)[3154705] tk_messageBox close button disabled (skylera)
+
+2011-01-22 (enhancement) add [ttk::entry validate] (schelte,english)
+
+2011-03-24 (bug fix)[3239768] Win menu font support (wehle)
+
+2011-03-28 (bug fix)[3129527] stop buffer overflows (dirtyepic,nijtmans)
+
+2011-04-04 (feature change)[2997657] No -container for [labelframe] (spjuth)
+
+2011-04-04 (bug fix)[723765] [grid remove] lost -in value (saye,spjuth)
+
+2011-04-22 (bug fix)[3291543] mem corrupt when [$canvas dchars] removes all
+coords of a polygon (rogers,spjuth)
+
+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)
---- Released 8.4.19, April 18, 2008 --- See ChangeLog for details ---
+--- Released 8.5.10, June 17, 2010 --- See ChangeLog for details ---
diff --git a/doc/3DBorder.3 b/doc/3DBorder.3
index 35bf666..01b359b 100644
--- a/doc/3DBorder.3
+++ b/doc/3DBorder.3
@@ -14,7 +14,6 @@ Tk_Alloc3DBorderFromObj, Tk_Get3DBorder, Tk_Get3DBorderFromObj, Tk_Draw3DRectang
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
Tk_3DBorder
\fBTk_Alloc3DBorderFromObj(\fIinterp, tkwin, objPtr\fB)\fR
.sp
@@ -23,7 +22,6 @@ Tk_3DBorder
.sp
Tk_3DBorder
\fBTk_Get3DBorderFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
void
\fBTk_Draw3DRectangle(\fItkwin, drawable, border, x, y, width, height, borderWidth, relief\fB)\fR
@@ -46,7 +44,7 @@ void
void
\fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOf3DBorder(\fIborder\fB)\fR
.sp
XColor *
@@ -55,9 +53,7 @@ XColor *
GC *
\fBTk_3DBorderGC(\fItkwin, border, which\fB)\fR
.sp
-.VS 8.1
\fBTk_Free3DBorderFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
\fBTk_Free3DBorder(\fIborder\fB)\fR
.SH ARGUMENTS
@@ -68,14 +64,12 @@ Interpreter to use for error reporting.
Token for window (for all procedures except \fBTk_Get3DBorder\fR,
must be the window for which the border was allocated).
.AP Tcl_Obj *objPtr in
-.VS 8.1
Pointer to object whose value describes color corresponding to
background (flat areas). Illuminated edges will be brighter than
this and shadowed edges will be darker than this.
.AP char *colorName in
Same as \fIobjPtr\fR except value is supplied as a string rather
than an object.
-.VE
.AP Drawable drawable in
X token for window or pixmap; indicates where graphics are to be drawn.
Must either be the X window for \fItkwin\fR or a pixmap with the
@@ -98,26 +92,26 @@ given by \fIx\fR, \fIy\fR, \fIwidth\fR, \fIheight\fR, negative means
border is outside rectangle.
.AP int relief in
Indicates 3-D position of interior of object relative to exterior;
-should be TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, TK_RELIEF_GROOVE,
-TK_RELIEF_SOLID, or TK_RELIEF_RIDGE (may also be TK_RELIEF_FLAT
+should be \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR,
+\fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR (may also be \fBTK_RELIEF_FLAT\fR
for \fBTk_Fill3DRectangle\fR).
.AP XPoint *pointPtr in
Pointer to array of points describing the set of vertices in a polygon.
The polygon need not be closed (it will be closed automatically if it
-isn't).
+is not).
.AP int numPoints in
Number of points at \fI*pointPtr\fR.
.AP int polyBorderWidth in
Width of border in pixels. If positive, border is drawn to left of
trajectory given by \fIpointPtr\fR; if negative, border is drawn to
-right of trajectory. If \fIleftRelief\fR is TK_RELIEF_GROOVE or
-TK_RELIEF_RIDGE then the border is centered on the trajectory.
+right of trajectory. If \fIleftRelief\fR is \fBTK_RELIEF_GROOVE\fR or
+\fBTK_RELIEF_RIDGE\fR then the border is centered on the trajectory.
.AP int leftRelief in
-Height of left side of polygon's path relative to right. TK_RELIEF_RAISED
-means left side should appear higher and TK_RELIEF_SUNKEN means right side
+Height of left side of polygon's path relative to right. \fBTK_RELIEF_RAISED\fR
+means left side should appear higher and \fBTK_RELIEF_SUNKEN\fR means right side
should appear higher;
-TK_RELIEF_GROOVE and TK_RELIEF_RIDGE mean the obvious things.
-For \fBTk_Fill3DPolygon\fR, TK_RELIEF_FLAT may also be specified to
+\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean the obvious things.
+For \fBTk_Fill3DPolygon\fR, \fBTK_RELIEF_FLAT\fR may also be specified to
indicate no difference in height.
.AP int leftBevel in
Non-zero means this bevel forms the left side of the object; zero means
@@ -138,14 +132,13 @@ Non-zero means this bevel forms the top side of the object; zero means
it forms the bottom side.
.AP int which in
Specifies which of the border's graphics contexts is desired.
-Must be TK_3D_FLAT_GC, TK_3D_LIGHT_GC, or TK_3D_DARK_GC.
+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
way that produces a three-dimensional appearance.
-.VS 8.1
\fBTk_Alloc3DBorderFromObj\fR
allocates colors and Pixmaps needed to draw a border in the window
given by the \fItkwin\fR argument. The value of \fIobjPtr\fR
@@ -173,13 +166,12 @@ prevents \fBTk_Get3DBorder\fR from caching the return value, so
.PP
\fBTk_Get3DBorderFromObj\fR returns the token for an existing border, given
the window and color name used to create the border.
-\fBTk_Get3DBorderFromObj\fR doesn't actually create the border; it must
+\fBTk_Get3DBorderFromObj\fR does not actually create the border; it must
already have been created with a previous call to
\fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. The return
value is cached in \fIobjPtr\fR, which speeds up
future calls to \fBTk_Get3DBorderFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
-.VE
.PP
Once a border structure has been created, \fBTk_Draw3DRectangle\fR may be
invoked to draw the border.
@@ -197,10 +189,10 @@ within \fIdrawable\fR (usually \fIx\fR and \fIy\fR are zero and
\fIborderWidth\fR specifies the number of pixels actually
occupied by the border. The \fIrelief\fR argument indicates
which of several three-dimensional effects is desired:
-TK_RELIEF_RAISED means that the interior of the rectangle should appear raised
-relative to the exterior of the rectangle, and
-TK_RELIEF_SUNKEN means that the interior should appear depressed.
-TK_RELIEF_GROOVE and TK_RELIEF_RIDGE mean that there should appear to be
+\fBTK_RELIEF_RAISED\fR means that the interior of the rectangle should
+appear raised relative to the exterior of the rectangle, and
+\fBTK_RELIEF_SUNKEN\fR means that the interior should appear depressed.
+\fBTK_RELIEF_GROOVE\fR and \fBTK_RELIEF_RIDGE\fR mean that there should appear to be
a groove or ridge around the exterior of the rectangle.
.PP
\fBTk_Fill3DRectangle\fR is somewhat like \fBTk_Draw3DRectangle\fR except
@@ -209,7 +201,7 @@ that it first fills the rectangular area with the background color
to the color used to create \fIborder\fR). Then it calls
\fBTk_Draw3DRectangle\fR to draw a border just inside the outer edge of
the rectangular area. The argument \fIrelief\fR indicates the desired
-effect (TK_RELIEF_FLAT means no border should be drawn; all that
+effect (\fBTK_RELIEF_FLAT\fR means no border should be drawn; all that
happens is to fill the rectangle with the background color).
.PP
The procedure \fBTk_Draw3DPolygon\fR may be used to draw more complex
@@ -228,7 +220,7 @@ it's not clear how useful this is.
\fBTk_Fill3DRectangle\fR is to \fBTk_Draw3DRectangle\fR: it fills
the polygonal area with the background color from \fIborder\fR,
then calls \fBTk_Draw3DPolygon\fR to draw a border around the
-area (unless \fIleftRelief\fR is TK_RELIEF_FLAT; in this case no
+area (unless \fIleftRelief\fR is \fBTK_RELIEF_FLAT\fR; in this case no
border is drawn).
.PP
The procedures \fBTk_3DVerticalBevel\fR and \fBTk_3DHorizontalBevel\fR
@@ -244,7 +236,9 @@ Each procedure takes \fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR
arguments that describe the rectangular area of the beveled edge
(e.g., \fIwidth\fR is the border width for \fBTk_3DVerticalBevel\fR).
The \fIleftBorder\fR and \fItopBorder\fR arguments indicate the
-position of the border relative to the ``inside'' of the object, and
+position of the border relative to the
+.QW inside
+of the object, and
\fIrelief\fR indicates the relief of the inside of the object relative
to the outside.
\fBTk_3DVerticalBevel\fR just draws a rectangular region.
@@ -282,11 +276,10 @@ as long as \fIborder\fR exists.
The procedure \fBTk_3DBorderGC\fR returns one of the X graphics contexts
that are used to draw the border.
The argument \fIwhich\fR selects which one of the three possible GC's:
-TK_3D_FLAT_GC returns the context used for flat surfaces,
-TK_3D_LIGHT_GC returns the context for light shadows,
-and TK_3D_DARK_GC returns the context for dark shadows.
+\fBTK_3D_FLAT_GC\fR returns the context used for flat surfaces,
+\fBTK_3D_LIGHT_GC\fR returns the context for light shadows,
+and \fBTK_3D_DARK_GC\fR returns the context for dark shadows.
.PP
-.VS 8.1
When a border is no longer needed, \fBTk_Free3DBorderFromObj\fR
or \fBTk_Free3DBorder\fR should
be called to release the resources associated with it.
@@ -297,7 +290,6 @@ 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.
-.VE
.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 3de6c2f..09a6d9e 100644
--- a/doc/AddOption.3
+++ b/doc/AddOption.3
@@ -16,9 +16,9 @@ void
.SH ARGUMENTS
.AP Tk_Window tkwin in
Token for window.
-.AP "CONST char" *name in
+.AP "const char" *name in
Multi-element name of option.
-.AP "CONST char" *value in
+.AP "const char" *value in
Value of option.
.AP int priority in
Overall priority level to use for option.
@@ -34,24 +34,19 @@ classes separated by asterisks or dots, in the usual X format.
this value will be returned in calls to \fBTk_GetOption\fR.
\fIPriority\fR specifies the priority of the value; when options are
queried using \fBTk_GetOption\fR, the value with the highest priority
-is returned. \fIPriority\fR must be between 0 and TK_MAX_PRIO. Some
+is returned. \fIPriority\fR must be between 0 and \fBTK_MAX_PRIO\fR. Some
common priority values are:
-.TP
-20
+.IP 20
Used for default values hard-coded into widgets.
-.TP
-40
+.IP 40
Used for options specified in application-specific startup files.
-.TP
-60
+.IP 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
-80
+.IP 80
Used for options specified interactively after the application starts
running.
-.PP
.SH KEYWORDS
class, name, option, add
diff --git a/doc/BindTable.3 b/doc/BindTable.3
index 438e586..223c37b 100644
--- a/doc/BindTable.3
+++ b/doc/BindTable.3
@@ -25,7 +25,7 @@ unsigned long
int
\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
.sp
\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR
@@ -43,7 +43,7 @@ Token for binding table; must have been returned by some previous
call to \fBTk_CreateBindingTable\fR.
.AP ClientData object in
Identifies object with which binding is associated.
-.AP "CONST char" *eventString in
+.AP "const char" *eventString in
String describing event sequence.
.AP char *script in
Tcl script to invoke when binding triggers.
@@ -117,7 +117,7 @@ message is left in \fIinterp->result\fR.
\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 TCL_OK.
+\fBTk_DeleteBinding\fR always returns \fBTCL_OK\fR.
In some cases it may reset \fIinterp->result\fR to the default
empty value.
.PP
diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3
index c0aff6d..08b17a4 100644
--- a/doc/CanvPsY.3
+++ b/doc/CanvPsY.3
@@ -83,15 +83,15 @@ 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 TCL_OK is returned
-unless an error occurs, in which case TCL_ERROR is returned and
+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.
.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
-TCL_OK unless an error occurs, in which case TCL_ERROR is returned and
+\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.
.PP
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
@@ -99,8 +99,8 @@ 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 TCL_OK
-unless an error occurs, in which case TCL_ERROR is returned and
+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.
.PP
\fBTk_CanvasPsPath\fR generates Postscript to set the current path
@@ -112,8 +112,8 @@ 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 TCL_OK is
-returned, unless an error occurs, in which case TCL_ERROR is returned and
+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.
.SH KEYWORDS
diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3
index fb8fff5..14db15e 100644
--- a/doc/CanvTkwin.3
+++ b/doc/CanvTkwin.3
@@ -36,7 +36,7 @@ Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR;
A token that identifies a canvas widget.
.AP Tcl_Interp *interp in/out
Interpreter to use for error reporting.
-.AP "CONST char" *string in
+.AP "const char" *string in
Textual description of a canvas coordinate.
.AP double *doublePtr out
Points to place to store a converted coordinate.
@@ -85,9 +85,9 @@ coordinate (such as \fB2p\fR or \fB1.6c\fR) into a double-precision
canvas coordinate.
If \fIstring\fR is a valid coordinate description then \fBTk_CanvasGetCoord\fR
stores the corresponding canvas coordinate at *\fIdoublePtr\fR
-and returns TCL_OK.
+and returns \fBTCL_OK\fR.
Otherwise it stores an error message in \fIinterp->result\fR and
-returns TCL_ERROR.
+returns \fBTCL_ERROR\fR.
.PP
\fBTk_CanvasDrawableCoords\fR is called by type managers during
redisplay to compute where to draw things.
@@ -138,20 +138,20 @@ modified using image commands.
.PP
\fBTk_CanvasTagsParseProc\fR and \fBTk_CanvasTagsPrintProc\fR are
procedures that handle the \fB\-tags\fR option for canvas items.
-The code of a canvas type manager won't call these procedures
+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:
.CS
static Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+ Tk_CanvasTagsPrintProc, (ClientData) NULL
};
static Tk_ConfigSpec configSpecs[] = {
- ...
- {TK_CONFIG_CUSTOM, "\-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- ...
+ ...
+ {TK_CONFIG_CUSTOM, "\-tags", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
+ ...
};
.CE
diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3
index 7ffa07b..58bf6e1 100644
--- a/doc/CanvTxtInfo.3
+++ b/doc/CanvTxtInfo.3
@@ -33,20 +33,20 @@ text.
The structure has the following form:
.CS
typedef struct Tk_CanvasTextInfo {
- Tk_3DBorder \fIselBorder\fR;
- int \fIselBorderWidth\fR;
- XColor *\fIselFgColorPtr\fR;
- Tk_Item *\fIselItemPtr\fR;
- int \fIselectFirst\fR;
- int \fIselectLast\fR;
- Tk_Item *\fIanchorItemPtr\fR;
- int \fIselectAnchor\fR;
- Tk_3DBorder \fIinsertBorder\fR;
- int \fIinsertWidth\fR;
- int \fIinsertBorderWidth\fR;
- Tk_Item *\fIfocusItemPtr\fR;
- int \fIgotFocus\fR;
- int \fIcursorOn\fR;
+ Tk_3DBorder \fIselBorder\fR;
+ int \fIselBorderWidth\fR;
+ XColor *\fIselFgColorPtr\fR;
+ Tk_Item *\fIselItemPtr\fR;
+ int \fIselectFirst\fR;
+ int \fIselectLast\fR;
+ Tk_Item *\fIanchorItemPtr\fR;
+ int \fIselectAnchor\fR;
+ Tk_3DBorder \fIinsertBorder\fR;
+ int \fIinsertWidth\fR;
+ int \fIinsertBorderWidth\fR;
+ Tk_Item *\fIfocusItemPtr\fR;
+ int \fIgotFocus\fR;
+ int \fIcursorOn\fR;
} Tk_CanvasTextInfo;
.CE
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
@@ -56,7 +56,7 @@ selected text, in pixels.
\fIselFgColorPtr\fR points to an XColor that describes the foreground
color to be used when drawing selected text.
\fIselItemPtr\fR points to the item that is currently selected, or
-NULL if there is no item selected or if the canvas doesn't have the
+NULL if there is no item selected or if the canvas does not have the
selection.
\fIselectFirst\fR and \fIselectLast\fR give the indices of the first
and last selected characters in \fIselItemPtr\fR, as returned by the
diff --git a/doc/Clipboard.3 b/doc/Clipboard.3
index 36c1726..6555290 100644
--- a/doc/Clipboard.3
+++ b/doc/Clipboard.3
@@ -44,8 +44,8 @@ number of targets.
.PP
\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any
data items previously stored on the clipboard in this application.
-It normally returns TCL_OK, but if an error occurs it returns
-TCL_ERROR and leaves an error message in \fIinterp->result\fR.
+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.
\fBTk_ClipboardClear\fR must be called before a sequence of
\fBTk_ClipboardAppend\fR calls can be issued.
.PP
@@ -54,13 +54,13 @@ The first buffer for a given \fItarget\fR determines the \fIformat\fR
for that \fItarget\fR.
Any successive appends for that \fItarget\fR must have
the same format or an error will be returned.
-\fBTk_ClipboardAppend\fR returns TCL_OK if the buffer is
+\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is
successfully copied onto the clipboard. If the clipboard is not
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 TCL_ERROR and leaves an error message in
+\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in
\fIinterp->result\fR.
.PP
In order to guarantee atomicity, no event handling should occur
diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3
index c7a8c33..6a3e41a 100644
--- a/doc/ConfigWidg.3
+++ b/doc/ConfigWidg.3
@@ -35,7 +35,7 @@ Pointer to table specifying legal configuration options for this
widget.
.AP int argc in
Number of arguments in \fIargv\fR.
-.AP "CONST char" **argv in
+.AP "const char" **argv in
Command-line options for configuring widget.
.AP char *widgRec in/out
Points to widget record structure. Fields in this structure get
@@ -43,14 +43,14 @@ modified by \fBTk_ConfigureWidget\fR to hold configuration information.
.AP int flags in
If non-zero, then it specifies an OR-ed combination of flags that
control the processing of configuration information.
-TK_CONFIG_ARGV_ONLY causes the option database and defaults to be
-ignored, and flag bits TK_CONFIG_USER_BIT and higher are used to
+\fBTK_CONFIG_ARGV_ONLY\fR causes the option database and defaults to be
+ignored, and flag bits \fBTK_CONFIG_USER_BIT\fR and higher are used to
selectively disable entries in \fIspecs\fR.
.AP "type name" type in
The name of the type of a widget record.
.AP "field name" field in
The name of a field in records of type \fItype\fR.
-.AP "CONST char" *argvName in
+.AP "const char" *argvName in
The name used on Tcl command lines to refer to a particular option
(e.g. when creating a widget or invoking the \fBconfigure\fR widget
command). If non-NULL, then information is returned only for this
@@ -61,12 +61,10 @@ Display containing widget whose record is being freed; needed in
order to free up resources.
.BE
.SH DESCRIPTION
-.VS 8.1
.PP
-Note: \fBTk_ConfigureWidget\fP should be replaced with the new
-\fBTcl_Obj\fP based API \fBTk_SetOptions\fP. The old interface is
+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.
-.VE
.PP
\fBTk_ConfigureWidget\fR is called to configure various aspects of a
widget, such as colors, fonts, border width, etc.
@@ -87,10 +85,10 @@ a table specifying the configuration options that are supported
\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR).
It uses the option database and defaults specified in \fIspecs\fR
to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR.
-\fBTk_ConfigureWidget\fR normally returns the value TCL_OK; in this
+\fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this
case it does not modify \fIinterp\fR.
If an error
-occurs then TCL_ERROR is returned and \fBTk_ConfigureWidget\fR will
+occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will
leave an error message in \fIinterp->result\fR in the standard Tcl
fashion.
In the event of an error return, some of the fields of \fIwidgRec\fR
@@ -104,23 +102,26 @@ expected by the widget. Each of its entries specifies one configuration
option and has the following structure:
.CS
typedef struct {
- int \fItype\fR;
- char *\fIargvName\fR;
- char *\fIdbName\fR;
- char *\fIdbClass\fR;
- char *\fIdefValue\fR;
- int \fIoffset\fR;
- int \fIspecFlags\fR;
- Tk_CustomOption *\fIcustomPtr\fR;
+ int \fItype\fR;
+ char *\fIargvName\fR;
+ char *\fIdbName\fR;
+ char *\fIdbClass\fR;
+ char *\fIdefValue\fR;
+ int \fIoffset\fR;
+ int \fIspecFlags\fR;
+ Tk_CustomOption *\fIcustomPtr\fR;
} Tk_ConfigSpec;
.CE
The \fItype\fR field indicates what type of configuration option this is
-(e.g. TK_CONFIG_COLOR for a color value, or TK_CONFIG_INT for
+(e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for
an integer value). The \fItype\fR field indicates how to use the
value of the option (more on this below).
-The \fIargvName\fR field is a string such as ``\-font'' or ``\-bg'',
+The \fIargvName\fR field is a string such as
+.QW \-font
+or
+.QW \-bg ,
which is compared with the values in \fIargv\fR (if \fIargvName\fR is
-NULL it means this is a grouped entry; see GROUPED ENTRIES below). The
+NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The
\fIdbName\fR and \fIdbClass\fR fields are used to look up a value
for this option in the option database. The \fIdefValue\fR field
specifies a default value for this configuration option if no
@@ -130,7 +131,7 @@ about this option, and \fIspecFlags\fR contains additional information
to control the processing of this configuration option (see FLAGS
below).
The last field, \fIcustomPtr\fR, is only used if \fItype\fR is
-TK_CONFIG_CUSTOM; see CUSTOM OPTION TYPES below.
+\fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below.
.PP
\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which
(if any) configuration options are specified there. \fIArgv\fR
@@ -146,15 +147,15 @@ a value is found, then it is used as the value for the option.
Finally, if no entry is found in the option database, the
\fIdefValue\fR field of the \fIspecs\fR entry is used as the
value for the configuration option. If the \fIdefValue\fR is
-NULL, or if the TK_CONFIG_DONT_SET_DEFAULT bit is set in
+NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in
\fIflags\fR, then there is no default value and this \fIspecs\fR entry
will be ignored if no value is specified in \fIargv\fR or the
option database.
.PP
Once a string value has been determined for a configuration option,
\fBTk_ConfigureWidget\fR translates the string value into a more useful
-form, such as a color if \fItype\fR is TK_CONFIG_COLOR or an integer
-if \fItype\fR is TK_CONFIG_INT. This value is then stored in the
+form, such as a color if \fItype\fR is \fBTK_CONFIG_COLOR\fR or an integer
+if \fItype\fR is \fBTK_CONFIG_INT\fR. This value is then stored in the
record pointed to by \fIwidgRec\fR. This record is assumed to
contain information relevant to the manager of the widget; its exact
type is unknown to \fBTk_ConfigureWidget\fR. The \fIoffset\fR field
@@ -162,7 +163,8 @@ of each \fIspecs\fR entry indicates where in \fIwidgRec\fR to store
the information about this configuration option. You should use the
\fBTk_Offset\fR macro to generate \fIoffset\fR values (see below for
a description of \fBTk_Offset\fR). The location indicated by
-\fIwidgRec\fR and \fIoffset\fR will be referred to as the ``target''
+\fIwidgRec\fR and \fIoffset\fR will be referred to as the
+.QW target
in the descriptions below.
.PP
The \fItype\fR field of each entry in \fIspecs\fR determines what
@@ -177,11 +179,11 @@ The value is converted to a \fBTk_Cursor\fR by calling
\fBTk_GetCursor\fR and the result is stored in the target.
In addition, the resulting cursor is made the active cursor
for \fItkwin\fR by calling \fBXDefineCursor\fR.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target and \fItkwin\fR's
active cursor will be set to \fBNone\fR.
If the previous value of the target
-wasn't \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR.
+was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeCursor\fR.
.TP
\fBTK_CONFIG_ANCHOR\fR
The value must be an ASCII string identifying an anchor point in one of the ways
@@ -194,17 +196,27 @@ The value must be an ASCII string identifying a bitmap in a form
suitable for passing to \fBTk_GetBitmap\fR. The value is converted
to a \fBPixmap\fR by calling \fBTk_GetBitmap\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target is set to \fBNone\fR.
If the previous value of the target
-wasn't \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR.
+was not \fBNone\fR, then it is freed by passing it to \fBTk_FreeBitmap\fR.
.TP
\fBTK_CONFIG_BOOLEAN\fR
The value must be an ASCII string specifying a boolean value. Any
-of the values ``true'', ``yes'', ``on'', or ``1'',
+of the values
+.QW true ,
+.QW yes ,
+.QW on ,
+or
+.QW 1 ,
or an abbreviation of one of these values, means true;
-any of the values ``false'', ``no'', ``off'', or ``0'', or an abbreviation of
-one of these values, means false.
+any of the values
+.QW false ,
+.QW no ,
+.QW off ,
+or
+.QW 0 ,
+or an abbreviation of one of these values, means false.
The target is expected to be an integer; for true values it will
be set to 1 and for false values it will be set to 0.
.TP
@@ -213,10 +225,10 @@ The value must be an ASCII string identifying a border color in a form
suitable for passing to \fBTk_Get3DBorder\fR. The value is converted
to a (\fBTk_3DBorder *\fR) by calling \fBTk_Get3DBorder\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
If the previous value of the target
-wasn't NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR.
+was not NULL, then it is freed by passing it to \fBTk_Free3DBorder\fR.
.TP
\fBTK_CONFIG_CAP_STYLE\fR
The value must be
@@ -231,10 +243,10 @@ The value must be an ASCII string identifying a color in a form
suitable for passing to \fBTk_GetColor\fR. The value is converted
to an (\fBXColor *\fR) by calling \fBTk_GetColor\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to \fBNone\fR.
If the previous value of the target
-wasn't NULL, then it is freed by passing it to \fBTk_FreeColor\fR.
+was not NULL, then it is freed by passing it to \fBTk_FreeColor\fR.
.TP
\fBTK_CONFIG_CURSOR\fR
This option is identical to \fBTK_CONFIG_ACTIVE_CURSOR\fR except
@@ -244,7 +256,7 @@ that the new cursor is not made the active one for \fItkwin\fR.
This option allows applications to define new option types.
The \fIcustomPtr\fR field of the entry points to a structure
defining the new option type.
-See the section CUSTOM OPTION TYPES below for details.
+See the section \fBCUSTOM OPTION TYPES\fR below for details.
.TP
\fBTK_CONFIG_DOUBLE\fR
The value must be an ASCII floating-point number in
@@ -262,15 +274,18 @@ The value must be an ASCII string identifying a font in a form
suitable for passing to \fBTk_GetFont\fR. The value is converted
to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
If the previous value of the target
-wasn't NULL, then it is freed by passing it to \fBTk_FreeFont\fR.
+was not NULL, then it is freed by passing it to \fBTk_FreeFont\fR.
.TP
\fBTK_CONFIG_INT\fR
The value must be an ASCII integer string
-in the format accepted by \fBstrtol\fR (e.g. ``0''
-and ``0x'' prefixes may be used to specify octal or hexadecimal
+in the format accepted by \fBstrtol\fR (e.g.
+.QW 0
+and
+.QW 0x
+prefixes may be used to specify octal or hexadecimal
numbers, respectively). The string is converted to an integer
value and the integer is stored in the target.
.TP
@@ -310,29 +325,32 @@ is stored in the target.
\fBTK_CONFIG_STRING\fR
A copy
of the value is made by allocating memory space with
-\fBmalloc\fR and copying the value into the dynamically-allocated
+\fBTcl_Alloc\fR and copying the value into the dynamically-allocated
space. A pointer to the new string is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
-If the previous value of the target wasn't NULL, then it is
-freed by passing it to \fBfree\fR.
+If the previous value of the target was not NULL, then it is
+freed by passing it to \fBTcl_Free\fR.
.TP
\fBTK_CONFIG_SYNONYM\fR
This \fItype\fR value identifies special entries in \fIspecs\fR that
are synonyms for other entries. If an \fIargv\fR value matches the
-\fIargvName\fR of a TK_CONFIG_SYNONYM entry, the entry isn't used
+\fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used
directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR
for another entry whose \fIargvName\fR is the same as the \fIdbName\fR
-field in the TK_CONFIG_SYNONYM entry; this new entry is used just
+field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just
as if its \fIargvName\fR had matched the \fIargv\fR value. The
synonym mechanism allows multiple \fIargv\fR values to be used for
-a single configuration option, such as ``\-background'' and ``\-bg''.
+a single configuration option, such as
+.QW \-background
+and
+.QW \-bg .
.TP
\fBTK_CONFIG_UID\fR
The value is translated to a \fBTk_Uid\fR
(by passing it to \fBTk_GetUid\fR). The resulting value
is stored in the target.
-If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR and the value
+If \fBTK_CONFIG_NULL_OK\fR is specified in \fIspecFlags\fR and the value
is an empty string then the target will be set to NULL.
.TP
\fBTK_CONFIG_WINDOW\fR
@@ -344,8 +362,8 @@ The value must be a window path name. It is translated to a
In some cases it is useful to generate multiple resources from
a single configuration value. For example, a color name might
be used both to generate the background color for a widget (using
-TK_CONFIG_COLOR) and to generate a 3-D border to draw around the
-widget (using TK_CONFIG_BORDER). In cases like this it is possible
+\fBTK_CONFIG_COLOR\fR) and to generate a 3-D border to draw around the
+widget (using \fBTK_CONFIG_BORDER\fR). In cases like this it is possible
to specify that several consecutive entries in \fIspecs\fR are to
be treated as a group. The first entry is used to determine a value
(using its \fIargvName\fR, \fIdbName\fR,
@@ -366,11 +384,11 @@ options. These values are used in three different ways as
described below.
.PP
First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has
-the TK_CONFIG_ARGV_ONLY bit set (i.e., \fIflags\fR | TK_CONFIG_ARGV_ONLY != 0),
+the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0),
then the option database and
\fIdefValue\fR fields are not used. In this case, if an entry in
-\fIspecs\fR doesn't match a field in \fIargv\fR then nothing happens:
-the corresponding target isn't modified. This feature is useful
+\fIspecs\fR does not match a field in \fIargv\fR then nothing happens:
+the corresponding target is not modified. This feature is useful
when the goal is to modify certain configuration options while
leaving others in their current state, such as when a \fBconfigure\fR
widget command is being processed.
@@ -399,7 +417,7 @@ on the type of the target.
This flag is typically used to allow a
feature to be turned off entirely, e.g. set a cursor value to
\fBNone\fR so that a window simply inherits its parent's cursor.
-If this bit isn't set then empty strings are processed as strings,
+If this bit is not set then empty strings are processed as strings,
which generally results in an error.
.TP
\fBTK_CONFIG_DONT_SET_DEFAULT\fR
@@ -415,21 +433,23 @@ once, save the value, and provide it before calling
\fBTk_ConfigureWidget\fR.
.TP
\fBTK_CONFIG_OPTION_SPECIFIED\fR
-This bit is set and cleared by \fBTk_ConfigureWidget\fR. Whenever
-\fBTk_ConfigureWidget\fR returns, this bit will be set in all the
-entries where a value was specified in \fIargv\fR.
-It will be zero in all other entries.
-This bit provides a way for clients to determine which values
-actually changed in a call to \fBTk_ConfigureWidget\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 TK_CONFIG_MONO_ONLY and TK_CONFIG_COLOR_ONLY flags are typically
+The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically
used to specify different default values for
monochrome and color displays. This is done by creating two
entries in \fIspecs\fR that are identical except for their
\fIdefValue\fR and \fIspecFlags\fR fields. One entry should have
-the value TK_CONFIG_MONO_ONLY in its \fIspecFlags\fR and the
+the value \fBTK_CONFIG_MONO_ONLY\fR in its \fIspecFlags\fR and the
default value for monochrome displays in its \fIdefValue\fR; the
-other entry entry should have the value TK_CONFIG_COLOR_ONLY in
+other entry should have the value \fBTK_CONFIG_COLOR_ONLY\fR in
its \fIspecFlags\fR and the appropriate \fIdefValue\fR for
color displays.
.PP
@@ -441,7 +461,7 @@ a single \fIspecs\fR table to be created with all the configuration
options for all the widget types. When processing a particular
widget type, only entries relevant to that type will be used. This
effect is achieved by setting the high-order bits (those in positions
-equal to or greater than TK_CONFIG_USER_BIT) in \fIspecFlags\fR
+equal to or greater than \fBTK_CONFIG_USER_BIT\fR) in \fIspecFlags\fR
values or in \fIflags\fR. In order for a particular entry in
\fIspecs\fR to be used, its high-order bits must match exactly
the high-order bits of the \fIflags\fR value passed to
@@ -473,7 +493,7 @@ 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
-it returns TCL_OK; if an error occurs then it returns TCL_ERROR
+it returns \fBTCL_OK\fR; if an error occurs then it returns \fBTCL_ERROR\fR
and \fIinterp->result\fR contains an error message.
.PP
If \fIargvName\fR is NULL, then the value left in
@@ -481,7 +501,7 @@ If \fIargvName\fR is NULL, then the value left in
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
-corresponding entry in \fIspecs\fR has type TK_CONFIG_SYNONYM, then
+corresponding entry in \fIspecs\fR has type \fBTK_CONFIG_SYNONYM\fR, then
the list will contain two values: the \fIargvName\fR for the entry
and the \fIdbName\fR (synonym name). Otherwise the list will contain
five values: \fIargvName\fR, \fIdbName\fR, \fIdbClass\fR, \fIdefValue\fR,
@@ -503,10 +523,10 @@ the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR.
\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 TCL_OK is
+The value is returned in \fIinterp->result\fR 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), TCL_ERROR is returned and an error message
+not a valid option name), \fBTCL_ERROR\fR is returned and an error message
is left in \fIinterp->result\fR.
This procedure is typically called to implement \fBcget\fR widget
commands.
@@ -517,8 +537,8 @@ The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup
to release all of the resources associated with configuration options.
It scans through \fIspecs\fR and for each entry corresponding to a
resource that must be explicitly freed (e.g. those with
-type TK_CONFIG_COLOR), it frees the resource in the widget record.
-If the field in the widget record doesn't refer to a resource (e.g.
+type \fBTK_CONFIG_COLOR\fR), it frees the resource in the widget record.
+If the field in the widget record does not refer to a resource (e.g.
it contains a null pointer) then no resource is freed for that
entry.
After freeing a resource, \fBTk_FreeOptions\fR sets the
@@ -531,25 +551,25 @@ configuration types by writing procedures to parse and print options
of the a type and creating a structure pointing to those procedures:
.CS
typedef struct Tk_CustomOption {
- Tk_OptionParseProc *\fIparseProc\fR;
- Tk_OptionPrintProc *\fIprintProc\fR;
- ClientData \fIclientData\fR;
+ Tk_OptionParseProc *\fIparseProc\fR;
+ Tk_OptionPrintProc *\fIprintProc\fR;
+ ClientData \fIclientData\fR;
} Tk_CustomOption;
typedef int Tk_OptionParseProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- Tk_Window \fItkwin\fR,
- char *\fIvalue\fR,
- char *\fIwidgRec\fR,
- int \fIoffset\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);
+ 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
@@ -577,8 +597,8 @@ The last argument, \fIoffset\fR, gives the offset in bytes from the start
of the widget record to the location where the option value is to
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 TCL_OK, but if an error occurs
-in translating the string to a value then it should return TCL_ERROR
+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.
.PP
The \fIprintProc\fR procedure is called
@@ -600,7 +620,7 @@ need not do anything with the \fIfreeProcPtr\fR argument.
Once \fIparseProc\fR and \fIprintProc\fR have been defined and a
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 TK_CONFIG_CUSTOM and whose \fIcustomPtr\fR fields point
+fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point
to the Tk_CustomOption structure.
.SH EXAMPLES
diff --git a/doc/ConfigWind.3 b/doc/ConfigWind.3
index 7d77902..f19512a 100644
--- a/doc/ConfigWind.3
+++ b/doc/ConfigWind.3
@@ -79,7 +79,6 @@ New cursor to use for \fItkwin\fR. If \fBNone\fR is specified, then
\fItkwin\fR will not have its own cursor; it will use the cursor
of its parent.
.BE
-
.SH DESCRIPTION
.PP
These procedures are analogous to the X library procedures
@@ -125,9 +124,8 @@ To change the stacking order, use the procedure \fBTk_RestackWindow\fR.
The procedure \fBTk_SetWindowColormap\fR will automatically add
\fItkwin\fR to the \fBTK_COLORMAP_WINDOWS\fR property of its
nearest top-level ancestor if the new colormap is different from
-that of \fItkwin\fR's parent and \fItkwin\fR isn't already in
+that of \fItkwin\fR's parent and \fItkwin\fR is not already in
the \fBTK_COLORMAP_WINDOWS\fR property.
-
.SH BUGS
.PP
\fBTk_SetWindowBackgroundPixmap\fR and \fBTk_SetWindowBorderPixmap\fR
@@ -143,9 +141,7 @@ and \fIpixmap\fR has been passed to the X server.
A similar problem occurs for the \fIcursor\fR argument passed to
\fBTk_DefineCursor\fR. The solution is the same as for pixmaps above:
call \fBTk_MakeWindowExist\fR before freeing the cursor.
-
.SH "SEE ALSO"
Tk_MoveToplevelWindow, Tk_RestackWindow
-
.SH KEYWORDS
attributes, border, color, configure, height, pixel, pixmap, width, window, x, y
diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3
index 21bc386..f8c72e5 100644
--- a/doc/CrtCmHdlr.3
+++ b/doc/CrtCmHdlr.3
@@ -25,7 +25,7 @@ Procedure to invoke whenever a ClientMessage X event occurs on any display.
.PP
\fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked
-in the future whenever a ClientMessage X event occurs that isn't handled by
+in the future whenever a ClientMessage X event occurs that is not handled by
\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
by applications which need to watch X ClientMessage events, such as drag and
drop applications.
@@ -40,14 +40,14 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
type \fBTk_ClientMessageProc\fR:
.CS
typedef int Tk_ClientMessageProc(
- Tk_Window \fItkwin\fR,
- XEvent *\fIeventPtr\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.
.PP
Whenever an X ClientMessage event is processed by \fBTk_HandleEvent\fR,
-the \fIproc\fR is called if it wasn't handled as a \fBWM_PROTOCOL\fR.
+the \fIproc\fR is called if it was not handled as a \fBWM_PROTOCOL\fR.
The return value from \fIproc\fR is normally 0.
A non-zero return value indicates that the event is not to be handled
further; that is, \fIproc\fR has done all processing that is to be
diff --git a/doc/CrtConsoleChan.3 b/doc/CrtConsoleChan.3
new file mode 100644
index 0000000..65feab7
--- /dev/null
+++ b/doc/CrtConsoleChan.3
@@ -0,0 +1,44 @@
+'\"
+'\" Copyright (c) 2007 ActiveState Software Inc.
+'\"
+'\" 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_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_InitConsoleChannels \- Install the console channels as standard channels
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+\fBTk_InitConsoleChannels\fR(\fIinterp\fR)
+.SH ARGUMENTS
+.AS Tcl_Interp *interp in
+.AP Tcl_Interp *interp in
+Interpreter in which the console channels are created.
+.BE
+.SH DESCRIPTION
+.PP
+\fBTk_InitConsoleChannels\fR is invoked to create a set of console
+channels and install them as the standard channels. All I/O on these
+channels will be discarded until \fBTk_CreateConsoleWindow\fR is
+called to attach the console to a text widget.
+.PP
+This function is for use by shell applications based on Tk, like
+\fBwish\fR, on platforms which have no standard channels in graphical
+mode, like Win32.
+.PP
+The \fIinterp\fR argument is the interpreter in which to create and
+install the console channels.
+.PP
+\fBNOTE:\fR If this function is used it has to be called before the
+first call to \fBTcl_RegisterChannel\fR, directly, or indirectly
+through other channel functions. Because otherwise the standard
+channels will be already initialized to the system defaults, which will
+be nonsensical for the case \fBTk_InitConsoleChannels\fR is for.
+.SH "SEE ALSO"
+console(n)
+.SH KEYWORDS
+standard channels, console
diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3
index f123211..a75414e 100644
--- a/doc/CrtErrHdlr.3
+++ b/doc/CrtErrHdlr.3
@@ -24,13 +24,13 @@ Tk_ErrorHandler
Display whose errors are to be handled.
.AP int error in
Match only error events with this value in the \fIerror_code\fR
-field. If -1, then match any \fIerror_code\fR value.
+field. If \-1, then match any \fIerror_code\fR value.
.AP int request in
Match only error events with this value in the \fIrequest_code\fR
-field. If -1, then match any \fIrequest_code\fR value.
+field. If \-1, then match any \fIrequest_code\fR value.
.AP int minor in
Match only error events with this value in the \fIminor_code\fR
-field. If -1, then match any \fIminor_code\fR value.
+field. If \-1, then match any \fIminor_code\fR value.
.AP Tk_ErrorProc *proc in
Procedure to invoke whenever an error event is received for
\fIdisplay\fR and matches \fIerror\fR, \fIrequest\fR, and \fIminor\fR.
@@ -41,14 +41,13 @@ Arbitrary one-word value to pass to \fIproc\fR.
Token for error handler to delete (return value from a previous
call to \fBTk_CreateErrorHandler\fR).
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreateErrorHandler\fR arranges for a particular procedure
(\fIproc\fR) to be called whenever certain protocol errors occur on a
particular display (\fIdisplay\fR). Protocol errors occur when
the X protocol is used incorrectly, such as attempting to map a window
-that doesn't exist. See the Xlib documentation for \fBXSetErrorHandler\fR
+that does not exist. See the Xlib documentation for \fBXSetErrorHandler\fR
for more information on the kinds of errors that can occur.
For \fIproc\fR to be invoked
to handle a particular error, five things must occur:
@@ -56,15 +55,15 @@ to handle a particular error, five things must occur:
The error must pertain to \fIdisplay\fR.
.IP [2]
Either the \fIerror\fR argument to \fBTk_CreateErrorHandler\fR
-must have been -1, or the \fIerror\fR argument must match
+must have been \-1, or the \fIerror\fR argument must match
the \fIerror_code\fR field from the error event.
.IP [3]
Either the \fIrequest\fR argument to \fBTk_CreateErrorHandler\fR
-must have been -1, or the \fIrequest\fR argument must match
+must have been \-1, or the \fIrequest\fR argument must match
the \fIrequest_code\fR field from the error event.
.IP [4]
Either the \fIminor\fR argument to \fBTk_CreateErrorHandler\fR
-must have been -1, or the \fIminor\fR argument must match
+must have been \-1, or the \fIminor\fR argument must match
the \fIminor_code\fR field from the error event.
.IP [5]
The protocol request to which the error pertains must have been
@@ -74,8 +73,8 @@ made when the handler was active (see below for more information).
following type:
.CS
typedef int Tk_ErrorProc(
- ClientData \fIclientData\fR,
- XErrorEvent *\fIerrEventPtr\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
@@ -96,14 +95,13 @@ If more than more than one handler matches a particular error, then
they are invoked in turn. The handlers will be invoked in reverse
order of creation: most recently declared handler first.
If any handler returns 0, then subsequent (older) handlers will
-not be invoked. If no handler returns 0, then Tk invokes X'es
+not be invoked. If no handler returns 0, then Tk invokes X's
default error handler, which prints an error message and aborts the
program. If you wish to have a default handler that deals with errors
that no other handler can deal with, then declare it first.
.PP
-The X documentation states that ``the error handler should not call
-any functions (directly or indirectly) on the display that will
-generate protocol requests or that will look for input events.''
+The X documentation states that
+.QW "the error handler should not call any functions (directly or indirectly) on the display that will generate protocol requests or that will look for input events."
This restriction applies to handlers declared by \fBTk_CreateErrorHandler\fR;
disobey it at your own risk.
.PP
diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3
index 702ac30..a1bc637 100644
--- a/doc/CrtGenHdlr.3
+++ b/doc/CrtGenHdlr.3
@@ -46,8 +46,8 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
type \fBTk_GenericProc\fR:
.CS
typedef int Tk_GenericProc(
- ClientData \fIclientData\fR,
- XEvent *\fIeventPtr\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 65061b3..da083e0 100644
--- a/doc/CrtImgType.3
+++ b/doc/CrtImgType.3
@@ -6,7 +6,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH Tk_CreateImageType 3 8.3 Tk "Tk Library Procedures"
+.TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind of image
@@ -16,7 +16,6 @@ Tk_CreateImageType, Tk_GetImageMasterData, Tk_InitImageArgs \- define new kind o
.sp
\fBTk_CreateImageType\fR(\fItypePtr\fR)
.sp
-.VS
ClientData
\fBTk_GetImageMasterData\fR(\fIinterp, name, typePtrPtr\fR)
.sp
@@ -29,7 +28,7 @@ Must be static: a
pointer to this structure is retained by the image code.
.AP Tcl_Interp *interp in
Interpreter in which image was created.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name of existing image.
.AP Tk_ImageType **typePtrPtr out
Points to word in which to store a pointer to type information for
@@ -38,7 +37,6 @@ the given image, if it exists.
Number of arguments
.AP char ***argvPtr in/out
Pointer to argument list
-.VE
.BE
.SH DESCRIPTION
@@ -61,12 +59,12 @@ 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;
- Tk_ImageCreateProc *\fIcreateProc\fR;
- Tk_ImageGetProc *\fIgetProc\fR;
- Tk_ImageDisplayProc *\fIdisplayProc\fR;
- Tk_ImageFreeProc *\fIfreeProc\fR;
- Tk_ImageDeleteProc *\fIdeleteProc\fR;
+ 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;
.CE
The fields of this structure will be described in later subsections
@@ -95,7 +93,7 @@ option specified for a widget or canvas item.
The following subsections describe the fields of a Tk_ImageType
in more detail.
-.SH NAME
+.SS NAME
.PP
\fItypePtr->name\fR provides a name for the image type.
Once \fBTk_CreateImageType\fR returns, this name may be used
@@ -104,30 +102,20 @@ type.
If there already existed an image type by this name then
the new image type replaces the old one.
-.SH PORTABILITY
-.PP
-In Tk 8.2 and earlier, the createProc below had a different
-signature. If you want to compile an image type using the
-old interface which should still run on all Tcl/Tk versions,
-compile it with the flag -DUSE_OLD_IMAGE. Further on, if
-you are using Stubs, you need to call the function
-Tk_InitImageArgs(interp, argc, &argv) first in your
-createProc. See below for a description of this function.
-
-.SH CREATEPROC
+.SS CREATEPROC
\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);
+ 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);
.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,
@@ -148,21 +136,21 @@ Typically the value is a pointer to the master data
structure for the image.
.PP
If \fIcreateProc\fR encounters an error, it should leave an error
-message in \fIinterp->result\fR and return \fBTCL_ERROR\fR; otherwise
+message in the interpreter result and return \fBTCL_ERROR\fR; otherwise
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.
-.SH GETPROC
+.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);
+ 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
@@ -175,22 +163,22 @@ 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.
-.SH DISPLAYPROC
+.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);
+ 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.
@@ -208,7 +196,7 @@ 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.
-.SH FREEPROC
+.SS FREEPROC
.PP
\fItypePtr->freeProc\fR contains the address of a procedure that
Tk will invoke when an image instance is released (i.e., when
@@ -219,8 +207,8 @@ canvas item is changed.
\fIfreeProc\fR must match the following prototype:
.CS
typedef void Tk_ImageFreeProc(
- ClientData \fIinstanceData\fR,
- Display *\fIdisplay\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
@@ -228,7 +216,7 @@ 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.
-.SH DELETEPROC
+.SS DELETEPROC
.PP
\fItypePtr->deleteProc\fR is a procedure that Tk invokes when an
image is being deleted (i.e. when the \fBimage delete\fR command
@@ -238,7 +226,7 @@ each of the image's instances.
\fIdeleteProc\fR must match the following prototype:
.CS
typedef void Tk_ImageDeleteProc(
- ClientData \fImasterData\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
@@ -247,7 +235,6 @@ image was created.
the image.
.SH TK_GETIMAGEMASTERDATA
-.VS
.PP
The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve
information about an image. For example, an image manager can use this
@@ -260,19 +247,42 @@ 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.
-.VE
-.SH TK_INITIMAGEARGS
-.VS
+.SH "LEGACY INTERFACE SUPPORT"
+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);
+.CE
+Legacy programs and libraries dating from those days may still
+contain code that defines extended Tk image types using the old
+interface. The Tk header file will still support this legacy
+interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR
+defined.
+.PP
+When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may
+see the routine \fBTk_InitImageArgs\fR in use. This was a migration
+tool used to create stub-enabled extensions that could be loaded
+into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer
+provides this routine, but uses a macro to convert any attempted
+calls of this routine into an empty comment. Any stub-enabled
+extension providing an extended image type via the legacy interface
+that is compiled against Tk 8.5 headers and linked against the
+Tk 8.5 stub library will produce a file that can be loaded only
+into interps with Tk 8.5 or later; that is, the normal stub-compatibility
+rules. If a developer needs to generate from such code a file
+that is loadable into interps with Tk 8.4 or earlier, they must
+use Tk 8.4 headers and stub libraries to do so.
.PP
-The function \fBTk_InitImageArgs\fR converts the arguments of the
-\fBcreateProc\fR from objects to strings when necessary. When
-not using stubs, not using the old interface, or running
-under an older (pre-8.3) Tk version, this function has no
-effect. This function makes porting older image handlers to
-the new interface a lot easier: After running this function,
-the arguments are guaranteed to be in string format, no
-matter how Tk deliverd them.
+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
diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3
index f035bc2..4f06438 100644
--- a/doc/CrtItemType.3
+++ b/doc/CrtItemType.3
@@ -22,7 +22,6 @@ Tk_ItemType *
.AP Tk_ItemType *typePtr in
Structure that defines the new type of canvas item.
.BE
-
.SH INTRODUCTION
.PP
\fBTk_CreateItemType\fR is invoked to define a new kind of canvas item
@@ -52,7 +51,6 @@ for an existing type and modify it for the new type.
Tk provides a number of utility procedures for the use of canvas
type managers, such as \fBTk_CanvasCoords\fR and \fBTk_CanvasPsColor\fR;
these are described in separate manual entries.
-
.SH "DATA STRUCTURES"
.PP
A type manager consists of a collection of procedures that provide a
@@ -64,26 +62,26 @@ information such as the name of the type and pointers to
the standard procedures implemented by the type manager:
.CS
typedef struct Tk_ItemType {
- char *\fIname\fR;
- int \fIitemSize\fR;
- Tk_ItemCreateProc *\fIcreateProc\fR;
- Tk_ConfigSpec *\fIconfigSpecs\fR;
- Tk_ItemConfigureProc *\fIconfigProc\fR;
- Tk_ItemCoordProc *\fIcoordProc\fR;
- Tk_ItemDeleteProc *\fIdeleteProc\fR;
- Tk_ItemDisplayProc *\fIdisplayProc\fR;
- int \fIalwaysRedraw\fR;
- Tk_ItemPointProc *\fIpointProc\fR;
- Tk_ItemAreaProc *\fIareaProc\fR;
- Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
- Tk_ItemScaleProc *\fIscaleProc\fR;
- Tk_ItemTranslateProc *\fItranslateProc\fR;
- Tk_ItemIndexProc *\fIindexProc\fR;
- Tk_ItemCursorProc *\fIicursorProc\fR;
- Tk_ItemSelectionProc *\fIselectionProc\fR;
- Tk_ItemInsertProc *\fIinsertProc\fR;
- Tk_ItemDCharsProc *\fIdCharsProc\fR;
- Tk_ItemType *\fInextPtr\fR;
+ char *\fIname\fR;
+ int \fIitemSize\fR;
+ Tk_ItemCreateProc *\fIcreateProc\fR;
+ Tk_ConfigSpec *\fIconfigSpecs\fR;
+ Tk_ItemConfigureProc *\fIconfigProc\fR;
+ Tk_ItemCoordProc *\fIcoordProc\fR;
+ Tk_ItemDeleteProc *\fIdeleteProc\fR;
+ Tk_ItemDisplayProc *\fIdisplayProc\fR;
+ int \fIalwaysRedraw\fR;
+ Tk_ItemPointProc *\fIpointProc\fR;
+ Tk_ItemAreaProc *\fIareaProc\fR;
+ Tk_ItemPostscriptProc *\fIpostscriptProc\fR;
+ Tk_ItemScaleProc *\fIscaleProc\fR;
+ Tk_ItemTranslateProc *\fItranslateProc\fR;
+ Tk_ItemIndexProc *\fIindexProc\fR;
+ Tk_ItemCursorProc *\fIicursorProc\fR;
+ Tk_ItemSelectionProc *\fIselectionProc\fR;
+ Tk_ItemInsertProc *\fIinsertProc\fR;
+ Tk_ItemDCharsProc *\fIdCharsProc\fR;
+ Tk_ItemType *\fInextPtr\fR;
} Tk_ItemType;
.CE
.PP
@@ -111,13 +109,13 @@ the first field.
For example, the item record for bitmap items is defined as follows:
.CS
typedef struct BitmapItem {
- Tk_Item \fIheader\fR;
- double \fIx\fR, \fIy\fR;
- Tk_Anchor \fIanchor\fR;
- Pixmap \fIbitmap\fR;
- XColor *\fIfgColor\fR;
- XColor *\fIbgColor\fR;
- GC \fIgc\fR;
+ Tk_Item \fIheader\fR;
+ double \fIx\fR, \fIy\fR;
+ Tk_Anchor \fIanchor\fR;
+ Pixmap \fIbitmap\fR;
+ XColor *\fIfgColor\fR;
+ XColor *\fIbgColor\fR;
+ GC \fIgc\fR;
} BitmapItem;
.CE
The \fIheader\fR substructure contains information used by Tk
@@ -152,8 +150,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 NAME
+.SS NAME
.PP
This section and the ones that follow describe each of the fields
in a Tk_ItemType structure in detail.
@@ -163,8 +160,7 @@ 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.
-
-.SH ITEMSIZE
+.SS ITEMSIZE
\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.
@@ -172,19 +168,18 @@ All of the item records for a given type must have the same size.
If variable length fields are needed for an item (such as a list
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.
-
-.SH CREATEPROC
+.SS CREATEPROC
.PP
\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:
.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);
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIobjc\fR,
+ Tcl_Obj* const \fIobjv\fR[]);
.CE
The \fIinterp\fR argument is the interpreter in which the canvas's
\fBcreate\fR widget command was invoked, and \fIcanvas\fR is a
@@ -212,8 +207,7 @@ 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
the item).
-
-.SH CONFIGSPECS
+.SS CONFIGSPECS
.PP
Each type manager must provide a standard table describing its
configuration options, in a form suitable for use with
@@ -227,8 +221,7 @@ for this type.
Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR
for implementing the \fB\-tags\fR option; see an existing type
manager for an example of how to use it in \fIconfigSpecs\fR.
-
-.SH CONFIGPROC
+.SS CONFIGPROC
.PP
\fItypePtr->configProc\fR is called by Tk whenever the
\fBitemconfigure\fR widget command is invoked to change the
@@ -236,12 +229,12 @@ configuration options for a canvas item.
This procedure must match the following prototype:
.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);
+ 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
@@ -255,7 +248,7 @@ example, if the following command is invoked:
through \fBblack\fR.
\fIobjc\fR will always be an even value.
The \fIflags\fR argument contains flags to pass to \fBTk_ConfigureWidget\fR;
-currently this value is always TK_CONFIG_ARGV_ONLY when Tk
+currently this value is always \fBTK_CONFIG_ARGV_ONLY\fR when Tk
invokes \fItypePtr->configProc\fR, but the type manager's \fIcreateProc\fR
procedure will usually invoke \fIconfigProc\fR with different flag values.
.PP
@@ -263,19 +256,18 @@ procedure will usually invoke \fIconfigProc\fR with different flag values.
leaves an error message in \fIinterp->result\fR if an error occurs.
It must update the item's bounding box to reflect the new configuration
options.
-
-.SH COORDPROC
+.SS COORDPROC
.PP
\fItypePtr->coordProc\fR is invoked by Tk to implement the \fBcoords\fR
widget command for an item.
It must match the following prototype:
.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);
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIobjc\fR,
+ Tcl_Obj* const \fIobjv\fR[]);
.CE
The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR
all have the standard meanings, and \fIobjc\fR and \fIobjv\fR
@@ -293,17 +285,16 @@ 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.
-
-.SH DELETEPROC
+.SS DELETEPROC
.PP
\fItypePtr->deleteProc\fR is invoked by Tk to delete an item
and free any resources allocated to it.
It must match the following prototype:
.CS
typedef void Tk_ItemDeleteProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- Display *\fIdisplay\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ Display *\fIdisplay\fR);
.CE
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual
interpretations, and \fIdisplay\fR identifies the X display containing
@@ -312,22 +303,21 @@ the canvas.
so that Tk can free the item record.
\fIdeleteProc\fR should not actually free the item record; this will
be done by Tk when \fIdeleteProc\fR returns.
-
-.SH "DISPLAYPROC AND ALWAYSREDRAW"
+.SS "DISPLAYPROC AND ALWAYSREDRAW"
.PP
\fItypePtr->displayProc\fR is invoked by Tk to redraw an item
on the screen.
It must match the following prototype:
.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);
+ 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
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIdisplay\fR identifies the display containing the canvas, and
@@ -352,12 +342,11 @@ 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 doesn't overlap the area of redisplay.
+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.
-
-.SH POINTPROC
+.SS POINTPROC
.PP
\fItypePtr->pointProc\fR is invoked by Tk to find out how close
a given point is to a canvas item.
@@ -366,9 +355,9 @@ under the mouse or finding the closest item to a given point.
The procedure must match the following prototype:
.CS
typedef double Tk_ItemPointProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double *\fIpointPtr\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double *\fIpointPtr\fR);
.CE
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIpointPtr\fR points to an array of two numbers giving
@@ -376,17 +365,16 @@ the x and y coordinates of a point.
\fIpointProc\fR must return a real value giving the distance
from the point to the item, or 0 if the point lies inside
the item.
-
-.SH AREAPROC
+.SS AREAPROC
.PP
\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:
.CS
typedef int Tk_ItemAreaProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double *\fIrectPtr\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double *\fIrectPtr\fR);
.CE
\fIcanvas\fR and \fIitemPtr\fR have the usual meaning.
\fIrectPtr\fR points to an array of four real numbers;
@@ -396,30 +384,29 @@ coordinates of the lower right corner.
\fIareaProc\fR must return \-1 if the item lies entirely outside
the given area, 0 if it lies partially inside and partially
outside the area, and 1 if it lies entirely inside the area.
-
-.SH POSTSCRIPTPROC
+.SS POSTSCRIPTPROC
.PP
\fItypePtr->postscriptProc\fR is invoked by Tk to generate
-Postcript for an item during the \fBpostscript\fR widget command.
+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.
The procedure must match the following prototype:
.CS
typedef int Tk_ItemPostscriptProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIprepass\fR);
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIprepass\fR);
.CE
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have
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
(e.g. by calling \fBTcl_AppendResult\fR, not \fBTcl_SetResult\fR)
-and return TCL_OK.
+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
-return TCL_ERROR.
+return \fBTCL_ERROR\fR.
.PP
Tk provides a collection of utility procedures to simplify
\fIpostscriptProc\fR.
@@ -447,19 +434,18 @@ 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.
-
-.SH SCALEPROC
+.SS SCALEPROC
\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:
.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);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double \fIoriginX\fR,
+ double \fIoriginY\fR,
+ double \fIscaleX\fR,
+ double \fIscaleY\fR);
.CE
The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning.
\fIoriginX\fR and \fIoriginY\fR specify an origin relative to which
@@ -467,32 +453,30 @@ the item is to be scaled, and \fIscaleX\fR and \fIscaleY\fR give the
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'\fR and \fIy'\fR, where
+coordinates \fIx\(fm\fR and \fIy\(fm\fR, where
.CS
-\fIx' = originX + scaleX*(x-originX)
-y' = originY + scaleY*(y-originY)\fR
+\fIx\(fm = originX + scaleX*(x-originX)
+y\(fm = originY + scaleY*(y-originY)\fR
.CE
\fIscaleProc\fR must also update the bounding box in the item's
header.
-
-.SH TRANSLATEPROC
+.SS TRANSLATEPROC
\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:
.CS
typedef void Tk_ItemTranslateProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- double \fIdeltaX\fR,
- double \fIdeltaY\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ double \fIdeltaX\fR,
+ double \fIdeltaY\fR);
.CE
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.
-
-.SH INDEXPROC
+.SS INDEXPROC
\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.
@@ -502,11 +486,11 @@ item types.
The procedure must match the following prototype:
.CS
typedef int Tk_ItemIndexProc(
- Tcl_Interp *\fIinterp\fR,
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- char \fIindexString\fR,
- int *\fIindexPtr\fR);
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ char \fIindexString\fR,
+ int *\fIindexPtr\fR);
.CE
The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all
have the usual meaning.
@@ -518,21 +502,20 @@ 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.
-
-.SH ICURSORPROC
+.SS ICURSORPROC
.PP
\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
-that don't support an insertion cursor.
+that do not support an insertion cursor.
The procedure must match the following prototype:
.CS
typedef void Tk_ItemCursorProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIindex\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIindex\fR);
.CE
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and
\fIindex\fR is an index into the item's text, as returned by a
@@ -541,8 +524,7 @@ 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.
-
-.SH SELECTIONPROC
+.SS SELECTIONPROC
.PP
\fItypePtr->selectionProc\fR is invoked by Tk during selection
retrievals; it must return part or all of the selected text in
@@ -553,11 +535,11 @@ item types.
The procedure must match the following prototype:
.CS
typedef int Tk_ItemSelectionProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIoffset\fR,
- char *\fIbuffer\fR,
- int \fImaxBytes\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIoffset\fR,
+ char *\fIbuffer\fR,
+ int \fImaxBytes\fR);
.CE
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIoffset\fR is an offset in bytes into the selection where 0 refers
@@ -569,10 +551,9 @@ of bytes to return.
\fIselectionProc\fR should extract up to \fImaxBytes\fR characters
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 aren't \fIoffset+maxBytes\fR bytes
+be less than \fImaxBytes\fR if there are not \fIoffset+maxBytes\fR bytes
in the selection.
-
-.SH INSERTPROC
+.SS INSERTPROC
.PP
\fItypePtr->insertProc\fR is invoked by Tk during
the \fBinsert\fR widget command to insert new text into a
@@ -583,10 +564,10 @@ item types.
The procedure must match the following prototype:
.CS
typedef void Tk_ItemInsertProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIindex\fR,
- char *\fIstring\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIindex\fR,
+ char *\fIstring\fR);
.CE
\fIcanvas\fR and \fIitemPtr\fR have the usual meanings.
\fIindex\fR is an index into the item's text, as returned by a
@@ -595,8 +576,7 @@ contains new text to insert just before the character given
by \fIindex\fR.
The type manager should insert the text and recompute the bounding
box in the item's header.
-
-.SH DCHARSPROC
+.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.
@@ -606,19 +586,17 @@ item types.
The procedure must match the following prototype:
.CS
typedef void Tk_ItemDCharsProc(
- Tk_Canvas \fIcanvas\fR,
- Tk_Item *\fIitemPtr\fR,
- int \fIfirst\fR,
- int \fIlast\fR);
+ Tk_Canvas \fIcanvas\fR,
+ Tk_Item *\fIitemPtr\fR,
+ int \fIfirst\fR,
+ int \fIlast\fR);
.CE
\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.
The type manager should delete the specified characters and update
the bounding box in the item's header.
-
.SH "SEE ALSO"
Tk_CanvasPsY, Tk_CanvasTextInfo, Tk_CanvasTkwin
-
.SH KEYWORDS
canvas, focus, item type, selection, type manager
diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3
index fa50d86..0575d40 100644
--- a/doc/CrtPhImgFmt.3
+++ b/doc/CrtPhImgFmt.3
@@ -10,7 +10,7 @@
'\" Australian National University.
'\"
.so man.macros
-.TH Tk_CreatePhotoImageFormat 3 8.3 Tk "Tk Library Procedures"
+.TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_CreatePhotoImageFormat \- define new file format for photo images
@@ -46,13 +46,13 @@ 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;
- Tk_ImageFileMatchProc *\fIfileMatchProc\fR;
- Tk_ImageStringMatchProc *\fIstringMatchProc\fR;
- Tk_ImageFileReadProc *\fIfileReadProc\fR;
- Tk_ImageStringReadProc *\fIstringReadProc\fR;
- Tk_ImageFileWriteProc *\fIfileWriteProc\fR;
- Tk_ImageStringWriteProc *\fIstringWriteProc\fR;
+ 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;
.CE
.PP
@@ -66,14 +66,6 @@ structure should be set to NULL. The handler must provide the
procedure, and the \fIstringMatchProc\fR procedure if it provides the
\fIstringReadProc\fR procedure.
-.SH PORTABILITY
-.PP
-In Tk 8.2 and earlier, a different interface was used. Tk 8.3 will
-still support the old format handlers if the format name is in upper
-case. If you still want to compile old format handlers with Tk8.3,
-use the flag -DUSE_OLD_IMAGE. This will restore all function prototypes
-to match the pre-8.3 situation.
-
.SH NAME
.PP
\fIformatPtr->name\fR provides a name for the image type.
@@ -81,9 +73,10 @@ Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used
in the \fB\-format\fR photo image configuration and subcommand option.
The manual page for the photo image (photo(n)) describes how image
file formats are chosen based on their names and the value given to
-the \fB\-format\fR option. For new format handlers, the name should
-be in lower case. Pre-8.3 format handlers are assumed to be in
-upper case.
+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
\fIformatPtr->fileMatchProc\fR provides the address of a procedure for
@@ -92,12 +85,12 @@ 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);
+ 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
@@ -115,11 +108,11 @@ 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);
+ 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
@@ -136,14 +129,14 @@ 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);
+ 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.
@@ -165,13 +158,13 @@ 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);
+ 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.
@@ -193,10 +186,10 @@ 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);
+ 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.
@@ -218,9 +211,9 @@ 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);
+ 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.
@@ -236,6 +229,44 @@ after the name of the format. If appropriate, the
characters to specify further details about the image file.
The return value is a standard Tcl return value.
+.SH "LEGACY INTERFACE SUPPORT"
+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
+those days may still contain code that defines extended Tk photo image
+formats using the old interface. The Tk header file will still support
+this legacy interface if the code is compiled with the
+macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces
+are used if the first character of \fIformatPtr->name\fR is an
+uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts
+are used to forgive the type mismatch. For example,
+.CS
+static Tk_PhotoImageFormat myFormat = {
+ "MyFormat",
+ (Tk_ImageFileMatchProc *) FileMatch,
+ NULL,
+ (Tk_ImageFileReadProc *) FileRead,
+ NULL,
+ NULL,
+ NULL
+};
+.CE
+would define a minimal \fBTk_PhotoImageFormat\fR that operates provide
+only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR
+are written according to the legacy interfaces of Tk 8.2 or earlier.
+.PP
+Any stub-enabled extension providing an extended photo image format
+via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro
+that is compiled against Tk 8.5 headers and linked against the
+Tk 8.5 stub library will produce a file that can be loaded only
+into interps with Tk 8.5 or later; that is, the normal stub-compatibility
+rules. If a developer needs to generate from such code a file
+that is loadable into interps with Tk 8.4 or earlier, they must
+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
diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3
index 5a5c48b..c081c71 100644
--- a/doc/CrtSelHdlr.3
+++ b/doc/CrtSelHdlr.3
@@ -35,11 +35,10 @@ and the selection contents are requested in the format given by
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.AP Atom format in
-If the selection requestor isn't in this process, \fIformat\fR determines
+If the selection requestor is not in this process, \fIformat\fR determines
the representation used to transmit the selection to its
requestor.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_CreateSelHandler\fR arranges for a particular procedure
@@ -56,10 +55,10 @@ the selection. The most common form is STRING.
type \fBTk_SelectionProc\fR:
.CS
typedef int Tk_SelectionProc(
- ClientData \fIclientData\fR,
- int \fIoffset\fR,
- char *\fIbuffer\fR,
- int \fImaxBytes\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.
@@ -75,7 +74,7 @@ at \fIbuffer\fR containing \fImaxBytes\fR or fewer characters
count of the number of non-NULL characters stored at
\fIbuffer\fR. If the selection no longer exists (e.g. it once
existed but the user deleted the range of characters containing
-it), then \fIproc\fR should return -1.
+it), then \fIproc\fR should return \-1.
.PP
When transferring large selections, Tk will break them up into
smaller pieces (typically a few thousand bytes each) for more
diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3
index a156581..8e36cb0 100644
--- a/doc/CrtWindow.3
+++ b/doc/CrtWindow.3
@@ -30,41 +30,39 @@ Tk_Window
.AS Tcl_Interp *topLevScreen
.AP Tcl_Interp *interp out
Tcl interpreter to use for error reporting. If no error occurs,
-then \fI*interp\fR isn't modified.
+then \fI*interp\fR is not modified.
.AP Tk_Window parent in
Token for the window that is to serve as the logical parent of
the new window.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name to use for this window. Must be unique among all children of
the same \fIparent\fR.
-.AP "CONST char" *topLevScreen in
+.AP "const char" *topLevScreen in
Has same format as \fIscreenName\fR. If NULL, then new window is
created as an internal window. If non-NULL, new window is created as
a top-level window on screen \fItopLevScreen\fR. If \fItopLevScreen\fR
-is an empty string (``'') then new
-window is created as top-level window of \fIparent\fR's screen.
+is an empty string
+.PQ ""
+then new window is created as top-level window of \fIparent\fR's screen.
.AP Tk_Window tkwin in
Token for window.
-.AP "CONST char" *pathName in
+.AP "const char" *pathName in
Name of new window, specified as path name within application
(e.g. \fB.a.b.c\fR).
.BE
-
.SH DESCRIPTION
.PP
The procedures \fBTk_CreateWindow\fR,
-.VS
\fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR
are used to create new windows for
use in Tk-based applications. Each of the procedures returns a token
that can be used to manipulate the window in other calls to the Tk
-library. If the window couldn't be created successfully, then NULL
+library. If the window could not be created successfully, then NULL
is returned and \fIinterp->result\fR is modified to hold an error
message.
.PP
Tk supports two different kinds of windows: internal
windows and top-level windows.
-.VE
An internal window is an interior window of a Tk application, such as a
scrollbar or menu bar or button. A top-level window is one that is
created as a child of a screen's root window, rather than as an
@@ -104,7 +102,7 @@ as in calls to \fBTk_CreateWindow\fR, the parent of the new window
must exist at the time of the call, but the new window must not
already exist.
.PP
-The window creation procedures don't
+The window creation procedures do not
actually issue the command to X to create a window.
Instead, they create a local data structure associated with
the window and defer the creation of the X window.
@@ -117,7 +115,7 @@ mapped all of the window attributes can be set while creating
the window.
.PP
The value returned by a window-creation procedure is not the
-X token for the window (it can't be, since X hasn't been
+X token for the window (it cannot be, since X has not been
asked to create the window yet). Instead, it is a token
for Tk's local data structure for the window. Most
of the Tk library procedures take Tk_Window tokens, rather
@@ -139,7 +137,7 @@ then the event handlers will be invoked later, after X has seen
the request and returned an event for it.
.PP
If a window has been created
-but hasn't been mapped, so no X window exists, it is
+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.
diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3
index 91bf63f..2b9288e 100644
--- a/doc/DeleteImg.3
+++ b/doc/DeleteImg.3
@@ -18,7 +18,7 @@ Tk_DeleteImage \- Destroy an image.
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter for which the image was created.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name of the image.
.BE
diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3
index 3d8bb12..2ea04ae 100644
--- a/doc/EventHndlr.3
+++ b/doc/EventHndlr.3
@@ -46,8 +46,8 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
type \fBTk_EventProc\fR:
.CS
typedef void Tk_EventProc(
- ClientData \fIclientData\fR,
- XEvent *\fIeventPtr\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
diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3
index 7e6ee5a..08e0221 100644
--- a/doc/FindPhoto.3
+++ b/doc/FindPhoto.3
@@ -17,19 +17,19 @@ Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_Pho
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
-\fB#include <tkPhoto.h>\fR
.sp
Tk_PhotoHandle
-.VS 8.0 br
\fBTk_FindPhoto\fR(\fIinterp, imageName\fR)
-.VE
.sp
-void
-\fBTk_PhotoPutBlock\fR(\fIhandle, blockPtr, x, y, width, height, compRule\fR)
+.VS 8.5
+int
+\fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\
+compRule\fR)
.sp
-void
-\fBTk_PhotoPutZoomedBlock\fR(\fIhandle, blockPtr, x, y, width, height,\
+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,21 +37,24 @@ int
void
\fBTk_PhotoBlank\fR(\fIhandle\fR)
.sp
-void
-\fBTk_PhotoExpand\fR(\fIhandle, width, height\fR)
+.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
-void
-\fBTk_PhotoSetSize\fR(\fIhandle, width, height\fR)
+.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
-.VS
-Interpreter in which image was created.
-.VE
-.AP "CONST char" *imageName in
+Interpreter in which image was created and in which error reporting is
+to be done.
+.AP "const char" *imageName in
Name of the photo image.
.AP Tk_PhotoHandle handle in
Opaque handle identifying the photo image to be affected.
@@ -67,16 +70,14 @@ to be placed within the image.
Specifies the width of the image area to be affected (for
\fBTk_PhotoPutBlock\fR) or the desired image width (for
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR).
-.VS 8.4
.AP int compRule in
Specifies the compositing rule used when combining transparent pixels
in a block of data with a photo image. Must be one of
-TK_PHOTO_COMPOSITE_OVERLAY (which puts the block of data over the top
+\fBTK_PHOTO_COMPOSITE_OVERLAY\fR (which puts the block of data over the top
of the existing photo image, with the previous contents showing
-through in the transparent bits) or TK_PHOTO_COMPOSITE_SET (which
+through in the transparent bits) or \fBTK_PHOTO_COMPOSITE_SET\fR (which
discards the existing photo image contents in the rectangle covered by
the data block.)
-.VE 8.4
.AP int height in
Specifies the height of the image area to be affected (for
\fBTk_PhotoPutBlock\fR) or the desired image height (for
@@ -122,12 +123,12 @@ The \fIblock\fR parameter is a pointer to a
\fBTk_PhotoImageBlock\fR structure, defined as follows:
.CS
typedef struct {
- unsigned char *\fIpixelPtr\fR;
- int \fIwidth\fR;
- int \fIheight\fR;
- int \fIpitch\fR;
- int \fIpixelSize\fR;
- int \fIoffset[4]\fR;
+ unsigned char *\fIpixelPtr\fR;
+ int \fIwidth\fR;
+ int \fIheight\fR;
+ int \fIpitch\fR;
+ int \fIpixelSize\fR;
+ int \fIoffset[4]\fR;
} Tk_PhotoImageBlock;
.CE
The \fIpixelPtr\fR field points to the first pixel, that is, the
@@ -143,16 +144,14 @@ to the addresses of the bytes containing the red, green, blue and alpha
have other values, e.g., for images that are stored as separate red,
green and blue planes.
.PP
-.VS 8.4
The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
compositing rule that says what to do with transparent pixels. The
-value TK_PHOTO_COMPOSITE_OVERLAY says that the previous contents of
+value \fBTK_PHOTO_COMPOSITE_OVERLAY\fR says that the previous contents of
the photo image should show through, and the value
-TK_PHOTO_COMPOSITE_SET says that the previous contents of the photo
+\fBTK_PHOTO_COMPOSITE_SET\fR says that the previous contents of the photo
image should be completely ignored, and the values from the block be
copied directly across. The behavior in Tk8.3 and earlier was
-equivalent to having TK_PHOTO_COMPOSITE_OVERLAY as a compositing rule.
-.VE 8.4
+equivalent to having \fBTK_PHOTO_COMPOSITE_OVERLAY\fR as a compositing rule.
.PP
The value given for the \fIwidth\fR and \fIheight\fR parameters to
\fBTk_PhotoPutBlock\fR do not have to correspond to the values specified
@@ -162,6 +161,13 @@ 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
\fIsubsampleX\fR and \fIsubsampleY\fR parameters allow the size of the
@@ -201,6 +207,13 @@ 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
\fB\-width\fR and \fB\-height\fR configuration options. A value of
@@ -209,11 +222,17 @@ 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
-.VS 8.4
.PP
In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
\fBTk_PhotoPutZoomedBlock\fR had different signatures. If you want to
@@ -221,7 +240,16 @@ compile code that uses the old interface against 8.4 without updating
your code, compile it with the flag
-DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against
older versions of Tk will continue to work.
-.VE 8.4
+.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
+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
diff --git a/doc/FontId.3 b/doc/FontId.3
index bed71c3..60905a7 100644
--- a/doc/FontId.3
+++ b/doc/FontId.3
@@ -17,12 +17,10 @@ fonts
Font
\fBTk_FontId(\fItkfont\fB)\fR
.sp
-void
\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR
.sp
int
\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR
-
.SH ARGUMENTS
.AS Tk_FontMetrics *dsPtr
.AP Tk_Font tkfont in
@@ -30,12 +28,11 @@ Opaque font token being queried. Must have been returned by a previous
call to \fBTk_GetFont\fR.
.AP Tk_FontMetrics *fmPtr out
Pointer to structure in which the font metrics for \fItkfont\fR will
-be stored.
+be stored. See \fBDATA STRUCTURES\fR below for details.
.AP Tcl_DString *dsPtr out
Pointer to an initialized \fBTcl_DString\fR to which the name of the
Postscript font that corresponds to \fItkfont\fR will be appended.
.BE
-
.SH DESCRIPTION
.PP
Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be
@@ -51,10 +48,12 @@ documentation for the \fBfont\fR command for definitions of the terms
ascent, descent, and linespace, used in font metrics.
.PP
\fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding
-Postcript font name that should be used when printing. The return value
+Postscript font name that should be used when printing. The return value
is the size in points of the \fItkfont\fR and the Postscript font name is
appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized
-\fBTcl_DString\fR. Given a ``reasonable'' Postscript printer, the
+\fBTcl_DString\fR. Given a
+.QW reasonable
+Postscript printer, the
following screen font families should print correctly:
.IP
\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR,
@@ -65,18 +64,18 @@ following screen font families should print correctly:
.PP
Any other font families may not print correctly because the computed
Postscript font name may be incorrect or not exist on the printer.
-.VS 8.0 br
.SH "DATA STRUCTURES"
-The Tk_FontMetrics data structure is used by Tk_GetFontMetrics to return
-information about a font and is defined as follows:
+The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to
+return information about a font and is defined as follows:
.CS
typedef struct Tk_FontMetrics {
- int ascent;
- int descent;
- int linespace;
+ int \fIascent\fR;
+ int \fIdescent\fR;
+ int \fIlinespace\fR;
} Tk_FontMetrics;
.CE
-The \fIlinespace\fR field is the amount in pixels that the tallest
+.PP
+The \fIascent\fR field is the amount in pixels that the tallest
letter sticks up above the baseline, plus any extra blank space added
by the designer of the font.
.PP
@@ -88,6 +87,7 @@ The \fIlinespace\fR is the sum of the ascent and descent. How far
apart two lines of text in the same font should be placed so that none
of the characters in one line overlap any of the characters in the
other line.
-.VE
+.SH "SEE ALSO"
+font(n), MeasureChar(3)
.SH KEYWORDS
-font
+font, measurement, Postscript
diff --git a/doc/FreeXId.3 b/doc/FreeXId.3
index c4ad889..eb1da96 100644
--- a/doc/FreeXId.3
+++ b/doc/FreeXId.3
@@ -23,7 +23,6 @@ Display for which \fIid\fR was allocated.
Identifier of X resource (window, font, pixmap, cursor, graphics
context, or colormap) that is no longer in use.
.BE
-
.SH DESCRIPTION
.PP
The default allocator for resource identifiers provided by Xlib is very
@@ -42,9 +41,8 @@ However, if you allocate resources directly from Xlib, for example
by calling \fBXCreatePixmap\fR, then you should call \fBTk_FreeXId\fR
when you call the corresponding Xlib free procedure, such as
\fBXFreePixmap\fR.
-If you don't call \fBTk_FreeXId\fR then the resource identifier will
+If you do not call \fBTk_FreeXId\fR then the resource identifier will
be lost, which could cause problems if the application runs long enough
to lose all of the available identifiers.
-
.SH KEYWORDS
resource identifier
diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3
index 0b25cb0..8698353 100644
--- a/doc/GetAnchor.3
+++ b/doc/GetAnchor.3
@@ -14,39 +14,42 @@ Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor \- translate between strings
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
int
\fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR
-.VE
.sp
int
\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfAnchor(\fIanchor\fB)\fR
.SH ARGUMENTS
.AS "Tk_Anchor" *anchorPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
-String value contains name of anchor point: \fBn\fR, \fBne\fR,
-\fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR;
+String value contains name of anchor point:
+.QW n ,
+.QW ne ,
+.QW e ,
+.QW se ,
+.QW s ,
+.QW sw ,
+.QW w ,
+.QW nw ,
+or
+.QW center ;
internal rep will be modified to cache corresponding Tk_Anchor.
-.AP "CONST char" *string in
+.AP "const char" *string in
Same as \fIobjPtr\fR except description of anchor point is passed as
a string.
-.VE
.AP int *anchorPtr out
Pointer to location in which to store anchor position corresponding to
\fIobjPtr\fR or \fIstring\fR.
.AP Tk_Anchor anchor in
Anchor position, e.g. \fBTCL_ANCHOR_CENTER\fR.
.BE
-
.SH DESCRIPTION
.PP
-.VS 8.1
\fBTk_GetAnchorFromObj\fR places in \fI*anchorPtr\fR an anchor position
(enumerated type \fBTk_Anchor\fR)
corresponding to \fIobjPtr\fR's value. The result will be one of
@@ -59,10 +62,10 @@ position the top center point of the object at a particular place.
.PP
Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
-If \fIstring\fR doesn't contain a valid anchor position
+If \fIstring\fR does not contain a valid anchor position
or an abbreviation of one of these names, \fBTCL_ERROR\fR is returned,
\fI*anchorPtr\fR is unmodified, and an error message is
-stored in \fIinterp\fR's result if \fIinterp\fR isn't NULL.
+stored in \fIinterp\fR's result if \fIinterp\fR is not NULL.
\fBTk_GetAnchorFromObj\fR caches information about the return
value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetAnchorFromObj\fR with the same \fIobjPtr\fR.
@@ -72,13 +75,12 @@ that the description of the anchor is specified with a string instead
of an object. This prevents \fBTk_GetAnchor\fR from caching the
return value, so \fBTk_GetAnchor\fR is less efficient than
\fBTk_GetAnchorFromObj\fR.
-.VE
.PP
\fBTk_NameOfAnchor\fR is the logical inverse of \fBTk_GetAnchor\fR.
Given an anchor position such as \fBTK_ANCHOR_N\fR it returns a
statically-allocated string corresponding to \fIanchor\fR.
-If \fIanchor\fR isn't a legal anchor value, then
-``unknown anchor position'' is returned.
-
+If \fIanchor\fR is not a legal anchor value, then
+.QW "unknown anchor position"
+is returned.
.SH KEYWORDS
anchor position
diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3
index 69e319e..a9bd2c2 100644
--- a/doc/GetBitmap.3
+++ b/doc/GetBitmap.3
@@ -14,7 +14,6 @@ Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_Na
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
Pixmap
\fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR
.sp
@@ -23,19 +22,16 @@ Pixmap
.sp
Pixmap
\fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
int
\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR
.sp
\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR
.sp
-.VS 8.1
\fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
\fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR
.SH ARGUMENTS
@@ -45,17 +41,15 @@ Interpreter to use for error reporting; if NULL then no error message
is left after errors.
.AP Tk_Window tkwin in
Token for window in which the bitmap will be used.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
String value describes desired bitmap; internal rep will be
modified to cache pointer to corresponding Pixmap.
-.AP "CONST char" *info in
+.AP "const char" *info in
Same as \fIobjPtr\fR except description of bitmap is passed as a string and
-resulting Pixmap isn't cached.
-.VE
-.AP "CONST char" *name in
+resulting Pixmap is not cached.
+.AP "const char" *name in
Name for new bitmap to be defined.
-.AP "CONST char" *source in
+.AP "const char" *source in
Data for bitmap, in standard bitmap format.
Must be stored in static memory whose value will never change.
.AP "int" width in
@@ -80,13 +74,11 @@ being used by an application. The procedures allow bitmaps to be
re-used efficiently, thereby avoiding server overhead, and also
allow bitmaps to be named with character strings.
.PP
-.VS 8.1
\fBTk_AllocBitmapFromObj\fR returns a Pixmap identifier for a bitmap
that matches the description in \fIobjPtr\fR and is suitable for use
in \fItkwin\fR. It re-uses an existing bitmap, if possible, and
creates a new one otherwise. \fIObjPtr\fR's value must have one
of the following forms:
-.VE
.TP 20
\fB@\fIfileName\fR
\fIFileName\fR must be the name of a file containing a bitmap
@@ -99,21 +91,18 @@ by Tk:
.RS
.TP 12
\fBerror\fR
-The international "don't" symbol: a circle with a diagonal line
-across it.
-.VS "" br
+The international
+.QW don't
+symbol: a circle with a diagonal line across it.
.TP 12
\fBgray75\fR
75% gray: a checkerboard pattern where three out of four bits are on.
-.VE
.TP 12
\fBgray50\fR
50% gray: a checkerboard pattern where every other bit is on.
-.VS "" br
.TP 12
\fBgray25\fR
25% gray: a checkerboard pattern where one out of every four bits is on.
-.VE
.TP 12
\fBgray12\fR
12.5% gray: a pattern where one-eighth of the bits are on, consisting of
@@ -123,7 +112,8 @@ every fourth pixel in every other row.
An hourglass symbol.
.TP 12
\fBinfo\fR
-A large letter ``i''.
+A large letter
+.QW i .
.TP 12
\fBquesthead\fR
The silhouette of a human head, with a question mark in it.
@@ -180,18 +170,17 @@ A database document icon.
A stop sign.
.TP 12
\fBnote\fR
-A face with ballon words.
+A face with balloon words.
.TP 12
\fBcaution\fR
A triangle with an exclamation point.
.RE
.LP
-.VS 8.1
Under normal conditions, \fBTk_AllocBitmapFromObj\fR
returns an identifier for the requested bitmap. If an error
occurs in creating the bitmap, such as when \fIobjPtr\fR refers
to a non-existent file, then \fBNone\fR is returned and an error
-message is left in \fIinterp\fR's result if \fIinterp\fR isn't
+message is left in \fIinterp\fR's result if \fIinterp\fR is not
NULL. \fBTk_AllocBitmapFromObj\fR caches information about the return
value in \fIobjPtr\fR, which speeds up future calls to procedures
such as \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmapFromObj\fR.
@@ -204,13 +193,12 @@ return value, so \fBTk_GetBitmap\fR is less efficient than
.PP
\fBTk_GetBitmapFromObj\fR returns the token for an existing bitmap, given
the window and description used to create the bitmap.
-\fBTk_GetBitmapFromObj\fR doesn't actually create the bitmap; the bitmap
+\fBTk_GetBitmapFromObj\fR does not actually create the bitmap; the bitmap
must already have been created with a previous call to
\fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. The return
value is cached in \fIobjPtr\fR, which speeds up
future calls to \fBTk_GetBitmapFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
-.VE
.PP
\fBTk_DefineBitmap\fR associates a name with
in-memory bitmap data so that the name can be used in later
@@ -219,12 +207,12 @@ argument gives a name for the bitmap; it must not previously
have been used in a call to \fBTk_DefineBitmap\fR.
The arguments \fIsource\fR, \fIwidth\fR, and \fIheight\fR
describe the bitmap.
-\fBTk_DefineBitmap\fR normally returns TCL_OK; if an error occurs
+\fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs
(e.g. a bitmap named \fInameId\fR has already been defined) then
-TCL_ERROR is returned and an error message is left in
+\fBTCL_ERROR\fR is returned and an error message is left in
\fIinterp->result\fR.
Note: \fBTk_DefineBitmap\fR expects the memory pointed to by
-\fIsource\fR to be static: \fBTk_DefineBitmap\fR doesn't make
+\fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make
a private copy of this memory, but uses the bytes pointed to
by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR.
@@ -237,26 +225,22 @@ which was created by the \fBbitmap\fR program and contains
a stipple pattern.
The following code uses \fBTk_DefineBitmap\fR to define a
new bitmap named \fBfoo\fR:
-.VS
.CS
Pixmap bitmap;
#include "stip.bitmap"
Tk_DefineBitmap(interp, "foo", stip_bits,
- stip_width, stip_height);
+ stip_width, stip_height);
\&...
bitmap = Tk_GetBitmap(interp, tkwin, "foo");
.CE
-.VE
This code causes the bitmap file to be read
at compile-time and incorporates the bitmap information into
the program's executable image. The same bitmap file could be
read at run-time using \fBTk_GetBitmap\fR:
-.VS
.CS
Pixmap bitmap;
bitmap = Tk_GetBitmap(interp, tkwin, "@stip.bitmap");
.CE
-.VE
The second form is a bit more flexible (the file could be modified
after the program has been compiled, or a different string could be
provided to read a different file), but it is a little slower and
@@ -289,7 +273,6 @@ argument in the words pointed to by the \fIwidthPtr\fR and
\fIbitmap\fR must have been created by \fBTk_AllocBitmapFromObj\fR or
\fBTk_GetBitmap\fR.
.PP
-.VS 8.1
When a bitmap is no longer needed, \fBTk_FreeBitmapFromObj\fR or
\fBTk_FreeBitmap\fR should be called to release it.
For \fBTk_FreeBitmapFromObj\fR the bitmap to release is specified
@@ -299,7 +282,6 @@ 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.
-.VE
.SH BUGS
In determining whether an existing bitmap can be used to satisfy
diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3
index e9cce7b..5463f12 100644
--- a/doc/GetCapStyl.3
+++ b/doc/GetCapStyl.3
@@ -17,15 +17,18 @@ Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles
int
\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfCapStyle(\fIcap\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *capPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP "CONST char" *string in
-String containing name of cap style: one of ```butt'', ``projecting'',
-or ``round''.
+.AP "const char" *string in
+String containing name of cap style: one of
+.QW butt ,
+.QW projecting ,
+or
+.QW round .
.AP int *capPtr out
Pointer to location in which to store X cap style corresponding to
\fIstring\fR.
@@ -46,7 +49,7 @@ implies.
.PP
Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
-If \fIstring\fR doesn't contain a valid cap style
+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
\fI*capPtr\fR is unmodified.
@@ -54,8 +57,9 @@ stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
\fBTk_NameOfCapStyle\fR is the logical inverse of \fBTk_GetCapStyle\fR.
Given a cap style such as \fBCapButt\fR it returns a
statically-allocated string corresponding to \fIcap\fR.
-If \fIcap\fR isn't a legal cap style, then
-``unknown cap style'' is returned.
+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/GetClrmap.3 b/doc/GetClrmap.3
index 3c288e9..13ad9b2 100644
--- a/doc/GetClrmap.3
+++ b/doc/GetClrmap.3
@@ -9,7 +9,7 @@
.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_GetColormap, Tk_FreeColormap \- allocate and free colormaps
+Tk_GetColormap, Tk_PreserveColormap, Tk_FreeColormap \- allocate and free colormaps
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -17,6 +17,8 @@ Tk_GetColormap, Tk_FreeColormap \- allocate and free colormaps
Colormap
\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR
.sp
+\fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR
+.sp
\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR
.SH ARGUMENTS
.AS "Colormap" colormap
@@ -24,16 +26,15 @@ Colormap
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which colormap will be used.
-.AP "CONST char" *string in
+.AP "const char" *string in
Selects a colormap: either \fBnew\fR or the name of a window
with the same screen and visual as \fItkwin\fR.
.AP Display *display in
Display for which \fIcolormap\fR was allocated.
.AP Colormap colormap in
-Colormap to free; must have been returned by a previous
+Colormap to free or preserve; must have been returned by a previous
call to \fBTk_GetColormap\fR or \fBTk_GetVisual\fR.
.BE
-
.SH DESCRIPTION
.PP
These procedures are used to manage colormaps.
@@ -42,16 +43,22 @@ If its \fIstring\fR argument is \fBnew\fR then a new colormap is
created; otherwise \fIstring\fR must be the name of another window
with the same screen and visual as \fItkwin\fR, and the colormap from that
window is returned.
-If \fIstring\fR doesn't make sense, or if it refers to a window on
+If \fIstring\fR does not make sense, or if it refers to a window on
a different screen from \fItkwin\fR or with
a different visual than \fItkwin\fR, then \fBTk_GetColormap\fR returns
-\fBNone\fR and leaves an error message in \fIinterp->result\fR.
+\fBNone\fR and leaves an error message in \fIinterp\fR's result.
+.PP
+\fBTk_PreserveColormap\fR increases the internal reference count for a
+colormap previously returned by \fBTk_GetColormap\fR, which allows the
+colormap to be stored in several locations without knowing which order
+they will be released.
.PP
\fBTk_FreeColormap\fR should be called when a colormap returned by
\fBTk_GetColormap\fR is no longer needed.
Tk maintains a reference count for each colormap returned by
\fBTk_GetColormap\fR, so there should eventually be one call to
-\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR.
+\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR and each
+call to \fBTk_PreserveColormap\fR.
When a colormap's reference count becomes zero, Tk releases the
X colormap.
.PP
@@ -66,6 +73,5 @@ If \fBTk_GetColormap\fR is called with a \fIstring\fR value of
be returned by \fBTk_GetVisual\fR; however, it can be used in other
windows by calling \fBTk_GetColormap\fR with the original window's
name as \fIstring\fR.
-
.SH KEYWORDS
-colormap
+colormap, visual
diff --git a/doc/GetColor.3 b/doc/GetColor.3
index 201edab..b5416af 100644
--- a/doc/GetColor.3
+++ b/doc/GetColor.3
@@ -13,7 +13,6 @@ Tk_AllocColorFromObj, Tk_GetColor, Tk_GetColorFromObj, Tk_GetColorByValue, Tk_Na
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
-.VS 8.1
.sp
XColor *
\fBTk_AllocColorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
@@ -23,20 +22,17 @@ XColor *
.sp
XColor *
\fBTk_GetColorFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
XColor *
\fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfColor(\fIcolorPtr\fB)\fR
.sp
GC
\fBTk_GCForColor(\fIcolorPtr, drawable\fB)\fR
.sp
-.VS 8.1
\fBTk_FreeColorFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
\fBTk_FreeColor(\fIcolorPtr\fB)\fR
.SH ARGUMENTS
@@ -45,14 +41,12 @@ GC
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which color will be used.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
String value describes desired color; internal rep will be
modified to cache pointer to corresponding (XColor *).
.AP char *name in
Same as \fIobjPtr\fR except description of color is passed as a string and
-resulting (XColor *) isn't cached.
-.VE
+resulting (XColor *) is not cached.
.AP XColor *prefPtr in
Indicates red, green, and blue intensities of desired
color.
@@ -66,7 +60,6 @@ same screen and depth as the window for which the color was allocated.
.BE
.SH DESCRIPTION
-.VS 8.1
.PP
These procedures manage the colors being used by a Tk application.
They allow colors to be shared whenever possible, so that colormap
@@ -77,7 +70,6 @@ Given a textual description of a color, \fBTk_AllocColorFromObj\fR
locates a pixel value that may be used to render the color
in a particular window. The desired color is specified with an
object whose string value must have one of the following forms:
-.VE
.TP 20
\fIcolorname\fR
Any of the valid textual names for a color defined in the
@@ -98,7 +90,6 @@ When fewer than 16 bits are provided for each color, they represent
the most significant bits of the color. For example, #3a7 is the
same as #3000a0007000.
.PP
-.VS 8.1
\fBTk_AllocColorFromObj\fR returns a pointer to
an XColor structure; the structure indicates the exact intensities of
the allocated color (which may differ slightly from those requested,
@@ -106,7 +97,7 @@ depending on the limitations of the screen) and a pixel value
that may be used to draw with the color in \fItkwin\fR.
If an error occurs in \fBTk_AllocColorFromObj\fR (such as an unknown
color name) then NULL is returned and an error message is stored in
-\fIinterp\fR's result if \fIinterp\fR isn't NULL.
+\fIinterp\fR's result if \fIinterp\fR is not NULL.
If the colormap for \fItkwin\fR is full, \fBTk_AllocColorFromObj\fR
will use the closest existing color in the colormap.
\fBTk_AllocColorFromObj\fR caches information about
@@ -121,13 +112,12 @@ return value, so \fBTk_GetColor\fR is less efficient than
.PP
\fBTk_GetColorFromObj\fR returns the token for an existing color, given
the window and description used to create the color.
-\fBTk_GetColorFromObj\fR doesn't actually create the color; the color
+\fBTk_GetColorFromObj\fR does not actually create the color; the color
must already have been created with a previous call to
\fBTk_AllocColorFromObj\fR or \fBTk_GetColor\fR. The return
value is cached in \fIobjPtr\fR, which speeds up
future calls to \fBTk_GetColorFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
-.VE
.PP
\fBTk_GetColorByValue\fR is similar to \fBTk_GetColor\fR except that
the desired color is indicated with the \fIred\fR, \fIgreen\fR, and
@@ -173,7 +163,6 @@ The graphics context is cached with the color and will exist only as
long as \fIcolorPtr\fR exists; it is freed when the last reference
to \fIcolorPtr\fR is freed by calling \fBTk_FreeColor\fR.
.PP
-.VS 8.1
When a color is no longer needed \fBTk_FreeColorFromObj\fR or
\fBTk_FreeColor\fR should be called to release it.
For \fBTk_FreeColorFromObj\fR the color to release is specified
@@ -183,6 +172,5 @@ with a pointer to its XColor structure.
There should be exactly one call to \fBTk_FreeColorFromObj\fR
or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR,
\fBTk_GetColor\fR, or \fBTk_GetColorByValue\fR.
-.VE
.SH KEYWORDS
color, intensity, object, pixel value
diff --git a/doc/GetCursor.3 b/doc/GetCursor.3
index daca323..953252b 100644
--- a/doc/GetCursor.3
+++ b/doc/GetCursor.3
@@ -14,7 +14,6 @@ Tk_AllocCursorFromObj, Tk_GetCursor, Tk_GetCursorFromObj, Tk_GetCursorFromData,
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
Tk_Cursor
\fBTk_AllocCursorFromObj(\fIinterp, tkwin, objPtr\fB)\fR
.sp
@@ -23,17 +22,14 @@ Tk_Cursor
.sp
Tk_Cursor
\fBTk_GetCursorFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
Tk_Cursor
\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
.sp
-.VS 8.1
\fBTk_FreeCursorFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
\fBTk_FreeCursor(\fIdisplay, cursor\fB)\fR
.SH ARGUMENTS
@@ -42,17 +38,15 @@ CONST char *
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which the cursor will be used.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
Description of cursor; see below for possible values. Internal rep will be
modified to cache pointer to corresponding Tk_Cursor.
.AP char *name in
Same as \fIobjPtr\fR except description of cursor is passed as a string and
-resulting Tk_Cursor isn't cached.
-.VE
-.AP "CONST char" *source in
+resulting Tk_Cursor is not cached.
+.AP "const char" *source in
Data for cursor cursor, in standard cursor format.
-.AP "CONST char" *mask in
+.AP "const char" *mask in
Data for mask cursor, in standard cursor format.
.AP "int" width in
Width of \fIsource\fR and \fImask\fR.
@@ -81,7 +75,6 @@ being used by an application. The procedures allow cursors to be
re-used efficiently, thereby avoiding server overhead, and also
allow cursors to be named with character strings.
.PP
-.VS 8.1
\fBTk_AllocCursorFromObj\fR takes as argument an object describing a
cursor, and returns an opaque Tk identifier for a cursor corresponding
to the description. It re-uses an existing cursor if possible and
@@ -91,15 +84,15 @@ future calls to procedures such as \fBTk_AllocCursorFromObj\fR and
\fBTk_GetCursorFromObj\fR. If an error occurs in creating the cursor,
such as when \fIobjPtr\fR refers to a non-existent file, then \fBNone\fR
is returned and an error message will be stored in \fIinterp\fR's result
-if \fIinterp\fR isn't NULL. \fIObjPtr\fR must contain a standard Tcl
+if \fIinterp\fR is not NULL. \fIObjPtr\fR must contain a standard Tcl
list with one of the following forms:
-.VE
.TP
\fIname\fR\0[\fIfgColor\fR\0[\fIbgColor\fR]]
\fIName\fR is the name of a cursor in the standard X cursor cursor,
i.e., any of the names defined in \fBcursorcursor.h\fR, without
the \fBXC_\fR. Some example values are \fBX_cursor\fR, \fBhand2\fR,
-or \fBleft_ptr\fR. Appendix B of ``The X Window System''
+or \fBleft_ptr\fR. Appendix B of
+.QW "The X Window System"
by Scheifler & Gettys has illustrations showing what each of these
cursors looks like. If \fIfgColor\fR and \fIbgColor\fR are both
specified, they give the foreground and background colors to use
@@ -116,7 +109,7 @@ will also accept any of the standard Mac cursors
including \fBibeam\fR, \fBcrosshair\fR, \fBwatch\fR, \fBplus\fR, and
\fBarrow\fR. In addition, Tk will load Macintosh cursor resources of
the types \fBcrsr\fR (color) and \fBCURS\fR (black and white) by the
-name of the of the resource. The application and all its open
+name of the resource. The application and all its open
dynamic library's resource files will be searched for the named
cursor. If there are conflicts color cursors will always be loaded
in preference to black and white cursors.
@@ -142,7 +135,6 @@ This form only works on Windows, and will load a Windows system
cursor (\fB.ani\fR or \fB.cur\fR) from the file specified in
\fIsourceName\fR.
.PP
-.VS 8.1
\fBTk_GetCursor\fR is identical to \fBTk_AllocCursorFromObj\fR except
that the description of the cursor is specified with a string instead
of an object. This prevents \fBTk_GetCursor\fR from caching the
@@ -151,13 +143,12 @@ return value, so \fBTk_GetCursor\fR is less efficient than
.PP
\fBTk_GetCursorFromObj\fR returns the token for an existing cursor, given
the window and description used to create the cursor.
-\fBTk_GetCursorFromObj\fR doesn't actually create the cursor; the cursor
+\fBTk_GetCursorFromObj\fR does not actually create the cursor; the cursor
must already have been created with a previous call to
\fBTk_AllocCursorFromObj\fR or \fBTk_GetCursor\fR. The return
value is cached in \fIobjPtr\fR, which speeds up
future calls to \fBTk_GetCursorFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
-.VE
.PP
\fBTk_GetCursorFromData\fR allows cursors to be created from
in-memory descriptions of their source and mask cursors. \fISource\fR
@@ -178,8 +169,8 @@ Tk_Cursor cursor;
#include "source.cursor"
#include "mask.cursor"
cursor = Tk_GetCursorFromData(interp, tkwin, source_bits,
- mask_bits, source_width, source_height, source_x_hot,
- source_y_hot, Tk_GetUid("red"), Tk_GetUid("blue"));
+ mask_bits, source_width, source_height, source_x_hot,
+ source_y_hot, Tk_GetUid("red"), Tk_GetUid("blue"));
.CE
.PP
Under normal conditions \fBTk_GetCursorFromData\fR
@@ -211,7 +202,6 @@ only guaranteed to persist until the next call to
\fBTk_NameOfCursor\fR. Also, this call is not portable except for
cursors returned by \fBTk_GetCursor\fR.
.PP
-.VS 8.1
When a cursor returned by \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR,
or \fBTk_GetCursorFromData\fR
is no longer needed, \fBTk_FreeCursorFromObj\fR or
@@ -223,7 +213,6 @@ 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.
-.VE
.SH BUGS
In determining whether an existing cursor can be used to satisfy
diff --git a/doc/GetDash.3 b/doc/GetDash.3
index ce25b31..cc54c5a 100644
--- a/doc/GetDash.3
+++ b/doc/GetDash.3
@@ -20,7 +20,7 @@ int
.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
@@ -31,31 +31,41 @@ value converted from \fIstring\fR.
.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 \fB[.,-_]\fR or spaces. If all
-goes well, TCL_OK is returned. If \fIstring\fR doesn't have the
-proper syntax then TCL_ERROR is returned, an error message is left
+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
+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
The first possible syntax is a list of integers. Each element
represents the number of pixels of a line segment. Only the odd
-segments are drawn using the "outline" color. The other segments
-are drawn transparent.
+segments are drawn using the
+.QW outline
+color. The other segments are drawn transparent.
.PP
The second possible syntax is a character list containing only
-5 possible characters \fB[.,-_ ]\fR. The space can be used
+5 possible characters
+.QW "\fB.,\-_ \fR" .
+The space can be used
to enlarge the space between other line elements, and can not
-occur as the first posibion in the string. Some examples:
- -dash . = -dash {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}
+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 {2 8}
+ \-dash , = \-dash {4 4}
+.CE
.PP
The main difference of this syntax with the previous is that it
-it shape-conserving. This means that all values in the dash
+is shape-conserving. This means that all values in the dash
list will be multiplied by the line width before display. This
-assures that "." will always be displayed as a dot and "-"
+assures that
+.QW .
+will always be displayed as a dot and
+.QW \-
always as a dash regardless of the line width.
.PP
On systems where only a limited set of dash patterns, the dash
diff --git a/doc/GetFont.3 b/doc/GetFont.3
index fbfa0e3..2ca1395 100644
--- a/doc/GetFont.3
+++ b/doc/GetFont.3
@@ -14,7 +14,6 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFr
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
Tk_Font
\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR
.sp
@@ -23,15 +22,12 @@ Tk_Font
.sp
Tk_Font
\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
-CONST char *
+const char *
\fBTk_NameOfFont(\fItkfont\fB)\fR
.sp
-.VS 8.1
Tk_Font
\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR
-.VE
.sp
void
\fBTk_FreeFont(\fItkfont\fB)\fR
@@ -43,21 +39,18 @@ Interpreter to use for error reporting. If \fBNULL\fR, then no error
messages are left after errors.
.AP Tk_Window tkwin in
Token for window in which font will be used.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
Gives name or description of font. See documentation
for the \fBfont\fR command for details on acceptable formats.
Internal rep will be modified to cache corresponding Tk_Font.
.AP "const char" *string in
Same as \fIobjPtr\fR except description of font is passed as a string and
-resulting Tk_Font isn't cached.
-.VE
+resulting Tk_Font is not cached.
.AP Tk_Font tkfont in
Opaque font token.
.BE
.SH DESCRIPTION
.PP
-.VS 8.1
\fBTk_AllocFontFromObj\fR finds the font indicated by \fIobjPtr\fR and
returns a token that represents the font. The return value can be used
in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR,
@@ -69,7 +62,7 @@ the documentation for the \fBfont\fR command for a description of the
valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because,
for example, \fIobjPtr\fR did not contain a valid font specification) then it
returns \fBNULL\fR and leaves an error message in \fIinterp\fR's result
-if \fIinterp\fR isn't \fBNULL\fR. \fBTk_AllocFontFromObj\fR caches
+if \fIinterp\fR is not \fBNULL\fR. \fBTk_AllocFontFromObj\fR caches
information about the return
value in \fIobjPtr\fR, which speeds up future calls to procedures
such as \fBTk_AllocFontFromObj\fR and \fBTk_GetFontFromObj\fR.
@@ -82,13 +75,12 @@ matching Tk_Font, so \fBTk_GetFont\fR is less efficient than
.PP
\fBTk_GetFontFromObj\fR returns the token for an existing font, given
the window and description used to create the font.
-\fBTk_GetFontFromObj\fR doesn't actually create the font; the font
+\fBTk_GetFontFromObj\fR does not actually create the font; the font
must already have been created with a previous call to
\fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR. The return
value is cached in \fIobjPtr\fR, which speeds up
future calls to \fBTk_GetFontFromObj\fR with the same \fIobjPtr\fR
and \fItkwin\fR.
-.VE
.PP
\fBTk_AllocFontFromObj\fR and \fBTk_GetFont\fR maintain
a database of all fonts they have allocated. If
@@ -105,7 +97,6 @@ passed to \fBTk_GetFont\fR to create the font. The string returned by
\fBTk_NameOfFont\fR is only guaranteed to persist until the \fItkfont\fR
is deleted. The caller must not modify this string.
.PP
-.VS 8.1
When a font is no longer needed,
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR should be called to
release it. For \fBTk_FreeFontFromObj\fR the font to release is specified
@@ -114,10 +105,8 @@ 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.
-.VE
.SH "SEE ALSO"
Tk_FontId(3)
-
.SH KEYWORDS
font
diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3
index 4a13786..07c9ddd 100644
--- a/doc/GetHINSTANCE.3
+++ b/doc/GetHINSTANCE.3
@@ -9,16 +9,14 @@
Tk_GetHINSTANCE \- retrieve the global application instance handle
.SH SYNOPSIS
.nf
-\fB#include <tk.h>\fR
+\fB#include <tkPlatDecls.h>\fR
.sp
HINSTANCE
\fBTk_GetHINSTANCE\fR()
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetHINSTANCE\fR returns the Windows application instance handle
for the Tk application. This function is only available on Windows platforms.
-
.SH KEYWORDS
identifier, instance
diff --git a/doc/GetHWND.3 b/doc/GetHWND.3
index 70fb0dd..06bdf37 100644
--- a/doc/GetHWND.3
+++ b/doc/GetHWND.3
@@ -6,7 +6,7 @@
.TH HWND 3 8.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_GetHWND, Tk_AttachHWND \- manage interactione between the Windows handle and an X window
+Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window
.SH SYNOPSIS
.nf
\fB#include <tkPlatDecls.h>\fR
diff --git a/doc/GetImage.3 b/doc/GetImage.3
index aefd9b9..fb6e4c8 100644
--- a/doc/GetImage.3
+++ b/doc/GetImage.3
@@ -28,7 +28,7 @@ Tk_Image
Place to leave error message.
.AP Tk_Window tkwin in
Window in which image will be used.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name of image.
.AP Tk_ImageChangedProc *changeProc in
Procedure for Tk to invoke whenever image content or size changes.
@@ -73,7 +73,7 @@ display an image.
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 doesn't exist then \fBTk_GetImage\fR returns NULL
+If the image does not exist then \fBTk_GetImage\fR returns NULL
and leaves an error message in \fIinterp->result\fR.
.PP
When a widget wishes to actually display an image it must
@@ -107,13 +107,13 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to
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);
+ 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.
diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3
index d2e45dd..1af1a06 100644
--- a/doc/GetJoinStl.3
+++ b/doc/GetJoinStl.3
@@ -17,15 +17,18 @@ Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles
int
\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *joinPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP "CONST char" *string in
-String containing name of join style: one of ``bevel'', ``miter'',
-or ``round''.
+.AP "const char" *string in
+String containing name of join style: one of
+.QW bevel ,
+.QW miter ,
+or
+.QW round .
.AP int *joinPtr out
Pointer to location in which to store X join style corresponding to
\fIstring\fR.
@@ -45,7 +48,7 @@ implies.
.PP
Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
-If \fIstring\fR doesn't contain a valid join style
+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
\fI*joinPtr\fR is unmodified.
@@ -53,8 +56,9 @@ stored in \fIinterp->result\fR, \fBTCL_ERROR\fR is returned, and
\fBTk_NameOfJoinStyle\fR is the logical inverse of \fBTk_GetJoinStyle\fR.
Given a join style such as \fBJoinBevel\fR it returns a
statically-allocated string corresponding to \fIjoin\fR.
-If \fIjoin\fR isn't a legal join style, then
-``unknown join style'' is returned.
+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 5f60336..e8535e7 100644
--- a/doc/GetJustify.3
+++ b/doc/GetJustify.3
@@ -14,41 +14,38 @@ Tk_GetJustifyFromObj, Tk_GetJustify, Tk_NameOfJustify \- translate between strin
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
int
\fBTk_GetJustifyFromObj(\fIinterp, objPtr, justifyPtr\fB)\fR
.sp
int
\fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfJustify(\fIjustify\fB)\fR
.SH ARGUMENTS
.AS "Tk_Justify" *justifyPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting, or NULL.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
-String value contains name of justification style (\fBleft\fR, \fBright\fR, or
-\fBcenter\fR). The
-internal rep will be modified to cache corresponding justify value.
-.AP "CONST char" *string in
+String value contains name of justification style, one of
+.QW left ,
+.QW right ,
+or
+.QW center .
+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
a string.
-.VE
.AP int *justifyPtr out
Pointer to location in which to store justify value corresponding to
\fIobjPtr\fR or \fIstring\fR.
.AP Tk_Justify justify in
Justification style (one of the values listed below).
.BE
-
.SH DESCRIPTION
.PP
-.VS 8.1
\fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value
corresponding to \fIobjPtr\fR's value.
-.VE
This value will be one of the following:
.TP
\fBTK_JUSTIFY_LEFT\fR
@@ -63,13 +60,12 @@ the line; as a result, the left edges of lines may be ragged.
Means that the text on each line should be centered; as a result,
both the left and right edges of lines may be ragged.
.PP
-.VS 8.1
Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
-If \fIobjPtr\fR doesn't contain a valid justification style
+If \fIobjPtr\fR does not contain a valid justification style
or an abbreviation of one of these names, \fBTCL_ERROR\fR is returned,
\fI*justifyPtr\fR is unmodified, and an error message is
-stored in \fIinterp\fR's result if \fIinterp\fR isn't NULL.
+stored in \fIinterp\fR's result if \fIinterp\fR is not NULL.
\fBTk_GetJustifyFromObj\fR caches information about the return
value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetJustifyFromObj\fR with the same \fIobjPtr\fR.
@@ -79,13 +75,13 @@ that the description of the justification is specified with a string instead
of an object. This prevents \fBTk_GetJustify\fR from caching the
return value, so \fBTk_GetJustify\fR is less efficient than
\fBTk_GetJustifyFromObj\fR.
-.VE
.PP
\fBTk_NameOfJustify\fR is the logical inverse of \fBTk_GetJustify\fR.
Given a justify value it returns a statically-allocated string
corresponding to \fIjustify\fR.
-If \fIjustify\fR isn't a legal justify value, then
-``unknown justification style'' is returned.
+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 de09f9b..79817b7 100644
--- a/doc/GetOption.3
+++ b/doc/GetOption.3
@@ -20,9 +20,9 @@ Tk_Uid
.AS Tk_Window *class
.AP Tk_Window tkwin in
Token for window.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name of desired option.
-.AP "CONST char" *class in
+.AP "const char" *class in
Class of desired option. Null means there is no class for
this option; do lookup based on name only.
.BE
diff --git a/doc/GetPixels.3 b/doc/GetPixels.3
index a89c8d1..814c4eb 100644
--- a/doc/GetPixels.3
+++ b/doc/GetPixels.3
@@ -14,18 +14,14 @@ Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM \- translate
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
int
\fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR
-.VE
.sp
int
\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR
.sp
-.VS 8.1
int
\fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR
-.VE
.sp
int
\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR
@@ -36,14 +32,12 @@ Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Window whose screen geometry determines the conversion between absolute
units and pixels.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
String value specifies a distance on the screen;
internal rep will be modified to cache converted distance.
-.AP "CONST char" *string in
+.AP "const char" *string in
Same as \fIobjPtr\fR except specification of distance is passed as
a string.
-.VE
.AP int *intPtr out
Pointer to location in which to store converted distance in pixels.
.AP double *doublePtr out
@@ -53,14 +47,10 @@ Pointer to location in which to store converted distance in millimeters.
.SH DESCRIPTION
.PP
These procedures take as argument a specification of distance on
-.VS 8.1
the screen (\fIobjPtr\fR or \fIstring\fR) and compute the
-.VE
corresponding distance either in integer pixels or floating-point millimeters.
In either case,
-.VS 8.1
\fIobjPtr\fR or \fIstring\fR
-.VE
specifies a screen distance as a
floating-point number followed by one of the following characters
that indicates units:
@@ -81,14 +71,13 @@ The number specifies a distance in millimeters on the screen.
The number specifies a distance in printer's points (1/72 inch)
on the screen.
.PP
-.VS 8.1
\fBTk_GetPixelsFromObj\fR converts the value of \fIobjPtr\fR to the
nearest even number of pixels and stores that value at \fI*intPtr\fR.
It returns \fBTCL_OK\fR under normal circumstances.
If an error occurs (e.g. \fIobjPtr\fR contains a number followed
-by a character that isn't one of the ones above) then
+by a character that is not one of the ones above) then
\fBTCL_ERROR\fR is returned and an error message is left
-in \fIinterp\fR's result if \fIinterp\fR isn't NULL.
+in \fIinterp\fR's result if \fIinterp\fR is not NULL.
\fBTk_GetPixelsFromObj\fR caches information about the return
value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetPixelsFromObj\fR with the same \fIobjPtr\fR.
@@ -103,7 +92,6 @@ return value, so \fBTk_GetAnchor\fR is less efficient than
\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.
-.VE
.SH KEYWORDS
centimeters, convert, inches, millimeters, pixels, points, screen units
diff --git a/doc/GetRelief.3 b/doc/GetRelief.3
index 209fb67..b97a615 100644
--- a/doc/GetRelief.3
+++ b/doc/GetRelief.3
@@ -14,52 +14,53 @@ Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief \- translate between strings
.nf
\fB#include <tk.h>\fR
.sp
-.VS 8.1
int
\fBTk_GetReliefFromObj(\fIinterp, objPtr, reliefPtr\fB)\fR
-.VE
.sp
int
\fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfRelief(\fIrelief\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *reliefPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.VS 8.1 br
.AP Tcl_Obj *objPtr in/out
-String value contains name of relief (one of \fBflat\fR, \fBgroove\fR,
-\fBraised\fR, \fBridge\fR, \fBsolid\fR, or \fBsunken\fR);
-internal rep will be modified to cache corresponding relief value.
+String value contains name of relief, one of
+.QW flat ,
+.QW groove ,
+.QW raised ,
+.QW ridge ,
+.QW solid ,
+or
+.QW sunken ;
+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
a string.
-.VE
.AP int *reliefPtr out
Pointer to location in which to store relief value corresponding to
\fIobjPtr\fR or \fIname\fR.
-.AP "CONST char" *name
+.AP "const char" *name
Name of the relief.
.AP int relief in
-Relief value (one of TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
-TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE).
+Relief value (one of \fBTK_RELIEF_FLAT\fR, \fBTK_RELIEF_RAISED\fR,
+\fBTK_RELIEF_SUNKEN\fR, \fBTK_RELIEF_GROOVE\fR, \fBTK_RELIEF_SOLID\fR,
+or \fBTK_RELIEF_RIDGE\fR).
.BE
-
.SH DESCRIPTION
.PP
-.VS 8.1
\fBTk_GetReliefFromObj\fR places in \fI*reliefPtr\fR the relief value
corresponding to the value of \fIobjPtr\fR. This value will be one of
-TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
-TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE.
-Under normal circumstances the return value is TCL_OK and
+\fBTK_RELIEF_FLAT\fR, \fBTK_RELIEF_RAISED\fR, \fBTK_RELIEF_SUNKEN\fR,
+\fBTK_RELIEF_GROOVE\fR, \fBTK_RELIEF_SOLID\fR, or \fBTK_RELIEF_RIDGE\fR.
+Under normal circumstances the return value is \fBTCL_OK\fR and
\fIinterp\fR is unused.
-If \fIobjPtr\fR doesn't contain one of the valid relief names
-or an abbreviation of one of them, then TCL_ERROR is returned,
+If \fIobjPtr\fR does not contain one of the valid relief names
+or an abbreviation of one of them, then \fBTCL_ERROR\fR is returned,
\fI*reliefPtr\fR is unmodified, and an error message
-is stored in \fIinterp\fR's result if \fIinterp\fR isn't NULL.
+is stored in \fIinterp\fR's result if \fIinterp\fR is not NULL.
\fBTk_GetReliefFromObj\fR caches information about the return
value in \fIobjPtr\fR, which speeds up future calls to
\fBTk_GetReliefFromObj\fR with the same \fIobjPtr\fR.
@@ -69,13 +70,12 @@ that the description of the relief is specified with a string instead
of an object. This prevents \fBTk_GetRelief\fR from caching the
return value, so \fBTk_GetRelief\fR is less efficient than
\fBTk_GetReliefFromObj\fR.
-.VE
.PP
\fBTk_NameOfRelief\fR is the logical inverse of \fBTk_GetRelief\fR.
Given a relief value it returns the corresponding string (\fBflat\fR,
\fBraised\fR, \fBsunken\fR, \fBgroove\fR, \fBsolid\fR, or \fBridge\fR).
-If \fIrelief\fR isn't a legal relief value, then ``unknown relief''
+If \fIrelief\fR is not a legal relief value, then
+.QW "unknown relief"
is returned.
-
.SH KEYWORDS
name, relief, string
diff --git a/doc/GetRootCrd.3 b/doc/GetRootCrd.3
index 48d4d70..7c46b5f 100644
--- a/doc/GetRootCrd.3
+++ b/doc/GetRootCrd.3
@@ -26,7 +26,6 @@ corresponding to left edge of \fItkwin\fR's border.
Pointer to location in which to store root-window y-coordinate
corresponding to top edge of \fItkwin\fR's border.
.BE
-
.SH DESCRIPTION
.PP
This procedure scans through the structural information maintained
@@ -34,8 +33,7 @@ by Tk to compute the root-window coordinates corresponding to
the upper-left corner of \fItkwin\fR's border. If \fItkwin\fR has
no border, then \fBTk_GetRootCoords\fR returns the root-window
coordinates corresponding to location (0,0) in \fItkwin\fR.
-\fBTk_GetRootCoords\fR is relatively efficient, since it doesn't have to
+\fBTk_GetRootCoords\fR is relatively efficient, since it does not have to
communicate with the X server.
-
.SH KEYWORDS
coordinates, root window
diff --git a/doc/GetScroll.3 b/doc/GetScroll.3
index 6ac19ce..43fbab8 100644
--- a/doc/GetScroll.3
+++ b/doc/GetScroll.3
@@ -25,13 +25,13 @@ int
Interpreter to use for error reporting.
.AP int argc in
Number of strings in \fIargv\fR array.
-.AP "CONST char" *argv[] in
+.AP "const char" *argv[] in
Argument strings. These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
.AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array.
-.AP "Tcl_Obj *CONST" objv[] in
+.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.
diff --git a/doc/GetSelect.3 b/doc/GetSelect.3
index a747869..4f8fa8d 100644
--- a/doc/GetSelect.3
+++ b/doc/GetSelect.3
@@ -44,9 +44,9 @@ should have arguments and result that match the type
\fBTk_GetSelProc\fR:
.CS
typedef int Tk_GetSelProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- char *\fIportion\fR);
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ char *\fIportion\fR);
.CE
The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR
will be copies of the corresponding arguments to
@@ -65,13 +65,13 @@ values separated by white space.
.PP
\fBTk_GetSelection\fR returns to its caller when the selection has
been completely retrieved and processed by \fIproc\fR, or when a
-fatal error has occurred (e.g. the selection owner didn't respond
-promptly). \fBTk_GetSelection\fR normally returns TCL_OK; if
-an error occurs, it returns TCL_ERROR and leaves an error message
+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
-TCL_OK or TCL_ERROR. If \fIproc\fR encounters an error in dealing with the
+\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 TCL_ERROR; this will abort the selection retrieval.
+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 8865fc7..32d4cbf 100644
--- a/doc/GetUid.3
+++ b/doc/GetUid.3
@@ -29,7 +29,8 @@ to \fIstring\fR.
Unique identifiers are similar to atoms in Lisp, and are used
in Tk to speed up comparisons and
searches. A unique identifier (type Tk_Uid) is a string pointer
-and may be used anywhere that a variable of type ``char *''
+and may be used anywhere that a variable of type
+.QW "char *"
could be used. However, there is guaranteed to be exactly
one unique identifier for any given string value. If \fBTk_GetUid\fR
is called twice, once with string \fIa\fR and once with string
diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3
index 84e3299..d95f3ee 100644
--- a/doc/GetVRoot.3
+++ b/doc/GetVRoot.3
@@ -31,15 +31,16 @@ Points to word in which to store height of virtual root.
.SH DESCRIPTION
.PP
-\fBTkGetVRootGeometry\fR returns geometry information about the virtual
-root window associated with \fItkwin\fR. The ``associated'' virtual
-root is the one in which \fItkwin\fR's nearest top-level ancestor (or
+\fBTk_GetVRootGeometry\fR returns geometry information about the virtual
+root window associated with \fItkwin\fR. The
+.QW associated
+virtual root is the one in which \fItkwin\fR's nearest top-level ancestor (or
\fItkwin\fR itself if it is a top-level window) has
been reparented by the window manager. This window is identified by
a \fB__SWM_ROOT\fR or \fB__WM_ROOT\fR property placed on the top-level
window by the window manager.
If \fItkwin\fR is not associated with a virtual root (e.g.
-because the window manager doesn't use virtual roots) then *\fIxPtr\fR and
+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.
diff --git a/doc/GetVisual.3 b/doc/GetVisual.3
index 01f87ba..2796660 100644
--- a/doc/GetVisual.3
+++ b/doc/GetVisual.3
@@ -22,7 +22,7 @@ Visual *
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which the visual will be used.
-.AP "CONST char" *string in
+.AP "const char" *string in
String that identifies the desired visual. See below for
valid formats.
.AP int *depthPtr out
@@ -31,7 +31,6 @@ Depth of returned visual gets stored here.
If non-NULL then a suitable colormap for visual is found and its
identifier is stored here.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_GetVisual\fR takes a string description of a visual and
@@ -74,23 +73,28 @@ as \fItkwin\fR.
Use the visual whose X identifier is \fInumber\fR.
.TP 15
\fBbest\fR ?\fIdepth\fR?
-Choose the ``best possible'' visual, using the following rules, in
-decreasing order of priority:
-(a) a visual that has exactly the desired depth is best, followed
+Choose the
+.QW "best possible"
+visual, using the following rules, in decreasing order of priority:
+.RS
+.IP (a)
+a visual that has exactly the desired depth is best, followed
by a visual with greater depth than requested (but as little extra
as possible), followed by a visual with less depth than requested
(but as great a depth as possible);
-(b) if no \fIdepth\fR is specified, then the deepest available visual
+.IP (b)
+if no \fIdepth\fR is specified, then the deepest available visual
is chosen;
-(c) \fBpseudocolor\fR is better than \fBtruecolor\fR or \fBdirectcolor\fR,
+.IP (c)
+\fBpseudocolor\fR is better than \fBtruecolor\fR or \fBdirectcolor\fR,
which are better than \fBstaticcolor\fR, which is better than
\fBstaticgray\fR or \fBgrayscale\fR;
-(d) the default visual for the screen is better than any other visual.
-
+.IP (d)
+the default visual for the screen is better than any other visual.
+.RE
.SH CREDITS
.PP
The idea for \fBTk_GetVisual\fR, and the first implementation, came
from Paul Mackerras.
-
.SH KEYWORDS
colormap, screen, visual
diff --git a/doc/Grab.3 b/doc/Grab.3
index 48605e5..6bf1b69 100644
--- a/doc/Grab.3
+++ b/doc/Grab.3
@@ -45,8 +45,8 @@ keyboard events intended for a windows within the same application
specifies the window on whose behalf the pointer is to be grabbed.
\fIGrabGlobal\fR indicates whether the grab should be global or
application local; if it is non-zero, it means the grab should be
-global. Normally, \fBTk_Grab\fR returns TCL_OK; if an error occurs
-and the grab cannot be set, TCL_ERROR is returned and an error message
+global. Normally, \fBTk_Grab\fR returns \fBTCL_OK\fR; if an error occurs
+and the grab cannot be set, \fBTCL_ERROR\fR is returned and an error message
is left if \fIinterp\fR's result. Once this call completes
successfully, no window outside the tree rooted at \fItkwin\fR will
receive pointer- or keyboard-related events until the next call to
diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3
index 7909274..4d24c14 100644
--- a/doc/HandleEvent.3
+++ b/doc/HandleEvent.3
@@ -18,14 +18,15 @@ Tk_HandleEvent \- invoke event handlers for window system events
.SH ARGUMENTS
.AS XEvent *eventPtr
.AP XEvent *eventPtr in
-Pointer to X event to dispatch to relevant handler(s).
+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
-\fBTk_DoOneEvent\fR), and in a few other cases within Tk.
+\fBTcl_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
diff --git a/doc/Inactive.3 b/doc/Inactive.3
new file mode 100644
index 0000000..8f37553
--- /dev/null
+++ b/doc/Inactive.3
@@ -0,0 +1,36 @@
+'\"
+'\" Copyright (c) 1998-2000 by Scriptics Corporation.
+'\" All rights reserved.
+'\"
+.so man.macros
+.TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_GetUserInactiveTime, Tk_ResetUserInactiveTime \- discover user inactivity time
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+long
+\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
+.sp
+\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR
+.SH ARGUMENTS
+.AS Display *display
+.AP Display *display in
+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
+have passed since the last user interaction (usually via keyboard or
+mouse) with the respective display. On systems and displays that do not
+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 79b3869..a4ca96c 100644
--- a/doc/InternAtom.3
+++ b/doc/InternAtom.3
@@ -17,13 +17,13 @@ Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms
Atom
\fBTk_InternAtom(\fItkwin, name\fR)
.sp
-CONST char *
+const char *
\fBTk_GetAtomName(\fItkwin, atom\fR)
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
Token for window. Used to map atom or name relative to a particular display.
-.AP "CONST char" *name in
+.AP "const char" *name in
String name for which atom is desired.
.AP Atom atom in
Atom for which corresponding string name is desired.
@@ -42,7 +42,8 @@ by \fBTk_GetAtomName\fR is in Tk's storage: the caller need
not free this space when finished with the string, and the caller
should not modify the contents of the returned string.
If there is no atom \fIatom\fR on \fItkwin\fR's display,
-then \fBTk_GetAtomName\fR returns the string ``?bad atom?''.
+then \fBTk_GetAtomName\fR returns the string
+.QW "?bad atom?" .
.PP
Tk caches
the information returned by \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3
index d34e22e..c96a646 100644
--- a/doc/MaintGeom.3
+++ b/doc/MaintGeom.3
@@ -62,7 +62,7 @@ is unmapped, the slave is automatically removed by the screen
by X.
.PP
\fBTk_MaintainGeometry\fR deals with these problems for slaves
-whose masters aren't their parents, as well as handling the simpler
+whose masters are not their parents, as well as handling the simpler
case of slaves whose masters are their parents.
\fBTk_MaintainGeometry\fR is typically called by a window manager
once it has decided where a slave should be positioned relative
@@ -95,7 +95,6 @@ If \fBTk_MaintainGeometry\fR is called repeatedly for the same
\fImaster\fR\-\fIslave\fR pair, the information from the most
recent call supersedes any older information.
If \fBTk_UnmaintainGeometry\fR is called for a \fImaster\fR\-\fIslave\fR
-pair that is isn't currently managed, the call has no effect.
-
+pair that is is not currently managed, the call has no effect.
.SH KEYWORDS
geometry manager, map, master, parent, position, slave, unmap
diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3
index 0ceff3a..5dcf688 100644
--- a/doc/ManageGeom.3
+++ b/doc/ManageGeom.3
@@ -19,16 +19,15 @@ Tk_ManageGeometry \- arrange to handle geometry requests for a window
.AS Tk_GeometryProc clientData
.AP Tk_Window tkwin in
Token for window to be managed.
-.AP Tk_GeomMgr *mgrPtr in
+.AP "const Tk_GeomMgr" *mgrPtr in
Pointer to data structure containing information about the
geometry manager, or NULL to indicate that \fItkwin\fR's geometry
-shouldn't be managed anymore.
+should not be managed anymore.
The data structure pointed to by \fImgrPtr\fR must be static:
Tk keeps a reference to it as long as the window is managed.
.AP ClientData clientData in
Arbitrary one-word value to pass to geometry manager callbacks.
.BE
-
.SH DESCRIPTION
.PP
\fBTk_ManageGeometry\fR arranges for a particular geometry manager,
@@ -43,9 +42,9 @@ The structure pointed to by \fImgrPtr\fR contains information about
the geometry manager:
.CS
typedef struct {
- char *\fIname\fR;
- Tk_GeomRequestProc *\fIrequestProc\fR;
- Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR;
+ const char *\fIname\fR;
+ Tk_GeomRequestProc *\fIrequestProc\fR;
+ Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR;
} Tk_GeomMgr;
.CE
The \fIname\fR field is the textual name for the geometry manager,
@@ -59,8 +58,8 @@ slave to change its desired geometry.
type \fBTk_GeomRequestProc\fR:
.CS
typedef void Tk_GeomRequestProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\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.
@@ -82,8 +81,8 @@ is the same as the window's current geometry manager.
arguments and results that match the following prototype:
.CS
typedef void Tk_GeomLostSlaveProc(
- ClientData \fIclientData\fR,
- Tk_Window \fItkwin\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.
diff --git a/doc/MapWindow.3 b/doc/MapWindow.3
index bf54dea..25d7ff5 100644
--- a/doc/MapWindow.3
+++ b/doc/MapWindow.3
@@ -29,7 +29,7 @@ Token for window.
These procedures may be used to map and unmap windows
managed by Tk. \fBTk_MapWindow\fR maps the window given
by \fItkwin\fR, and also creates an X window corresponding
-to \fItkwin\fR if it doesn't already exist. See the
+to \fItkwin\fR if it does not already exist. See the
\fBTk_CreateWindow\fR manual entry for information on
deferred window creation.
\fBTk_UnmapWindow\fR unmaps \fItkwin\fR's window
@@ -37,7 +37,7 @@ from the screen.
.PP
If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was
used to create a child window), then event handlers interested in map
-and unmap events are invoked immediately. If \fItkwin\fR isn't an
+and unmap events are invoked immediately. If \fItkwin\fR is not an
internal window, then the event handlers will be invoked later, after
X has seen the request and returned an event for it.
.PP
diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3
index 059d8e8..c8164f3 100644
--- a/doc/MeasureChar.3
+++ b/doc/MeasureChar.3
@@ -19,10 +19,8 @@ int
int
\fBTk_TextWidth(\fItkfont, string, numBytes\fB)\fR
.sp
-void
\fBTk_DrawChars(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fB)\fR
.sp
-void
\fBTk_UnderlineChars(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fB)\fR
.sp
.SH ARGUMENTS
@@ -35,24 +33,22 @@ Text to be measured or displayed. Need not be null terminated. Any
non-printing meta-characters in the string (such as tabs, newlines, and
other control characters) will be measured or displayed in a
platform-dependent manner.
-.VS 8.1
.AP int numBytes in
The maximum number of bytes to consider when measuring or drawing
\fIstring\fR. Must be greater than or equal to 0.
-.VE 8.1
.AP int maxPixels in
If \fImaxPixels\fR is >= 0, it specifies the longest permissible
line length in pixels. Characters from \fIstring\fR are processed only
until this many pixels have been covered. If \fImaxPixels\fR is < 0, then
the line length is unbounded and the \fIflags\fR argument is ignored.
.AP int flags in
-Various flag bits OR-ed together: TK_PARTIAL_OK means include a character
+Various flag bits OR-ed together: \fBTK_PARTIAL_OK\fR means include a character
as long as any part of it fits in the length given by \fImaxPixels\fR;
otherwise, a character must fit completely to be considered.
-TK_WHOLE_WORDS means stop on a word boundary, if possible. If
-TK_AT_LEAST_ONE is set, it means return at least one character even if no
+\fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If
+\fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no
characters could fit in the length given by \fImaxPixels\fR. If
-TK_AT_LEAST_ONE is set and TK_WHOLE_WORDS is also set, it means that if
+\fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if
not even one word fits on the line, return the first few letters of the
word that did fit; if not even one letter of the word fit, then the first
letter will still be returned.
@@ -69,7 +65,6 @@ must be the same as the \fItkfont\fR.
.AP int "x, y" in
Coordinates at which to place the left edge of the baseline when displaying
\fIstring\fR.
-.VS 8.1
.AP int firstByte in
The index of the first byte of the first character to underline in the
\fIstring\fR. Underlining begins at the left edge of this character.
@@ -77,23 +72,19 @@ The index of the first byte of the first character to underline in the
The index of the first byte of the last character up to which the
underline will be drawn. The character specified by \fIlastByte\fR
will not itself be underlined.
-.VE 8.1
.BE
-
.SH DESCRIPTION
.PP
These routines are for measuring and displaying simple single-font,
-single-line, strings. To measure and display single-font, multi-line,
+single-line strings. To measure and display single-font, multi-line,
justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR.
There is no programming interface in the core of Tk that supports
multi-font, multi-line text; support for that behavior must be built on
top of simpler layers.
-.VS 8.1
Note that the interfaces described here are
byte-oriented not character-oriented, so index values coming from Tcl
scripts need to be converted to byte offsets using the
\fBTcl_UtfAtIndex\fR and related routines.
-.VE 8.1
.PP
A glyph is the displayable picture of a letter, number, or some other
symbol. Not all character codes in a given font have a glyph.
@@ -125,11 +116,12 @@ space in pixels the given \fIstring\fR needs.
given \fIdrawable\fR.
.PP
\fBTk_UnderlineChars\fR underlines the given range of characters in the
-given \fIstring\fR. It doesn't draw the characters (which are assumed to
+given \fIstring\fR. It does not draw the characters (which are assumed to
have been displayed previously by \fBTk_DrawChars\fR); it just draws the
underline. This procedure is used to underline a few characters without
having to construct an underlined font. To produce natively underlined
text, the appropriate underlined font should be constructed and used.
-
+.SH "SEE ALSO"
+font(n), FontId(3)
.SH KEYWORDS
-font
+font, measurement
diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3
index 88accaf..24653ab 100644
--- a/doc/MoveToplev.3
+++ b/doc/MoveToplev.3
@@ -44,7 +44,7 @@ similar in function to the \fBwm geometry\fR Tcl command except that
negative offsets cannot be specified. It is invoked by widgets such as
menus that want to appear at a particular place on the screen.
.PP
-When \fBTk_MoveToplevelWindow\fR is called it doesn't immediately
+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.
diff --git a/doc/Name.3 b/doc/Name.3
index 4497ea6..73b09b1 100644
--- a/doc/Name.3
+++ b/doc/Name.3
@@ -28,7 +28,7 @@ Tk_Window
Token for window.
.AP Tcl_Interp *interp out
Interpreter to use for error reporting.
-.AP "CONST char" *pathName in
+.AP "const char" *pathName in
Character string containing path name of window.
.BE
@@ -53,9 +53,17 @@ 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 ``.''; its children have names like
-``.a'' and ``.b''; their children have names like ``.a.aa'' and
-``.b.bb''; and so on. A window is considered to be be a child of
+an application has the path name
+.QW . ;
+its children have names like
+.QW .a
+and
+.QW .b ;
+their children have names like
+.QW .a.aa
+and
+.QW .b.bb ;
+and so on. A window is considered to be a child of
another window for naming purposes if the second window was named
as the first window's \fIparent\fR when the first window was created.
This is not always the same as the X window hierarchy. For
diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3
index 3e05a14..a1a69a8 100644
--- a/doc/NameOfImg.3
+++ b/doc/NameOfImg.3
@@ -13,7 +13,7 @@ Tk_NameOfImage \- Return name of image.
.nf
\fB#include <tk.h>\fR
.sp
-CONST char *
+const char *
\fBTk_NameOfImage\fR(\fItypePtr\fR)
.SH ARGUMENTS
.AS Tk_ImageMaster *masterPtr
diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3
index 07c7551..b7592b7 100644
--- a/doc/ParseArgv.3
+++ b/doc/ParseArgv.3
@@ -26,17 +26,18 @@ no Tk options will be processed.
.AP int argcPtr in/out
Pointer to number of arguments in argv; gets modified to hold
number of unprocessed arguments that remain after the call.
-.AP "CONST char" **argv in/out
+.AP "const char" **argv in/out
Command line arguments passed to main program. Modified to
hold unprocessed arguments that remain after the call.
.AP Tk_ArgvInfo *argTable in
Array of argument descriptors, terminated by element with
-type TK_ARGV_END.
+type \fBTK_ARGV_END\fR.
.AP int flags in
If non-zero, then it specifies one or more flags that control the
parsing of arguments. Different flags may be OR'ed together.
-The flags currently defined are TK_ARGV_DONT_SKIP_FIRST_ARG,
-TK_ARGV_NO_ABBREV, TK_ARGV_NO_LEFTOVERS, and TK_ARGV_NO_DEFAULTS.
+The flags currently defined are \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR,
+\fBTK_ARGV_NO_ABBREV\fR, \fBTK_ARGV_NO_LEFTOVERS\fR, and
+\fBTK_ARGV_NO_DEFAULTS\fR.
.BE
.SH DESCRIPTION
.PP
@@ -52,13 +53,13 @@ the caller. At the end of the call
arguments that are left in \fIargv\fR, and \fIargv[*argcPtr]\fR
will hold the value NULL. Normally, \fBTk_ParseArgv\fR
assumes that \fIargv[0]\fR is a command name, so it is treated like
-an argument that doesn't match \fIargTable\fR and returned to the
-caller; however, if the TK_ARGV_DONT_SKIP_FIRST_ARG bit is set in
+an argument that does not match \fIargTable\fR and returned to the
+caller; however, if the \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR bit is set in
\fIflags\fR then \fIargv[0]\fR will be processed just like the other
elements of \fIargv\fR.
.PP
-\fBTk_ParseArgv\fR normally returns the value TCL_OK. If an error
-occurs while parsing the arguments, then TCL_ERROR is returned and
+\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
the event of an error return, \fI*argvPtr\fR will not have been
@@ -69,14 +70,17 @@ 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;
- int \fItype\fR;
- char *\fIsrc\fR;
- char *\fIdst\fR;
- char *\fIhelp\fR;
+ char *\fIkey\fR;
+ int \fItype\fR;
+ char *\fIsrc\fR;
+ char *\fIdst\fR;
+ char *\fIhelp\fR;
} Tk_ArgvInfo;
.CE
-The \fIkey\fR field is a string such as ``\-display'' or ``\-bg''
+The \fIkey\fR field is a string such as
+.QW \-display
+or
+.QW \-bg
that is compared with the values in \fIargv\fR. \fIType\fR
indicates how to process an argument that matches \fIkey\fR
(more on this below). \fISrc\fR and \fIdst\fR are additional
@@ -101,11 +105,13 @@ skipped and returned to the caller.
.PP
Once a matching argument specifier is found, \fBTk_ParseArgv\fR
processes the argument according to the \fItype\fR field of the
-specifier. The argument that matched \fIkey\fR is called ``the matching
-argument'' in the descriptions below. As part of the processing,
+specifier. The argument that matched \fIkey\fR is called
+.QW "the matching argument"
+in the descriptions below. As part of the processing,
\fBTk_ParseArgv\fR may also use the next argument in \fIargv\fR
-after the matching argument, which is called ``the following
-argument''. The legal values for \fItype\fR, and the processing
+after the matching argument, which is called
+.QW "the following argument" .
+The legal values for \fItype\fR, and the processing
that they cause, are as follows:
.TP
\fBTK_ARGV_END\fR
@@ -120,8 +126,11 @@ The matching argument is discarded.
.TP
\fBTK_ARGV_INT\fR
The following argument must contain an
-integer string in the format accepted by \fBstrtol\fR (e.g. ``0''
-and ``0x'' prefixes may be used to specify octal or hexadecimal
+integer string in the format accepted by \fBstrtol\fR (e.g.
+.QW 0
+and
+.QW 0x
+prefixes may be used to specify octal or hexadecimal
numbers, respectively). \fIDst\fR is treated as a pointer to an
integer; the following argument is converted to an integer value
and stored at \fI*dst\fR. \fISrc\fR is ignored. The matching
@@ -130,7 +139,7 @@ and following arguments are discarded from \fIargv\fR.
\fBTK_ARGV_FLOAT\fR
The following argument must contain a floating-point number in
the format accepted by \fBstrtol\fR.
-\fIDst\fR is treated as the address of an double-precision
+\fIDst\fR is treated as the address of a double-precision
floating point value; the following argument is converted to a
double-precision value and stored at \fI*dst\fR. The matching
and following arguments are discarded from \fIargv\fR.
@@ -142,7 +151,7 @@ argument, and discards the matching and following arguments from
\fIargv\fR. \fISrc\fR is ignored.
.TP
\fBTK_ARGV_UID\fR
-This form is similar to TK_ARGV_STRING, except that the argument
+This form is similar to \fBTK_ARGV_STRING\fR, except that the argument
is turned into a Tk_Uid by calling \fBTk_GetUid\fR.
\fIDst\fR is treated as a pointer to a
Tk_Uid; \fBTk_ParseArgv\fR stores at \fI*dst\fR the Tk_Uid
@@ -159,7 +168,7 @@ argument is discarded. If \fItkwin\fR is NULL, then argument
specifiers of this type are ignored (as if they did not exist).
.TP
\fBTK_ARGV_OPTION_VALUE\fR
-This form is similar to TK_ARGV_CONST_OPTION, except that the
+This form is similar to \fBTK_ARGV_CONST_OPTION\fR, except that the
value of the option is taken from the following argument instead
of from \fIsrc\fR. \fIDst\fR is used as the name of the option.
\fISrc\fR is ignored. The matching and following arguments
@@ -178,18 +187,18 @@ specifiers of this type are ignored (as if they did not exist).
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
-and \fBTk_ParseArgv\fR returns TCL_ERROR. When this happens, the
+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 TK_ARGV_HELP specifier is NULL, then the specifier will
+field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will
never match any arguments; in this case the specifier simply provides
extra documentation, which will be included when some other
-TK_ARGV_HELP entry causes help information to be returned.
+\fBTK_ARGV_HELP\fR entry causes help information to be returned.
.TP
\fBTK_ARGV_REST\fR
This option is used by programs or commands that allow the last
several of their options to be the name and/or options for some
other program. If a \fBTK_ARGV_REST\fR argument is found, then
-\fBTk_ParseArgv\fR doesn't process any
+\fBTk_ParseArgv\fR does not process any
of the remaining arguments; it returns them all at
the beginning of \fIargv\fR (along with any other unprocessed arguments).
In addition, \fBTk_ParseArgv\fR treats \fIdst\fR as the address of an
@@ -206,16 +215,16 @@ The procedure should have the following structure:
.CS
int
\fIfunc\fR(\fIdst\fR, \fIkey\fR, \fInextArg\fR)
- char *\fIdst\fR;
- char *\fIkey\fR;
- char *\fInextArg\fR;
+ char *\fIdst\fR;
+ char *\fIkey\fR;
+ char *\fInextArg\fR;
{
}
.CE
The \fIdst\fR and \fIkey\fR parameters will contain the
corresponding fields from the \fIargTable\fR entry, and
\fInextArg\fR will point to the following argument from \fIargv\fR
-(or NULL if there aren't any more arguments left in \fIargv\fR).
+(or NULL if there are not any more arguments left in \fIargv\fR).
If \fIfunc\fR uses \fInextArg\fR (so that
\fBTk_ParseArgv\fR should discard it), then it should return 1. Otherwise it
should return 0 and \fBTkParseArgv\fR will process the following
@@ -232,11 +241,11 @@ form:
.CS
int
\fIgenfunc\fR(dst, interp, key, argc, argv)
- char *\fIdst\fR;
- Tcl_Interp *\fIinterp\fR;
- char *\fIkey\fR;
- int \fIargc\fR;
- char **\fIargv\fR;
+ char *\fIdst\fR;
+ Tcl_Interp *\fIinterp\fR;
+ char *\fIkey\fR;
+ int \fIargc\fR;
+ char **\fIargv\fR;
{
}
.CE
@@ -251,16 +260,15 @@ then return any that are left by compacting them to the beginning of
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,
-in the usual Tcl fashion, and return -1; when this happens
-\fBTk_ParseArgv\fR will abort its processing and return TCL_ERROR.
+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"
.TP
\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR
\fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program
or command name, and returns it to the caller just as if it
-hadn't matched \fIargTable\fR. If this flag is given, then
+had not matched \fIargTable\fR. If this flag is given, then
\fIargv[0]\fR is not given special treatment.
.TP
\fBTK_ARGV_NO_ABBREV\fR
@@ -271,17 +279,16 @@ only exact matches will be acceptable.
\fBTK_ARGV_NO_LEFTOVERS\fR
Normally, \fBTk_ParseArgv\fR returns unrecognized arguments to the
caller. If this bit is set in \fIflags\fR then \fBTk_ParseArgv\fR
-will return an error if it encounters any argument that doesn't
+will return an error if it encounters any argument that does not
match \fIargTable\fR. The only exception to this rule is \fIargv[0]\fR,
which will be returned to the caller with no errors as
-long as TK_ARGV_DONT_SKIP_FIRST_ARG isn't specified.
+long as \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR is not specified.
.TP
\fBTK_ARGV_NO_DEFAULTS\fR
Normally, \fBTk_ParseArgv\fR searches an internal table of
standard argument specifiers in addition to \fIargTable\fR. If
this bit is set in \fIflags\fR, then \fBTk_ParseArgv\fR will
use only \fIargTable\fR and not its default table.
-
.SH EXAMPLE
.PP
Here is an example definition of an \fIargTable\fR and
@@ -303,32 +310,32 @@ Boolean exec = FALSE;
* Define option descriptions.
*/
Tk_ArgvInfo argTable[] = {
- {"-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag,
- "Turn on debugging printfs"},
- {"-N", TK_ARGV_INT, (char *) NULL, (char *) &numReps,
- "Number of repetitions"},
- {"-of", TK_ARGV_STRING, (char *) NULL, (char *) &fileName,
- "Name of file for output"},
- {"x", TK_ARGV_REST, (char *) NULL, (char *) &exec,
- "File to exec, followed by any arguments (must be last argument)."},
- {(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
- (char *) NULL}
+ {"\-X", TK_ARGV_CONSTANT, (char *) 1, (char *) &debugFlag,
+ "Turn on debugging printfs"},
+ {"\-N", TK_ARGV_INT, (char *) NULL, (char *) &numReps,
+ "Number of repetitions"},
+ {"\-of", TK_ARGV_STRING, (char *) NULL, (char *) &fileName,
+ "Name of file for output"},
+ {"x", TK_ARGV_REST, (char *) NULL, (char *) &exec,
+ "File to exec, followed by any arguments (must be last argument)."},
+ {(char *) NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
+ (char *) NULL}
};
main(argc, argv)
- int argc;
- char *argv[];
+ int argc;
+ char *argv[];
{
- \&...
+ \&...
- if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) {
- fprintf(stderr, "%s\en", interp->result);
- exit(1);
- }
+ if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) {
+ fprintf(stderr, "%s\en", interp->result);
+ exit(1);
+ }
- /*
- * Remainder of the program.
- */
+ /*
+ * Remainder of the program.
+ */
}
.CE
.PP
@@ -337,13 +344,15 @@ Note that default values can be assigned to variables named in
particular arguments are present in \fIargv\fR.
Here are some example command lines and their effects.
.CS
-prog -N 200 infile # just sets the numReps variable to 200
-prog -of out200 infile # sets fileName to reference "out200"
-prog -XN 10 infile # sets the debug flag, also sets numReps
+prog \-N 200 infile # just sets the numReps variable to 200
+prog \-of out200 infile # sets fileName to reference "out200"
+prog \-XN 10 infile # sets the debug flag, also sets numReps
.CE
In all of the above examples, \fIargc\fR will be set by \fBTk_ParseArgv\fR to 2,
-\fIargv\fR[0] will be ``prog'', \fIargv\fR[1] will be ``infile'',
+\fIargv\fR[0] will be
+.QW prog ,
+\fIargv\fR[1] will be
+.QW infile ,
and \fIargv\fR[2] will be NULL.
-
.SH KEYWORDS
arguments, command line, options
diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3
index 8bd3099..5eada22 100644
--- a/doc/QWinEvent.3
+++ b/doc/QWinEvent.3
@@ -24,7 +24,8 @@ Display for which to control motion event collapsing.
.AP int collapse in
Indicates whether motion events should be collapsed or not.
.AP XEvent *eventPtr in
-An event to add to the event queue.
+An event to add to the event queue. It is important
+that all unused fields of the structure be set to zero.
.AP Tcl_QueuePosition position in
Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR.
diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3
index b1cc9b8..da8b822 100644
--- a/doc/RestrictEv.3
+++ b/doc/RestrictEv.3
@@ -41,8 +41,8 @@ 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);
+ ClientData \fIclientData\fR,
+ XEvent *\fIeventPtr\fR);
.CE
The \fIclientData\fR argument is a copy of the \fIclientData\fR passed
to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with
@@ -68,8 +68,9 @@ bindings with the \fBbind\fR Tcl command or by calling
\fBTk_CreateEventHandler\fR and \fBTk_DeleteEventHandler\fR from C.
The main place where \fBTk_RestrictEvents\fR must be used is when
performing synchronous actions (for example, if you need to wait
-for a particular event to occur on a particular window but you don't
-want to invoke any handlers for any other events). The ``obvious''
+for a particular event to occur on a particular window but you do not
+want to invoke any handlers for any other events). The
+.QW obvious
solution in these situations is to call \fBXNextEvent\fR or
\fBXWindowEvent\fR, but these procedures cannot be used because
Tk keeps its own event queue that is separate from the X event
diff --git a/doc/SetAppName.3 b/doc/SetAppName.3
index ef9b331..b2df656 100644
--- a/doc/SetAppName.3
+++ b/doc/SetAppName.3
@@ -9,19 +9,19 @@
.TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_SetAppName \- Set the name of an application for ``send'' commands
+Tk_SetAppName \- Set the name of an application for 'send' commands
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
-CONST char *
+const char *
\fBTk_SetAppName\fR(\fItkwin, name\fR)
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
Token for window in application. Used only to select a particular
application.
-.AP "CONST char" *name in
+.AP "const char" *name in
Name under which to register the application.
.BE
@@ -35,7 +35,8 @@ display will be able to use the \fBsend\fR command to invoke operations
in the application.
If \fIname\fR is already in use by some other application on the
display, then a new name will be generated by appending
-``\fB #2\fR'' to \fIname\fR; if this name is also in use,
+.QW "\fB #2\fR"
+to \fIname\fR; if this name is also in use,
the number will be incremented until an unused name is found.
The return value from the procedure is a pointer to the name actually
used.
@@ -54,7 +55,7 @@ becomes inaccessible via \fBsend\fR.
The application can be made accessible again by calling \fBTk_SetAppName\fR.
.PP
\fBTk_SetAppName\fR is called automatically by \fBTk_Init\fR,
-so applications don't normally need to call it explicitly.
+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.
diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3
index 1ab9a6c..e8820b6 100644
--- a/doc/SetClassProcs.3
+++ b/doc/SetClassProcs.3
@@ -34,10 +34,10 @@ are used as callbacks in different places.
The structure pointed to by \fIprocs\fR contains the following:
.CS
typedef struct Tk_ClassProcs {
- unsigned int \fIsize\fR;
- Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
- Tk_ClassCreateProc *\fIcreateProc\fR;
- Tk_ClassModalProc *\fImodalProc\fR;
+ unsigned int \fIsize\fR;
+ Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
+ Tk_ClassCreateProc *\fIcreateProc\fR;
+ Tk_ClassModalProc *\fImodalProc\fR;
} Tk_ClassProcs;
.CE
The \fIsize\fR field is used to simplify future expansion of the
@@ -51,10 +51,10 @@ accordingly. \fIworldChangedProc\fR should have arguments and results
that match the type \fBTk_ClassWorldChangedProc\fR:
.CS
typedef void Tk_ClassWorldChangedProc(
- ClientData \fIinstanceData\fR);
+ ClientData \fIinstanceData\fR);
.CE
The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
-will be identical to the \fIinstanceData\fR paramter passed to
+will be identical to the \fIinstanceData\fR parameter passed to
\fBTk_SetClassProcs\fR.
.PP
\fIcreateProc\fR is used to create platform-dependant windows. It is
@@ -62,9 +62,9 @@ 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);
+ 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
@@ -77,8 +77,8 @@ 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);
+ 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
diff --git a/doc/SetOptions.3 b/doc/SetOptions.3
index f0d5fba..6ce3db0 100644
--- a/doc/SetOptions.3
+++ b/doc/SetOptions.3
@@ -39,13 +39,13 @@ Tcl_Obj *
int
\fBTk_Offset(\fItype, field\fB)\fR
.SH ARGUMENTS
-.AS Tk_SavedOptions "*CONST objv[]" in/out
+.AS Tk_SavedOptions "*const objv[]" in/out
.AP Tcl_Interp *interp in
A Tcl interpreter. Most procedures use this only for returning error
messages; if it is NULL then no error messages are returned. For
\fBTk_CreateOptionTable\fR the value cannot be NULL; it gives the
interpreter in which the option table will be used.
-.AP Tk_OptionSpec *templatePtr in
+.AP "const Tk_OptionSpec" *templatePtr in
Points to an array of static information that describes the configuration
options that are supported. Used to build a Tk_OptionTable. The information
pointed to by this argument must exist for the lifetime of the Tk_OptionTable.
@@ -57,13 +57,13 @@ Points to structure in which values of configuration options are stored;
fields of this record are modified by procedures such as \fBTk_SetOptions\fR
and read by procedures such as \fBTk_GetOptionValue\fR.
.AP Tk_Window tkwin in
-For options such as TK_OPTION_COLOR, this argument indicates
+For options such as \fBTK_OPTION_COLOR\fR, this argument indicates
the window in which the option will be used. If \fIoptionTable\fR uses
no window-dependent options, then a NULL value may be supplied for
this argument.
.AP int objc in
Number of values in \fIobjv\fR.
-.AP Tcl_Obj "*CONST objv[]" in
+.AP Tcl_Obj "*const objv[]" in
Command-line arguments for setting configuring options.
.AP Tk_SavedOptions *savePtr out
If not NULL, the structure pointed to by this argument is filled
@@ -93,15 +93,17 @@ options are supported, these procedures handle all the details of
parsing options and storing their values into a C structure associated
with the widget or object. The procedures were designed primarily for
widgets in Tk, but they can also be used for other kinds of objects that
-have configuration options. In the rest of this manual page ``widget'' will
-be used to refer to the object whose options are being managed; in
-practice the object may not actually be a widget. The term ``widget
-record'' is used to refer to the C-level structure in
+have configuration options. In the rest of this manual page
+.QW widget
+will be used to refer to the object whose options are being managed; in
+practice the object may not actually be a widget. The term
+.QW "widget record"
+is used to refer to the C-level structure in
which information about a particular widget or object is stored.
.PP
Note: the easiest way to learn how to use these procedures is to
look at a working example. In Tk, the simplest example is the code
-that implements the button family of widgets, which is an \fBtkButton.c\fR.
+that implements the button family of widgets, which is in \fBtkButton.c\fR.
Other examples are in \fBtkSquare.c\fR and \fBtkMenu.c\fR.
.PP
In order to use these procedures, the code that implements the widget
@@ -136,10 +138,10 @@ uses the information in the option table to
choose an appropriate default for each option, then it stores the default
value directly into the widget record, overwriting any information that
was already present in the widget record. \fBTk_InitOptions\fR normally
-returns TCL_OK. If an error occurred while setting the default values
-(e.g., because a default value was erroneous) then TCL_ERROR is returned
+returns \fBTCL_OK\fR. If an error occurred while setting the default values
+(e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned
and an error message is left in \fIinterp\fR's result if \fIinterp\fR
-isn't NULL.
+is not NULL.
.PP
\fBTk_SetOptions\fR is invoked to modify configuration options based
on information specified in a Tcl command. The command might be one that
@@ -151,13 +153,13 @@ an option and the second object gives the new value for that option.
\fBTk_SetOptions\fR looks up each name in \fIoptionTable\fR, checks that
the new value of the option conforms to the type in \fIoptionTable\fR,
and stores the value of the option into the widget record given by
-\fIrecordPtr\fR. \fBTk_SetOptions\fR normally returns TCL_OK. If
+\fIrecordPtr\fR. \fBTk_SetOptions\fR normally returns \fBTCL_OK\fR. If
an error occurred (such as an unknown option name or an illegal option
-value) then TCL_ERROR is returned and an error message is left in
-\fIinterp\fR's result if \fIinterp\fR isn't NULL.
+value) then \fBTCL_ERROR\fR is returned and an error message is left in
+\fIinterp\fR's result if \fIinterp\fR is not NULL.
.PP
\fBTk_SetOptions\fR has two additional features. First, if the
-\fImaskPtr\fR argument isn't NULL then it points to an integer
+\fImaskPtr\fR argument is not NULL then it points to an integer
value that is filled in with information about the options that were
modified. For each option in the template passed to
\fBTk_CreateOptionTable\fR there is a \fItypeMask\fR field. The
@@ -170,8 +172,8 @@ that bit set. Another bit might indicate that the geometry of the widget
must be recomputed, and so on. \fBTk_SetOptions\fR OR's together the
\fItypeMask\fR fields from all the options that were modified and returns
this value at *\fImaskPtr\fR; the caller can then use this information
-to optimize itself so that, for example, it doesn't redisplay the widget
-if the modified options don't affect the widget's appearance.
+to optimize itself so that, for example, it does not redisplay the widget
+if the modified options do not affect the widget's appearance.
.PP
The second additional feature of \fBTk_SetOptions\fR has to do with error
recovery. If an error occurs while processing configuration options, this
@@ -250,20 +252,20 @@ supported by a particular class of widgets. Each structure specifies
one configuration option and has the following fields:
.CS
typedef struct {
- Tk_OptionType \fItype\fR;
- char *\fIoptionName\fR;
- char *\fIdbName\fR;
- char *\fIdbClass\fR;
- char *\fIdefValue\fR;
- int \fIobjOffset\fR;
- int \fIinternalOffset\fR;
- int \fIflags\fR;
- ClientData \fIclientData\fR;
- int \fItypeMask\fR;
+ Tk_OptionType \fItype\fR;
+ const char *\fIoptionName\fR;
+ const char *\fIdbName\fR;
+ const char *\fIdbClass\fR;
+ const char *\fIdefValue\fR;
+ int \fIobjOffset\fR;
+ int \fIinternalOffset\fR;
+ int \fIflags\fR;
+ ClientData \fIclientData\fR;
+ int \fItypeMask\fR;
} Tk_OptionSpec;
.CE
The \fItype\fR field indicates what kind of configuration option this is
-(e.g. TK_OPTION_COLOR for a color value, or TK_OPTION_INT for
+(e.g. \fBTK_OPTION_COLOR\fR for a color value, or \fBTK_OPTION_INT\fR for
an integer value). \fIType\fR determines how the
value of the option is parsed (more on this below).
The \fIoptionName\fR field is a string such as \fB\-font\fR or \fB\-bg\fR;
@@ -283,7 +285,7 @@ The \fIflags\fR field contains additional information
to control the processing of this configuration option (see below
for details).
\fIClientData\fR provides additional type-specific data needed
-by certain types. For instance, for TK_OPTION_COLOR types,
+by certain types. For instance, for \fBTK_OPTION_COLOR\fR types,
\fIclientData\fR is a string giving the default value to use on
monochrome displays. See the descriptions of the different types
below for details.
@@ -300,22 +302,22 @@ If the \fIinternalOffset\fR field of the Tk_OptionSpec is
greater than or equal to zero, then the value of the option is stored
in a type-specific internal form at the location in the widget record
given by \fIinternalOffset\fR. For example, if the option's type is
-TK_OPTION_INT then the internal form is an integer. If the
+\fBTK_OPTION_INT\fR then the internal form is an integer. If the
\fIobjOffset\fR or \fIinternalOffset\fR field is negative then the
value is not stored in that form. At least one of the offsets must be
greater than or equal to zero.
.PP
The \fIflags\fR field consists of one or more bits ORed together. At
-present only a single flag is supported: TK_OPTION_NULL_OK. If
+present only a single flag is supported: \fBTK_OPTION_NULL_OK\fR. If
this bit is set for an option then an empty string will be accepted as
the value for the option and the resulting internal form will be a
NULL pointer, a zero value, or \fBNone\fR, depending on the type of
the option. If the flag is not set then empty strings will result
in errors.
-TK_OPTION_NULL_OK is typically used to allow a
+\fBTK_OPTION_NULL_OK\fR is typically used to allow a
feature to be turned off entirely, e.g. set a cursor value to
\fBNone\fR so that a window simply inherits its parent's cursor.
-Not all option types support the TK_OPTION_NULL_OK
+Not all option types support the \fBTK_OPTION_NULL_OK\fR
flag; for those that do, there is an explicit indication of that fact
in the descriptions below.
.PP
@@ -337,7 +339,7 @@ returned by \fBTk_GetAnchorFromObj\fR.
The value must be a standard Tk bitmap name. The internal form is a
Pixmap token like the ones returned by \fBTk_AllocBitmapFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
-such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag.
+such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_BOOLEAN\fR
The value must be a standard boolean value such as \fBtrue\fR or
@@ -348,14 +350,14 @@ The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR.
The internal form is a Tk_3DBorder token like the ones returned
by \fBTk_Alloc3DBorderFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
-such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag.
+such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_COLOR\fR
The value must be a standard color name such as \fBred\fR or \fB#ff8080\fR.
The internal form is an (XColor *) token like the ones returned by
\fBTk_AllocColorFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
-such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag.
+such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_CURSOR\fR
The value must be a standard cursor name such as \fBcross\fR or \fB@foo\fR.
@@ -364,25 +366,25 @@ The internal form is a Tk_Cursor token like the ones returned by
This option type requires \fItkwin\fR to be supplied to procedures
such as \fBTk_SetOptions\fR, and when the option is set the cursor
for the window is changed by calling \fBXDefineCursor\fR. This
-option type also supports the TK_OPTION_NULL_OK flag.
+option type also supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_CUSTOM\fR
This option allows applications to define new option types. The
clientData field of the entry points to a structure defining the new
-option type. See the section CUSTOM OPTION TYPES below for details.
+option type. See the section \fBCUSTOM OPTION TYPES\fR below for details.
.TP
\fBTK_OPTION_DOUBLE\fR
The string value must be a floating-point number in
the format accepted by \fBstrtol\fR. The internal form is a C
-\fBdouble\fR value. This option type supports the TK_OPTION_NULL_OK
+\fBdouble\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR
flag; if a NULL value is set, the internal representation is set to zero.
.TP
\fBTK_OPTION_END\fR
Marks the end of the template. There must be a Tk_OptionSpec structure
-with \fItype\fR TK_OPTION_END at the end of each template. If the
-\fIclientData\fR field of this structure isn't NULL, then it points to
+with \fItype\fR \fBTK_OPTION_END\fR at the end of each template. If the
+\fIclientData\fR field of this structure is not NULL, then it points to
an additional array of Tk_OptionSpec's, which is itself terminated by
-another TK_OPTION_END entry. Templates may be chained arbitrarily
+another \fBTK_OPTION_END\fR entry. Templates may be chained arbitrarily
deeply. This feature allows common options to be shared by several
widget classes.
.TP
@@ -391,7 +393,7 @@ The value must be a standard font name such as \fBTimes 16\fR.
The internal form is a Tk_Font handle like the ones returned by
\fBTk_AllocFontFromObj\fR.
This option type requires \fItkwin\fR to be supplied to procedures
-such as \fBTk_SetOptions\fR, and it supports the TK_OPTION_NULL_OK flag.
+such as \fBTk_SetOptions\fR, and it supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_INT\fR
The string value must be an integer in the format accepted by
@@ -408,23 +410,23 @@ The internal form is a Tk_Justify like the values returned by
The value must specify a screen distance such as \fB2i\fR or \fB6.4\fR.
The internal form is an integer value giving a
distance in pixels, like the values returned by
-\fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field isn't
+\fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field is not
used then information about the original value of this option will be lost.
See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option
-type supports the TK_OPTION_NULL_OK flag; if a NULL value is set, the
+type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the
internal representation is set to zero.
.TP
\fBTK_OPTION_RELIEF\fR
The value must be standard relief such as \fBraised\fR.
The internal form is an integer relief value such as
-TK_RELIEF_RAISED. This option type supports the TK_OPTION_NULL_OK
+\fBTK_RELIEF_RAISED\fR. This option type supports the \fBTK_OPTION_NULL_OK\fR
flag; if the empty string is specified as the value for the option,
-the integer relief value is set to TK_RELIEF_NULL.
+the integer relief value is set to \fBTK_RELIEF_NULL\fR.
.TP
\fBTK_OPTION_STRING\fR
The value may be any string. The internal form is a (char *) pointer
that points to a dynamically allocated copy of the value.
-This option type supports the TK_OPTION_NULL_OK flag.
+This option type supports the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fBTK_OPTION_STRING_TABLE\fR
For this type, \fIclientData\fR is a pointer to an array of strings
@@ -447,7 +449,7 @@ The value must be a window path name. The internal form is a
\fBTk_Window\fR token for the window.
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 TK_OPTION_NULL_OK flag.
+and it supports the \fBTK_OPTION_NULL_OK\fR flag.
.SH "STORAGE MANAGEMENT ISSUES"
.PP
@@ -457,8 +459,8 @@ procedures described here will handle all of the storage allocation and
resource management issues associated with the field. When the value
of an option is changed, \fBTk_SetOptions\fR (or \fBTk_FreeSavedOptions\fR)
will automatically free any resources associated with the old value, such as
-Tk_Fonts for TK_OPTION_FONT options or dynamically allocated memory for
-TK_OPTION_STRING options. For an option stored as an object using the
+Tk_Fonts for \fBTK_OPTION_FONT\fR options or dynamically allocated memory for
+\fBTK_OPTION_STRING\fR options. For an option stored as an object using the
\fIobjOffset\fR field of a Tk_OptionSpec, the widget record shares the
object pointed to by the \fIobjv\fR value from the call to
\fBTk_SetOptions\fR. The reference count for this object is incremented
@@ -478,28 +480,28 @@ an error occurs in \fBTk_InitOptions\fR.
In most cases it is simplest to use the \fIinternalOffset\fR field of
a Tk_OptionSpec structure and not the \fIobjOffset\fR field. This
makes the internal form of the value immediately available to the
-widget code so the value doesn't have to be extracted from an object
+widget code so the value does not have to be extracted from an object
each time it is used. However, there are two cases where the
\fIobjOffset\fR field is useful. The first case is for
-TK_OPTION_PIXELS options. In this case, the internal form is
+\fBTK_OPTION_PIXELS\fR options. In this case, the internal form is
an integer pixel value that is valid only for a particular screen.
If the value of the option is retrieved, it will be returned as a simple
number. For example, after the command \fB.b configure \-borderwidth 2m\fR,
the command \fB.b configure \-borderwidth\fR might return 7, which is the
integer pixel value corresponding to \fB2m\fR. Unfortunately, this loses
-the original screen-independent value. Thus for TK_OPTION_PIXELS options
+the original screen-independent value. Thus for \fBTK_OPTION_PIXELS\fR options
it is better to use the \fIobjOffset\fR field. In this case the original
value of the option is retained in the object and can be returned when
the option is retrieved. In most cases it is convenient to use the
-\fIinternalOffset\fR field field as well, so that the integer value is
+\fIinternalOffset\fR field as well, so that the integer value is
immediately available for use in the widget code (alternatively,
\fBTk_GetPixelsFromObj\fR can be used to extract the integer value from
the object whenever it is needed). Note: the problem of losing information
-on retrievals exists only for TK_OPTION_PIXELS options.
+on retrievals exists only for \fBTK_OPTION_PIXELS\fR options.
.PP
The second reason to use the \fIobjOffset\fR field is in order to
implement new types of options not supported by these procedures.
-To implement a new type of option, you can use TK_OPTION_STRING as
+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.
@@ -512,40 +514,40 @@ free, and restore saved copies of the type and creating a structure
pointing to those procedures:
.CS
typedef struct Tk_ObjCustomOption {
- char *name;
- Tk_CustomOptionSetProc *\fIsetProc\fR;
- Tk_CustomOptionGetProc *\fIgetProc\fR;
- Tk_CustomOptionRestoreProc *\fIrestoreProc\fR;
- Tk_CustomOptionFreeProc *\fIfreeProc\fR;
- ClientData \fIclientData\fR;
+ char *name;
+ Tk_CustomOptionSetProc *\fIsetProc\fR;
+ Tk_CustomOptionGetProc *\fIgetProc\fR;
+ Tk_CustomOptionRestoreProc *\fIrestoreProc\fR;
+ Tk_CustomOptionFreeProc *\fIfreeProc\fR;
+ ClientData \fIclientData\fR;
} Tk_ObjCustomOption;
typedef int Tk_CustomOptionSetProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR,
- Tk_Window \fItkwin\fR,
- Tcl_Obj **\fIvaluePtr\fR,
- char *\fIrecordPtr\fR,
- int \fIinternalOffset\fR,
- char *\fIsaveInternalPtr\fR,
- int \fIflags\fR);
+ 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);
+ 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);
+ 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);
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIinternalPtr\fR);
.CE
.PP
The Tk_ObjCustomOption structure contains six fields: a name
@@ -581,7 +583,7 @@ value is stored as a (Tcl_Obj *) in the widget record), the Tcl_Obj
pointer referenced by \fIvaluePtr\fR is the pointer that will be
stored at the objOffset for the option. \fISetProc\fR may modify the
value if necessary; for example, \fIsetProc\fR may change the value to
-NULL to support the TK_OPTION_NULL_OK flag.
+NULL to support the \fBTK_OPTION_NULL_OK\fR flag.
.TP
\fIrecordPtr\fR
A pointer to the start of the widget record to modify.
@@ -602,8 +604,8 @@ A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the
option
.RE
.PP
-\fISetProc\fR returns a standard Tcl result: TCL_OK to indicate successful
-processing, or TCL_ERROR to indicate a failure of any kind. An error
+\fISetProc\fR returns a standard Tcl result: \fBTCL_OK\fR to indicate successful
+processing, or \fBTCL_ERROR\fR to indicate a failure of any kind. An error
message may be left in the Tcl interpreter given by \fIinterp\fR in
the case of an error.
.PP
diff --git a/doc/SetVisual.3 b/doc/SetVisual.3
index f5c5890..2082220 100644
--- a/doc/SetVisual.3
+++ b/doc/SetVisual.3
@@ -40,7 +40,7 @@ actually been created in X (e.g. before \fBTk_MapWindow\fR or
The safest thing is to call \fBTk_SetWindowVisual\fR immediately
after calling \fBTk_CreateWindow\fR.
If \fItkwin\fR has already been created before \fBTk_SetWindowVisual\fR
-is called then it returns 0 and doesn't make any changes; otherwise
+is called then it returns 0 and does not make any changes; otherwise
it returns 1 to signify that the operation
completed successfully.
.PP
diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3
index d44991d..770b335 100644
--- a/doc/StrictMotif.3
+++ b/doc/StrictMotif.3
@@ -28,8 +28,9 @@ variable in the interpreter associated with \fItkwin\fR's application.
The value is returned as an integer that is either 0 or 1.
1 means that strict Motif compliance has been requested, so anything
that is not part of the Motif specification should be avoided.
-0 means that ``Motif-like'' is good enough, and extra features
-are welcome.
+0 means that
+.QW Motif-like
+is good enough, and extra features are welcome.
.PP
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
diff --git a/doc/TextLayout.3 b/doc/TextLayout.3
index d6fa032..6c4da60 100644
--- a/doc/TextLayout.3
+++ b/doc/TextLayout.3
@@ -53,10 +53,8 @@ lifetime of the text layout.
.AP int numChars in
The number of characters to consider from \fIstring\fR. If
\fInumChars\fR is less than 0, then assumes \fIstring\fR is null
-.VS 8.1
terminated and uses \fBTcl_NumUtfChars\fR to determine the length of
\fIstring\fR.
-.VE
.AP int wrapLength in
Longest permissible line length, in pixels. Lines in \fIstring\fR will
automatically be broken at word boundaries and wrapped when they reach
@@ -67,15 +65,17 @@ wrapping; lines will get as long as they need to be and only wrap if a
newline/return character is encountered.
.AP Tk_Justify justify in
How to justify the lines in a multi-line text layout. Possible values
-are TK_JUSTIFY_LEFT, TK_JUSTIFY_CENTER, or TK_JUSTIFY_RIGHT. If the text
-layout only occupies a single line, then \fIjustify\fR is irrelevant.
+are \fBTK_JUSTIFY_LEFT\fR, \fBTK_JUSTIFY_CENTER\fR, or
+\fBTK_JUSTIFY_RIGHT\fR. If the text layout only occupies a single
+line, then \fIjustify\fR is irrelevant.
.AP int flags in
-Various flag bits OR-ed together. TK_IGNORE_TABS means that tab characters
-should not be expanded to the next tab stop. TK_IGNORE_NEWLINES means that
-newline/return characters should not cause a line break. If either tabs or
-newlines/returns are ignored, then they will be treated as regular
-characters, being measured and displayed in a platform-dependent manner as
-described in \fBTk_MeasureChars\fR, and will not have any special behaviors.
+Various flag bits OR-ed together. \fBTK_IGNORE_TABS\fR means that tab
+characters should not be expanded to the next tab stop.
+\fBTK_IGNORE_NEWLINES\fR means that newline/return characters should
+not cause a line break. If either tabs or newlines/returns are
+ignored, then they will be treated as regular characters, being
+measured and displayed in a platform-dependent manner as described in
+\fBTk_MeasureChars\fR, and will not have any special behaviors.
.AP int *widthPtr out
If non-NULL, filled with either the width, in pixels, of the widest
line in the text layout, or the width, in pixels, of the bounding box for the
@@ -135,13 +135,11 @@ strings, refer to the documentation for \fBTk_MeasureChars\fR. There is
no programming interface in the core of Tk that supports multi-font,
multi-line text; support for that behavior must be built on top of
simpler layers.
-.VS 8.1
Note that unlike the lower level text display routines, the functions
described here all operate on character-oriented lengths and indices
rather than byte-oriented values. See the description of
\fBTcl_UtfAtIndex\fR for more details on converting between character
and byte offsets.
-.VE 8.1
.PP
The routines described here are built on top of the programming interface
described in the \fBTk_MeasureChars\fR documentation. Tab characters and
@@ -216,7 +214,7 @@ the given point (\fIx, y\fR) to the characters in \fIlayout\fR.
Newline/return characters and non-displaying space characters that occur at
the end of individual lines in the text layout are ignored for hit detection
purposes, but tab characters are not. The return value is 0 if the point
-actually hits the \fIlayout\fR. If the point didn't hit the \fIlayout\fR
+actually hits the \fIlayout\fR. If the point did not hit the \fIlayout\fR
then the return value is the distance in pixels from the point to the
\fIlayout\fR.
.PP
@@ -234,8 +232,7 @@ 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.
-.PP
-.SH DISPLAY MODEL
+.SH "DISPLAY MODEL"
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 421ed10..3806f95 100644
--- a/doc/TkInitStubs.3
+++ b/doc/TkInitStubs.3
@@ -1,5 +1,5 @@
'\"
-'\" Copyright (c) 1999 Scriptics Corportation
+'\" Copyright (c) 1999 Scriptics Corporation
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -13,7 +13,7 @@ Tk_InitStubs \- initialize the Tk stubs mechanism
.nf
\fB#include <tk.h>\fR
.sp
-CONST char *
+const char *
\fBTk_InitStubs\fR(\fIinterp, version, exact\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp in
@@ -48,8 +48,8 @@ Tcl functions.
Call \fBTk_InitStubs\fR if the extension before calling any other
Tk functions.
.IP 2) 5
-Define the USE_TCL_STUBS symbol. Typically, you would include the
--DUSE_TCL_STUBS flag when compiling the extension.
+Define the \fBUSE_TCL_STUBS\fR symbol. Typically, you would include the
+\fB\-DUSE_TCL_STUBS\fR flag 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
@@ -67,7 +67,7 @@ as long as they have the same major version number as \fIversion\fR;
non-zero means that only the specified \fIversion\fR is acceptable.
\fBTcl_InitStubs\fR returns a string containing the actual version
of Tk satisfying the request, or NULL if the Tk version is not
-acceptable, does not support the stubs mechansim, or any other
+acceptable, does not support the stubs mechanism, or any other
error condition occurred.
.SH "SEE ALSO"
\fBTcl_InitStubs\fR
diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3
index b217aff..65e2d0a 100644
--- a/doc/Tk_Init.3
+++ b/doc/Tk_Init.3
@@ -52,8 +52,9 @@ Continuous ringing of the bell is a nuisance.
.TP
\fBclipboard\fR
A malicious script could replace the contents of the clipboard with
-the string \fB"rm -r *"\fR and lead to surprises when the contents of
-the clipboard are pasted.
+the string
+.QW "\fBrm \-r *\fR"
+and lead to surprises when the contents of the clipboard are pasted.
.TP
\fBgrab\fR
Grab can be used to block the user from using any other applications.
diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3
index c247211..e67cf00 100644
--- a/doc/Tk_Main.3
+++ b/doc/Tk_Main.3
@@ -44,7 +44,8 @@ nothing but invoke \fBTk_Main\fR.
.PP
When it is has finished its own initialization, but before
it processes commands, \fBTk_Main\fR calls the procedure given by
-the \fIappInitProc\fR argument. This procedure provides a ``hook''
+the \fIappInitProc\fR argument. This procedure provides a
+.QW hook
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:
diff --git a/doc/WindowId.3 b/doc/WindowId.3
index e588c8e..efa326d 100644
--- a/doc/WindowId.3
+++ b/doc/WindowId.3
@@ -9,7 +9,7 @@
.TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap \- retrieve information from Tk's local data structure
+Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp \- retrieve information from Tk's local data structure
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -23,7 +23,7 @@ Tk_Window
Display *
\fBTk_Display\fR(\fItkwin\fR)
.sp
-CONST char *
+const char *
\fBTk_DisplayName\fR(\fItkwin\fR)
.sp
int
@@ -94,6 +94,9 @@ int
.sp
Colormap
\fBTk_Colormap\fR(\fItkwin\fR)
+.sp
+Tcl_Interp *
+\fBTk_Interp\fR(\fItkwin\fR)
.SH ARGUMENTS
.AS Tk_Window tkwin
.AP Tk_Window tkwin in
@@ -116,6 +119,9 @@ yet.
\fItkwin\fR. The parent is the token that was specified when
\fItkwin\fR was created, or NULL for main windows.
.PP
+\fBTk_Interp\fR returns the Tcl interpreter associated with a
+\fItkwin\fR or NULL if there is an error.
+.PP
\fBTk_Display\fR returns a pointer to the Xlib display structure
corresponding to \fItkwin\fR. \fBTk_DisplayName\fR returns an
ASCII string identifying \fItkwin\fR's display. \fBTk_ScreenNumber\fR
@@ -144,15 +150,15 @@ is a container, and that some other application may be embedding
itself inside \fItkwin\fR.
.PP
\fBTk_IsEmbedded\fR returns a non-zero value if \fItkwin\fR
-is is not a free-standing window, but rather is embedded in some
+is not a free-standing window, but rather is embedded in some
other application.
.PP
\fBTk_IsMapped\fR returns a non-zero value if \fItkwin\fR
-is mapped and zero if \fItkwin\fR isn't mapped.
+is mapped and zero if \fItkwin\fR is not mapped.
.PP
\fBTk_IsTopLevel\fR returns a non-zero value if \fItkwin\fR
is a top-level window (its X parent is the root window of the
-screen) and zero if \fItkwin\fR isn't a top-level window.
+screen) and zero if \fItkwin\fR is not a top-level window.
.PP
\fBTk_ReqWidth\fR and \fBTk_ReqHeight\fR return information about
the window's requested size. These values correspond to the last
diff --git a/doc/bind.n b/doc/bind.n
index d5bdf2c..cd556e7 100644
--- a/doc/bind.n
+++ b/doc/bind.n
@@ -15,7 +15,6 @@ bind \- Arrange for X events to invoke Tcl scripts
.SH SYNOPSIS
\fBbind\fI tag\fR ?\fIsequence\fR? ?\fB+\fR??\fIscript\fR?
.BE
-
.SH "INTRODUCTION"
.PP
The \fBbind\fR command associates Tcl scripts with X events.
@@ -23,7 +22,9 @@ If all three arguments are specified, \fBbind\fR will
arrange for \fIscript\fR (a Tcl script) to be evaluated whenever
the event(s) given by \fIsequence\fR occur in the window(s)
identified by \fItag\fR.
-If \fIscript\fR is prefixed with a ``+'', then it is appended to
+If \fIscript\fR is prefixed with a
+.QW + ,
+then it is appended to
any existing binding for \fIsequence\fR; otherwise \fIscript\fR replaces
any existing binding.
If \fIscript\fR is an empty string then the current binding for
@@ -64,17 +65,15 @@ the binding applies to all windows in the application.
.PP
The \fIsequence\fR argument specifies a sequence of one or more
event patterns, with optional white space between the patterns. Each
-.VS
event pattern may
take one of three forms. In the simplest case it is a single
-.VE
printing ASCII character, such as \fBa\fR or \fB[\fR. The character
may not be a space character or the character \fB<\fR. This form of
pattern matches a \fBKeyPress\fR event for the particular
character. The second form of pattern is longer but more general.
It has the following syntax:
.CS
-\fB<\fImodifier-modifier-type-detail\fB>\fR
+\fB<\fImodifier\-modifier\-type\-detail\fB>\fR
.CE
The entire event pattern is surrounded by angle brackets.
Inside the angle brackets are zero or more modifiers, an event
@@ -82,7 +81,6 @@ type, and an extra piece of information (\fIdetail\fR) identifying
a particular button or keysym. Any of the fields may be omitted,
as long as at least one of \fItype\fR and \fIdetail\fR is present.
The fields must be separated by white space or dashes.
-.VS
.PP
The third form of pattern is used to specify a user-defined, named virtual
event. It has the following syntax:
@@ -95,26 +93,26 @@ Modifiers, such as \fBShift\fR or \fBControl\fR, may not be combined with a
virtual event to modify it. Bindings on a virtual event may be created
before the virtual event is defined, and if the definition of a virtual
event changes dynamically, all windows bound to that virtual event will
-respond immediately to the new definition.
+respond immediately to the new definition.
.PP
Some widgets (e.g. \fBmenu\fR and \fBtext\fR) issue virtual events
when their internal state is updated in some ways. Please see the
manual page for each widget for details.
-.VE
-.SH "MODIFIERS"
+.SS "MODIFIERS"
.PP
Modifiers consist of any of the following values:
.DS
.ta 6c
-\fBControl\fR \fBMod2, M2\fR
-\fBShift\fR \fBMod3, M3\fR
-\fBLock\fR \fBMod4, M4\fR
-\fBButton1, B1\fR \fBMod5, M5\fR
-\fBButton2, B2\fR \fBMeta, M\fR
-\fBButton3, B3\fR \fBAlt\fR
-\fBButton4, B4\fR \fBDouble\fR
-\fBButton5, B5\fR \fBTriple\fR
-\fBMod1, M1\fR \fBQuadruple\fR
+\fBControl\fR \fBMod1\fR, \fBM1\fR, \fBCommand\fR
+\fBAlt\fR \fBMod2\fR, \fBM2\fR, \fBOption\fR
+\fBShift\fR \fBMod3\fR, \fBM3\fR
+\fBLock\fR \fBMod4\fR, \fBM4\fR
+\fBExtended\fR \fBMod5\fR, \fBM5\fR
+\fBButton1\fR, \fBB1\fR \fBMeta\fR, \fBM\fR
+\fBButton2\fR, \fBB2\fR \fBDouble\fR
+\fBButton3\fR, \fBB3\fR \fBTriple\fR
+\fBButton4\fR, \fBB4\fR \fBQuadruple\fR
+\fBButton5\fR, \fBB5\fR
.DE
Where more than one value is listed, separated by commas, the values
are equivalent.
@@ -126,8 +124,8 @@ must include all of those specified in the event pattern.
An event may also contain additional modifiers not specified in
the binding.
For example, if button 1 is pressed while the shift and control keys
-are down, the pattern \fB<Control-Button-1>\fR will match
-the event, but \fB<Mod1-Button-1>\fR will not.
+are down, the pattern \fB<Control\-Button\-1>\fR will match
+the event, but \fB<Mod1\-Button\-1>\fR will not.
If no modifiers are specified, then any combination of modifiers may
be present in the event.
.PP
@@ -146,11 +144,24 @@ events. They cause a particular event pattern to be repeated 2, 3 or 4
times, and also place a time and space requirement on the sequence: for a
sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR
pattern, all of the events must occur close together in time and without
-substantial mouse motion in between. For example, \fB<Double-Button-1>\fR
-is equivalent to \fB<Button-1><Button-1>\fR with the extra time and space
+substantial mouse motion in between. For example, \fB<Double\-Button\-1>\fR
+is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space
requirement.
-
-.SH "EVENT TYPES"
+.PP
+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" .
+On a US keyboard, the extended keys include the \fBAlt\fR
+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
few extra abbreviations. The \fItype\fR field will also accept a
@@ -158,19 +169,18 @@ couple non-standard X event types that were added to better support
the Macintosh and Windows platforms. Below is a list of all the valid
types; where two names appear together, they are synonyms.
.DS
-.ta \w'ButtonPress, Button\0\0\0'u +\w'KeyPress, Key\0\0\0'u
-\fBActivate Destroy Map
-ButtonPress, Button Enter MapRequest
-ButtonRelease Expose Motion
-Circulate FocusIn MouseWheel
-CirculateRequest FocusOut Property
-Colormap Gravity Reparent
-Configure KeyPress, Key ResizeRequest
-ConfigureRequest KeyRelease Unmap
-Create Leave Visibility
-Deactivate\fR
+.ta \w'\fBButtonPress, Button\0\0\0\fR'u +\w'\fBKeyPress, Key\0\0\0\fR'u
+\fBActivate\fR \fBDestroy\fR \fBMap\fR
+\fBButtonPress\fR, \fBButton\fR \fBEnter\fR \fBMapRequest\fR
+\fBButtonRelease\fR \fBExpose\fR \fBMotion\fR
+\fBCirculate\fR \fBFocusIn\fR \fBMouseWheel\fR
+\fBCirculateRequest\fR \fBFocusOut\fR \fBProperty\fR
+\fBColormap\fR \fBGravity\fR \fBReparent\fR
+\fBConfigure\fR \fBKeyPress\fR, \fBKey\fR \fBResizeRequest\fR
+\fBConfigureRequest\fR \fBKeyRelease\fR \fBUnmap\fR
+\fBCreate\fR \fBLeave\fR \fBVisibility\fR
+\fBDeactivate\fR
.DE
-.VS
Most of the above events have the same fields and behaviors as events
in the X Windowing system. You can find more detailed descriptions of
these events in any X window programming book. A couple of the events
@@ -189,165 +199,163 @@ active. Likewise, the \fBDeactive\fR event is sent when the window's
state changes from active to deactive. There are no useful percent
substitutions you would make when binding to these events.
.IP \fBMouseWheel\fR 5
-Some mice on the Windows platform support a mouse wheel which is used
+Many contemporary mice support a mouse wheel, which is used
for scrolling documents without using the scrollbars. By rolling the
wheel, the system will generate \fBMouseWheel\fR events that the
-application can use to scroll. On Windows, the event is
-always routed to the window that currently has focus (like \fBKey\fR
-events.) On Mac OS X,
-the event is routed to the window under the pointer. When the event
+application can use to scroll. Like \fBKey\fR events the event is
+always routed to the window that currently has focus. When the event
is received you can use the \fB%D\fR substitution to get the
\fIdelta\fR field for the event, which is a integer value describing how
the mouse wheel has moved. The smallest value for which the
system will report is defined by the OS. On Windows 95 & 98 machines
this value is at least 120 before it is reported. However, higher
-resolution devices may be available in the future. On Mac OS X, the value is
-not scaled by 120, but a value of 1 corresponds to roughly one text line.
-The sign of the value determines which direction your widget should scroll.
-Positive values should scroll up and negative values should scroll down.
-.VE
-.IP "\fBKeyPress\fP, \fBKeyRelease\fP" 5
-The \fBKeyPress\fP and \fBKeyRelease\fP events are generated
-whenever a key is pressed or released. \fBKeyPress\fP and \fBKeyRelease\fP
+resolution devices may be available in the future. The sign of the
+value determines which direction your widget should scroll. Positive
+values should scroll up and negative values should scroll down.
+.IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5
+The \fBKeyPress\fR and \fBKeyRelease\fR events are generated
+whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR
events are sent to the window which currently has the keyboard focus.
-.IP "\fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP" 5
-The \fBButtonPress\fP and \fBButtonRelease\fP events
+.IP "\fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR" 5
+The \fBButtonPress\fR and \fBButtonRelease\fR events
are generated when the user presses or releases a mouse button.
-\fBMotion\fP events are generated whenever the pointer is moved.
-\fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP events are
+\fBMotion\fR events are generated whenever the pointer is moved.
+\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are
normally sent to the window containing the pointer.
.RS
.PP
When a mouse button is pressed, the window containing the pointer
automatically obtains a temporary pointer grab.
-Subsequent \fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP
+Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR
events will be sent to that window,
regardless of which window contains the pointer,
until all buttons have been released.
.RE
-.IP \fBConfigure\fP 5
-A \fBConfigure\fP event is sent to a window whenever its
+.IP \fBConfigure\fR 5
+A \fBConfigure\fR event is sent to a window whenever its
size, position, or border width changes, and sometimes
when it has changed position in the stacking order.
-.IP "\fBMap\fP, \fBUnmap\fP" 5
-The \fBMap\fP and \fBUnmap\fP events are generated whenever the mapping
+.IP "\fBMap\fR, \fBUnmap\fR" 5
+The \fBMap\fR and \fBUnmap\fR events are generated whenever the mapping
state of a window changes.
.RS
.PP
Windows are created in the unmapped state.
Top-level windows become mapped when they transition to the
-\fBnormal\fP state, and are unmapped in the \fBwithdrawn\fP
-and \fBiconic\fP states.
+\fBnormal\fR state, and are unmapped in the \fBwithdrawn\fR
+and \fBiconic\fR states.
Other windows become mapped when they are placed under control
-of a geometry manager (for example \fBpack\fP or \fBgrid\fP).
+of a geometry manager (for example \fBpack\fR or \fBgrid\fR).
.PP
-A window is \fIviewable\fP only if it and all of its ancestors are mapped.
-Note that geometry managers typically do not map their children until
+A window is \fIviewable\fR only if it and all of its ancestors are mapped.
+Note that geometry managers typically do not map their children until
they have been mapped themselves, and unmap all children
-when they become unmapped; hence in Tk \fBMap\fP and \fBUnmap\fP
+when they become unmapped; hence in Tk \fBMap\fR and \fBUnmap\fR
events indicate whether or not a window is viewable.
.RE
-.IP \fBVisibility\fP 5
-A window is said to be \fIobscured\fP when another window
+.IP \fBVisibility\fR 5
+A window is said to be \fIobscured\fR when another window
above it in the stacking order fully or partially overlaps it.
-\fBVisibility\fP events are generated whenever a window's
-obscurity state changes; the \fIstate\fP field (\fB%s\fP)
+\fBVisibility\fR events are generated whenever a window's
+obscurity state changes; the \fIstate\fR field (\fB%s\fR)
specifies the new state.
-.IP \fBExpose\fP 5
-An \fBExpose\fP event is generated whenever all or part of a
+.IP \fBExpose\fR 5
+An \fBExpose\fR event is generated whenever all or part of a
window should be redrawn (for example, when a window is
first mapped or if it becomes unobscured).
-It is normally not necessary for client applications to
-handle \fBExpose\fP events, since Tk handles them internally.
-.IP \fBDestroy\fP 5
-A \fBDestroy\fP event is delivered to a window when
+It is normally not necessary for client applications to
+handle \fBExpose\fR events, since Tk handles them internally.
+.IP \fBDestroy\fR 5
+A \fBDestroy\fR event is delivered to a window when
it is destroyed.
.RS
.PP
-When the \fBDestroy\fP event is delivered
-to a widget, it is in a ``half-dead'' state: the widget still exists,
-but most operations on it will fail.
+When the \fBDestroy\fR event is delivered
+to a widget, it is in a
+.QW half-dead
+state: the widget still exists, but most operations on it will fail.
.RE
-.IP "\fBFocusIn\fP, \fBFocusOut\fP" 5
-The \fBFocusIn\fP and \fBFocusOut\fP events are generated
+.IP "\fBFocusIn\fR, \fBFocusOut\fR" 5
+The \fBFocusIn\fR and \fBFocusOut\fR events are generated
whenever the keyboard focus changes.
-A \fBFocusOut\fP event is sent to the old focus window,
-and a \fBFocusIn\fP event is sent to the new one.
+A \fBFocusOut\fR event is sent to the old focus window,
+and a \fBFocusIn\fR event is sent to the new one.
.RS
.PP
In addition,
if the old and new focus windows do not share a common parent,
-``virtual crossing'' focus events are sent to the intermediate
-windows in the hierarchy.
-Thus a \fBFocusIn\fP event indicates
+.QW "virtual crossing"
+focus events are sent to the intermediate windows in the hierarchy.
+Thus a \fBFocusIn\fR event indicates
that the target window or one of its descendants has acquired the focus,
-and a \fBFocusOut\fP event indicates that the focus
+and a \fBFocusOut\fR event indicates that the focus
has been changed to a window outside the target window's hierarchy.
.PP
-The keyboard focus may be changed explicitly by a call to \fBfocus\fP,
-or implicitly by the window manager.
+The keyboard focus may be changed explicitly by a call to \fBfocus\fR,
+or implicitly by the window manager.
.RE
-.IP "\fBEnter\fP, \fBLeave\fP" 5
-An \fBEnter\fP event is sent to a window when the pointer
-enters that window, and a \fBLeave\fP event is sent when
-the pointer leaves it.
+.IP "\fBEnter\fR, \fBLeave\fR" 5
+An \fBEnter\fR event is sent to a window when the pointer
+enters that window, and a \fBLeave\fR event is sent when
+the pointer leaves it.
.RS
.PP
-If there is a pointer grab in effect, \fBEnter\fP and \fBLeave\fP
+If there is a pointer grab in effect, \fBEnter\fR and \fBLeave\fR
events are only delivered to the window owning the grab.
.PP
In addition, when the pointer moves
-between two windows, \fBEnter\fP and \fBLeave\fP
-``virtual crossing'' events are sent to intermediate windows
-in the hierarchy in the same manner as for \fBFocusIn\fP and
-\fBFocusOut\fP events.
+between two windows, \fBEnter\fR and \fBLeave\fR
+.QW "virtual crossing"
+events are sent to intermediate windows
+in the hierarchy in the same manner as for \fBFocusIn\fR and
+\fBFocusOut\fR events.
.RE
-.IP \fBProperty\fP
-A \fBProperty\fP event is sent to a window whenever an X property
+.IP \fBProperty\fR
+A \fBProperty\fR event is sent to a window whenever an X property
belonging to that window is changed or deleted.
-\fBProperty\fP events are not normally delivered to Tk applications as
+\fBProperty\fR events are not normally delivered to Tk applications as
they are handled by the Tk core.
-.IP \fBColormap\fP
-A \fBColormap\fP event is generated whenever the colormap
+.IP \fBColormap\fR
+A \fBColormap\fR event is generated whenever the colormap
associated with a window has been changed, installed, or uninstalled.
.RS
.PP
Widgets may be assigned a private colormap by
-specifying a \fB-colormap\fP option; the window manager
+specifying a \fB\-colormap\fR option; the window manager
is responsible for installing and uninstalling colormaps
as necessary.
.PP
Note that Tk provides no useful details for this event type.
.RE
'\" The following events were added in TIP#47
-.IP "\fBMapRequest\fP, \fBCirculateRequest\fP, \fBResizeRequest\fP, \fBConfigureRequest\fP, \fBCreate\fP" 5
+.IP "\fBMapRequest\fR, \fBCirculateRequest\fR, \fBResizeRequest\fR, \fBConfigureRequest\fR, \fBCreate\fR" 5
These events are not normally delivered to Tk applications.
They are included for completeness, to make it possible to
write X11 window managers in Tk.
(These events are only delivered when a client has
-selected \fBSubstructureRedirectMask\fP on a window;
+selected \fBSubstructureRedirectMask\fR on a window;
the Tk core does not use this mask.)
-.IP "\fBGravity\fP, \fBReparent\fP, \fBCirculate\fP" 5
-The events \fBGravity\fP and \fBReparent\fP
+.IP "\fBGravity\fR, \fBReparent\fR, \fBCirculate\fR" 5
+The events \fBGravity\fR and \fBReparent\fR
are not normally delivered to Tk applications.
They are included for completeness.
.RS
.PP
-A \fBCirculate\fP event indicates that the window has moved
+A \fBCirculate\fR event indicates that the window has moved
to the top or to the bottom of the stacking order as
-a result of an \fBXCirculateSubwindows\fP protocol request.
+a result of an \fBXCirculateSubwindows\fR protocol request.
Note that the stacking order may be changed for other reasons
-which do not generate a \fBCirculate\fP event, and that
-Tk does not use \fBXCirculateSubwindows()\fP internally.
+which do not generate a \fBCirculate\fR event, and that
+Tk does not use \fBXCirculateSubwindows()\fR internally.
This event type is included only for completeness;
there is no reliable way to track changes to a window's
position in the stacking order.
.RE
-.SH "EVENT DETAILS"
+.SS "EVENT DETAILS"
.PP
The last part of a long event specification is \fIdetail\fR. In the
case of a \fBButtonPress\fR or \fBButtonRelease\fR event, it is the
-number of a button (1-5). If a button number is given, then only an
+number of a button (1\-5). If a button number is given, then only an
event on that particular button will match; if no button number is
given, then an event on any button will match. Note: giving a
specific button number is different than specifying a button modifier;
@@ -356,17 +364,22 @@ while in the second it refers to some other button that is already
depressed when the matching event occurs. If a button
number is given then \fItype\fR may be omitted: if will default
to \fBButtonPress\fR. For example, the specifier \fB<1>\fR
-is equivalent to \fB<ButtonPress-1>\fR.
+is equivalent to \fB<ButtonPress\-1>\fR.
.PP
If the event type is \fBKeyPress\fR or \fBKeyRelease\fR, then
\fIdetail\fR may be specified in the form of an X keysym. Keysyms
are textual specifications for particular keys on the keyboard;
-they include all the alphanumeric ASCII characters (e.g. ``a'' is
-the keysym for the ASCII character ``a''), plus descriptions for
-non-alphanumeric characters (``comma'' is the keysym for the comma
-character), plus descriptions for all the non-ASCII keys on the
-keyboard (``Shift_L'' is the keysym for the left shift key, and
-``F1'' is the keysym for the F1 function key, if it exists). The
+they include all the alphanumeric ASCII characters (e.g.
+.QW a
+is the keysym for the ASCII character
+.QW a ),
+plus descriptions for non-alphanumeric characters
+.PQ comma "is the keysym for the comma character" ,
+plus descriptions for all the non-ASCII keys on the keyboard (e.g.
+.QW Shift_L
+is the keysym for the left shift key, and
+.QW F1
+is the keysym for the F1 function key, if it exists). The
complete list of keysyms is not presented here; it is
available in other X documentation and may vary from system to
system.
@@ -374,8 +387,8 @@ If necessary, you can use the \fB%K\fR notation described below
to print out the keysym name for a particular key.
If a keysym \fIdetail\fR is given, then the
\fItype\fR field may be omitted; it will default to \fBKeyPress\fR.
-For example, \fB<Control-comma>\fR is equivalent to
-\fB<Control-KeyPress-comma>\fR.
+For example, \fB<Control\-comma>\fR is equivalent to
+\fB<Control\-KeyPress\-comma>\fR.
.SH "BINDING SCRIPTS AND SUBSTITUTIONS"
.PP
The \fIscript\fR argument to \fBbind\fR is a Tcl script,
@@ -406,49 +419,58 @@ The \fIabove\fR field from the event,
formatted as a hexadecimal number.
Valid only for \fBConfigure\fR events.
Indicates the sibling window immediately below the receiving window
-in the stacking order, or \fB0\fP if the receiving window is at the
+in the stacking order, or \fB0\fR if the receiving window is at the
bottom.
.IP \fB%b\fR 5
The number of the button that was pressed or released. Valid only
for \fBButtonPress\fR and \fBButtonRelease\fR events.
.IP \fB%c\fR 5
The \fIcount\fR field from the event. Valid only for \fBExpose\fR events.
-Indicates that there are \fIcount\fP pending \fBExpose\fP events which have not
+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 field from the event. The \fB%d\fR is replaced by
+The \fIdetail\fR
+.VS 8.5
+or \fIuser_data\fR
+.VE 8.5
+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,
the string will be one of the following:
.RS
.DS
.ta 6c
-\fBNotifyAncestor NotifyNonlinearVirtual
-NotifyDetailNone NotifyPointer
-NotifyInferior NotifyPointerRoot
-NotifyNonlinear NotifyVirtual\fR
+\fBNotifyAncestor\fR \fBNotifyNonlinearVirtual\fR
+\fBNotifyDetailNone\fR \fBNotifyPointer\fR
+\fBNotifyInferior\fR \fBNotifyPointerRoot\fR
+\fBNotifyNonlinear\fR \fBNotifyVirtual\fR
.DE
For \fBConfigureRequest\fR events, the string will be one of:
.DS
.ta 6c
-\fBAbove Opposite
-Below None
-BottomIf TopIf\fR
+\fBAbove\fR \fBOpposite\fR
+\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
The \fIfocus\fR field from the event (\fB0\fR or \fB1\fR). Valid only
-for \fBEnter\fR and \fBLeave\fR events. \fB1\fP if the receiving
-window is the focus window or a descendant of the focus window,
-\fB0\fP otherwise.
+for \fBEnter\fR and \fBLeave\fR events. \fB1\fR if the receiving
+window is the focus window or a descendant of the focus window,
+\fB0\fR otherwise.
.IP \fB%h\fR 5
-.VS
The \fIheight\fR field from the event. Valid for the \fBConfigure\fR,
\fBConfigureRequest\fR, \fBCreate\fR, \fBResizeRequest\fR, and
\fBExpose\fR events.
Indicates the new or requested height of the window.
-.VE
.IP \fB%i\fR 5
The \fIwindow\fR field from the event, represented as a hexadecimal
integer. Valid for all event types.
@@ -458,10 +480,8 @@ and \fBKeyRelease\fR events.
.IP \fB%m\fR 5
The \fImode\fR field from the event. The substituted string is one of
\fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or
-.VS
\fBNotifyWhileGrabbed\fR. Valid only for \fBEnter\fR,
\fBFocusIn\fR, \fBFocusOut\fR, and \fBLeave\fR events.
-.VE
.IP \fB%o\fR 5
The \fIoverride_redirect\fR field from the event. Valid only for
\fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events.
@@ -476,36 +496,34 @@ The \fIstate\fR field from the event. For \fBButtonPress\fR,
is substituted. For \fBVisibility\fR, one of the strings
\fBVisibilityUnobscured\fR, \fBVisibilityPartiallyObscured\fR,
and \fBVisibilityFullyObscured\fR is substituted.
-For \fBProperty\fP events, substituted with
-either the string \fBNewValue\fP (indicating that the property
-has been created or modified) or \fBDelete\fP (indicating that
+For \fBProperty\fR events, substituted with
+either the string \fBNewValue\fR (indicating that the property
+has been created or modified) or \fBDelete\fR (indicating that
the property has been removed).
.IP \fB%t\fR 5
The \fItime\fR field from the event.
This is the X server timestamp (typically the time since
the last server reset) in milliseconds, when the event occurred.
-Valid for most events.
+Valid for most events.
.IP \fB%w\fR 5
The \fIwidth\fR field from the event.
Indicates the new or requested width of the window.
Valid only for
-.VS
\fBConfigure\fR, \fBConfigureRequest\fR, \fBCreate\fR,
\fBResizeRequest\fR, and \fBExpose\fR events.
-.VE
.IP "\fB%x\fR, \fB%y\fR" 5
The \fIx\fR and \fIy\fR fields from the event.
-For \fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP,
-\fBKeyPress\fP, \fBKeyRelease\fP, and \fBMouseWheel\fP events,
-\fB%x\fP and \fB%y\fP indicate the position of the mouse pointer
+For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
+\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
+\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
relative to the receiving window.
-For \fBEnter\fP and \fBLeave\fP events, the position where the
+For \fBEnter\fR and \fBLeave\fR events, the position where the
mouse pointer crossed the window, relative to the receiving window.
-For \fBConfigure\fP and \fBCreate\fP requests, the \fIx\fP and \fIy\fP
+For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
coordinates of the window relative to its parent window.
.IP \fB%A\fR 5
Substitutes the UNICODE character corresponding to the event, or
-the empty string if the event doesn't correspond to a UNICODE character
+the empty string if the event does not correspond to a UNICODE character
(e.g. the shift key was pressed). \fBXmbLookupString\fR (or
\fBXLookupString\fR when input method support is turned off) does all
the work of translating from the event to a UNICODE character.
@@ -514,18 +532,19 @@ Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
The \fIborder_width\fR field from the event. Valid only for
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
.IP \fB%D\fR 5
-.VS
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The
\fIdelta\fR value represents the rotation units the mouse wheel has
been moved. On Windows 95 & 98 systems the smallest value for the
delta is 120. Future systems may support higher resolution values for
the delta. The sign of the value represents the direction the mouse
wheel was scrolled.
-.VE
.IP \fB%E\fR 5
The \fIsend_event\fR field from the event. Valid for all event types.
-\fB0\fP indicates that this is a ``normal'' event, \fB1\fP indicates
-that it is a ``synthetic'' event generated by \fBSendEvent\fP.
+\fB0\fR indicates that this is a
+.QW normal
+event, \fB1\fR indicates that it is a
+.QW synthetic
+event generated by \fBSendEvent\fR.
.IP \fB%K\fR 5
The keysym corresponding to the event, substituted as a textual
string. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
@@ -535,7 +554,7 @@ number. Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%P\fR 5
The name of the property being updated or deleted (which
may be converted to an XAtom using \fBwinfo atom\fR.) Valid
-only for \fBProperty\fP events.
+only for \fBProperty\fR events.
.IP \fB%R\fR 5
The \fIroot\fR window identifier from the event. Valid only for
events containing a \fIroot\fR field.
@@ -548,27 +567,19 @@ The \fItype\fR field from the event. Valid for all event types.
.IP \fB%W\fR 5
The path name of the window to which the event was reported (the
\fIwindow\fR field from the event). Valid for all event types.
-.IP \fB%X\fR 5
-The \fIx_root\fR field from the event.
+.IP "\fB%X\fR, \fB%Y\fR" 5
+The \fIx_root\fR and \fIy_root\fR fields from the event.
If a virtual-root window manager is being used then the substituted
-value is the corresponding x-coordinate in the virtual root.
+values are the corresponding x-coordinate and y-coordinate in the virtual root.
Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
and \fBMotion\fR events.
-Same meaning as \fB%x\fP, except relative to the (virtual) root window.
-.IP \fB%Y\fR 5
-The \fIy_root\fR field from the event.
-If a virtual-root window manager is being used then the substituted
-value is the corresponding y-coordinate in the virtual root.
-Valid only for
-\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
-and \fBMotion\fR events.
-Same meaning as \fB%y\fP, except relative to the (virtual) root window.
+Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
+window.
.LP
The replacement string for a %-replacement is formatted as a proper
Tcl list element.
-This means that it will be surrounded with braces
-if it contains spaces, or special characters such as \fB$\fR and
+This means that spaces or special characters such as \fB$\fR and
\fB{\fR may be preceded by backslashes.
This guarantees that the string will be passed through the Tcl
parser when the binding script is evaluated.
@@ -587,7 +598,7 @@ actually executed will be
.CE
This will cause the \fBinsert\fR to receive the original replacement
string (open square bracket) as its first argument.
-If the extra backslash hadn't been added, Tcl would not have been
+If the extra backslash had not been added, Tcl would not have been
able to parse the script correctly.
.SH "MULTIPLE MATCHES"
.PP
@@ -615,36 +626,43 @@ have the same \fItag\fR, then the most specific binding
is chosen and its script is evaluated.
The following tests are applied, in order, to determine which of
several matching sequences is more specific:
-(a) an event pattern that specifies a specific button or key is more specific
-than one that doesn't;
-(b) a longer sequence (in terms of number
+.RS
+.IP (a)
+an event pattern that specifies a specific button or key is more specific
+than one that does not;
+.IP (b)
+a longer sequence (in terms of number
of events matched) is more specific than a shorter sequence;
-(c) if the modifiers specified in one pattern are a subset of the
+.IP (c)
+if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers
is more specific.
-(d) a virtual event whose physical pattern matches the sequence is less
-specific than the same physical pattern that is not associated with a
+.IP (d)
+a virtual event whose physical pattern matches the sequence is less
+specific than the same physical pattern that is not associated with a
virtual event.
-(e) given a sequence that matches two or more virtual events, one
+.IP (e)
+given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined.
+.RE
.PP
If the matching sequences contain more than one event, then tests
-(c)-(e) are applied in order from the most recent event to the least recent
+(c)\-(e) are applied in order from the most recent event to the least recent
event in the sequences. If these tests fail to determine a winner, then the
most recently registered sequence is the winner.
.PP
If there are two (or more) virtual events that are both triggered by the
same sequence, and both of those virtual events are bound to the same window
tag, then only one of the virtual events will be triggered, and it will
-be picked at random:
+be picked at random:
.CS
-event add <<Paste>> <Control-y>
-event add <<Paste>> <Button-2>
-event add <<Scroll>> <Button-2>
+event add <<Paste>> <Control\-y>
+event add <<Paste>> <Button\-2>
+event add <<Scroll>> <Button\-2>
\fBbind\fR Entry <<Paste>> {puts Paste}
\fBbind\fR Entry <<Scroll>> {puts Scroll}
.CE
-If the user types Control-y, the \fB<<Paste>>\fR binding
+If the user types Control\-y, the \fB<<Paste>>\fR binding
will be invoked, but if the user presses button 2 then one of
either the \fB<<Paste>>\fR or the \fB<<Scroll>>\fR bindings will
be invoked, but exactly which one gets invoked is undefined.
@@ -658,12 +676,12 @@ When a \fIsequence\fR specified in a \fBbind\fR command contains
more than one event pattern, then its script is executed whenever
the recent events (leading up to and including the current event)
match the given sequence. This means, for example, that if button 1 is
-clicked repeatedly the sequence \fB<Double-ButtonPress-1>\fR will match
+clicked repeatedly the sequence \fB<Double\-ButtonPress\-1>\fR will match
each button press but the first.
If extraneous events that would prevent a match occur in the middle
of an event sequence then the extraneous events are
ignored unless they are \fBKeyPress\fR or \fBButtonPress\fR events.
-For example, \fB<Double-ButtonPress-1>\fR will match a sequence of
+For example, \fB<Double\-ButtonPress\-1>\fR will match a sequence of
presses of button 1, even though there will be \fBButtonRelease\fR
events (and possibly \fBMotion\fR events) between the
\fBButtonPress\fR events.
@@ -686,7 +704,7 @@ The \fBbgerror\fR command will be executed at global level
Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked:
.CS
-\fBbind\fR . <Double-1> {
+\fBbind\fR . <Double\-1> {
puts "hi from (%x,%y)"
}
.CE
@@ -695,14 +713,12 @@ A little GUI that displays what the keysym name of the last key
pressed is:
.CS
set keysym "Press any key"
-pack [label .l -textvariable keysym -padx 2m -pady 1m]
+pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
\fBbind\fR . <Key> {
set keysym "You pressed %K"
}
.CE
-
.SH "SEE ALSO"
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
-
.SH KEYWORDS
binding, event
diff --git a/doc/bindtags.n b/doc/bindtags.n
index 8c6557a..c5cf71b 100644
--- a/doc/bindtags.n
+++ b/doc/bindtags.n
@@ -55,8 +55,9 @@ For example, the command
.CE
reverses the order in which binding scripts will be evaluated for
a button named \fB.b\fR so that \fBall\fR bindings are invoked
-first, following by bindings for \fB.b\fR's toplevel (``.''), followed by
-class bindings, followed by bindings for \fB.b\fR.
+first, following by bindings for \fB.b\fR's toplevel
+.PQ . "" ,
+followed by class bindings, followed by bindings for \fB.b\fR.
If \fItagList\fR is an empty list then the binding tags for \fIwindow\fR
are returned to the default state described above.
.PP
@@ -94,7 +95,7 @@ proc setupBindtagsForTreeDelivery {widget} {
.CE
.SH "SEE ALSO"
-bind
+bind(n)
.SH KEYWORDS
binding, event, tag
diff --git a/doc/button.n b/doc/button.n
index 3ca4c4d..4b655a4 100644
--- a/doc/button.n
+++ b/doc/button.n
@@ -30,7 +30,6 @@ Specifies a Tcl command to associate with the button. This command
is typically invoked when mouse button 1 is released over the button
window.
.OP \-default default Default
-.VS
Specifies one of three states for the default ring: \fBnormal\fR,
\fBactive\fR, or \fBdisabled\fR. In active state, the button is drawn
with the platform specific appearance for a default button. In normal
@@ -41,15 +40,13 @@ the same size. In disabled state, the button is drawn with the
non-default button appearance without leaving space for the default
appearance. The disabled state may result in a smaller button than
the active state.
-.VE
.OP \-height height Height
Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
-If this option isn't specified, the button's desired height is computed
+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.
-.VS 8.4
.OP \-overrelief overRelief OverRelief
Specifies an alternative relief for the button, to be used when the
mouse cursor is over the widget. This option can be used to make
@@ -57,7 +54,6 @@ toolbar buttons, by configuring \fB\-relief flat \-overrelief
raised\fR. If the value of this option is the empty string, then no
alternative relief is used when the mouse cursor is over the button.
The empty string is the default value.
-.VE 8.4
.OP \-state state State
Specifies one of three states for the button: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the button is displayed using the
@@ -72,9 +68,11 @@ In this state the \fBdisabledForeground\fR and
.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
-screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
-for text it is in characters.
-If this option isn't specified, the button's desired width is computed
+screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
+For a text button (no image or with \fB\-compound none\fR) then the width
+specifies how much space in characters to allocate for the text label.
+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
@@ -159,10 +157,8 @@ default behavior:
.IP [1]
A button activates whenever the mouse passes over it and deactivates
whenever the mouse leaves the button.
-.VS
Under Windows, this binding is only active when mouse button 1 has
been pressed over the button.
-.VE
.IP [2]
A button's relief is changed to sunken whenever mouse button 1 is
pressed over the button, and the relief is restored to its original
@@ -181,5 +177,26 @@ actions occur: the button is completely non-responsive.
The behavior of buttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
+.SH EXAMPLES
+This is the classic Tk
+.QW "Hello, World!"
+demonstration:
+.PP
+.CS
+ \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
+.CE
+.SH "SEE ALSO"
+ttk::button(n)
.SH KEYWORDS
button, widget
diff --git a/doc/canvas.n b/doc/canvas.n
index 6a308a0..bdf1e62 100644
--- a/doc/canvas.n
+++ b/doc/canvas.n
@@ -15,19 +15,19 @@ canvas \- Create and manipulate canvas widgets
.SH SYNOPSIS
\fBcanvas\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-background \-insertborderwidth \-selectborderwidth
-\-borderwidth \-insertofftime \-selectforeground
-\-cursor \-insertontime \-takefocus
-\-highlightbackground \-insertwidth \-xscrollcommand
-\-highlightcolor \-relief \-yscrollcommand
-\-highlightthickness \-state
-\-insertbackground \-selectbackground
+\-background \-borderwidth \-cursor
+\-highlightbackground \-highlightcolor \-highlightthickness
+\-insertbackground \-insertborderwidth \-insertofftime
+\-insertontime \-insertwidth \-relief
+\-selectbackground \-selectborderwidth \-selectforeground
+\-takefocus \-xscrollcommand \-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-closeenough closeEnough CloseEnough
Specifies a floating-point value indicating how close the mouse cursor
-must be to an item before it is considered to be ``inside'' the item.
-Defaults to 1.0.
+must be to an item before it is considered to be
+.QW inside
+the item. Defaults to 1.0.
.OP \-confine confine Confine
Specifies a boolean value that indicates whether or not it should be
allowable to set the canvas's view outside the region defined by the
@@ -80,7 +80,6 @@ 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
-
.SH INTRODUCTION
.PP
The \fBcanvas\fR command creates a new window (given
@@ -110,8 +109,9 @@ The items in a canvas are ordered for purposes of display,
with the first item in the display list being displayed
first, followed by the next item in the list, and so on.
Items later in the display list obscure those that are
-earlier in the display list and are sometimes referred to
-as being ``on top'' of earlier items.
+earlier in the display list and are sometimes referred to as being
+.QW "on top"
+of earlier items.
When a new item is created it is placed at the end of the
display list, on top of everything else.
Widget commands may be used to re-arrange the order of the
@@ -134,11 +134,15 @@ canvas widget.
Each item may also have any number of \fItags\fR associated
with it. A tag is just a string of characters, and it may
take any form except that of an integer.
-For example, ``x123'' is OK but ``123'' isn't.
+For example,
+.QW x123
+is OK but
+.QW 123
+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 ``selected''.
+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
@@ -147,7 +151,8 @@ all the items in the canvas.
The tag \fBcurrent\fR is managed automatically by Tk;
it applies to the \fIcurrent item\fR, which is the
topmost item whose drawn area covers the position of
-the mouse cursor.
+the mouse cursor (different item types interpret this in varying ways; see the
+individual item type documentation for details).
If the mouse is not in the canvas widget or is not over
an item, then no item has the \fBcurrent\fR tag.
.PP
@@ -162,8 +167,12 @@ an argument specifies either an id that selects a single
item or a tag that selects zero or more items.
.PP
\fItagOrId\fR may contain a logical expressions of
-tags by using operators: '&&', '||', '^' '!', and parenthesized
-subexpressions. For example:
+tags by using operators:
+.QW \fB&&\fR ,
+.QW \fB||\fR ,
+.QW \fB^\fR ,
+.QW \fB!\fR ,
+and parenthesized subexpressions. For example:
.CS
.c find withtag {(a&&!b)||(!a&&b)}
.CE
@@ -171,7 +180,11 @@ or equivalently:
.CS
.c find withtag {a^b}
.CE
-will find only those items with either "a" or "b" tags, but not both.
+will find only those items with either
+.QW a
+or
+.QW b
+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
@@ -193,12 +206,10 @@ the screen; if it is \fBc\fR then the distance is in centimeters;
\fBi\fR means inches, and \fBp\fR means printers points (1/72 inch).
Larger y-coordinates refer to points lower on the screen; larger
x-coordinates refer to points farther to the right.
-.VS
Coordinates can be specified either as an even number of parameters,
or as a single list parameter containing an even number of x and y
coordinate values.
-.VE
-.SH TRANSFORMATIONS
+.SS TRANSFORMATIONS
.PP
Normally the origin of the canvas coordinate system is at the
upper-left corner of the window containing the canvas.
@@ -238,7 +249,7 @@ 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
tasks as inserting new text at the end of the item.
-Lines and Polygons don't support the insertion cursor
+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
@@ -267,11 +278,11 @@ 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 isn't in this item then this form is illegal.
+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 isn't in this item then this form is illegal.
+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
@@ -286,24 +297,32 @@ Many items support the notion of a dash pattern for outlines.
.PP
The first possible syntax is a list of integers. Each element
represents the number of pixels of a line segment. Only the odd
-segments are drawn using the "outline" color. The other segments
-are drawn transparent.
+segments are drawn using the
+.QW outline
+color. The other segments are drawn transparent.
.PP
The second possible syntax is a character list containing only
-5 possible characters \fB[.,-_ ]\fR. The space can be used
-to enlarge the space between other line elements, and can not
+5 possible characters
+.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:
- -dash . = -dash {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}
+.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 {2 8}
+\-dash , \(-> \-dash {4 4}
+.CE
.PP
The main difference of this syntax with the previous 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 "." will always be displayed as a dot and "-"
+assures that
+.QW .
+will always be displayed as a dot and
+.QW \-
always as a dash regardless of the line width.
.PP
On systems which support only a limited set of dash patterns, the dash
@@ -328,7 +347,7 @@ The following widget commands are possible for canvas widgets:
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
-isn't already present on that list.
+is not already present on that list.
It is possible that no items will satisfy the constraints
given by \fIsearchSpec\fR and \fIarg\fRs, in which case the
command has no effect.
@@ -391,7 +410,9 @@ Selects all the items given by \fItagOrId\fR.
\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 ``\fIx1 y1 x2 y2\fR'' such that the drawn
+The list has the form
+.QW "\fIx1 y1 x2 y2\fR"
+such that the drawn
areas of all the named elements are within the region bounded by
\fIx1\fR on the left, \fIx2\fR on the right, \fIy1\fR on the top,
and \fIy2\fR on the bottom.
@@ -414,8 +435,9 @@ on the syntax of \fIsequence\fR and the substitutions performed
on \fIcommand\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 \fItagOrId\fR
-(if the first character of \fIcommand\fR is ``+'' then \fIcommand\fR
-augments an existing binding rather than replacing it).
+(if the first character of \fIcommand\fR is
+.QW +
+then \fIcommand\fR augments an existing binding rather than replacing it).
In this case the return value is an empty string.
If \fIcommand\fR is omitted then the command returns the \fIcommand\fR
associated with \fItagOrId\fR and \fIsequence\fR (an error occurs
@@ -428,8 +450,9 @@ defined for \fItagOrId\fR.
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 ITEM
-IDS AND TAGS above. \fBEnter\fR and \fBLeave\fR events trigger for an
+The handling of events in canvases uses the current item defined in
+\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
@@ -519,11 +542,11 @@ This command returns the id for the new item.
\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 don't support
+If some of the items given by \fItagOrId\fR do not support
indexing operations then they ignore dchars.
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).
-Indices are described in INDICES above.
+Indices are described in \fBINDICES\fR above.
If \fIlast\fR is omitted, it defaults to \fIfirst\fR.
This command returns an empty string.
.TP
@@ -535,7 +558,7 @@ an empty string.
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.
-If an item doesn't have the tag \fItagToDelete\fR then
+If an item does not have the tag \fItagToDelete\fR then
the item is unaffected by the command.
If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR.
This command returns an empty string.
@@ -554,8 +577,8 @@ Set the keyboard focus for the canvas widget to the item given by
If \fItagOrId\fR refers to several items, then the focus is set
to the first such item in the display list that supports the
insertion cursor.
-If \fItagOrId\fR doesn't refer to any items, or if none of them
-support the insertion cursor, then the focus isn't changed.
+If \fItagOrId\fR does not refer to any items, or if none of them
+support the insertion cursor, then the focus is not changed.
If \fItagOrId\fR is an empty
string, then the focus item is reset so that no item has the focus.
If \fItagOrId\fR is not specified then the command returns the
@@ -568,12 +591,12 @@ the insertion cursor and all keyboard events will be directed
to that item.
The focus item within a canvas and the focus window on the
screen (set with the \fBfocus\fR command) are totally independent:
-a given item doesn't actually have the input focus unless (a)
+a given item does not actually have the input focus unless (a)
its canvas is the focus window and (b) the item is the focus item
within the canvas.
In most cases it is advisable to follow the \fBfocus\fR widget
command with the \fBfocus\fR command to set the focus window to
-the canvas (if it wasn't there already).
+the canvas (if it was not there already).
.RE
.TP
\fIpathName \fBgettags\fR \fItagOrId\fR
@@ -581,27 +604,27 @@ 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
are returned from the first such item in the display list.
-If \fItagOrId\fR doesn't refer to any items, or if the item
+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 don't support
+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 INDICES above for a description of the
+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
-be set even when the item doesn't have the focus.
+be set even when the item does not have the focus.
This command returns an empty string.
.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 INDICES above.
+as described in \fBINDICES\fR above.
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
@@ -618,7 +641,7 @@ 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.
-See INDICES above for information about the forms allowed
+See \fBINDICES\fR above for information about the forms allowed
for \fIbeforeThis\fR.
This command returns an empty string.
.TP
@@ -691,7 +714,7 @@ Note: by default Postscript is only generated for information that
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
-either invoke the "update" command to wait for the canvas window
+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
@@ -703,13 +726,14 @@ options are supported:
\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
-code to set a particular color value (e.g. ``\fB1.0 1.0 0.0 setrgbcolor\fR'').
+code to set a particular color value (e.g.
+.QW "\fB1.0 1.0 0.0 setrgbcolor\fR" ).
When outputting color information in the Postscript, Tk checks
to see if there is an element of \fIvarName\fR with the same
name as the color.
If so, Tk uses the value of the element as the Postscript command
to set the color.
-If this option hasn't been specified, or if there isn't an entry
+If this option has not been specified, or if there is no entry
in \fIvarName\fR for a given color, then Tk uses the red, green,
and blue intensities from the X color.
.TP
@@ -721,7 +745,7 @@ to black or white).
.TP
\fB\-file \fIfileName\fR
Specifies the name of the file in which to write the Postscript.
-If this option isn't specified then the Postscript is returned as the
+If this option is not specified then the Postscript is returned as the
result of the command instead of being written to a file.
.TP
\fB\-fontmap \fIvarName\fR
@@ -792,9 +816,10 @@ Defaults to the center of the page.
\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 (``portrait'' orientation);
-in rotated output the x-axis runs along the long dimension of the
-page (``landscape'' orientation).
+the short dimension of the page
+.PQ portrait orientation ;
+in rotated output the x-axis runs along the long dimension of the page
+.PQ landscape orientation .
Defaults to non-rotated.
.TP
\fB\-width \fIsize\fR
@@ -875,7 +900,7 @@ 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
-within \fItagOrId\fR, as described in INDICES above.
+within \fItagOrId\fR, as described in \fBINDICES\fR above.
.RS
.TP
\fIpathName \fBselect adjust \fItagOrId index\fR
@@ -885,14 +910,14 @@ end of the selection to be at \fIindex\fR (i.e. including
but not going beyond \fIindex\fR).
The other end of the selection is made the anchor point
for future \fBselect to\fR commands.
-If the selection isn't currently in \fItagOrId\fR then
+If the selection is not currently in \fItagOrId\fR then
this command behaves the same as the \fBselect to\fR widget
command.
Returns an empty string.
.TP
\fIpathName \fBselect clear\fR
Clear the selection if it is in this widget.
-If the selection isn't in this widget then the command
+If the selection is not in this widget then the command
has no effect.
Returns an empty string.
.TP
@@ -900,7 +925,7 @@ Returns an empty string.
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 doesn't 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.
@@ -920,7 +945,7 @@ it will include the character given by the anchor point only if
\fIindex\fR is greater than or equal to the anchor point.
The anchor point is determined by the most recent \fBselect adjust\fR
or \fBselect from\fR command for this widget.
-If the selection anchor point for the widget isn't currently in
+If the selection anchor point for the widget is not currently in
\fItagOrId\fR, then it is set to the same character given
by \fIindex\fR.
Returns an empty string.
@@ -931,7 +956,7 @@ 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
of the first item in the display list is returned.
-If \fItagOrId\fR doesn't refer to any items at all then
+If \fItagOrId\fR does not refer to any items at all then
an empty string is returned.
.TP
\fIpathName \fBxview \fR?\fIargs\fR?
@@ -1015,14 +1040,14 @@ first, the form of the \fBcreate\fR command used to create
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 don't support indexing or selection or the commands
+Most items do not support indexing or selection or the commands
related to them, such as \fBindex\fR and \fBinsert\fR.
Where items do support these facilities, it is noted explicitly
in the descriptions below.
At present, text, line and polygon items provide this support.
For lines and polygons the indexing facility is used to manipulate
the coordinates of the item.
-.SH "COMMON ITEM OPTIONS"
+.SS "COMMON ITEM OPTIONS"
.PP
Many items share a common set of options. These options are
explained here, and then referred to be each widget type for brevity.
@@ -1037,12 +1062,12 @@ This option specifies dash patterns for the normal, active
state, and disabled state of an item.
\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
If the dash options are omitted then the default is a solid outline.
-See "DASH PATTERNS" for more information.
+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 pattern. The \fIoffset\fR may have any of the forms described
in the \fBCOORDINATES\fR section above.
.TP
\fB\-fill \fIcolor\fR
@@ -1076,7 +1101,7 @@ Specifies the offset of stipples. The offset value can be of the form
first case the origin is the origin of the toplevel of the current window.
For the canvas itself and canvas objects the origin is the canvas origin,
but putting \fB#\fR in front of the coordinate pair indicates using the
-toplevel origin instead. For canvas objects, the \fB-offset\fR option is
+toplevel origin instead. For canvas objects, the \fB\-offset\fR option is
used for stippling as well. For the line and polygon canvas items you can
also specify an index as argument, which connects the stipple origin to one
of the coordinate points of the line/polygon.
@@ -1091,13 +1116,24 @@ 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;
\fIbitmap\fR specifies the stipple pattern to use, in any of the
forms accepted by \fBTk_GetBitmap\fR.
-If the \fB\-outline\fR option hasn't been specified then this option
+If the \fB\-outline\fR option has not been specified then this option
has no effect.
If \fIbitmap\fR is an empty string (the default), then the outline is drawn
in a solid fashion.
\fINote that stipples are not well supported on platforms that do not
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?!
+.TP
\fB\-stipple \fIbitmap\fR
.TP
\fB\-activestipple \fIbitmap\fR
@@ -1107,7 +1143,7 @@ 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
forms accepted by \fBTk_GetBitmap\fR.
-If the \fB\-fill\fR option hasn't been specified then this option
+If the \fB\-fill\fR option has not been specified then this option
has no effect.
If \fIbitmap\fR is an empty string (the default), then filling is done
in a solid fashion.
@@ -1156,8 +1192,10 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1171,6 +1209,7 @@ The following standard options are supported by arcs:
\-outline
\-activeoutline
\-disabledoutline
+\-outlineoffset
\-outlinestipple
\-activeoutlinestipple
\-disabledoutlinestipple
@@ -1190,7 +1229,7 @@ Specifies the size of the angular range occupied by the arc.
The arc's range extends for \fIdegrees\fR degrees counter-clockwise
from the starting angle given by the \fB\-start\fR option.
\fIDegrees\fR may be negative.
-If it is greater than 360 or less than -360, then \fIdegrees\fR
+If it is greater than 360 or less than \-360, then \fIdegrees\fR
modulo 360 is used as the extent.
.TP
\fB\-start \fIdegrees\fR
@@ -1219,15 +1258,17 @@ Bitmaps are created with widget commands of the following form:
\fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value option value ...\fR?
\fIpathName \fBcreate bitmap \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
+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).
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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1249,10 +1290,11 @@ This option defaults to \fBcenter\fR.
\fB\-activebackground \fIbitmap\fR
.TP
\fB\-disabledbackground \fIbitmap\fR
-Specifies the color to use for each of the bitmap's '0' valued pixels
-in its normal, active and disabled states.
+Specifies the color to use for each of the bitmap's
+.QW 0
+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 isn't specified, or if it is specified as an empty
+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
produces a transparent effect.
.TP
@@ -1270,8 +1312,9 @@ disabled states.
\fB\-activeforeground \fIbitmap\fR
.TP
\fB\-disabledforeground \fIbitmap\fR
-Specifies the color to use for each of the bitmap's '1' valued pixels
-in its normal, active and disabled states.
+Specifies the color to use for each of the bitmap's
+.QW 1
+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"
@@ -1290,8 +1333,9 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1335,8 +1379,10 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1377,14 +1423,16 @@ The second element gives the distance along the line from the
trailing points of the arrowhead to the tip, and the third
element gives the distance from the outside edge of the line to the
trailing points.
-If this option isn't specified then Tk picks a ``reasonable'' shape.
+If this option is not specified then Tk picks a
+.QW reasonable
+shape.
.TP
\fB\-capstyle \fIstyle\fR
Specifies the ways in which caps are to be drawn at the endpoints
of the line.
\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
(\fBbutt\fR, \fBprojecting\fR, or \fBround\fR).
-If this option isn't specified then it defaults to \fBbutt\fR.
+If this option is not specified then it defaults to \fBbutt\fR.
Where arrowheads are drawn the cap style is ignored.
.TP
\fB\-joinstyle \fIstyle\fR
@@ -1392,27 +1440,38 @@ 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
(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
-If this option isn't specified then it defaults to \fBmiter\fR.
+If this option is not specified then it defaults to \fBround\fR.
If the line only contains two points then this option is
irrelevant.
.TP
\fB\-smooth \fIsmoothMethod\fR
\fIsmoothMethod\fR must have one of the forms accepted by
-\fBTcl_GetBoolean\fR or a line smoothing method. Only \fBbezier\fR is
-supported in the core, but more can be added at runtime. If a boolean
+\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
-truth value assume \fBbezier\fR smoothing.
-It indicates whether or not the line should be drawn as a curve.
-If so, the line is rendered as a set of parabolic splines: one spline
+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
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
+line segments can be generated within a curve by making control points
+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
-option is ignored unless the \fB\-smooth\fR option is true.
-
+option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR.
.SH "OVAL ITEMS"
.PP
Items of type \fBoval\fR appear as circular or oval regions on
@@ -1434,8 +1493,10 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1449,6 +1510,7 @@ The following standard options are supported by ovals:
\-outline
\-activeoutline
\-disabledoutline
+\-outlineoffset
\-outlinestipple
\-activeoutlinestipple
\-disabledoutlinestipple
@@ -1481,8 +1543,10 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1515,25 +1579,41 @@ 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
(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
-If this option isn't specified then it defaults to \fBmiter\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.
-It indicates whether or not the polygon should be drawn with a
-curved perimeter.
-If so, the outline of the polygon becomes a set of parabolic splines,
-one spline for the first and second line segments, one for the second
-and third, and so on. Straight-line segments can be generated in a
-smoothed polygon by duplicating the end-points of the desired line segment.
+\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
+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
+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
+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
+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
-option is ignored unless the \fB\-smooth\fR option is true.
+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
-and arcs in that interior points are considered to be ``inside'' a
-polygon (e.g. for purposes of the \fBfind closest\fR and
+and arcs in that interior points are considered to be
+.QW inside
+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
@@ -1550,7 +1630,8 @@ following form:
\fIpathName \fBcreate rectangle \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
\fIpathName \fBcreate rectangle \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give
+The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR
+(which must have four elements) give
the coordinates of two diagonally opposite corners of the rectangle
(the rectangle will include its upper and left edges but not
its lower or right edges).
@@ -1558,8 +1639,11 @@ 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+configuration. A rectangle 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 rectangles:
.CS
\-dash
@@ -1573,6 +1657,7 @@ The following standard options are supported by rectangles:
\-outline
\-activeoutline
\-disabledoutline
+\-outlineoffset
\-outlinestipple
\-activeoutlinestipple
\-disabledoutlinestipple
@@ -1599,15 +1684,17 @@ form:
\fIpathName \fBcreate text \fIx y \fR?\fIoption value option value ...\fR?
\fIpathName \fBcreate text \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
+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 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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
@@ -1634,7 +1721,7 @@ This option defaults to \fBcenter\fR.
\fB\-font \fIfontName\fR
Specifies the font to use for the text item.
\fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR.
-If this option isn't specified, it defaults to a system-dependent
+If this option is not specified, it defaults to a system-dependent
font.
.TP
\fB\-justify \fIhow\fR
@@ -1651,6 +1738,15 @@ 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
+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
@@ -1671,15 +1767,19 @@ Window items are created with widget commands of the following form:
\fIpathName \fBcreate window \fIx y \fR?\fIoption value option value ...\fR?
\fIpathName \fBcreate window \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
+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).
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
used in \fBitemconfigure\fR widget commands to change the item's
-configuration.
-.br
+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
+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
@@ -1688,6 +1788,7 @@ The following standard options are supported by window items:
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
@@ -1697,20 +1798,23 @@ 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.
\fIPixels\fR may have any of the
forms described in the \fBCOORDINATES\fR section above.
-If this option isn't specified, or if it is specified as an empty
-string, then the window is given whatever height it requests internally.
+If this option is not specified, or if it is specified as zero,
+then the window is given whatever height it requests internally.
.TP
\fB\-width \fIpixels\fR
+.
Specifies the width to assign to the item's window.
\fIPixels\fR may have any of the
forms described in the \fBCOORDINATES\fR section above.
-If this option isn't specified, or if it is specified as an empty
-string, then the window is given whatever width it requests internally.
+If this option is not specified, or if it is specified as zero,
+then the window is given whatever width it requests internally.
.TP
\fB\-window \fIpathName\fR
+.
Specifies the window to associate with this item.
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.
@@ -1719,7 +1823,11 @@ the canvas widget or a child of some ancestor of the canvas widget.
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
-overlap it, regardless of their order in the display list.
+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
+the window specified by the \fB\-window\fR option; when the parent widget is
+the canvas, this means that the window item can overlap the canvas's border.
.SH "APPLICATION-DEFINED ITEM TYPES"
.PP
It is possible for individual applications to define new item
@@ -1728,7 +1836,7 @@ See the documentation for \fBTk_CreateItemType\fR.
.SH BINDINGS
.PP
In the current implementation, new canvases are not given any
-default behavior: you'll 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
@@ -1737,9 +1845,7 @@ Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's
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
diff --git a/doc/checkbutton.n b/doc/checkbutton.n
index f236de2..1e05c96 100644
--- a/doc/checkbutton.n
+++ b/doc/checkbutton.n
@@ -34,31 +34,34 @@ Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
-If this option isn't specified, the button's desired height is computed
+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
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
-.VS 8.4
.OP \-offrelief offRelief OffRelief
Specifies the relief for the checkbutton when the indicator is not drawn and
-the checkbutton is off. The default value is "raised". By setting this option
-to "flat" and setting -indicatoron to false and -overrelief to raised,
-the effect is achieved
+the checkbutton is off. The default value is
+.QW raised .
+By setting this option to
+.QW flat
+and setting \fB\-indicatoron\fR to false and \fB\-overrelief\fR to
+.QW raised ,
+the effect is achieved
of having a flat button that raises on mouse-over and which is
depressed when activated. This is the behavior typically exhibited by
the Bold, Italic, and Underline checkbuttons on the toolbar of a
word-processor, for example.
-.VE 8.4
.OP \-offvalue offValue Value
Specifies value to store in the button's associated variable whenever
-this button is deselected. Defaults to ``0''.
+this button is deselected. Defaults to
+.QW 0 .
.OP \-onvalue onValue Value
Specifies value to store in the button's associated variable whenever
-this button is selected. Defaults to ``1''.
-.VS 8.4
+this button is selected. Defaults to
+.QW 1 .
.OP \-overrelief overRelief OverRelief
Specifies an alternative relief for the checkbutton, to be used when the
mouse cursor is over the widget. This option can be used to make
@@ -66,12 +69,10 @@ toolbar buttons, by configuring \fB\-relief flat \-overrelief
raised\fR. If the value of this option is the empty string, then no
alternative relief is used when the mouse cursor is over the checkbutton.
The empty string is the default value.
-.VE 8.4
.OP \-selectcolor selectColor Background
Specifies a background color to use when the button is selected.
-If \fBindicatorOn\fR is true then the color applies to the indicator.
-Under Windows, this color is used as the background for the indicator
-regardless of the select state.
+If \fBindicatorOn\fR is true then the 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,
whenever the widget is selected.
@@ -93,6 +94,19 @@ 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.
+.OP \-tristateimage tristateImage TristateImage
+.VS 8.5
+Specifies an image to display (in place of the \fBimage\fR option)
+when the checkbutton is in tri-state mode.
+This option is ignored unless the \fBimage\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
+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
@@ -103,10 +117,9 @@ Specifies a desired width for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
-If this option isn't specified, the button's desired width is computed
+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 \fBcheckbutton\fR command creates a new window (given by the
@@ -139,30 +152,45 @@ checkbutton.
.PP
In addition, checkbuttons can be \fIselected\fR.
If a checkbutton is selected then the indicator is normally
-.VS
drawn with a selected appearance, and
a Tcl variable associated with the checkbutton is set to a particular
value (normally 1).
-Under Unix, the indicator is drawn with a sunken relief and a special
-color. Under Windows, the indicator is drawn with a check mark inside.
+.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).
-Under Unix, the indicator is drawn with a raised relief and no special
-color. Under Windows, the indicator is drawn without a check mark inside.
-.VE
+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
+Windows, the background interior of the box is
+.QW grayed .
+Under Mac, the indicator is drawn with a dash mark inside.
By default, the name of the variable associated with a checkbutton is the
same as the \fIname\fR used to create the checkbutton.
-The variable name, and the ``on'' and ``off'' values stored in it,
-may be modified with options on the command line or in the option
-database.
+The variable name, and the
+.QW on ,
+.QW off
+and
+.QW tristate
+values stored in it, may be modified with options on the command line
+or in the option database.
Configuration options may also be used to modify the way the
indicator is displayed (or whether it is displayed at all).
By default a checkbutton is configured to select and deselect
itself on alternate button clicks.
In addition, each checkbutton monitors its associated variable and
automatically selects and deselects itself when the variables value
-changes to and from the button's ``on'' value.
+changes to and from the button's
+.QW on ,
+.QW off
+and
+.QW tristate
+values.
+.VE 8.5
.SH "WIDGET COMMAND"
.PP
The \fBcheckbutton\fR command creates a new Tcl command whose
@@ -197,7 +225,8 @@ this case the command returns an empty string.
command.
.TP
\fIpathName \fBdeselect\fR
-Deselects the checkbutton and sets the associated variable to its ``off''
+Deselects the checkbutton and sets the associated variable to its
+.QW off
value.
.TP
\fIpathName \fBflash\fR
@@ -216,7 +245,8 @@ empty string if there is no command associated with the checkbutton.
This command is ignored if the checkbutton's state is \fBdisabled\fR.
.TP
\fIpathName \fBselect\fR
-Selects the checkbutton and sets the associated variable to its ``on''
+Selects the checkbutton and sets the associated variable to its
+.QW on
value.
.TP
\fIpathName \fBtoggle\fR
@@ -226,7 +256,6 @@ modifying its associated variable to reflect the new state.
.PP
Tk automatically creates class bindings for checkbuttons that give them
the following default behavior:
-.VS
.IP [1]
On Unix systems, a checkbutton activates whenever the mouse passes
over it and deactivates whenever the mouse leaves the checkbutton. On
@@ -234,26 +263,32 @@ Mac and Windows systems, when mouse button 1 is pressed over a
checkbutton, the button activates whenever the mouse pointer is inside
the button, and deactivates whenever the mouse pointer leaves the
button.
-.VE
.IP [2]
When mouse button 1 is pressed over a checkbutton, it is invoked (its
selection state toggles and the command associated with the button is
invoked, if there is one).
-.VS
.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.
-.VE
+(+) and equal (=) select the button, and minus (\-) 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.
.PP
The behavior of checkbuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH EXAMPLE
+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
+.CE
.SH "SEE ALSO"
-button(n), options(n), radiobutton(n)
-
+button(n), options(n), radiobutton(n), ttk::checkbutton(n)
.SH KEYWORDS
checkbutton, widget
diff --git a/doc/chooseColor.n b/doc/chooseColor.n
index 8bb8d83..565934c 100644
--- a/doc/chooseColor.n
+++ b/doc/chooseColor.n
@@ -10,7 +10,6 @@
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tk_chooseColor \- pops up a dialog box for the user to select a color.
-.PP
.SH SYNOPSIS
\fBtk_chooseColor \fR?\fIoption value ...\fR?
.BE
diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n
index c796f86..c380ccf 100644
--- a/doc/chooseDirectory.n
+++ b/doc/chooseDirectory.n
@@ -8,11 +8,9 @@
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tk_chooseDirectory \- pops up a dialog box for the user to select a directory.
-.PP
.SH SYNOPSIS
\fBtk_chooseDirectory \fR?\fIoption value ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the
@@ -24,31 +22,29 @@ Specifies that the directories in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified, then
the directories in the current working directory are displayed. If the
parameter specifies a relative path, the return value will convert the
-relative path to an absolute path. This option may not always work on
-the Macintosh. This is not a bug. Rather, the \fIGeneral Controls\fR
-control panel on the Mac allows the end user to override the
-application default directory.
+relative path to an absolute path.
+.TP
+\fB\-mustexist\fR \fIboolean\fR
+Specifies whether the user may specify non-existent directories. If
+this parameter is true, then the user may only select directories that
+already exist. The default value is \fIfalse\fR.
.TP
\fB\-parent\fR \fIwindow\fR
Makes \fIwindow\fR the logical parent of the dialog. The dialog
-is displayed on top of its parent window.
+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 will be displayed.
-.TP
-\fB\-mustexist\fR \fIboolean\fR
-Specifies whether the user may specify non-existent directories. If
-this parameter is true, then the user may only select directories that
-already exist. The default value is \fIfalse\fR.
.SH EXAMPLE
.CS
-set dir [\fBtk_chooseDirectory\fR \\
+set dir [\fBtk_chooseDirectory\fR \e
\-initialdir ~ \-title "Choose a directory"]
if {$dir eq ""} {
- label .l -text "No directory selected"
+ label .l \-text "No directory selected"
} else {
- label .l -text "Selected $dir"
+ label .l \-text "Selected $dir"
}
.CE
diff --git a/doc/clipboard.n b/doc/clipboard.n
index 9fa858a..b689328 100644
--- a/doc/clipboard.n
+++ b/doc/clipboard.n
@@ -19,7 +19,7 @@ clipboard \- Manipulate Tk clipboard
.PP
This command provides a Tcl interface to the Tk clipboard,
which stores data for later retrieval using the selection mechanism
-(via the \fB-selection CLIPBOARD\fR option).
+(via the \fB\-selection CLIPBOARD\fR option).
In order to copy data into the clipboard, \fBclipboard clear\fR must
be called, followed by a sequence of one or more calls to \fBclipboard
append\fR. To ensure that the clipboard is updated atomically, all
@@ -32,8 +32,9 @@ forms are currently supported:
.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 ``.''. Returns an
-empty string.
+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
@@ -43,7 +44,9 @@ display.
.RS
.PP
\fIType\fR specifies the form in which the selection is to be returned
-(the desired ``target'' for conversion, in ICCCM terminology), and
+(the desired
+.QW target
+for conversion, in ICCCM terminology), and
should be an atom name such as STRING or FILE_NAME; see the
Inter-Client Communication Conventions Manual for complete details.
\fIType\fR defaults to STRING.
@@ -65,7 +68,7 @@ boundaries. All items appended to the clipboard with the same
\fItype\fR must have the same \fIformat\fR.
.PP
The \fIformat\fR argument is needed only for compatibility with
-clipboard requesters that don't use Tk. If the Tk toolkit is being
+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
irrelevant.
@@ -77,13 +80,19 @@ with a \fB\-\fR.
.RE
.TP
\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR?
-.VS 8.4
Retrieve data from the clipboard on \fIwindow\fR's display.
-\fIwindow\fR defaults to ".". \fIType\fR specifies the form in which
+\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
-equivalent to \fBselection get -selection CLIPBOARD\fR.
-.VE 8.4
+equivalent to
+.QW "\fBselection get \-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
Get the current contents of the clipboard.
.CS
@@ -97,9 +106,49 @@ Set the clipboard to contain a fixed string.
\fBclipboard clear\fR
\fBclipboard append\fR "some fixed string"
.CE
+.PP
+You can put custom data into the clipboard by using a custom \fB\-type\fR
+option. This is not necessarily portable, but can be very useful. The
+method of passing Tcl scripts this way is effective, but should be mixed
+with safe interpreters in production code.
+.CS
+# This is a very simple canvas serializer;
+# it produces a script that recreates the item(s) when executed
+proc getItemConfig {canvas tag} {
+ set script {}
+ foreach item [$canvas find withtag $tag] {
+ append script {$canvas create } [$canvas type $item]
+ append script { } [$canvas coords $item] { }
+ foreach config [$canvas itemconf $item] {
+ lassign $config name \- \- \- value
+ append script [list $name $value] { }
+ }
+ append script \en
+ }
+ return [string trim $script]
+}
+
+# Set up a binding on a canvas to cut and paste an item
+set c [canvas .c]
+pack $c
+$c create text 150 30 \-text "cut and paste me"
+bind $c <<Cut>> {
+ \fBclipboard clear\fR
+ \fBclipboard append \-type\fR TkCanvasItem \e
+ [getItemConfig %W current]
+ # Delete because this is cut, not copy.
+ %W delete current
+}
+bind $c <<Paste>> {
+ catch {
+ set canvas %W
+ eval [\fBclipboard get \-type\fR TkCanvasItem]
+ }
+}
+.CE
.SH "SEE ALSO"
-selection(n)
+interp(n), selection(n)
.SH KEYWORDS
clear, format, clipboard, append, selection, type
diff --git a/doc/colors.n b/doc/colors.n
index 604ac52..6c31734 100644
--- a/doc/colors.n
+++ b/doc/colors.n
@@ -7,7 +7,7 @@
.so man.macros
.TH colors n 8.3 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
colors \- symbolic color names recognized by Tk
.BE
@@ -15,914 +15,932 @@ colors \- symbolic color names recognized by Tk
.PP
Tk recognizes many symbolic color names (e.g., \fBred\fR) when
specifying colors. The symbolic names recognized by Tk and their
-8-bit RGB values are:
-.CS
-\fIName\fR \fIRed\fR \fIGreen\fR \fIBlue\fR
-alice blue 240 248 255
-AliceBlue 240 248 255
-antique white 250 235 215
-AntiqueWhite 250 235 215
-AntiqueWhite1 255 239 219
-AntiqueWhite2 238 223 204
-AntiqueWhite3 205 192 176
-AntiqueWhite4 139 131 120
-aquamarine 127 255 212
-aquamarine1 127 255 212
-aquamarine2 118 238 198
-aquamarine3 102 205 170
-aquamarine4 69 139 116
-azure 240 255 255
-azure1 240 255 255
-azure2 224 238 238
-azure3 193 205 205
-azure4 131 139 139
-beige 245 245 220
-bisque 255 228 196
-bisque1 255 228 196
-bisque2 238 213 183
-bisque3 205 183 158
-bisque4 139 125 107
-black 0 0 0
-blanched almond 255 235 205
-BlanchedAlmond 255 235 205
-blue 0 0 255
-blue violet 138 43 226
-blue1 0 0 255
-blue2 0 0 238
-blue3 0 0 205
-blue4 0 0 139
-BlueViolet 138 43 226
-brown 165 42 42
-brown1 255 64 64
-brown2 238 59 59
-brown3 205 51 51
-brown4 139 35 35
-burlywood 222 184 135
-burlywood1 255 211 155
-burlywood2 238 197 145
-burlywood3 205 170 125
-burlywood4 139 115 85
-cadet blue 95 158 160
-CadetBlue 95 158 160
-CadetBlue1 152 245 255
-CadetBlue2 142 229 238
-CadetBlue3 122 197 205
-CadetBlue4 83 134 139
-chartreuse 127 255 0
-chartreuse1 127 255 0
-chartreuse2 118 238 0
-chartreuse3 102 205 0
-chartreuse4 69 139 0
-chocolate 210 105 30
-chocolate1 255 127 36
-chocolate2 238 118 33
-chocolate3 205 102 29
-chocolate4 139 69 19
-coral 255 127 80
-coral1 255 114 86
-coral2 238 106 80
-coral3 205 91 69
-coral4 139 62 47
-cornflower blue 100 149 237
-CornflowerBlue 100 149 237
-cornsilk 255 248 220
-cornsilk1 255 248 220
-cornsilk2 238 232 205
-cornsilk3 205 200 177
-cornsilk4 139 136 120
-cyan 0 255 255
-cyan1 0 255 255
-cyan2 0 238 238
-cyan3 0 205 205
-cyan4 0 139 139
-dark blue 0 0 139
-dark cyan 0 139 139
-dark goldenrod 184 134 11
-dark gray 169 169 169
-dark green 0 100 0
-dark grey 169 169 169
-dark khaki 189 183 107
-dark magenta 139 0 139
-dark olive green 85 107 47
-dark orange 255 140 0
-dark orchid 153 50 204
-dark red 139 0 0
-dark salmon 233 150 122
-dark sea green 143 188 143
-dark slate blue 72 61 139
-dark slate gray 47 79 79
-dark slate grey 47 79 79
-dark turquoise 0 206 209
-dark violet 148 0 211
-DarkBlue 0 0 139
-DarkCyan 0 139 139
-DarkGoldenrod 184 134 11
-DarkGoldenrod1 255 185 15
-DarkGoldenrod2 238 173 14
-DarkGoldenrod3 205 149 12
-DarkGoldenrod4 139 101 8
-DarkGray 169 169 169
-DarkGreen 0 100 0
-DarkGrey 169 169 169
-DarkKhaki 189 183 107
-DarkMagenta 139 0 139
-DarkOliveGreen 85 107 47
-DarkOliveGreen1 202 255 112
-DarkOliveGreen2 188 238 104
-DarkOliveGreen3 162 205 90
-DarkOliveGreen4 110 139 61
-DarkOrange 255 140 0
-DarkOrange1 255 127 0
-DarkOrange2 238 118 0
-DarkOrange3 205 102 0
-DarkOrange4 139 69 0
-DarkOrchid 153 50 204
-DarkOrchid1 191 62 255
-DarkOrchid2 178 58 238
-DarkOrchid3 154 50 205
-DarkOrchid4 104 34 139
-DarkRed 139 0 0
-DarkSalmon 233 150 122
-DarkSeaGreen 143 188 143
-DarkSeaGreen1 193 255 193
-DarkSeaGreen2 180 238 180
-DarkSeaGreen3 155 205 155
-DarkSeaGreen4 105 139 105
-DarkSlateBlue 72 61 139
-DarkSlateGray 47 79 79
-DarkSlateGray1 151 255 255
-DarkSlateGray2 141 238 238
-DarkSlateGray3 121 205 205
-DarkSlateGray4 82 139 139
-DarkSlateGrey 47 79 79
-DarkTurquoise 0 206 209
-DarkViolet 148 0 211
-deep pink 255 20 147
-deep sky blue 0 191 255
-DeepPink 255 20 147
-DeepPink1 255 20 147
-DeepPink2 238 18 137
-DeepPink3 205 16 118
-DeepPink4 139 10 80
-DeepSkyBlue 0 191 255
-DeepSkyBlue1 0 191 255
-DeepSkyBlue2 0 178 238
-DeepSkyBlue3 0 154 205
-DeepSkyBlue4 0 104 139
-dim gray 105 105 105
-dim grey 105 105 105
-DimGray 105 105 105
-DimGrey 105 105 105
-dodger blue 30 144 255
-DodgerBlue 30 144 255
-DodgerBlue1 30 144 255
-DodgerBlue2 28 134 238
-DodgerBlue3 24 116 205
-DodgerBlue4 16 78 139
-firebrick 178 34 34
-firebrick1 255 48 48
-firebrick2 238 44 44
-firebrick3 205 38 38
-firebrick4 139 26 26
-floral white 255 250 240
-FloralWhite 255 250 240
-forest green 34 139 34
-ForestGreen 34 139 34
-gainsboro 220 220 220
-ghost white 248 248 255
-GhostWhite 248 248 255
-gold 255 215 0
-gold1 255 215 0
-gold2 238 201 0
-gold3 205 173 0
-gold4 139 117 0
-goldenrod 218 165 32
-goldenrod1 255 193 37
-goldenrod2 238 180 34
-goldenrod3 205 155 29
-goldenrod4 139 105 20
-gray 190 190 190
-gray0 0 0 0
-gray1 3 3 3
-gray2 5 5 5
-gray3 8 8 8
-gray4 10 10 10
-gray5 13 13 13
-gray6 15 15 15
-gray7 18 18 18
-gray8 20 20 20
-gray9 23 23 23
-gray10 26 26 26
-gray11 28 28 28
-gray12 31 31 31
-gray13 33 33 33
-gray14 36 36 36
-gray15 38 38 38
-.CE
-.CS
-gray16 41 41 41
-gray17 43 43 43
-gray18 46 46 46
-gray19 48 48 48
-gray20 51 51 51
-gray21 54 54 54
-gray22 56 56 56
-gray23 59 59 59
-gray24 61 61 61
-gray25 64 64 64
-gray26 66 66 66
-gray27 69 69 69
-gray28 71 71 71
-gray29 74 74 74
-gray30 77 77 77
-gray31 79 79 79
-gray32 82 82 82
-gray33 84 84 84
-gray34 87 87 87
-gray35 89 89 89
-gray36 92 92 92
-gray37 94 94 94
-gray38 97 97 97
-gray39 99 99 99
-gray40 102 102 102
-gray41 105 105 105
-gray42 107 107 107
-gray43 110 110 110
-gray44 112 112 112
-gray45 115 115 115
-gray46 117 117 117
-gray47 120 120 120
-gray48 122 122 122
-gray49 125 125 125
-gray50 127 127 127
-gray51 130 130 130
-gray52 133 133 133
-gray53 135 135 135
-gray54 138 138 138
-gray55 140 140 140
-gray56 143 143 143
-gray57 145 145 145
-gray58 148 148 148
-gray59 150 150 150
-gray60 153 153 153
-gray61 156 156 156
-gray62 158 158 158
-gray63 161 161 161
-gray64 163 163 163
-gray65 166 166 166
-gray66 168 168 168
-gray67 171 171 171
-gray68 173 173 173
-gray69 176 176 176
-gray70 179 179 179
-gray71 181 181 181
-gray72 184 184 184
-gray73 186 186 186
-gray74 189 189 189
-gray75 191 191 191
-gray76 194 194 194
-gray77 196 196 196
-gray78 199 199 199
-gray79 201 201 201
-gray80 204 204 204
-gray81 207 207 207
-gray82 209 209 209
-gray83 212 212 212
-gray84 214 214 214
-gray85 217 217 217
-gray86 219 219 219
-gray87 222 222 222
-gray88 224 224 224
-gray89 227 227 227
-gray90 229 229 229
-gray91 232 232 232
-gray92 235 235 235
-gray93 237 237 237
-gray94 240 240 240
-gray95 242 242 242
-gray96 245 245 245
-gray97 247 247 247
-gray98 250 250 250
-gray99 252 252 252
-gray100 255 255 255
-green 0 255 0
-green yellow 173 255 47
-green1 0 255 0
-green2 0 238 0
-green3 0 205 0
-green4 0 139 0
-GreenYellow 173 255 47
-grey 190 190 190
-grey0 0 0 0
-grey1 3 3 3
-grey2 5 5 5
-grey3 8 8 8
-grey4 10 10 10
-grey5 13 13 13
-grey6 15 15 15
-grey7 18 18 18
-grey8 20 20 20
-grey9 23 23 23
-grey10 26 26 26
-grey11 28 28 28
-grey12 31 31 31
-grey13 33 33 33
-grey14 36 36 36
-grey15 38 38 38
-grey16 41 41 41
-grey17 43 43 43
-grey18 46 46 46
-grey19 48 48 48
-grey20 51 51 51
-grey21 54 54 54
-grey22 56 56 56
-grey23 59 59 59
-grey24 61 61 61
-grey25 64 64 64
-grey26 66 66 66
-grey27 69 69 69
-grey28 71 71 71
-grey29 74 74 74
-grey30 77 77 77
-grey31 79 79 79
-grey32 82 82 82
-grey33 84 84 84
-grey34 87 87 87
-grey35 89 89 89
-grey36 92 92 92
-grey37 94 94 94
-grey38 97 97 97
-grey39 99 99 99
-grey40 102 102 102
-grey41 105 105 105
-grey42 107 107 107
-grey43 110 110 110
-grey44 112 112 112
-grey45 115 115 115
-grey46 117 117 117
-grey47 120 120 120
-grey48 122 122 122
-grey49 125 125 125
-grey50 127 127 127
-grey51 130 130 130
-grey52 133 133 133
-grey53 135 135 135
-grey54 138 138 138
-grey55 140 140 140
-grey56 143 143 143
-grey57 145 145 145
-grey58 148 148 148
-grey59 150 150 150
-grey60 153 153 153
-grey61 156 156 156
-grey62 158 158 158
-grey63 161 161 161
-grey64 163 163 163
-grey65 166 166 166
-grey66 168 168 168
-grey67 171 171 171
-grey68 173 173 173
-grey69 176 176 176
-grey70 179 179 179
-grey71 181 181 181
-grey72 184 184 184
-grey73 186 186 186
-grey74 189 189 189
-grey75 191 191 191
-grey76 194 194 194
-grey77 196 196 196
-grey78 199 199 199
-grey79 201 201 201
-grey80 204 204 204
-grey81 207 207 207
-grey82 209 209 209
-grey83 212 212 212
-grey84 214 214 214
-grey85 217 217 217
-grey86 219 219 219
-grey87 222 222 222
-grey88 224 224 224
-grey89 227 227 227
-grey90 229 229 229
-grey91 232 232 232
-grey92 235 235 235
-grey93 237 237 237
-grey94 240 240 240
-grey95 242 242 242
-grey96 245 245 245
-grey97 247 247 247
-grey98 250 250 250
-grey99 252 252 252
-grey100 255 255 255
-honeydew 240 255 240
-honeydew1 240 255 240
-honeydew2 224 238 224
-honeydew3 193 205 193
-honeydew4 131 139 131
-hot pink 255 105 180
-.CE
-.CS
-HotPink 255 105 180
-HotPink1 255 110 180
-HotPink2 238 106 167
-HotPink3 205 96 144
-HotPink4 139 58 98
-indian red 205 92 92
-IndianRed 205 92 92
-IndianRed1 255 106 106
-IndianRed2 238 99 99
-IndianRed3 205 85 85
-IndianRed4 139 58 58
-ivory 255 255 240
-ivory1 255 255 240
-ivory2 238 238 224
-ivory3 205 205 193
-ivory4 139 139 131
-khaki 240 230 140
-khaki1 255 246 143
-khaki2 238 230 133
-khaki3 205 198 115
-khaki4 139 134 78
-lavender 230 230 250
-lavender blush 255 240 245
-LavenderBlush 255 240 245
-LavenderBlush1 255 240 245
-LavenderBlush2 238 224 229
-LavenderBlush3 205 193 197
-LavenderBlush4 139 131 134
-lawn green 124 252 0
-LawnGreen 124 252 0
-lemon chiffon 255 250 205
-LemonChiffon 255 250 205
-LemonChiffon1 255 250 205
-LemonChiffon2 238 233 191
-LemonChiffon3 205 201 165
-LemonChiffon4 139 137 112
-light blue 173 216 230
-light coral 240 128 128
-light cyan 224 255 255
-light goldenrod 238 221 130
-light goldenrod yellow 250 250 210
-light gray 211 211 211
-light green 144 238 144
-light grey 211 211 211
-light pink 255 182 193
-light salmon 255 160 122
-light sea green 32 178 170
-light sky blue 135 206 250
-light slate blue 132 112 255
-light slate gray 119 136 153
-light slate grey 119 136 153
-light steel blue 176 196 222
-light yellow 255 255 224
-LightBlue 173 216 230
-LightBlue1 191 239 255
-LightBlue2 178 223 238
-LightBlue3 154 192 205
-LightBlue4 104 131 139
-LightCoral 240 128 128
-LightCyan 224 255 255
-LightCyan1 224 255 255
-LightCyan2 209 238 238
-LightCyan3 180 205 205
-LightCyan4 122 139 139
-LightGoldenrod 238 221 130
-LightGoldenrod1 255 236 139
-LightGoldenrod2 238 220 130
-LightGoldenrod3 205 190 112
-LightGoldenrod4 139 129 76
-LightGoldenrodYellow 250 250 210
-LightGray 211 211 211
-LightGreen 144 238 144
-LightGrey 211 211 211
-LightPink 255 182 193
-LightPink1 255 174 185
-LightPink2 238 162 173
-LightPink3 205 140 149
-LightPink4 139 95 101
-LightSalmon 255 160 122
-LightSalmon1 255 160 122
-LightSalmon2 238 149 114
-LightSalmon3 205 129 98
-LightSalmon4 139 87 66
-LightSeaGreen 32 178 170
-LightSkyBlue 135 206 250
-LightSkyBlue1 176 226 255
-LightSkyBlue2 164 211 238
-LightSkyBlue3 141 182 205
-LightSkyBlue4 96 123 139
-LightSlateBlue 132 112 255
-LightSlateGray 119 136 153
-LightSlateGrey 119 136 153
-LightSteelBlue 176 196 222
-LightSteelBlue1 202 225 255
-LightSteelBlue2 188 210 238
-LightSteelBlue3 162 181 205
-LightSteelBlue4 110 123 139
-LightYellow 255 255 224
-LightYellow1 255 255 224
-LightYellow2 238 238 209
-LightYellow3 205 205 180
-LightYellow4 139 139 122
-lime green 50 205 50
-LimeGreen 50 205 50
-linen 250 240 230
-magenta 255 0 255
-magenta1 255 0 255
-magenta2 238 0 238
-magenta3 205 0 205
-magenta4 139 0 139
-maroon 176 48 96
-maroon1 255 52 179
-maroon2 238 48 167
-maroon3 205 41 144
-maroon4 139 28 98
-medium aquamarine 102 205 170
-medium blue 0 0 205
-medium orchid 186 85 211
-medium purple 147 112 219
-medium sea green 60 179 113
-medium slate blue 123 104 238
-medium spring green 0 250 154
-medium turquoise 72 209 204
-medium violet red 199 21 133
-MediumAquamarine 102 205 170
-MediumBlue 0 0 205
-MediumOrchid 186 85 211
-MediumOrchid1 224 102 255
-MediumOrchid2 209 95 238
-MediumOrchid3 180 82 205
-MediumOrchid4 122 55 139
-MediumPurple 147 112 219
-MediumPurple1 171 130 255
-MediumPurple2 159 121 238
-MediumPurple3 137 104 205
-MediumPurple4 93 71 139
-MediumSeaGreen 60 179 113
-MediumSlateBlue 123 104 238
-MediumSpringGreen 0 250 154
-MediumTurquoise 72 209 204
-MediumVioletRed 199 21 133
-midnight blue 25 25 112
-MidnightBlue 25 25 112
-mint cream 245 255 250
-MintCream 245 255 250
-misty rose 255 228 225
-MistyRose 255 228 225
-MistyRose1 255 228 225
-MistyRose2 238 213 210
-MistyRose3 205 183 181
-MistyRose4 139 125 123
-moccasin 255 228 181
-navajo white 255 222 173
-NavajoWhite 255 222 173
-NavajoWhite1 255 222 173
-NavajoWhite2 238 207 161
-NavajoWhite3 205 179 139
-NavajoWhite4 139 121 94
-navy 0 0 128
-navy blue 0 0 128
-NavyBlue 0 0 128
-old lace 253 245 230
-OldLace 253 245 230
-olive drab 107 142 35
-OliveDrab 107 142 35
-OliveDrab1 192 255 62
-OliveDrab2 179 238 58
-OliveDrab3 154 205 50
-OliveDrab4 105 139 34
-orange 255 165 0
-orange red 255 69 0
-orange1 255 165 0
-orange2 238 154 0
-orange3 205 133 0
-orange4 139 90 0
-OrangeRed 255 69 0
-OrangeRed1 255 69 0
-OrangeRed2 238 64 0
-OrangeRed3 205 55 0
-OrangeRed4 139 37 0
-orchid 218 112 214
-orchid1 255 131 250
-orchid2 238 122 233
-orchid3 205 105 201
-orchid4 139 71 137
-pale goldenrod 238 232 170
-pale green 152 251 152
-pale turquoise 175 238 238
-pale violet red 219 112 147
-PaleGoldenrod 238 232 170
-PaleGreen 152 251 152
-PaleGreen1 154 255 154
-PaleGreen2 144 238 144
-PaleGreen3 124 205 124
-PaleGreen4 84 139 84
-PaleTurquoise 175 238 238
-PaleTurquoise1 187 255 255
-PaleTurquoise2 174 238 238
-PaleTurquoise3 150 205 205
-PaleTurquoise4 102 139 139
-.CE
-.CS
-PaleVioletRed 219 112 147
-PaleVioletRed1 255 130 171
-PaleVioletRed2 238 121 159
-PaleVioletRed3 205 104 127
-PaleVioletRed4 139 71 93
-papaya whip 255 239 213
-PapayaWhip 255 239 213
-peach puff 255 218 185
-PeachPuff 255 218 185
-PeachPuff1 255 218 185
-PeachPuff2 238 203 173
-PeachPuff3 205 175 149
-PeachPuff4 139 119 101
-peru 205 133 63
-pink 255 192 203
-pink1 255 181 197
-pink2 238 169 184
-pink3 205 145 158
-pink4 139 99 108
-plum 221 160 221
-plum1 255 187 255
-plum2 238 174 238
-plum3 205 150 205
-plum4 139 102 139
-powder blue 176 224 230
-PowderBlue 176 224 230
-purple 160 32 240
-purple1 155 48 255
-purple2 145 44 238
-purple3 125 38 205
-purple4 85 26 139
-red 255 0 0
-red1 255 0 0
-red2 238 0 0
-red3 205 0 0
-red4 139 0 0
-rosy brown 188 143 143
-RosyBrown 188 143 143
-RosyBrown1 255 193 193
-RosyBrown2 238 180 180
-RosyBrown3 205 155 155
-RosyBrown4 139 105 105
-royal blue 65 105 225
-RoyalBlue 65 105 225
-RoyalBlue1 72 118 255
-RoyalBlue2 67 110 238
-RoyalBlue3 58 95 205
-RoyalBlue4 39 64 139
-saddle brown 139 69 19
-SaddleBrown 139 69 19
-salmon 250 128 114
-salmon1 255 140 105
-salmon2 238 130 98
-salmon3 205 112 84
-salmon4 139 76 57
-sandy brown 244 164 96
-SandyBrown 244 164 96
-sea green 46 139 87
-SeaGreen 46 139 87
-SeaGreen1 84 255 159
-SeaGreen2 78 238 148
-SeaGreen3 67 205 128
-SeaGreen4 46 139 87
-seashell 255 245 238
-seashell1 255 245 238
-seashell2 238 229 222
-seashell3 205 197 191
-seashell4 139 134 130
-sienna 160 82 45
-sienna1 255 130 71
-sienna2 238 121 66
-sienna3 205 104 57
-sienna4 139 71 38
-sky blue 135 206 235
-SkyBlue 135 206 235
-SkyBlue1 135 206 255
-SkyBlue2 126 192 238
-SkyBlue3 108 166 205
-SkyBlue4 74 112 139
-slate blue 106 90 205
-slate gray 112 128 144
-slate grey 112 128 144
-SlateBlue 106 90 205
-SlateBlue1 131 111 255
-SlateBlue2 122 103 238
-SlateBlue3 105 89 205
-SlateBlue4 71 60 139
-SlateGray 112 128 144
-SlateGray1 198 226 255
-SlateGray2 185 211 238
-SlateGray3 159 182 205
-SlateGray4 108 123 139
-SlateGrey 112 128 144
-snow 255 250 250
-snow1 255 250 250
-snow2 238 233 233
-snow3 205 201 201
-snow4 139 137 137
-spring green 0 255 127
-SpringGreen 0 255 127
-SpringGreen1 0 255 127
-SpringGreen2 0 238 118
-SpringGreen3 0 205 102
-SpringGreen4 0 139 69
-steel blue 70 130 180
-SteelBlue 70 130 180
-SteelBlue1 99 184 255
-SteelBlue2 92 172 238
-SteelBlue3 79 148 205
-SteelBlue4 54 100 139
-tan 210 180 140
-tan1 255 165 79
-tan2 238 154 73
-tan3 205 133 63
-tan4 139 90 43
-thistle 216 191 216
-thistle1 255 225 255
-thistle2 238 210 238
-thistle3 205 181 205
-thistle4 139 123 139
-tomato 255 99 71
-tomato1 255 99 71
-tomato2 238 92 66
-tomato3 205 79 57
-tomato4 139 54 38
-turquoise 64 224 208
-turquoise1 0 245 255
-turquoise2 0 229 238
-turquoise3 0 197 205
-turquoise4 0 134 139
-violet 238 130 238
-violet red 208 32 144
-VioletRed 208 32 144
-VioletRed1 255 62 150
-VioletRed2 238 58 140
-VioletRed3 205 50 120
-VioletRed4 139 34 82
-wheat 245 222 179
-wheat1 255 231 186
-wheat2 238 216 174
-wheat3 205 186 150
-wheat4 139 126 102
-white 255 255 255
-white smoke 245 245 245
-WhiteSmoke 245 245 245
-yellow 255 255 0
-yellow green 154 205 50
-yellow1 255 255 0
-yellow2 238 238 0
-yellow3 205 205 0
-yellow4 139 139 0
-YellowGreen 154 205 50
-.CE
-
+8-bit-per-channel RGB values are:
+.DS
+.ta 7.2cR 9.5cR 11cR
+\fBName\fR \fBRed\fR \fBGreen\fR \fBBlue\fR
+alice blue 240 248 255
+AliceBlue 240 248 255
+antique white 250 235 215
+AntiqueWhite 250 235 215
+AntiqueWhite1 255 239 219
+AntiqueWhite2 238 223 204
+AntiqueWhite3 205 192 176
+AntiqueWhite4 139 131 120
+aquamarine 127 255 212
+aquamarine1 127 255 212
+aquamarine2 118 238 198
+aquamarine3 102 205 170
+aquamarine4 69 139 116
+azure 240 255 255
+azure1 240 255 255
+azure2 224 238 238
+azure3 193 205 205
+azure4 131 139 139
+beige 245 245 220
+bisque 255 228 196
+bisque1 255 228 196
+bisque2 238 213 183
+bisque3 205 183 158
+bisque4 139 125 107
+black 0 0 0
+blanched almond 255 235 205
+BlanchedAlmond 255 235 205
+blue 0 0 255
+blue violet 138 43 226
+blue1 0 0 255
+blue2 0 0 238
+blue3 0 0 205
+blue4 0 0 139
+BlueViolet 138 43 226
+brown 165 42 42
+brown1 255 64 64
+brown2 238 59 59
+brown3 205 51 51
+brown4 139 35 35
+burlywood 222 184 135
+burlywood1 255 211 155
+burlywood2 238 197 145
+burlywood3 205 170 125
+burlywood4 139 115 85
+cadet blue 95 158 160
+CadetBlue 95 158 160
+CadetBlue1 152 245 255
+CadetBlue2 142 229 238
+CadetBlue3 122 197 205
+CadetBlue4 83 134 139
+chartreuse 127 255 0
+chartreuse1 127 255 0
+chartreuse2 118 238 0
+chartreuse3 102 205 0
+chartreuse4 69 139 0
+chocolate 210 105 30
+chocolate1 255 127 36
+chocolate2 238 118 33
+chocolate3 205 102 29
+chocolate4 139 69 19
+coral 255 127 80
+coral1 255 114 86
+coral2 238 106 80
+coral3 205 91 69
+coral4 139 62 47
+cornflower blue 100 149 237
+CornflowerBlue 100 149 237
+cornsilk 255 248 220
+cornsilk1 255 248 220
+cornsilk2 238 232 205
+cornsilk3 205 200 177
+cornsilk4 139 136 120
+cyan 0 255 255
+cyan1 0 255 255
+cyan2 0 238 238
+cyan3 0 205 205
+cyan4 0 139 139
+dark blue 0 0 139
+dark cyan 0 139 139
+dark goldenrod 184 134 11
+dark gray 169 169 169
+dark green 0 100 0
+dark grey 169 169 169
+dark khaki 189 183 107
+dark magenta 139 0 139
+dark olive green 85 107 47
+dark orange 255 140 0
+dark orchid 153 50 204
+dark red 139 0 0
+dark salmon 233 150 122
+dark sea green 143 188 143
+dark slate blue 72 61 139
+dark slate gray 47 79 79
+dark slate grey 47 79 79
+dark turquoise 0 206 209
+dark violet 148 0 211
+DarkBlue 0 0 139
+DarkCyan 0 139 139
+DarkGoldenrod 184 134 11
+DarkGoldenrod1 255 185 15
+DarkGoldenrod2 238 173 14
+DarkGoldenrod3 205 149 12
+DarkGoldenrod4 139 101 8
+DarkGray 169 169 169
+DarkGreen 0 100 0
+DarkGrey 169 169 169
+DarkKhaki 189 183 107
+DarkMagenta 139 0 139
+DarkOliveGreen 85 107 47
+DarkOliveGreen1 202 255 112
+DarkOliveGreen2 188 238 104
+DarkOliveGreen3 162 205 90
+DarkOliveGreen4 110 139 61
+DarkOrange 255 140 0
+DarkOrange1 255 127 0
+DarkOrange2 238 118 0
+DarkOrange3 205 102 0
+DarkOrange4 139 69 0
+DarkOrchid 153 50 204
+DarkOrchid1 191 62 255
+DarkOrchid2 178 58 238
+DarkOrchid3 154 50 205
+DarkOrchid4 104 34 139
+DarkRed 139 0 0
+DarkSalmon 233 150 122
+DarkSeaGreen 143 188 143
+DarkSeaGreen1 193 255 193
+DarkSeaGreen2 180 238 180
+DarkSeaGreen3 155 205 155
+DarkSeaGreen4 105 139 105
+DarkSlateBlue 72 61 139
+DarkSlateGray 47 79 79
+DarkSlateGray1 151 255 255
+DarkSlateGray2 141 238 238
+DarkSlateGray3 121 205 205
+DarkSlateGray4 82 139 139
+DarkSlateGrey 47 79 79
+DarkTurquoise 0 206 209
+DarkViolet 148 0 211
+deep pink 255 20 147
+deep sky blue 0 191 255
+DeepPink 255 20 147
+DeepPink1 255 20 147
+DeepPink2 238 18 137
+DeepPink3 205 16 118
+DeepPink4 139 10 80
+DeepSkyBlue 0 191 255
+DeepSkyBlue1 0 191 255
+DeepSkyBlue2 0 178 238
+DeepSkyBlue3 0 154 205
+DeepSkyBlue4 0 104 139
+dim gray 105 105 105
+dim grey 105 105 105
+DimGray 105 105 105
+DimGrey 105 105 105
+dodger blue 30 144 255
+DodgerBlue 30 144 255
+DodgerBlue1 30 144 255
+DodgerBlue2 28 134 238
+DodgerBlue3 24 116 205
+DodgerBlue4 16 78 139
+firebrick 178 34 34
+firebrick1 255 48 48
+firebrick2 238 44 44
+firebrick3 205 38 38
+firebrick4 139 26 26
+floral white 255 250 240
+FloralWhite 255 250 240
+forest green 34 139 34
+ForestGreen 34 139 34
+gainsboro 220 220 220
+ghost white 248 248 255
+GhostWhite 248 248 255
+gold 255 215 0
+gold1 255 215 0
+gold2 238 201 0
+gold3 205 173 0
+gold4 139 117 0
+goldenrod 218 165 32
+goldenrod1 255 193 37
+goldenrod2 238 180 34
+goldenrod3 205 155 29
+goldenrod4 139 105 20
+gray 190 190 190
+gray0 0 0 0
+gray1 3 3 3
+gray2 5 5 5
+gray3 8 8 8
+gray4 10 10 10
+gray5 13 13 13
+gray6 15 15 15
+gray7 18 18 18
+gray8 20 20 20
+gray9 23 23 23
+gray10 26 26 26
+gray11 28 28 28
+gray12 31 31 31
+gray13 33 33 33
+gray14 36 36 36
+gray15 38 38 38
+gray16 41 41 41
+gray17 43 43 43
+gray18 46 46 46
+gray19 48 48 48
+gray20 51 51 51
+gray21 54 54 54
+gray22 56 56 56
+gray23 59 59 59
+gray24 61 61 61
+gray25 64 64 64
+gray26 66 66 66
+gray27 69 69 69
+gray28 71 71 71
+gray29 74 74 74
+gray30 77 77 77
+gray31 79 79 79
+gray32 82 82 82
+gray33 84 84 84
+gray34 87 87 87
+gray35 89 89 89
+gray36 92 92 92
+gray37 94 94 94
+gray38 97 97 97
+gray39 99 99 99
+gray40 102 102 102
+gray41 105 105 105
+gray42 107 107 107
+gray43 110 110 110
+gray44 112 112 112
+gray45 115 115 115
+gray46 117 117 117
+gray47 120 120 120
+gray48 122 122 122
+gray49 125 125 125
+gray50 127 127 127
+gray51 130 130 130
+gray52 133 133 133
+gray53 135 135 135
+gray54 138 138 138
+gray55 140 140 140
+gray56 143 143 143
+gray57 145 145 145
+gray58 148 148 148
+gray59 150 150 150
+gray60 153 153 153
+gray61 156 156 156
+gray62 158 158 158
+gray63 161 161 161
+gray64 163 163 163
+gray65 166 166 166
+gray66 168 168 168
+gray67 171 171 171
+gray68 173 173 173
+gray69 176 176 176
+gray70 179 179 179
+gray71 181 181 181
+gray72 184 184 184
+gray73 186 186 186
+gray74 189 189 189
+gray75 191 191 191
+gray76 194 194 194
+gray77 196 196 196
+gray78 199 199 199
+gray79 201 201 201
+gray80 204 204 204
+gray81 207 207 207
+gray82 209 209 209
+gray83 212 212 212
+gray84 214 214 214
+gray85 217 217 217
+gray86 219 219 219
+gray87 222 222 222
+gray88 224 224 224
+gray89 227 227 227
+gray90 229 229 229
+gray91 232 232 232
+gray92 235 235 235
+gray93 237 237 237
+gray94 240 240 240
+gray95 242 242 242
+gray96 245 245 245
+gray97 247 247 247
+gray98 250 250 250
+gray99 252 252 252
+gray100 255 255 255
+green 0 255 0
+green yellow 173 255 47
+green1 0 255 0
+green2 0 238 0
+green3 0 205 0
+green4 0 139 0
+GreenYellow 173 255 47
+grey 190 190 190
+grey0 0 0 0
+grey1 3 3 3
+grey2 5 5 5
+grey3 8 8 8
+grey4 10 10 10
+grey5 13 13 13
+grey6 15 15 15
+grey7 18 18 18
+grey8 20 20 20
+grey9 23 23 23
+grey10 26 26 26
+grey11 28 28 28
+grey12 31 31 31
+grey13 33 33 33
+grey14 36 36 36
+grey15 38 38 38
+grey16 41 41 41
+grey17 43 43 43
+grey18 46 46 46
+grey19 48 48 48
+grey20 51 51 51
+grey21 54 54 54
+grey22 56 56 56
+grey23 59 59 59
+grey24 61 61 61
+grey25 64 64 64
+grey26 66 66 66
+grey27 69 69 69
+grey28 71 71 71
+grey29 74 74 74
+grey30 77 77 77
+grey31 79 79 79
+grey32 82 82 82
+grey33 84 84 84
+grey34 87 87 87
+grey35 89 89 89
+grey36 92 92 92
+grey37 94 94 94
+grey38 97 97 97
+grey39 99 99 99
+grey40 102 102 102
+grey41 105 105 105
+grey42 107 107 107
+grey43 110 110 110
+grey44 112 112 112
+grey45 115 115 115
+grey46 117 117 117
+grey47 120 120 120
+grey48 122 122 122
+grey49 125 125 125
+grey50 127 127 127
+grey51 130 130 130
+grey52 133 133 133
+grey53 135 135 135
+grey54 138 138 138
+grey55 140 140 140
+grey56 143 143 143
+grey57 145 145 145
+grey58 148 148 148
+grey59 150 150 150
+grey60 153 153 153
+grey61 156 156 156
+grey62 158 158 158
+grey63 161 161 161
+grey64 163 163 163
+grey65 166 166 166
+grey66 168 168 168
+grey67 171 171 171
+grey68 173 173 173
+grey69 176 176 176
+grey70 179 179 179
+grey71 181 181 181
+grey72 184 184 184
+grey73 186 186 186
+grey74 189 189 189
+grey75 191 191 191
+grey76 194 194 194
+grey77 196 196 196
+grey78 199 199 199
+grey79 201 201 201
+grey80 204 204 204
+grey81 207 207 207
+grey82 209 209 209
+grey83 212 212 212
+grey84 214 214 214
+grey85 217 217 217
+grey86 219 219 219
+grey87 222 222 222
+grey88 224 224 224
+grey89 227 227 227
+grey90 229 229 229
+grey91 232 232 232
+grey92 235 235 235
+grey93 237 237 237
+grey94 240 240 240
+grey95 242 242 242
+grey96 245 245 245
+grey97 247 247 247
+grey98 250 250 250
+grey99 252 252 252
+grey100 255 255 255
+honeydew 240 255 240
+honeydew1 240 255 240
+honeydew2 224 238 224
+honeydew3 193 205 193
+honeydew4 131 139 131
+hot pink 255 105 180
+HotPink 255 105 180
+HotPink1 255 110 180
+HotPink2 238 106 167
+HotPink3 205 96 144
+HotPink4 139 58 98
+indian red 205 92 92
+IndianRed 205 92 92
+IndianRed1 255 106 106
+IndianRed2 238 99 99
+IndianRed3 205 85 85
+IndianRed4 139 58 58
+ivory 255 255 240
+ivory1 255 255 240
+ivory2 238 238 224
+ivory3 205 205 193
+ivory4 139 139 131
+khaki 240 230 140
+khaki1 255 246 143
+khaki2 238 230 133
+khaki3 205 198 115
+khaki4 139 134 78
+lavender 230 230 250
+lavender blush 255 240 245
+LavenderBlush 255 240 245
+LavenderBlush1 255 240 245
+LavenderBlush2 238 224 229
+LavenderBlush3 205 193 197
+LavenderBlush4 139 131 134
+lawn green 124 252 0
+LawnGreen 124 252 0
+lemon chiffon 255 250 205
+LemonChiffon 255 250 205
+LemonChiffon1 255 250 205
+LemonChiffon2 238 233 191
+LemonChiffon3 205 201 165
+LemonChiffon4 139 137 112
+light blue 173 216 230
+light coral 240 128 128
+light cyan 224 255 255
+light goldenrod 238 221 130
+light goldenrod yellow 250 250 210
+light gray 211 211 211
+light green 144 238 144
+light grey 211 211 211
+light pink 255 182 193
+light salmon 255 160 122
+light sea green 32 178 170
+light sky blue 135 206 250
+light slate blue 132 112 255
+light slate gray 119 136 153
+light slate grey 119 136 153
+light steel blue 176 196 222
+light yellow 255 255 224
+LightBlue 173 216 230
+LightBlue1 191 239 255
+LightBlue2 178 223 238
+LightBlue3 154 192 205
+LightBlue4 104 131 139
+LightCoral 240 128 128
+LightCyan 224 255 255
+LightCyan1 224 255 255
+LightCyan2 209 238 238
+LightCyan3 180 205 205
+LightCyan4 122 139 139
+LightGoldenrod 238 221 130
+LightGoldenrod1 255 236 139
+LightGoldenrod2 238 220 130
+LightGoldenrod3 205 190 112
+LightGoldenrod4 139 129 76
+LightGoldenrodYellow 250 250 210
+LightGray 211 211 211
+LightGreen 144 238 144
+LightGrey 211 211 211
+LightPink 255 182 193
+LightPink1 255 174 185
+LightPink2 238 162 173
+LightPink3 205 140 149
+LightPink4 139 95 101
+LightSalmon 255 160 122
+LightSalmon1 255 160 122
+LightSalmon2 238 149 114
+LightSalmon3 205 129 98
+LightSalmon4 139 87 66
+LightSeaGreen 32 178 170
+LightSkyBlue 135 206 250
+LightSkyBlue1 176 226 255
+LightSkyBlue2 164 211 238
+LightSkyBlue3 141 182 205
+LightSkyBlue4 96 123 139
+LightSlateBlue 132 112 255
+LightSlateGray 119 136 153
+LightSlateGrey 119 136 153
+LightSteelBlue 176 196 222
+LightSteelBlue1 202 225 255
+LightSteelBlue2 188 210 238
+LightSteelBlue3 162 181 205
+LightSteelBlue4 110 123 139
+LightYellow 255 255 224
+LightYellow1 255 255 224
+LightYellow2 238 238 209
+LightYellow3 205 205 180
+LightYellow4 139 139 122
+lime green 50 205 50
+LimeGreen 50 205 50
+linen 250 240 230
+magenta 255 0 255
+magenta1 255 0 255
+magenta2 238 0 238
+magenta3 205 0 205
+magenta4 139 0 139
+maroon 176 48 96
+maroon1 255 52 179
+maroon2 238 48 167
+maroon3 205 41 144
+maroon4 139 28 98
+medium aquamarine 102 205 170
+medium blue 0 0 205
+medium orchid 186 85 211
+medium purple 147 112 219
+medium sea green 60 179 113
+medium slate blue 123 104 238
+medium spring green 0 250 154
+medium turquoise 72 209 204
+medium violet red 199 21 133
+MediumAquamarine 102 205 170
+MediumBlue 0 0 205
+MediumOrchid 186 85 211
+MediumOrchid1 224 102 255
+MediumOrchid2 209 95 238
+MediumOrchid3 180 82 205
+MediumOrchid4 122 55 139
+MediumPurple 147 112 219
+MediumPurple1 171 130 255
+MediumPurple2 159 121 238
+MediumPurple3 137 104 205
+MediumPurple4 93 71 139
+MediumSeaGreen 60 179 113
+MediumSlateBlue 123 104 238
+MediumSpringGreen 0 250 154
+MediumTurquoise 72 209 204
+MediumVioletRed 199 21 133
+midnight blue 25 25 112
+MidnightBlue 25 25 112
+mint cream 245 255 250
+MintCream 245 255 250
+misty rose 255 228 225
+MistyRose 255 228 225
+MistyRose1 255 228 225
+MistyRose2 238 213 210
+MistyRose3 205 183 181
+MistyRose4 139 125 123
+moccasin 255 228 181
+navajo white 255 222 173
+NavajoWhite 255 222 173
+NavajoWhite1 255 222 173
+NavajoWhite2 238 207 161
+NavajoWhite3 205 179 139
+NavajoWhite4 139 121 94
+navy 0 0 128
+navy blue 0 0 128
+NavyBlue 0 0 128
+old lace 253 245 230
+OldLace 253 245 230
+olive drab 107 142 35
+OliveDrab 107 142 35
+OliveDrab1 192 255 62
+OliveDrab2 179 238 58
+OliveDrab3 154 205 50
+OliveDrab4 105 139 34
+orange 255 165 0
+orange red 255 69 0
+orange1 255 165 0
+orange2 238 154 0
+orange3 205 133 0
+orange4 139 90 0
+OrangeRed 255 69 0
+OrangeRed1 255 69 0
+OrangeRed2 238 64 0
+OrangeRed3 205 55 0
+OrangeRed4 139 37 0
+orchid 218 112 214
+orchid1 255 131 250
+orchid2 238 122 233
+orchid3 205 105 201
+orchid4 139 71 137
+pale goldenrod 238 232 170
+pale green 152 251 152
+pale turquoise 175 238 238
+pale violet red 219 112 147
+PaleGoldenrod 238 232 170
+PaleGreen 152 251 152
+PaleGreen1 154 255 154
+PaleGreen2 144 238 144
+PaleGreen3 124 205 124
+PaleGreen4 84 139 84
+PaleTurquoise 175 238 238
+PaleTurquoise1 187 255 255
+PaleTurquoise2 174 238 238
+PaleTurquoise3 150 205 205
+PaleTurquoise4 102 139 139
+PaleVioletRed 219 112 147
+PaleVioletRed1 255 130 171
+PaleVioletRed2 238 121 159
+PaleVioletRed3 205 104 127
+PaleVioletRed4 139 71 93
+papaya whip 255 239 213
+PapayaWhip 255 239 213
+peach puff 255 218 185
+PeachPuff 255 218 185
+PeachPuff1 255 218 185
+PeachPuff2 238 203 173
+PeachPuff3 205 175 149
+PeachPuff4 139 119 101
+peru 205 133 63
+pink 255 192 203
+pink1 255 181 197
+pink2 238 169 184
+pink3 205 145 158
+pink4 139 99 108
+plum 221 160 221
+plum1 255 187 255
+plum2 238 174 238
+plum3 205 150 205
+plum4 139 102 139
+powder blue 176 224 230
+PowderBlue 176 224 230
+purple 160 32 240
+purple1 155 48 255
+purple2 145 44 238
+purple3 125 38 205
+purple4 85 26 139
+red 255 0 0
+red1 255 0 0
+red2 238 0 0
+red3 205 0 0
+red4 139 0 0
+rosy brown 188 143 143
+RosyBrown 188 143 143
+RosyBrown1 255 193 193
+RosyBrown2 238 180 180
+RosyBrown3 205 155 155
+RosyBrown4 139 105 105
+royal blue 65 105 225
+RoyalBlue 65 105 225
+RoyalBlue1 72 118 255
+RoyalBlue2 67 110 238
+RoyalBlue3 58 95 205
+RoyalBlue4 39 64 139
+saddle brown 139 69 19
+SaddleBrown 139 69 19
+salmon 250 128 114
+salmon1 255 140 105
+salmon2 238 130 98
+salmon3 205 112 84
+salmon4 139 76 57
+sandy brown 244 164 96
+SandyBrown 244 164 96
+sea green 46 139 87
+SeaGreen 46 139 87
+SeaGreen1 84 255 159
+SeaGreen2 78 238 148
+SeaGreen3 67 205 128
+SeaGreen4 46 139 87
+seashell 255 245 238
+seashell1 255 245 238
+seashell2 238 229 222
+seashell3 205 197 191
+seashell4 139 134 130
+sienna 160 82 45
+sienna1 255 130 71
+sienna2 238 121 66
+sienna3 205 104 57
+sienna4 139 71 38
+sky blue 135 206 235
+SkyBlue 135 206 235
+SkyBlue1 135 206 255
+SkyBlue2 126 192 238
+SkyBlue3 108 166 205
+SkyBlue4 74 112 139
+slate blue 106 90 205
+slate gray 112 128 144
+slate grey 112 128 144
+SlateBlue 106 90 205
+SlateBlue1 131 111 255
+SlateBlue2 122 103 238
+SlateBlue3 105 89 205
+SlateBlue4 71 60 139
+SlateGray 112 128 144
+SlateGray1 198 226 255
+SlateGray2 185 211 238
+SlateGray3 159 182 205
+SlateGray4 108 123 139
+SlateGrey 112 128 144
+snow 255 250 250
+snow1 255 250 250
+snow2 238 233 233
+snow3 205 201 201
+snow4 139 137 137
+spring green 0 255 127
+SpringGreen 0 255 127
+SpringGreen1 0 255 127
+SpringGreen2 0 238 118
+SpringGreen3 0 205 102
+SpringGreen4 0 139 69
+steel blue 70 130 180
+SteelBlue 70 130 180
+SteelBlue1 99 184 255
+SteelBlue2 92 172 238
+SteelBlue3 79 148 205
+SteelBlue4 54 100 139
+tan 210 180 140
+tan1 255 165 79
+tan2 238 154 73
+tan3 205 133 63
+tan4 139 90 43
+thistle 216 191 216
+thistle1 255 225 255
+thistle2 238 210 238
+thistle3 205 181 205
+thistle4 139 123 139
+tomato 255 99 71
+tomato1 255 99 71
+tomato2 238 92 66
+tomato3 205 79 57
+tomato4 139 54 38
+turquoise 64 224 208
+turquoise1 0 245 255
+turquoise2 0 229 238
+turquoise3 0 197 205
+turquoise4 0 134 139
+violet 238 130 238
+violet red 208 32 144
+VioletRed 208 32 144
+VioletRed1 255 62 150
+VioletRed2 238 58 140
+VioletRed3 205 50 120
+VioletRed4 139 34 82
+wheat 245 222 179
+wheat1 255 231 186
+wheat2 238 216 174
+wheat3 205 186 150
+wheat4 139 126 102
+white 255 255 255
+white smoke 245 245 245
+WhiteSmoke 245 245 245
+yellow 255 255 0
+yellow green 154 205 50
+yellow1 255 255 0
+yellow2 238 238 0
+yellow3 205 205 0
+yellow4 139 139 0
+YellowGreen 154 205 50
+.DE
.SH "PORTABILITY ISSUES"
-
.TP
\fBMac OS X\fR
+.
On Mac OS X, the following additional system colors are available
(note that the actual color values depend on the currently active OS theme,
and typically many of these will in fact be patterns rather than pure colors):
.RS
-.CS
-systemTransparent
-systemBlack
-systemWhite
-systemHighlight
-systemPrimaryHighlightColor
-systemHighlightSecondary
-systemSecondaryHighlightColor
-systemHighlightAlternate
-systemAlternatePrimaryHighlightColor
-systemHighlightText
-systemDialogBackgroundActive
-systemDialogBackgroundInactive
+.DS
+systemActiveAreaFill
+systemAlertActiveText
systemAlertBackgroundActive
systemAlertBackgroundInactive
-systemModelessDialogBackgroundActive
-systemModelessDialogBackgroundInactive
-systemUtilityWindowBackgroundActive
-systemUtilityWindowBackgroundInactive
-systemListViewSortColumnBackground
-systemListViewBackground
-systemIconLabelBackground
-systemListViewSeparator
-systemChasingArrows
-systemDragHilite
-systemWindowBody
-systemDocumentWindowBackground
-systemFinderWindowBackground
-systemScrollBarDelimiterActive
-systemScrollBarDelimiterInactive
-systemFocusHighlight
-systemPopupArrowActive
-systemPopupArrowPressed
-systemPopupArrowInactive
+systemAlertInactiveText
+systemAlternatePrimaryHighlightColor
systemAppleGuideCoachmark
-systemIconLabelBackgroundSelected
-systemStaticAreaFill
-systemActiveAreaFill
-systemButtonFrame
-systemButtonFrameActive
-systemButtonFrameInactive
+systemBevelActiveDark
+systemBevelActiveLight
+systemBevelButtonActiveText
+systemBevelButtonInactiveText
+systemBevelButtonPressedText
+systemBevelButtonStickyActiveText
+systemBevelButtonStickyInactiveText
+systemBevelInactiveDark
+systemBevelInactiveLight
+systemBlack
+systemBlackText
+systemButtonActiveDarkHighlight
+systemButtonActiveDarkShadow
+systemButtonActiveLightHighlight
+systemButtonActiveLightShadow
systemButtonFace
systemButtonFaceActive
systemButtonFaceInactive
systemButtonFacePressed
-systemButtonActiveDarkShadow
-systemButtonActiveDarkHighlight
-systemButtonActiveLightShadow
-systemButtonActiveLightHighlight
-systemButtonInactiveDarkShadow
+systemButtonFrame
+systemButtonFrameActive
+systemButtonFrameInactive
systemButtonInactiveDarkHighlight
-systemButtonInactiveLightShadow
+systemButtonInactiveDarkShadow
systemButtonInactiveLightHighlight
-systemButtonPressedDarkShadow
+systemButtonInactiveLightShadow
systemButtonPressedDarkHighlight
-systemButtonPressedLightShadow
+systemButtonPressedDarkShadow
systemButtonPressedLightHighlight
-systemBevelActiveLight
-systemBevelActiveDark
-systemBevelInactiveLight
-systemBevelInactiveDark
-systemNotificationWindowBackground
-systemMovableModalBackground
-systemSheetBackground
-systemSheetBackgroundOpaque
+systemButtonPressedLightShadow
+systemButtonText
+systemChasingArrows
+systemDialogActiveText
+systemDialogBackgroundActive
+systemDialogBackgroundInactive
+systemDialogInactiveText
+systemDocumentWindowBackground
+systemDocumentWindowTitleActiveText
+systemDocumentWindowTitleInactiveText
+systemDragHilite
systemDrawerBackground
-systemToolbarBackground
-systemSheetBackgroundTransparent
+systemFinderWindowBackground
+systemFocusHighlight
+systemHighlight
+systemHighlightAlternate
+systemHighlightSecondary
+systemHighlightText
+systemIconLabelBackground
+systemIconLabelBackgroundSelected
+systemIconLabelSelectedText
+systemIconLabelText
+systemListViewBackground
+systemListViewColumnDivider
+systemListViewEvenRowBackground
+systemListViewOddRowBackground
+systemListViewSeparator
+systemListViewSortColumnBackground
+systemListViewText
+systemListViewWindowHeaderBackground
systemMenu
-systemMenuBackground
systemMenuActive
+systemMenuActiveText
+systemMenuBackground
systemMenuBackgroundSelected
-systemListViewOddRowBackground
-systemListViewEvenRowBackground
-systemListViewColumnDivider
-systemTabPaneBackground
-systemPlacardBackground
-systemWindowHeaderBackground
-systemListViewWindowHeaderBackground
-systemSecondaryGroupBoxBackground
+systemMenuDisabled
+systemMenuItemActiveText
+systemMenuItemDisabledText
+systemMenuItemSelectedText
+systemMenuText
systemMetalBackground
-systemBlackText
-systemWhiteText
-systemDialogActiveText
-systemDialogInactiveText
-systemAlertActiveText
-systemAlertInactiveText
systemModelessDialogActiveText
+systemModelessDialogBackgroundActive
+systemModelessDialogBackgroundInactive
systemModelessDialogInactiveText
-systemWindowHeaderActiveText
-systemWindowHeaderInactiveText
+systemMovableModalBackground
+systemMovableModalWindowTitleActiveText
+systemMovableModalWindowTitleInactiveText
+systemNotificationText
+systemNotificationWindowBackground
systemPlacardActiveText
+systemPlacardBackground
systemPlacardInactiveText
systemPlacardPressedText
-systemButtonText
-systemPushButtonActiveText
-systemPushButtonInactiveText
-systemPushButtonPressedText
-systemBevelButtonActiveText
-systemBevelButtonInactiveText
-systemBevelButtonPressedText
+systemPopupArrowActive
+systemPopupArrowInactive
+systemPopupArrowPressed
systemPopupButtonActiveText
systemPopupButtonInactiveText
systemPopupButtonPressedText
-systemIconLabelText
-systemListViewText
-systemDocumentWindowTitleActiveText
-systemDocumentWindowTitleInactiveText
-systemMovableModalWindowTitleActiveText
-systemMovableModalWindowTitleInactiveText
-systemUtilityWindowTitleActiveText
-systemUtilityWindowTitleInactiveText
+systemPopupLabelActiveText
+systemPopupLabelInactiveText
systemPopupWindowTitleActiveText
systemPopupWindowTitleInactiveText
+systemPrimaryHighlightColor
+systemPushButtonActiveText
+systemPushButtonInactiveText
+systemPushButtonPressedText
systemRootMenuActiveText
-systemRootMenuSelectedText
systemRootMenuDisabledText
-systemMenuText
-systemMenuItemActiveText
-systemMenuActiveText
-systemMenuItemSelectedText
-systemMenuDisabled
-systemMenuItemDisabledText
-systemPopupLabelActiveText
-systemPopupLabelInactiveText
+systemRootMenuSelectedText
+systemScrollBarDelimiterActive
+systemScrollBarDelimiterInactive
+systemSecondaryGroupBoxBackground
+systemSecondaryHighlightColor
+systemSheetBackground
+systemSheetBackgroundOpaque
+systemSheetBackgroundTransparent
+systemStaticAreaFill
+systemSystemDetailText
systemTabFrontActiveText
-systemTabNonFrontActiveText
-systemTabNonFrontPressedText
systemTabFrontInactiveText
+systemTabNonFrontActiveText
systemTabNonFrontInactiveText
-systemIconLabelSelectedText
-systemBevelButtonStickyActiveText
-systemBevelButtonStickyInactiveText
-systemNotificationText
-systemSystemDetailText
-.CE
+systemTabNonFrontPressedText
+systemTabPaneBackground
+systemToolbarBackground
+systemTransparent
+systemUtilityWindowBackgroundActive
+systemUtilityWindowBackgroundInactive
+systemUtilityWindowTitleActiveText
+systemUtilityWindowTitleInactiveText
+systemWhite
+systemWhiteText
+systemWindowBody
+systemWindowHeaderActiveText
+systemWindowHeaderBackground
+systemWindowHeaderInactiveText
+.DE
+.RE
+.TP
+\fBWindows\fR
+.
+On Windows, the following additional system colors are available
+(note that the actual color values depend on the currently active OS theme):
+.RS
+.DS
+.ta 6c
+3dDarkShadow Highlight
+3dLight HighlightText
+ActiveBorder InactiveBorder
+ActiveCaption InactiveCaption
+AppWorkspace InactiveCaptionText
+Background InfoBackground
+ButtonFace InfoText
+ButtonHighlight Menu
+ButtonShadow MenuText
+ButtonText Scrollbar
+CaptionText Window
+DisabledText WindowFrame
+GrayText WindowText
+.DE
.RE
-
+.SH "SEE ALSO"
+options(n), Tk_GetColor(3)
.SH KEYWORDS
color, option
diff --git a/doc/console.n b/doc/console.n
index c6ea1d1..8e0691c 100644
--- a/doc/console.n
+++ b/doc/console.n
@@ -13,7 +13,6 @@ console \- Control the console on systems without a real console
.SH SYNOPSIS
\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The console window is a replacement for a real console to allow input
@@ -22,7 +21,13 @@ a real console. It is implemented as a separate interpreter with the
Tk toolkit loaded, and control over this interpreter is given through
the \fBconsole\fR command. The behaviour of the console window is
defined mainly through the contents of the \fIconsole.tcl\fR file in
-the Tk library (or the \fIConsole\fR resource on Macintosh systems.)
+the Tk library. Except for TkAqua, this command is not available when
+Tk is loaded into a tclsh interpreter with
+.QW "\fBpackage require Tk\fR" ,
+as a conventional terminal is expected to be present in that case.
+In TkAqua, this command is ony available when stdin is \fB/dev/null\fR
+(as is the case e.g. when the application embedding Tk is started
+from the Mac OS X Finder).
.PP
.TP
\fBconsole eval \fIscript\fR
@@ -130,9 +135,7 @@ often has the following code fragment in it so output produced by
.CS
catch {\fBconsole show\fR}
.CE
-
-.SH KEYWORDS
-console, interpreter, window, interactive, output channels
-
.SH "SEE ALSO"
destroy(n), fconfigure(n), history(n), interp(n), puts(n), text(n), wm(n)
+.SH KEYWORDS
+console, interpreter, window, interactive, output channels
diff --git a/doc/cursors.n b/doc/cursors.n
index 06a0208..8bc2a8f 100644
--- a/doc/cursors.n
+++ b/doc/cursors.n
@@ -11,10 +11,9 @@
.SH NAME
cursors \- mouse cursors available in Tk
.BE
-
.SH DESCRIPTION
.PP
-The \fB-cursor\fR widget option allows a Tk programmer to change the
+The \fB\-cursor\fR widget option allows a Tk programmer to change the
mouse cursor for a particular widget. The cursor names recognized by
Tk on all platforms are:
.CS
@@ -61,6 +60,7 @@ lr_angle
man
middlebutton
mouse
+none
pencil
pirate
plus
@@ -96,9 +96,9 @@ ur_angle
watch
xterm
.CE
-
+.PP
+The \fBnone\fR cursor can be specified to eliminate the cursor.
.SH "PORTABILITY ISSUES"
-
.TP
\fBWindows\fR
On Windows systems, the following cursors are mapped to native cursors:
@@ -110,6 +110,7 @@ crosshair
fleur
ibeam
icon
+none
sb_h_double_arrow
sb_v_double_arrow
watch
@@ -127,9 +128,7 @@ size_we
uparrow
wait
.CE
-The \fBno\fR cursor can be specified to eliminate the cursor.
.RE
-
.TP
\fBMac OS X\fR
On Mac OS X systems, the following cursors are mapped to native cursors:
@@ -139,6 +138,7 @@ arrow
cross
crosshair
ibeam
+none
plus
watch
xterm
@@ -159,7 +159,6 @@ resizeleftright
resizeup
resizedown
resizeupdown
-none
notallowed
poof
countinguphand
@@ -168,6 +167,5 @@ countingupanddownhand
spinning
.CE
.RE
-
.SH KEYWORDS
cursor, option
diff --git a/doc/destroy.n b/doc/destroy.n
index 65b0caa..93aedd5 100644
--- a/doc/destroy.n
+++ b/doc/destroy.n
@@ -14,19 +14,18 @@ destroy \- Destroy one or more windows
.SH SYNOPSIS
\fBdestroy \fR?\fIwindow window ...\fR?
.BE
-
.SH DESCRIPTION
-.VS
.PP
This command deletes the windows given by the
\fIwindow\fR arguments, plus all of their descendants.
-If a \fIwindow\fR ``.'' is deleted then the entire application
-will be destroyed.
+If a \fIwindow\fR
+.QW .
+is deleted then all windows will be destroyed and the application will
+(normally) exit.
The \fIwindow\fRs are destroyed in order, and if an error occurs
in destroying a window the command aborts without destroying the
remaining windows.
No error is returned if \fIwindow\fR does not exist.
-.VE
.SH EXAMPLE
Destroy all checkbuttons that are direct children of the given widget:
.CS
diff --git a/doc/dialog.n b/doc/dialog.n
index 1f91b3f..e72cbac 100644
--- a/doc/dialog.n
+++ b/doc/dialog.n
@@ -39,7 +39,7 @@ If this is an empty string then no bitmap is displayed in the dialog.
If this is an integer greater than or equal to zero, then it gives
the index of the button that is to be the default button for the dialog
(0 for the leftmost button, and so on).
-If less than zero or an empty string then there won't be any default
+If less than zero or an empty string then there will not be any default
button.
.TP
\fIstring\fR
@@ -53,14 +53,14 @@ mouse or by typing return to invoke the default button (if any).
Then it returns the index of the selected button: 0 for the leftmost
button, 1 for the button next to it, and so on.
If the dialog's window is destroyed before the user selects one
-of the buttons, then -1 is returned.
+of the buttons, then \-1 is returned.
.PP
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
.CS
-set reply [\fBtk_dialog\fR .foo "The Title" "Do you want to say yes?" \\
+set reply [\fBtk_dialog\fR .foo "The Title" "Do you want to say yes?" \e
questhead 0 Yes No "I'm not sure"]
.CE
diff --git a/doc/entry.n b/doc/entry.n
index 5a34b47..58c5d64 100644
--- a/doc/entry.n
+++ b/doc/entry.n
@@ -25,37 +25,31 @@ entry \- Create and manipulate entry widgets
\-highlightcolor \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
-.VS 8.4
.OP \-disabledbackground disabledBackground DisabledBackground
Specifies the background color to use when the entry is disabled. If
this option is the empty string, the normal background color is used.
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies the foreground color to use when the entry is disabled. If
this option is the empty string, the normal foreground color is used.
-.VE 8.4
-.VS 8.3
.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
Specifies a script to eval when \fBvalidateCommand\fR returns 0.
Setting it to {} disables this feature (the default). The best use
of this option is to set it to \fIbell\fR. See \fBValidation\fR
below for more information.
-.VE
-.VS 8.4
.OP \-readonlybackground readonlyBackground ReadonlyBackground
Specifies the background color to use when the entry is readonly. If
this option is the empty string, the normal background color is used.
-.VE
.OP \-show show Show
If this option is specified, then the true contents of the entry
are not displayed in the window.
Instead, each character in the entry's value will be displayed as
-the first character in the value of this option, such as ``*''.
+the first character in the value of this option, such as
+.QW * .
This is useful, for example, if the entry is to be used to enter
a password.
If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents
of the entry.
-.VS 8.4
.OP \-state state State
Specifies one of three states for the entry: \fBnormal\fR,
\fBdisabled\fR, or \fBreadonly\fR. If the entry is readonly, then the
@@ -65,9 +59,7 @@ contents of the widget may still be selected. If the entry is
disabled, the value may not be changed, no insertion cursor will be
displayed, the contents will not be selectable, and the entry may
be displayed in a different color, depending on the values of the
-\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
-.VE 8.4
-.VS 8.3
+\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
.OP \-validate validate Validate
Specifies the mode in which validation should operate: \fBnone\fR,
\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
@@ -81,14 +73,12 @@ 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
is set. If it returns 1, then the new edition occurs.
See \fBValidation\fR below for more information.
-.VE
.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.
If the value is less than or equal to zero, the widget picks a
size just large enough to hold its current text.
.BE
-
.SH DESCRIPTION
.PP
The \fBentry\fR command creates a new window (given by the
@@ -122,7 +112,6 @@ the standard \fBxScrollCommand\fR mechanism for interacting with
scrollbars (see the description of the \fBxScrollCommand\fR option
for details). They also support scanning, as described below.
.SH VALIDATION
-.VS 8.3
.PP
Validation works by setting the \fBvalidateCommand\fR
option to a script which will be evaluated according to the \fBvalidate\fR
@@ -149,9 +138,9 @@ are recognized:
.PP
.IP \fB%d\fR 5
Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
-or -1 for focus, forced or textvariable validation.
+or \-1 for focus, forced or textvariable validation.
.IP \fB%i\fR 5
-Index of char string to be inserted/deleted, if any, otherwise -1.
+Index of char string to be inserted/deleted, if any, otherwise \-1.
.IP \fB%P\fR 5
The value of the entry if the edit is allowed. If you are configuring the
entry widget to have a new textvariable, this will be the value of that
@@ -188,23 +177,23 @@ 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
include the command
.CS
-after idle {%W config -validate %v}
+after idle {%W config \-validate %v}
.CE
in the \fBvalidateCommand\fR or \fBinvalidCommand\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.
-.VE
.SH "WIDGET COMMAND"
.PP
The \fBentry\fR command creates a new Tcl command whose
name is \fIpathName\fR. This command may be used to invoke various
operations on the widget. It has the following general form:
.CS
-\fIpathName option \fR?\fIarg arg ...\fR?
+\fIpathName subcommand \fR?\fIarg arg ...\fR?
.CE
-\fIOption\fR and the \fIarg\fRs
+\fISubcommand\fR and the \fIarg\fRs
determine the exact behavior of the command.
+.SS INDICES
.PP
Many of the widget commands for entries take one or more indices as
arguments. An index specifies a particular character in the entry's
@@ -229,22 +218,27 @@ insertion cursor.
.TP 12
\fBsel.first\fR
Indicates the first character in the selection. It is an error to
-use this form if the selection isn't in the entry window.
+use this form if the selection is not in the entry window.
.TP 12
\fBsel.last\fR
Indicates the character just after the last one in the selection.
-It is an error to use this form if the selection isn't in the
+It is an error to use this form if the selection is not in the
entry window.
.TP 12
\fB@\fInumber\fR
In this form, \fInumber\fR is treated as an x-coordinate in the
entry's window; the character spanning that x-coordinate is used.
-For example, ``\fB@0\fR'' indicates the left-most character in the
-window.
+For example,
+.QW \fB@0\fR
+indicates the left-most character in the window.
.LP
-Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
-or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
-rounded to the nearest legal value.
+Abbreviations may be used for any of the forms above, e.g.
+.QW \fBe\fR
+or
+.QW \fBsel.f\fR .
+In general, out-of-range indices are automatically rounded to the
+nearest legal value.
+.SS SUBCOMMANDS
.PP
The following commands are possible for entry widgets:
.TP
@@ -283,7 +277,7 @@ Delete one or more elements of the entry.
\fIFirst\fR is the index of the first character to delete, and
\fIlast\fR is the index of the character just after the last
one to delete.
-If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
+If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This command returns an empty string.
.TP
@@ -333,19 +327,19 @@ Locate the end of the selection nearest to the character given by
(i.e. including but not going beyond \fIindex\fR). The other
end of the selection is made the anchor point for future
\fBselect to\fR commands. If the selection
-isn't currently in the entry, then a new selection is created to
+is not currently in the entry, then a new selection is created to
include the characters between \fIindex\fR and the most recent
selection anchor point, inclusive.
Returns an empty string.
.TP
\fIpathName \fBselection clear\fR
Clear the selection if it is currently in this widget. If the
-selection isn't in this widget then the command has no effect.
+selection is not in this widget then the command has no effect.
Returns an empty string.
.TP
\fIpathName \fBselection from \fIindex\fR
Set the selection anchor point to just before the character
-given by \fIindex\fR. Doesn't change the selection.
+given by \fIindex\fR. Does not change the selection.
Returns an empty string.
.TP
\fIpathName \fBselection present\fR
@@ -369,18 +363,16 @@ to the characters from the anchor point up to but not including
\fIindex\fR.
The anchor point is determined by the most recent \fBselect from\fR
or \fBselect adjust\fR command in this widget.
-If the selection isn't in this widget then a new selection is
+If the selection is not in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
-.VS 8.3
.TP
\fIpathName \fBvalidate\fR
This command is used to force an evaluation of the \fBvalidateCommand\fR
independent of the conditions specified by the \fBvalidate\fR option.
This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR.
It returns 0 or 1.
-.VE
.TP
\fIpathName \fBxview \fIargs\fR
This command is used to query and change the horizontal position of the
@@ -423,10 +415,11 @@ become visible.
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for entries that give them
-the following default behavior.
-In the descriptions below, ``word'' refers to a contiguous group
-of letters, digits, or ``_'' characters, or any single character
-other than these.
+the following default behavior. In the descriptions below,
+.QW word
+refers to a contiguous group of letters, digits, or
+.QW _
+characters, or any single character other than these.
.IP [1]
Clicking mouse button 1 positions the insertion cursor
just before the character underneath the mouse cursor, sets the
@@ -487,7 +480,7 @@ Shift-End moves the cursor to the end and extends the selection
to that point.
.IP [12]
The Select key and Control-Space set the selection anchor to the position
-of the insertion cursor. They don't affect the current selection.
+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.
@@ -531,14 +524,13 @@ If the entry is disabled using the \fB\-state\fR option, then the entry's
view can still be adjusted and text in the entry can still be selected,
but no insertion cursor will be displayed and no text modifications will
take place
-.VS
except if the entry is linked to a variable using the \fB\-textvariable\fR
option, in which case any changes to the variable are reflected by the
entry whatever the value of its \fB\-state\fR option.
-.VE
.PP
The behavior of entries can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "SEE ALSO"
+ttk::entry(n)
.SH KEYWORDS
entry, widget
diff --git a/doc/event.n b/doc/event.n
index 49e04d3..69f336a 100644
--- a/doc/event.n
+++ b/doc/event.n
@@ -14,7 +14,6 @@ event \- Miscellaneous event facilities: define virtual events and generate even
.SH SYNOPSIS
\fBevent\fI option \fR?\fIarg arg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBevent\fR command provides several facilities for dealing with
@@ -49,10 +48,8 @@ trigger anymore.
Generates a window event and arranges for it to be processed just as if
it had come from the window system.
\fIWindow\fR gives the path name of the window for which the event
-.VS 8.3
will be generated; it may also be an identifier (such as returned by
\fBwinfo id\fR) as long as it is for a window in the current application.
-.VE
\fIEvent\fR provides a basic description of
the event, such as \fB<Shift-Button-2>\fR or \fB<<Paste>>\fR.
If \fIWindow\fR is empty the whole screen is meant, and coordinates
@@ -62,14 +59,14 @@ argument of the \fBbind\fR command except that it must consist
of a single event pattern, not a sequence.
\fIOption-value\fR pairs may be used to specify additional
attributes of the event, such as the x and y mouse position; see
-EVENT FIELDS below. If the \fB\-when\fR option is not specified, the
+\fBEVENT FIELDS\fR below. If the \fB\-when\fR option is not specified, the
event is processed immediately: all of the handlers for the event
will complete before the \fBevent generate\fR command returns.
If the \fB\-when\fR option is specified then it determines when the
event is processed. Certain events, such as key events, require
that the window has focus to receive the event properly.
.TP
-\fBevent info \fR?<<\fIvirtual\fB>>\fR?
+\fBevent info \fR?\fB<<\fIvirtual\fB>>\fR?
Returns information about virtual events.
If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value
is a list of all the virtual events that are currently defined.
@@ -77,11 +74,17 @@ If \fB<<\fIvirtual\fB>>\fR is specified then the return value is
a list whose elements are the physical event sequences currently
defined for the given virtual event; if the virtual event is
not defined then an empty string is returned.
+.RS
+.PP
+Note that virtual events that that are not bound to physical event
+sequences are \fInot\fR returned by \fBevent info\fR.
+.RE
.SH "EVENT FIELDS"
.PP
The following options are supported for the \fBevent generate\fR
-command. These correspond to the ``%'' expansions
-allowed in binding scripts for the \fBbind\fR command.
+command. These correspond to the
+.QW %
+expansions allowed in binding scripts for the \fBbind\fR command.
.TP
\fB\-above\fI window\fR
\fIWindow\fR specifies the \fIabove\fR field for the event,
@@ -105,6 +108,13 @@ 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
@@ -112,7 +122,7 @@ for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the
direction and magnitude the mouse wheel was rotated. Note the value
is not a screen distance but are units of motion in the mouse wheel.
Typically these values are multiples of 120. For example, 120 should
-scroll the text widget up 4 lines and -240 would scroll the text
+scroll the text widget up 4 lines and \-240 would scroll the text
widget down 8 lines. Of course, other widgets may define different
behaviors for mouse wheel motion. This field corresponds to the
\fB%D\fR substitution for binding scripts.
@@ -123,10 +133,10 @@ and must be one of the following:
.RS
.DS
.ta 6c
-\fBNotifyAncestor NotifyNonlinearVirtual
-NotifyDetailNone NotifyPointer
-NotifyInferior NotifyPointerRoot
-NotifyNonlinear NotifyVirtual\fR
+\fBNotifyAncestor\fR \fBNotifyNonlinearVirtual\fR
+\fBNotifyDetailNone\fR \fBNotifyPointer\fR
+\fBNotifyInferior\fR \fBNotifyPointerRoot\fR
+\fBNotifyNonlinear\fR \fBNotifyVirtual\fR
.DE
Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and
\fBFocusOut\fR events.
@@ -297,6 +307,74 @@ for binding scripts.
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"
+Tk defines the following virtual events for the purposes of
+notification:
+.TP
+\fB<<AltUnderlined>>\fR
+This is sent to widget to notify it that the letter it has underlined
+(as an accelerator indicator) with the \fB\-underline\fR option has
+been pressed in combination with the Alt key. The usual response to
+this is to either focus into the widget (or some related widget) or to
+invoke the widget.
+.TP
+\fB<<ListboxSelect>>\fR
+This is sent to a listbox when the set of selected item(s) in the
+listbox is updated.
+.TP
+\fB<<MenuSelect>>\fR
+This is sent to a menu when the currently selected item in the menu
+changes. It is intended for use with context-sensitive help systems.
+.TP
+\fB<<Modified>>\fR
+This is sent to a text widget when the contents of the widget are
+changed.
+.TP
+\fB<<Selection>>\fR
+This is sent to a text widget when the selection in the widget is
+changed.
+.TP
+\fB<<TraverseIn>>\fR
+This is sent to a widget when the focus enters the widget because of a
+user-driven
+.QW "tab to widget"
+action.
+.TP
+\fB<<TraverseOut>>\fR
+This is sent to a widget when the focus leaves the widget because of a
+user-driven
+.QW "tab to widget"
+action.
+.PP
+Tk defines the following virtual events for the purposes of unifying
+bindings across multiple platforms. Users expect them to behave in the
+following way:
+.TP
+\fB<<Clear>>\fR
+Delete the currently selected widget contents.
+.TP
+\fB<<Copy>>\fR
+Copy the currently selected widget contents to the clipboard.
+.TP
+\fB<<Cut>>\fR
+Move the currently selected widget contents to the clipboard.
+.TP
+\fB<<Paste>>\fR
+Replace the currently selected widget contents with the contents of
+the clipboard.
+.TP
+\fB<<PasteSelection>>\fR
+Insert the contents of the selection at the mouse location. (This
+event has meaningful \fB%x\fR and \fB%y\fR substitutions).
+.TP
+\fB<<PrevWindow>>\fR
+Traverse to the previous window.
+.TP
+\fB<<Redo>>\fR
+Redo one undone action.
+.TP
+\fB<<Undo>>\fR
+Undo the last action.
.SH "VIRTUAL EVENT EXAMPLES"
.PP
In order for a virtual event binding to trigger, two things must
diff --git a/doc/focus.n b/doc/focus.n
index d37697a..f37e1cd 100644
--- a/doc/focus.n
+++ b/doc/focus.n
@@ -67,7 +67,7 @@ displays.
If the application currently has the input focus on \fIwindow\fR's
display, this command resets the input focus for \fIwindow\fR's display
to \fIwindow\fR and returns an empty string.
-If the application doesn't currently have the input focus on
+If the application does not currently have the input focus on
\fIwindow\fR's display, \fIwindow\fR will be remembered as the focus
for its top-level; the next time the focus arrives at the top-level,
Tk will redirect it to \fIwindow\fR.
@@ -75,12 +75,12 @@ If \fIwindow\fR is an empty string then the command does nothing.
.TP
\fBfocus \-displayof\fR \fIwindow\fR
Returns the name of the focus window on the display containing \fIwindow\fR.
-If the focus window for \fIwindow\fR's display isn't in this
+If the focus window for \fIwindow\fR's display is not in this
application, the return value is an empty string.
.TP
\fBfocus \-force \fIwindow\fR
Sets the focus of \fIwindow\fR's display to \fIwindow\fR, even if
-the application doesn't currently have the input focus for the display.
+the application does not currently have the input focus for the display.
This command should be used sparingly, if at all.
In normal usage, an application should not claim the focus for
itself; instead, it should wait for the window manager to give it
@@ -97,7 +97,7 @@ will receive the input focus the next time the window manager gives
the focus to the top-level.
.SH "QUIRKS"
.PP
-When an internal window receives the input focus, Tk doesn't actually
+When an internal window receives the input focus, Tk does not actually
set the X focus to that window; as far as X is concerned, the focus
will stay on the top-level window containing the window with the focus.
However, Tk generates FocusIn and FocusOut events just as if the X
@@ -110,11 +110,11 @@ 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:
.CS
-button .before -text "Before"
-button .middle -text "Middle"
-button .after -text "After"
-checkbutton .flag -variable traverseToMiddle -takefocus 0
-pack .flag -side left
+button .before \-text "Before"
+button .middle \-text "Middle"
+button .after \-text "After"
+checkbutton .flag \-variable traverseToMiddle \-takefocus 0
+pack .flag \-side left
pack .before .middle .after
bind .before <Tab> {
if {!$traverseToMiddle} {
@@ -122,7 +122,7 @@ bind .before <Tab> {
break
}
}
-bind .after <Shift-Tab> {
+bind .after <Shift\-Tab> {
if {!$traverseToMiddle} {
\fBfocus\fR .before
break
diff --git a/doc/focusNext.n b/doc/focusNext.n
index 1279f20..ede496f 100644
--- a/doc/focusNext.n
+++ b/doc/focusNext.n
@@ -22,8 +22,9 @@ tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for manag
.SH DESCRIPTION
.PP
\fBtk_focusNext\fR is a utility procedure used for keyboard traversal.
-It returns the ``next'' window after \fIwindow\fR in focus order.
-The focus order is determined by
+It returns the
+.QW next
+window after \fIwindow\fR in focus order. The focus order is determined by
the stacking order of windows and the structure of the window hierarchy.
Among siblings, the focus order is the same as the stacking order, with the
lowest window being first.
@@ -50,7 +51,7 @@ The \fBfocus\fR command may be used to move the focus to a window
other than the one under the mouse, but as soon as the mouse moves
into a new window the focus will jump to that window.
Note: at present there is no built-in support for returning the
-application to an explicit focus model; to do this you'll have
+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.
diff --git a/doc/font.n b/doc/font.n
index 07b7164..124fc43 100644
--- a/doc/font.n
+++ b/doc/font.n
@@ -21,28 +21,34 @@ fonts, such as defining named fonts and inspecting the actual attributes of
a font. The command has several different forms, determined by the
first argument. The following forms are currently supported:
.TP
-\fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR?
+\fBfont actual \fIfont\fR ?\fB\-displayof \fIwindow\fR? ?\fIoption\fR? ?\fB\-\|\-\fR? ?\fIchar\fR?
.
Returns information about the actual attributes that are obtained when
\fIfont\fR is used on \fIwindow\fR's display; the actual attributes obtained
may differ from the attributes requested due to platform-dependent
limitations, such as the availability of font families and pointsizes.
-\fIfont\fR is a font description; see FONT DESCRIPTIONS below. If the
+\fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the
\fIwindow\fR argument is omitted, it defaults to the main window. If
\fIoption\fR is specified, returns the value of that attribute; if it is
omitted, the return value is a list of all the attributes and their values.
-See FONT OPTIONS below for a list of the possible attributes.
+See \fBFONT OPTIONS\fR below for a list of the possible attributes. If the
+\fIchar\fR argument is supplied, it must be a single character. The font
+attributes returned will be those of the specific font used to render
+that character, which will be different from the base font if the base
+font does not contain the given character. If \fIchar\fR may be a hyphen, it
+should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled
+\fIoption\fR.
.TP
-\fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+\fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
Query or modify the desired attributes for the named font called
\fIfontname\fR. If no \fIoption\fR is specified, returns a list describing
-all the options and their values for \fIfontname\fR. If a single \fIoption\fR
+all the options and their values for \fIfontname\fR. If a single \fIoption\fR
is specified with no \fIvalue\fR, then returns the current value of that
attribute. If one or more \fIoption\fR\-\fIvalue\fR pairs are specified,
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 FONT OPTIONS below for a list of the
+new attributes for the font. See \fBFONT OPTIONS\fR below for a list of the
possible attributes.
.TP
\fBfont create\fR ?\fIfontname\fR? ?\fIoption value ...\fR?
@@ -51,13 +57,13 @@ Creates a new named font and returns its name. \fIfontname\fR specifies the
name for the font; if it is omitted, then Tk generates a new name of the
form \fBfont\fIx\fR, where \fIx\fR is an integer. There may be any number
of \fIoption\fR\-\fIvalue\fR pairs, which provide the desired attributes for
-the new named font. See FONT OPTIONS below for a list of the possible
+the new named font. See \fBFONT OPTIONS\fR below for a list of the possible
attributes.
.TP
\fBfont delete\fR \fIfontname\fR ?\fIfontname ...\fR?
.
Delete the specified named fonts. If there are widgets using the named font,
-the named font won't actually be deleted until all the instances are
+the named font will not actually be deleted until all the instances are
released. Those widgets will continue to display using the last known values
for the named font. If a deleted named font is subsequently recreated with
another call to \fBfont create\fR, the widgets will use the new named font
@@ -65,18 +71,21 @@ and redisplay themselves using the new attributes of that font.
.TP
\fBfont families\fR ?\fB\-displayof \fIwindow\fR?
.
-The return value is a list of the case-insensitive names of all font families
+The return value is a list of the case-insensitive names of all font families
that exist on \fIwindow\fR's display. If the \fIwindow\fR argument is
omitted, it defaults to the main window.
.TP
-\fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR
+\fBfont measure \fIfont\fR ?\fB\-displayof \fIwindow\fR? \fItext\fR
.
Measures the amount of space the string \fItext\fR would use in the given
\fIfont\fR when displayed in \fIwindow\fR. \fIfont\fR is a font description;
-see FONT DESCRIPTIONS below. If the \fIwindow\fR argument is omitted, it
+see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is
+omitted, it
defaults to the main window. The return value is the total width in pixels
of \fItext\fR, not including the extra pixels used by highly exaggerated
-characters such as cursive ``f''. If the string contains newlines or tabs,
+characters such as cursive
+.QW f .
+If the string contains newlines or tabs,
those characters are not expanded or treated specially when measuring the
string.
.TP
@@ -84,11 +93,12 @@ string.
.
Returns information about the metrics (the font-specific data), for
\fIfont\fR when it is used on \fIwindow\fR's display. \fIfont\fR is a font
-description; see FONT DESCRIPTIONS below. If the \fIwindow\fR argument is
+description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR
+argument is
omitted, it defaults to the main window. If \fIoption\fR is specified,
-returns the value of that metric; if it is omitted, the return value is a
-list of all the metrics and their values. See FONT METRICS below for a list
-of the possible metrics.
+returns the value of that metric; if it is omitted, the return value is a
+list of all the metrics and their values. See \fBFONT METRICS\fR
+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.
@@ -98,7 +108,7 @@ The following formats are accepted as a font description anywhere
\fIfont\fR is specified as an argument above; these same forms are also
permitted when specifying the \fB\-font\fR option for widgets.
.TP
-[1] \fIfontname\fR
+[1] \fIfontname\fR
.
The name of a named font, created using the \fBfont create\fR command. When
a widget uses a named font, it is guaranteed that this will never cause an
@@ -110,48 +120,56 @@ font will be substituted automatically.
[2] \fIsystemfont\fR
.
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 ``\fB*\fR''
+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 PLATFORM-SPECIFIC issues for a list of the system fonts.
-.VS 8.0 br
+name. See \fBPLATFORM-SPECIFIC\fR issues for a list of the system fonts.
.TP
[3] \fIfamily \fR?\fIsize\fR? ?\fIstyle\fR? ?\fIstyle ...\fR?
.
A properly formed list whose first element is the desired font
\fIfamily\fR and whose optional second element is the desired \fIsize\fR.
The interpretation of the \fIsize\fR attribute follows the same rules
-described for \fB\-size\fR in FONT OPTIONS below. Any additional optional
+described for \fB\-size\fR in \fBFONT OPTIONS\fR below. Any
+additional optional
arguments following the \fIsize\fR are font \fIstyle\fRs. Possible values
for the \fIstyle\fR arguments are as follows:
.RS
.DS
.ta 3c 6c 9c
-\fBnormal bold roman italic
-underline overstrike\fR
+\fBnormal\fR \fBbold\fR \fBroman\fR \fBitalic\fR
+\fBunderline\fR \fBoverstrike\fR
.DE
.RE
-.TP
+.TP
[4] X-font names (XLFD)
.
A Unix-centric font name of the form
-\fI-foundry-family-weight-slant-setwidth-addstyle-pixel-point-resx-resy-spacing-width-charset-encoding\fR.
-The ``\fB*\fR'' character may be used to skip individual fields that the
-user does not care about. There must be exactly one ``\fB*\fR'' for each
-field skipped, except that a ``\fB*\fR'' at the end of the XLFD skips any
-remaining fields; the shortest valid XLFD is simply ``\fB*\fR'', signifying
-all fields as defaults. Any fields that were skipped are given default
+\fI\-foundry\-family\-weight\-slant\-setwidth\-addstyle\-pixel\-point\-resx\-resy\-spacing\-width\-charset\-encoding\fR.
+The
+.QW \fB*\fR
+character may be used to skip individual fields that the
+user does not care about. There must be exactly one
+.QW \fB*\fR
+for each field skipped, except that a
+.QW \fB*\fR
+at the end of the XLFD skips any
+remaining fields; the shortest valid XLFD is simply
+.QW \fB*\fR ,
+signifying all fields as defaults. Any fields that were skipped are
+given default
values. For compatibility, an XLFD always chooses a font of the specified
pixel size (not point size); although this interpretation is not strictly
-correct, all existing applications using XLFDs assumed that one ``point''
+correct, all existing applications using XLFDs assumed that one
+.QW point
was in fact one pixel and would display incorrectly (generally larger) if
the correct size font were actually used.
-.VE
.TP
[5] \fIoption value \fR?\fIoption value ...\fR?
.
A properly formed list of \fIoption\fR\-\fIvalue\fR pairs that specify
the desired attributes of the font, in the same format used when defining
-a named font; see FONT OPTIONS below.
+a named font; see \fBFONT OPTIONS\fR below.
.LP
When font description \fIfont\fR is used, the system attempts to parse the
description according to each of the above five rules, in the order specified.
@@ -161,22 +179,26 @@ platforms and the closest available font will be used. In some situations
it may not be possible to find any close font (e.g., the font family was
a garbage value); in that case, some system-dependent default font is
chosen. If the font description does not match any of the above patterns,
-an error is generated.
+an error is generated.
.SH "FONT METRICS"
.
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
-font. In the following definitions, the ``baseline'' of a font is the
-horizontal line where the bottom of most letters line up; certain letters,
-such as lower-case ``g'' stick below the baseline.
+font. In the following definitions, the
+.QW baseline
+of a font is the
+horizontal line where the bottom of most letters line up; certain letters,
+such as lower-case
+.QW g
+stick below the baseline.
.TP
\fB\-ascent \0\fR
.
The amount in pixels that the tallest letter sticks up above the baseline of
the font, plus any extra blank space added by the designer of the font.
.TP
-\fB\-descent \0\fR
+\fB\-descent \0\fR
.
The largest amount in pixels that any letter sticks down below the baseline
of the font, plus any extra blank space added by the designer of the font.
@@ -190,29 +212,36 @@ above the baseline line plus the descent below the baseline.
.TP
\fB\-fixed \0\fR
.
-Returns a boolean flag that is ``\fB1\fR'' if this is a fixed-width font,
+Returns a boolean flag that is
+.QW \fB1\fR
+if this is a fixed-width font,
where each normal character is the same width as all the other
-characters, or is ``\fB0\fR'' if this is a proportionally-spaced font, where
-individual characters have different widths. The widths of control
-characters, tab characters, and other non-printing characters are not
+characters, or is
+.QW \fB0\fR
+if this is a proportionally-spaced font, where
+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"
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:
.TP
-\fB\-family \fIname\fR
+\fB\-family \fIname\fR
.
The case-insensitive font family name. Tk guarantees to support the font
-families named \fBCourier\fR (a monospaced ``typewriter'' font), \fBTimes\fR
-(a serifed ``newspaper'' font), and \fBHelvetica\fR (a sans-serif
-``European'' font). The most closely matching native font family will
+families named \fBCourier\fR (a monospaced
+.QW typewriter
+font), \fBTimes\fR (a serifed
+.QW newspaper
+font), and \fBHelvetica\fR (a sans-serif
+.QW European
+font). The most closely matching native font family will
automatically be substituted when one of the above font families is used.
The \fIname\fR may also be the name of a native, platform-specific font
family; in that case it will work as desired on one platform but may not
-display correctly on other platforms. If the family is unspecified or
+display correctly on other platforms. If the family is unspecified or
unrecognized, a platform-specific default font will be chosen.
-.VS
.TP
\fB\-size \fIsize\fR
.
@@ -221,7 +250,7 @@ number, it is interpreted as a size in points. If \fIsize\fR is a negative
number, its absolute value is interpreted as a size in pixels. If a
font cannot be displayed at the specified size, a nearby size will be
chosen. If \fIsize\fR is unspecified or zero, a platform-dependent default
-size will be chosen.
+size will be chosen.
.RS
.PP
Sizes should normally be specified in points so the application will remain
@@ -232,9 +261,8 @@ to a fixed-size bitmap. The mapping between points and pixels is set when
the application starts, based on properties of the installed monitor, but it
can be overridden by calling the \fBtk scaling\fR command.
.RE
-.VE
.TP
-\fB\-weight \fIweight\fR
+\fB\-weight \fIweight\fR
.
The nominal thickness of the characters in the font. The value
\fBnormal\fR specifies a normal weight font, while \fBbold\fR specifies a
@@ -244,7 +272,7 @@ be chosen. The default weight is \fBnormal\fR.
\fB\-slant \fIslant\fR
The amount the characters in the font are slanted away from the
vertical. Valid values for slant are \fBroman\fR and \fBitalic\fR.
-A roman font is the normal, upright appearance of a font, while
+A roman font is the normal, upright appearance of a font, while
an italic font is one that is tilted some number of degrees from upright.
The closest available slant to the one specified will be chosen.
The default slant is \fBroman\fR.
@@ -253,46 +281,112 @@ The default slant is \fBroman\fR.
The value is a boolean flag that specifies whether characters in this
font should be underlined. The default value for underline is \fBfalse\fR.
.TP
-\fB\-overstrike \fIboolean\fR
+\fB\-overstrike \fIboolean\fR
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 "PLATFORM-SPECIFIC ISSUES"
+.SH "STANDARD FONTS"
.LP
-The following named system fonts are supported:
-.RS
-.TP
-X Windows:
+The following named fonts are supported on all systems, and default to values
+that match appropriate system defaults.
+.TP
+\fBTkDefaultFont\fR
+.
+This font is the default for all GUI items not otherwise specified.
+.TP
+\fBTkTextFont\fR
+.
+This font should be used for user text in entry widgets, listboxes etc.
+.TP
+\fBTkFixedFont\fR
+.
+This font is the standard fixed-width font.
+.TP
+\fBTkMenuFont\fR
+.
+This font is used for menu items.
+.TP
+\fBTkHeadingFont\fR
+.
+This font should be used for column headings in lists and tables.
+.TP
+\fBTkCaptionFont\fR
+.
+This font should be used for window and dialog caption bars.
+.TP
+\fBTkSmallCaptionFont\fR
+.
+This font should be used for captions on contained windows or tool dialogs.
+.TP
+\fBTkIconFont\fR
+.
+This font should be used for icon captions.
+.TP
+\fBTkTooltipFont\fR
+.
+This font should be used for tooltip windows (transient information windows).
+.LP
+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"
+.PP
+The following system fonts are supported:
+.TP
+\fBX Windows\fR
All valid X font names, including those listed by xlsfonts(1), are available.
.TP
-MS Windows:
+\fBMS Windows\fR
+The following fonts are supported, and are mapped to the user's
+style defaults.
+.RS
.DS
.ta 3c 6c
-\fBsystem ansi device
-systemfixed ansifixed oemfixed\fR
+\fBsystem\fR \fBansi\fR \fBdevice\fR
+\fBsystemfixed\fR \fBansifixed\fR \fBoemfixed\fR
.DE
+.RE
.TP
-Mac OS X:
+\fBMac OS X\fR
+The following fonts are supported, and are mapped to the user's
+style defaults.
+.RS
.DS
.ta 3c 6c
-\fBsystem application menu\fR
+\fBsystem\fR \fBapplication\fR \fBmenu\fR
+.DE
+.PP
+Additionally, the following named fonts provide access to the Aqua
+theme fonts:
+.DS
+.ta 5c
+\fBsystemSystemFont\fR \fBsystemEmphasizedSystemFont\fR
+\fBsystemSmallSystemFont\fR \fBsystemSmallEmphasizedSystemFont\fR
+\fBsystemApplicationFont\fR \fBsystemLabelFont\fR
+\fBsystemViewsFont\fR \fBsystemMenuTitleFont\fR
+\fBsystemMenuItemFont\fR \fBsystemMenuItemMarkFont\fR
+\fBsystemMenuItemCmdKeyFont\fR \fBsystemWindowTitleFont\fR
+\fBsystemPushButtonFont\fR \fBsystemUtilityWindowTitleFont\fR
+\fBsystemAlertHeaderFont\fR \fBsystemToolbarFont\fR
+\fBsystemMiniSystemFont\fR \fBsystemDetailSystemFont\fR
+\fBsystemDetailEmphasizedSystemFont\fR
.DE
.RE
.SH EXAMPLE
Fill a text widget with lots of font demonstrators, one for every font
family installed on your system:
.CS
-pack [text .t -wrap none] -fill both -expand 1
+pack [text .t \-wrap none] \-fill both \-expand 1
set count 0
set tabwidth 0
-foreach family [lsort -dictionary [\fBfont families\fR]] {
- .t tag configure f[incr count] -font [list $family 10]
- .t insert end ${family}:\\t {} \\
- "This is a simple sampler\\n" f$count
- set w [\fBfont measure\fR [.t cget -font] ${family}:]
+foreach family [lsort \-dictionary [\fBfont families\fR]] {
+ .t tag configure f[incr count] \-font [list $family 10]
+ .t insert end ${family}:\\t {} \e
+ "This is a simple sampler\en" f$count
+ set w [\fBfont measure\fR [.t cget \-font] ${family}:]
if {$w+5 > $tabwidth} {
set tabwidth [expr {$w+5}]
- .t configure -tabs $tabwidth
+ .t configure \-tabs $tabwidth
}
}
.CE
diff --git a/doc/frame.n b/doc/frame.n
index ac03de9..fbd32c8 100644
--- a/doc/frame.n
+++ b/doc/frame.n
@@ -52,11 +52,16 @@ 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\R, \fB-padx\fR and \fB-pady\R 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
-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.
+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. Note that this
+sets the total height of the frame, any \fB\-borderwidth\fR or similar is
+not added. Normally \fB\-height\fR should not be used if a propagating
+geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the
+frame since the geometry manager will override the height of the frame.
.OP \-visual visual Visual
Specifies visual information for the new window in any of the
forms accepted by \fBTk_GetVisual\fR.
@@ -66,11 +71,13 @@ The \fBvisual\fR option may not be modified with the \fBconfigure\fR
widget command.
.OP \-width width Width
Specifies the desired width for the window in any of the forms
-acceptable to \fBTk_GetPixels\fR.
-If this option is less than or equal to zero then the window will
-not request any size at all.
+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. Note that this
+sets the total width of the frame, any \fB\-borderwidth\fR or similar is
+not added. Normally \fB\-width\fR should not be used if a propagating
+geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the
+frame since the geometry manager will override the width of the frame.
.BE
-
.SH DESCRIPTION
.PP
The \fBframe\fR command creates a new window (given by the
@@ -86,7 +93,6 @@ A frame is a simple widget. Its primary purpose is to act as a
spacer or container for complex window layouts. The only features
of a frame are its background color and an optional 3-D border to make the
frame appear raised or sunken.
-
.SH "WIDGET COMMAND"
.PP
The \fBframe\fR command creates a new Tcl command whose
@@ -120,14 +126,11 @@ 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 \fBframe\fR
command.
-
.SH BINDINGS
.PP
When a new frame is created, it has no default event bindings:
frames are not intended to be interactive.
-
.SH "SEE ALSO"
-labelframe(n), toplevel(n)
-
+labelframe(n), toplevel(n), ttk::frame(n)
.SH KEYWORDS
frame, widget
diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n
index b13194b..f95fc49 100644
--- a/doc/getOpenFile.n
+++ b/doc/getOpenFile.n
@@ -11,11 +11,11 @@
.SH NAME
tk_getOpenFile, tk_getSaveFile \- pop up a dialog box for the user to select a file to open or save.
.SH SYNOPSIS
+.nf
\fBtk_getOpenFile \fR?\fIoption value ...\fR?
-.br
\fBtk_getSaveFile \fR?\fIoption value ...\fR?
+.fi
.BE
-
.SH DESCRIPTION
.PP
The procedures \fBtk_getOpenFile\fR and \fBtk_getSaveFile\fR pop up a
@@ -39,12 +39,10 @@ arguments to these two commands:
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
-any case. This option is ignored on the Macintosh platform, which
+any case. This option is ignored on Mac OS X, which
does not require extensions to filenames,
-.VS 8.4
and the UNIX implementation guesses reasonable values for this from
the \fB\-filetypes\fR option when this is not supplied.
-.VE 8.4
.TP
\fB\-filetypes\fR \fIfilePatternList\fR
If a \fBFile types\fR listbox exists in the file dialog on the particular
@@ -61,38 +59,42 @@ 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
parameter specifies a relative path, the return value will convert the
-relative path to an absolute path. This option may not always work on
-the Macintosh. This is not a bug. Rather, the \fIGeneral Controls\fR
-control panel on the Mac allows the end user to override the
-application default directory.
+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. This
-option is ignored on the Macintosh platform.
-.TP
-\fB\-multiple\fR \fIboolean\fR
-Allows the user to choose multiple files from the Open dialog.
-On the Macintosh, this is only available when Navigation Services are
-installed.
+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 the Macintosh, and only when Navigation
-Services are installed.
+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.
+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
+filter. The variable is read once at the beginning to select the
+appropriate filter. If the variable does not exist, or its value does
+not match any filter typename, or is empty (\fB{}\fR), the dialog box
+will revert to the default behavior of selecting the first filter in
+the list. If the dialog is canceled, the variable is not modified.
.PP
If the user selects a file, both \fBtk_getOpenFile\fR and
\fBtk_getSaveFile\fR return the full pathname of this file. If the
user cancels the operation, both commands return the empty string.
.SH "SPECIFYING FILE PATTERNS"
-
+.PP
The \fIfilePatternList\fR value given by the \fB\-filetypes\fR option
is a list of file patterns. Each file pattern is a list of the
form
@@ -111,8 +113,8 @@ they refer to the same file type and share the same entry in the
listbox. When the user selects an entry in the listbox, all the files
that match at least one of the file patterns corresponding
to that entry are listed. Usually, each file pattern corresponds to a
-distinct type of file. The use of more than one file patterns for one
-type of file is necessary on the Macintosh platform only.
+distinct type of file. The use of more than one file pattern for one
+type of file is only necessary on the Macintosh platform.
.PP
On the Macintosh platform, a file matches a file pattern if its
name matches at least one of the \fIextension\fR(s) AND it
@@ -122,7 +124,7 @@ sample code matches with files that have a \fB\.c\fR extension AND
belong to the \fImacType\fR \fBTEXT\fR. To use the OR rule instead,
you can use two file patterns, one with the \fIextensions\fR only and
the other with the \fImacType\fR only. The \fBGIF Files\fR file type
-in the sample code matches files that EITHER have a \fB\.gif\fR
+in the sample code matches files that \fIeither\fR have a \fB\.gif\fR
extension OR belong to the \fImacType\fR \fBGIFF\fR.
.PP
On the Unix and Windows platforms, a file matches a file pattern
@@ -131,20 +133,29 @@ the file pattern. The \fImacType\fRs are ignored.
.SH "SPECIFYING EXTENSIONS"
.PP
On the Unix and Macintosh platforms, extensions are matched using
-glob-style pattern matching. On the Windows platforms, extensions are
+glob-style pattern matching. On the Windows platform, extensions are
matched by the underlying operating system. The types of possible
-extensions are: (1) the special extension * matches any
-file; (2) the special extension "" matches any files that
-do not have an extension (i.e., the filename contains no full stop
-character); (3) any character string that does not contain any wild
-card characters (* and ?).
+extensions are:
+.IP (1)
+the special extension
+.QW *
+matches any file;
+.IP (2)
+the special extension
+.MT
+matches any files that do not have an extension (i.e., the filename
+contains no full stop character);
+.IP (3)
+any character string that does not contain any wild card characters (*
+and ?).
.PP
Due to the different pattern matching rules on the various platforms,
to ensure portability, wild card characters are not allowed in the
-extensions, except as in the special extension *. Extensions
-without a full stop character (e.g. ~) are allowed but may not
-work on all platforms.
-
+extensions, except as in the special extension
+.QW * .
+Extensions without a full stop character (e.g.
+.QW ~ )
+are allowed but may not work on all platforms.
.SH EXAMPLE
.CS
set types {
@@ -155,15 +166,13 @@ set types {
{{GIF Files} {} GIFF}
{{All Files} * }
}
-set filename [tk_getOpenFile -filetypes $types]
+set filename [tk_getOpenFile \-filetypes $types]
if {$filename != ""} {
# Open the file ...
}
.CE
-
.SH "SEE ALSO"
tk_chooseDirectory
-
.SH KEYWORDS
file selection dialog
diff --git a/doc/grab.n b/doc/grab.n
index c954fab..2f7e2f1 100644
--- a/doc/grab.n
+++ b/doc/grab.n
@@ -30,8 +30,9 @@ and all events will be reported in the normal fashion.
When the pointer is outside \fIwindow\fR's tree, button presses and
releases and
mouse motion events are reported to \fIwindow\fR, and window entry
-and window exit events are ignored.
-The grab subtree ``owns'' the pointer:
+and window exit events are ignored. The grab subtree
+.QW owns
+the pointer:
windows outside the grab subtree will be visible on the screen
but they will be insensitive until the grab is released.
The tree of windows underneath the grab window can include top-level
@@ -109,7 +110,7 @@ events and not providing any mechanism for releasing the grab). Take
.PP
It took an incredibly complex and gross implementation to produce
the simple grab effect described above.
-Given the current implementation, it isn't safe for applications
+Given the current implementation, it is not safe for applications
to use the Xlib grab facilities at all except through the Tk grab
procedures.
If applications try to manipulate X's grab mechanisms directly,
@@ -118,7 +119,7 @@ things will probably break.
If a single process is managing several different Tk applications,
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 doesn't exist.
+processes, this restriction does not exist.
.SH EXAMPLE
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
diff --git a/doc/grid.n b/doc/grid.n
index fa22eeb..5c1c3ba 100644
--- a/doc/grid.n
+++ b/doc/grid.n
@@ -5,7 +5,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH grid n 8.4 Tk "Tk Built-In Commands"
+.TH grid n 8.5 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -13,7 +13,6 @@ grid \- Geometry manager that arranges widgets in a grid
.SH SYNOPSIS
\fBgrid \fIoption arg \fR?\fIarg ...\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBgrid\fR command is used to communicate with the grid
@@ -25,9 +24,16 @@ on the \fIoption\fR argument:
\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.\fP) or one of the characters \fBx\fP or \fB^\fP
+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,
@@ -35,71 +41,77 @@ 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\fP and \fIrow\fP 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\fP and \fIrow\fP
+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\fP column of the
-geometry master, \fImaster\fP.
-.VS 8.4
-The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
-and \fB-pad\fP.
-.VE 8.4
-If one or more options are provided, then \fIindex\fP may be given as
+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
a list of column indices to which the configuration options will operate on.
-The \fB\-minsize\fP option sets the minimum size, in screen units,
+.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\fP option (an integer value)
+The \fB\-weight\fR option (an integer value)
sets the relative weight for apportioning
any extra spaces among
columns.
A weight of zero (0) indicates the column will not deviate from its requested
size. A column whose weight is two will grow at twice the rate as a column
of weight one when extra space is allocated to the layout.
-.VS 8.4
-The \fB-uniform\fP option, when a non-empty value is supplied, places
-the column in a \fIuniform group\fP with other columns that have the
-same value for \fB-uniform\fP. The space for columns belonging to a
+The \fB\-uniform\fR option, when a non-empty value is supplied, places
+the column in a \fIuniform group\fR with other columns that have the
+same value for \fB\-uniform\fR. The space for columns belonging to a
uniform group is allocated so that their sizes are always in strict
-proportion to their \fB-weight\fP values. See
+proportion to their \fB\-weight\fR values. See
\fBTHE GRID ALGORITHM\fR below for further details.
-.VE 8.4
-The \fB-pad\fP option specifies the number of screen units that will be
+The \fB\-pad\fR option specifies the number of screen units that will be
added to the largest window contained completely in that column when the
grid geometry manager requests a size from the containing window.
If only an option is specified, with no value,
the current value of that option is returned.
If only the master window and index is specified, all the current settings
-are returned in a list of "-option value" pairs.
+are returned in a list of
+.QW "\-option value"
+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\-\fP, \fBx\fP and \fB^\fP,
+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\fP, as described in the \fBRELATIVE PLACEMENT\fR
+location of a \fIslave\fR, as described in the \fBRELATIVE PLACEMENT\fR
section, below.
The following options are supported:
.RS
.TP
\fB\-column \fIn\fR
-Insert the slave so that it occupies the \fIn\fPth column in the grid.
+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
-call to \fIgrid\fP, or column "0" if it is the first slave. For each
-\fBx\fP that immediately precedes the \fIslave\fP, the column position
-is incremented by one. Thus the \fBx\fP represents a blank column
+call to \fBgrid\fR, or column
+.QW 0
+if it is the first slave. For each
+\fBx\fR that immediately precedes the \fIslave\fR, the column position
+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\fP columns in the grid.
+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\-\fP, in which case the columnspan is incremented once for each immediately
-following \fB\-\fP.
+\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
@@ -136,31 +148,34 @@ 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\fPth row in the grid.
+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\fP, or the first unoccupied row if this is the first slave.
+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\fP rows in the grid.
-The default is one row. If the next \fBgrid\fP command contains
-\fB^\fP characters instead of \fIslaves\fP that line up with the columns
-of this \fIslave\fP, then the \fBrowspan\fP of this \fIslave\fP is
+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
+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
-\fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP.
+\fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR.
The string can optionally contains spaces or
commas, but they are ignored. Each letter refers to a side (north, south,
-east, or west) that the slave will "stick" to. If both \fBn\fP and \fBs\fP (or
-\fBe\fP and \fBw\fP) are specified, the slave will be stretched to fill the entire
-height (or width) of its cavity. The \fBsticky\fP option subsumes the
-combination of \fB\-anchor\fP and \fB\-fill\fP that is used by \fBpack\fP.
-The default is \fB{}\fP, which causes the slave to be centered in its cavity,
-at its requested size.
+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
+combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR.
+The default is
+.QW "" ,
+which causes the slave to be centered in its cavity, at its requested size.
.LP
If any of the slaves are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
@@ -179,13 +194,15 @@ default settings are used.
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.
-The first two elements of the list are ``\fB\-in \fImaster\fR'' where
-\fImaster\fR is the slave's master.
+The first two elements of the list are
+.QW "\fB\-in \fImaster\fR"
+where \fImaster\fR is the slave's master.
.TP
\fBgrid location \fImaster x y\fR
-Given \fIx\fP and \fIy\fP values in screen units relative to the master window,
-the column and row number at that \fIx\fP and \fIy\fP location is returned.
-For locations that are above or to the left of the grid, \fB-1\fP is returned.
+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
@@ -200,38 +217,42 @@ 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\fP row of the
-geometry master, \fImaster\fP.
-.VS 8.4
-The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
-and \fB-pad\fP.
-.VE 8.4
-If one or more options are provided, then \fIindex\fP may be given as
+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
a list of row indices to which the configuration options will operate on.
-The \fB\-minsize\fP option sets the minimum size, in screen units,
+.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\fP option (an integer value)
+The \fB\-weight\fR option (an integer value)
sets the relative weight for apportioning
any extra spaces among
rows.
A weight of zero (0) indicates the row will not deviate from its requested
size. A row whose weight is two will grow at twice the rate as a row
of weight one when extra space is allocated to the layout.
-.VS 8.4
-The \fB-uniform\fP option, when a non-empty value is supplied, places
-the row in a \fIuniform group\fP with other rows that have the
-same value for \fB-uniform\fP. The space for rows belonging to a
+The \fB\-uniform\fR option, when a non-empty value is supplied, places
+the row in a \fIuniform group\fR with other rows that have the
+same value for \fB\-uniform\fR. The space for rows belonging to a
uniform group is allocated so that their sizes are always in strict
-proportion to their \fB-weight\fP values. See
+proportion to their \fB\-weight\fR values. See
\fBTHE GRID ALGORITHM\fR below for further details.
-.VE 8.4
-The \fB-pad\fP option specifies the number of screen units that will be
+The \fB\-pad\fR option specifies the number of screen units that will be
added to the largest window contained completely in that row when the
grid geometry manager requests a size from the containing window.
If only an option is specified, with no value,
the current value of that option is returned.
If only the master window and index is specified, all the current settings
-are returned in a list of "-option value" pairs.
+are returned in a list of
+.QW "-option value"
+pairs.
.TP
\fBgrid remove \fIslave \fR?\fIslave ...\fR?
Removes each of the \fIslave\fRs from grid for its
@@ -243,48 +264,48 @@ 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\fP.
-The size is determined either by the \fIslave\fP occupying the largest
-row or column, or the largest column or row with a \fBminsize\fP,
-\fBweight\fP, or \fBpad\fP that is non-zero.
+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.
.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\fP can be either \fB\-row\fP or \fB\-column\fP which
-causes only the slaves in the row (or column) specified by \fIvalue\fP
+\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which
+causes only the slaves in the row (or column) specified by \fIvalue\fR
to be returned.
.SH "RELATIVE PLACEMENT"
.PP
-The \fBgrid\fP command contains a limited set of capabilities that
+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,
added, or removed without the need to explicitly specify row and
column information.
-When no column or row information is specified for a \fIslave\fP,
+When no column or row information is specified for a \fIslave\fR,
default values are chosen for
-\fBcolumn\fP, \fBrow\fP, \fBcolumnspan\fP and \fBrowspan\fP
-at the time the \fIslave\fP is managed. The values are chosen
-based upon the current layout of the grid, the position of the \fIslave\fP
-relative to other \fIslave\fPs in the same grid command, and the presence
-of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP
-command where \fIslave\fP names are normally expected.
+\fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\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
+of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR
+command where \fIslave\fR names are normally expected.
.RS
.TP
-\fB\-\fP
-This increases the columnspan of the \fIslave\fP to the left. Several
-\fB\-\fP's in a row will successively increase the columnspan. A \fB\-\fP
-may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP
+\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
+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\fP
-This leaves an empty column between the \fIslave\fP on the left and
-the \fIslave\fP on the right.
+\fBx\fR
+This leaves an empty column between the \fIslave\fR on the left and
+the \fIslave\fR on the right.
.TP
-\fB^\fP
-This extends the \fBrowspan\fP of the \fIslave\fP above the \fB^\fP's
-in the grid. The number of \fB^\fP's in a row must match the number of
-columns spanned by the \fIslave\fP above it.
+\fB^\fR
+This extends the \fBrowspan\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
.SH "THE GRID ALGORITHM"
.PP
@@ -296,46 +317,49 @@ In the second step, the requested size is compared against the actual size
of the master. If the sizes are different, then spaces is added to or taken
away from the layout as needed.
For the final step, each slave is positioned in its row(s) and column(s)
-based on the setting of its \fIsticky\fP flag.
+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,
and computes the nominal size of each row or column to be either the
-\fIminsize\fP for that row or column, or the sum of the \fIpad\fPding
+\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
examined. If a group of rows or columns need to be increased in size
in order to accommodate these slaves, then extra space is added to each
-row or column in the group according to its \fIweight\fP. For each
+row or column in the group according to its \fIweight\fR. For each
group whose weights are all zero, the additional space is apportioned
equally.
.PP
When multiple rows or columns belong to a uniform group, the space
allocated to them is always in proportion to their weights. (A weight
of zero is considered to be 1.) In other words, a row or column
-configured with \fB-weight 1 -uniform a\fP will have exactly the same
-size as any other row or column configured with \fB-weight 1 -uniform
-a\fP. A row or column configured with \fB-weight 2 -uniform b\fR will
-be exactly twice as large as one that is configured with \fB-weight 1
--uniform b\fP.
+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
+be exactly twice as large as one that is configured with \fB\-weight 1
+\-uniform b\fR.
.PP
More technically, each row or column in the group will have a size
-equal to \fIk*weight\fP for some constant \fIk\fP. The constant
-\fIk\fP is chosen so that no row or column becomes smaller than its
+equal to \fIk*weight\fR for some constant \fIk\fR. The constant
+\fIk\fR is chosen so that no row or column becomes smaller than its
minimum size. For example, if all rows or columns in a group have the
same weight, then each row or column will have the same size as the
largest row or column in the group.
.PP
+.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 centered within its master.
+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
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
-clipped on the bottom and right.
+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
@@ -357,19 +381,19 @@ The master for each slave must either be the slave's parent
This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is
visible without danger of the slave being clipped by its parent.
-In addition, all slaves in one call to \fBgrid\fP must have the same master.
+In addition, all slaves in one call to \fBgrid\fR must have the same master.
.SH "STACKING ORDER"
.PP
If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
-if the slave hasn't been managed correctly.
+if the slave has not been managed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first: the most recently created window
will be highest in the stacking order.
.SH CREDITS
.PP
-The \fBgrid\fP command is based on ideas taken from the \fIGridBag\fP
+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
@@ -378,27 +402,30 @@ A toplevel window containing a text widget and two scrollbars:
# Make the widgets
toplevel .t
text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set}
-scrollbar .t.v \-orient vertical \-command {.t.txt xview}
+scrollbar .t.v \-orient vertical \-command {.t.txt yview}
scrollbar .t.h \-orient horizontal \-command {.t.txt xview}
+
# Lay them out
\fBgrid\fR .t.txt .t.v \-sticky nsew
\fBgrid\fR .t.h \-sticky nsew
+
# Tell the text widget to take all the extra room
-\fBgrid rowconfigure\fR .t 0 \-weight 1
-\fBgrid columnconfigure\fR .t 0 \-weight 1
+\fBgrid rowconfigure\fR .t .t.txt \-weight 1
+\fBgrid columnconfigure\fR .t .t.txt \-weight 1
.CE
.PP
-Three widgets of equal width, despite their different "natural" widths:
+Three widgets of equal width, despite their different
+.QW natural
+widths:
.CS
button .b \-text "Foo"
entry .e \-variable foo
label .l \-text "This is a fairly long piece of text"
+
\fBgrid\fR .b .e .l \-sticky ew
-\fBgrid columnconfigure\fR . {0 1 2} \-uniform allTheSame
+\fBgrid columnconfigure\fR . "all" \-uniform allTheSame
.CE
-
.SH "SEE ALSO"
pack(n), place(n)
-
.SH KEYWORDS
geometry manager, location, grid, cell, propagation, size, pack
diff --git a/doc/image.n b/doc/image.n
index a93ffc1..e536916 100644
--- a/doc/image.n
+++ b/doc/image.n
@@ -43,7 +43,7 @@ name wisely. It is recommended to use a separate namespace for image names
\fBimage delete \fR?\fIname name\fR ...?
Deletes each of the named images and returns an empty string.
If there are instances of the images displayed in widgets,
-the images won't actually be deleted until all of the instances
+the images will not actually be deleted until all of the instances
are released.
However, the association between the instances and the image
manager will be dropped.
diff --git a/doc/label.n b/doc/label.n
index 1aa5ee1..5e1139a 100644
--- a/doc/label.n
+++ b/doc/label.n
@@ -29,7 +29,7 @@ Specifies a desired height for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
-If this option isn't specified, the label's desired height is computed
+If this option is not specified, the label's desired height is computed
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,
@@ -44,10 +44,9 @@ Specifies a desired width for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
-If this option isn't specified, the label's desired width is computed
+If this option is not specified, the label's desired width is computed
from the size of the image or bitmap or text being displayed in it.
.BE
-
.SH DESCRIPTION
.PP
The \fBlabel\fR command creates a new window (given by the
@@ -69,7 +68,6 @@ one of the characters may optionally be underlined using the
\fBunderline\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"
.PP
The \fBlabel\fR command creates a new Tcl command whose
@@ -102,11 +100,27 @@ 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 \fBlabel\fR
command.
-
.SH BINDINGS
.PP
When a new label is created, it has no default event bindings:
labels are not intended to be interactive.
-
+.SH EXAMPLE
+.CS
+# Make the widgets
+\fBlabel\fR .t \-text "This widget is at the top" \-bg red
+\fBlabel\fR .b \-text "This widget is at the bottom" \-bg green
+\fBlabel\fR .l \-text "Left\enHand\enSide"
+\fBlabel\fR .r \-text "Right\enHand\enSide"
+text .mid
+\.mid insert end "This layout is like Java's BorderLayout"
+# Lay them out
+pack .t \-side top \-fill x
+pack .b \-side bottom \-fill x
+pack .l \-side left \-fill y
+pack .r \-side right \-fill y
+pack .mid \-expand 1 \-fill both
+.CE
+.SH "SEE ALSO"
+labelframe(n), button(n), ttk::label(n)
.SH KEYWORDS
label, widget
diff --git a/doc/labelframe.n b/doc/labelframe.n
index 2654fe8..70d04cb 100644
--- a/doc/labelframe.n
+++ b/doc/labelframe.n
@@ -44,15 +44,6 @@ If the \fBcolormap\fR option is not specified, the new window
uses the same colormap as its parent.
This option may not be changed with the \fBconfigure\fR
widget command.
-.OP \-container container Container
-The value must be a boolean. If true, it means that this window will
-be used as a container in which some other application will be embedded
-(for example, a Tk toplevel can be embedded using the \fB\-use\fR option).
-The window will support the appropriate window manager protocols for
-things like geometry requests. The window should not have any
-children of its own in this application.
-This option may not be changed with the \fBconfigure\fR
-widget command.
.OP \-height height Height
Specifies the desired height for the window in any of the forms
acceptable to \fBTk_GetPixels\fR.
@@ -83,7 +74,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 \fBlabelframe\fR command creates a new window (given by the
@@ -131,14 +121,51 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBlabelframe\fR
command.
-
.SH BINDINGS
.PP
When a new labelframe is created, it has no default event bindings:
labelframes are not intended to be interactive.
+.SH EXAMPLE
+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.
+.PP
+.CS
+grid [\fBlabelframe\fR .burger \-text "Burger"] \e
+ [\fBlabelframe\fR .bun \-text "Bun"] \-sticky news
+grid [\fBlabelframe\fR .cheese \-text "Cheese Option"] \e
+ [\fBlabelframe\fR .pickle \-text "Pickle Option"] \-sticky news
+foreach {type name val} {
+ burger Beef beef
+ burger Lamb lamb
+ burger Vegetarian beans
-.SH "SEE ALSO"
-frame(n), label(n)
+ bun Plain white
+ bun Sesame seeds
+ bun Wholemeal brown
+
+ cheese None none
+ cheese Cheddar cheddar
+ cheese Edam edam
+ cheese Brie brie
+ cheese Gruy\eu00e8re gruyere
+ cheese "Monterey Jack" jack
+ pickle None none
+ pickle Gherkins gherkins
+ pickle Onions onion
+ pickle Chili chili
+} {
+ set w [radiobutton .$type.$val \-text $name \-anchor w \e
+ \-variable $type \-value $val]
+ pack $w \-side top \-fill x
+}
+set burger beef
+set bun white
+set cheese none
+set pickle none
+.CE
+.SH "SEE ALSO"
+frame(n), label(n), ttk::labelframe(n)
.SH KEYWORDS
labelframe, widget
diff --git a/doc/listbox.n b/doc/listbox.n
index e287b09..341ce9a 100644
--- a/doc/listbox.n
+++ b/doc/listbox.n
@@ -14,24 +14,20 @@ listbox \- Create and manipulate listbox widgets
.SH SYNOPSIS
\fBlistbox\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activestyle \-height \-selectforeground
-\-background \-highlightbackground \-setgrid
-\-borderwidth \-highlightcolor \-state
-\-cursor \-highlightthickness \-takefocus
-\-disabledforeground \-relief \-width
-\-exportselection \-selectbackground \-xscrollcommand
-\-font \-selectborderwidth \-yscrollcommand
-\-foreground
+\-background \-borderwidth \-cursor
+\-disabledforeground \-exportselection \-font
+\-foreground \-highlightbackground \-highlightcolor
+\-highlightthickness \-relief \-selectbackground
+\-selectborderwidth \-selectforeground \-setgrid
+\-takefocus \-xscrollcommand \-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
-.VS 8.4
.OP \-activestyle activeStyle ActiveStyle
Specifies the style in which to draw the active element. This must be
one of \fBdotbox\fR (show a focus ring around the active element),
\fBnone\fR (no special indication of active element) or
\fBunderline\fR (underline the active element).
-The default is \fBunderline\fR.
-.VS 8.4
+The default is \fBunderline\fR on Windows, and \fBdotbox\fR elsewhere.
.OP \-height height Height
Specifies the desired height for the window, in lines.
If zero or less, then the desired height for the window is made just
@@ -51,17 +47,16 @@ or \fBextended\fR; the default value is \fBbrowse\fR.
.OP \-state state State
Specifies one of two states for the listbox: \fBnormal\fR or \fBdisabled\fR.
If the listbox is disabled then items may not be inserted or deleted,
-items are drawn in the \fB-disabledforeground\fR color, and selection
+items are drawn in the \fB\-disabledforeground\fR color, and selection
cannot be modified and is not shown (though selection information is retained).
.OP \-width width Width
Specifies the desired width for the window in characters.
-If the font doesn't have a uniform width then the width of the
-character ``0'' is used in translating from character units to
-screen units.
+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.
If zero or less, then the desired width for the window is made just
large enough to hold all the elements in the listbox.
.BE
-
.SH DESCRIPTION
.PP
The \fBlistbox\fR command creates a new window (given by the
@@ -93,7 +88,6 @@ 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.
They also support scanning, as described below.
-
.SH "INDICES"
.PP
Many of the widget commands for listboxes take one or more indices
@@ -117,11 +111,9 @@ Indicates the anchor point for the selection, which is set with the
.TP 12
\fBend\fR
Indicates the end of the listbox.
-.VS 8.0
For most commands this refers to the last element in the listbox,
but for a few commands such as \fBindex\fR and \fBinsert\fR
it refers to the element just after the last one.
-.VE
.TP 12
\fB@\fIx\fB,\fIy\fR
Indicates the element that covers the point in the listbox window
@@ -132,7 +124,6 @@ point is used.
In the widget command descriptions below, arguments named \fIindex\fR,
\fIfirst\fR, and \fIlast\fR always contain text indices in one of
the above forms.
-
.SH "WIDGET COMMAND"
.PP
The \fBlistbox\fR command creates a new Tcl command whose
@@ -148,10 +139,8 @@ commands are possible for listbox widgets:
.TP
\fIpathName \fBactivate\fR \fIindex\fR
Sets the active element to the one indicated by \fIindex\fR.
-.VS 8.0
If \fIindex\fR is outside the range of elements in the listbox
then the closest element is activated.
-.VE
The active element is drawn as specified by \fB\-activestyle\fR when the
widget has the input focus, and its index may be retrieved with the
index \fBactive\fR.
@@ -165,9 +154,7 @@ of the upper-left corner of the screen area covered by the text
elements give the width and height of the area, in pixels.
If no part of the element given by \fIindex\fR is visible on the
screen,
-.VS 8.0
or if \fIindex\fR refers to a non-existent element,
-.VE
then the result is an empty string; if the element is
partially visible, the result gives the full area of the element,
including any parts that are not visible.
@@ -201,15 +188,13 @@ string is returned.
\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 isn't specified it defaults to
+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,
-.VS 8.0
or an empty string if \fIfirst\fR refers to a non-existent element.
-.VE
If \fIlast\fR is specified, the command returns a list whose elements
are all of the listbox elements between \fIfirst\fR and \fIlast\fR,
inclusive.
@@ -218,10 +203,8 @@ forms for indices.
.TP
\fIpathName \fBindex \fIindex\fR
Returns the integer index value that corresponds to \fIindex\fR.
-.VS 8.0
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).
-.VE
.TP
\fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR?
Inserts zero or more new elements in the list just before the
@@ -308,10 +291,8 @@ has several forms, depending on \fIoption\fR:
.TP
\fIpathName \fBselection anchor \fIindex\fR
Sets the selection anchor to the element given by \fIindex\fR.
-.VS 8.0
If \fIindex\fR refers to a non-existent element, then the closest
element is used.
-.VE
The selection anchor is the end of the selection that is fixed
while dragging out a selection with the mouse.
The index \fBanchor\fR may be used to refer to the anchor
@@ -325,7 +306,7 @@ this range.
.TP
\fIpathName \fBselection includes \fIindex\fR
Returns 1 if the element indicated by \fIindex\fR is currently
-selected, 0 if it isn't.
+selected, 0 if it is not.
.TP
\fIpathName \fBselection set \fIfirst \fR?\fIlast\fR?
Selects all of the elements in the range between
@@ -418,7 +399,6 @@ If \fInumber\fR is negative then earlier elements
become visible; if it is positive then later elements
become visible.
.RE
-
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for listboxes that give them
@@ -432,6 +412,10 @@ 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
@@ -464,7 +448,7 @@ the button down.
In \fBextended\fR mode, pressing button 1 with the Control key down
starts a toggle operation: the anchor is set to the element under
the mouse, and its selection state is reversed. The selection state
-of other elements isn't changed.
+of other elements is not changed.
If the mouse is dragged with button 1 down, then the selection state
of all elements between the anchor and the element under the mouse
is set to match that of the anchor element; the selection state of
@@ -545,10 +529,10 @@ Control-backslash deselects everything in the widget, except in
The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is
a selection.
-
.PP
The behavior of listboxes can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "SEE ALSO"
+ttk_treeview(n)
.SH KEYWORDS
listbox, widget
diff --git a/doc/loadTk.n b/doc/loadTk.n
index 6c6a830..e1fecf6 100644
--- a/doc/loadTk.n
+++ b/doc/loadTk.n
@@ -13,15 +13,13 @@ loadTk \- Load Tk into a safe interpreter.
.SH SYNOPSIS
\fB::safe::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.
-
-.SH DESCRIPTION
.PP
The \fB::safe::loadTk\fR command initializes the required data structures
in the named safe interpreter and then loads Tk into it.
@@ -29,14 +27,17 @@ 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 ``.''
+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
+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.
diff --git a/doc/menu.n b/doc/menu.n
index f801ead..7a92002 100644
--- a/doc/menu.n
+++ b/doc/menu.n
@@ -16,14 +16,12 @@ menu, tk_menuSetFocus \- Create and manipulate menu widgets
\fBmenu\fR \fIpathName \fR?\fIoptions\fR?
\fBtk_menuSetFocus\fR \fIpathName\fR
.SO
-\-activebackground \-borderwidth \-foreground
-\-activeborderwidth \-cursor \-relief
+\-activebackground \-borderwidth \-foreground
+\-activeborderwidth \-cursor \-relief
\-activeforeground \-disabledforeground \-takefocus
\-background \-font
-
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
-.VS
.OP \-postcommand postCommand Command
If this option is specified then it provides a Tcl command to execute
each time the menu is posted. The command is invoked by the \fBpost\fR
@@ -31,7 +29,6 @@ widget command before posting the menu. Note that in Tk 8.0 on Macintosh
and Windows, all post-commands in a system of menus are executed before any
of those menus are posted.
This is due to the limitations in the individual platforms' menu managers.
-.VE
.OP \-selectcolor selectColor Background
For menu entries that are check buttons or radio buttons, this option
specifies the color to display in the indicator when the check button
@@ -49,10 +46,12 @@ to invoke whenever the menu is torn off. The actual command will
consist of the value of this option, followed by a space, followed
by the name of the menu window, followed by a space, followed by
the name of the name of the torn off menu window. For example, if
-the option's is ``\fBa b\fR'' and menu \fB.x.y\fR is torn off to
+the option's value is
+.QW "\fBa b\fR"
+and menu \fB.x.y\fR is torn off to
create a new menu \fB.x.tearoff1\fR, then the command
-``\fBa b .x.y .x.tearoff1\fR'' will be invoked.
-.VS
+.QW "\fBa b .x.y .x.tearoff1\fR"
+will be invoked.
.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
@@ -65,9 +64,7 @@ returned by the configuration database will change if this option is
changed, this does not affect the menu widget's behavior. This is used
by the cloning mechanism and is not normally set outside of the Tk
library.
-.VE
.BE
-
.SH INTRODUCTION
.PP
The \fBmenu\fR command creates a new top-level window (given
@@ -81,14 +78,12 @@ The \fBmenu\fR command returns its
there must not exist a window named \fIpathName\fR, but
\fIpathName\fR's parent must exist.
.PP
-.VS
A menu is a widget that displays a collection of one-line entries arranged
in one or more columns. There exist several different types of entries,
each with different properties. Entries of different types may be
combined in a single menu. Menu entries are not the same as
entry widgets. In fact, menu entries are not even distinct widgets;
the entire menu is one widget.
-.VE
.PP
Menu entries are displayed with up to three separate fields.
The main field is a label in the form of a text string,
@@ -117,28 +112,24 @@ The default menu bindings will not allow
a disabled entry to be activated or invoked.
Disabled entries may be re-enabled, at which point it becomes
possible to activate and invoke them again.
-.VS
.PP
Whenever a menu's active entry is changed, a <<MenuSelect>> virtual
event is send to the menu. The active item can then be queried from
the menu, and an action can be taken, such as setting
context-sensitive help text for the entry.
-.VE
-
-.SH "COMMAND ENTRIES"
+.SH "TYPES OF ENTRIES"
+.SS "COMMAND ENTRIES"
.PP
The most common kind of menu entry is a command entry, which
behaves much like a button widget. When a command entry is
invoked, a Tcl command is executed. The Tcl
command is specified with the \fB\-command\fR option.
-
-.SH "SEPARATOR ENTRIES"
+.SS "SEPARATOR ENTRIES"
.PP
A separator is an entry that is displayed as a horizontal dividing
line. A separator may not be activated or invoked, and it has
no behavior other than its display appearance.
-
-.SH "CHECKBUTTON ENTRIES"
+.SS "CHECKBUTTON ENTRIES"
.PP
A checkbutton menu entry behaves much like a checkbutton widget.
When it is invoked it toggles back and forth between the selected
@@ -155,8 +146,7 @@ the menu. If a \fB\-command\fR option is specified for a checkbutton
entry, then its value is evaluated as a Tcl command each time the entry
is invoked; this happens after toggling the entry's
selected state.
-
-.SH "RADIOBUTTON ENTRIES"
+.SS "RADIOBUTTON ENTRIES"
.PP
A radiobutton menu entry behaves much like a radiobutton widget.
Radiobutton entries are organized in groups of which only one
@@ -179,8 +169,7 @@ otherwise the indicator's center is displayed in the background color for
the menu. If a \fB\-command\fR option is specified for a radiobutton
entry, then its value is evaluated as a Tcl command each time the entry
is invoked; this happens after selecting the entry.
-
-.SH "CASCADE ENTRIES"
+.SS "CASCADE ENTRIES"
.PP
A cascade entry is one with an associated menu (determined
by the \fB\-menu\fR option). Cascade entries allow the construction
@@ -199,7 +188,6 @@ Tcl command of the form
where \fImenu\fR is the path name of the associated menu, and \fIx\fR
and \fIy\fR are the root-window coordinates of the upper-right
corner of the cascade entry.
-.VS
On Unix, the lower-level menu is unposted by executing a Tcl command with
the form
.CS
@@ -208,15 +196,11 @@ the form
where \fImenu\fR is the name of the associated menu.
On other platforms, the platform's native code takes care of unposting the
menu.
-.VE
.PP
-.VS
If a \fB\-command\fR option is specified for a cascade entry then it is
evaluated as a Tcl command whenever the entry is invoked. This is not
supported on Windows.
-.VE
-
-.SH "TEAR-OFF ENTRIES"
+.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
@@ -226,8 +210,6 @@ When a tear-off entry is created it appears as a dashed line at
the top of the menu. Under the default bindings, invoking the
tear-off entry causes a torn-off copy to be made of the menu and
all of its submenus.
-
-.VS
.SH "MENUBARS"
.PP
Any menu can be set as a menubar for a toplevel window (see
@@ -244,39 +226,29 @@ example of this concerns the handling of checkbuttons and radiobuttons
within the menu. While it is permitted to put these menu elements on
menubars, they may not be drawn with indicators on some platforms, due
to system restrictions.
-.VE
-
-.VS
-.SH "SPECIAL MENUS IN MENUBARS"
+.SS "SPECIAL MENUS IN MENUBARS"
.PP
-Certain menus in a menubar will be treated specially. On the Macintosh,
-access to the special Apple 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 is provided. 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.
+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 an Apple menu on the Macintosh, that menu's contents make
-up the first items of the Apple menu on the screen whenever the window
-containing the menubar is in front. The menu is the
-first one that the user sees and has a title which is an Apple logo.
+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.
After all of the Tk-defined items, the menu will have a separator,
-followed by all of the items in the user's Apple Menu Items folder.
-Since the System uses a different menu definition procedure for
-the Apple menu than Tk uses for its menus, and the system APIs do
-not fully support everything Tk tries to do, the menu item will only
-have its text displayed. No font attributes, images, bitmaps, or colors
-will be displayed. In addition, a menu with a tearoff item will have
-the tearoff item displayed as "(TearOff)".
+followed by all standard Application menu items.
.PP
-When Tk see 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 user's menubar is in front. The first items in the menu
-are provided by Apple. Similar to the Apple Menu, customization in this
-menu is limited to what the system provides.
+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
+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
@@ -285,11 +257,11 @@ 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.
.PP
-When Tk see a Help menu on X Windows, the menu is moved to be last in
-the menubar and is right justified.
-.VE
-
-.VS
+When Tk sees a Help menu on X Windows and Motif menu compatibility is
+enabled the menu is moved to be last in the menubar and is right
+justified. Motif menu compatibility is enabled by setting the Tk option
+\fB*Menu.useMotifHelp\fR to true or by calling
+\fBtk::classic::restore menu\fR.
.SH "CLONES"
.PP
When a menu is set as a menubar for a toplevel window, or when a menu
@@ -299,9 +271,7 @@ configuration of the original are reflected in the
clone. Additionally, any cascades that are pointed to are also cloned
so that menu traversal will work right. Clones are destroyed when
either the tearoff or menubar goes away, or when the original menu is
-destroyed.
-.VE
-
+destroyed.
.SH "WIDGET COMMAND"
.PP
The \fBmenu\fR command creates a new Tcl command whose
@@ -338,7 +308,9 @@ This form may not be abbreviated.
Same as \fBend\fR.
.TP 12
\fBnone\fR
-Indicates ``no entry at all''; this is used most commonly with
+Indicates
+.QW "no entry at all" ;
+this is used most commonly with
the \fBactivate\fR option to deactivate all the entries in the
menu. In most cases the specification of \fBnone\fR causes
nothing to happen in the widget command.
@@ -347,11 +319,12 @@ This form may not be abbreviated.
\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, ``\fB@0\fR'' indicates the top-most entry in the
-window.
+For example,
+.QW \fB@0\fR
+indicates the top-most entry in the window.
.TP 12
\fIpattern\fR
-If the index doesn't satisfy one of the above forms then this
+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
@@ -417,16 +390,13 @@ 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
-.VS 8.0
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.
-.VE 8.0
.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.
-.VS 8.4
.TP
\fB\-compound \fIvalue\fR
Specifies whether the menu entry should display both an image and text,
@@ -436,7 +406,6 @@ Valid values for this option are \fBbottom\fR, \fBcenter\fR,
is \fBnone\fR, meaning that the button will display either an image or
text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
options.
-.VE
.TP
\fB\-font \fIvalue\fR
Specifies the font to use when drawing the label or accelerator
@@ -451,14 +420,12 @@ 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.
This option is not available for separator or tear-off entries.
-.VS
.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.
-.VE
.TP
\fB\-image \fIvalue\fR
Specifies an image to display in the menu instead of a text string
@@ -556,16 +523,14 @@ 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.
-.VS
.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
-propogated to the original menu and vice versa. \fIcloneType\fR can be
+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.
-.VE
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
Query or modify the configuration options of the widget.
@@ -644,8 +609,8 @@ returned without posting the menu.
\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 doesn't correspond to a cascade entry,
-or if \fIpathName\fR isn't posted,
+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
@@ -656,30 +621,31 @@ 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
-.VS
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.
-.VE
+.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:
-.VS
.TP
\fBPulldown Menus in Menubar\fR
-This is the most command case. You create a menu widget that will become the
+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
of the pulldowns. Once you have done this, specify the menu using the
\fB\-menu\fR option of the toplevel's widget command. See the
\fBtoplevel\fR manual entry for details.
-.VE
.TP
\fBPulldown Menus in Menu Buttons\fR
This is the compatible way to do menu bars. You create one menubutton
@@ -711,7 +677,6 @@ 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
posted as a top-level window. The torn-off menu behaves just
the same as the original menu.
-
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for menus that give them
@@ -763,23 +728,21 @@ Otherwise, if the current menu was posted from a
menubutton, then the current menubutton is unposted and the
next menubutton to the right is posted.
.PP
-Disabled menu entries are non-responsive: they don't activate and
+Disabled menu entries are non-responsive: they do not activate and
they ignore mouse button presses and releases.
.PP
-.VS 8.4
Several of the bindings make use of the command \fBtk_menuSetFocus\fR.
It saves the current focus and sets the focus to its \fIpathName\fR
argument, which is a menu widget.
-.VE
.PP
The behavior of menus can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
.SH BUGS
.PP
-At present it isn't possible to use the
+At present it is not possible to use the
option database to specify values for the options to individual
entries.
-
+.SH "SEE ALSO"
+bind(n), menubutton(n), ttk::menubutton(n), toplevel(n)
.SH KEYWORDS
menu, widget
diff --git a/doc/menubutton.n b/doc/menubutton.n
index 22b1df6..ade9523 100644
--- a/doc/menubutton.n
+++ b/doc/menubutton.n
@@ -37,7 +37,7 @@ Specifies a desired height for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
-If this option isn't specified, the menubutton's desired height is computed
+If this option is not specified, the menubutton's desired height is computed
from the size of the image or bitmap or text being displayed in it.
.OP \-indicatoron indicatorOn IndicatorOn
The value must be a proper boolean value. If it is true then
@@ -64,10 +64,9 @@ Specifies a desired width for the menubutton.
If an image or bitmap is being displayed in the menubutton then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
-If this option isn't specified, the menubutton's desired width is computed
+If this option is not specified, the menubutton's desired width is computed
from the size of the image or bitmap or text being displayed in it.
.BE
-
.SH INTRODUCTION
.PP
The \fBmenubutton\fR command creates a new window (given by the
@@ -105,7 +104,6 @@ new menubutton is posted instead.
There are several interactions between menubuttons and menus; see
the \fBmenu\fR manual entry for information on various menu configurations,
such as pulldown menus and option menus.
-
.SH "WIDGET COMMAND"
.PP
The \fBmenubutton\fR command creates a new Tcl command whose
@@ -138,7 +136,6 @@ 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 \fBmenubutton\fR
command.
-
.SH "DEFAULT BINDINGS"
.PP
Tk automatically creates class bindings for menubuttons that give them
@@ -178,7 +175,7 @@ lower-case or upper-case equivalent), may be typed in any window
under the menubutton's toplevel to post the menubutton.
.IP [8]
The F10 key may be typed in any window to post the first menubutton
-under its toplevel window that isn't disabled.
+under its toplevel window that is not disabled.
.IP [9]
If a menubutton has the input focus, the space and return keys
post the menubutton.
@@ -188,6 +185,7 @@ actions occur: the menubutton is completely non-responsive.
.PP
The behavior of menubuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
+.SH "SEE ALSO"
+ttk::menubutton(n), menu(n)
.SH KEYWORDS
menubutton, widget
diff --git a/doc/message.n b/doc/message.n
index 94f93fe..92434f0 100644
--- a/doc/message.n
+++ b/doc/message.n
@@ -14,12 +14,11 @@ message \- Create and manipulate message widgets
.SH SYNOPSIS
\fBmessage\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-anchor \-highlightbackground \-takefocus
-\-background \-highlightcolor \-text
-\-borderwidth \-highlightthickness \-textvariable
-\-cursor \-padx \-width
-\-font \-pady
-\-foreground \-relief
+\-anchor \-background \-borderwidth
+\-cursor \-font \-foreground
+\-highlightbackground \-highlightcolor \-highlightthickness
+\-padx \-pady \-relief
+\-takefocus \-text \-textvariable
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-aspect aspect Aspect
@@ -30,7 +29,7 @@ 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
-isn't specified.
+is not specified.
Defaults to 150.
.OP \-justify justify Justify
Specifies how to justify lines of text.
@@ -61,7 +60,6 @@ length.
If this option has a value less than or equal to zero, then
the \fBaspect\fR option determines the line length.
.BE
-
.SH DESCRIPTION
.PP
The \fBmessage\fR command creates a new window (given by the
@@ -96,10 +94,10 @@ are replaced with enough blank space to line up on the next
characters (ASCII code less than 0x20) and characters not defined
in the font are displayed as a four-character sequence \fB\ex\fIhh\fR where
\fIhh\fR is the two-digit hexadecimal number corresponding to
-the character. In the unusual case where the font doesn't contain
-all of the characters in ``0123456789abcdef\ex'' then control
-characters and undefined characters are not displayed at all.
-
+the character. In the unusual case where the font does not contain
+all of the characters in
+.QW 0123456789abcdef\ex
+then control characters and undefined characters are not displayed at all.
.SH "WIDGET COMMAND"
.PP
The \fBmessage\fR command creates a new Tcl command whose
@@ -132,16 +130,15 @@ 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 \fBmessage\fR
command.
-
.SH "DEFAULT BINDINGS"
.PP
When a new message is created, it has no default event bindings:
messages are intended for output purposes only.
-
.SH BUGS
.PP
-Tabs don't work very well with text that is centered or right-justified.
+Tabs do not work very well with text that is centered or right-justified.
The most common result is that the line is justified wrong.
-
+.SH "SEE ALSO"
+label(n)
.SH KEYWORDS
message, widget
diff --git a/doc/messageBox.n b/doc/messageBox.n
index 0079972..5cdd26e 100644
--- a/doc/messageBox.n
+++ b/doc/messageBox.n
@@ -27,10 +27,21 @@ 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 ('ok', 'cancel', and so on). See \fB\-type\fR
+this message window (
+.QW ok ,
+.QW cancel ,
+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
+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
@@ -76,8 +87,10 @@ and \fBcancel\fR.
.PP
.SH EXAMPLE
.CS
-set answer [\fBtk_messageBox\fR \-message "Really quit?" \-type yesno \-icon question]
-switch -- $answer {
+set answer [\fBtk_messageBox\fR \-message "Really quit?" \e
+ \-icon question \-type yesno \e
+ \-detail "Select \e"Yes\e" to make the application exit"]
+switch \-\- $answer {
yes exit
no {\fBtk_messageBox\fR \-message "I know you like this application!" \e
\-type ok}
diff --git a/doc/option.n b/doc/option.n
index e731713..b7342e2 100644
--- a/doc/option.n
+++ b/doc/option.n
@@ -19,7 +19,6 @@ option \- Add/retrieve window options to/from the option database
\fBoption readfile \fIfileName \fR?\fIpriority\fR?
.fi
.BE
-
.SH DESCRIPTION
.PP
The \fBoption\fR command allows you to add entries to the Tk option
@@ -27,7 +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. \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,31 +63,60 @@ 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 isn't specified, it defaults to
+starts running. If \fIpriority\fR is not specified, it defaults to
this level.
-.LP
+.PP
Any of the above keywords may be abbreviated. In addition, priorities
may be specified numerically using integers between 0 and 100,
inclusive. The numeric form is probably a bad idea except for new priority
levels other than the ones given above.
+.SH "PATTERN FORMAT"
+.PP
+Patterns consist of a sequence of words separated by either periods,
+.QW . ,
+or asterisks
+.QW * .
+The overall pattern may also be optionally preceded by an asterisk.
+.PP
+Each word in the pattern conventionally starts with either an upper-case
+letter (in which case it denotes the class of either a widget or an option) or
+any other character, when it denotes the name of a widget or option. The last
+word in the pattern always indicates the option; the preceding ones constrain
+which widgets that option will be looked for in.
+.PP
+When two words are separated by a period, the latter widget must be a direct
+child of the former (or the option must apply to only the indicated widgets).
+When two words are separated by an asterisk, any depth of widgets may lie
+between the former and latter widgets (and the option applies to all widgets
+that are children of the former widget).
+.PP
+If the overall pattern is preceded by an asterisk, then the overall pattern
+applies anywhere it can throughout the whole widget hierarchy. Otherwise the
+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
Instruct every button in the application to have red text on it unless
-explicitly overridden:
+explicitly overridden (note that on some platforms the option is ignored):
.CS
-\fBoption add\fR *button.foreground red startupFile
+\fBoption add\fR *Button.foreground red startupFile
.CE
.PP
Allow users to control what happens in an entry widget when the Return
@@ -98,6 +127,10 @@ entry .e
bind .e <Return> [\fBoption get\fR .e returnCommand Command]
\fBoption add\fR *.e.returnCommand bell widgetDefault
.CE
-
+.SH "SEE ALSO"
+options(n), wish(1)
.SH KEYWORDS
database, option, priority, retrieve
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/optionMenu.n b/doc/optionMenu.n
index 3ffa1cb..1f9f831 100644
--- a/doc/optionMenu.n
+++ b/doc/optionMenu.n
@@ -12,12 +12,11 @@
.SH NAME
tk_optionMenu \- Create an option menubutton and its menu
.SH SYNOPSIS
-\fBtk_optionMenu \fIw varName value \fR?\fIvalue value ...\fR?
+\fBtk_optionMenu \fIpathName varName value \fR?\fIvalue value ...\fR?
.BE
-
.SH DESCRIPTION
.PP
-This procedure creates an option menubutton whose name is \fIw\fR,
+This procedure creates an option menubutton whose name is \fIpathName\fR,
plus an associated menu.
Together they allow the user to select one of the values
given by the \fIvalue\fR arguments.
@@ -31,8 +30,12 @@ and appear in the option menubutton.
The current value can also be changed by setting the variable.
.PP
The return value from \fBtk_optionMenu\fR is the name of the menu
-associated with \fIw\fR, so that the caller can change its configuration
-options or manipulate it in other ways.
-
+associated with \fIpathName\fR, so that the caller can change its
+configuration options or manipulate it in other ways.
+.SH EXAMPLE
+.CS
+tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble
+pack .foo
+.CE
.SH KEYWORDS
option menu
diff --git a/doc/options.n b/doc/options.n
index 2710300..25b0c9d 100644
--- a/doc/options.n
+++ b/doc/options.n
@@ -21,7 +21,9 @@ of the standard options supported by that widget), but if a widget does
support an option with one of the names listed below, then the option
has exactly the effect described below.
.PP
-In the descriptions below, ``Command-Line Name'' refers to the
+In the descriptions below,
+.QW "Command-Line Name"
+refers to the
switch used in class commands and \fBconfigure\fR widget commands to
set this value. For example, if an option's command-line switch is
\fB\-foreground\fR and there exists a widget \fB.a.b.c\fR, then the
@@ -32,9 +34,10 @@ command
may be used to specify the value \fBblack\fR for the option in
the widget \fB.a.b.c\fR. Command-line switches may be abbreviated,
as long as the abbreviation is unambiguous.
-``Database Name'' refers to the option's name in the option database (e.g.
-in .Xdefaults files). ``Database Class'' refers to the option's class value
-in the option database.
+.QW "Database Name"
+refers to the option's name in the option database (e.g. in .Xdefaults files).
+.QW "Database Class"
+refers to the option's class value in the option database.
.OP \-activebackground activeBackground Foreground
Specifies background color to use when drawing active elements.
An element (a widget or portion of a widget) is active if the
@@ -43,10 +46,8 @@ will cause some action to occur.
If strict Motif compliance has been requested by setting the
\fBtk_strictMotif\fR variable, this option will normally be
ignored; the normal background color will be used instead.
-.VS
For some elements on Windows and Macintosh systems, the active color
will only be used while mouse button 1 is pressed over the element.
-.VE
.OP \-activeborderwidth activeBorderWidth BorderWidth
Specifies a non-negative value indicating
the width of the 3-D border drawn around active elements. See above for
@@ -89,8 +90,9 @@ The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
.OP \-cursor cursor Cursor
Specifies the mouse cursor to be used for the widget.
The value may have any of the forms acceptable to \fBTk_GetCursor\fR.
+In addition, if an empty string is specified, it indicates that the
+widget should defer to its parent for cursor specification.
.OP \-compound compound Compound
-.VS 8.4
Specifies if the widget should display text and bitmaps/images at the
same time, and if so, where the bitmap/image should be placed relative
to the text. Must be one of the values \fBnone\fR, \fBbottom\fR,
@@ -100,7 +102,6 @@ to the text. Must be one of the values \fBnone\fR, \fBbottom\fR,
specifies that the bitmap or image should be displayed to the left of
the text, and the value \fBcenter\fR specifies that the bitmap or
image should be displayed on top of the text.
-.VE 8.4
.OP \-disabledforeground disabledForeground DisabledForeground
Specifies foreground color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
@@ -119,7 +120,8 @@ requests when it has a selection. The default is usually for widgets
to export selections.
.OP \-font font Font
Specifies the font to use when drawing text inside the widget.
-The value may have any of the forms accepted by \fBTk_GetFont\fR.
+The value may have any of the forms described in the \fBfont\fR manual
+page under \fBFONT DESCRIPTION\fR.
.OP "\-foreground or \-fg" foreground Foreground
Specifies the normal foreground color to use when displaying the widget.
.OP \-highlightbackground highlightBackground HighlightBackground
@@ -153,12 +155,16 @@ of the 3-D border to draw around the insertion cursor.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
.OP \-insertofftime insertOffTime OffTime
Specifies a non-negative integer value indicating the number of
-milliseconds the insertion cursor should remain ``off'' in each blink cycle.
-If this option is zero then the cursor doesn't blink: it is on
+milliseconds the insertion cursor should remain
+.QW off
+in each blink cycle.
+If this option is zero then the cursor does not blink: it is on
all the time.
.OP \-insertontime insertOnTime OnTime
Specifies a non-negative integer value indicating the number of
-milliseconds the insertion cursor should remain ``on'' in each blink cycle.
+milliseconds the insertion cursor should remain
+.QW on
+in each blink cycle.
.OP \-insertwidth insertWidth InsertWidth
Specifies a value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
@@ -176,7 +182,9 @@ If the value is false, updates are made continuously as the
slider is dragged.
If the value is true, updates are delayed until the mouse button
is released to end the drag; at that point a single notification
-is made (the value ``jumps'' rather than changing smoothly).
+is made (the value
+.QW jumps
+rather than changing smoothly).
.OP \-justify justify Justify
When there are multiple lines of text displayed in a widget, this
option determines how the lines line up with each other.
@@ -292,7 +300,7 @@ particular widget and may be determined by other options, such as
.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
-scrollbars on Windows (native widget doesn't recognize this option).
+scrollbars on Windows (native widget does not recognize this option).
.OP \-underline underline Underline
Specifies the integer index of a character to underline in the widget.
This option is used by the default bindings to implement keyboard
@@ -327,7 +335,11 @@ 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
-widget followed by ``set'', e.g. ``.x.scrollbar set'': this will cause
+widget followed by
+.QW set ,
+e.g.
+.QW ".x.scrollbar set" :
+this will cause
the scrollbar to be updated whenever the view in the window changes.
If this option is not specified, then no command will be executed.
.OP \-yscrollcommand yScrollCommand ScrollCommand
diff --git a/doc/pack-old.n b/doc/pack-old.n
index 66bdc18..532b4ae 100644
--- a/doc/pack-old.n
+++ b/doc/pack-old.n
@@ -61,7 +61,7 @@ the \fIoptions\fR argument following each \fIwindow\fR consists of
a list of one or more fields that govern the placement of that
window. In the discussion below, the term \fIcavity\fR refers
to the space left in a parent when a particular child is placed
-(i.e. all the space that wasn't claimed by earlier children in
+(i.e. all the space that was not claimed by earlier children in
the packing order). The term \fIparcel\fR refers to the space
allocated to a particular child; this is not necessarily the
same as the child window's final geometry.
diff --git a/doc/pack.n b/doc/pack.n
index 33c8203..0809337 100644
--- a/doc/pack.n
+++ b/doc/pack.n
@@ -25,14 +25,15 @@ on the \fIoption\fR argument:
.TP
\fBpack \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?
If the first argument to \fBpack\fR is a window name (any value
-starting with ``.''), then the command is processed in the same
-way as \fBpack configure\fR.
+starting with
+.QW . ),
+then the command is processed in the same way as \fBpack configure\fR.
.TP
\fBpack 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.
-See ``THE PACKER ALGORITHM'' below for details on how the options
+See \fBTHE PACKER ALGORITHM\fR below for details on how the options
are used by the packer.
The following options are supported:
.RS
@@ -134,13 +135,14 @@ The slaves will no longer be managed by the packer.
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 \fBpack configure\fR.
-The first two elements of the list are ``\fB\-in \fImaster\fR'' where
-\fImaster\fR is the slave's master.
+The first two elements of the list are
+.QW "\fB\-in \fImaster\fR"
+where \fImaster\fR is the slave's master.
.TP
\fBpack 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 ``GEOMETRY PROPAGATION'' below).
+name (see \fBGEOMETRY PROPAGATION\fR below).
If \fIboolean\fR has a false boolean value then propagation is
disabled for \fImaster\fR.
In either of these cases an empty string is returned.
@@ -182,7 +184,7 @@ For the left or right side the height of the parcel is
the height of the cavity and the width is the requested width
of the slave plus the \fB\-ipadx\fR and \fB\-padx\fR options.
The parcel may be enlarged further because of the \fB\-expand\fR
-option (see ``EXPANSION'' below)
+option (see \fBEXPANSION\fR below)
.IP [2]
The packer chooses the dimensions of the slave.
The width will normally be the slave's requested width plus
@@ -206,7 +208,7 @@ slave and the edges of the parcel.
Once a given slave has been packed, the area of its parcel
is subtracted from the cavity, leaving a smaller rectangular
cavity for the next slave.
-If a slave doesn't use all of its parcel, the unused space
+If a slave does not use all of its parcel, the unused space
in the parcel will not be used by subsequent slaves.
If the cavity should become too small to meet the needs of
a slave then the slave will be given whatever space is
@@ -214,7 +216,7 @@ left in the cavity.
If the cavity shrinks to zero size, then all remaining slaves
on the packing list will be unmapped from the screen until
the master window becomes large enough to hold them again.
-.SH "EXPANSION"
+.SS "EXPANSION"
.PP
If a master window is so large that there will be extra space
left over after all of its slaves have been packed, then the
@@ -224,7 +226,7 @@ Extra horizontal space is distributed among the expandable
slaves whose \fB\-side\fR is \fBleft\fR or \fBright\fR,
and extra vertical space is distributed among the expandable
slaves whose \fB\-side\fR is \fBtop\fR or \fBbottom\fR.
-.SH "GEOMETRY PROPAGATION"
+.SS "GEOMETRY PROPAGATION"
.PP
The packer normally computes how large a master must be to
just exactly meet the needs of its slaves, and it sets the
@@ -250,7 +252,7 @@ visible without danger of the slave being clipped by its parent.
If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
-if the slave hasn't been packed correctly.
+if the slave has not been packed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first: the most recently created window
will be highest in the stacking order.
@@ -261,8 +263,8 @@ the stacking order of either the master or the slave.
# Make the widgets
label .t \-text "This widget is at the top" \-bg red
label .b \-text "This widget is at the bottom" \-bg green
-label .l \-text "Left\\nHand\\nSide"
-label .r \-text "Right\\nHand\\nSide"
+label .l \-text "Left\enHand\enSide"
+label .r \-text "Right\enHand\enSide"
text .mid
\.mid insert end "This layout is like Java's BorderLayout"
# Lay them out
diff --git a/doc/palette.n b/doc/palette.n
index 76c01c7..4b1dcff 100644
--- a/doc/palette.n
+++ b/doc/palette.n
@@ -32,15 +32,15 @@ of \fIname\fR\-\fIvalue\fR pairs, where the first argument of the pair
is the name of an option in the Tk option database and the second
argument is the new value to use for that option. The following
database names are currently supported:
-.DS L
+.DS
.ta 4c 8c
-\fBactiveBackground foreground selectColor
-activeForeground highlightBackground selectBackground
-background highlightColor selectForeground
-disabledForeground insertBackground troughColor\fR
+\fBactiveBackground\fR \fBforeground\fR \fBselectColor\fR
+\fBactiveForeground\fR \fBhighlightBackground\fR \fBselectBackground\fR
+\fBbackground\fR \fBhighlightColor\fR \fBselectForeground\fR
+\fBdisabledForeground\fR \fBinsertBackground\fR \fBtroughColor\fR
.DE
\fBtk_setPalette\fR tries to compute reasonable defaults for any
-options that you don't specify. You can specify options other
+options that you do not specify. You can specify options other
than the above ones and Tk will change those options on widgets as
well. This feature may be useful if you are using custom widgets with
additional color options.
@@ -64,7 +64,8 @@ from the .Xdefaults file or options specified on the command-line
that creates a widget.
.PP
The procedure \fBtk_bisque\fR is provided for backward compatibility:
-it restores the application's colors to the light brown (``bisque'')
+it restores the application's colors to the light brown
+.PQ bisque
color scheme used in Tk 3.6 and earlier versions.
.SH KEYWORDS
diff --git a/doc/panedwindow.n b/doc/panedwindow.n
index 621767c..ccc87e7 100644
--- a/doc/panedwindow.n
+++ b/doc/panedwindow.n
@@ -14,9 +14,8 @@ panedwindow \- Create and manipulate panedwindow widgets
.SH SYNOPSIS
\fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-background \-height \-width
-\-borderwidth \-orient
-\-cursor \-relief
+\-background \-borderwidth \-cursor
+\-orient \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-handlepad handlePad HandlePad
@@ -26,6 +25,10 @@ which to draw the handle. May be any value accepted by \fBTk_GetPixels\fR.
.OP \-handlesize handleSize HandleSize
Specifies the side length of a sash handle. Handles are always
drawn as squares. May be any value accepted by \fBTk_GetPixels\fR.
+.OP \-height height Height
+Specifies a desired height for the overall panedwindow widget. May be any
+value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be
+made high enough to allow all contained widgets to have their natural height.
.OP \-opaqueresize opaqueResize OpaqueResize
Specifies whether panes should be resized as a sash is moved (true),
or if resizing should be deferred until the sash is placed (false).
@@ -45,8 +48,11 @@ Specifies the width of each sash. May be any value accepted by
.OP \-showhandle showHandle ShowHandle
Specifies whether sash handles should be shown. May be any valid Tcl
boolean value.
+.OP \-width width Width
+Specifies a desired width for the overall panedwindow widget. May be any
+value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be
+made wide enough to allow all contained widgets to have their natural width.
.BE
-
.SH DESCRIPTION
.PP
The \fBpanedwindow\fR command creates a new window (given by the
@@ -188,10 +194,17 @@ height requested internally by the window will be used initially; the
height may later be adjusted by the movement of sashes in the
panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
.TP
+\fB\-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 -- the x dimension for horizontal panedwindows, the y
+paned dimension \(em the x dimension for horizontal panedwindows, the y
dimension for vertical panedwindows. May be any value accepted by
\fBTk_GetPixels\fR.
.TP
@@ -209,13 +222,46 @@ have any of the forms accepted by \fBTk_GetPixels\fR.
If a window's pane is larger than the requested dimensions of the
window, this option may be used to position (or stretch) the window
within its pane. \fIStyle\fR is a string that contains zero or more
-of the characters \fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP. The string
+of the characters \fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR. The string
can optionally contains spaces or commas, but they are ignored. Each
letter refers to a side (north, south, east, or west) that the window
-will "stick" to. If both \fBn\fP and \fBs\fP (or \fBe\fP and \fBw\fP)
+will
+.QW stick
+to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR)
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.
+The panedwindow will calculate the required size of all its panes. Any
+remaining (or deficit) space will be distributed to those panes marked
+for stretching. The space will be distributed based on each panes
+current ratio of the whole. The \fIwhen\fR values have the following
+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
+stretch.
+.TP
+\fBlast\fR
+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
@@ -237,6 +283,7 @@ adjusted.
When a pane is resized from outside (e.g. it is packed to expand and
fill, and the containing toplevel is resized), space is added to the final
(rightmost or bottommost) pane in the window.
-
+.SH "SEE ALSO"
+ttk::panedwindow(n)
.SH KEYWORDS
panedwindow, widget, geometry management
diff --git a/doc/photo.n b/doc/photo.n
index 7f03fe7..101d2ca 100644
--- a/doc/photo.n
+++ b/doc/photo.n
@@ -30,10 +30,8 @@ C code through a procedural interface. At present, only GIF and PPM/PGM
formats are supported, but an interface exists to allow additional
image file formats to be added easily. A photo image is transparent
in regions where no image data has been supplied
-.VS 8.4
or where it has been set transparent by the \fBtransparency set\fR
subcommand.
-.VE 8.4
.SH "CREATING PHOTOS"
.PP
Like all images, photos are created using the \fBimage create\fR
@@ -188,7 +186,6 @@ about the Y or X axes, respectively. If \fIy\fR is not given, the
default value is the same as \fIx\fR.
.TP
\fB\-compositingrule \fIrule\fR
-.VS 8.4
Specifies how transparent pixels in the source image are combined with
the destination image. When a compositing rule of \fIoverlay\fR is
set, the old contents of the destination image are visible, as if the
@@ -197,7 +194,6 @@ over the top of the destination. When a compositing rule of \fIset\fR
is set, the old contents of the destination image are discarded and
the source image is used as-is. The default compositing rule is
\fIoverlay\fR.
-.VE 8.4
.RE
.TP
\fIimageName \fBdata ?\fIoption value(s) ...\fR?
@@ -259,8 +255,8 @@ 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 data from \fIfilename\fR
-are to be read. The default is (0,0). If \fIx2\fR,\fIy2\fR is given
+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
and \fIdata\fR is not large enough to cover the rectangle specified by
this option, the image data extracted will be tiled so it covers the
entire destination rectangle. Note that if \fIdata\fR specifies a
@@ -316,7 +312,6 @@ recalculate the dithered image in each window where the image is
displayed.
.TP
\fIimageName \fBtransparency \fIsubcommand ?arg arg ...?\fR
-.VS 8.4
Allows examination and manipulation of the transparency information in
the photo image. Several subcommands are available:
.RS
@@ -329,7 +324,6 @@ transparent.
Makes the pixel at (\fIx\fR,\fIy\fR) transparent if \fIboolean\fR is
true, and makes that pixel opaque otherwise.
.RE
-.VE 8.4
.TP
\fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR?
Writes image data from \fIimageName\fR to a file named \fIfilename\fR.
@@ -374,7 +368,7 @@ When reading an image file or processing
string data specified with the \fB\-data\fR configuration option, the
photo image code invokes each handler in turn until one is
found that claims to be able to read the data in the file or string.
-Usually this will find the correct handler, but if it doesn't, the
+Usually this will find the correct handler, but if it does not, the
user may give a format name with the \fB\-format\fR option to specify
which handler to use. In fact the photo image code will try those
handlers whose names begin with the string specified for the
@@ -390,10 +384,8 @@ for the \fB\-format\fR option must begin with the complete name of the
requested handler, and may contain additional information following
that, which the handler can use, for example, to specify which variant
to use of the formats supported by the handler.
-.VS 8.4
Note that not all image handlers may support writing transparency data
to a file, even where the target image format does.
-.VE 8.4
.SH "COLOR ALLOCATION"
.PP
When a photo image is displayed in a window, the photo image code
@@ -433,7 +425,7 @@ Load an image from a file and tile it to the size of a window, which
is useful for producing a tiled background:
.CS
# These lines should be called once
-\fBimage create photo\fR untiled -file "theFile.ppm"
+\fBimage create photo\fR untiled \-file "theFile.ppm"
\fBimage create photo\fR tiled
# These lines should be called whenever .someWidget changes
diff --git a/doc/place.n b/doc/place.n
index 017313f..fc7e0fb 100644
--- a/doc/place.n
+++ b/doc/place.n
@@ -102,7 +102,7 @@ In addition, \fImaster\fR and \fIwindow\fR must both be descendants
of the same top-level window.
These restrictions are necessary to guarantee
that \fIwindow\fR is visible whenever \fImaster\fR is visible.
-If this option isn't specified then the master defaults to
+If this option is not specified then the master defaults to
\fIwindow\fR's parent.
.TP
\fB\-relheight \fIsize\fR
@@ -180,7 +180,7 @@ the most recent option is used and the older one is ignored.
\fBplace forget \fIwindow\fR
Causes the placer to stop managing the geometry of \fIwindow\fR. As a
side effect of this command \fIwindow\fR will be unmapped so that it
-doesn't appear on the screen. If \fIwindow\fR isn't currently managed
+does not appear on the screen. If \fIwindow\fR is not currently managed
by the placer then the command has no effect. This command returns an
empty string.
.TP
@@ -207,12 +207,15 @@ This feature is useful in at least two situations.
First, for complex window layouts it means you can create a
hierarchy of subwindows whose only purpose
is to assist in the layout of the parent.
-The ``real children'' of the parent (i.e. the windows that
+The
+.QW "real children"
+of the parent (i.e. the windows that
are significant for the application's user interface) can be
children of the parent yet be placed inside the windows
of the geometry-management hierarchy.
-This means that the path names of the ``real children''
-don't reflect the geometry-management hierarchy and users
+This means that the path names of the
+.QW "real children"
+do not reflect the geometry-management hierarchy and users
can specify options for the real children
without being aware of the structure of the geometry-management
hierarchy.
@@ -230,7 +233,7 @@ will be repositioned as well.
.PP
Unlike many other geometry managers (such as the packer)
the placer does not make any attempt to manipulate the geometry of
-the master windows or the parents of slave windows (i.e. it doesn't
+the master windows or the parents of slave windows (i.e. it does not
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.
@@ -238,7 +241,7 @@ frames and canvases that provide configuration options for this purpose.
Make the label occupy the middle bit of the toplevel, no matter how it
is resized:
.CS
-label .l \-text "In the\\nMiddle!" \-bg black \-fg white
+label .l \-text "In the\enMiddle!" \-bg black \-fg white
\fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35
.CE
diff --git a/doc/radiobutton.n b/doc/radiobutton.n
index ae9a857..29c2eec 100644
--- a/doc/radiobutton.n
+++ b/doc/radiobutton.n
@@ -34,7 +34,7 @@ Specifies a desired height for the button.
If an image or bitmap is being displayed in the button then the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
-If this option isn't specified, the button's desired height is computed
+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
@@ -52,25 +52,25 @@ 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 \-offrelief offRelief OffRelief
-.VS 8.4
Specifies the relief for the checkbutton when the indicator is not drawn and
-the checkbutton is off. The default value is "raised". By setting this option
-to "flat" and setting -indicatoron to false and -overrelief to raised,
+the checkbutton is off. The default value is
+.QW raised .
+By setting this option to
+.QW flat
+and setting \fB\-indicatoron\fR to false and \fB\-overrelief\fR to
+.QW raised ,
the effect is achieved
of having a flat button that raises on mouse-over and which is
depressed when activated. This is the behavior typically exhibited by
the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a
word-processor, for example.
-.VE 8.4
.OP \-overrelief overRelief OverRelief
-.VS 8.4
Specifies an alternative relief for the radiobutton, to be used when the
mouse cursor is over the widget. This option can be used to make
toolbar buttons, by configuring \fB\-relief flat \-overrelief
raised\fR. If the value of this option is the empty string, then no
alternative relief is used when the mouse cursor is over the radiobutton.
The empty string is the default value.
-.VE 8.4
.OP \-selectimage selectImage SelectImage
Specifies an image to display (in place of the \fBimage\fR option)
when the radiobutton is selected.
@@ -87,6 +87,19 @@ 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.
+.OP \-tristateimage tristateImage TristateImage
+.VS 8.5
+Specifies an image to display (in place of the \fBimage\fR option)
+when the radiobutton is selected.
+This option is ignored unless the \fBimage\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
+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.
@@ -100,10 +113,9 @@ Specifies a desired width for the button.
If an image or bitmap is being displayed in the button, the value is in
screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in characters.
-If this option isn't specified, the button's desired width is computed
+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 \fBradiobutton\fR command creates a new window (given by the
@@ -117,10 +129,8 @@ text, and initial relief. The \fBradiobutton\fR command returns its
there must not exist a window named \fIpathName\fR, but
\fIpathName\fR's parent must exist.
.PP
-.VS
A radiobutton is a widget that displays a textual string, bitmap or image
and a diamond or circle called an \fIindicator\fR.
-.VE
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
@@ -135,7 +145,6 @@ check button.
.PP
In addition, radiobuttons can be \fIselected\fR.
If a radiobutton is selected, the indicator is normally
-.VS
drawn with a selected appearance, and
a Tcl variable associated with the radiobutton is set to a particular
value (normally 1).
@@ -144,15 +153,19 @@ color. Under Windows, the indicator is drawn with a round mark inside.
If the radiobutton is not selected, then the indicator is drawn with a
deselected appearance, and the associated variable is
set to a different value (typically 0).
-Under Unix, the indicator is drawn with a raised relief and no special
-color. Under Windows, the indicator is drawn without a round mark inside.
-.VE
+The indicator is drawn without a round mark inside.
Typically, several radiobuttons share a single variable and the
value of the variable indicates which radiobutton is to be selected.
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
+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
@@ -225,14 +238,12 @@ value corresponding to this widget.
Tk automatically creates class bindings for radiobuttons that give them
the following default behavior:
.IP [1]
-.VS
On Unix systems, a radiobutton activates whenever the mouse passes
over it and deactivates whenever the mouse leaves the radiobutton. On
Mac and Windows systems, when mouse button 1 is pressed over a
radiobutton, the button activates whenever the mouse pointer is inside
the button, and deactivates whenever the mouse pointer leaves the
button.
-.VE
.IP [2]
When mouse button 1 is pressed over a radiobutton it is invoked (it
becomes selected and the command associated with the button is
@@ -246,9 +257,7 @@ actions occur: the radiobutton is completely non-responsive.
.PP
The behavior of radiobuttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-
.SH "SEE ALSO"
-checkbutton(n), labelframe(n), listbox(n), options(n), scale(n)
-
+checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n)
.SH KEYWORDS
radiobutton, widget
diff --git a/doc/raise.n b/doc/raise.n
index 643ec36..02f805f 100644
--- a/doc/raise.n
+++ b/doc/raise.n
@@ -34,11 +34,11 @@ 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
display:
.CS
-button .b -text "Hi there!"
-pack [frame .f -background blue]
-pack [label .f.l1 -text "This is above"]
-pack .b -in .f
-pack [label .f.l2 -text "This is below"]
+button .b \-text "Hi there!"
+pack [frame .f \-background blue]
+pack [label .f.l1 \-text "This is above"]
+pack .b \-in .f
+pack [label .f.l2 \-text "This is below"]
\fBraise\fR .b
.CE
diff --git a/doc/scale.n b/doc/scale.n
index 5b1b3b1..e750fdd 100644
--- a/doc/scale.n
+++ b/doc/scale.n
@@ -23,7 +23,8 @@ scale \- Create and manipulate scale widgets
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-bigincrement bigIncrement BigIncrement
Some interactions with the scale cause its value to change by
-``large'' increments; this option specifies the size of the
+.QW large
+increments; this option specifies the size of the
large increments. If specified as 0, the large increments default
to 1/10 the range of the scale.
.OP \-command command Command
@@ -71,7 +72,7 @@ or \fBsunken\fR.
Specifies one of three states for the scale: \fBnormal\fR,
\fBactive\fR, or \fBdisabled\fR.
If the scale is disabled then the value may not be changed and the scale
-won't activate.
+will not activate.
If the scale is active, the slider is displayed using the color
specified by the \fBactiveBackground\fR option.
.OP \-tickinterval tickInterval TickInterval
@@ -186,7 +187,7 @@ the slider; \fBtrough1\fR means that the point is over the
portion of the slider above or to the left of the slider;
and \fBtrough2\fR means that the point is over the portion
of the slider below or to the right of the slider.
-If the point isn't over one of these elements, an empty string
+If the point is not over one of these elements, an empty string
is returned.
.TP
\fIpathName \fBset\fR \fIvalue\fR
diff --git a/doc/scrollbar.n b/doc/scrollbar.n
index 7f4801a..a13574b 100644
--- a/doc/scrollbar.n
+++ b/doc/scrollbar.n
@@ -37,7 +37,7 @@ name of a widget and either \fBxview\fR (if the scrollbar is for
horizontal scrolling) or \fByview\fR (for vertical scrolling).
All scrollable widgets have \fBxview\fR and \fByview\fR commands
that take exactly the additional arguments appended by the scrollbar
-as described in SCROLLING COMMANDS below.
+as described in \fBSCROLLING COMMANDS\fR below.
.OP \-elementborderwidth elementBorderWidth BorderWidth
Specifies the width of borders drawn around the internal elements
of the scrollbar (the two arrows and the slider). The value may
@@ -51,7 +51,6 @@ scrollbars this will be the width and for horizontal scrollbars
this will be the height.
The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
.BE
-
.SH DESCRIPTION
.PP
The \fBscrollbar\fR command creates a new window (given by the
@@ -280,7 +279,7 @@ If the button is held down, the action auto-repeats.
.IP [3]
Pressing button 1 over the slider and dragging causes the view
to drag with the slider.
-If the \fBjump\fR option is true, then the view doesn't drag along
+If the \fBjump\fR option is true, then the view does not drag along
with the slider; it changes only when the mouse button is released.
.IP [4]
Pressing button 1 over \fBtrough2\fR causes the view in the
@@ -332,12 +331,13 @@ The End key adjusts the view to the bottom (right edge) of the document.
Create a window with a scrollable \fBtext\fR widget:
.CS
toplevel .tl
-text .tl.t -yscrollcommand {.tl.s set}
-\fBscrollbar\fR .tl.s -command {.tl.t yview}
-grid .tl.t .tl.s -sticky nsew
-grid columnconfigure .tl 0 -weight 1
-grid rowconfigure .tl 0 -weight 1
+text .tl.t \-yscrollcommand {.tl.s set}
+\fBscrollbar\fR .tl.s \-command {.tl.t yview}
+grid .tl.t .tl.s \-sticky nsew
+grid columnconfigure .tl 0 \-weight 1
+grid rowconfigure .tl 0 \-weight 1
.CE
-
+.SH "SEE ALSO"
+ttk:scrollbar(n)
.SH KEYWORDS
scrollbar, widget
diff --git a/doc/selection.n b/doc/selection.n
index dcf12b2..8aee321 100644
--- a/doc/selection.n
+++ b/doc/selection.n
@@ -35,35 +35,44 @@ 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
Communication Conventions Manual for complete details.
-\fISelection\fR defaults to PRIMARY and \fIwindow\fR defaults to ``.''.
+\fISelection\fR defaults to PRIMARY 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
-\fIwindow\fR defaults to ``.''.
+\fIwindow\fR defaults to
+.QW . .
\fIType\fR specifies the form in which the selection is to be returned
-(the desired ``target'' for conversion, in ICCCM terminology), and
+(the desired
+.QW target
+for conversion, in ICCCM terminology), and
should be an atom name such as STRING or FILE_NAME; see the
Inter-Client Communication Conventions Manual for complete details.
\fIType\fR defaults to STRING. The selection owner may choose to
return the selection in any of several different representation
-formats, such as STRING, ATOM, INTEGER, etc. (this format is different
+formats, such as STRING, UTF8_STRING, ATOM, INTEGER, 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
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.
.TP
-\fBselection handle\fR ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-format\fR \fIformat\fR? \fIwindow command\fR
+\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 \fIselection\fR is owned by \fIwindow\fR and
-someone attempts to retrieve it in the form given by \fItype\fR
-(e.g. \fItype\fR is specified in the \fBselection get\fR command).
-\fISelection\fR defaults to PRIMARY, \fItype\fR defaults to STRING, and
-\fIformat\fR defaults to STRING. If \fIcommand\fR is an empty string
-then any existing handler for \fIwindow\fR, \fItype\fR, and
-\fIselection\fR is removed.
+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
+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.
.RS
.PP
When \fIselection\fR is requested, \fIwindow\fR is the selection owner,
@@ -71,7 +80,6 @@ and \fItype\fR is the requested type, \fIcommand\fR will be executed
as a Tcl command with two additional numbers appended to it
(with space separators).
The two additional numbers
-.VS
are \fIoffset\fR and \fImaxChars\fR: \fIoffset\fR specifies a starting
character position in the selection and \fImaxChars\fR gives the maximum
number of characters to retrieve. The command should return a value consisting
@@ -85,16 +93,17 @@ include all of the remainder of the selection; if the length of
\fIcommand\fR will be invoked again, until it eventually
returns a result shorter than \fImaxChars\fR. The value of \fImaxChars\fR
will always be relatively large (thousands of characters).
-.VE
.PP
If \fIcommand\fR returns an error then the selection retrieval is rejected
-just as if the selection didn't exist at all.
+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.
-just in the form returned by \fIcommand\fR). If \fIformat\fR is
+just in the form returned by \fIcommand\fR, in the system \fBencoding\fR;
+the UTF8_STRING format always uses UTF-8 as its encoding).
+If \fIformat\fR is
ATOM, 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.
@@ -104,7 +113,7 @@ converted to a 32-bit integer; an array of integers is transmitted
to the selection requester.
.PP
The \fIformat\fR argument is needed only for compatibility with
-selection requesters that don't use Tk. If Tk is being
+selection requesters that do not use Tk. If Tk is being
used to retrieve the selection then the value is converted back to
a string at the requesting end, so \fIformat\fR is
irrelevant.
@@ -117,7 +126,8 @@ 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
-\fIwindow\fR defaults to ``.''.
+\fIwindow\fR defaults to
+.QW . .
.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
@@ -160,9 +170,7 @@ proc lost {} {
puts "Lost selection"
}
.CE
-
.SH "SEE ALSO"
clipboard(n)
-
.SH KEYWORDS
clear, format, handler, ICCCM, own, selection, target, type
diff --git a/doc/send.n b/doc/send.n
index 59d832b..3b2a714 100644
--- a/doc/send.n
+++ b/doc/send.n
@@ -28,9 +28,9 @@ contained entirely within the \fIcmd\fR argument. If one or
more \fIarg\fRs are present, they are concatenated to form the
command to be executed, just as for the \fBeval\fR command.
.PP
-If the initial arguments of the command begin with ``\-''
-they are treated as options. The following options are
-currently defined:
+If the initial arguments of the command begin with
+.QW \-
+they are treated as options. The following options are currently defined:
.TP
\fB\-async\fR
Requests asynchronous invocation. In this case the \fBsend\fR
@@ -47,7 +47,8 @@ the application's main window.
.TP
\fB\-\|\-\fR
Serves no purpose except to terminate the list of options. This
-option is needed only if \fIapp\fR could contain a leading ``\-''
+option is needed only if \fIapp\fR could contain a leading
+.QW \-
character.
.SH "APPLICATION NAMES"
@@ -85,16 +86,14 @@ list of enabled hosts is empty.
This means that applications cannot connect to your server unless
they use some other form of authorization
such as that provide by \fBxauth\fR.
-.VS
Under Windows, \fBsend\fR is currently disabled. Most of the
functionality is provided by the \fBdde\fR command instead.
-.VE
.SH EXAMPLE
This script fragment can be used to make an application that only runs
once on a particular display.
.CS
if {[tk appname FoobarApp] ne "FoobarApp"} {
- \fBsend\fR -async FoobarApp RemoteStart $argv
+ \fBsend\fR \-async FoobarApp RemoteStart $argv
exit
}
# The command that will be called remotely, which raises
@@ -107,6 +106,4 @@ proc RemoteStart args {
}
.CE
.SH KEYWORDS
-.VS
application, dde, name, remote execution, security, send
-.VE
diff --git a/doc/spinbox.n b/doc/spinbox.n
index 700f001..dc98251 100644
--- a/doc/spinbox.n
+++ b/doc/spinbox.n
@@ -78,7 +78,7 @@ contents of the widget may still be selected. If the spinbox is
disabled, the value may not be changed, no insertion cursor will be
displayed, the contents will not be selectable, and the spinbox may
be displayed in a different color, depending on the values of the
-\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
+\fB\-disabledforeground\fR and \fB\-disabledbackground\fR options.
.OP \-to to To
A floating-point value corresponding to the highest value for the spinbox,
to be used in conjunction with \fB\-from\fR and \fB\-increment\fR. When
@@ -112,7 +112,6 @@ size just large enough to hold its current text.
Must be a proper boolean value. If on, the spinbox will wrap around the
values of data in the widget.
.BE
-
.SH DESCRIPTION
.PP
The \fBspinbox\fR command creates a new window (given by the
@@ -145,7 +144,6 @@ may be used to change the view in the window. Spinboxes use
the standard \fBxScrollCommand\fR mechanism for interacting with
scrollbars (see the description of the \fBxScrollCommand\fR option
for details). They also support scanning, as described below.
-
.SH VALIDATION
.PP
Validation works by setting the \fBvalidateCommand\fR
@@ -172,9 +170,9 @@ following substitutions are recognized:
.PP
.IP \fB%d\fR 5
Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
-or -1 for focus, forced or textvariable validation.
+or \-1 for focus, forced or textvariable validation.
.IP \fB%i\fR 5
-Index of char string to be inserted/deleted, if any, otherwise -1.
+Index of char string to be inserted/deleted, if any, otherwise \-1.
.IP \fB%P\fR 5
The value of the spinbox should edition occur. If you are configuring the
spinbox widget to have a new textvariable, this will be the value of that
@@ -212,13 +210,12 @@ validated. If you wish to edit the value of the widget
during validation and still have the \fBvalidate\fR option set, you should
include the command
.CS
- \fI%W config -validate %v\fR
+ \fI%W config \-validate %v\fR
.CE
in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
were editing the spinbox widget from). It is also recommended to not set an
associated \fBtextVariable\fR during validation, as that can cause the
spinbox widget to become out of sync with the \fBtextVariable\fR.
-
.SH "WIDGET COMMAND"
.PP
The \fBspinbox\fR command creates a new Tcl command whose
@@ -229,6 +226,7 @@ operations on the widget. It has the following general form:
.CE
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command.
+.SS INDICES
.PP
Many of the widget commands for spinboxes take one or more indices as
arguments. An index specifies a particular character in the spinbox's
@@ -253,22 +251,27 @@ insertion cursor.
.TP 12
\fBsel.first\fR
Indicates the first character in the selection. It is an error to
-use this form if the selection isn't in the spinbox window.
+use this form if the selection is not in the spinbox window.
.TP 12
\fBsel.last\fR
Indicates the character just after the last one in the selection.
-It is an error to use this form if the selection isn't in the
+It is an error to use this form if the selection is not in the
spinbox window.
.TP 12
\fB@\fInumber\fR
In this form, \fInumber\fR is treated as an x-coordinate in the
spinbox's window; the character spanning that x-coordinate is used.
-For example, ``\fB@0\fR'' indicates the left-most character in the
-window.
+For example,
+.QW \fB@0\fR
+indicates the left-most character in the window.
.LP
-Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
-or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
-rounded to the nearest legal value.
+Abbreviations may be used for any of the forms above, e.g.
+.QW \fBe\fR
+or
+.QW \fBsel.f\fR .
+In general, out-of-range indices are automatically rounded to the
+nearest legal value.
+.SS SUBCOMMANDS
.PP
The following commands are possible for spinbox widgets:
.TP
@@ -307,7 +310,7 @@ Delete one or more elements of the spinbox.
\fIFirst\fR is the index of the first character to delete, and
\fIlast\fR is the index of the character just after the last
one to delete.
-If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
+If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
i.e. a single character is deleted.
This command returns an empty string.
.TP
@@ -366,14 +369,14 @@ Locate the end of the selection nearest to the character given by
(i.e. including but not going beyond \fIindex\fR). The other
end of the selection is made the anchor point for future
\fBselect to\fR commands. If the selection
-isn't currently in the spinbox, then a new selection is created to
+is not currently in the spinbox, then a new selection is created to
include the characters between \fIindex\fR and the most recent
selection anchor point, inclusive.
Returns an empty string.
.TP
\fIpathName \fBselection clear\fR
Clear the selection if it is currently in this widget. If the
-selection isn't in this widget then the command has no effect.
+selection is not in this widget then the command has no effect.
Returns an empty string.
.TP
\fIpathName \fBselection element\fR ?\fIelement\fR?
@@ -382,7 +385,7 @@ is specified, it will be displayed depressed.
.TP
\fIpathName \fBselection from \fIindex\fR
Set the selection anchor point to just before the character
-given by \fIindex\fR. Doesn't change the selection.
+given by \fIindex\fR. Does not change the selection.
Returns an empty string.
.TP
\fIpathName \fBselection present\fR
@@ -406,7 +409,7 @@ to the characters from the anchor point up to but not including
\fIindex\fR.
The anchor point is determined by the most recent \fBselect from\fR
or \fBselect adjust\fR command in this widget.
-If the selection isn't in this widget then a new selection is
+If the selection is not in this widget then a new selection is
created using the most recent anchor point specified for the widget.
Returns an empty string.
.RE
@@ -465,9 +468,11 @@ become visible.
.PP
Tk automatically creates class bindings for spinboxes that give them
the following default behavior.
-In the descriptions below, ``word'' refers to a contiguous group
-of letters, digits, or ``_'' characters, or any single character
-other than these.
+In the descriptions below,
+.QW word
+refers to a contiguous group of letters, digits, or
+.QW _
+characters, or any single character other than these.
.IP [1]
Clicking mouse button 1 positions the insertion cursor
just before the character underneath the mouse cursor, sets the
@@ -528,7 +533,7 @@ Shift-End moves the cursor to the end and extends the selection
to that point.
.IP [12]
The Select key and Control-Space set the selection anchor to the position
-of the insertion cursor. They don't affect the current selection.
+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.
diff --git a/doc/text.n b/doc/text.n
index ac61d41..69f7ac2 100644
--- a/doc/text.n
+++ b/doc/text.n
@@ -6,7 +6,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH text n 8.4 Tk "Tk Built-In Commands"
+.TH text n 8.5 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -14,11 +14,9 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widget
.SH SYNOPSIS
.nf
\fBtext\fR \fIpathName \fR?\fIoptions\fR?
-.VS 8.4
\fBtk_textCopy\fR \fIpathName\fR
\fBtk_textCut\fR \fIpathName\fR
\fBtk_textPaste\fR \fIpathName\fR
-.VE 8.4
.SO
\-background \-highlightthickness \-relief
\-borderwidth \-insertbackground \-selectbackground
@@ -31,20 +29,37 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widget
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-autoseparators autoSeparators AutoSeparators
-.VS 8.4
Specifies a boolean that says whether separators are automatically
inserted in the undo stack. Only meaningful when the \fB\-undo\fR
option is true.
-.VE 8.4
+.OP \-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
+.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
.OP \-height height Height
Specifies the desired height for the window, in units of characters
in the font given by the \fB\-font\fR option.
Must be at least one.
+.OP \-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
.OP \-maxundo maxUndo MaxUndo
-.VS 8.4
Specifies the maximum number of compound undo actions on the undo
stack. A zero or a negative value imply an unlimited undo stack.
-.VE 8.4
.OP \-spacing1 spacing1 Spacing1
Requests additional space above each text line in the widget,
using any of the standard forms for screen distances.
@@ -66,6 +81,15 @@ 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
.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
@@ -89,36 +113,55 @@ 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, \fB\-tabs {2c left 4c 6c center}\fR creates three
-tab stops at two-centimeter intervals; the first two use left
+For example,
+.QW "\fB\-tabs {2c left 4c 6c center}\fR"
+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
+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.
+(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.
.OP \-undo undo Undo
-.VS 8.4
Specifies a boolean that says whether the undo mechanism is active or
not.
-.VE 8.4
.OP \-width width Width
Specifies the desired width for the window in units of characters
in the font given by the \fB\-font\fR option.
-If the font doesn't have a uniform width then the width of the
-character ``0'' is used in translating from character units to
-screen units.
+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 don't fit
+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.
@@ -149,7 +192,8 @@ 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 "marks".
+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.
@@ -162,10 +206,14 @@ The fourth form of annotation allows Tk images to be embedded in a text
widget.
See \fBEMBEDDED IMAGES\fR below for more details.
.PP
-.VS 8.4
The text widget also has a built-in undo/redo mechanism.
See \fBTHE UNDO MECHANISM\fR below for more details.
-.VE 8.4
+.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
.SH INDICES
.PP
Many of the widget commands for texts take one or more indices
@@ -181,6 +229,20 @@ 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
+.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
@@ -227,82 +289,163 @@ Indicates the position of the embedded image whose name is
This form generates an error if there is no embedded image
by the given name.
.PP
-If the \fIbase\fP could match more than one of the above forms, such
-as a \fImark\fP and \fIimageName\fP both having the same value, then
+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\fB chars\fR
-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 character in the text.
-Spaces on either side of \fIcount\fR are optional.
-.TP
-\fB\- \fIcount\fB chars\fR
+\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
+.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 the first character in the text.
-Spaces on either side of \fIcount\fR are optional.
-.TP
-\fB+ \fIcount\fB lines\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
+.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
+.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
+.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
+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.
-.TP
-\fB\- \fIcount\fB lines\fR
-Adjust the index backward by \fIcount\fR 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.
-.TP
-\fBlinestart\fR
-Adjust the index to refer to the first character on the line.
-.TP
-\fBlineend\fR
-Adjust the index to refer to the last character on the line (the newline).
-.TP
-\fBwordstart\fR
+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
+.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
+.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
+.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
+.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.
-.TP
-\fBwordend\fR
+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
+.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.
+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 ``\fBend \- 1 chars\fR''
+left-to-right order. For example, the index
+.QW "\fBend \- 1 chars\fR"
refers to the next-to-last character in the text and
-``\fBinsert wordstart \- 1 c\fR'' refers to the character just before
+.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 ``\fB1.0 -1c +1c\fR'' refers to the
-index ``\fB2.0\fR''.
+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,
+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 `` '' (space), \fB+\fR, or \fB\-\fR:
+avoid using the characters
+.QW " "
+(space), \fB+\fR, or \fB\-\fR:
these characters have special meaning in indices, so tags containing
-them can't be used as indices.
+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
@@ -315,16 +458,20 @@ 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
-``\fIpathName \fBtag raise\fR'' and ``\fIpathName \fBtag lower\fR''
+.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
-\fBbackground\fR, \fBfont\fR, and \fBforeground\fR options for 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 ``\fIpathName \fBtag configure\fR'' widget command.
+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:
@@ -338,7 +485,7 @@ It may have any of the forms accepted by \fBTk_GetColor\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 hasn't been specified, or if it is specified
+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
@@ -352,16 +499,17 @@ it is ignored unless the \fB\-background\fR option
has been set for the tag.
.TP
\fB\-elide \fIboolean\fR
-\fIElide\fR specifies whether the data should be elided.
-Elided data 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 hasn't been specified, or if it is specified
+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
@@ -374,15 +522,15 @@ 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 character of a display line has a tag for which this
+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 character of that display line.
+display is determined by the first non-elided character of that display line.
.TP
\fB\-lmargin1 \fIpixels\fR
-If the first character of a text line has a tag for which this
+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.
@@ -393,7 +541,7 @@ first line on the display; the \fB\-lmargin2\fR option controls
the indentation for subsequent lines.
.TP
\fB\-lmargin2 \fIpixels\fR
-If the first character of a display line has a tag for which this
+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
@@ -426,7 +574,7 @@ it is ignored unless the \fB\-background\fR option
has been set for the tag.
.TP
\fB\-rmargin \fIpixels\fR
-If the first character of a display line has a tag for which this
+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.
@@ -434,7 +582,7 @@ edge of the window.
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 character of that display
+display is determined by the first non-elided character of that display
line.
.TP
\fB\-spacing1 \fIpixels\fR
@@ -461,14 +609,22 @@ line on the display.
\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 character on that display line.
+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 \fBtags\fR
+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).
+.TP
\fB\-underline \fIboolean\fR
\fIBoolean\fR specifies whether or not to draw an underline underneath
characters.
@@ -485,7 +641,7 @@ for the text widget.
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 hasn't been specified for a
+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.
@@ -500,17 +656,29 @@ 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 \fBtag bind\fR widget
-command below.
+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
+(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
.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 isn't associated
+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
@@ -520,12 +688,15 @@ 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 ``\fIpathName \fBmark\fR'' widget
+Marks may be manipulated with the
+.QW "\fIpathName \fBmark\fR"
+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 "gravity", which is either \fBleft\fR or
-\fBright\fR.
+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
@@ -549,6 +720,11 @@ 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
.SH "EMBEDDED WINDOWS"
.PP
The third form of annotation in text widgets is an embedded window.
@@ -562,17 +738,25 @@ 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 character's worth of index space
+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
-\fBwindow create\fR widget command, several configuration
+\fIpathName \fBwindow create\fR widget command, several configuration
options may be associated with it.
-These options may be modified later with the \fBwindow configure\fR
+These options may be modified later with the \fIpathName \fBwindow configure\fR
widget command.
The following options are currently supported:
.TP
@@ -594,6 +778,11 @@ 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.
.TP
@@ -618,6 +807,14 @@ 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
.SH "EMBEDDED IMAGES"
.PP
The final form of annotation in text widgets is an embedded image.
@@ -628,30 +825,34 @@ 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 character's worth of index space
+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 \fBimage create\fP.
+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 \fBimage
+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\fP option
-(described below). If the \fB\-name\fP option is not provided, the
-\fB\-image\fP name is used instead. If the \fIimageName\fP is already
+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\fP, where \fInn\fP is an arbitrary integer. This insures
-the \fIimageName\fP is unique.
-Once this name is assigned to this instance of the image, it does not
-change, even though the \fB\-image\fP or \fB\-name\fP values can be changed
-with \fBimage configure\fP.
+\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
-\fBimage create\fR widget command, several configuration
+\fIpathName \fBimage create\fR widget command, several configuration
options may be associated with it.
-These options may be modified later with the \fBimage configure\fR
+These options may be modified later with the \fIpathName \fBimage configure\fR
widget command.
The following options are currently supported:
.TP
@@ -667,13 +868,13 @@ of the line).
.TP
\fB\-image \fIimage\fR
Specifies the name of the Tk image to display in the annotation.
-If \fIimage\fP is not a valid Tk image, then an error is returned.
+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\fP is not supplied, then the
+the text widget. If \fIImageName\fR is not supplied, then the
name of the Tk image is used instead.
-If the \fIimageName\fP is already in use, \fI#nn\fP is appended to
+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
@@ -702,23 +903,35 @@ 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
+Whenever the \fBsel\fR tag range changes a virtual event
\fB<<Selection>>\fR is generated.
.PP
The \fBsel\fR tag is automatically defined when a text widget is
-created, and it may not be deleted with the ``\fIpathName \fBtag delete\fR''
+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
.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 ``\fIpathName \fBmark unset\fR'' widget
-command.
+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.
@@ -726,17 +939,18 @@ this point whenever the text widget has the input focus.
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 \fBedit modified\fR widget command for
+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
-.VS 8.4
The text widget has an unlimited undo and redo mechanism (when the
\fB\-undo\fR widget option is true) which records every insert and
delete action on a stack.
.PP
-Boundaries (called "separators") are inserted between edit actions. The
+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
@@ -757,9 +971,70 @@ automatically to the appropriate state. This automatic coupling
does not work when the modified flag has been set by the user, until
the flag has been reset again.
.PP
-See below for the \fBedit\fR widget command that controls the undo
+See below for the \fIpathName \fBedit\fR widget command that controls the undo
mechanism.
-.VE 8.4
+.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.
+.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.
+.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
+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
+.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
@@ -795,7 +1070,7 @@ command.
\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 isn't.
+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
@@ -815,6 +1090,74 @@ 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
+.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,
+\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:
+.RS
+.IP \fB\-chars\fR
+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.
+.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.
+.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.
+.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
+.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
+.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
+.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
@@ -830,13 +1173,13 @@ 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
-.VS 8.4
When debugging is turned on, the drawing routines of the text widget
set the global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR
to the lists of indices that are redrawn. The values of these variables
are tested by Tk's test suite.
-.VE 8.4
+.RE
.TP
\fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR?
Delete a range of characters from the text.
@@ -844,23 +1187,21 @@ 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 doesn't specify a position later in the text
+If \fIindex2\fR does not specify a position later in the text
than \fIindex1\fR then no characters are deleted.
-If \fIindex2\fR isn't specified then the single character at
+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.
-.VS 8.4
If more indices are given, multiple ranges of text will be deleted.
All indices are first checked for validity before any deletions are made.
They are sorted and the text is removed from the last range to the
-first range to deleted text does not cause an undesired index shifting
+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.
-.VE 8.4
.TP
\fIpathName \fBdlineinfo \fIindex\fR
Returns a list with five elements describing the area occupied
@@ -893,10 +1234,10 @@ in the following format:
.RS
\fIkey1 value1 index1 key2 value2 index2\fR ...
.LP
-The possible \fIkey\fP values are \fBtext\fP, \fBmark\fP,
-\fBtagon\fP, \fBtagoff\fP, \fBimage\fP, and \fBwindow\fP. The corresponding
-\fIvalue\fP is the text, mark name, tag name, image name, or window name.
-The \fIindex\fP information is the index of the
+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:
@@ -909,7 +1250,7 @@ This is the default.
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\fP, \fIvalue\fP, and \fIindex\fP.
+the \fIkey\fR, \fIvalue\fR, and \fIindex\fR.
.TP
\fB\-image\fR
Include information about images in the dump results.
@@ -919,7 +1260,7 @@ 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\fP and \fBtagoff\fP elements that
+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
@@ -939,7 +1280,6 @@ window by its index position to get more information.
.RE
.TP
\fIpathName \fBedit \fIoption \fR?\fIarg arg ...\fR?
-.VS 8.4
This command controls the undo mechanism and the modified flag. The
exact behavior of the command depends on the \fIoption\fR argument
that follows the \fBedit\fR argument. The following forms of the
@@ -972,9 +1312,8 @@ recorded on the undo stack in between two separators. Generates an
error when the undo stack is empty. Does nothing when the \fB\-undo\fR
option is false.
.RE
-.VE 8.4
.TP
-\fIpathName \fBget \fIindex1 \fR?\fIindex2 ...\fR?
+\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
@@ -987,11 +1326,14 @@ is past the end of the file or \fIindex2\fR is less than or equal
to \fIindex1\fR) then an empty string is returned.
If the specified range contains embedded windows, no information
about them is included in the returned string.
-.VS 8.4
If multiple index pairs are given, multiple ranges of text will be returned
in a list. Invalid ranges will not be represented with empty strings in
-the list. The ranges are returned in the order passed to \fBget\fR.
-.VE 8.4
+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
.TP
\fIpathName \fBimage \fIoption \fR?\fIarg arg ...\fR?
This command is used to manipulate embedded images.
@@ -1058,7 +1400,7 @@ 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 \fBinsert\fR widget
+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
@@ -1088,11 +1430,11 @@ 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\fP operation can be used to
+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 \fBdump\fP operation.
-If a mark has been set to the special \fBend\fP index,
-then it appears to be \fIafter\fP \fBend\fP with respect to the \fBmark next\fP operation.
+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
@@ -1103,25 +1445,61 @@ 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 \fBmark previous\fP operation can be used to
+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 \fBdump\fP operation.
+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 doesn't exist, a new mark is created.
+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 ``\fIpathName \fBmark names\fR''.
+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:
+.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.
+.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.
+.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
+\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.
+.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:
@@ -1129,14 +1507,14 @@ two forms, depending on \fIoption\fR:
.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 \fBscan dragto\fR commands.
+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
-\fBscan mark\fR command for the widget.
+\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
@@ -1161,7 +1539,13 @@ This is the default.
\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.
+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
.TP
\fB\-exact\fR
Use exact matching: the characters in the matching range must be
@@ -1172,6 +1556,23 @@ This is the default.
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
+.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
+.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.
@@ -1185,6 +1586,55 @@ 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
+.QW \ew+
+against
+.QW "hello there"
+will just match twice, once for each word, and matching
+.QW "Z[a\-z]+Z"
+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
+.QW \ew+
+against
+.QW "hello there"
+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
+.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
+.TP
\fB\-elide\fR
Find elided (hidden) text as well. By default only displayed text is
searched.
@@ -1193,12 +1643,15 @@ searched.
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.
-.LP
-The matching range must be entirely within a single line of text.
-For regular expression matching the newlines are removed from the ends
-of the lines before matching: use the \fB$\fR feature in regular
-expressions to match the end of a line.
-For exact matching the newlines are retained.
+.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
@@ -1207,6 +1660,10 @@ 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
@@ -1229,7 +1686,7 @@ supported:
\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 isn't tagged).
+\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
@@ -1251,8 +1708,9 @@ 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 ``+'' then \fIscript\fR
-augments an existing binding rather than replacing it).
+(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
@@ -1262,9 +1720,8 @@ returns a list of all the sequences for which bindings have been
defined for \fItagName\fR.
.RS
.PP
-.VS
The only events for which bindings may be specified are those related
-to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
+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
@@ -1277,7 +1734,6 @@ changed. Note that these events are different than \fBEnter\fR and
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.
-.VE
.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
@@ -1301,11 +1757,11 @@ for the window as a whole.
\fIpathName \fBtag cget\fR \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 \fBtag configure\fR
-widget command.
+\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 \fBconfigure\fR widget command except
+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
@@ -1339,10 +1795,11 @@ 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 ``\fIpathName \fBtag\fR'' widget
-command but haven't been deleted by a ``\fIpathName \fBtag delete\fR''
-widget command, even if no characters are currently marked with
-the tag).
+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.
.TP
@@ -1398,11 +1855,11 @@ empty string is returned.
\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 isn't affected).
+\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 single character at
-\fIindex1\fR is tagged.
+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.
@@ -1481,15 +1938,24 @@ span of the text is off-screen to the left.
\fIpathName \fBxview scroll \fInumber what\fR
This command shifts the view in the window left or right according to
\fInumber\fR and \fIwhat\fR.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
-of one of these.
-If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
-\fInumber\fR average-width characters on the display; if it is
-\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
-If \fInumber\fR is negative then characters farther to the left
-become visible; if it is positive then characters farther to the right
-become visible.
+\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
+.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
+\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.
.RE
.TP
\fIpathName \fByview \fI?args\fR?
@@ -1501,37 +1967,56 @@ It can take any of the following forms:
\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 character in the
+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 character just after
-the last one in the bottom line of the window,
+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 character given by \fIfraction\fR
-appears on the top line of the window.
+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
-character in the text, 0.33 indicates the character one-third the
-way through the text, and so on.
+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
.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.
-\fINumber\fR must be an integer.
-\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
-If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by
-\fInumber\fR lines on the display; if it is \fBpages\fR then
-the view adjusts by \fInumber\fR screenfuls.
+\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
+.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
+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.
.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 isn't specified then \fIindex\fR will
+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:
@@ -1548,9 +2033,9 @@ 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 \fBsee\fR widget
-command (\fBsee\fR handles both x- and y-motion to make a location
-visible, whereas \fB\-pickplace\fR only handles motion in y).
+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
@@ -1563,8 +2048,10 @@ This command used to be used for scrolling, but now it is obsolete.
.PP
Tk automatically creates class bindings for texts that give them
the following default behavior.
-In the descriptions below, ``word'' is dependent on the value of
-the \fBtcl_wordchars\fR variable. See tclvars(n).
+In the descriptions below,
+.QW word
+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
@@ -1573,12 +2060,12 @@ 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 end of the word.
+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 end of the line.
+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]
@@ -1632,21 +2119,19 @@ 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.
-Control-v moves the view down one screenful without moving the
-insertion cursor or adjusting the selection.
.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 line and clear any selection in the widget.
-Shift-Home moves the insertion cursor to the beginning of the line
+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 line and clear any selection in the widget.
-Shift-End moves the cursor to the end of the line and extends the selection
-to that point.
+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.
@@ -1659,7 +2144,7 @@ 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 don't affect the current selection.
+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.
@@ -1670,24 +2155,18 @@ Control-\e clears any selection in the widget.
.IP [20]
The F16 key (labelled Copy on many Sun workstations) or Meta-w
copies the selection in the widget to the clipboard, if there is a selection.
-.VS 8.4
This action is carried out by the command \fBtk_textCopy\fR.
-.VE 8.4
.IP [21]
The F20 key (labelled Cut on many Sun workstations) or Control-w
copies the selection in the widget to the clipboard and deletes
the selection.
-.VS 8.4
This action is carried out by the command \fBtk_textCut\fR.
-.VE 8.4
If there is no selection in the widget then these keys have no effect.
.IP [22]
The F18 key (labelled Paste on many Sun workstations) or Control-y
inserts the contents of the clipboard at the position of the
insertion cursor.
-.VS 8.4
This action is carried out by the command \fBtk_textPaste\fR.
-.VE 8.4
.IP [23]
The Delete key deletes the selection, if there is one in the widget.
If there is no selection, it deletes the character to the right of
@@ -1716,16 +2195,14 @@ 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.
+the insertion cursor.
.IP [32]
-.VS 8.4
Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is
true) undoes the last edit action if the \fB\-undo\fR option is true.
Does nothing otherwise.
.IP [33]
Control-Z (or Control-y on Windows) reapplies the last undone edit
action if the \fB\-undo\fR option is true. Does nothing otherwise.
-.VE 8.4
.PP
If the widget is disabled using the \fB\-state\fR option, then its
view can still be adjusted and text can still be selected,
@@ -1734,7 +2211,34 @@ take place.
.PP
The behavior of texts can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-.SH "PERFORMANCE ISSUES"
+.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
+.QW chars
+and
+.QW indices .
+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
+.QW "+N any chars"
+or
+.QW "\-N any chars"
+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
@@ -1766,10 +2270,64 @@ 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\fP attribute to 0 avoid this.
-
+Set the \fBinsertOffTime\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:
+.CS
+pack [text .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
+.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:
+.CS
+pack [text .t]
+\.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n"
+\.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end
+.CE
+matches at
+.QW 5.0
+when a true greedy match would match at
+.QW 1.0 .
+Similarly if we add \fB\-all\fR to this case, it matches at all of
+.QW 5.0 ,
+.QW 4.0 ,
+.QW 3.0
+and
+.QW 1.0 ,
+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
diff --git a/doc/tk.n b/doc/tk.n
index 6e807e6..377aa91 100644
--- a/doc/tk.n
+++ b/doc/tk.n
@@ -26,13 +26,17 @@ The command can take any of a number of different forms
depending on the \fIoption\fR argument. The legal forms are:
.TP
\fBtk appname \fR?\fInewName\fR?
-If \fInewName\fR isn't specified, this command returns the name
+.
+If \fInewName\fR is not specified, this command returns the name
of the application (the name that may be used in \fBsend\fR
commands to communicate with the application).
If \fInewName\fR is specified, then the name of the application
is changed to \fInewName\fR.
If the given name is already in use, then a suffix of the form
-``\fB #2\fR'' or ``\fB #3\fR'' is appended in order to make the name unique.
+.QW "\fB #2\fR"
+or
+.QW "\fB #3\fR"
+is appended in order to make the name unique.
The command's result is the name actually chosen.
\fInewName\fR should not start with a capital letter.
This will interfere with option processing, since names starting with
@@ -41,7 +45,6 @@ be able to find some options for the application.
If sends have been disabled by deleting the \fBsend\fR command,
this command will reenable them and recreate the \fBsend\fR
command.
-.VS 8.4
.TP
\fBtk caret window \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
.
@@ -54,7 +57,6 @@ the last values used for setting the caret are return in option-value pair
format. \fI\-x\fR and \fI\-y\fR represent window-relative coordinates, and
\fI\-height\fR is the height of the current cursor location, or the height
of the specified \fIwindow\fR if none is given.
-.VE
.TP
\fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
.
@@ -66,7 +68,9 @@ 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
-A ``point'' is a unit of measurement equal to 1/72 inch. A scaling factor
+A
+.QW point
+is a unit of measurement equal to 1/72 inch. A scaling factor
of 1.0 corresponds to 1 pixel per point, which is equivalent to a standard
72 dpi monitor. A scaling factor of 1.25 would mean 1.25 pixels per point,
which is the setting for a 90 dpi monitor; setting the scaling factor to
@@ -78,25 +82,41 @@ after the scaling factor is changed will use the new scaling factor, but it
is undefined whether existing widgets will resize themselves dynamically to
accommodate the new scaling factor.
.RE
-.VS 8.3
+.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)
for filtering events. The resulting state is returned. XIM is used in
-some locales (ie: Japanese, Korean), to handle special input devices. This
+some locales (i.e., Japanese, Korean), to handle special input devices. This
feature is only significant on X. If XIM support is not available, this
will always return 0. If the \fIwindow\fR argument is omitted, it defaults
to the main window. If the \fIboolean\fR argument is omitted, the current
state is returned. This is turned on by default for the main display.
-.VE
-.VS 8.4
.TP
\fBtk windowingsystem\fR
.
Returns the current Tk windowing system, one of
\fBx11\fR (X11-based), \fBwin32\fR (MS Windows),
-\fBclassic\fR (Mac OS Classic), or \fBaqua\fR (Mac OS X Aqua).
-.VE
+or \fBaqua\fR (Mac OS X Aqua).
+.SH "SEE ALSO"
+send(n), winfo(n)
.SH KEYWORDS
application name, send
diff --git a/doc/tkvars.n b/doc/tkvars.n
index da7410e..9971698 100644
--- a/doc/tkvars.n
+++ b/doc/tkvars.n
@@ -29,7 +29,7 @@ an interpreter; this is done by searching several different directories
until one is found that contains an appropriate Tk startup script.
If the \fBTK_LIBRARY\fR environment variable exists, then
the directory it names is checked first.
-If \fBTK_LIBRARY\fR isn't set or doesn't refer to an appropriate
+If \fBTK_LIBRARY\fR is not set or does not refer to an appropriate
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
diff --git a/doc/toplevel.n b/doc/toplevel.n
index c1f0081..e02eb35 100644
--- a/doc/toplevel.n
+++ b/doc/toplevel.n
@@ -72,7 +72,7 @@ This option is special in that it may not be specified via the option
database, and it may not be modified with the \fBconfigure\fR
widget command.
.OP \-use use Use
-This option is used for embedding. If the value isn't an empty string,
+This option is used for embedding. If the value is not an empty string,
it must be the window identifier of a container window, specified as
a hexadecimal string like the ones returned by the \fBwinfo id\fR
command. The toplevel widget will be created as a child of the given
diff --git a/doc/ttk_Geometry.3 b/doc/ttk_Geometry.3
new file mode 100644
index 0000000..5a0ce4f
--- /dev/null
+++ b/doc/ttk_Geometry.3
@@ -0,0 +1,223 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+.so man.macros
+.TH Geometry 3 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+Ttk_MakeBox, Ttk_PadBox, Ttk_ExpandBox, Ttk_PackBox, Ttk_StickBox, Ttk_PlaceBox, Ttk_BoxContains, Ttk_MakePadding, Ttk_UniformPadding, Ttk_AddPadding, Ttk_RelievePadding, Ttk_GetPaddingFromObj, Ttk_GetBorderFromObj, Ttk_GetStickyFromObj \- Tk themed geometry utilities
+.SH SYNOPSIS
+.nf
+\fB#include <tkTheme.h>\fR
+
+Ttk_Box
+\fBTtk_MakeBox\fR(int \fIx\fR, int \fIy\fR, int \fIwidth\fR, int \fIheight\fR);
+
+Ttk_Box
+\fBTtk_PadBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
+
+Ttk_Box
+\fBTtk_ExpandBox\fR(Ttk_Box \fIparcel\fR, Ttk_Padding \fIpadding\fR);
+
+Ttk_Box
+\fBTtk_PackBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR);
+
+Ttk_Box
+\fBTtk_StickBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, unsigned \fIsticky\fR);
+
+Ttk_Box
+\fBTtk_PlaceBox\fR(Ttk_Box *\fIcavity\fR, int \fIwidth\fR, int \fIheight\fR, Ttk_Side \fIside\fR, unsigned \fIsticky\fR);
+
+Ttk_Box
+\fBTtk_AnchorBox\fR(Ttk_Box \fIparcel\fR, int \fIwidth\fR, int \fIheight\fR, Tk_Anchor \fIanchor\fR);
+
+Ttk_Padding
+\fBTtk_MakePadding\fR(short \fIleft\fR, short \fItop\fR, short \fIright\fR, short \fIbottom\fR);
+
+Ttk_Padding
+\fBTtk_UniformPadding\fR(short \fIborder\fR);
+
+Ttk_Padding
+\fBTtk_AddPadding\fR(Ttk_Padding \fIpadding1\fR, Ttk_Padding \fIpadding2\fR;
+
+Ttk_Padding
+\fBTtk_RelievePadding\fR(Ttk_Padding \fIpadding\fR, int \fIrelief\fR);
+
+int
+\fBTtk_BoxContains\fR(Ttk_Box \fIbox\fR, int \fIx\fR, int \fIy\fR);
+
+int
+\fBTtk_GetPaddingFromObj\fR(Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
+
+int
+\fBTtk_GetBorderFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, Ttk_Padding *\fIpadding_rtn\fR);
+
+int
+\fBTtk_GetStickyFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, int *\fIsticky_rtn\fR);
+.fi
+.SH ARGUMENTS
+.AP Tk_Anchor anchor in
+One of the symbolic constants \fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR,
+etc. See \fITk_GetAnchorFromObj(3)\fR.
+.AP "Ttk_Box *" cavity in/out
+A rectangular region from which a parcel is allocated.
+.AP short border in
+Extra padding (in pixels) to add uniformly to each side of a region.
+.AP short bottom in
+Extra padding (in pixels) to add to the bottom of a region.
+.AP Ttk_Box box in
+.AP "Ttk_Box *" box_rtn out
+Specifies a rectangular region.
+.AP int height in
+The height in pixels of a region.
+.AP "Tcl_Interp *" interp in
+Used to store error messages.
+.AP int left in
+Extra padding (in pixels) to add to the left side of a region.
+.AP "Tcl_Obj *" objPtr in
+String value contains a symbolic name
+to be converted to an enumerated value or bitmask.
+Internal rep may be be modified to cache corresponding value.
+.AP Ttk_Padding padding in
+.AP "Ttk_Padding *" padding_rtn out
+Extra padding to add on the inside of a region.
+.AP Ttk_Box parcel in
+A rectangular region, allocated from a cavity.
+.AP int relief in
+One of the standard Tk relief options
+(TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.).
+See \fBTk_GetReliefFromObj\fR.
+.AP short right in
+Extra padding (in pixles) to add to the right side of a region.
+.AP Ttk_Side side in
+One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR,
+\fBTTK_SIDE_RIGHT\fR, or \fBTTK_SIDE_BOTTOM\fR.
+.AP unsigned sticky in
+A bitmask containing one or more of the bits
+\fBTTK_STICK_W\fR (west, or left),
+\fBTTK_STICK_E\fR (east, or right,
+\fBTTK_STICK_N\fR (north, or top), and
+\fBTTK_STICK_S\fR (south, or bottom).
+\fBTTK_FILL_X\fR is defined as a synonym for (TTK_STICK_W|TTK_STICK_E),
+\fBTTK_FILL_Y\fR is a synonym for (TTK_STICK_N|TTK_STICK_S),
+and \fBTTK_FILL_BOTH\fR and \fBTTK_STICK_ALL\fR
+are synonyms for (TTK_FILL_X|TTK_FILL_Y).
+See also: \fIgrid(n)\fR.
+.AP Tk_Window tkwin in
+Window whose screen geometry determines
+the conversion between absolute units and pixels.
+.AP short top in
+Extra padding at the top of a region.
+.AP int width in
+The width in pixels of a region.
+.AP int x in
+X coordinate of upper-left corner of region.
+.AP int y in
+Y coordinate of upper-left corner of region.
+.BE
+.SH "BOXES"
+.PP
+The \fBTtk_Box\fR structure represents a rectangular region of a window:
+.CS
+typedef struct {
+ int \fIx\fR;
+ int \fIy\fR;
+ int \fIwidth\fR;
+ int \fIheight\fR;
+} \fBTtk_Box\fR;
+.CE
+All coordinates are relative to the window.
+.PP
+\fBTtk_MakeBox\fR is a convenience routine that contsructs
+a \fBTtk_Box\fR structure representing a region \fIwidth\fR pixels
+wide, \fIheight\fR pixels tall, at the specified \fIx, y\fR coordinates.
+.PP
+\fBTtk_PadBox\fR returns a new box located inside the specified \fIparcel\fR,
+shrunken according to the left, top, right, and bottom margins
+specified by \fIpadding\fR.
+.PP
+\fBTtk_ExpandBox\fR is the inverse of \fBTtk_PadBox\fR:
+it returns a new box surrounding the specified \fIparcel\fR,
+expanded according to the left, top, right, and bottom margins
+specified by \fIpadding\fR.
+.PP
+\fBTtk_PackBox\fR allocates a parcel \fIwidth\fR by \fIheight\fR
+pixels wide on the specified \fIside\fR of the \fIcavity\fR,
+and shrinks the \fIcavity\fR accordingly.
+.PP
+\fBTtk_StickBox\fR places a box with the requested \fIwidth\fR
+and \fIheight\fR inside the \fIparcel\fR according to the
+\fIsticky\fR bits.
+.PP
+\fBTtk_PlaceBox\fR combines \fBTtk_PackBox\fR and \fBTtk_StickBox\fR:
+it allocates a parcel on the specified \fIside\fR of the \fIcavity\fR,
+places a box of the requested size inside the parcel according to \fIsticky\fR,
+and shrinks the \fIcavity\fR.
+.PP
+\fBTtk_AnchorBox\fR places a box with the requested \fIwidth\fR
+and \fIheight\fR inside the \fIparcel\fR according to the
+specified \fIanchor\fR option.
+.PP
+\fBTtk_BoxContains\fR tests if the specified \fIx, y\fR coordinate
+lies within the rectangular region \fIbox\fR.
+.SH "PADDDING"
+.PP
+The \fBTtk_Padding\fR structure is used to represent
+borders, internal padding, and external margins:
+.CS
+typedef struct {
+ short \fIleft\fR;
+ short \fItop\fR;
+ short \fIright\fR;
+ short \fIbottom\fR;
+} \fBTtk_Padding\fR;
+.CE
+.PP
+\fBTtk_MakePadding\fR is a convenience routine that contsructs
+a \fBTtk_Padding\fR structure with the specified left, top, right, and bottom
+components.
+.PP
+\fBTtk_UniformPadding\fR constructs a \fBTtk_Padding\fR structure
+with all components equal to the specified \fIborder\fR.
+.PP
+\fBTtk_AddPadding\fR adds two \fBTtk_Padding\fRs together
+and returns a combined padding containing the sum of the
+individual padding components.
+.PP
+\fBTtk_RelievePadding\fR
+adds an extra 2 pixels of padding to \fIpadding\fR
+according to the specified \fIrelief\fR.
+If \fIrelief\fR is \fBTK_RELIEF_SUNKEN\fR,
+adds two pixels at the top and left
+so the inner region is shifted down and to the left.
+If it is \fBTK_RELIEF_RAISED\fR, adds two pixels
+at the bottom and right so
+the inner region is shifted up and to the right.
+Otherwise, adds 1 pixel on all sides.
+This is typically used in element geometry procedures to simulate a
+.QW pressed-in
+look for pushbuttons.
+.SH "CONVERSION ROUTINES"
+.PP
+\fBTtk_GetPaddingFromObj\fR converts the string in \fIobjPtr\fR
+to a \fBTtk_Padding\fR structure.
+The string representation is a list of
+up to four length specifications
+.QW "\fIleft top right bottom\fR" .
+If fewer than four elements are specified,
+\fIbottom\fR defaults to \fItop\fR,
+\fIright\fR defaults to \fIleft\fR, and
+\fItop\fR defaults to \fIleft\fR.
+See \fBTk_GetPixelsFromObj(3)\fR for the syntax of length specifications.
+.PP
+\fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR
+except that the lengths are specified as integers
+(i.e., resolution-dependant values like \fI3m\fR are not allowed).
+.PP
+\fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR
+to a \fIsticky\fR bitmask. The string contains zero or more
+of the characters \fBn\fR, \fBs\fR, \fBe\fR, or \fBw\fR.
+.SH "SEE ALSO"
+Tk_GetReliefFromObj(3), Tk_GetPixelsFromObj(3), Tk_GetAnchorFromObj(3)
+.SH "KEYWORDS"
+geometry, padding, margins, box, region, sticky, relief
diff --git a/doc/ttk_Theme.3 b/doc/ttk_Theme.3
new file mode 100644
index 0000000..acd0e98
--- /dev/null
+++ b/doc/ttk_Theme.3
@@ -0,0 +1,32 @@
+'\"
+'\" Copyright (c) 2003 Joe English
+'\"
+'\" 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 Ttk_CreateTheme 3 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+Ttk_CreateTheme, Ttk_GetTheme, Ttk_GetDefaultTheme, Ttk_GetCurrentTheme \- create and use Tk themes.
+.SH SYNOPSIS
+.nf
+Ttk_Theme Ttk_CreateTheme(\fIinterp\fR, \fIname\fR, \fIparentTheme\fR);
+Ttk_Theme Ttk_GetTheme(\fIinterp\fR, \fIname\fR);
+Ttk_Theme Ttk_GetDefaultTheme(\fIinterp\fR);
+Ttk_Theme Ttk_GetCurrentTheme(\fIinterp\fR);
+.fi
+.SH ARGUMENTS
+.AP "Tcl_Interp *" interp in
+The Tcl interpreter in which to register/query available themes.
+.AP "Ttk_Theme" parentTheme in
+Fallback or parent theme from which the new theme will
+inherit elements and layouts.
+.AP "const char *" name in
+The name of the theme.
+.BE
+.SH DESCRIPTION
+.\" TODO - Document these functions better!
+.SH "SEE ALSO"
+Ttk_RegisterLayout, Ttk_BuildLayout
+.\" .SH KEYWORDS
diff --git a/doc/ttk_button.n b/doc/ttk_button.n
new file mode 100644
index 0000000..c6f2308
--- /dev/null
+++ b/doc/ttk_button.n
@@ -0,0 +1,81 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::button n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::button \- Widget that issues a command when pressed
+.SH SYNOPSIS
+\fBttk::button\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+A \fBttk::button\fR widget displays a textual label and/or image,
+and evaluates a command when pressed.
+.SO ttk_widget
+\-class \-compound \-cursor
+\-image \-state \-style
+\-takefocus \-text \-textvariable
+\-underline \-width
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-command command Command
+A script to evaluate when the widget is invoked.
+.OP \-default default Default
+May be set to one of \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR.
+In a dialog box, one button may be designated the
+.QW default
+button (meaning, roughly,
+.QW "the one that gets invoked when the user presses <Enter>" ).
+\fBactive\fR indicates that this is currently the default button;
+\fBnormal\fR means that it may become the default button, and
+\fBdisabled\fR means that it is not defaultable.
+The default is \fBnormal\fR.
+.RS
+.PP
+Depending on the theme, the default button may be displayed
+with an extra highlight ring, or with a different border color.
+.RE
+.OP \-width width Width
+If greater than zero, specifies how much space, in character widths,
+to allocate for the text label.
+If less than zero, specifies a minimum width.
+If zero or unspecified, the natural width of the text label is used.
+Note that some themes may specify a non-zero \fB\-width\fR
+in the style.
+.\" Not documented -- may go away
+.\" .OP \-padding padding Padding
+.\" .OP \-foreground foreground Foreground
+.\" .OP \-font font Font
+.\" .OP \-anchor anchor Anchor
+.\" .OP \-padding padding Padding
+.\" .OP \-relief relief Relief
+.SH "WIDGET COMMAND"
+.PP
+In addition to the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+commands, buttons support the following additional widget commands:
+.TP
+\fIpathName \fBinvoke\fR
+Invokes the command associated with the button.
+.SH "STANDARD STYLES"
+.PP
+\fBTtk::button\fR widgets support the \fBToolbutton\fR style in all standard
+themes, which is useful for creating widgets for toolbars.
+.SH "COMPATIBILITY OPTIONS"
+.OP \-state state State
+May be set to \fBnormal\fR or \fBdisabled\fR to control the
+\fBdisabled\fR state bit. This is a
+.QW write-only
+option: setting it changes the widget state, but the \fBstate\fR
+widget command does not affect the state option.
+.SH "SEE ALSO"
+ttk::widget(n), button(n)
+.SH "KEYWORDS"
+widget, button, default, command
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n
new file mode 100644
index 0000000..07b3205
--- /dev/null
+++ b/doc/ttk_checkbutton.n
@@ -0,0 +1,77 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::checkbutton n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::checkbutton \- On/off widget
+.SH SYNOPSIS
+\fBttk::checkbutton\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+A \fBttk::checkbutton\fR widget is used to show or change a setting.
+It has two states, selected and deselected.
+The state of the checkbutton may be linked to a Tcl variable.
+.SO ttk_widget
+\-class \-compound \-cursor
+\-image \-state \-style
+\-takefocus \-text \-textvariable
+\-underline \-width
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-command command Command
+A Tcl script to execute whenever the widget is invoked.
+.OP \-offvalue offValue OffValue
+The value to store in the associated \fB\-variable\fR
+when the widget is deselected. Defaults to \fB0\fR.
+.OP \-onvalue onValue OnValue
+The value to store in the associated \fB\-variable\fR
+when the widget is selected. Defaults to \fB1\fR.
+.OP \-variable variable Variable
+The name of a global variable whose value is linked to the widget.
+Defaults to the widget pathname if not specified.
+.SH "WIDGET COMMAND"
+.PP
+In addition to the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+commands, checkbuttons support the following additional
+widget commands:
+.TP
+\fIpathname\fB invoke\fR
+Toggles between the selected and deselected states
+and evaluates the associated \fB\-command\fR.
+If the widget is currently selected, sets the \fB\-variable\fR
+to the \fB\-offvalue\fR and deselects the widget;
+otherwise, sets the \fB\-variable\fR to the \fB\-onvalue\fR
+Returns the result of the \fB\-command\fR.
+.\" Missing: select, deselect, toggle
+.\" Are these useful? They don't invoke the -command
+.\" Missing: flash. This is definitely not useful.
+.SH "WIDGET STATES"
+.PP
+The widget does not respond to user input if the \fBdisabled\fR state is set.
+The widget sets the \fBselected\fR state whenever
+the linked \fB\-variable\fR is set to the widget's \fB\-onvalue\fR,
+and clears it otherwise.
+The widget sets the \fBalternate\fR state whenever the
+linked \fB\-variable\fR is unset.
+(The \fBalternate\fR state may be used to indicate a
+.QW tri-state
+or
+.QW indeterminate
+selection.)
+.SH "STANDARD STYLES"
+.PP
+\fBTtk::checkbutton\fR widgets support the \fBToolbutton\fR style in all
+standard themes, which is useful for creating widgets for toolbars.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::radiobutton(n), checkbutton(n)
+.SH "KEYWORDS"
+widget, button, toggle, check, option
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n
new file mode 100644
index 0000000..e01c6f6
--- /dev/null
+++ b/doc/ttk_combobox.n
@@ -0,0 +1,119 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::combobox n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::combobox \- text field with popdown selection list
+.SH SYNOPSIS
+\fBttk::combobox\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::combobox\fR combines a text field with a pop-down list of values;
+the user may select the value of the text field from among the
+values in the list.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.\" ALSO: Other entry widget options
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-exportselection exportSelection ExportSelection
+Boolean value.
+If set, the widget selection is linked to the X selection.
+.OP \-justify justify Justify
+Specifies how the text is aligned within the widget.
+Must be one of \fBleft\fR, \fBcenter\fR, or \fBright\fR.
+.OP \-height height Height
+Specifies the height of the pop-down listbox, in rows.
+.OP \-postcommand postCommand PostCommand
+A Tcl script to evaluate immediately before displaying the listbox.
+The \fB\-postcommand\fR script may specify the \fB\-values\fR to display.
+.OP \-state state State
+One of \fBnormal\fR, \fBreadonly\fR, or \fBdisabled\fR.
+In the \fBreadonly\fR state,
+the value may not be edited directly, and
+the user can only select one of the \fB\-values\fR from the
+dropdown list.
+In the \fBnormal\fR state,
+the text field is directly editable.
+In the \fBdisabled\fR state, no interaction is possible.
+.OP \-textvariable textVariable TextVariable
+Specifies the name of a global variable whose value is linked
+to the widget value.
+Whenever the variable changes value the widget value is updated,
+and vice versa.
+.OP \-values values Values
+Specifies the list of values to display in the drop-down listbox.
+.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.
+.SH "WIDGET COMMAND"
+.PP
+The following subcommands are possible for combobox widgets:
+'\".TP
+'\"\fIpathName \fBcget\fR \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 \fBcurrent\fR ?\fInewIndex\fR?
+If \fInewIndex\fR is supplied, sets the combobox value
+to the element at position \fInewIndex\fR in the list of \fB\-values\fR.
+Otherwise, returns the index of the current value in the list of
+\fB\-values\fR or \fB\-1\fR if the current value does not appear in the list.
+.TP
+\fIpathName \fBget\fR
+Returns the current value of the combobox.
+'\".TP
+'\"\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 \fIvalue\fR
+Sets the value of the combobox to \fIvalue\fR.
+'\".TP
+'\"\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+'\"Modify or query the widget state.
+'\"See \fIttk::widget(n)\fR.
+.PP
+The combobox widget also supports the following \fBttk::entry\fR
+widget subcommands (see \fIttk::entry(n)\fR for details):
+.DS
+.ta 5.5c 11c
+\fBbbox\fR \fBdelete\fR \fBicursor\fR
+\fBindex\fR \fBinsert\fR \fBselection\fR
+\fBxview\fR
+.DE
+The combobox widget also supports the following generic \fBttk::widget\fR
+widget subcommands (see \fIttk::widget(n)\fR for details):
+.DS
+.ta 5.5c 11c
+\fBcget\fR \fBconfigure\fR \fBidentify\fR
+\fBinstate\fR \fBstate\fR
+.DE
+.SH "VIRTUAL EVENTS"
+.PP
+The combobox widget generates a \fB<<ComboboxSelected>>\fR virtual event
+when the user selects an element from the list of values.
+If the selection action unposts the listbox,
+this event is delivered after the listbox is unposted.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::entry(n)
+.SH KEYWORDS
+choice, entry, list box, text box, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n
new file mode 100644
index 0000000..b42bd31
--- /dev/null
+++ b/doc/ttk_entry.n
@@ -0,0 +1,470 @@
+'\"
+'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
+'\" Copyright (c) 1998-2000 Scriptics Corporation.
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::entry n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::entry \- Editable text field widget
+.SH SYNOPSIS
+\fBttk::entry\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+An \fBttk::entry\fR widget displays a one-line text string and
+allows that string to be edited by the user.
+The value of the string may be linked to a Tcl variable
+with the \fB\-textvariable\fR option.
+Entry widgets support horizontal scrolling with the
+standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command.
+.SO ttk_widget
+\-class \-cursor \-style
+\-takefocus \-xscrollcommand
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-exportselection exportSelection ExportSelection
+A boolean value specifying whether or not
+a selection in the widget should be linked to the X selection.
+If the selection is exported, then selecting in the widget deselects
+the current X selection, selecting outside the widget deselects any
+widget selection, and the widget will respond to selection retrieval
+requests when it has a selection.
+.\" MAYBE: .OP \-font font Font
+.\" MAYBE: .OP \-foreground foreground Foreground
+.\" 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.
+See \fBVALIDATION\fR below for more information.
+.OP \-justify justify Justify
+Specifies how the text is aligned within the entry widget.
+One of \fBleft\fR, \fBcenter\fR, or \fBright\fR.
+.\" MAYBE: .OP \-selectbackground selectBackground Foreground
+.\" MAYBE: .OP \-selectborderwidth selectBorderWidth BorderWidth
+.\" MAYBE: .OP \-selectforeground selectForeground Background
+.OP \-show show Show
+If this option is specified, then the true contents of the entry
+are not displayed in the window.
+Instead, each character in the entry's value will be displayed as
+the first character in the value of this option, such as
+.QW *
+or a bullet.
+This is useful, for example, if the entry is to be used to enter
+a password.
+If characters in the entry are selected and copied elsewhere, the
+information copied will be what is displayed, not the true contents
+of the entry.
+.OP \-state state State
+Compatibility option; see \fIttk::widget(n)\fR for details.
+Specifies one of three states for the entry,
+\fBnormal\fR, \fBdisabled\fR, or \fBreadonly\fR.
+See \fBWIDGET STATES\fR, below.
+.OP \-textvariable textVariable Variable
+Specifies the name of a global variable whose value is linked
+to the entry widget's contents.
+Whenever the variable changes value, the widget's contents are updated,
+and vice versa.
+.OP \-validate validate Validate
+Specifies the mode in which validation should operate:
+\fBnone\fR, \fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
+Default is \fBnone\fR, meaning that validation is disabled.
+See \fBVALIDATION\fR below.
+.OP \-validatecommand validateCommand ValidateCommand
+A script template to evaluate whenever validation is triggered.
+If set to the empty string (the default), validation is disabled.
+The script must return a boolean value.
+See \fBVALIDATION\fR below.
+.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.
+.\" Not in ttk: If the value is less than or equal to zero, the widget picks a
+.\" Not in ttk: size just large enough to hold its current text.
+.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
+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
+input focus. When an entry has the input focus it displays an
+\fIinsert cursor\fR to indicate where new characters will be
+inserted.
+.PP
+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
+for details).
+.SH "INDICES"
+.PP
+Many of the \fBentry\fR widget commands take one or more indices as
+arguments. An index specifies a particular character in the entry's
+string, in any of the following ways:
+.IP \fInumber\fR
+Specifies the character as a numerical index, where 0 corresponds
+to the first character in the string.
+.IP \fB@\fInumber\fR
+In this form, \fInumber\fR is treated as an x-coordinate in the
+entry's window; the character spanning that x-coordinate is used.
+For example,
+.QW \fB@0\fR
+indicates the left-most character in the window.
+.IP \fBend\fR
+Indicates the character just after the last one in the entry's string.
+This is equivalent to specifying a numerical index equal to the length
+of the entry's string.
+.IP \fBinsert\fR
+Indicates the character adjacent to and immediately following the
+insert cursor.
+.IP \fBsel.first\fR
+Indicates the first character in the selection. It is an error to
+use this form if the selection is not in the entry window.
+.IP \fBsel.last\fR
+Indicates the character just after the last one in the selection.
+It is an error to use this form if the selection is not in the
+entry window.
+.LP
+Abbreviations may be used for any of the forms above, e.g.\|
+.QW \fBe\fR
+or
+.QW \fBsel.l\fR .
+In general, out-of-range indices are automatically rounded to the
+nearest legal value.
+.SH "WIDGET COMMAND"
+.PP
+The following subcommands are possible for entry widgets:
+.TP
+\fIpathName \fBbbox \fIindex\fR
+Returns a list of four numbers describing the bounding box of the
+character given by \fIindex\fR.
+The first two elements of the list give the x and y coordinates of
+the upper-left corner of the screen area covered by the character
+(in pixels relative to the widget) and the last two elements give
+the width and height of the character, in pixels.
+The bounding box may refer to a region outside the visible area
+of the window.
+'\".TP
+'\"\fIpathName \fBcget\fR \fIoption\fR
+'\"Returns the current value of the 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 \fBdelete \fIfirst \fR?\fIlast\fR?
+Delete one or more elements of the entry.
+\fIFirst\fR is the index of the first character to delete, and
+\fIlast\fR is the index of the character just after the last
+one to delete.
+If \fIlast\fR is not specified it defaults to \fIfirst\fR+1,
+i.e. a single character is deleted.
+This command returns the empty string.
+.TP
+\fIpathName \fBget\fR
+Returns the entry's string.
+.TP
+\fIpathName \fBicursor \fIindex\fR
+Arrange for the insert cursor to be displayed just before the character
+given by \fIindex\fR. Returns the empty string.
+'\".TP
+'\"\fIpathName \fBidentify \fIx y\fR
+'\"Returns the name of the element at position \fIx\fR, \fIy\fR,
+'\"or the empty string if the coordinates are outside the window.
+.TP
+\fIpathName \fBindex\fI index\fR
+Returns the numerical index corresponding to \fIindex\fR.
+.TP
+\fIpathName \fBinsert \fIindex string\fR
+Insert \fIstring\fR just before the character
+indicated by \fIindex\fR. Returns the empty string.
+'\".TP
+'\"\fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR?
+'\"Test the widget state.
+'\"See \fIttk::widget(n)\fR.
+.TP
+\fIpathName \fBselection \fIoption arg\fR
+This command is used to adjust the selection within an entry. It
+has several forms, depending on \fIoption\fR:
+.RS
+.TP
+\fIpathName \fBselection clear\fR
+Clear the selection if it is currently in this widget.
+If the selection is not in this widget then the command has no effect.
+Returns the empty string.
+.TP
+\fIpathName \fBselection present\fR
+Returns 1 if there is are characters selected in the entry,
+0 if nothing is selected.
+.TP
+\fIpathName \fBselection range \fIstart\fR \fIend\fR
+Sets the selection to include the characters starting with
+the one indexed by \fIstart\fR and ending with the one just
+before \fIend\fR.
+If \fIend\fR refers to the same character as \fIstart\fR or an
+earlier one, then the entry's selection is cleared.
+.RE
+'\".TP
+'\"\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+'\"Modify or query the widget state.
+'\"See \fIttk::widget(n)\fR.
+.TP
+\fIpathName \fBvalidate\fR
+Force revalidation, independent of the conditions specified
+by the \fB\-validate\fR option.
+Returns 0 if validation fails, 1 if it succeeds.
+Sets or clears the \fBinvalid\fR state accordingly.
+See \fBVALIDATION\fR below for more details.
+.TP
+\fIpathName \fBxview \fIargs\fR
+This command is used to query and change the horizontal position of the
+text in the widget's window. It can take any of the following
+forms:
+.RS
+.TP
+\fIpathName \fBxview\fR
+Returns a list containing two elements.
+Each element is a real fraction between 0 and 1; together they describe
+the horizontal span that is visible in the window.
+For example, if the first element is .2 and the second element is .6,
+20% of the entry's text is off-screen to the left, the middle 40% is visible
+in the window, and 40% of the text is off-screen to the right.
+These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
+option.
+.TP
+\fIpathName \fBxview\fR \fIindex\fR
+Adjusts the view in the window so that the character given by \fIindex\fR
+is displayed at the left edge of the window.
+.TP
+\fIpathName \fBxview moveto\fI fraction\fR
+Adjusts the view in the window so that the character \fIfraction\fR of the
+way through the text appears at the left edge of the window.
+\fIFraction\fR must be a fraction between 0 and 1.
+.TP
+\fIpathName \fBxview scroll \fInumber what\fR
+This command shifts the view in the window left or right according to
+\fInumber\fR and \fIwhat\fR.
+\fINumber\fR must be an integer.
+\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.
+'\" or an abbreviation of one of these, but we don't document that.
+If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
+\fInumber\fR average-width characters on the display; if it is
+\fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
+If \fInumber\fR is negative then characters farther to the left
+become visible; if it is positive then characters farther to the right
+become visible.
+.RE
+.PP
+The entry widget also supports the following generic \fBttk::widget\fR
+widget subcommands (see \fIttk::widget(n)\fR for details):
+.DS
+.ta 5.5c 11c
+\fBcget\fR \fBconfigure\fR \fBidentify\fR
+\fBinstate\fR \fBstate\fR
+.DE
+.SH VALIDATION
+.PP
+The \fB\-validate\fR, \fB\-validatecommand\fR, and \fB\-invalidcommand\fR
+options are used to enable entry widget validation.
+.SS "VALIDATION MODES"
+.PP
+There are two main validation modes: \fIprevalidation\fR,
+in which the \fB\-validatecommand\fR is evaluated prior to each edit
+and the return value is used to determine whether to accept
+or reject the change;
+and \fIrevalidation\fR, in which the \fB\-validatecommand\fR is
+evaluated to determine whether the current value is valid.
+.PP
+The \fB\-validate\fR option determines when validation occurs;
+it may be set to any of the following values:
+.RS
+.IP \fBnone\fR
+Default. This means validation will only occur when
+specifically requested by the \fBvalidate\fR widget command.
+.IP \fBkey\fR
+The entry will be prevalidated prior to each edit
+(specifically, whenever the \fBinsert\fR or \fBdelete\fR
+widget commands are called).
+If prevalidation fails, the edit is rejected.
+.IP \fBfocus\fR
+The entry is revalidated when the entry receives or loses focus.
+.IP \fBfocusin\fR
+The entry is revalidated when the entry receives focus.
+.IP \fBfocusout\fR
+The entry is revalidated when the entry loses focus.
+.IP \fBall\fR
+Validation is performed for all above conditions.
+.RE
+.PP
+The \fB\-invalidcommand\fR is evaluated whenever
+the \fB\-validatecommand\fR returns a false value.
+.PP
+The \fB\-validatecommand\fR and \fB\-invalidcommand\fR
+may modify the entry widget's value
+via the widget \fBinsert\fR or \fBdelete\fR commands,
+or by setting the linked \fB\-textvariable\fR.
+If either does so during prevalidation,
+then the edit is rejected
+regardless of the value returned by the \fB\-validatecommand\fR.
+.PP
+If \fB\-validatecommand\fR is empty (the default),
+validation always succeeds.
+.SS "VALIDATION SCRIPT SUBSTITUTIONS"
+.PP
+It is possible to perform percent substitutions on the
+\fB\-validatecommand\fR and \fB\-invalidcommand\fR,
+just as in a \fBbind\fR script.
+The following substitutions are recognized:
+.RS
+.IP \fB%d\fR
+Type of action: 1 for \fBinsert\fR prevalidation,
+0 for \fBdelete\fR prevalidation,
+or \-1 for revalidation.
+.IP \fB%i\fR
+Index of character string to be inserted/deleted, if any, otherwise \-1.
+.IP \fB%P\fR
+In prevalidation, the new value of the entry if the edit is accepted.
+In revalidation, the current value of the entry.
+.IP \fB%s\fR
+The current value of entry prior to editing.
+.IP \fB%S\fR
+The text string being inserted/deleted, if any, {} otherwise.
+.IP \fB%v\fR
+The current value of the \fB\-validate\fR option.
+.IP \fB%V\fR
+The validation condition that triggered the callback
+(\fBkey\fR, \fBfocusin\fR, \fBfocusout\fR, or \fBforced\fR).
+.IP \fB%W\fR
+The name of the entry widget.
+.RE
+.SS "DIFFERENCES FROM TK ENTRY WIDGET VALIDATION"
+.PP
+The standard Tk entry widget automatically disables validation
+(by setting \fB\-validate\fR to \fBnone\fR)
+if the \fB\-validatecommand\fR or \fB\-invalidcommand\fR modifies
+the entry's value.
+The Tk themed entry widget only disables validation if one
+of the validation scripts raises an error, or if \fB\-validatecommand\fR
+does not return a valid boolean value.
+(Thus, it is not necessary to re-enable validation after
+modifying the entry value in a validation script).
+.PP
+In addition, the standard entry widget invokes validation whenever the linked
+\fB\-textvariable\fR is modified; the Tk themed entry widget does not.
+.SH "DEFAULT BINDINGS"
+.PP
+The entry widget's default bindings enable the following behavior.
+In the descriptions below,
+.QW word
+refers to a contiguous group of letters, digits, or
+.QW _
+characters, or any single character other than these.
+.IP \0\(bu 4
+Clicking mouse button 1 positions the insert 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 down strokes out a selection between
+the insert cursor and the character under the mouse.
+.IP \0\(bu 4
+Double-clicking with mouse button 1 selects the word under the mouse
+and positions the insert cursor at the end of the word.
+Dragging after a double click strokes out a selection consisting
+of whole words.
+.IP \0\(bu 4
+Triple-clicking with mouse button 1 selects all of the text in the
+entry and positions the insert cursor at the end of the line.
+.IP \0\(bu 4
+The ends of the selection can be adjusted by dragging with mouse
+button 1 while the Shift key is down.
+If the button is double-clicked before dragging then the selection
+will be adjusted in units of whole words.
+.IP \0\(bu 4
+Clicking mouse button 1 with the Control key down will position the
+insert cursor in the entry without affecting the selection.
+.IP \0\(bu 4
+If any normal printing characters are typed in an entry, they are
+inserted at the point of the insert cursor.
+.IP \0\(bu 4
+The view in the entry 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 entry at the position of the mouse cursor.
+.IP \0\(bu 4
+If the mouse is dragged out of the entry on the left or right sides
+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 \0\(bu 4
+The Left and Right keys move the insert cursor one character to the
+left or right; they also clear any selection in the entry.
+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 insert cursor by words, and
+Control-Shift-Left and Control-Shift-Right move the insert cursor
+by words and also extend the selection.
+Control-b and Control-f behave the same as Left and Right, respectively.
+.IP \0\(bu 4
+The Home key and Control-a move the insert cursor to the
+beginning of the entry and clear any selection in the entry.
+Shift-Home moves the insert cursor to the beginning of the entry
+and extends the selection to that point.
+.IP \0\(bu 4
+The End key and Control-e move the insert cursor to the
+end of the entry and clear any selection in the entry.
+Shift-End moves the cursor to the end and extends the selection
+to that point.
+.IP \0\(bu 4
+Control-/ selects all the text in the entry.
+.IP \0\(bu 4
+Control-\e clears any selection in the entry.
+.IP \0\(bu 4
+The standard Tk <<Cut>>, <<Copy>>, <<Paste>>, and <<Clear>>
+virtual events operate on the selection in the expected manner.
+.IP \0\(bu 4
+The Delete key deletes the selection, if there is one in the entry.
+If there is no selection, it deletes the character to the right of
+the insert cursor.
+.IP \0\(bu 4
+The BackSpace key and Control-h delete the selection, if there is one
+in the entry.
+If there is no selection, it deletes the character to the left of
+the insert cursor.
+.IP \0\(bu 4
+Control-d deletes the character to the right of the insert cursor.
+.IP \0\(bu 4
+Control-k deletes all the characters to the right of the insertion
+cursor.
+.SH "WIDGET STATES"
+.PP
+In the \fBdisabled\fR state,
+the entry cannot be edited and the text cannot be selected.
+In the \fBreadonly\fR state,
+no insert cursor is displayed and
+the entry cannot be edited
+(specifically: the \fBinsert\fR and \fBdelete\fR commands have no effect).
+The \fBdisabled\fR state is the same as \fBreadonly\fR,
+and in addition text cannot be selected.
+.PP
+Note that changes to the linked \fB\-textvariable\fR will
+still be reflected in the entry, even if it is disabled or readonly.
+.PP
+Typically, the text is
+.QW grayed-out
+in the \fBdisabled\fR state,
+and a different background is used in the \fBreadonly\fR state.
+.PP
+The entry widget sets the \fBinvalid\fR state if revalidation fails,
+and clears it whenever validation succeeds.
+.SH "SEE ALSO"
+ttk::widget(n), entry(n)
+.SH KEYWORDS
+entry, widget, text field
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n
new file mode 100644
index 0000000..9dcf2dc
--- /dev/null
+++ b/doc/ttk_frame.n
@@ -0,0 +1,56 @@
+'\"
+'\" Copyright (c) 2005 Joe English
+'\"
+'\" 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 ttk::frame n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::frame \- Simple container widget
+.SH SYNOPSIS
+\fBttk::frame\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::frame\fR widget is a container, used to group other widgets
+together.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-borderwidth borderWidth BorderWidth
+The desired width of the widget border. Defaults to 0.
+.OP \-relief relief Relief
+One of the standard Tk border styles:
+\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR,
+\fBsolid\fR, or \fBsunken\fR.
+Defaults to \fBflat\fR.
+.OP \-padding padding Padding
+Additional padding to include inside the border.
+.OP \-width width Width
+If specified, the widget's requested width in pixels.
+.OP \-height height Height
+If specified, the widget's requested height in pixels.
+.SH "WIDGET COMMAND"
+.PP
+Supports the standard widget commands
+\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
+see \fIttk::widget(n)\fR.
+.SH "NOTES"
+.PP
+Note that if the \fBpack\fR, \fBgrid\fR, or other geometry managers
+are used to manage the children of the \fBframe\fR,
+by the GM's requested size will normally take precedence
+over the \fBframe\fR widget's \fB\-width\fR and \fB\-height\fR options.
+\fBpack propagate\fR and \fBgrid propagate\fR can be used
+to change this.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::labelframe(n), frame(n)
+.SH "KEYWORDS"
+widget, frame, container
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_image.n b/doc/ttk_image.n
new file mode 100644
index 0000000..3d8b13c
--- /dev/null
+++ b/doc/ttk_image.n
@@ -0,0 +1,82 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk_image n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk_image \- Define an element based on an image
+.SH SYNOPSIS
+\fBttk::style element create \fIname\fR \fBimage\fR \fIimageSpec\fR ?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+The \fIimage\fR element factory creates a new element
+in the current theme whose visual appearance is determined
+by Tk images.
+\fIimageSpec\fP is a list of one or more elements.
+The first element is the default image name.
+The rest of the list is a sequence of \fIstatespec / value\fR
+pairs specifying other images to use when the element is
+in a particular state or combination of states.
+.SH OPTIONS
+.PP
+Valid \fIoptions\fR are:
+.TP
+\fB\-border\fR \fIpadding\fR
+\fIpadding\fR is a list of up to four integers, specifying
+the left, top, right, and bottom borders, respectively.
+See \fBIMAGE STRETCHING\fR, below.
+.TP
+\fB\-height \fIheight\fR
+Specifies a minimum height for the element.
+If less than zero, the base image's height is used as a default.
+.TP
+\fB\-padding\fR \fIpadding\fR
+Specifies the element's interior padding. Defaults to
+\fB\-border\fR if not specified.
+.TP
+\fB\-sticky\fR \fIspec\fR
+Specifies how the image is placed within the final parcel.
+\fIspec\fR contains zero or more characters
+.QW n ,
+.QW s ,
+.QW w ,
+or
+.QW e .
+.TP
+\fB\-width \fIwidth\fR
+Specifies a minimum width for the element.
+If less than zero, the base image's width is used as a default.
+.SH "IMAGE STRETCHING"
+.PP
+If the element's allocated parcel is larger than the image,
+the image will be placed in the parcel based on the \fB\-sticky\fR option.
+If the image needs to stretch horizontally (i.e., \fB\-sticky ew\fR)
+or vertically (\fB\-sticky ns\fR),
+subregions of the image are replicated to fill the parcel
+based on the \fB\-border\fR option.
+The \fB\-border\fR divides the image into 9 regions:
+four fixed corners, top and left edges (which may be tiled horizontally),
+left and right edges (which may be tiled vertically),
+and the central area (which may be tiled in both directions).
+.SH "EXAMPLE"
+.PP
+.CS
+set img1 [image create photo \-file button.png]
+set img2 [image create photo \-file button-pressed.png]
+set img3 [image create photo \-file button-active.png]
+style element create Button.button image \e
+ [list $img1 pressed $img2 active $img3] \e
+ \-border {2 4} \-sticky we
+.CE
+.SH "SEE ALSO"
+ttk::intro(n), ttk::style(n), ttk_vsapi(n), image(n), photo(n)
+.SH KEYWORDS
+style, theme, appearance, pixmap theme, image
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_intro.n b/doc/ttk_intro.n
new file mode 100644
index 0000000..cb0c440
--- /dev/null
+++ b/doc/ttk_intro.n
@@ -0,0 +1,177 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::intro n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::intro \- Introduction to the Tk theme engine
+.BE
+.SH "OVERVIEW"
+.PP
+The Tk themed widget set is based on a revised and enhanced version
+of TIP #48 (http://tip.tcl.tk/48) specified style engine.
+The main concepts are described below.
+The basic idea is to separate, to the extent possible,
+the code implementing a widget's behavior from
+the code implementing its appearance.
+Widget class bindings are primarily responsible for
+maintaining the widget state and invoking callbacks;
+all aspects of the widget's appearance are controlled by the style of
+the widget (i.e. the style of the elements of the widget).
+.SH "THEMES"
+.PP
+A \fItheme\fR is a collection of elements and styles
+that determine the look and feel of the widget set.
+Themes can be used to:
+.IP \(bu
+isolate platform differences (X11 vs. classic Windows vs. XP vs. Aqua ...)
+.IP \(bu
+adapt to display limitations (low-color, grayscale, monochrome, tiny screens)
+.IP \(bu
+accessibility (high contrast, large type)
+.IP \(bu
+application suite branding
+.IP \(bu
+blend in with the rest of the desktop (Gnome, KDE, Java)
+.IP \(bu
+and, of course: eye candy.
+.SH "ELEMENTS"
+.PP
+An \fIelement\fR displays an individual part of a widget.
+For example, a vertical scrollbar widget contains \fBuparrow\fR,
+\fBdownarrow\fR, \fBtrough\fR and \fBslider\fR elements.
+.PP
+Element names use a recursive dotted notation.
+For example, \fBuparrow\fR identifies a generic arrow element,
+and \fBScrollbar.uparrow\fR and \fBCombobox.uparrow\fR identify
+widget-specific elements.
+When looking for an element, the style engine looks for
+the specific name first, and if an element of that name is
+not found it looks for generic elements by stripping off
+successive leading components of the element name.
+.PP
+Like widgets, elements have \fIoptions\fR which
+specify what to display and how to display it.
+For example, the \fBtext\fR element
+(which displays a text string) has
+\fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR,
+\fB\-underline\fR, and \fB\-width\fR options.
+The value of an element option is taken from:
+.IP \(bu
+an option of the same name and type in the widget containing the element;
+.IP \(bu
+a dynamic setting specified by \fBstyle map\fR and the current state;
+.IP \(bu
+the default setting specified by \fBstyle configure\fR; or
+.IP \(bu
+the element's built-in default value for the option.
+.SH "LAYOUTS"
+.PP
+A \fIlayout\fR specifies which elements make up a widget
+and how they are arranged.
+The layout engine uses a simplified version of the \fBpack\fR
+algorithm: starting with an initial cavity equal to the size
+of the widget, elements are allocated a parcel within the cavity along
+the side specified by the \fB\-side\fR option,
+and placed within the parcel according to the \fB\-sticky\fR
+option.
+For example, the layout for a horizontal scrollbar is:
+.PP
+.CS
+ttk::\fBstyle layout\fR Horizontal.TScrollbar {
+ Scrollbar.trough \-children {
+ Scrollbar.leftarrow \-side left \-sticky w
+ Scrollbar.rightarrow \-side right \-sticky e
+ Scrollbar.thumb \-side left \-expand true \-sticky ew
+ }
+}
+.CE
+.PP
+By default, the layout for a widget is the same as its class name.
+Some widgets may override this (for example, the \fBttk::scrollbar\fR
+widget chooses different layouts based on the \fB\-orient\fR option).
+.SH "STATES"
+.PP
+In standard Tk, many widgets have a \fB\-state\fR option
+which (in most cases) is either \fBnormal\fR or \fBdisabled\fR.
+Some widgets support additional states, such
+as the \fBentry\fR widget which has a \fBreadonly\fR state
+and the various flavors of buttons which have \fBactive\fR state.
+.PP
+The themed Tk widgets generalizes this idea:
+every widget has a bitmap of independent state flags.
+Widget state flags include \fBactive\fR, \fBdisabled\fR,
+\fBpressed\fR, \fBfocus\fR, etc.,
+(see \fIttk::widget(n)\fR for the full list of state flags).
+.PP
+Instead of a \fB\-state\fR option, every widget now has
+a \fBstate\fR widget command which is used to set or query
+the state.
+A \fIstate specification\fR is a list of symbolic state names
+indicating which bits are set, each optionally prefixed with an
+exclamation point indicating that the bit is cleared instead.
+.PP
+For example, the class bindings for the \fBttk::button\fR
+widget are:
+.PP
+.CS
+bind TButton <Enter> { %W state active }
+bind TButton <Leave> { %W state !active }
+bind TButton <ButtonPress-1> { %W state pressed }
+bind TButton <Button1-Leave> { %W state !pressed }
+bind TButton <Button1-Enter> { %W state pressed }
+bind TButton <ButtonRelease-1> \e
+ { %W instate {pressed} { %W state !pressed ; %W invoke } }
+.CE
+.PP
+This specifies that the widget becomes \fBactive\fR when
+the pointer enters the widget, and inactive when it leaves.
+Similarly it becomes \fBpressed\fR when the mouse button is pressed,
+and \fB!pressed\fR on the ButtonRelease event.
+In addition, the button unpresses if
+pointer is dragged outside the widget while Button-1 is held down,
+and represses if it's dragged back in.
+Finally, when the mouse button is released, the widget's
+\fB\-command\fR is invoked, but only if the button is currently
+in the \fBpressed\fR state.
+(The actual bindings are a little more complicated than the above,
+but not by much).
+'\" Note to self: rewrite that paragraph. It's horrible.
+.SH "STYLES"
+.PP
+Each widget is associated with a \fIstyle\fR,
+which specifies values for element options.
+Style names use a recursive dotted notation like layouts and elements;
+by default, widgets use the class name to look up a style in the current theme.
+For example:
+.PP
+.CS
+ttk::\fBstyle configure\fR TButton \e
+ \-background #d9d9d9 \e
+ \-foreground black \e
+ \-relief raised \e
+ ;
+.CE
+.PP
+Many elements are displayed differently depending on the widget state.
+For example, buttons have a different background when they are active,
+a different foreground when disabled, and a different relief when pressed.
+The \fBstyle map\fR command specifies dynamic option settings
+for a particular style:
+.PP
+.CS
+ttk::\fBstyle map\fR TButton \e
+ \-background [list disabled #d9d9d9 active #ececec] \e
+ \-foreground [list disabled #a3a3a3] \e
+ \-relief [list {pressed !disabled} sunken] \e
+ ;
+.CE
+.SH "SEE ALSO"
+ttk::widget(n), ttk::style(n)
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_label.n b/doc/ttk_label.n
new file mode 100644
index 0000000..66dafeb
--- /dev/null
+++ b/doc/ttk_label.n
@@ -0,0 +1,78 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::label n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::label \- Display a text string and/or image
+.SH SYNOPSIS
+\fBttk::label\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::label\fR widget displays a textual label and/or image.
+The label may be linked to a Tcl variable
+to automatically change the displayed text.
+.SO ttk_widget
+\-class \-compound \-cursor
+\-image \-style \-takefocus
+\-text \-textvariable \-underline
+\-width
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-anchor anchor Anchor
+Specifies how the information in the widget is positioned
+relative to the inner margins. Legal values are
+\fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR,
+\fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, and \fBcenter\fR.
+See also \fB\-justify\fR.
+.OP \-background frameColor FrameColor
+The widget's background color.
+If unspecified, the theme default is used.
+.OP \-font font Font
+Font to use for label text.
+.OP \-foreground textColor TextColor
+The widget's foreground color.
+If unspecified, the theme default is used.
+.OP \-justify justify Justify
+If there are multiple lines of text, specifies how
+the lines are laid out relative to one another.
+One of \fBleft\fR, \fBcenter\fR, or \fBright\fR.
+See also \fB\-anchor\fR.
+.OP \-padding padding Padding
+Specifies the amount of extra space to allocate for the widget.
+The padding is a list of up to four length specifications
+\fIleft top right bottom\fR.
+If fewer than four elements are specified,
+\fIbottom\fR defaults to \fItop\fR,
+\fIright\fR defaults to \fIleft\fR, and
+\fItop\fR defaults to \fIleft\fR.
+.OP \-relief relief Relief
+.\" Rewrite this:
+Specifies the 3-D effect desired for the widget border.
+Valid values are
+\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR,
+and \fBsunken\fR.
+.OP \-text text Text
+Specifies a text string to be displayed inside the widget
+(unless overridden by \fB\-textvariable\fR).
+.OP \-wraplength wrapLength WrapLength
+Specifies the maximum line length (in pixels).
+If this option is less than or equal to zero,
+then automatic wrapping is not performed; otherwise
+the text is split into lines such that no line is longer
+than the specified value.
+.SH "WIDGET COMMAND"
+.PP
+Supports the standard widget commands
+\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
+see \fIttk::widget(n)\fR.
+.SH "SEE ALSO"
+ttk::widget(n), label(n)
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n
new file mode 100644
index 0000000..e782f87
--- /dev/null
+++ b/doc/ttk_labelframe.n
@@ -0,0 +1,76 @@
+'\"
+'\" Copyright (c) 2005 Joe English
+'\"
+'\" 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 ttk::labelframe n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::labelframe \- Container widget with optional label
+.SH SYNOPSIS
+\fBttk::labelframe\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::labelframe\fR widget is a container used to group other widgets
+together. It has an optional label, which may be a plain text string or
+another widget.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.\" XXX: Currently included, but may go away:
+.\" XXX: .OP -borderwidth borderWidth BorderWidth
+.\" XXX: The desired width of the widget border. Default is theme-dependent.
+.\" XXX: .OP -relief relief Relief
+.\" XXX: One of the standard Tk border styles:
+.\" XXX: \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR,
+.\" XXX: \fBsolid\fR, or \fBsunken\fR.
+.\" XXX: Default is theme-dependent.
+.OP \-labelanchor labelAnchor LabelAnchor
+Specifies where to place the label.
+Allowed values are (clockwise from the top upper left corner):
+\fBnw\fR, \fBn\fR, \fBne\fR, \fBen\fR, \fBe\fR, \fBes\fR,
+\fBse\fR, \fBs\fR,\fBsw\fR, \fBws\fR, \fBw\fR and \fBwn\fR.
+The default value is theme-dependent.
+.\" Alternate explanation: The first character must be one of n, s, e, or w
+.\" and specifies which side the label should be placed on;
+.\" the remaining characters specify how the label is aligned on that side.
+.\" NOTE: Now allows other values as well; leave this undocumented for now
+.OP \-text text Text
+Specifies the text of the label.
+.OP \-underline underline Underline
+If set, specifies the integer index (0-based) of a character to
+underline in the text string.
+The underlined character is used for mnemonic activation.
+Mnemonic activation for a \fBttk::labelframe\fR
+sets the keyboard focus to the first child of the \fBttk::labelframe\fR widget.
+.OP \-padding padding Padding
+Additional padding to include inside the border.
+.OP \-labelwidget labelWidget LabelWidget
+The name of a widget to use for the label.
+If set, overrides the \fB\-text\fR option.
+The \fB\-labelwidget\fR must be a child of the \fBlabelframe\fR widget
+or one of the \fBlabelframe\fR's ancestors, and must belong to the
+same top-level widget as the \fBlabelframe\fR.
+.OP \-width width Width
+If specified, the widget's requested width in pixels.
+.OP \-height height Height
+If specified, the widget's requested height in pixels.
+(See \fIttk::frame(n)\fR for further notes on \fB\-width\fR and
+\fB\-height\fR).
+.SH "WIDGET COMMAND"
+.PP
+Supports the standard widget commands
+\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
+see \fIttk::widget(n)\fR.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::frame(n), labelframe(n)
+.SH "KEYWORDS"
+widget, frame, container, label, groupbox
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n
new file mode 100644
index 0000000..99b7c4d
--- /dev/null
+++ b/doc/ttk_menubutton.n
@@ -0,0 +1,54 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::menubutton n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::menubutton \- Widget that pops down a menu when pressed
+.SH SYNOPSIS
+\fBttk::menubutton\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::menubutton\fR widget displays a textual label and/or image,
+and displays a menu when pressed.
+.SO ttk_widget
+\-class \-compound \-cursor
+\-image \-state \-style
+\-takefocus \-text \-textvariable
+\-underline \-width
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-direction direction Direction
+Specifies where the menu is to be popped up relative
+to the menubutton.
+One of: \fBabove\fR, \fBbelow\fR, \fBleft\fR, \fBright\fR,
+or \fBflush\fR. The default is \fBbelow\fR.
+\fBflush\fR pops the menu up directly over the menubutton.
+.OP \-menu menu Menu
+Specifies the path name of the menu associated with the menubutton.
+To be on the safe side, the menu ought to be a direct child of the
+menubutton.
+.\" not documented: may go away:
+.\" .OP \-anchor anchor Anchor
+.\" .OP \-padding padding Pad
+.SH "WIDGET COMMAND"
+.PP
+Menubutton widgets support the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+methods. No other widget methods are used.
+.SH "STANDARD STYLES"
+.PP
+\fBTtk::menubutton\fR widgets support the \fBToolbutton\fR style in all
+standard themes, which is useful for creating widgets for toolbars.
+.SH "SEE ALSO"
+ttk::widget(n), menu(n), menubutton(n)
+.SH "KEYWORDS"
+widget, button, menu
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n
new file mode 100644
index 0000000..d6c33d3
--- /dev/null
+++ b/doc/ttk_notebook.n
@@ -0,0 +1,213 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::notebook n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::notebook \- Multi-paned container widget
+.SH SYNOPSIS
+.nf
+\fBttk::notebook\fR \fIpathname \fR?\fIoptions...\fR?
+.br
+\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR?
+\fIpathname \fBinsert\fR \fIindex\fR \fIwindow\fR ?\fIoptions...\fR?
+.fi
+.BE
+.SH DESCRIPTION
+A \fBttk::notebook\fR widget manages a collection of windows
+and displays a single one at a time.
+Each slave window is associated with a \fItab\fR,
+which the user may select to change the currently-displayed window.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-height height Height
+If present and greater than zero,
+specifies the desired height of the pane area
+(not including internal padding or tabs).
+Otherwise, the maximum height of all panes is used.
+.OP \-padding padding Padding
+Specifies the amount of extra space to add around the outside
+of the notebook.
+The padding is a list of up to four length specifications
+\fIleft top right bottom\fR.
+If fewer than four elements are specified,
+\fIbottom\fR defaults to \fItop\fR,
+\fIright\fR defaults to \fIleft\fR, and
+\fItop\fR defaults to \fIleft\fR.
+.OP \-width width Width
+If present and greater than zero,
+specifies the desired width of the pane area
+(not including internal padding).
+Otherwise, the maximum width of all panes is used.
+.SH "TAB OPTIONS"
+The following options may be specified for individual notebook panes:
+.OP \-state state State
+Either \fBnormal\fR, \fBdisabled\fR or \fBhidden\fR.
+If \fBdisabled\fR, then the tab is not selectable.
+If \fBhidden\fR, then the tab is not shown.
+.OP \-sticky sticky Sticky
+Specifies how the slave window is positioned within the pane area.
+Value is a string containing zero or more of the characters
+\fBn, s, e,\fR or \fBw\fR.
+Each letter refers to a side (north, south, east, or west)
+that the slave window will
+.QW stick
+to, as per the \fBgrid\fR geometry manager.
+.OP \-padding padding Padding
+Specifies the amount of extra space to add between the notebook and this pane.
+Syntax is the same as for the widget \fB\-padding\fR option.
+.OP \-text text Text
+Specifies a string to be displayed in the tab.
+.OP \-image image Image
+Specifies an image to display in the tab.
+See \fIttk_widget(n)\fR for details.
+.OP \-compound compound Compound
+Specifies how to display the image relative to the text,
+in the case both \fB\-text\fR and \fB\-image\fR are present.
+See \fIlabel(n)\fR for legal values.
+.OP \-underline underline Underline
+Specifies the integer index (0-based) of a character to underline
+in the text string.
+The underlined character is used for mnemonic activation
+if \fBttk::notebook::enableTraversal\fR is called.
+.SH "TAB IDENTIFIERS"
+The \fItabid\fR argument to the following commands may take
+any of the following forms:
+.IP \(bu
+An integer between zero and the number of tabs;
+.IP \(bu
+The name of a slave window;
+.IP \(bu
+A positional specification of the form
+.QW @\fIx\fR,\fIy\fR ,
+which identifies the tab
+.IP \(bu
+The literal string
+.QW \fBcurrent\fR ,
+which identifies the currently-selected tab; or:
+.IP \(bu
+The literal string
+.QW \fBend\fR ,
+which returns the number of tabs
+(only valid for
+.QW "\fIpathname \fBindex\fR" ).
+.SH "WIDGET COMMAND"
+.TP
+\fIpathname \fBadd\fR \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,
+it is restored to its previous position.
+.TP
+\fIpathname \fBconfigure\fR ?\fIoptions\fR?
+See \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBcget\fR \fIoption\fR
+See \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBforget\fR \fItabid\fR
+Removes the tab specified by \fItabid\fR,
+unmaps and unmanages the associated window.
+.TP
+\fIpathname \fBhide\fR \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
+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
+Returns the name of the element at the specified location.
+.TP
+\fIpathname \fBidentify\fR \fBtab\fR \fIx\fR \fIy\fR
+Returns the index of the tab at the specified location.
+.RE
+.TP
+\fIpathname \fBindex\fR \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
+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.
+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?
+See \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBselect\fR ?\fItabid\fR?
+Selects the specified tab.
+The associated slave window will be displayed,
+and the previously-selected window (if different) is unmapped.
+If \fItabid\fR is omitted, returns the widget name of the
+currently selected pane.
+.TP
+\fIpathname \fBstate\fR ?\fIstatespec\fR?
+See \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBtab\fR \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.
+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.
+See \fBTAB OPTIONS\fR for the available options.
+.TP
+\fIpathname \fBtabs\fR
+Returns the list of windows managed by the notebook.
+.SH "KEYBOARD TRAVERSAL"
+To enable keyboard traversal for a toplevel window
+containing a notebook widget \fI$nb\fR, call:
+.CS
+ttk::notebook::enableTraversal $nb
+.CE
+.PP
+This will extend the bindings for the toplevel window
+containing the notebook as follows:
+.IP \(bu
+\fBControl-Tab\fR selects the tab following the currently selected one.
+.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
+of any tab, will select that tab.
+.PP
+Multiple notebooks in a single toplevel may be enabled for traversal,
+including nested notebooks.
+However, notebook traversal only works properly if all panes
+are direct children of the notebook.
+.SH "VIRTUAL EVENTS"
+The notebook widget generates a \fB<<NotebookTabChanged>>\fR
+virtual event after a new tab is selected.
+.SH "EXAMPLE"
+.CS
+pack [\fBttk::notebook\fR .nb]
+\.nb add [frame .nb.f1] \-text "First tab"
+\.nb add [frame .nb.f2] \-text "Second tab"
+\.nb select .nb.f2
+ttk::notebook::enableTraversal .nb
+.CE
+.SH "SEE ALSO"
+ttk::widget(n), grid(n)
+.SH "KEYWORDS"
+pane, tab
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n
new file mode 100644
index 0000000..c5851c3
--- /dev/null
+++ b/doc/ttk_panedwindow.n
@@ -0,0 +1,112 @@
+'\"
+'\" Copyright (c) 2005 Joe English
+'\"
+'\" 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 ttk::panedwindow n 8.5.9 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::panedwindow \- Multi-pane container window
+.SH SYNOPSIS
+.nf
+\fBttk::panedwindow\fR \fIpathname \fR?\fIoptions\fR?
+.br
+\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR?
+\fIpathname \fBinsert\fR \fIindex\fR \fIwindow\fR ?\fIoptions...\fR?
+.fi
+.BE
+.SH DESCRIPTION
+A \fBttk::panedwindow\fR widget displays a number of subwindows,
+stacked either vertically or horizontally.
+The user may adjust the relative sizes of the subwindows
+by dragging the sash between panes.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-orient orient Orient
+Specifies the orientation of the window.
+If \fBvertical\fR, subpanes are stacked top-to-bottom;
+if \fBhorizontal\fR, subpanes are stacked left-to-right.
+.OP \-width width Width
+If present and greater than zero,
+specifies the desired width of the widget in pixels.
+Otherwise, the requested width is determined by the width
+of the managed windows.
+.OP \-height height Height
+If present and greater than zero,
+specifies the desired height of the widget in pixels.
+Otherwise, the requested height is determined by the height
+of the managed windows.
+.SH "PANE OPTIONS"
+The following options may be specified for each pane:
+.OP \-weight weight Weight
+An integer specifying the relative stretchability of the pane.
+When the paned window is resized, the extra space is added
+or subtracted to each pane proportionally to its \fB\-weight\fR.
+.SH "WIDGET COMMAND"
+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
+Adds a new pane to the window.
+See \fBPANE OPTIONS\fR for the list of available options.
+.TP
+\fIpathname\fR \fBforget\fR \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
+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
+Returns the name of the element at the specified location.
+.TP
+\fIpathname\fR \fBidentify\fR \fBsash\fR \fIx\fR \fIy\fR
+Returns the index of the sash at the specified location.
+.RE
+.TP
+\fIpathname\fR \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\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.
+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
+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
+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
+Returns the list of all windows managed by the widget.
+.TP
+\fIpathname\fR \fBsashpos\fR \fIindex\fR ?\fInewpos\fR?
+If \fInewpos\fR is specified, sets the position
+of sash number \fIindex\fR.
+May adjust the positions of adjacent sashes
+to ensure that positions are monotonically increasing.
+Sash positions are further constrained to be between 0
+and the total size of the widget.
+.\" Full story: "total size" is either the -height (resp -width),
+.\" or the actual window height (resp actual window width),
+.\" depending on which changed most recently.
+Returns the new position of sash number \fIindex\fR.
+.\" Full story: new position may be different than the requested position.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::notebook(n), panedwindow(n)
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n
new file mode 100644
index 0000000..9381c61
--- /dev/null
+++ b/doc/ttk_progressbar.n
@@ -0,0 +1,93 @@
+'\"
+'\" Copyright (c) 2005 Joe English
+'\"
+'\" 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 ttk::progressbar n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::progressbar \- Provide progress feedback
+.SH SYNOPSIS
+\fBttk::progressbar\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::progressbar\fR widget shows the status of a long-running
+operation. They can operate in two modes: \fIdeterminate\fR mode shows the
+amount completed relative to the total amount of work to be done, and
+\fIindeterminate\fR mode provides an animated display to let the user know
+that something is happening.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-orient orient Orient
+One of \fBhorizontal\fR or \fBvertical\fR.
+Specifies the orientation of the progress bar.
+.OP \-length length Length
+Specifies the length of the long axis of the progress bar
+(width if horizontal, height if vertical).
+.OP \-mode mode Mode
+One of \fBdeterminate\fR or \fBindeterminate\fR.
+.OP \-maximum maximum Maximum
+A floating point number specifying the maximum \fB\-value\fR.
+Defaults to 100.
+.OP \-value value Value
+The current value of the progress bar.
+In \fIdeterminate\fR mode, this represents the amount of work completed.
+In \fIindeterminate\fR mode, it is interpreted modulo \fB\-maximum\fR;
+that is, the progress bar completes one
+.QW cycle
+when the \fB\-value\fR increases by \fB\-maximum\fR.
+.OP \-variable variable Variable
+The name of a global Tcl variable which is linked to the \fB\-value\fR.
+If specified, the \fB\-value\fR of the progress bar is
+automatically set to the value of the variable whenever
+the latter is modified.
+.OP \-phase phase Phase
+Read-only option.
+The widget periodically increments the value of this option
+whenever the \fB\-value\fR is greater than 0 and,
+in \fIdeterminate\fR mode, less than \fB\-maximum\fR.
+This option may be used by the current theme
+to provide additional animation effects.
+.SH "WIDGET COMMAND"
+.PP
+.TP
+\fIpathName \fBcget\fR \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
+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 \fBstart\fR ?\fIinterval\fR?
+Begin autoincrement mode:
+schedules a recurring timer event that calls \fBstep\fR
+every \fIinterval\fR milliseconds.
+If omitted, \fIinterval\fR defaults to 50 milliseconds (20 steps/second).
+.TP
+\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+Modify or query the widget state; see \fIttk::widget(n)\fR.
+.TP
+\fIpathName \fBstep\fR ?\fIamount\fR?
+Increments the \fB\-value\fR by \fIamount\fR.
+\fIamount\fR defaults to 1.0 if omitted.
+.TP
+\fIpathName \fBstop\fR
+Stop autoincrement mode:
+cancels any recurring timer event initiated by \fIpathName \fBstart\fR.
+.SH "SEE ALSO"
+ttk::widget(n)
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n
new file mode 100644
index 0000000..cbea359
--- /dev/null
+++ b/doc/ttk_radiobutton.n
@@ -0,0 +1,74 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::radiobutton n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::radiobutton \- Mutually exclusive option widget
+.SH SYNOPSIS
+\fBttk::radiobutton\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+\fBttk::radiobutton\fR widgets are used in groups to show or change
+a set of mutually-exclusive options.
+Radiobuttons are linked to a Tcl variable,
+and have an associated value; when a radiobutton is clicked,
+it sets the variable to its associated value.
+.SO ttk_widget
+\-class \-compound \-cursor
+\-image \-state \-style
+\-takefocus \-text \-textvariable
+\-underline \-width
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.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
+when the widget is selected.
+.OP \-variable variable Variable
+The name of a global variable whose value is linked to the widget.
+Default value is \fB::selectedButton\fR.
+.SH "WIDGET COMMAND"
+.PP
+In addition to the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+commands, radiobuttons support the following additional
+widget commands:
+.TP
+\fIpathname\fB invoke\fR
+Sets the \fB\-variable\fR to the \fB\-value\fR, selects the widget,
+and evaluates the associated \fB\-command\fR.
+Returns the result of the \fB\-command\fR, or the empty
+string if no \fB\-command\fR is specified.
+.\" Missing: select, deselect. Useful?
+.\" Missing: flash. This is definitely not useful.
+.SH "WIDGET STATES"
+.PP
+The widget does not respond to user input if the \fBdisabled\fR state is set.
+The widget sets the \fBselected\fR state whenever
+the linked \fB\-variable\fR is set to the widget's \fB\-value\fR,
+and clears it otherwise.
+The widget sets the \fBalternate\fR state whenever the
+linked \fB\-variable\fR is unset.
+(The \fBalternate\fR state may be used to indicate a
+.QW tri-state
+or
+.QW indeterminate
+selection.)
+.SH "STANDARD STYLES"
+.PP
+\fBTtk::radiobutton\fR widgets support the \fBToolbutton\fR style in all
+standard themes, which is useful for creating widgets for toolbars.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::checkbutton(n), radiobutton(n)
+.SH "KEYWORDS"
+widget, button, option
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n
new file mode 100644
index 0000000..2fd485b
--- /dev/null
+++ b/doc/ttk_scale.n
@@ -0,0 +1,101 @@
+.\"
+.\" Copyright (c) 2008 Donal 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 ttk::scale n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::scale \- Create and manipulate a scale widget
+.SH SYNOPSIS
+\fBttk::scale \fIpathName \fR?\fIoptions...\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::scale\fR widget is typically used to control the numeric value of a
+linked variable that varies uniformly over some range. A scale displays a
+\fIslider\fR that can be moved along over a \fItrough\fR, with the relative
+position of the slider over the trough indicating the value of the variable.
+.SO ttk_widget
+\-class \-cursor \-style
+\-takefocus
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-command command Command
+Specifies the prefix of a Tcl command to invoke whenever the scale's value is
+changed via a widget command. The actual command consists of this option
+followed by a space and a real number indicating the new value of the scale.
+.OP \-from from From
+A real value corresponding to the left or top end of the scale.
+.OP \-length length Length
+Specifies the desired long dimension of the scale in screen units (i.e. any of
+the forms acceptable to \fBTk_GetPixels\fR). For vertical scales this is the
+scale's height; for horizontal scales it is the scale's width.
+.OP \-orient orient Orient
+Specifies which orientation whether the widget should be laid out horizontally
+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.
+.OP \-value value Value
+Specifies the current floating-point value of the variable.
+.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 value.
+Whenever the scale is manipulated interactively, the variable will be modified
+to reflect the scale's new value.
+.SH "WIDGET COMMAND"
+.PP
+.TP
+\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 \fBget \fR?\fIx y\fR?
+.
+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
+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 \fIvalue\fR
+.
+Set the value of the widget (i.e. the \fB\-value\fR option) to \fIvalue\fR.
+The value will be clipped to the range given by the \fB\-from\fR and
+\fB\-to\fR options. Note that setting the linked variable (i.e. the variable
+named in the \fB\-variable\fR option) does not cause such clipping.
+.TP
+\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+.
+Modify or query the widget state; see \fIttk::widget(n)\fR.
+.SH "INTERNAL COMMANDS"
+.PP
+.TP
+\fIpathName \fBcoords \fR?\fIvalue\fR?
+.
+Get the coordinates corresponding to \fIvalue\fR, or the coordinates
+corresponding to the current value of the \fB\-value\fR option if \fIvalue\fR
+is omitted.
+.SH "SEE ALSO"
+ttk::widget(n), scale(n)
+.SH KEYWORDS
+scale, slider, trough, widget
+.\" Local Variables:
+.\" mode: nroff
+.\" fill-column: 78
+.\" End:
diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n
new file mode 100644
index 0000000..ce9eeed
--- /dev/null
+++ b/doc/ttk_scrollbar.n
@@ -0,0 +1,163 @@
+'\"
+'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::scrollbar n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::scrollbar \- Control the viewport of a scrollable widget
+.SH SYNOPSIS
+\fBttk::scrollbar\fR \fIpathName \fR?\fIoptions...\fR?
+.BE
+.SH DESCRIPTION
+.PP
+\fBttk::scrollbar\fR widgets are typically linked to an associated window
+that displays a document of some sort, such as a file being edited or a
+drawing.
+A scrollbar displays a \fIthumb\fR in the middle portion of the scrollbar,
+whose position and size provides information about the portion of the
+document visible in the associated window.
+The thumb may be dragged by the user to control the visible region.
+Depending on the theme, two or more arrow buttons may also be present;
+these are used to scroll the visible region in discrete units.
+.SO ttk_widget
+\-class \-cursor \-style
+\-takefocus
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-command command Command
+A Tcl script prefix to evaluate
+to change the view in the widget associated with the scrollbar.
+Additional arguments are appended to the value of this option,
+as described in \fBSCROLLING COMMANDS\fR below,
+whenever the user requests a view change by manipulating the scrollbar.
+.RS
+.PP
+This option typically consists of a two-element list,
+containing the name of a scrollable widget followed by
+either \fBxview\fR (for horizontal scrollbars)
+or \fByview\fR (for vertical scrollbars).
+.RE
+.OP \-orient orient Orient
+One of \fBhorizontal\fR or \fBvertical\fR.
+Specifies the orientation of the scrollbar.
+.SH "WIDGET COMMAND"
+.PP
+.TP
+\fIpathName \fBcget\fR \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 \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
+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
+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.
+\fIfirst\fR and \fIlast\fR are real fractions between 0 and 1.
+.TP
+\fIpathName \fBstate\fR ?\fIstateSpec\fR?
+Modify or query the widget state; see \fIttk::widget(n)\fR.
+.SH "INTERNAL COMMANDS"
+.PP
+The following widget commands are used internally
+by the TScrollbar widget class bindings.
+.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 thumb position. For example, if the scrollbar is horizontal,
+the result indicates how much the scrollbar setting must change
+to move the thumb \fIdeltaX\fR pixels to the right (\fIdeltaY\fR is
+ignored in this case).
+If the scrollbar is vertical, the result indicates how much the
+scrollbar setting must change to move the thumb \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,
+where 0.0 corresponds to the top or left of the trough
+and 1.0 corresponds to the bottom or right.
+\fIX\fR and \fIy\fR are pixel coordinates relative to the scrollbar
+widget.
+If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest
+point in the trough is used.
+.SH "SCROLLING COMMANDS"
+.PP
+When the user interacts with the scrollbar, for example by dragging
+the thumb, the scrollbar notifies the associated widget that it
+must change its view.
+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
+.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.
+If \fIfraction\fR is 0 it refers to the beginning of the
+document. 1.0 refers to the end of the document, 0.333
+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.
+\fINumber\fR is either 1, which means one unit should scroll off
+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
+is a slight overlap between the old and new views.
+\fINumber\fR is either 1, which means the next page should
+become visible, or \-1, which means that the previous page should
+become visible.
+.SH "WIDGET STATES"
+.PP
+The scrollbar automatically sets the \fBdisabled\fR state bit.
+when the entire range is visible (range is 0.0 to 1.0),
+and clears it otherwise.
+It also sets the \fBactive\fR and \fBpressed\fR state flags
+of individual elements, based on the position and state of the mouse pointer.
+.SH EXAMPLE
+.PP
+.CS
+set f [frame .f]
+ttk::scrollbar $f.hsb \-orient horizontal \-command [list $f.t xview]
+ttk::scrollbar $f.vsb \-orient vertical \-command [list $f.t yview]
+text $f.t \-xscrollcommand [list $f.hsb set] \-yscrollcommand [list $f.vsb set]
+grid $f.t \-row 0 \-column 0 \-sticky nsew
+grid $f.vsb \-row 0 \-column 1 \-sticky nsew
+grid $f.hsb \-row 1 \-column 0 \-sticky nsew
+grid columnconfigure $f 0 \-weight 1
+grid rowconfigure $f 0 \-weight 1
+.CE
+.SH "SEE ALSO"
+ttk::widget(n), scrollbar(n)
+.SH KEYWORDS
+scrollbar, widget
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n
new file mode 100644
index 0000000..78114bd
--- /dev/null
+++ b/doc/ttk_separator.n
@@ -0,0 +1,38 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::separator n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::separator \- Separator bar
+.SH SYNOPSIS
+\fBttk::separator\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::separator\fR widget displays a horizontal or vertical separator
+bar.
+.SO ttk_widget
+\-class \-cursor \-state
+\-style \-takefocus
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-orient orient Orient
+One of \fBhorizontal\fR or \fBvertical\fR.
+Specifies the orientation of the separator.
+.SH "WIDGET COMMAND"
+.PP
+Separator widgets support the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+methods. No other widget methods are used.
+.SH "SEE ALSO"
+ttk::widget(n)
+.SH "KEYWORDS"
+widget, separator
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n
new file mode 100644
index 0000000..38de1ed
--- /dev/null
+++ b/doc/ttk_sizegrip.n
@@ -0,0 +1,69 @@
+'\"
+'\" Copyright (c) 2006 Joe English
+'\"
+'\" 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 ttk::sizegrip n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::sizegrip \- Bottom-right corner resize widget
+.SH SYNOPSIS
+\fBttk::sizegrip\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::sizegrip\fR widget (also known as a \fIgrow box\fR)
+allows the user to resize the containing toplevel window
+by pressing and dragging the grip.
+.SO ttk_widget
+\-class \-cursor \-state
+\-style \-takefocus
+.SE
+.SH "WIDGET COMMAND"
+.PP
+Sizegrip widgets support the standard
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
+methods. No other widget methods are used.
+.SH "PLATFORM-SPECIFIC NOTES"
+.PP
+On Mac OSX, toplevel windows automatically include a built-in
+size grip by default.
+Adding a \fBttk::sizegrip\fR there is harmless, since
+the built-in grip will just mask the widget.
+.SH EXAMPLES
+.PP
+Using pack:
+.CS
+pack [ttk::frame $top.statusbar] \-side bottom \-fill x
+pack [\fBttk::sizegrip\fR $top.statusbar.grip] \-side right \-anchor se
+.CE
+.PP
+Using grid:
+.CS
+grid [\fBttk::sizegrip\fR $top.statusbar.grip] \e
+ \-row $lastRow \-column $lastColumn \-sticky se
+# ... optional: add vertical scrollbar in $lastColumn,
+# ... optional: add horizontal scrollbar in $lastRow
+.CE
+.SH "BUGS"
+.PP
+If the containing toplevel's position was specified
+relative to the right or bottom of the screen
+(e.g.,
+.QW "\fBwm geometry ... \fIw\fBx\fIh\fB\-\fIx\fB\-\fIy\fR"
+instead of
+.QW "\fBwm geometry ... \fIw\fBx\fIh\fB+\fIx\fB+\fIy\fR" ),
+the sizegrip widget will not resize the window.
+.PP
+\fBttk::sizegrip\fR widgets only support
+.QW southeast
+resizing.
+.SH "SEE ALSO"
+ttk::widget(n)
+.SH "KEYWORDS"
+widget, sizegrip, grow box
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n
new file mode 100644
index 0000000..fefd287
--- /dev/null
+++ b/doc/ttk_spinbox.n
@@ -0,0 +1,86 @@
+'\"
+'\" Copyright (c) 2008 Pat Thoyts
+'\"
+'\" 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 ttk::spinbox n 8.5.9 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::spinbox \- Selecting text field widget
+.SH SYNOPSIS
+\fBttk::spinbox\fR \fIpathName \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+A \fBttk::spinbox\fR widget is a \fBttk::entry\fR widget with built-in
+up and down buttons that are used to either modify a numeric value or
+to select among a set of values. The widget implements all the features
+of the \fBttk::entry\fR widget including support of the
+\fB\-textvariable\fR option to link the value displayed by the widget
+to a Tcl variable.
+.SO ttk_widget
+\-class \-cursor \-style
+\-takefocus \-xscrollcommand
+.SE
+.SO ttk_entry
+\-validate \-validatecommand
+.SE
+.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
+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.
+range.
+.OP \-increment increment Increment
+A floating\-point value specifying the change in value to be applied each
+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
+specified beginning with the first value.
+.OP \-wrap wrap Wrap
+Must be a proper boolean value. If on, the spinbox will wrap around the
+values of data in the widget.
+.OP \-format format Format
+Specifies an alternate format to use when setting the string value
+when using the \fB\-from\fR and \fB\-to\fR range.
+This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
+as it will format a floating-point number.
+.OP \-command command Command
+Specifies a Tcl command to be invoked whenever a spinbutton is invoked.
+.SH "INDICES"
+.PP
+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.
+.SH "WIDGET COMMAND"
+.PP
+The following subcommands are possible for spinbox widgets in addition to
+the commands described for the \fBttk::entry\fR widget:
+.TP
+\fIpathName \fBcurrent \fIindex\fR
+.TP
+\fIpathName \fBget\fR
+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
+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
+is set directly.
+.SH "SEE ALSO"
+ttk::widget(n), ttk::entry(n), spinbox(n)
+.SH KEYWORDS
+entry, spinbox, widget, text field
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_style.n b/doc/ttk_style.n
new file mode 100644
index 0000000..c32b028
--- /dev/null
+++ b/doc/ttk_style.n
@@ -0,0 +1,131 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::style n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::style \- Manipulate style database
+.SH SYNOPSIS
+\fBttk::style\fR \fIoption\fR ?\fIargs\fR?
+.BE
+.SH NOTES
+.PP
+See also the Tcl'2004 conference presentation,
+available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf
+.SH DEFINITIONS
+.PP
+Each widget is assigned a \fIstyle\fR,
+which specifies the set of elements making up the widget
+and how they are arranged, along with dynamic and default
+settings for element options.
+By default, the style name is the same as the widget's class;
+this may be overridden by the \fB\-style\fR option.
+.PP
+A \fItheme\fR is a collection of elements and styles
+which controls the overall look and feel of an application.
+.SH DESCRIPTION
+.PP
+The \fBttk::style\fR command takes the following arguments:
+.TP
+\fBttk::style configure \fIstyle\fR ?\fI\-option\fR ?\fIvalue option value...\fR? ?
+Sets the default value of the specified option(s) in \fIstyle\fR.
+.TP
+\fBttk::style map \fIstyle\fR ?\fI\-option\fB { \fIstatespec value...\fB }\fR?
+Sets dynamic values of the specified option(s) in \fIstyle\fR.
+Each \fIstatespec / value\fR pair is examined in order;
+the value corresponding to the first matching \fIstatespec\fR
+is used.
+.TP
+\fBttk::style lookup \fIstyle\fR \fI\-option \fR?\fIstate \fR?\fIdefault\fR??
+Returns the value specified for \fI\-option\fR in style \fIstyle\fR
+in state \fIstate\fR, using the standard lookup rules for element options.
+\fIstate\fR is a list of state names; if omitted,
+it defaults to all bits off (the
+.QW normal
+state).
+If the \fIdefault\fR argument is present, it is used as a fallback
+value in case no specification for \fI\-option\fR is found.
+.\" Otherwise -- signal error? return empty string? Leave unspecified for now.
+.TP
+\fBttk::style layout \fIstyle\fR ?\fIlayoutSpec\fR?
+Define the widget layout for style \fIstyle\fR.
+See \fBLAYOUTS\fR below for the format of \fIlayoutSpec\fR.
+If \fIlayoutSpec\fR is omitted, return the layout specification
+for style \fIstyle\fR.
+.TP
+\fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR?
+Creates a new element in the current theme of type \fItype\fR.
+The only cross-platform built-in element type is \fIimage\fR
+(see \fBttk_image\fR(n)) but themes may define other element types
+(see \fBTtk_RegisterElementFactory\fR). On suitable versions of Windows
+an element factory is registered to create Windows theme elements
+(see \fBttk_vsapi\fR(n)).
+.TP
+\fBttk::style element names\fR
+Returns the list of elements defined in the current theme.
+.TP
+\fBttk::style element options \fIelement\fR
+Returns the list of \fIelement\fR's options.
+.TP
+\fBttk::style theme create\fR \fIthemeName\fR ?\fB\-parent \fIbasedon\fR? ?\fB\-settings \fIscript...\fR ?
+Creates a new theme. It is an error if \fIthemeName\fR already exists.
+If \fB\-parent\fR is specified, the new theme will inherit
+styles, elements, and layouts from the parent theme \fIbasedon\fR.
+If \fB\-settings\fR is present, \fIscript\fR is evaluated in the
+context of the new theme as per \fBttk::style theme settings\fR.
+.TP
+\fBttk::style theme settings \fIthemeName\fR \fIscript\fR
+Temporarily sets the current theme to \fIthemeName\fR,
+evaluate \fIscript\fR, then restore the previous theme.
+Typically \fIscript\fR simply defines styles and elements,
+though arbitrary Tcl code may appear.
+.TP
+\fBttk::style theme names\fR
+Returns a list of all known themes.
+.TP
+\fBttk::style theme use\fR ?\fIthemeName\fR?
+Without an argument the result is the name of the current theme.
+Otherwise this command sets the current theme to \fIthemeName\fR,
+and refreshes all widgets.
+.SH LAYOUTS
+.PP
+A \fIlayout\fR specifies a list of elements, each followed
+by one or more options specifying how to arrange the element.
+The layout mechanism uses a simplified version of the \fBpack\fR
+geometry manager: given an initial cavity,
+each element is allocated a parcel.
+Valid options are:
+.TP
+\fB\-side \fIside\fR
+Specifies which side of the cavity to place the element;
+one of \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR.
+If omitted, the element occupies the entire cavity.
+.TP
+\fB\-sticky\fR \fB[\fInswe\fB]\fR
+Specifies where the element is placed inside its allocated parcel.
+.TP
+\fB\-children { \fIsublayout... \fB}\fR
+Specifies a list of elements to place inside the element.
+.\" Also: -border, -unit, -expand: may go away.
+.PP
+For example:
+.CS
+ttk::style layout Horizontal.TScrollbar {
+ Scrollbar.trough \-children {
+ Scrollbar.leftarrow \-side left
+ Scrollbar.rightarrow \-side right
+ Horizontal.Scrollbar.thumb \-side left \-sticky ew
+ }
+}
+.CE
+.SH "SEE ALSO"
+ttk::intro(n), ttk::widget(n), photo(n), ttk_image(n)
+.SH KEYWORDS
+style, theme, appearance
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n
new file mode 100644
index 0000000..33cca55
--- /dev/null
+++ b/doc/ttk_treeview.n
@@ -0,0 +1,484 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::treeview n 8.5.9 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::treeview \- hierarchical multicolumn data display widget
+.SH SYNOPSIS
+\fBttk::treeview \fIpathname \fR?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+The \fBttk::treeview\fR widget displays a hierarchical collection of items.
+Each item has a textual label, an optional image,
+and an optional list of data values.
+The data values are displayed in successive columns after
+the tree label.
+.PP
+The order in which data values are displayed may be controlled
+by setting the \fB\-displaycolumns\fR widget option.
+The tree widget can also display column headings.
+Columns may be accessed by number or by symbolic names
+listed in the \fB\-columns\fR widget option;
+see \fBCOLUMN IDENTIFIERS\fR.
+.PP
+Each item is identified by a unique name.
+The widget will generate item IDs if they are not supplied by the caller.
+There is a distinguished root item, named \fB{}\fR.
+The root item itself is not displayed;
+its children appear at the top level of the hierarchy.
+.PP
+Each item also has a list of \fItags\fR,
+which can be used to associate event bindings with individual items
+and control the appearance of the item.
+.\" .PP
+.\" @@@HERE: describe selection, focus item
+.PP
+Treeview widgets support horizontal and vertical scrolling with the
+standard \fB\-\fR[\fBxy\fR]\fBscrollcommand\fR options
+and [\fBxy\fR]\fBview\fR widget commands.
+.SO ttk_widget
+\-class \-cursor \-takefocus
+\-style \-xscrollcommand \-yscrollcommand
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-columns columns Columns
+A list of column identifiers,
+specifying the number of columns and their names.
+.\"X: This is a read-only option; it may only be set when the widget is created.
+.OP \-displaycolumns displayColumns DisplayColumns
+A list of column identifiers
+(either symbolic names or integer indices)
+specifying which data columns are displayed
+and the order in which they appear,
+or the string \fB#all\fP.
+If set to \fB#all\fP (the default),
+all columns are shown in the order given.
+.OP \-height height Height
+Specifies the number of rows which should be visible.
+Note:
+the requested width is determined from the sum of the column widths.
+.OP \-padding padding Padding
+Specifies the internal padding for the widget.
+The padding is a list of up to four length specifications;
+see \fBTtk_GetPaddingFromObj()\fR for details.
+.OP \-selectmode selectMode SelectMode
+Controls how the built-in class bindings manage the selection.
+One of \fBextended\fR, \fBbrowse\fR, or \fBnone\fR.
+.RS
+.PP
+If set to \fBextended\fR (the default), multiple items may be selected.
+If \fBbrowse\fR, only a single item will be selected at a time.
+If \fBnone\fR, the selection will not be changed.
+.PP
+Note that application code and tag bindings can set the selection
+however they wish, regardless of the value of \fB\-selectmode\fR.
+.RE
+.OP \-show show Show
+A list containing zero or more of the following values, specifying
+which elements of the tree to display.
+.RS
+.IP \fBtree\fR
+Display tree labels in column #0.
+.IP \fBheadings\fR
+Display the heading row.
+.PP
+The default is \fBtree headings\fR, i.e., show all elements.
+.PP
+\fBNOTE:\fR Column #0 always refers to the tree column,
+even if \fB\-show tree\fR is not specified.
+.RE
+.SH "WIDGET COMMAND"
+.PP
+.TP
+\fIpathname \fBbbox \fIitem\fR ?\fIcolumn\fR?
+Returns the bounding box (relative to the treeview widget's window)
+of the specified \fIitem\fR
+in the form \fIx y width height\fR.
+If \fIcolumn\fR is specified, returns the bounding box of that cell.
+If the \fIitem\fR is not visible
+(i.e., if it is a descendant of a closed item or is scrolled offscreen),
+returns the empty list.
+.TP
+\fIpathname \fBcget \fIoption\fR
+Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBchildren \fIitem\fR ?\fInewchildren\fR?
+If \fInewchildren\fR is not specified,
+returns the list of children belonging to \fIitem\fR.
+.RS
+.PP
+If \fInewchildren\fR is specified, replaces \fIitem\fR's child list
+with \fInewchildren\fR.
+Items in the old child list not present in the new child list
+are detached from the tree.
+None of the items in \fInewchildren\fR may be an ancestor
+of \fIitem\fR.
+.RE
+.TP
+\fIpathname \fBcolumn \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
+Query or modify the options for the specified \fIcolumn\fR.
+If no \fI\-option\fR is specified,
+returns a dictionary of option/value pairs.
+If a single \fI\-option\fR is specified,
+returns the value of that option.
+Otherwise, the options are updated with the specified values.
+The following options may be set on each column:
+.RS
+.TP
+\fB\-id \fIname\fR
+The column name. This is a read-only option.
+For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR]
+returns the data column associated with display column #\fIn\fR.
+.TP
+\fB\-anchor\fR
+Specifies how the text in this column should be aligned
+with respect to the cell. One of
+\fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR,
+\fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR.
+.TP
+\fB\-minwidth\fR
+The minimum width of the column in pixels.
+The treeview widget will not make the column any smaller than
+\fB\-minwidth\fR when the widget is resized or the user drags a
+column separator.
+.TP
+\fB\-stretch\fR
+Specifies whether or not the column's width should be adjusted
+when the widget is resized.
+.TP
+\fB\-width \fIw\fR
+The width of the column in pixels. Default is something reasonable,
+probably 200 or so.
+.PP
+Use \fIpathname column #0\fR to configure the tree column.
+.RE
+.TP
+\fIpathname \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
+Modify or query widget options; see \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBdelete \fIitemList\fR
+Deletes each of the items in \fIitemList\fR and all of their descendants.
+The root item may not be deleted.
+See also: \fBdetach\fR.
+.TP
+\fIpathname \fBdetach \fIitemList\fR
+Unlinks all of the specified items in \fIitemList\fR from the tree.
+The items and all of their descendants are still present
+and may be reinserted at another point in the tree
+with the \fBmove\fR operation,
+but will not be displayed until that is done.
+The root item may not be detached.
+See also: \fBdelete\fR.
+.TP
+\fIpathname \fBexists \fIitem\fR
+Returns 1 if the specified \fIitem\fR is present in the tree,
+0 otherwise.
+.TP
+\fIpathname \fBfocus \fR?\fIitem\fR?
+If \fIitem\fR is specified, sets the focus item to \fIitem\fR.
+Otherwise, returns the current focus item, or \fB{}\fR if there is none.
+.\" Need: way to clear the focus item. {} works for this...
+.TP
+\fIpathname \fBheading \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
+Query or modify the heading options for the specified \fIcolumn\fR.
+Valid options are:
+.RS
+.TP
+\fB\-text \fItext\fR
+The text to display in the column heading.
+.TP
+\fB\-image \fIimageName\fR
+Specifies an image to display to the right of the column heading.
+.TP
+\fB\-anchor \fIanchor\fR
+Specifies how the heading text should be aligned.
+One of the standard Tk anchor values.
+.TP
+\fB\-command \fIscript\fR
+A script to evaluate when the heading label is pressed.
+.PP
+Use \fIpathname heading #0\fR to configure the tree column heading.
+.RE
+.TP
+\fIpathname \fBidentify \fIcomponent x y\fR
+Returns a description of the specified \fIcomponent\fR
+under the point given by \fIx\fR and \fIy\fR,
+or the empty string if no such \fIcomponent\fR is present at that position.
+The following subcommands are supported:
+.RS
+.TP
+\fIpathname \fBidentify region \fIx y\fR
+.RS
+Returns one of:
+.IP heading
+Tree heading area;
+use [\fBpathname identify column \fIx y\fR]
+to determine the heading number.
+.IP separator
+Space between two column headings;
+[\fBpathname identify column \fIx y\fR]
+will return the display column identifier
+of the heading to left of the separator.
+.IP tree
+The tree area.
+.IP cell
+A data cell.
+.RE
+\fIpathname \fBidentify item \fIx y\fR
+Returns the item ID of the item at position \fIy\fR.
+.TP
+\fIpathname \fBidentify column \fIx y\fR
+Returns the data column identifier of the cell at position \fIx\fR.
+The tree column has ID \fB#0\fR.
+.TP
+\fIpathname \fBidentify element \fIx y\fR
+The element at position \fIx,y\fR.
+.TP
+\fIpathname \fBidentify row \fIx y\fR
+Obsolescent synonym for \fIpathname \fBidentify item\fR.
+.PP
+See \fBCOLUMN IDENTIFIERS\fR for a discussion of display columns
+and data columns.
+.RE
+.TP
+\fIpathname \fBindex \fIitem\fR
+Returns the integer index of \fIitem\fR within its parent's list of children.
+.TP
+\fIpathname \fBinsert \fIparent index\fR ?\fB\-id \fIid\fR? \fIoptions...\fR
+Creates a new item.
+\fIparent\fR is the item ID of the parent item,
+or the empty string \fB{}\fR
+to create a new top-level item.
+\fIindex\fR is an integer, or the value \fBend\fR, specifying where in the
+list of \fIparent\fR's children to insert the new item.
+If \fIindex\fR is less than or equal to zero,
+the new node is inserted at the beginning;
+if \fIindex\fR is greater than or equal to the current number of children,
+it is inserted at the end.
+If \fB\-id\fR is specified, it is used as the item identifier;
+\fIid\fR must not already exist in the tree.
+Otherwise, a new unique identifier is generated.
+.RS
+.PP
+\fIpathname \fBinsert\fR returns the item identifier of the
+newly created item.
+See \fBITEM OPTIONS\fR for the list of available options.
+.RE
+.TP
+\fIpathname \fBinstate \fIstatespec\fR ?\fIscript\fR?
+Test the widget state; see \fIttk::widget(n)\fR.
+.TP
+\fIpathname \fBitem \fIitem\fR ?\fI\-option \fR?\fIvalue \-option value...\fR?
+Query or modify the options for the specified \fIitem\fR.
+If no \fI\-option\fR is specified,
+returns a dictionary of option/value pairs.
+If a single \fI\-option\fR is specified,
+returns the value of that option.
+Otherwise, the item's options are updated with the specified values.
+See \fBITEM OPTIONS\fR for the list of available options.
+.TP
+\fIpathname \fBmove \fIitem parent index\fR
+Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children.
+It is illegal to move an item under one of its descendants.
+.RS
+.PP
+If \fIindex\fR is less than or equal to zero, \fIitem\fR is moved
+to the beginning; if greater than or equal to the number of children,
+it is moved to the end.
+.RE
+.TP
+\fIpathname \fBnext \fIitem\fR
+Returns the identifier of \fIitem\fR's next sibling,
+or \fB{}\fR if \fIitem\fR is the last child of its parent.
+.TP
+\fIpathname \fBparent \fIitem\fR
+Returns the ID of the parent of \fIitem\fR,
+or \fB{}\fR if \fIitem\fR is at the top level of the hierarchy.
+.TP
+\fIpathname \fBprev \fIitem\fR
+Returns the identifier of \fIitem\fR's previous sibling,
+or \fB{}\fR if \fIitem\fR is the first child of its parent.
+.TP
+\fIpathname \fBsee \fIitem\fR
+Ensure that \fIitem\fR is visible:
+sets all of \fIitem\fR's ancestors to \fB\-open true\fR,
+and scrolls the widget if necessary so that \fIitem\fR is
+within the visible portion of the tree.
+.TP
+\fIpathname \fBselection\fR ?\fIselop itemList\fR?
+If \fIselop\fR is not specified, returns the list of selected items.
+Otherwise, \fIselop\fR is one of the following:
+.RS
+.TP
+\fIpathname \fBselection set \fIitemList\fR
+\fIitemList\fR becomes the new selection.
+.TP
+\fIpathname \fBselection add \fIitemList\fR
+Add \fIitemList\fR to the selection
+.TP
+\fIpathname \fBselection remove \fIitemList\fR
+Remove \fIitemList\fR from the selection
+.TP
+\fIpathname \fBselection toggle \fIitemList\fR
+Toggle the selection state of each item in \fIitemList\fR.
+.RE
+.TP
+\fIpathname \fBset \fIitem\fR ?\fIcolumn\fR? ?\fIvalue\fR?
+With one argument, returns a dictionary of column/value pairs
+for the specified \fIitem\fR.
+With two arguments, returns the current value of the specified \fIcolumn\fR.
+With three arguments, sets the value of column \fIcolumn\fR
+in item \fIitem\fR to the specified \fIvalue\fR.
+See also \fBCOLUMN IDENTIFIERS\fR.
+.TP
+\fIpathname \fBstate\fR ?\fIstateSpec\fR?
+Modify or query the widget state; see \fIttk::widget(n)\fR.
+.TP
+\fIpathName \fBtag \fIargs...\fR
+.RS
+.TP
+\fIpathName \fBtag bind \fItagName \fR?\fIsequence\fR? ?\fIscript\fR?
+Add a Tk binding script for the event sequence \fIsequence\fR
+to the tag \fItagName\fR. When an X event is delivered to an item,
+binding scripts for each of the item's \fB\-tags\fR are evaluated
+in order as per \fIbindtags(n)\fR.
+.RS
+.PP
+\fB<KeyPress>\fR, \fB<KeyRelease>\fR, and virtual events
+are sent to the focus item.
+\fB<ButtonPress>\fR, \fB<ButtonRelease>\fR, and \fB<Motion>\fR events
+are sent to the item under the mouse pointer.
+No other event types are supported.
+.PP
+The binding \fIscript\fR undergoes \fB%\fR-substitutions before
+evaluation; see \fBbind(n)\fR for details.
+.RE
+.TP
+\fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue option value...\fR?
+Query or modify the options for the specified \fItagName\fR.
+If one or more \fIoption/value\fR pairs are specified,
+sets the value of those options for the specified tag.
+If a single \fIoption\fR is specified,
+returns the value of that option
+(or the empty string if the option has not been specified for \fItagName\fR).
+With no additional arguments,
+returns a dictionary of the option settings for \fItagName\fR.
+See \fBTAG OPTIONS\fR for the list of available options.
+.TP
+\fIpathName \fBtag has \fItagName\fR ?\fIitem\fR?
+If \fIitem\fR is specified, returns 1 or 0
+depending on whether the specified item has the named tag.
+Otherwise, returns a list of all items which have
+the specified tag.
+.TP
+\fIpathName \fBtag names\fR
+Returns a list of all tags used by the widget.
+.TP
+\fIpathName \fBtag add\fR \fItag\fR \fIitems\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.
+.TP
+\fIpathName \fBtag remove\fR \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.
+.RE
+.TP
+\fIpathName \fBxview \fIargs\fR
+Standard command for horizontal scrolling; see \fIwidget(n)\fR.
+.TP
+\fIpathName \fByview \fIargs\fR
+Standard command for vertical scrolling; see \fIttk::widget(n)\fR.
+.SH "ITEM OPTIONS"
+.PP
+The following item options may be specified for items
+in the \fBinsert\fR and \fBitem\fR widget commands.
+.OP \-text text Text
+The textual label to display for the item.
+.OP \-image image Image
+A Tk image, displayed to the left of the label.
+.OP \-values values Values
+The list of values associated with the item.
+.RS
+.PP
+Each item should have the same number of values as
+the \fB\-columns\fR widget option.
+If there are fewer values than columns,
+the remaining values are assumed empty.
+If there are more values than columns,
+the extra values are ignored.
+.RE
+.OP \-open open Open
+A boolean value indicating whether the item's children
+should be displayed (\fB\-open true\fR) or hidden (\fB\-open false\fR).
+.OP \-tags tags Tags
+A list of tags associated with this item.
+.SH "TAG OPTIONS"
+.PP
+The following options may be specified on tags:
+.IP \fB\-foreground\fR
+Specifies the text foreground color.
+.IP \fB\-background\fR
+Specifies the cell or item background color.
+.IP \fB\-font\fR
+Specifies the font to use when drawing text.
+.\" ??? Maybe: .IP \-anchor
+.\" ??? Maybe: .IP \-padding
+.\" ??? Maybe: .IP \-text
+.IP \fB\-image\fR
+Specifies the item image, in case the item's \fB\-image\fR option is empty.
+.\" .PP
+.\" \fI(@@@ TODO: sort out order of precedence for options)\fR
+.SH "COLUMN IDENTIFIERS"
+.PP
+Column identifiers take any of the following forms:
+.IP \(bu
+A symbolic name from the list of \fB\-columns\fR.
+.IP \(bu
+An integer \fIn\fR, specifying the \fIn\fRth data column.
+.IP \(bu
+A string of the form \fB#\fIn\fR, where \fIn\fR is an integer,
+specifying the \fIn\fRth display column.
+.PP
+\fBNOTE:\fR
+Item \fB\-values\fR may be displayed in a different order than
+the order in which they are stored.
+.PP
+\fBNOTE:\fR Column #0 always refers to the tree column,
+even if \fB\-show tree\fR is not specified.
+.PP
+A \fIdata column number\fR is an index into an item's \fB\-values\fR list;
+a \fIdisplay column number\fR is the column number in the tree
+where the values are displayed.
+Tree labels are displayed in column #0.
+If \fB\-displaycolumns\fR is not set,
+then data column \fIn\fR is displayed in display column \fB#\fIn+1\fR.
+Again, \fBcolumn #0 always refers to the tree column\fR.
+.SH "VIRTUAL EVENTS"
+.PP
+The treeview widget generates the following virtual events.
+.IP <<TreeviewSelect>>
+Generated whenever the selection changes.
+.IP <<TreeviewOpen>>
+Generated just before setting the focus item to \fB\-open true\fR.
+.IP <<TreeviewClose>>
+Generated just after setting the focus item to \fB\-open false\fR.
+.PP
+The \fBfocus\fR and \fBselection\fR widget commands can be used
+to determine the affected item or items.
+'\" Not yet:
+'\" In Tk 8.5, the affected item is also passed as the \fB\-detail\fR field
+'\" of the virtual event.
+.SH "SEE ALSO"
+ttk::widget(n), listbox(n), image(n), bind(n)
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n
new file mode 100644
index 0000000..7506ec4
--- /dev/null
+++ b/doc/ttk_vsapi.n
@@ -0,0 +1,102 @@
+'\"
+'\" Copyright (c) 2008 Pat Thoyts
+'\"
+'\" 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 ttk_vsapi n 8.5 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk_vsapi \- Define a Microsoft Visual Styles element
+.SH SYNOPSIS
+\fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR \fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR?
+.BE
+.SH DESCRIPTION
+.PP
+The \fIvsapi\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.
+.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
+Visual Styles API states (see \fBSTATE MAP\fR).
+.SH "OPTIONS"
+.PP
+Valid \fIoptions\fR are:
+.TP
+\fB\-padding\fR \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
+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
+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.
+.TP
+\fB\-height\fR \fIheight\fR
+Specifies the height of the element. See the comments for \fI-width\fR.
+.SH "STATE MAP"
+.PP
+The \fIstateMap\fR parameter is a list of ttk states and the
+corresponding Visual Styles API state value.
+This permits the element appearence to respond to changes in the
+widget state such as becoming active or being pressed. The list should
+be as described for the \fBttk::style map\fR command but note that the
+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
+versions of the Windows Development Kit this is \fIvssym32.h\fR.
+.PP
+If no \fIstateMap\fR parameter is given there is an implicit default
+map of {{} 1}
+.SH "EXAMPLE"
+.PP
+Create a correctly themed close button by changing the layout of
+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 \\
+ {disabled 4 pressed 3 active 2 {} 1}
+ttk::style layout CloseButton {CloseButton.smallclose -sticky news}
+pack [ttk::button .close -style CloseButton]
+.CE
+.PP
+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 {
+ {pressed !selected} 3
+ {active !selected} 2
+ {pressed selected} 6
+ {active selected} 5
+ {selected} 4
+ {} 1
+}
+ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news}
+pack [ttk::checkbutton .pin -style Explorer.Pin]
+.CE
+.SH "SEE ALSO"
+ttk::intro(n), ttk::widget(n), ttk::style(n), ttk_image(n)
+.SH "KEYWORDS"
+style, theme, appearance, windows
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n
new file mode 100644
index 0000000..98968ad
--- /dev/null
+++ b/doc/ttk_widget.n
@@ -0,0 +1,262 @@
+'\"
+'\" Copyright (c) 2004 Joe English
+'\"
+'\" 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 ttk::widget n 8.5.9 Tk "Tk Themed Widget"
+.BS
+.SH NAME
+ttk::widget \- Standard options and commands supported by Tk themed widgets
+.BE
+.SH DESCRIPTION
+This manual describes common widget options and commands.
+.SH "STANDARD OPTIONS"
+The following options are supported by all Tk themed widgets:
+.OP \-class undefined undefined
+Specifies the window class.
+The class is used when querying the option database
+for the window's other options, to determine the default
+bindtags for the window, and to select the widget's default
+layout and style.
+This is a read-only option:
+it may only be specified when the window is created,
+and may not be changed with the \fBconfigure\fR widget command.
+.OP \-cursor cursor Cursor
+Specifies the mouse cursor to be used for the widget.
+See \fBTk_GetCursor\fR and \fIcursors(n)\fR in the Tk reference manual
+for the legal values.
+If set to the empty string (the default),
+the cursor is inherited from the parent widget.
+.OP \-takefocus takeFocus TakeFocus
+Determines whether the window accepts the focus during keyboard traversal.
+Either \fB0\fR, \fB1\fR, a command prefix (to which the widget path
+is appended, and which should return \fB0\fR or \fB1\fR),
+or the empty string.
+See \fIoptions(n)\fR in the Tk reference manual for the full description.
+.OP \-style style Style
+May be used to specify a custom widget style.
+.SH "SCROLLABLE WIDGET OPTIONS"
+The following options are supported by widgets that
+are controllable by a scrollbar.
+See \fIscrollbar(n)\fR for more information
+.OP \-xscrollcommand xScrollCommand ScrollCommand
+A command prefix, used to communicate with horizontal scrollbars.
+.RS
+When the view in the widget's window changes, the widget will
+generate a Tcl command by concatenating the scroll command and
+two numbers.
+Each of the numbers is a fraction between 0 and 1 indicating
+a position in the document; 0 indicates the beginning,
+and 1 indicates the end.
+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
+of a \fBscrollbar\fR widget followed by
+.QW set ,
+e.g.
+.QW ".x.scrollbar set" .
+This will cause the scrollbar to be updated whenever the view in the
+window changes.
+.PP
+If this option is set to the empty string (the default),
+then no command will be executed.
+.RE
+.OP \-yscrollcommand yScrollCommand ScrollCommand
+A command prefix, used to communicate with vertical scrollbars.
+See the description of \fB\-xscrollcommand\fR above for details.
+.SH "LABEL OPTIONS"
+The following options are supported by labels, buttons,
+and other button-like widgets:
+.OP \-text text Text
+Specifies a text string to be displayed inside the widget
+(unless overridden by \fB\-textvariable\fR).
+.OP \-textvariable textVariable Variable
+Specifies the name of a global variable whose value will be used
+in place of the \fB\-text\fR resource.
+.OP \-underline underline Underline
+If set, specifies the integer index (0-based) of a character to underline
+in the text string.
+The underlined character is used for mnemonic activation.
+.OP \-image image Image
+Specifies an image to display.
+This is a list of 1 or more elements.
+The first element is the default image name.
+The rest of the list is a sequence of \fIstatespec / value\fR pairs
+as per \fBstyle map\fR, specifying different images to use when
+the widget is in a particular state or combination of states.
+All images in the list should have the same size.
+.OP \-compound compound Compound
+Specifies how to display the image relative to the text,
+in the case both \fB\-text\fR and \fB\-image\fR are present.
+Valid values are:
+.RS
+.IP text
+Display text only.
+.IP image
+Display image only.
+.IP center
+Display text centered on top of image.
+.IP top
+.IP bottom
+.IP left
+.IP right
+Display image above, below, left of, or right of the text, respectively.
+.IP none
+The default; display the image if present, otherwise the text.
+.RE
+.OP \-width width Width
+If greater than zero, specifies how much space, in character widths,
+to allocate for the text label.
+If less than zero, specifies a minimum width.
+If zero or unspecified, the natural width of the text label is used.
+.SH "COMPATIBILITY OPTIONS"
+.OP \-state state State
+May be set to \fBnormal\fR or \fBdisabled\fR
+to control the \fBdisabled\fR state bit.
+This is a write-only option:
+setting it changes the widget state,
+but the \fBstate\fR widget command
+does not affect the \fB\-state\fR option.
+.SH COMMANDS
+.TP
+\fIpathName \fBcget\fR \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)
+to have the given value(s);
+in this case the command returns an empty string.
+If \fIoption\fR is specified with no \fIvalue\fR,
+then the command returns a list describing the named option:
+the elements of the list are the
+option name, database name, database class, default value,
+and current value.
+.\" Note: Ttk widgets don't use TK_OPTION_SYNONYM.
+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
+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?
+Test the widget's state.
+If \fIscript\fR is not specified, returns 1 if
+the widget state matches \fIstatespec\fR and 0 otherwise.
+If \fIscript\fR is specified, equivalent to
+.CS
+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
+or clears it if prefixed by an exclamation point.
+.RS
+Returns a new state spec indicating which flags were changed:
+.CS
+set changes [\fIpathName \fRstate \fIspec\fR]
+\fIpathName \fRstate $changes
+.CE
+will restore \fIpathName\fR to the original state.
+If \fIstateSpec\fR is not specified,
+returns a list of the currently-enabled state flags.
+.RE
+.SH "WIDGET STATES"
+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
+(Gnome),
+.QW hot
+(Windows),
+.QW hover ).
+.TP
+\fBdisabled\fR
+Widget is disabled under program control (aka
+.QW unavailable ,
+.QW inactive )
+.TP
+\fBfocus\fR
+Widget has keyboard focus
+.TP
+\fBpressed\fR
+Widget is being pressed (aka
+.QW armed
+in Motif).
+.TP
+\fBselected\fR
+.QW On ,
+.QW true ,
+or
+.QW current
+for things like checkbuttons and radiobuttons.
+.TP
+\fBbackground\fR
+Windows and the Mac have a notion of an
+.QW active
+or foreground window.
+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
+or
+.QW mixed
+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
+provide distinct visual feedback for
+the active widget in addition to the active element
+within the widget.
+.PP
+A \fIstate specification\fR or \fIstateSpec\fR is a list
+of state names, optionally prefixed with an exclamation point (!)
+indicating that the bit is off.
+.SH EXAMPLES
+.CS
+set b [ttk::button .b]
+
+# Disable the widget:
+$b state disabled
+
+# Invoke the widget only if it is currently pressed and enabled:
+$b instate {pressed !disabled} { .b invoke }
+
+# Reenable widget:
+$b state !disabled
+.CE
+.SH "SEE ALSO"
+ttk::intro(n), ttk::style(n)
+.SH KEYWORDS
+state, configure, option
+'\" Local Variables:
+'\" mode: nroff
+'\" End:
diff --git a/doc/winfo.n b/doc/winfo.n
index fe62071..4b75eb9 100644
--- a/doc/winfo.n
+++ b/doc/winfo.n
@@ -55,9 +55,11 @@ Returns the class name for \fIwindow\fR.
.TP
\fBwinfo colormapfull \fIwindow\fR
Returns 1 if the colormap for \fIwindow\fR is known to be full, 0
-otherwise. The colormap for a window is ``known'' to be full if the last
+otherwise. The colormap for a window is
+.QW known
+to be full if the last
attempt to allocate a new color on that window failed and this
-application hasn't freed any colors in the colormap since the
+application has not freed any colors in the colormap since the
failed allocation.
.TP
\fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR
@@ -88,7 +90,10 @@ window exists.
Returns a floating-point value giving the number of pixels
in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
\fINumber\fR may be specified in any of the forms acceptable
-to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
+to \fBTk_GetScreenMM\fR, such as
+.QW 2.0c
+or
+.QW 1i .
The return value may be fractional; for an integer value, use
\fBwinfo pixels\fR.
.TP
@@ -108,12 +113,10 @@ or use \fBwinfo reqheight\fR to get the window's requested height
instead of its actual height.
.TP
\fBwinfo id \fIwindow\fR
-.VS
Returns a hexadecimal string giving a low-level platform-specific
identifier for \fIwindow\fR. On Unix platforms, this is the X
window identifier. Under Windows, this is the Windows
HWND. On the Macintosh the value has no meaning outside Tk.
-.VE
.TP
\fBwinfo interps \fR?\fB\-displayof \fIwindow\fR?
Returns a list whose members are the names of all Tcl interpreters
@@ -128,7 +131,7 @@ Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
\fBwinfo manager \fIwindow\fR
Returns the name of the geometry manager currently
responsible for \fIwindow\fR, or an empty string if \fIwindow\fR
-isn't managed by any geometry manager.
+is not managed by any geometry manager.
The name is usually the name of the Tcl command for the geometry
manager, such as \fBpack\fR or \fBplace\fR.
If the geometry manager is a widget, such as canvases or text, the
@@ -155,7 +158,10 @@ the display of the application's main window.
Returns the number of pixels in \fIwindow\fR corresponding
to the distance given by \fInumber\fR.
\fINumber\fR may be specified in any of the forms acceptable
-to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
+to \fBTk_GetPixels\fR, such as
+.QW 2.0c
+or
+.QW 1i .
The result is rounded to the nearest integer value; for a
fractional result, use \fBwinfo fpixels\fR.
.TP
@@ -164,7 +170,7 @@ If the mouse pointer is on the same screen as \fIwindow\fR, returns the
pointer's x coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position is
measured in the virtual root.
-If the mouse pointer isn't on the same screen as \fIwindow\fR then
+If the mouse pointer is not on the same screen as \fIwindow\fR then
-1 is returned.
.TP
\fBwinfo pointerxy \fIwindow\fR
@@ -173,15 +179,15 @@ with two elements, which are the pointer's x and y coordinates measured
in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
-If the mouse pointer isn't on the same screen as \fIwindow\fR then
-both of the returned coordinates are -1.
+If the mouse pointer is not on the same screen as \fIwindow\fR then
+both of the returned coordinates are \-1.
.TP
\fBwinfo pointery \fIwindow\fR
If the mouse pointer is on the same screen as \fIwindow\fR, returns the
pointer's y coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
-If the mouse pointer isn't on the same screen as \fIwindow\fR then
+If the mouse pointer is not on the same screen as \fIwindow\fR then
-1 is returned.
.TP
\fBwinfo reqheight \fIwindow\fR
@@ -252,14 +258,17 @@ in pixels.
Returns a string containing information about the server for
\fIwindow\fR's display. The exact format of this string may vary
from platform to platform. For X servers the string
-has the form ``\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR''
+has the form
+.QW "\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR"
where \fImajor\fR and \fIminor\fR are the version and revision
numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR
is the name of the vendor for the server, and \fIvendorRelease\fR
is an integer release number provided by the server.
.TP
\fBwinfo toplevel \fIwindow\fR
-Returns the path name of the top-level window containing \fIwindow\fR.
+Returns the path name of the top-of-hierarchy window containing \fIwindow\fR.
+In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may
+create other kinds of top-of-hierarchy widgets.
.TP
\fBwinfo viewable \fIwindow\fR
Returns 1 if \fIwindow\fR and all of its ancestors up through the
@@ -328,9 +337,8 @@ has no border).
.SH EXAMPLE
Print where the mouse pointer is and what window it is currently over:
.CS
-set x [\fBwinfo pointerx\fR .]
-set y [\fBwinfo pointery\fR .]
-puts -nonewline "Mouse pointer at ($x,$y) which is "
+lassign [\fBwinfo pointerxy\fR .] x y
+puts \-nonewline "Mouse pointer at ($x,$y) which is "
set win [\fBwinfo containing\fR $x $y]
if {$win eq ""} {
puts "over no window"
diff --git a/doc/wish.1 b/doc/wish.1
index 20d54e2..ca62120 100644
--- a/doc/wish.1
+++ b/doc/wish.1
@@ -12,8 +12,13 @@
.SH NAME
wish \- Simple windowing shell
.SH SYNOPSIS
-\fBwish\fR ?\fIfileName arg arg ...\fR?
+\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.
@@ -30,14 +35,17 @@ as the name of the interpreter for \fBsend\fR commands.
Execute all X server commands synchronously, so that errors
are reported immediately. This will result in much slower
execution, but it is useful for debugging.
-.VS 8.0 br
.IP "\fB\-use\fR \fIid\fR" 20
Specifies that the main window for the application is to be embedded in
the window whose identifier is \fIid\fR, instead of being created as an
independent toplevel window. \fIId\fR must be specified in the same
way as the value for the \fB\-use\fR option for toplevel widgets (i.e.
it has a form like that returned by the \fBwinfo id\fR command).
-.VE
+.RS
+Note that on some platforms this will only work correctly if \fIid\fR
+refers to a Tk \fBframe\fR or \fBtoplevel\fR that has its
+\fB\-container\fR option enabled.
+.RE
.IP "\fB\-visual \fIvisual\fR" 20
Specifies the visual to use for the window.
\fIVisual\fR may have any of the forms supported by the \fBTk_GetVisual\fR
@@ -48,47 +56,60 @@ variable without interpreting them.
This provides a mechanism for passing arguments such as \fB\-name\fR
to a script instead of having \fBwish\fR interpret them.
.BE
-
.SH DESCRIPTION
.PP
\fBWish\fR is a simple program consisting of the Tcl command
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 no arguments, or with a first argument
-that starts with ``\-'', then it reads Tcl commands interactively from
-standard input.
+If \fBwish\fR is invoked with arguments, then the first few
+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
+does not start with
+.QW \- .
+.PP
+If there are no arguments, or the arguments do not specify a \fIfileName\fR,
+then wish reads Tcl commands interactively from standard input.
It will continue processing commands until all windows have been
deleted or until end-of-file is reached on standard input.
-If there exists a file \fB.wishrc\fR in the home directory of
-the user, \fBwish\fR evaluates the file as a Tcl script
-just before reading the first command from standard input.
+If there exists a file
+.QW \fB.wishrc\fR
+in the home directory of the user, \fBwish\fR evaluates the file as a
+Tcl script just before reading the first command from standard input.
.PP
-If \fBwish\fR is invoked with an initial \fIfileName\fR argument, then
+If arguments to \fBwish\fR do specify a \fIfileName\fR, then
\fIfileName\fR is treated as the name of a script file.
\fBWish\fR will evaluate the script in \fIfileName\fR (which
presumably creates a user interface), then it will respond to events
until all windows have been deleted.
Commands will not be read from standard input.
-There is no automatic evaluation of \fB.wishrc\fR when the name
-of a script file is presented on the \fBwish\fR command line,
+There is no automatic evaluation of
+.QW \fB.wishrc\fR
+when the name of a script file is presented on the \fBwish\fR command line,
but the script file can always \fBsource\fR it if desired.
-
-.SH "OPTIONS"
+.PP
+Note that on Windows, the \fBwish\fIversion\fB.exe\fR program varies
+from the \fBtclsh\fIversion\fB.exe\fR program in an additional
+important way: it does not connect to a standard Windows console and
+is instead a windowed program. Because of this, it additionally
+provides access to its own \fBconsole\fR command.
+.SH "OPTION PROCESSING"
.PP
\fBWish\fR automatically processes all of the command-line options
described in the \fBOPTIONS\fR summary above.
Any other command-line arguments besides these are passed through
to the application using the \fBargc\fR and \fBargv\fR variables
described later.
-
.SH "APPLICATION NAME AND CLASS"
.PP
The name of the application, which is used for purposes such as
\fBsend\fR commands, is taken from the \fB\-name\fR option,
if it is specified; otherwise it is taken from \fIfileName\fR,
if it is specified, or from the command name by which
-\fBwish\fR was invoked. In the last two cases, if the name contains a ``/''
+\fBwish\fR was invoked. In the last two cases, if the name contains a
+.QW /
character, then only the characters after the last slash are used
as the application name.
.PP
@@ -96,7 +117,6 @@ The class of the application, which is used for purposes such as
specifying options with a \fBRESOURCE_MANAGER\fR property or .Xdefaults
file, is the same as its name except that the first letter is
capitalized.
-
.SH "VARIABLES"
.PP
\fBWish\fR sets the following Tcl variables:
@@ -107,8 +127,8 @@ not including the options described above.
.TP 15
\fBargv\fR
Contains a Tcl list whose elements are the \fIarg\fR arguments
-that follow a \fB\-\|\-\fR option or don't match any of the
-options described in OPTIONS above, in order, or an empty string
+that follow a \fB\-\|\-\fR option or do not match any of the
+options described in \fBOPTIONS\fR above, in order, or an empty string
if there are no such arguments.
.TP 15
\fBargv0\fR
@@ -126,7 +146,6 @@ window's geometry.
Contains 1 if \fBwish\fR is reading commands interactively (\fIfileName\fR
was not specified and standard input is a terminal-like
device), 0 otherwise.
-
.SH "SCRIPT FILES"
.PP
If you create a Tcl script in a file whose first line is
@@ -136,8 +155,8 @@ If you create a Tcl script in a file whose first line is
then you can invoke the script file directly from your shell if
you mark it as executable.
This assumes that \fBwish\fR has been installed in the default
-location in /usr/local/bin; if it's installed somewhere else
-then you'll have to modify the above line to match.
+location in /usr/local/bin; if it is installed somewhere else
+then you will have to modify the above line to match.
Many UNIX systems do not allow the \fB#!\fR line to exceed about
30 characters in length, so be sure that the \fBwish\fR executable
can be accessed with a short file name.
@@ -150,7 +169,7 @@ following three lines:
exec wish "$0" "$@"\fR
.CE
This approach has three advantages over the approach in the previous
-paragraph. First, the location of the \fBwish\fR binary doesn't have
+paragraph. First, the location of the \fBwish\fR binary does not have
to be hard-wired into the script: it can be anywhere in your shell
search path. Second, it gets around the 30-character file name limit
in the previous approach.
@@ -168,27 +187,31 @@ When \fBwish\fR starts up, it treats all three lines as comments,
since the backslash at the end of the second line causes the third
line to be treated as part of the comment on the second line.
.PP
-.VS 8.4
The end of a script file may be marked either by the physical end of
-the medium, or by the character, '\\032' ('\\u001a', control-Z).
+the medium, or by the character,
+.QW \e032
+.PQ \eu001a ", control-Z" .
If this character is present in the file, the \fBwish\fR application
will read text up to but not including the character. An application
that requires this character in the file may encode it as
-``\\032'', ``\\x1a'', or ``\\u001a''; or may generate it by use of commands
-such as \fBformat\fR or \fBbinary\fR.
-.VE
+.QW \e032 ,
+.QW \ex1a ,
+or
+.QW \eu001a ;
+or may generate it by use of commands such as \fBformat\fR or \fBbinary\fR.
.SH PROMPTS
.PP
When \fBwish\fR is invoked interactively it normally prompts for each
-command with ``\fB% \fR''. You can change the prompt by setting the
+command with
+.QW "\fB% \fR" .
+You can change the prompt by setting the
variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR. If variable
\fBtcl_prompt1\fR exists then it must consist of a Tcl script
to output a prompt; instead of outputting a prompt \fBwish\fR
will evaluate the script in \fBtcl_prompt1\fR.
The variable \fBtcl_prompt2\fR is used in a similar way when
-a newline is typed but the current command isn't yet complete;
-if \fBtcl_prompt2\fR isn't set then no prompt is output for
+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 KEYWORDS
shell, toolkit
diff --git a/doc/wm.n b/doc/wm.n
index f234b6d..93858ef 100644
--- a/doc/wm.n
+++ b/doc/wm.n
@@ -6,7 +6,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
-.TH wm n 8.4 Tk "Tk Built-In Commands"
+.TH wm n 8.5 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -14,7 +14,6 @@ wm \- Communicate with window manager
.SH SYNOPSIS
\fBwm\fR \fIoption window \fR?\fIargs\fR?
.BE
-
.SH DESCRIPTION
.PP
The \fBwm\fR command is used to interact with window managers in
@@ -42,7 +41,6 @@ a Tcl list containing four elements, which are the current values
of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
(if no aspect restrictions are in effect, then an empty string is
returned).
-.VS 8.4
.TP
\fBwm attributes \fIwindow\fR
.TP
@@ -54,66 +52,85 @@ with a window. The first form returns a list of the platform specific
flags and their values. The second form returns the value for the
specific option. The third form sets one or more of the values. The
values are as follows:
-.PP
-On Windows, the following attributes may be set.
.RS
+.PP
+All platforms support the following attributes (though X11 users
+should see the notes below):
.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).
+\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.
-.RE
+.VE 8.5
.PP
On Mac OS X, the following attributes may be set.
-.RS
+.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\-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\-topmost\fR
-Specifies whether this is a topmost window (displays above all other windows).
-.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. "systemTransparent".
-.TP
-\fB\-fullscreen\fR
-Places the window in a mode that takes up the entire main screen and hides
-the dock and menu bar.
-.RE
+color with some alpha, e.g.
+.QW systemTransparent .
.PP
-On X11, there are currently no special attribute values.
-.VE 8.4
+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\-zoomed\fR
+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.
+.RE
.TP
\fBwm client \fIwindow\fR ?\fIname\fR?
If \fIname\fR is specified, this command stores \fIname\fR (which
@@ -122,7 +139,7 @@ the host on which the application is executing) in \fIwindow\fR's
\fBWM_CLIENT_MACHINE\fR property for use by the window manager or
session manager.
The command returns an empty string in this case.
-If \fIname\fR isn't specified, the command returns the last name
+If \fIname\fR is not specified, the command returns the last name
set in a \fBwm client\fR command for \fIwindow\fR.
If \fIname\fR is specified as an empty string, the command deletes the
\fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR.
@@ -131,7 +148,9 @@ If \fIname\fR is specified as an empty string, the command deletes the
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.
-If \fIwindowList\fR isn't specified, the command returns a list
+.RS
+.PP
+If \fIwindowList\fR is not specified, the command returns a list
whose elements are the names of the windows in the \fBWM_COLORMAP_WINDOWS\fR
property.
If \fIwindowList\fR is specified, it consists of a list of window
@@ -140,6 +159,7 @@ property with the given windows and returns an empty string.
The \fBWM_COLORMAP_WINDOWS\fR property should normally contain a
list of the internal windows within \fIwindow\fR whose colormaps differ
from their parents.
+.PP
The order of the windows in the property indicates a priority order:
the window manager will attempt to install as many colormaps as possible
from the head of this list when \fIwindow\fR gets the colormap focus.
@@ -152,6 +172,7 @@ whose colormaps differ from their parents, followed by the top-level
itself; the order of the internal windows is undefined.
See the ICCCM documentation for more information on the
\fBWM_COLORMAP_WINDOWS\fR property.
+.RE
.TP
\fBwm command \fIwindow\fR ?\fIvalue\fR?
If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's
@@ -159,7 +180,7 @@ If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's
session manager and returns an empty string.
\fIValue\fR must have proper list structure; the elements should
contain the words of the command used to invoke the application.
-If \fIvalue\fR isn't specified then the command returns the last value
+If \fIvalue\fR is not specified then the command returns the last value
set in a \fBwm command\fR command for \fIwindow\fR.
If \fIvalue\fR is specified as an empty string, the command
deletes the \fBWM_COMMAND\fR property from \fIwindow\fR.
@@ -179,6 +200,8 @@ to the command, then it specifies the focus model for \fIwindow\fR.
In this case the command returns an empty string. If no additional
argument is supplied, then the command returns the current focus
model for \fIwindow\fR.
+.RS
+.PP
An \fBactive\fR focus model means that \fIwindow\fR will claim the
input focus for itself or its descendants, even at times when
the focus is currently in some other application. \fBPassive\fR means that
@@ -188,16 +211,22 @@ once the focus has been given to \fIwindow\fR or one of its descendants,
the application may re-assign the focus among \fIwindow\fR's descendants.
The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR command
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
+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
-.VS
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
window whose parent is the root or virtual root). If \fIwindow\fR
-hasn't been reparented by the window manager then the command returns
+has not been reparented by the window manager then the command returns
the platform specific window identifier for \fIwindow\fR.
-.VE
.TP
\fBwm geometry \fIwindow\fR ?\fInewGeometry\fR?
If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR
@@ -209,9 +238,12 @@ the form \fB=\fIwidth\fBx\fIheight\fB\(+-\fIx\fB\(+-\fIy\fR, where
any of \fB=\fR, \fIwidth\fBx\fIheight\fR, or \fB\(+-\fIx\fB\(+-\fIy\fR
may be omitted. \fIWidth\fR and \fIheight\fR are positive integers
specifying the desired dimensions of \fIwindow\fR. If \fIwindow\fR
-is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions
+is gridded (see \fBGRIDDED GEOMETRY MANAGEMENT\fR below) then the dimensions
are specified in grid units; otherwise they are specified in pixel
-units. \fIX\fR and \fIy\fR specify the desired location of
+units.
+.RS
+.PP
+\fIX\fR and \fIy\fR specify the desired location of
\fIwindow\fR on the screen, in pixels.
If \fIx\fR is preceded by \fB+\fR, it specifies
the number of pixels between the left edge of the screen and the left
@@ -223,10 +255,12 @@ number of pixels between the top of the screen and the top
of \fIwindow\fR's border; if \fIy\fR is preceded by \fB\-\fR then
it specifies the number of pixels between the bottom of \fIwindow\fR's
border and the bottom of the screen.
+.PP
If \fInewGeometry\fR is specified as an empty string then any
existing user-specified geometry for \fIwindow\fR is cancelled, and
the window will revert to the size requested internally by its
widgets.
+.RE
.TP
\fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR?
This command indicates that \fIwindow\fR is to be managed as a
@@ -243,20 +277,25 @@ that are non-negative integers.
Tk will pass this information to the window manager; during
manual resizing, the window manager will restrict the window's size
to one of these acceptable sizes.
+.RS
+.PP
Furthermore, during manual resizing the window manager will display
the window's current size in terms of grid units rather than pixels.
If \fIbaseWidth\fR etc. are all specified as empty strings, then
\fIwindow\fR will no longer be managed as a gridded window. If
\fIbaseWidth\fR etc. are specified then the return value is an
empty string.
+.PP
Otherwise the return value is a Tcl list containing
four elements corresponding to the current \fIbaseWidth\fR,
\fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR; if
\fIwindow\fR is not currently gridded, then an empty string
is returned.
+.PP
Note: this command should not be needed very often, since the
\fBTk_SetGrid\fR library procedure and the \fBsetGrid\fR option
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
@@ -266,7 +305,7 @@ leader is iconified. \fIPathName\fR may be specified as an empty string to
remove \fIwindow\fR from any group association. If \fIpathName\fR is
specified then the command returns an empty string; otherwise it
returns the path name of \fIwindow\fR's current group leader, or an empty
-string if \fIwindow\fR isn't part of any group.
+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
@@ -280,7 +319,9 @@ 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:
-\fBwm iconbitmap \fIwindow\fR ?\fB\-default\fR? ?\fIimage\fR?.
+.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.
@@ -291,9 +332,10 @@ file for which the shell has assigned an icon. Tcl will
first test if the file contains an icon, then if it has an assigned
icon, and finally, if that fails, test for
a bitmap.
+.RE
.TP
\fBwm iconify \fIwindow\fR
-Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR hasn't
+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
@@ -315,11 +357,35 @@ returns the name of the current icon mask associated with
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
-string is returned as result. If \fInewName\fR isn't specified
+string is returned as result. If \fInewName\fR is not specified
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
+time of invocation. If the images are later changed, this is not
+reflected to the titlebar icons. Multiple images are accepted to allow
+different images sizes (e.g., 16x16 and 32x32) to be provided. The window
+manager may scale provided icons to an appropriate size.
+.RS
+.PP
+On Windows, the images are packed into a Windows icon structure.
+This will override an ico specified to \fBwm iconbitmap\fR, and
+vice versa.
+.PP
+On X, the images are arranged into the _NET_WM_ICON X property, which
+most modern window managers support. A \fBwm iconbitmap\fR may exist
+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
@@ -342,10 +408,19 @@ returned. Otherwise the command returns the path name of the
current icon window for \fIwindow\fR, or an empty string if there
is no icon window currently specified for \fIwindow\fR.
Button press events are disabled for \fIwindow\fR as long as it is
-an icon window; this is needed in order to allow window managers
-to ``own'' those events.
+an icon window; this is needed in order to allow window managers to
+.QW own
+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
+with this command. Attempting to pass any other widget type will raise
+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.
@@ -400,7 +475,8 @@ If \fIwho\fR is specified, then the command returns an empty string.
Otherwise it returns \fBuser\fR or \fBprogram\fR to indicate the
source of the window's current position, or an empty string if
no source has been specified yet. Most window managers interpret
-``no source'' as equivalent to \fBprogram\fR.
+.QW "no source"
+as equivalent to \fBprogram\fR.
Tk will automatically set the position source to \fBuser\fR
when a \fBwm geometry\fR command is invoked, unless the source has
been set explicitly to \fBprogram\fR.
@@ -419,7 +495,7 @@ protocol handler for \fIname\fR, and \fIcommand\fR will
be invoked in the future whenever the window manager sends a
message to the client for that protocol.
In this case the command returns an empty string.
-If \fIname\fR is specified but \fIcommand\fR isn't, then the current
+If \fIname\fR is specified but \fIcommand\fR is not, then the current
command for \fIname\fR is returned, or an empty string if there
is no handler defined for \fIname\fR.
If \fIcommand\fR is specified as an empty string then the current
@@ -432,8 +508,8 @@ are currently defined for \fIwindow\fR.
.RS
.PP
Tk always defines a protocol handler for \fBWM_DELETE_WINDOW\fR, even if
-you haven't asked for one with \fBwm protocol\fR.
-If a \fBWM_DELETE_WINDOW\fR message arrives when you haven't defined
+you have not asked for one with \fBwm protocol\fR.
+If a \fBWM_DELETE_WINDOW\fR message arrives when you have not defined
a handler, then Tk handles the message by destroying the window for
which it was received.
.RE
@@ -467,18 +543,19 @@ If \fIwho\fR is specified, then the command returns an empty string.
Otherwise it returns \fBuser\fR or \fBwindow\fR to indicate the
source of the window's current size, or an empty string if
no source has been specified yet. Most window managers interpret
-``no source'' as equivalent to \fBprogram\fR.
+.QW "no source"
+as equivalent to \fBprogram\fR.
.TP
-\fBwm stackorder \fIwindow\fR ?\fIisabove|isbelow window\fR?
-The stackorder command returns a list of toplevel windows
+\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
window's children that are toplevels. Only those toplevels
that are currently mapped to the screen are returned.
-The stackorder command can also be used to determine if one
+The \fBstackorder\fR command can also be used to determine if one
toplevel is positioned above or below a second toplevel.
-When two window arguments separated by either \fIisabove\fR or
-\fIisbelow\fR are passed, a boolean result indicates whether
+When two window arguments separated by either \fBisabove\fR or
+\fBisbelow\fR are passed, a boolean result indicates whether
or not the first window is currently above or below the second
window in the stacking order.
.TP
@@ -497,7 +574,7 @@ iconwindow\fR command). The \fBicon\fR state cannot be set.
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
-case the command returns an empty string. If \fIstring\fR isn't
+case the command returns an empty string. If \fIstring\fR is not
specified then the command returns the current title for the
\fIwindow\fR. The title for a window defaults to its name.
.TP
@@ -509,7 +586,7 @@ path name for a top-level window). If \fImaster\fR
is specified as an empty string then \fIwindow\fR is marked as not
being a transient window any more. Otherwise the command
returns the path name of \fIwindow\fR's current master, or an
-empty string if \fIwindow\fR isn't currently a transient window.
+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.
@@ -552,6 +629,21 @@ all forms of resizing, including the window's natural size as
well as manual resizes and the \fBwm geometry\fR command.
You can also use the command \fBwm resizable\fR to completely
disable interactive resizing in one or both dimensions.
+.PP
+The \fBwm manage\fR and \fBwm forget\fR commands may be used to
+perform undocking and docking of windows. After a widget is managed
+by \fBwm manage\fR command, all other \fBwm\fR subcommands may be used
+with the widget. Only widgets created using the toplevel command may
+have an attached menu via the \fB\-menu\fR configure option. A toplevel
+widget may be used as a frame and managed with any of the other
+geometry managers after using the \fBwm forget\fR command. Any menu
+associated with a toplevel widget will be hidden when managed by
+another geometry managers. The menus will reappear once the window is
+managed by \fBwm\fR. All custom bindtags for widgets in a subtree
+that have their top-level widget changed via a \fBwm manage\fR or
+\fBwm forget\fR command, must be redone to adjust any top-level widget
+path in the bindtags. Bindtags that have not been customized do not
+have to be redone.
.SH "GRIDDED GEOMETRY MANAGEMENT"
.PP
Gridded geometry management occurs when one of the widgets of an
@@ -588,7 +680,7 @@ rather than pixels.
.SH BUGS
.PP
Most existing window managers appear to have bugs that affect the
-operation of the \fBwm\fR command. For example, some changes won't
+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
@@ -622,9 +714,7 @@ set y [expr {([winfo screenheight .]\-[winfo height .msg])/2}]
\fBwm title\fR .msg "Dialog demo"
\fBwm deiconify\fR .msg
.CE
-
.SH "SEE ALSO"
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
diff --git a/generic/README b/generic/README
index 285127c..6ac6bb4 100644
--- a/generic/README
+++ b/generic/README
@@ -1,3 +1,3 @@
This directory contains Tk source files that work on all the platforms
-where Tk runs (e.g. UNIX, PCs, and Macintoshes). Platform-specific
-sources are in the directories ../unix, ../win, ../macosx, and ../mac.
+where Tk runs (e.g. UNIX, PCs, and MacOSX). Platform-specific
+sources are in the directories ../unix, ../win, and ../macosx.
diff --git a/generic/default.h b/generic/default.h
index 0f67ebf..6156f4d 100644
--- a/generic/default.h
+++ b/generic/default.h
@@ -15,13 +15,11 @@
#define _DEFAULT
#if defined(__WIN32__) || defined(_WIN32) || \
- defined(__CYGWIN__) || defined(__MINGW32__)
+ defined(__MINGW32__)
# include "tkWinDefault.h"
#else
# if defined(MAC_OSX_TK)
# include "tkMacOSXDefault.h"
-# elif defined(MAC_TCL)
-# include "tkMacDefault.h"
# else
# include "tkUnixDefault.h"
# endif
diff --git a/generic/prolog.ps b/generic/prolog.ps
deleted file mode 100644
index 4076282..0000000
--- a/generic/prolog.ps
+++ /dev/null
@@ -1,283 +0,0 @@
-%%BeginProlog
-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).
-
-/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
-
-% Define the array ISOLatin1Encoding (which specifies how characters are
-% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript
-% level 2 is supposed to define it, but level 1 doesn't).
-
-systemdict /ISOLatin1Encoding known not {
- /ISOLatin1Encoding [
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /space /exclam /quotedbl /numbersign /dollar /percent /ampersand
- /quoteright
- /parenleft /parenright /asterisk /plus /comma /minus /period /slash
- /zero /one /two /three /four /five /six /seven
- /eight /nine /colon /semicolon /less /equal /greater /question
- /at /A /B /C /D /E /F /G
- /H /I /J /K /L /M /N /O
- /P /Q /R /S /T /U /V /W
- /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
- /quoteleft /a /b /c /d /e /f /g
- /h /i /j /k /l /m /n /o
- /p /q /r /s /t /u /v /w
- /x /y /z /braceleft /bar /braceright /asciitilde /space
- /space /space /space /space /space /space /space /space
- /space /space /space /space /space /space /space /space
- /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
- /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron
- /space /exclamdown /cent /sterling /currency /yen /brokenbar /section
- /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen
- /registered /macron
- /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph
- /periodcentered
- /cedillar /onesuperior /ordmasculine /guillemotright /onequarter
- /onehalf /threequarters /questiondown
- /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
- /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex
- /Idieresis
- /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
- /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn
- /germandbls
- /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
- /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex
- /idieresis
- /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
- /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn
- /ydieresis
- ] def
-} if
-
-% font ISOEncode font
-% This procedure changes the encoding of a font from the default
-% Postscript encoding to ISOLatin1. It's typically invoked just
-% before invoking "setfont". The body of this procedure comes from
-% Section 5.6.1 of the Postscript book.
-
-/ISOEncode {
- dup length dict begin
- {1 index /FID ne {def} {pop pop} ifelse} forall
- /Encoding ISOLatin1Encoding def
- currentdict
- end
-
- % I'm not sure why it's necessary to use "definefont" on this new
- % font, but it seems to be important; just use the name "Temporary"
- % for the font.
-
- /Temporary exch definefont
-} bind def
-
-% StrokeClip
-%
-% This procedure converts the current path into a clip area under
-% the assumption of stroking. It's a bit tricky because some Postscript
-% interpreters get errors during strokepath for dashed lines. If
-% this happens then turn off dashes and try again.
-
-/StrokeClip {
- {strokepath} stopped {
- (This Postscript printer gets limitcheck overflows when) =
- (stippling dashed lines; lines will be printed solid instead.) =
- [] 0 setdash strokepath} if
- clip
-} bind def
-
-% desiredSize EvenPixels closestSize
-%
-% The procedure below is used for stippling. Given the optimal size
-% of a dot in a stipple pattern in the current user coordinate system,
-% compute the closest size that is an exact multiple of the device's
-% pixel size. This allows stipple patterns to be displayed without
-% aliasing effects.
-
-/EvenPixels {
- % Compute exact number of device pixels per stipple dot.
- dup 0 matrix currentmatrix dtransform
- dup mul exch dup mul add sqrt
-
- % Round to an integer, make sure the number is at least 1, and compute
- % user coord distance corresponding to this.
- dup round dup 1 lt {pop 1} if
- exch div mul
-} bind def
-
-% width height string StippleFill --
-%
-% Given a path already set up and a clipping region generated from
-% it, this procedure will fill the clipping region with a stipple
-% pattern. "String" contains a proper image description of the
-% stipple pattern and "width" and "height" give its dimensions. Each
-% stipple dot is assumed to be about one unit across in the current
-% user coordinate system. This procedure trashes the graphics state.
-
-/StippleFill {
- % The following code is needed to work around a NeWSprint bug.
-
- /tmpstip 1 index def
-
- % Change the scaling so that one user unit in user coordinates
- % corresponds to the size of one stipple dot.
- 1 EvenPixels dup scale
-
- % Compute the bounding box occupied by the path (which is now
- % the clipping region), and round the lower coordinates down
- % to the nearest starting point for the stipple pattern. Be
- % careful about negative numbers, since the rounding works
- % differently on them.
-
- pathbbox
- 4 2 roll
- 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
- 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
-
- % Stack now: width height string y1 y2 x1 x2
- % Below is a doubly-nested for loop to iterate across this area
- % in units of the stipple pattern size, going up columns then
- % across rows, blasting out a stipple-pattern-sized rectangle at
- % each position
-
- 6 index exch {
- 2 index 5 index 3 index {
- % Stack now: width height string y1 y2 x y
-
- gsave
- 1 index exch translate
- 5 index 5 index true matrix tmpstip imagemask
- grestore
- } for
- pop
- } for
- pop pop pop pop pop
-} bind def
-
-% -- AdjustColor --
-% Given a color value already set for output by the caller, adjusts
-% that value to a grayscale or mono value if requested by the CL
-% variable.
-
-/AdjustColor {
- CL 2 lt {
- currentgray
- CL 0 eq {
- .5 lt {0} {1} ifelse
- } if
- setgray
- } if
-} bind def
-
-% x y strings spacing xoffset yoffset justify stipple DrawText --
-% This procedure does all of the real work of drawing text. The
-% color and font must already have been set by the caller, and the
-% following arguments must be on the stack:
-%
-% x, y - Coordinates at which to draw text.
-% strings - An array of strings, one for each line of the text item,
-% in order from top to bottom.
-% spacing - Spacing between lines.
-% xoffset - Horizontal offset for text bbox relative to x and y: 0 for
-% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.
-% yoffset - Vertical offset for text bbox relative to x and y: 0 for
-% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.
-% justify - 0 for left justification, 0.5 for center, 1 for right justify.
-% stipple - Boolean value indicating whether or not text is to be
-% drawn in stippled fashion. If text is stippled,
-% procedure StippleText must have been defined to call
-% StippleFill in the right way.
-%
-% Also, when this procedure is invoked, the color and font must already
-% have been set for the text.
-
-/DrawText {
- /stipple exch def
- /justify exch def
- /yoffset exch def
- /xoffset exch def
- /spacing exch def
- /strings exch def
-
- % First scan through all of the text to find the widest line.
-
- /lineLength 0 def
- strings {
- stringwidth pop
- dup lineLength gt {/lineLength exch def} {pop} ifelse
- newpath
- } forall
-
- % Compute the baseline offset and the actual font height.
-
- 0 0 moveto (TXygqPZ) false charpath
- pathbbox dup /baseline exch def
- exch pop exch sub /height exch def pop
- newpath
-
- % Translate coordinates first so that the origin is at the upper-left
- % corner of the text's bounding box. Remember that x and y for
- % positioning are still on the stack.
-
- translate
- lineLength xoffset mul
- strings length 1 sub spacing mul height add yoffset mul translate
-
- % Now use the baseline and justification information to translate so
- % that the origin is at the baseline and positioning point for the
- % first line of text.
-
- justify lineLength mul baseline neg translate
-
- % Iterate over each of the lines to output it. For each line,
- % compute its width again so it can be properly justified, then
- % display it.
-
- strings {
- dup stringwidth 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
- {
- char 0 3 -1 roll put
- currentpoint
- gsave
- char true charpath clip StippleText
- grestore
- char stringwidth translate
- moveto
- } forall
- grestore
- } {show} ifelse
- 0 spacing neg translate
- } forall
-} bind def
-
-%%EndProlog
diff --git a/generic/tk.decls b/generic/tk.decls
index 2424ee0..9037e75 100644
--- a/generic/tk.decls
+++ b/generic/tk.decls
@@ -4,9 +4,9 @@
# functions that are exported by the Tk library via the stubs table.
# This file is used to generate the tkDecls.h, tkPlatDecls.h,
# tkStub.c, and tkPlatStub.c files.
-#
#
# Copyright (c) 1998-2000 Ajuba Solutions.
+# 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.
@@ -26,1102 +26,886 @@ hooks {tkPlat tkInt tkIntPlat tkIntXlib}
# to preserve backwards compatibility.
declare 0 generic {
- void Tk_MainLoop (void)
+ void Tk_MainLoop(void)
}
-
declare 1 generic {
- XColor *Tk_3DBorderColor (Tk_3DBorder border)
+ XColor *Tk_3DBorderColor(Tk_3DBorder border)
}
-
declare 2 generic {
- GC Tk_3DBorderGC (Tk_Window tkwin, Tk_3DBorder border,
+ GC Tk_3DBorderGC(Tk_Window tkwin, Tk_3DBorder border,
int which)
}
-
declare 3 generic {
- void Tk_3DHorizontalBevel (Tk_Window tkwin,
+ void Tk_3DHorizontalBevel(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border, int x,
int y, int width, int height, int leftIn,
int rightIn, int topBevel, int relief)
}
-
declare 4 generic {
- void Tk_3DVerticalBevel (Tk_Window tkwin,
+ 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,
+ void Tk_AddOption(Tk_Window tkwin, CONST char *name,
CONST char *value, int priority)
}
-
declare 6 generic {
- void Tk_BindEvent (Tk_BindingTable bindingTable,
+ void Tk_BindEvent(Tk_BindingTable bindingTable,
XEvent *eventPtr, Tk_Window tkwin, int numObjects,
ClientData *objectPtr)
}
-
declare 7 generic {
- void Tk_CanvasDrawableCoords (Tk_Canvas canvas,
+ void Tk_CanvasDrawableCoords(Tk_Canvas canvas,
double x, double y, short *drawableXPtr,
short *drawableYPtr)
}
-
declare 8 generic {
- void Tk_CanvasEventuallyRedraw (Tk_Canvas canvas, int x1, int y1,
+ void Tk_CanvasEventuallyRedraw(Tk_Canvas canvas, int x1, int y1,
int x2, int y2)
}
-
declare 9 generic {
- int Tk_CanvasGetCoord (Tcl_Interp *interp,
+ int Tk_CanvasGetCoord(Tcl_Interp *interp,
Tk_Canvas canvas, CONST char *str, double *doublePtr)
}
-
declare 10 generic {
- Tk_CanvasTextInfo *Tk_CanvasGetTextInfo (Tk_Canvas canvas)
+ Tk_CanvasTextInfo *Tk_CanvasGetTextInfo(Tk_Canvas canvas)
}
-
declare 11 generic {
- int Tk_CanvasPsBitmap (Tcl_Interp *interp,
+ int Tk_CanvasPsBitmap(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap, int x, int y,
int width, int height)
}
-
declare 12 generic {
- int Tk_CanvasPsColor (Tcl_Interp *interp,
+ int Tk_CanvasPsColor(Tcl_Interp *interp,
Tk_Canvas canvas, XColor *colorPtr)
}
-
declare 13 generic {
- int Tk_CanvasPsFont (Tcl_Interp *interp,
+ int Tk_CanvasPsFont(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Font font)
}
-
declare 14 generic {
- void Tk_CanvasPsPath (Tcl_Interp *interp,
+ void Tk_CanvasPsPath(Tcl_Interp *interp,
Tk_Canvas canvas, double *coordPtr, int numPoints)
}
-
declare 15 generic {
- int Tk_CanvasPsStipple (Tcl_Interp *interp,
+ int Tk_CanvasPsStipple(Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap)
}
-
declare 16 generic {
- double Tk_CanvasPsY (Tk_Canvas canvas, double y)
+ double Tk_CanvasPsY(Tk_Canvas canvas, double y)
}
-
declare 17 generic {
- void Tk_CanvasSetStippleOrigin (Tk_Canvas canvas, GC gc)
+ void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc)
}
-
declare 18 generic {
- int Tk_CanvasTagsParseProc (ClientData clientData, Tcl_Interp *interp,
+ int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp,
Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
}
-
declare 19 generic {
- char * Tk_CanvasTagsPrintProc (ClientData clientData, Tk_Window tkwin,
+ char *Tk_CanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
-
declare 20 generic {
- Tk_Window Tk_CanvasTkwin (Tk_Canvas canvas)
+ Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas)
}
-
declare 21 generic {
- void Tk_CanvasWindowCoords (Tk_Canvas canvas, double x, double y,
+ void Tk_CanvasWindowCoords(Tk_Canvas canvas, double x, double y,
short *screenXPtr, short *screenYPtr)
}
-
declare 22 generic {
- void Tk_ChangeWindowAttributes (Tk_Window tkwin, unsigned long valueMask,
+ void Tk_ChangeWindowAttributes(Tk_Window tkwin, unsigned long valueMask,
XSetWindowAttributes *attsPtr)
}
-
declare 23 generic {
- int Tk_CharBbox (Tk_TextLayout layout, int index, int *xPtr,
+ int Tk_CharBbox(Tk_TextLayout layout, int index, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr)
}
-
declare 24 generic {
- void Tk_ClearSelection (Tk_Window tkwin, Atom selection)
+ void Tk_ClearSelection(Tk_Window tkwin, Atom selection)
}
-
declare 25 generic {
- int Tk_ClipboardAppend (Tcl_Interp *interp,Tk_Window tkwin,
- Atom target, Atom format, char* buffer)
+ int Tk_ClipboardAppend(Tcl_Interp *interp, Tk_Window tkwin,
+ Atom target, Atom format, char *buffer)
}
-
declare 26 generic {
- int Tk_ClipboardClear (Tcl_Interp *interp, Tk_Window tkwin)
+ int Tk_ClipboardClear(Tcl_Interp *interp, Tk_Window tkwin)
}
-
declare 27 generic {
- int Tk_ConfigureInfo (Tcl_Interp *interp,
+ int Tk_ConfigureInfo(Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specs,
char *widgRec, CONST char *argvName, int flags)
}
-
declare 28 generic {
- int Tk_ConfigureValue (Tcl_Interp *interp,
+ int Tk_ConfigureValue(Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specs,
char *widgRec, CONST char *argvName, int flags)
}
-
declare 29 generic {
- int Tk_ConfigureWidget (Tcl_Interp *interp,
+ int Tk_ConfigureWidget(Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specs,
int argc, CONST84 char **argv, char *widgRec,
int flags)
}
-
declare 30 generic {
- void Tk_ConfigureWindow (Tk_Window tkwin,
+ void Tk_ConfigureWindow(Tk_Window tkwin,
unsigned int valueMask, XWindowChanges *valuePtr)
}
-
declare 31 generic {
- Tk_TextLayout Tk_ComputeTextLayout (Tk_Font font,
+ Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font,
CONST char *str, int numChars, int wrapLength,
Tk_Justify justify, int flags, int *widthPtr,
int *heightPtr)
}
-
declare 32 generic {
- Tk_Window Tk_CoordsToWindow (int rootX, int rootY, Tk_Window tkwin)
+ Tk_Window Tk_CoordsToWindow(int rootX, int rootY, Tk_Window tkwin)
}
-
declare 33 generic {
- unsigned long Tk_CreateBinding (Tcl_Interp *interp,
+ unsigned long Tk_CreateBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
CONST char *eventStr, CONST char *command, int append)
}
-
declare 34 generic {
- Tk_BindingTable Tk_CreateBindingTable (Tcl_Interp *interp)
+ Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp)
}
-
declare 35 generic {
- Tk_ErrorHandler Tk_CreateErrorHandler (Display *display,
+ Tk_ErrorHandler Tk_CreateErrorHandler(Display *display,
int errNum, int request, int minorCode,
Tk_ErrorProc *errorProc, ClientData clientData)
}
-
declare 36 generic {
- void Tk_CreateEventHandler (Tk_Window token,
+ void Tk_CreateEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
-
declare 37 generic {
- void Tk_CreateGenericHandler (Tk_GenericProc *proc, ClientData clientData)
+ void Tk_CreateGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
-
declare 38 generic {
- void Tk_CreateImageType (Tk_ImageType *typePtr)
+ void Tk_CreateImageType(Tk_ImageType *typePtr)
}
-
declare 39 generic {
- void Tk_CreateItemType (Tk_ItemType *typePtr)
+ void Tk_CreateItemType(Tk_ItemType *typePtr)
}
-
declare 40 generic {
- void Tk_CreatePhotoImageFormat (Tk_PhotoImageFormat *formatPtr)
+ void Tk_CreatePhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
}
-
declare 41 generic {
- void Tk_CreateSelHandler (Tk_Window tkwin,
+ void Tk_CreateSelHandler(Tk_Window tkwin,
Atom selection, Atom target,
Tk_SelectionProc *proc, ClientData clientData,
Atom format)
}
-
declare 42 generic {
- Tk_Window Tk_CreateWindow (Tcl_Interp *interp,
+ Tk_Window Tk_CreateWindow(Tcl_Interp *interp,
Tk_Window parent, CONST char *name, CONST char *screenName)
}
-
declare 43 generic {
- Tk_Window Tk_CreateWindowFromPath (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp, Tk_Window tkwin,
CONST char *pathName, CONST char *screenName)
}
-
declare 44 generic {
- int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name,
+ int Tk_DefineBitmap(Tcl_Interp *interp, CONST char *name,
CONST char *source, int width, int height)
}
-
declare 45 generic {
- void Tk_DefineCursor (Tk_Window window, Tk_Cursor cursor)
+ void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor)
}
-
declare 46 generic {
- void Tk_DeleteAllBindings (Tk_BindingTable bindingTable, ClientData object)
+ void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, ClientData object)
}
-
declare 47 generic {
- int Tk_DeleteBinding (Tcl_Interp *interp,
+ int Tk_DeleteBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
CONST char *eventStr)
}
-
declare 48 generic {
- void Tk_DeleteBindingTable (Tk_BindingTable bindingTable)
+ void Tk_DeleteBindingTable(Tk_BindingTable bindingTable)
}
-
declare 49 generic {
- void Tk_DeleteErrorHandler (Tk_ErrorHandler handler)
+ void Tk_DeleteErrorHandler(Tk_ErrorHandler handler)
}
-
declare 50 generic {
- void Tk_DeleteEventHandler (Tk_Window token,
+ void Tk_DeleteEventHandler(Tk_Window token,
unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
-
declare 51 generic {
- void Tk_DeleteGenericHandler (Tk_GenericProc *proc, ClientData clientData)
+ void Tk_DeleteGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
-
declare 52 generic {
- void Tk_DeleteImage (Tcl_Interp *interp, CONST char *name)
+ void Tk_DeleteImage(Tcl_Interp *interp, CONST char *name)
}
-
declare 53 generic {
- void Tk_DeleteSelHandler (Tk_Window tkwin, Atom selection, Atom target)
+ void Tk_DeleteSelHandler(Tk_Window tkwin, Atom selection, Atom target)
}
-
declare 54 generic {
- void Tk_DestroyWindow (Tk_Window tkwin)
+ void Tk_DestroyWindow(Tk_Window tkwin)
}
-
declare 55 generic {
- CONST84_RETURN char * Tk_DisplayName (Tk_Window tkwin)
+ CONST84_RETURN char *Tk_DisplayName(Tk_Window tkwin)
}
-
declare 56 generic {
- int Tk_DistanceToTextLayout (Tk_TextLayout layout, int x, int y)
+ int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x, int y)
}
-
declare 57 generic {
- void Tk_Draw3DPolygon (Tk_Window tkwin,
+ void Tk_Draw3DPolygon(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border,
XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
-
declare 58 generic {
- void Tk_Draw3DRectangle (Tk_Window tkwin, Drawable drawable,
+ void Tk_Draw3DRectangle(Tk_Window tkwin, Drawable drawable,
Tk_3DBorder border, int x, int y, int width, int height,
int borderWidth, int relief)
}
-
declare 59 generic {
- void Tk_DrawChars (Display *display, Drawable drawable, GC gc,
+ void Tk_DrawChars(Display *display, Drawable drawable, GC gc,
Tk_Font tkfont, CONST char *source, int numBytes, int x, int y)
}
-
declare 60 generic {
- void Tk_DrawFocusHighlight (Tk_Window tkwin, GC gc, int width,
+ void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width,
Drawable drawable)
}
-
declare 61 generic {
- void Tk_DrawTextLayout (Display *display,
+ void Tk_DrawTextLayout(Display *display,
Drawable drawable, GC gc, Tk_TextLayout layout,
int x, int y, int firstChar, int lastChar)
}
-
declare 62 generic {
- void Tk_Fill3DPolygon (Tk_Window tkwin,
+ void Tk_Fill3DPolygon(Tk_Window tkwin,
Drawable drawable, Tk_3DBorder border,
XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
-
declare 63 generic {
- void Tk_Fill3DRectangle (Tk_Window tkwin,
+ 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)
+ Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp, CONST char *imageName)
}
-
declare 65 generic {
- Font Tk_FontId (Tk_Font font)
+ Font Tk_FontId(Tk_Font font)
}
-
declare 66 generic {
- void Tk_Free3DBorder (Tk_3DBorder border)
+ void Tk_Free3DBorder(Tk_3DBorder border)
}
-
declare 67 generic {
- void Tk_FreeBitmap (Display *display, Pixmap bitmap)
+ void Tk_FreeBitmap(Display *display, Pixmap bitmap)
}
-
declare 68 generic {
- void Tk_FreeColor (XColor *colorPtr)
+ void Tk_FreeColor(XColor *colorPtr)
}
-
declare 69 generic {
- void Tk_FreeColormap (Display *display, Colormap colormap)
+ void Tk_FreeColormap(Display *display, Colormap colormap)
}
-
declare 70 generic {
- void Tk_FreeCursor (Display *display, Tk_Cursor cursor)
+ void Tk_FreeCursor(Display *display, Tk_Cursor cursor)
}
-
declare 71 generic {
- void Tk_FreeFont (Tk_Font f)
+ void Tk_FreeFont(Tk_Font f)
}
-
declare 72 generic {
- void Tk_FreeGC (Display *display, GC gc)
+ void Tk_FreeGC(Display *display, GC gc)
}
-
declare 73 generic {
- void Tk_FreeImage (Tk_Image image)
+ void Tk_FreeImage(Tk_Image image)
}
-
declare 74 generic {
- void Tk_FreeOptions (Tk_ConfigSpec *specs,
+ void Tk_FreeOptions(Tk_ConfigSpec *specs,
char *widgRec, Display *display, int needFlags)
}
-
declare 75 generic {
- void Tk_FreePixmap (Display *display, Pixmap pixmap)
+ void Tk_FreePixmap(Display *display, Pixmap pixmap)
}
-
declare 76 generic {
- void Tk_FreeTextLayout (Tk_TextLayout textLayout)
+ void Tk_FreeTextLayout(Tk_TextLayout textLayout)
}
-
declare 77 generic {
- void Tk_FreeXId (Display *display, XID xid)
+ void Tk_FreeXId(Display *display, XID xid)
}
-
declare 78 generic {
- GC Tk_GCForColor (XColor *colorPtr, Drawable drawable)
+ GC Tk_GCForColor(XColor *colorPtr, Drawable drawable)
}
-
declare 79 generic {
- void Tk_GeometryRequest (Tk_Window tkwin, int reqWidth, int reqHeight)
+ void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight)
}
-
declare 80 generic {
- Tk_3DBorder Tk_Get3DBorder (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_3DBorder Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid colorName)
}
-
declare 81 generic {
- void Tk_GetAllBindings (Tcl_Interp *interp,
+ void Tk_GetAllBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object)
}
-
declare 82 generic {
- int Tk_GetAnchor (Tcl_Interp *interp,
+ int Tk_GetAnchor(Tcl_Interp *interp,
CONST char *str, Tk_Anchor *anchorPtr)
}
-
declare 83 generic {
- CONST84_RETURN char * Tk_GetAtomName (Tk_Window tkwin, Atom atom)
+ CONST84_RETURN char *Tk_GetAtomName(Tk_Window tkwin, Atom atom)
}
-
declare 84 generic {
- CONST84_RETURN char * Tk_GetBinding (Tcl_Interp *interp,
+ CONST84_RETURN char *Tk_GetBinding(Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object,
CONST char *eventStr)
}
-
declare 85 generic {
- Pixmap Tk_GetBitmap (Tcl_Interp *interp, Tk_Window tkwin, CONST char * str)
+ Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)
}
-
declare 86 generic {
- Pixmap Tk_GetBitmapFromData (Tcl_Interp *interp,
+ Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *source, int width, int height)
}
-
declare 87 generic {
- int Tk_GetCapStyle (Tcl_Interp *interp, CONST char *str, int *capPtr)
+ int Tk_GetCapStyle(Tcl_Interp *interp, CONST char *str, int *capPtr)
}
-
declare 88 generic {
- XColor * Tk_GetColor (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)
+ XColor *Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)
}
-
declare 89 generic {
- XColor * Tk_GetColorByValue (Tk_Window tkwin, XColor *colorPtr)
+ XColor *Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr)
}
-
declare 90 generic {
- Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin,
+ Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
CONST char *str)
}
-
declare 91 generic {
- Tk_Cursor Tk_GetCursor (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid str)
}
-
declare 92 generic {
- Tk_Cursor Tk_GetCursorFromData (Tcl_Interp *interp,
+ Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *source, CONST char *mask,
int width, int height, int xHot, int yHot,
Tk_Uid fg, Tk_Uid bg)
}
-
declare 93 generic {
- Tk_Font Tk_GetFont (Tcl_Interp *interp,
+ Tk_Font Tk_GetFont(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *str)
}
-
declare 94 generic {
- Tk_Font Tk_GetFontFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 95 generic {
- void Tk_GetFontMetrics (Tk_Font font, Tk_FontMetrics *fmPtr)
+ void Tk_GetFontMetrics(Tk_Font font, Tk_FontMetrics *fmPtr)
}
-
declare 96 generic {
- GC Tk_GetGC (Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr)
+ 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,
+ Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, CONST char *name,
Tk_ImageChangedProc *changeProc, ClientData clientData)
}
-
declare 98 generic {
- ClientData Tk_GetImageMasterData (Tcl_Interp *interp,
+ ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
CONST char *name, Tk_ImageType **typePtrPtr)
}
-
declare 99 generic {
- Tk_ItemType * Tk_GetItemTypes (void)
+ Tk_ItemType *Tk_GetItemTypes(void)
}
-
declare 100 generic {
- int Tk_GetJoinStyle (Tcl_Interp *interp, CONST char *str, int *joinPtr)
+ int Tk_GetJoinStyle(Tcl_Interp *interp, CONST char *str, int *joinPtr)
}
-
declare 101 generic {
- int Tk_GetJustify (Tcl_Interp *interp,
+ int Tk_GetJustify(Tcl_Interp *interp,
CONST char *str, Tk_Justify *justifyPtr)
}
-
declare 102 generic {
- int Tk_GetNumMainWindows (void)
+ int Tk_GetNumMainWindows(void)
}
-
declare 103 generic {
- Tk_Uid Tk_GetOption (Tk_Window tkwin, CONST char *name,
+ Tk_Uid Tk_GetOption(Tk_Window tkwin, CONST char *name,
CONST char *className)
}
-
declare 104 generic {
- int Tk_GetPixels (Tcl_Interp *interp,
+ int Tk_GetPixels(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *str, int *intPtr)
}
-
declare 105 generic {
- Pixmap Tk_GetPixmap (Display *display, Drawable d,
+ Pixmap Tk_GetPixmap(Display *display, Drawable d,
int width, int height, int depth)
}
-
declare 106 generic {
- int Tk_GetRelief (Tcl_Interp *interp, CONST char *name, int *reliefPtr)
+ int Tk_GetRelief(Tcl_Interp *interp, CONST char *name, int *reliefPtr)
}
-
declare 107 generic {
- void Tk_GetRootCoords (Tk_Window tkwin, int *xPtr, int *yPtr)
+ void Tk_GetRootCoords(Tk_Window tkwin, int *xPtr, int *yPtr)
}
-
declare 108 generic {
- int Tk_GetScrollInfo (Tcl_Interp *interp,
+ int Tk_GetScrollInfo(Tcl_Interp *interp,
int argc, CONST84 char **argv, double *dblPtr, int *intPtr)
}
-
declare 109 generic {
- int Tk_GetScreenMM (Tcl_Interp *interp,
+ int Tk_GetScreenMM(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *str, double *doublePtr)
}
-
declare 110 generic {
- int Tk_GetSelection (Tcl_Interp *interp,
+ 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)
+ Tk_Uid Tk_GetUid(CONST char *str)
}
-
declare 112 generic {
- Visual * Tk_GetVisual (Tcl_Interp *interp,
+ Visual *Tk_GetVisual(Tcl_Interp *interp,
Tk_Window tkwin, CONST char *str, int *depthPtr,
Colormap *colormapPtr)
}
-
declare 113 generic {
- void Tk_GetVRootGeometry (Tk_Window tkwin,
+ void Tk_GetVRootGeometry(Tk_Window tkwin,
int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)
}
-
declare 114 generic {
- int Tk_Grab (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)
+ int Tk_Grab(Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)
}
-
declare 115 generic {
- void Tk_HandleEvent (XEvent *eventPtr)
+ void Tk_HandleEvent(XEvent *eventPtr)
}
-
declare 116 generic {
- Tk_Window Tk_IdToWindow (Display *display, Window window)
+ Tk_Window Tk_IdToWindow(Display *display, Window window)
}
-
declare 117 generic {
- void Tk_ImageChanged (Tk_ImageMaster master, int x, int y,
+ void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
-
declare 118 generic {
- int Tk_Init (Tcl_Interp *interp)
+ int Tk_Init(Tcl_Interp *interp)
}
-
declare 119 generic {
- Atom Tk_InternAtom (Tk_Window tkwin, CONST char *name)
+ Atom Tk_InternAtom(Tk_Window tkwin, CONST char *name)
}
-
declare 120 generic {
- int Tk_IntersectTextLayout (Tk_TextLayout layout, int x, int y,
+ int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y,
int width, int height)
}
-
declare 121 generic {
- void Tk_MaintainGeometry (Tk_Window slave,
+ void Tk_MaintainGeometry(Tk_Window slave,
Tk_Window master, int x, int y, int width, int height)
}
-
declare 122 generic {
- Tk_Window Tk_MainWindow (Tcl_Interp *interp)
+ Tk_Window Tk_MainWindow(Tcl_Interp *interp)
}
-
declare 123 generic {
- void Tk_MakeWindowExist (Tk_Window tkwin)
+ void Tk_MakeWindowExist(Tk_Window tkwin)
}
-
declare 124 generic {
- void Tk_ManageGeometry (Tk_Window tkwin,
- Tk_GeomMgr *mgrPtr, ClientData clientData)
+ void Tk_ManageGeometry(Tk_Window tkwin,
+ CONST Tk_GeomMgr *mgrPtr, ClientData clientData)
}
-
declare 125 generic {
- void Tk_MapWindow (Tk_Window tkwin)
+ void Tk_MapWindow(Tk_Window tkwin)
}
-
declare 126 generic {
- int Tk_MeasureChars (Tk_Font tkfont,
+ int Tk_MeasureChars(Tk_Font tkfont,
CONST char *source, int numBytes, int maxPixels,
int flags, int *lengthPtr)
}
-
declare 127 generic {
- void Tk_MoveResizeWindow (Tk_Window tkwin,
+ void Tk_MoveResizeWindow(Tk_Window tkwin,
int x, int y, int width, int height)
}
-
declare 128 generic {
- void Tk_MoveWindow (Tk_Window tkwin, int x, int y)
+ void Tk_MoveWindow(Tk_Window tkwin, int x, int y)
}
-
declare 129 generic {
- void Tk_MoveToplevelWindow (Tk_Window tkwin, int x, int y)
+ void Tk_MoveToplevelWindow(Tk_Window tkwin, int x, int y)
}
-
declare 130 generic {
- CONST84_RETURN char * Tk_NameOf3DBorder (Tk_3DBorder border)
+ CONST84_RETURN char *Tk_NameOf3DBorder(Tk_3DBorder border)
}
-
declare 131 generic {
- CONST84_RETURN char * Tk_NameOfAnchor (Tk_Anchor anchor)
+ CONST84_RETURN char *Tk_NameOfAnchor(Tk_Anchor anchor)
}
-
declare 132 generic {
- CONST84_RETURN char * Tk_NameOfBitmap (Display *display, Pixmap bitmap)
+ CONST84_RETURN char *Tk_NameOfBitmap(Display *display, Pixmap bitmap)
}
-
declare 133 generic {
- CONST84_RETURN char * Tk_NameOfCapStyle (int cap)
+ CONST84_RETURN char *Tk_NameOfCapStyle(int cap)
}
-
declare 134 generic {
- CONST84_RETURN char * Tk_NameOfColor (XColor *colorPtr)
+ CONST84_RETURN char *Tk_NameOfColor(XColor *colorPtr)
}
-
declare 135 generic {
- CONST84_RETURN char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor)
+ CONST84_RETURN char *Tk_NameOfCursor(Display *display, Tk_Cursor cursor)
}
-
declare 136 generic {
- CONST84_RETURN char * Tk_NameOfFont (Tk_Font font)
+ CONST84_RETURN char *Tk_NameOfFont(Tk_Font font)
}
-
declare 137 generic {
- CONST84_RETURN char * Tk_NameOfImage (Tk_ImageMaster imageMaster)
+ CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster imageMaster)
}
-
declare 138 generic {
- CONST84_RETURN char * Tk_NameOfJoinStyle (int join)
+ CONST84_RETURN char *Tk_NameOfJoinStyle(int join)
}
-
declare 139 generic {
- CONST84_RETURN char * Tk_NameOfJustify (Tk_Justify justify)
+ CONST84_RETURN char *Tk_NameOfJustify(Tk_Justify justify)
}
-
declare 140 generic {
- CONST84_RETURN char * Tk_NameOfRelief (int relief)
+ CONST84_RETURN char *Tk_NameOfRelief(int relief)
}
-
declare 141 generic {
- Tk_Window Tk_NameToWindow (Tcl_Interp *interp,
+ Tk_Window Tk_NameToWindow(Tcl_Interp *interp,
CONST char *pathName, Tk_Window tkwin)
}
-
declare 142 generic {
- void Tk_OwnSelection (Tk_Window tkwin,
+ void Tk_OwnSelection(Tk_Window tkwin,
Atom selection, Tk_LostSelProc *proc,
ClientData clientData)
}
-
declare 143 generic {
- int Tk_ParseArgv (Tcl_Interp *interp,
+ int Tk_ParseArgv(Tcl_Interp *interp,
Tk_Window tkwin, int *argcPtr, CONST84 char **argv,
Tk_ArgvInfo *argTable, int flags)
}
-
declare 144 generic {
- void Tk_PhotoPutBlock_NoComposite (Tk_PhotoHandle handle,
+ void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height)
}
-
declare 145 generic {
- void Tk_PhotoPutZoomedBlock_NoComposite (Tk_PhotoHandle handle,
+ 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 {
- int Tk_PhotoGetImage (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)
+ int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)
}
-
declare 147 generic {
- void Tk_PhotoBlank (Tk_PhotoHandle handle)
+ void Tk_PhotoBlank(Tk_PhotoHandle handle)
}
-
declare 148 generic {
- void Tk_PhotoExpand (Tk_PhotoHandle handle, int width, int height )
+ void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height )
}
-
declare 149 generic {
- void Tk_PhotoGetSize (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)
+ void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)
}
-
declare 150 generic {
- void Tk_PhotoSetSize (Tk_PhotoHandle handle, int width, int height)
+ void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height)
}
-
declare 151 generic {
- int Tk_PointToChar (Tk_TextLayout layout, int x, int y)
+ int Tk_PointToChar(Tk_TextLayout layout, int x, int y)
}
-
declare 152 generic {
- int Tk_PostscriptFontName (Tk_Font tkfont, Tcl_DString *dsPtr)
+ int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr)
}
-
declare 153 generic {
- void Tk_PreserveColormap (Display *display, Colormap colormap)
+ void Tk_PreserveColormap(Display *display, Colormap colormap)
}
-
declare 154 generic {
- void Tk_QueueWindowEvent (XEvent *eventPtr, Tcl_QueuePosition position)
+ void Tk_QueueWindowEvent(XEvent *eventPtr, Tcl_QueuePosition position)
}
-
declare 155 generic {
- void Tk_RedrawImage (Tk_Image image, int imageX,
+ void Tk_RedrawImage(Tk_Image image, int imageX,
int imageY, int width, int height,
Drawable drawable, int drawableX, int drawableY)
}
-
declare 156 generic {
- void Tk_ResizeWindow (Tk_Window tkwin, int width, int height)
+ void Tk_ResizeWindow(Tk_Window tkwin, int width, int height)
}
-
declare 157 generic {
- int Tk_RestackWindow (Tk_Window tkwin, int aboveBelow, Tk_Window other)
+ int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other)
}
-
declare 158 generic {
- Tk_RestrictProc *Tk_RestrictEvents (Tk_RestrictProc *proc,
+ Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc,
ClientData arg, ClientData *prevArgPtr)
}
-
declare 159 generic {
- int Tk_SafeInit (Tcl_Interp *interp)
+ int Tk_SafeInit(Tcl_Interp *interp)
}
-
declare 160 generic {
- CONST char * Tk_SetAppName (Tk_Window tkwin, CONST char *name)
+ CONST char *Tk_SetAppName(Tk_Window tkwin, CONST char *name)
}
-
declare 161 generic {
- void Tk_SetBackgroundFromBorder (Tk_Window tkwin, Tk_3DBorder border)
+ void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border)
}
-
declare 162 generic {
- void Tk_SetClass (Tk_Window tkwin, CONST char *className)
+ void Tk_SetClass(Tk_Window tkwin, CONST char *className)
}
-
declare 163 generic {
- void Tk_SetGrid (Tk_Window tkwin, int reqWidth, int reqHeight,
+ void Tk_SetGrid(Tk_Window tkwin, int reqWidth, int reqHeight,
int gridWidth, int gridHeight)
}
-
declare 164 generic {
- void Tk_SetInternalBorder (Tk_Window tkwin, int width)
+ void Tk_SetInternalBorder(Tk_Window tkwin, int width)
}
-
declare 165 generic {
- void Tk_SetWindowBackground (Tk_Window tkwin, unsigned long pixel)
+ void Tk_SetWindowBackground(Tk_Window tkwin, unsigned long pixel)
}
-
declare 166 generic {
- void Tk_SetWindowBackgroundPixmap (Tk_Window tkwin, Pixmap pixmap)
+ void Tk_SetWindowBackgroundPixmap(Tk_Window tkwin, Pixmap pixmap)
}
-
declare 167 generic {
- void Tk_SetWindowBorder (Tk_Window tkwin, unsigned long pixel)
+ void Tk_SetWindowBorder(Tk_Window tkwin, unsigned long pixel)
}
-
declare 168 generic {
- void Tk_SetWindowBorderWidth (Tk_Window tkwin, int width)
+ void Tk_SetWindowBorderWidth(Tk_Window tkwin, int width)
}
-
declare 169 generic {
- void Tk_SetWindowBorderPixmap (Tk_Window tkwin, Pixmap pixmap)
+ void Tk_SetWindowBorderPixmap(Tk_Window tkwin, Pixmap pixmap)
}
-
declare 170 generic {
- void Tk_SetWindowColormap (Tk_Window tkwin, Colormap colormap)
+ void Tk_SetWindowColormap(Tk_Window tkwin, Colormap colormap)
}
-
declare 171 generic {
- int Tk_SetWindowVisual (Tk_Window tkwin, Visual *visual, int depth,
+ int Tk_SetWindowVisual(Tk_Window tkwin, Visual *visual, int depth,
Colormap colormap)
}
-
declare 172 generic {
- void Tk_SizeOfBitmap (Display *display, Pixmap bitmap, int *widthPtr,
+ void Tk_SizeOfBitmap(Display *display, Pixmap bitmap, int *widthPtr,
int *heightPtr)
}
-
declare 173 generic {
- void Tk_SizeOfImage (Tk_Image image, int *widthPtr, int *heightPtr)
+ void Tk_SizeOfImage(Tk_Image image, int *widthPtr, int *heightPtr)
}
-
declare 174 generic {
- int Tk_StrictMotif (Tk_Window tkwin)
+ int Tk_StrictMotif(Tk_Window tkwin)
}
-
declare 175 generic {
- void Tk_TextLayoutToPostscript (Tcl_Interp *interp, Tk_TextLayout layout)
+ void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout)
}
-
declare 176 generic {
- int Tk_TextWidth (Tk_Font font, CONST char *str, int numBytes)
+ int Tk_TextWidth(Tk_Font font, CONST char *str, int numBytes)
}
-
declare 177 generic {
- void Tk_UndefineCursor (Tk_Window window)
+ void Tk_UndefineCursor(Tk_Window window)
}
-
declare 178 generic {
- void Tk_UnderlineChars (Display *display,
+ void Tk_UnderlineChars(Display *display,
Drawable drawable, GC gc, Tk_Font tkfont,
CONST char *source, int x, int y, int firstByte,
int lastByte)
}
-
declare 179 generic {
- void Tk_UnderlineTextLayout (Display *display, Drawable drawable, GC gc,
+ void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc,
Tk_TextLayout layout, int x, int y,
int underline)
}
-
declare 180 generic {
- void Tk_Ungrab (Tk_Window tkwin)
+ void Tk_Ungrab(Tk_Window tkwin)
}
-
declare 181 generic {
- void Tk_UnmaintainGeometry (Tk_Window slave, Tk_Window master)
+ void Tk_UnmaintainGeometry(Tk_Window slave, Tk_Window master)
}
-
declare 182 generic {
- void Tk_UnmapWindow (Tk_Window tkwin)
+ void Tk_UnmapWindow(Tk_Window tkwin)
}
-
declare 183 generic {
- void Tk_UnsetGrid (Tk_Window tkwin)
+ void Tk_UnsetGrid(Tk_Window tkwin)
}
-
declare 184 generic {
- void Tk_UpdatePointer (Tk_Window tkwin, int x, int y, int state)
+ void Tk_UpdatePointer(Tk_Window tkwin, int x, int y, int state)
}
# new functions for 8.1
declare 185 generic {
- Pixmap Tk_AllocBitmapFromObj (Tcl_Interp *interp, Tk_Window tkwin,
+ Pixmap Tk_AllocBitmapFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-
declare 186 generic {
- Tk_3DBorder Tk_Alloc3DBorderFromObj (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-
declare 187 generic {
- XColor * Tk_AllocColorFromObj (Tcl_Interp *interp, Tk_Window tkwin,
+ XColor *Tk_AllocColorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-
declare 188 generic {
- Tk_Cursor Tk_AllocCursorFromObj (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-
declare 189 generic {
- Tk_Font Tk_AllocFontFromObj (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_Font Tk_AllocFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
-
declare 190 generic {
- Tk_OptionTable Tk_CreateOptionTable (Tcl_Interp *interp,
+ Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
CONST Tk_OptionSpec *templatePtr)
}
-
declare 191 generic {
- void Tk_DeleteOptionTable (Tk_OptionTable optionTable)
+ void Tk_DeleteOptionTable(Tk_OptionTable optionTable)
}
-
declare 192 generic {
- void Tk_Free3DBorderFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ void Tk_Free3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 193 generic {
- void Tk_FreeBitmapFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ void Tk_FreeBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 194 generic {
- void Tk_FreeColorFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ void Tk_FreeColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 195 generic {
- void Tk_FreeConfigOptions (char *recordPtr, Tk_OptionTable optionToken,
+ void Tk_FreeConfigOptions(char *recordPtr, Tk_OptionTable optionToken,
Tk_Window tkwin)
}
-
declare 196 generic {
- void Tk_FreeSavedOptions (Tk_SavedOptions *savePtr)
+ void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr)
}
-
declare 197 generic {
- void Tk_FreeCursorFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ void Tk_FreeCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 198 generic {
- void Tk_FreeFontFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ void Tk_FreeFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 199 generic {
- Tk_3DBorder Tk_Get3DBorderFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ Tk_3DBorder Tk_Get3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 200 generic {
- int Tk_GetAnchorFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr,
+ int Tk_GetAnchorFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
Tk_Anchor *anchorPtr)
}
-
declare 201 generic {
- Pixmap Tk_GetBitmapFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ Pixmap Tk_GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 202 generic {
- XColor * Tk_GetColorFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ XColor *Tk_GetColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 203 generic {
- Tk_Cursor Tk_GetCursorFromObj (Tk_Window tkwin, Tcl_Obj *objPtr)
+ Tk_Cursor Tk_GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
-
declare 204 generic {
- Tcl_Obj * Tk_GetOptionInfo (Tcl_Interp *interp,
+ Tcl_Obj *Tk_GetOptionInfo(Tcl_Interp *interp,
char *recordPtr, Tk_OptionTable optionTable,
Tcl_Obj *namePtr, Tk_Window tkwin)
}
-
declare 205 generic {
- Tcl_Obj * Tk_GetOptionValue (Tcl_Interp *interp, char *recordPtr,
+ Tcl_Obj *Tk_GetOptionValue(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)
}
-
declare 206 generic {
- int Tk_GetJustifyFromObj (Tcl_Interp *interp,
+ int Tk_GetJustifyFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tk_Justify *justifyPtr)
}
-
declare 207 generic {
- int Tk_GetMMFromObj (Tcl_Interp *interp,
+ int Tk_GetMMFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr)
}
-
declare 208 generic {
- int Tk_GetPixelsFromObj (Tcl_Interp *interp,
+ int Tk_GetPixelsFromObj(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr)
}
-
declare 209 generic {
- int Tk_GetReliefFromObj (Tcl_Interp *interp,
+ int Tk_GetReliefFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, int *resultPtr)
}
-
declare 210 generic {
- int Tk_GetScrollInfoObj (Tcl_Interp *interp,
+ int Tk_GetScrollInfoObj(Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr)
}
-
declare 211 generic {
- int Tk_InitOptions (Tcl_Interp *interp, char *recordPtr,
+ int Tk_InitOptions(Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionToken, Tk_Window tkwin)
}
-
declare 212 generic {
- void Tk_MainEx (int argc, char **argv, Tcl_AppInitProc *appInitProc,
+ void Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp)
}
-
declare 213 generic {
- void Tk_RestoreSavedOptions (Tk_SavedOptions *savePtr)
+ void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr)
}
-
declare 214 generic {
- int Tk_SetOptions (Tcl_Interp *interp, char *recordPtr,
+ 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)
}
-
declare 215 generic {
- void Tk_InitConsoleChannels (Tcl_Interp *interp)
+ void Tk_InitConsoleChannels(Tcl_Interp *interp)
}
-
declare 216 generic {
- int Tk_CreateConsoleWindow (Tcl_Interp *interp)
+ int Tk_CreateConsoleWindow(Tcl_Interp *interp)
}
-
declare 217 generic {
- void Tk_CreateSmoothMethod (Tcl_Interp *interp, Tk_SmoothMethod *method)
+ void Tk_CreateSmoothMethod(Tcl_Interp *interp, Tk_SmoothMethod *method)
}
#declare 218 generic {
-# void Tk_CreateCanvasVisitor (Tcl_Interp *interp, VOID *typePtr)
+# void Tk_CreateCanvasVisitor(Tcl_Interp *interp, VOID *typePtr)
#}
#declare 219 generic {
-# VOID *Tk_GetCanvasVisitor (Tcl_Interp *interp, CONST char *name)
+# VOID *Tk_GetCanvasVisitor(Tcl_Interp *interp, CONST char *name)
#}
declare 220 generic {
- int Tk_GetDash (Tcl_Interp *interp, CONST char *value, Tk_Dash *dash)
+ int Tk_GetDash(Tcl_Interp *interp, CONST char *value, Tk_Dash *dash)
}
declare 221 generic {
- void Tk_CreateOutline (Tk_Outline *outline)
+ void Tk_CreateOutline(Tk_Outline *outline)
}
declare 222 generic {
- void Tk_DeleteOutline (Display *display, Tk_Outline *outline)
+ void Tk_DeleteOutline(Display *display, Tk_Outline *outline)
}
declare 223 generic {
- int Tk_ConfigOutlineGC (XGCValues *gcValues, Tk_Canvas canvas,
+ int Tk_ConfigOutlineGC(XGCValues *gcValues, Tk_Canvas canvas,
Tk_Item *item, Tk_Outline *outline)
}
declare 224 generic {
- int Tk_ChangeOutlineGC (Tk_Canvas canvas, Tk_Item *item,
+ int Tk_ChangeOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 225 generic {
- int Tk_ResetOutlineGC (Tk_Canvas canvas, Tk_Item *item,
+ int Tk_ResetOutlineGC(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 226 generic {
- int Tk_CanvasPsOutline (Tk_Canvas canvas, Tk_Item *item,
+ int Tk_CanvasPsOutline(Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 227 generic {
- void Tk_SetTSOrigin (Tk_Window tkwin, GC gc, int x, int y)
+ void Tk_SetTSOrigin(Tk_Window tkwin, GC gc, int x, int y)
}
declare 228 generic {
- int Tk_CanvasGetCoordFromObj (Tcl_Interp *interp, Tk_Canvas canvas,
+ int Tk_CanvasGetCoordFromObj(Tcl_Interp *interp, Tk_Canvas canvas,
Tcl_Obj *obj, double *doublePtr)
}
declare 229 generic {
- void Tk_CanvasSetOffset (Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)
+ void Tk_CanvasSetOffset(Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)
}
declare 230 generic {
- void Tk_DitherPhoto (Tk_PhotoHandle handle, int x, int y, int width,
+ void Tk_DitherPhoto(Tk_PhotoHandle handle, int x, int y, int width,
int height)
}
declare 231 generic {
- int Tk_PostscriptBitmap (Tcl_Interp *interp, Tk_Window tkwin,
+ int Tk_PostscriptBitmap(Tcl_Interp *interp, Tk_Window tkwin,
Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX,
int startY, int width, int height)
}
declare 232 generic {
- int Tk_PostscriptColor (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
+ int Tk_PostscriptColor(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
XColor *colorPtr)
}
declare 233 generic {
- int Tk_PostscriptFont (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
+ int Tk_PostscriptFont(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
Tk_Font font)
}
declare 234 generic {
- int Tk_PostscriptImage (Tk_Image image, Tcl_Interp *interp,
+ int Tk_PostscriptImage(Tk_Image image, Tcl_Interp *interp,
Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y,
int width, int height, int prepass)
}
declare 235 generic {
- void Tk_PostscriptPath (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
+ void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
double *coordPtr, int numPoints)
}
declare 236 generic {
- int Tk_PostscriptStipple (Tcl_Interp *interp, Tk_Window tkwin,
+ int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin,
Tk_PostscriptInfo psInfo, Pixmap bitmap)
}
declare 237 generic {
- double Tk_PostscriptY (double y, Tk_PostscriptInfo psInfo)
+ double Tk_PostscriptY(double y, Tk_PostscriptInfo psInfo)
}
declare 238 generic {
- int Tk_PostscriptPhoto (Tcl_Interp *interp,
+ int Tk_PostscriptPhoto(Tcl_Interp *interp,
Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo,
int width, int height)
}
@@ -1129,254 +913,267 @@ declare 238 generic {
# New in 8.4a1
#
declare 239 generic {
- void Tk_CreateClientMessageHandler (Tk_ClientMessageProc *proc)
+ void Tk_CreateClientMessageHandler(Tk_ClientMessageProc *proc)
}
declare 240 generic {
- void Tk_DeleteClientMessageHandler (Tk_ClientMessageProc *proc)
+ void Tk_DeleteClientMessageHandler(Tk_ClientMessageProc *proc)
}
# New in 8.4a2
#
declare 241 generic {
- Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp,
+ Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp,
Tk_Window parent, CONST char *screenName)
}
declare 242 generic {
- void Tk_SetClassProcs (Tk_Window tkwin,
+ void Tk_SetClassProcs(Tk_Window tkwin,
Tk_ClassProcs *procs, ClientData instanceData)
}
# New in 8.4a4
#
declare 243 generic {
- void Tk_SetInternalBorderEx (Tk_Window tkwin, int left, int right,
+ void Tk_SetInternalBorderEx(Tk_Window tkwin, int left, int right,
int top, int bottom)
}
declare 244 generic {
- void Tk_SetMinimumRequestSize (Tk_Window tkwin,
+ void Tk_SetMinimumRequestSize(Tk_Window tkwin,
int minWidth, int minHeight)
}
# New in 8.4a5
#
declare 245 generic {
- void Tk_SetCaretPos (Tk_Window tkwin, int x, int y, int height)
+ void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
}
-
declare 246 generic {
- void Tk_PhotoPutBlock (Tk_PhotoHandle handle,
+ void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int compRule)
}
declare 247 generic {
- void Tk_PhotoPutZoomedBlock (Tk_PhotoHandle handle,
+ 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 {
- int Tk_CollapseMotionEvents (Display *display, int collapse)
+ int Tk_CollapseMotionEvents(Display *display, int collapse)
}
# Style engine
declare 249 generic {
- Tk_StyleEngine Tk_RegisterStyleEngine (CONST char *name,
+ Tk_StyleEngine Tk_RegisterStyleEngine(CONST char *name,
Tk_StyleEngine parent)
}
declare 250 generic {
- Tk_StyleEngine Tk_GetStyleEngine (CONST char *name)
+ Tk_StyleEngine Tk_GetStyleEngine(CONST char *name)
}
declare 251 generic {
- int Tk_RegisterStyledElement (Tk_StyleEngine engine,
+ int Tk_RegisterStyledElement(Tk_StyleEngine engine,
Tk_ElementSpec *templatePtr)
}
declare 252 generic {
- int Tk_GetElementId (CONST char *name)
+ int Tk_GetElementId(CONST char *name)
}
declare 253 generic {
- Tk_Style Tk_CreateStyle (CONST char *name, Tk_StyleEngine engine,
+ 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)
+ Tk_Style Tk_GetStyle(Tcl_Interp *interp, CONST char *name)
}
declare 255 generic {
- void Tk_FreeStyle (Tk_Style style)
+ void Tk_FreeStyle(Tk_Style style)
}
declare 256 generic {
- CONST char * Tk_NameOfStyle (Tk_Style style)
+ CONST char *Tk_NameOfStyle(Tk_Style style)
}
declare 257 generic {
- Tk_Style Tk_AllocStyleFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr)
+ Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
}
declare 258 generic {
- Tk_Style Tk_GetStyleFromObj (Tcl_Obj *objPtr)
+ Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr)
}
declare 259 generic {
- void Tk_FreeStyleFromObj (Tcl_Obj *objPtr)
+ void Tk_FreeStyleFromObj(Tcl_Obj *objPtr)
}
declare 260 generic {
- Tk_StyledElement Tk_GetStyledElement (Tk_Style style, int elementId,
+ Tk_StyledElement Tk_GetStyledElement(Tk_Style style, int elementId,
Tk_OptionTable optionTable)
}
declare 261 generic {
- void Tk_GetElementSize (Tk_Style style, Tk_StyledElement element,
+ void Tk_GetElementSize(Tk_Style style, Tk_StyledElement element,
char *recordPtr, Tk_Window tkwin, int width, int height,
int inner, int *widthPtr, int *heightPtr)
}
declare 262 generic {
- void Tk_GetElementBox (Tk_Style style, Tk_StyledElement element,
+ void Tk_GetElementBox(Tk_Style style, Tk_StyledElement element,
char *recordPtr, Tk_Window tkwin, int x, int y, int width,
int height, int inner, int *xPtr, int *yPtr, int *widthPtr,
int *heightPtr)
}
declare 263 generic {
- int Tk_GetElementBorderWidth (Tk_Style style, Tk_StyledElement element,
+ int Tk_GetElementBorderWidth(Tk_Style style, Tk_StyledElement element,
char *recordPtr, Tk_Window tkwin)
}
declare 264 generic {
- void Tk_DrawElement (Tk_Style style, Tk_StyledElement element,
+ 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 {
+ int Tk_PhotoExpand(Tcl_Interp *interp, Tk_PhotoHandle handle,
+ int width, int height)
+}
+declare 266 generic {
+ 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 {
+ 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 {
+ int Tk_PhotoSetSize(Tcl_Interp *interp, Tk_PhotoHandle handle,
+ int width, int height)
+}
+# TIP#245
+declare 269 generic {
+ long Tk_GetUserInactiveTime(Display *dpy)
+}
+declare 270 generic {
+ void Tk_ResetUserInactiveTime(Display *dpy)
+}
+
+# TIP #264
+declare 271 generic {
+ Tcl_Interp *Tk_Interp(Tk_Window tkwin)
+}
+
+# Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional
+# means to continue support for extensions using the USE_OLD_IMAGE to
+# continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats.
+#
+# Note that this restores the usual rules for stub compatibility. Stub-enabled
+# extensions compiled against 8.5 headers and linked to the 8.5 stub library
+# will produce a file [load]able into an interp with Tk 8.X, for X >= 5.
+# 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 273 generic {
+ void Tk_CreateOldPhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
+}
# Define the platform specific public Tk interface. These functions are
# only available on the designated platform.
interface tkPlat
+################################
# Unix specific functions
# (none)
+################################
# Windows specific functions
declare 0 win {
- Window Tk_AttachHWND (Tk_Window tkwin, HWND hwnd)
+ Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd)
}
-
declare 1 win {
- HINSTANCE Tk_GetHINSTANCE (void)
+ HINSTANCE Tk_GetHINSTANCE(void)
}
-
declare 2 win {
- HWND Tk_GetHWND (Window window)
+ HWND Tk_GetHWND(Window window)
}
-
declare 3 win {
- Tk_Window Tk_HWNDToWindow (HWND hwnd)
+ Tk_Window Tk_HWNDToWindow(HWND hwnd)
}
-
declare 4 win {
- void Tk_PointerEvent (HWND hwnd, int x, int y)
+ void Tk_PointerEvent(HWND hwnd, int x, int y)
}
-
declare 5 win {
- int Tk_TranslateWinEvent (HWND hwnd,
+ int Tk_TranslateWinEvent(HWND hwnd,
UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
}
-# Mac specific functions
-
-declare 0 mac {
- void Tk_MacSetEmbedHandler (
- Tk_MacEmbedRegisterWinProc *registerWinProcPtr,
- Tk_MacEmbedGetGrafPortProc *getPortProcPtr,
- Tk_MacEmbedMakeContainerExistProc *containerExistProcPtr,
- Tk_MacEmbedGetClipProc *getClipProc,
- Tk_MacEmbedGetOffsetInParentProc *getOffsetProc)
-}
-
-declare 1 mac {
- void Tk_MacTurnOffMenus (void)
-}
-
-declare 2 mac {
- void Tk_MacTkOwnsCursor (int tkOwnsIt)
-}
-
-declare 3 mac {
- void TkMacInitMenus (Tcl_Interp *interp)
-}
-
-declare 4 mac {
- void TkMacInitAppleEvents (Tcl_Interp *interp)
-}
-
-declare 5 mac {
- int TkMacConvertEvent (EventRecord *eventPtr)
-}
-
-declare 6 mac {
- int TkMacConvertTkEvent (EventRecord *eventPtr, Window window)
-}
-
-declare 7 mac {
- void TkGenWMConfigureEvent (Tk_Window tkwin,
- int x, int y, int width, int height, int flags)
-}
-
-declare 8 mac {
- void TkMacInvalClipRgns (TkWindow *winPtr)
-}
-
-declare 9 mac {
- int TkMacHaveAppearance (void)
-}
-
-declare 10 mac {
- GWorldPtr TkMacGetDrawablePort (Drawable drawable)
-}
-
-# Mac OS X specific functions
+################################
+# Aqua specific functions
declare 0 aqua {
- void Tk_MacOSXSetEmbedHandler ( \
- Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, \
- Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, \
- Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, \
- Tk_MacOSXEmbedGetClipProc *getClipProc, \
+ void Tk_MacOSXSetEmbedHandler(
+ Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
+ Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr,
+ Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
+ Tk_MacOSXEmbedGetClipProc *getClipProc,
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
}
-
declare 1 aqua {
- void Tk_MacOSXTurnOffMenus (void)
+ void Tk_MacOSXTurnOffMenus(void)
}
-
declare 2 aqua {
- void Tk_MacOSXTkOwnsCursor (int tkOwnsIt)
+ void Tk_MacOSXTkOwnsCursor(int tkOwnsIt)
}
-
declare 3 aqua {
- void TkMacOSXInitMenus (Tcl_Interp *interp)
+ void TkMacOSXInitMenus(Tcl_Interp *interp)
}
-
declare 4 aqua {
- void TkMacOSXInitAppleEvents (Tcl_Interp *interp)
+ void TkMacOSXInitAppleEvents(Tcl_Interp *interp)
}
-
declare 5 aqua {
- void TkGenWMConfigureEvent (Tk_Window tkwin, \
- int x, int y, int width, int height, int flags)
+ void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, int width,
+ int height, int flags)
}
-
declare 6 aqua {
- void TkMacOSXInvalClipRgns (Tk_Window tkwin)
+ void TkMacOSXInvalClipRgns(Tk_Window tkwin)
}
-
declare 7 aqua {
- GWorldPtr TkMacOSXGetDrawablePort (Drawable drawable)
+ GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable)
}
-
declare 8 aqua {
- ControlRef TkMacOSXGetRootControl (Drawable drawable)
+ ControlRef TkMacOSXGetRootControl(Drawable drawable)
}
-
declare 9 aqua {
- void Tk_MacOSXSetupTkNotifier (void)
+ void Tk_MacOSXSetupTkNotifier(void)
}
-
declare 10 aqua {
- int Tk_MacOSXIsAppInFront (void)
+ int Tk_MacOSXIsAppInFront(void)
+}
+
+##############################################################################
+
+# Public functions that are not accessible via the stubs table.
+
+export {
+ CONST char *Tk_InitStubs(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 f03992f..448f845 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -1,26 +1,24 @@
/*
* tk.h --
*
- * Declarations for Tk-related things that are visible
- * outside of the Tk module itself.
+ * Declarations for Tk-related things that are visible outside of the Tk
+ * module itself.
*
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994 The Australian National University.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 Ajuba Solutions.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TK
#define _TK
-#ifndef _TCL
#include <tcl.h>
-#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 4)
-# error Tk 8.4 must be compiled with tcl.h from Tcl 8.4
-#endif
+#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 5)
+# error Tk 8.5 must be compiled with tcl.h from Tcl 8.5
#endif
/*
@@ -35,46 +33,43 @@ extern "C" {
* When version numbers change here, you must also go into the following files
* and update the version numbers:
*
- * library/tk.tcl (only if Major.minor changes, not patchlevel)
+ * library/tk.tcl (2 LOC patch)
* unix/configure.in (2 LOC Major, 2 LOC minor, 1 LOC patch)
* win/configure.in (as above)
- * win/makefile.vc (not patchlevel)
* README (sections 0 and 1)
- * mac/README (not patchlevel)
+ * macosx/Wish.xcode/project.pbxproj (not patchlevel) 1 LOC
+ * macosx/Wish-Common.xcconfig (not patchlevel) 1 LOC
* win/README (not patchlevel)
* unix/README (not patchlevel)
- * unix/tk.spec (3 LOC Major/Minor, 2 LOC patch)
+ * unix/tk.spec (1 LOC patch)
* win/tcl.m4 (not patchlevel)
*
- * You may also need to update some of these files when the numbers change
- * for the version of Tcl that this release of Tk is compiled against.
+ * You may also need to update some of these files when the numbers change for
+ * the version of Tcl that this release of Tk is compiled against.
*/
-#define TK_MAJOR_VERSION 8
-#define TK_MINOR_VERSION 4
-#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
-#define TK_RELEASE_SERIAL 19
+#define TK_MAJOR_VERSION 8
+#define TK_MINOR_VERSION 5
+#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
+#define TK_RELEASE_SERIAL 9
-#define TK_VERSION "8.4"
-#define TK_PATCH_LEVEL "8.4.19"
+#define TK_VERSION "8.5"
+#define TK_PATCH_LEVEL "8.5.9"
-/*
- * 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. RC_INVOKED is defined by default by the windows RC tool
- * and manually set for macintosh.
+/*
+ * 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.
+ * RC_INVOKED is defined by default by the windows RC tool and manually set
+ * for macintosh.
*
- * Resource compilers don't like all the C stuff, like typedefs and
- * procedure declarations, that occur below, so block them out.
+ * Resource compilers don't like all the C stuff, like typedefs and procedure
+ * declarations, that occur below, so block them out.
*/
-
+
#ifndef RC_INVOKED
-
+
#ifndef _XLIB_H
-# if defined (MAC_TCL)
-# include <Xlib.h>
-# include <X.h>
-# elif defined(MAC_OSX_TK)
+# if defined(MAC_OSX_TK)
# include <X11/Xlib.h>
# include <X11/X.h>
# else
@@ -89,7 +84,7 @@ extern "C" {
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif
-
+
/*
* Decide whether or not to use input methods.
*/
@@ -122,11 +117,11 @@ typedef struct Tk_StyledElement_ *Tk_StyledElement;
* Additional types exported to clients.
*/
-typedef CONST char *Tk_Uid;
+typedef const char *Tk_Uid;
/*
- * The enum below defines the valid types for Tk configuration options
- * as implemented by Tk_InitOptions, Tk_SetOptions, etc.
+ * The enum below defines the valid types for Tk configuration options as
+ * implemented by Tk_InitOptions, Tk_SetOptions, etc.
*/
typedef enum {
@@ -152,56 +147,54 @@ typedef enum {
} Tk_OptionType;
/*
- * Structures of the following type are used by widgets to specify
- * their configuration options. Typically each widget has a static
- * array of these structures, where each element of the array describes
- * a single configuration option. The array is passed to
- * Tk_CreateOptionTable.
+ * Structures of the following type are used by widgets to specify their
+ * configuration options. Typically each widget has a static array of these
+ * structures, where each element of the array describes a single
+ * configuration option. The array is passed to Tk_CreateOptionTable.
*/
typedef struct Tk_OptionSpec {
- Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR;
- * see definitions above. Last option in
- * table must have type TK_OPTION_END. */
- char *optionName; /* Name used to specify option in Tcl
+ Tk_OptionType type; /* Type of option, such as TK_OPTION_COLOR;
+ * see definitions above. Last option in table
+ * must have type TK_OPTION_END. */
+ const char *optionName; /* Name used to specify option in Tcl
* commands. */
- char *dbName; /* Name for option in option database. */
- char *dbClass; /* Class for option in database. */
- char *defValue; /* Default value for option if not specified
- * in command line, the option database,
- * or the system. */
+ const char *dbName; /* Name for option in option database. */
+ const char *dbClass; /* Class for option in database. */
+ const char *defValue; /* Default value for option if not specified
+ * in command line, the option database, or
+ * the system. */
int objOffset; /* Where in record to store a Tcl_Obj * that
* holds the value of this option, specified
- * as an offset in bytes from the start of
- * the record. Use the Tk_Offset macro to
- * generate values for this. -1 means don't
- * store the Tcl_Obj in the record. */
+ * as an offset in bytes from the start of the
+ * record. Use the Tk_Offset macro to generate
+ * values for this. -1 means don't store the
+ * Tcl_Obj in the record. */
int internalOffset; /* Where in record to store the internal
* representation of the value of this option,
- * such as an int or XColor *. This field
- * is specified as an offset in bytes
- * from the start of the record. Use the
- * Tk_Offset macro to generate values for it.
- * -1 means don't store the internal
- * representation in the record. */
+ * such as an int or XColor *. This field is
+ * specified as an offset in bytes from the
+ * start of the record. Use the Tk_Offset
+ * macro to generate values for it. -1 means
+ * don't store the internal representation in
+ * the record. */
int flags; /* Any combination of the values defined
* below. */
ClientData clientData; /* An alternate place to put option-specific
- * data. Used for the monochrome default value
+ * data. Used for the monochrome default value
* for colors, etc. */
- int typeMask; /* An arbitrary bit mask defined by the
- * class manager; typically bits correspond
- * to certain kinds of options such as all
- * those that require a redisplay when they
- * change. Tk_SetOptions returns the bit-wise
- * OR of the typeMasks of all options that
- * were changed. */
+ int typeMask; /* An arbitrary bit mask defined by the class
+ * manager; typically bits correspond to
+ * certain kinds of options such as all those
+ * that require a redisplay when they change.
+ * Tk_SetOptions returns the bit-wise OR of
+ * the typeMasks of all options that were
+ * changed. */
} Tk_OptionSpec;
/*
- * Flag values for Tk_OptionSpec structures. These flags are shared by
- * Tk_ConfigSpec structures, so be sure to coordinate any changes
- * carefully.
+ * Flag values for Tk_OptionSpec structures. These flags are shared by
+ * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully.
*/
#define TK_OPTION_NULL_OK (1 << 0)
@@ -222,28 +215,29 @@ typedef void (Tk_CustomOptionRestoreProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *internalPtr, char *saveInternalPtr));
typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *internalPtr));
-
+
typedef struct Tk_ObjCustomOption {
- char *name; /* Name of the custom option. */
- Tk_CustomOptionSetProc *setProc; /* Function to use to set a record's
- * option value from a Tcl_Obj */
- Tk_CustomOptionGetProc *getProc; /* Function to use to get a Tcl_Obj
- * representation from an internal
- * representation of an option. */
- Tk_CustomOptionRestoreProc *restoreProc; /* Function to use to restore a
- * saved value for the internal
- * representation. */
- Tk_CustomOptionFreeProc *freeProc; /* Function to use to free the internal
- * representation of an option. */
- ClientData clientData; /* Arbitrary one-word value passed to
- * the handling procs. */
+ 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 */
+ Tk_CustomOptionGetProc *getProc;
+ /* Function to use to get a Tcl_Obj
+ * representation from an internal
+ * representation of an option. */
+ Tk_CustomOptionRestoreProc *restoreProc;
+ /* Function to use to restore a saved value
+ * for the internal representation. */
+ Tk_CustomOptionFreeProc *freeProc;
+ /* Function to use to free the internal
+ * representation of an option. */
+ ClientData clientData; /* Arbitrary one-word value passed to the
+ * handling procs. */
} Tk_ObjCustomOption;
-
/*
- * Macro to use to fill in "offset" fields of the Tk_OptionSpec.
- * struct. Computes number of bytes from beginning of structure
- * to a given field.
+ * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
+ * Computes number of bytes from beginning of structure to a given field.
*/
#ifdef offsetof
@@ -253,34 +247,30 @@ typedef struct Tk_ObjCustomOption {
#endif
/*
- * The following two structures are used for error handling. When
- * configuration options are being modified, the old values are
- * saved in a Tk_SavedOptions structure. If an error occurs, then the
- * contents of the structure can be used to restore all of the old
- * values. The contents of this structure are for the private use
- * Tk. No-one outside Tk should ever read or write any of the fields
- * of these structures.
+ * The following two structures are used for error handling. When config
+ * options are being modified, the old values are saved in a Tk_SavedOptions
+ * structure. If an error occurs, then the contents of the structure can be
+ * used to restore all of the old values. The contents of this structure are
+ * for the private use Tk. No-one outside Tk should ever read or write any of
+ * the fields of these structures.
*/
typedef struct Tk_SavedOption {
- struct TkOption *optionPtr; /* Points to information that describes
- * the option. */
- Tcl_Obj *valuePtr; /* The old value of the option, in
- * the form of a Tcl object; may be
- * NULL if the value wasn't saved as
- * an object. */
- double internalForm; /* The old value of the option, in
- * some internal representation such
- * as an int or (XColor *). Valid
- * only if optionPtr->specPtr->objOffset
- * is < 0. The space must be large
- * enough to accommodate a double, a
- * long, or a pointer; right now it
- * looks like a double is big
- * enough. Also, using a double
- * guarantees that the field is
- * properly aligned for storing large
- * values. */
+ struct TkOption *optionPtr; /* Points to information that describes the
+ * option. */
+ Tcl_Obj *valuePtr; /* The old value of the option, in the form of
+ * a Tcl object; may be NULL if the value was
+ * not saved as an object. */
+ double internalForm; /* The old value of the option, in some
+ * internal representation such as an int or
+ * (XColor *). Valid only if the field
+ * optionPtr->specPtr->objOffset is < 0. The
+ * space must be large enough to accommodate a
+ * double, a long, or a pointer; right now it
+ * looks like a double (i.e., 8 bytes) is big
+ * enough. Also, using a double guarantees
+ * that the field is properly aligned for
+ * storing large values. */
} Tk_SavedOption;
#ifdef TCL_MEM_DEBUG
@@ -290,31 +280,30 @@ typedef struct Tk_SavedOption {
#endif
typedef struct Tk_SavedOptions {
- char *recordPtr; /* The data structure in which to
- * restore configuration options. */
- Tk_Window tkwin; /* Window associated with recordPtr;
- * needed to restore certain options. */
- int numItems; /* The number of valid items in
- * items field. */
+ char *recordPtr; /* The data structure in which to restore
+ * configuration options. */
+ Tk_Window tkwin; /* Window associated with recordPtr; needed to
+ * restore certain options. */
+ int numItems; /* The number of valid items in items field. */
Tk_SavedOption items[TK_NUM_SAVED_OPTIONS];
- /* Items used to hold old values. */
- struct Tk_SavedOptions *nextPtr; /* Points to next structure in list;
- * needed if too many options changed
- * to hold all the old values in a
- * single structure. NULL means no
- * more structures. */
+ /* Items used to hold old values. */
+ struct Tk_SavedOptions *nextPtr;
+ /* Points to next structure in list; needed if
+ * too many options changed to hold all the
+ * 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 describing an option. THESE ARE
- * DEPRECATED; PLEASE USE THE NEW STRUCTURES LISTED ABOVE.
+ * Structure used to describe application-specific configuration options:
+ * indicates procedures to call to parse an option and to return a text string
+ * describing an option. THESE ARE DEPRECATED; PLEASE USE THE NEW STRUCTURES
+ * LISTED ABOVE.
*/
/*
- * This is a temporary flag used while tkObjConfig and new widgets
- * are in development.
+ * This is a temporary flag used while tkObjConfig and new widgets are in
+ * development.
*/
#ifndef __NO_OLD_CONFIG
@@ -327,58 +316,58 @@ typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_((ClientData clientData,
Tcl_FreeProc **freeProcPtr));
typedef struct Tk_CustomOption {
- Tk_OptionParseProc *parseProc; /* Procedure to call to parse an
- * option and store it in converted
- * form. */
- Tk_OptionPrintProc *printProc; /* Procedure to return a printable
- * string describing an existing
- * option. */
- ClientData clientData; /* Arbitrary one-word value used by
- * option parser: passed to
- * parseProc and printProc. */
+ Tk_OptionParseProc *parseProc;
+ /* Procedure to call to parse an option and
+ * store it in converted form. */
+ Tk_OptionPrintProc *printProc;
+ /* Procedure to return a printable string
+ * describing an existing option. */
+ ClientData clientData; /* Arbitrary one-word value used by option
+ * parser: passed to parseProc and
+ * printProc. */
} Tk_CustomOption;
/*
- * Structure used to specify information for Tk_ConfigureWidget. Each
- * structure gives complete information for one option, including
- * how the option is specified on the command line, where it appears
- * in the option database, etc.
+ * Structure used to specify information for Tk_ConfigureWidget. Each
+ * structure gives complete information for one option, including how the
+ * option is specified on the command line, where it appears in the option
+ * database, etc.
*/
typedef struct 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 means this spec is part of a group. */
+ * see definitions below. Last option in table
+ * must have type TK_CONFIG_END. */
+ char *argvName; /* Switch used to specify option in argv. NULL
+ * means this spec is part of a group. */
Tk_Uid dbName; /* Name for option in option database. */
Tk_Uid dbClass; /* Class for option in database. */
- Tk_Uid defValue; /* Default value for option if not
- * specified in command line or database. */
- int offset; /* Where in widget record to store value;
- * use Tk_Offset macro to generate values
- * for this. */
+ Tk_Uid defValue; /* Default value for option if not specified
+ * in command line or database. */
+ int offset; /* Where in widget record to store value; use
+ * Tk_Offset macro to generate values for
+ * this. */
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 pointer to info about how to parse and
- * print the option. Otherwise it is
+ * below; other bits are used internally by
+ * tkConfig.c. */
+ 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. */
} Tk_ConfigSpec;
/*
- * Type values for Tk_ConfigSpec structures. See the user
- * documentation for details.
+ * Type values for Tk_ConfigSpec structures. See the user documentation for
+ * details.
*/
typedef enum {
TK_CONFIG_BOOLEAN, TK_CONFIG_INT, TK_CONFIG_DOUBLE, TK_CONFIG_STRING,
TK_CONFIG_UID, TK_CONFIG_COLOR, TK_CONFIG_FONT, TK_CONFIG_BITMAP,
- TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR,
- TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR,
+ TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR,
+ TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR,
TK_CONFIG_SYNONYM, TK_CONFIG_CAP_STYLE, TK_CONFIG_JOIN_STYLE,
- TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM,
+ TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM,
TK_CONFIG_END
} Tk_ConfigTypes;
@@ -390,10 +379,10 @@ typedef enum {
#define TK_CONFIG_OBJS 0x80
/*
- * Possible flag values for Tk_ConfigSpec structures. Any bits at
- * or above TK_CONFIG_USER_BIT may be used by clients for selecting
- * certain entries. Before changing any values here, coordinate with
- * tkOldConfig.c (internal-use-only flags are defined there).
+ * Possible flag values for Tk_ConfigSpec structures. Any bits at or above
+ * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries.
+ * Before changing any values here, coordinate with tkOldConfig.c
+ * (internal-use-only flags are defined there).
*/
#define TK_CONFIG_NULL_OK (1 << 0)
@@ -409,14 +398,15 @@ typedef enum {
*/
typedef struct {
- 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 option. */
+ 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
+ * option. */
} Tk_ArgvInfo;
/*
@@ -448,8 +438,8 @@ typedef struct {
#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.
+ * Enumerated type for describing actions to be taken in response to a
+ * restrictProc established by Tk_RestrictEvents.
*/
typedef enum {
@@ -487,10 +477,10 @@ typedef enum {
#define TK_3D_DARK_GC 3
/*
- * Special EnterNotify/LeaveNotify "mode" for use in events
- * generated by tkShare.c. Pick a high enough value that it's
- * unlikely to conflict with existing values (like NotifyNormal)
- * or any new values defined in the future.
+ * Special EnterNotify/LeaveNotify "mode" for use in events generated by
+ * tkShare.c. Pick a high enough value that it's unlikely to conflict with
+ * existing values (like NotifyNormal) or any new values defined in the
+ * future.
*/
#define TK_NOTIFY_SHARE 20
@@ -515,7 +505,7 @@ typedef enum {
/*
* The following structure is used by Tk_GetFontMetrics() to return
- * information about the properties of a Tk_Font.
+ * information about the properties of a Tk_Font.
*/
typedef struct Tk_FontMetrics {
@@ -527,9 +517,9 @@ typedef struct Tk_FontMetrics {
* letter sticks below the baseline, plus any
* extra blank space added by the designer of
* the font. */
- int linespace; /* The sum of the ascent and descent. How
- * far apart two lines of text in the same
- * font should be placed so that none of the
+ int linespace; /* The sum of the ascent and descent. How far
+ * apart two lines of text in the same font
+ * should be placed so that none of the
* characters in one line overlap any of the
* characters in the other line. */
} Tk_FontMetrics;
@@ -563,13 +553,12 @@ typedef void (Tk_ClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
typedef struct Tk_ClassProcs {
unsigned int size;
Tk_ClassWorldChangedProc *worldChangedProc;
- /* Procedure to invoke when the widget needs to
- * respond in some way to a change in the
+ /* Procedure to invoke when the widget needs
+ * to respond in some way to a change in the
* world (font changes, etc.) */
Tk_ClassCreateProc *createProc;
- /* Procedure to invoke when the
- * platform-dependent window needs to be
- * created. */
+ /* Procedure to invoke when the platform-
+ * dependent window needs to be created. */
Tk_ClassModalProc *modalProc;
/* Procedure to invoke after all bindings on a
* widget have been triggered in order to
@@ -577,8 +566,8 @@ typedef struct Tk_ClassProcs {
} Tk_ClassProcs;
/*
- * Simple accessor for Tk_ClassProcs structure. Checks that the structure
- * is not NULL, then checks the size field and returns either the requested
+ * Simple accessor for Tk_ClassProcs structure. Checks that the structure is
+ * not NULL, then checks the size field and returns either the requested
* field, if present, or NULL if the structure is too small to have the field
* (or NULL if the structure is NULL).
*
@@ -595,9 +584,9 @@ typedef struct Tk_ClassProcs {
(((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.
+ * 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,
@@ -606,17 +595,17 @@ typedef void (Tk_GeomLostSlaveProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin));
typedef struct Tk_GeomMgr {
- char *name; /* Name of the geometry manager (command
- * used to invoke it, or name of widget
- * class that allows embedded widgets). */
+ const char *name; /* Name of the geometry manager (command used
+ * to invoke it, or name of widget class that
+ * allows embedded widgets). */
Tk_GeomRequestProc *requestProc;
/* Procedure to invoke when a slave's
* requested geometry changes. */
Tk_GeomLostSlaveProc *lostSlaveProc;
- /* Procedure to invoke when a slave is
- * taken away from one geometry manager
- * by another. NULL means geometry manager
- * doesn't care when slaves are lost. */
+ /* Procedure to invoke when a slave is taken
+ * away from one geometry manager by another.
+ * NULL means geometry manager doesn't care
+ * when slaves are lost. */
} Tk_GeomMgr;
/*
@@ -648,35 +637,45 @@ typedef struct Tk_GeomMgr {
/*
* A virtual event shares most of its fields with the XKeyEvent and
- * XButtonEvent structures. 99% of the time a virtual event will be
- * an abstraction of a key or button event, so this structure provides
- * the most information to the user. The only difference is the changing
- * of the detail field for a virtual event so that it holds the name of the
- * virtual event being triggered.
+ * XButtonEvent structures. 99% of the time a virtual event will be an
+ * abstraction of a key or button event, so this structure provides the most
+ * information to the user. The only difference is the changing of the detail
+ * field for a virtual event so that it holds the name of the virtual event
+ * being triggered.
+ *
+ * When using this structure, you should ensure that you zero out all the
+ * fields first using memset() or bzero().
*/
typedef struct {
int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* True if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window event; /* Window on which event was requested. */
- Window root; /* root window that the event occured on */
- Window subwindow; /* child window */
- Time time; /* milliseconds */
- int x, y; /* pointer x, y coordinates in event window */
- int x_root, y_root; /* coordinates relative to root */
- unsigned int state; /* key or button mask */
- Tk_Uid name; /* Name of virtual event. */
- Bool same_screen; /* same screen flag */
+ unsigned long serial; /* # of last request processed by server. */
+ Bool send_event; /* True if this came from a SendEvent
+ * request. */
+ Display *display; /* Display the event was read from. */
+ Window event; /* Window on which event was requested. */
+ Window root; /* Root window that the event occured on. */
+ Window subwindow; /* Child window. */
+ Time time; /* Milliseconds. */
+ int x, y; /* Pointer x, y coordinates in event
+ * window. */
+ int x_root, y_root; /* Coordinates relative to root. */
+ unsigned int state; /* Key or button mask */
+ Tk_Uid name; /* Name of virtual event. */
+ Bool same_screen; /* Same screen flag. */
+ Tcl_Obj *user_data; /* Application-specific data reference; Tk
+ * will decrement the reference count *once*
+ * when it has finished processing the
+ * event. */
} XVirtualEvent;
typedef struct {
int type;
- unsigned long serial; /* # of last request processed by server */
- Bool send_event; /* True if this came from a SendEvent request */
- Display *display; /* Display the event was read from */
- Window window; /* Window in which event occurred. */
+ unsigned long serial; /* # of last request processed by server. */
+ Bool send_event; /* True if this came from a SendEvent
+ * request. */
+ Display *display; /* Display the event was read from. */
+ Window window; /* Window in which event occurred. */
} XActivateDeactivateEvent;
typedef XActivateDeactivateEvent XActivateEvent;
typedef XActivateDeactivateEvent XDeactivateEvent;
@@ -684,29 +683,29 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
/*
*--------------------------------------------------------------
*
- * Macros for querying Tk_Window structures. See the
- * manual entries for documentation.
+ * Macros for querying Tk_Window structures. See the manual entries for
+ * documentation.
*
*--------------------------------------------------------------
*/
-#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
-#define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum)
-#define Tk_Screen(tkwin) (ScreenOfDisplay(Tk_Display(tkwin), \
- Tk_ScreenNumber(tkwin)))
-#define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth)
-#define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual)
-#define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window)
-#define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName)
-#define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid)
-#define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid)
-#define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x)
-#define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y)
-#define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width)
+#define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
+#define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum)
+#define Tk_Screen(tkwin) \
+ (ScreenOfDisplay(Tk_Display(tkwin), Tk_ScreenNumber(tkwin)))
+#define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth)
+#define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual)
+#define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window)
+#define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName)
+#define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid)
+#define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid)
+#define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x)
+#define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y)
+#define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width)
#define Tk_Height(tkwin) \
(((Tk_FakeWin *) (tkwin))->changes.height)
-#define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes)
-#define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts)
+#define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes)
+#define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts)
#define Tk_IsEmbedded(tkwin) \
(((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED)
#define Tk_IsContainer(tkwin) \
@@ -721,8 +720,10 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
(((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED)
#define Tk_TopWinHierarchy(tkwin) \
(((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY)
-#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
-#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
+#define Tk_IsManageable(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE)
+#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
+#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
/* Tk_InternalBorderWidth is deprecated */
#define Tk_InternalBorderWidth(tkwin) \
(((Tk_FakeWin *) (tkwin))->internalBorderLeft)
@@ -734,20 +735,19 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
(((Tk_FakeWin *) (tkwin))->internalBorderTop)
#define Tk_InternalBorderBottom(tkwin) \
(((Tk_FakeWin *) (tkwin))->internalBorderBottom)
-#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth)
-#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight)
-#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr)
-#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap)
+#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth)
+#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight)
+#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr)
+#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap)
/*
- * The structure below is needed by the macros above so that they can
- * access the fields of a Tk_Window. The fields not needed by the macros
- * are declared as "dummyX". The structure has its own type in order to
- * prevent applications from accessing Tk_Window fields except using
- * official macros. WARNING!! The structure definition must be kept
- * consistent with the TkWindow structure in tkInt.h. If you change one,
- * then change the other. See the declaration in tkInt.h for
- * documentation on what the fields are used for internally.
+ * The structure below is needed by the macros above so that they can access
+ * the fields of a Tk_Window. The fields not needed by the macros are declared
+ * as "dummyX". The structure has its own type in order to prevent apps from
+ * accessing Tk_Window fields except using official macros. WARNING!! The
+ * structure definition must be kept consistent with the TkWindow structure in
+ * tkInt.h. If you change one, then change the other. See the declaration in
+ * tkInt.h for documentation on what the fields are used for internally.
*/
typedef struct Tk_FakeWin {
@@ -802,69 +802,65 @@ typedef struct Tk_FakeWin {
* TK_ALREADY_DEAD: 1 means the window is in the process of
* being destroyed already.
* TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured
- * before it was made to exist. At the time of
+ * before it was made to exist. At the time of
* making it exist a ConfigureNotify event needs
* to be generated.
- * TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for
- * details.
+ * TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for details
* TK_CHECKED_IC: 1 means we've already tried to get an input
- * context for this window; if the ic field
- * is NULL it means that there isn't a context
- * for the field.
+ * context for this window; if the ic field is
+ * NULL it means that there isn't a context for
+ * the field.
* TK_DONT_DESTROY_WINDOW: 1 means that Tk_DestroyWindow should not
* invoke XDestroyWindow to destroy this widget's
- * X window. The flag is set when the window
- * has already been destroyed elsewhere (e.g.
- * by another application) or when it will be
- * destroyed later (e.g. by destroying its
- * parent).
+ * X window. The flag is set when the window has
+ * already been destroyed elsewhere (e.g. by
+ * another application) or when it will be
+ * destroyed later (e.g. by destroying its parent)
* TK_WM_COLORMAP_WINDOW: 1 means that this window has at some time
* appeared in the WM_COLORMAP_WINDOWS property
- * for its toplevel, so we have to remove it
- * from that property if the window is
- * deleted and the toplevel isn't.
+ * for its toplevel, so we have to remove it from
+ * that property if the window is deleted and the
+ * toplevel isn't.
* TK_EMBEDDED: 1 means that this window (which must be a
* toplevel) is not a free-standing window but
* rather is embedded in some other application.
* TK_CONTAINER: 1 means that this window is a container, and
- * that some other application (either in
- * this process or elsewhere) may be
- * embedding itself inside the window.
+ * that some other application (either in this
+ * process or elsewhere) may be embedding itself
+ * inside the window.
* TK_BOTH_HALVES: 1 means that this window is used for
- * application embedding (either as
- * container or embedded application), and
- * both the containing and embedded halves
- * are associated with windows in this
- * particular process.
+ * application embedding (either as container or
+ * 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 information.
+ * 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
+ * information.
* TK_REPARENTED: 1 means that this window has been reparented
* so that as far as the window system is
- * concerned it isn't a child of its Tk
- * parent. Initially this is used only for
- * special Unix menubar windows.
+ * concerned it isn't a child of its Tk parent.
+ * Initially this is used only for special Unix
+ * menubar windows.
* TK_ANONYMOUS_WINDOW: 1 means that this window has no name, and is
* thus not accessible from Tk.
* TK_HAS_WRAPPER 1 means that this window has a wrapper window
- * TK_WIN_MANAGED 1 means that this window is a child of the
- * root window, and is managed by the window
- * manager.
- * TK_TOP_HIERARCHY 1 means this window is at the top of a
- * physical window hierarchy within this
- * process, i.e. the window's parent
- * either doesn't exist or is not owned by
- * this Tk application.
- * TK_PROP_PROPCHANGE 1 means that PropertyNotify events in
- * this window's children should propagate
- * up to this window.
+ * TK_WIN_MANAGED 1 means that this window is a child of the root
+ * window, and is managed by the window manager.
+ * TK_TOP_HIERARCHY 1 means this window is at the top of a physical
+ * window hierarchy within this process, i.e. the
+ * window's parent either doesn't exist or is not
+ * owned by this Tk application.
+ * TK_PROP_PROPCHANGE 1 means that PropertyNotify events in the
+ * window's children should propagate up to this
+ * window.
+ * TK_WM_MANAGEABLE 1 marks a window as capable of being converted
+ * into a toplevel using [wm manage].
*/
-
#define TK_MAPPED 1
#define TK_TOP_LEVEL 2
#define TK_ALREADY_DEAD 4
@@ -884,12 +880,12 @@ typedef struct Tk_FakeWin {
#define TK_WIN_MANAGED 0x10000
#define TK_TOP_HIERARCHY 0x20000
#define TK_PROP_PROPCHANGE 0x40000
+#define TK_WM_MANAGEABLE 0x80000
/*
*--------------------------------------------------------------
*
- * Procedure prototypes and structures used for defining new canvas
- * items:
+ * Procedure prototypes and structures used for defining new canvas items:
*
*--------------------------------------------------------------
*/
@@ -910,54 +906,48 @@ typedef struct Tk_SmoothMethod {
} Tk_SmoothMethod;
/*
- * For each item in a canvas widget there exists one record with
- * the following structure. Each actual item is represented by
- * a record with the following stuff at its beginning, plus additional
- * type-specific stuff after that.
+ * For each item in a canvas widget there exists one record with the following
+ * structure. Each actual item is represented by a record with the following
+ * stuff at its beginning, plus additional type-specific stuff after that.
*/
#define TK_TAG_SPACE 3
-typedef struct Tk_Item {
- int id; /* Unique identifier for this item
- * (also serves as first tag for
- * item). */
- struct Tk_Item *nextPtr; /* Next in display list of all
- * items in this canvas. Later items
- * in list are drawn on top of earlier
- * ones. */
- Tk_Uid staticTagSpace[TK_TAG_SPACE];/* Built-in space for limited # of
- * tags. */
- Tk_Uid *tagPtr; /* Pointer to array of tags. Usually
- * points to staticTagSpace, but
- * may point to malloc-ed space if
- * there are lots of tags. */
- int tagSpace; /* Total amount of tag space available
- * at tagPtr. */
- int numTags; /* Number of tag slots actually used
- * at *tagPtr. */
- struct Tk_ItemType *typePtr; /* Table of procedures that implement
- * this type of item. */
- int x1, y1, x2, y2; /* Bounding box for item, in integer
- * canvas units. Set by item-specific
- * code and guaranteed to contain every
- * pixel drawn in item. Item area
- * includes x1 and y1 but not x2
- * and y2. */
- struct Tk_Item *prevPtr; /* Previous in display list of all
- * items in this canvas. Later items
- * in list are drawn just below earlier
- * ones. */
- Tk_State state; /* state of item */
- char *reserved1; /* reserved for future use */
- int redraw_flags; /* some flags used in the canvas */
+typedef struct Tk_Item {
+ int id; /* Unique identifier for this item (also
+ * serves as first tag for item). */
+ struct Tk_Item *nextPtr; /* Next in display list of all items in this
+ * canvas. Later items in list are drawn on
+ * top of earlier ones. */
+ Tk_Uid staticTagSpace[TK_TAG_SPACE];
+ /* Built-in space for limited # of tags. */
+ Tk_Uid *tagPtr; /* Pointer to array of tags. Usually points to
+ * staticTagSpace, but may point to malloc-ed
+ * space if there are lots of tags. */
+ int tagSpace; /* Total amount of tag space available at
+ * tagPtr. */
+ int numTags; /* Number of tag slots actually used at
+ * *tagPtr. */
+ struct Tk_ItemType *typePtr;/* Table of procedures that implement this
+ * type of item. */
+ int x1, y1, x2, y2; /* Bounding box for item, in integer canvas
+ * units. Set by item-specific code and
+ * guaranteed to contain every pixel drawn in
+ * item. Item area includes x1 and y1 but not
+ * x2 and y2. */
+ struct Tk_Item *prevPtr; /* Previous in display list of all items in
+ * this canvas. Later items in list are drawn
+ * just below earlier ones. */
+ Tk_State state; /* State of item. */
+ char *reserved1; /* reserved for future use */
+ int redraw_flags; /* Some flags used in the canvas */
/*
*------------------------------------------------------------------
- * Starting here is additional type-specific stuff; see the
- * declarations for individual types to see what is part of
- * each type. The actual space below is determined by the
- * "itemInfoSize" of the type's Tk_ItemType record.
+ * Starting here is additional type-specific stuff; see the declarations
+ * for individual types to see what is part of each type. The actual space
+ * below is determined by the "itemInfoSize" of the type's Tk_ItemType
+ * record.
*------------------------------------------------------------------
*/
} Tk_Item;
@@ -965,20 +955,19 @@ typedef struct Tk_Item {
/*
* Flag bits for canvases (redraw_flags):
*
- * TK_ITEM_STATE_DEPENDANT - 1 means that object needs to be
- * redrawn if the canvas state changes.
- * TK_ITEM_DONT_REDRAW - 1 means that the object redraw is already
- * been prepared, so the general canvas code
- * doesn't need to do that any more.
+ * TK_ITEM_STATE_DEPENDANT - 1 means that object needs to be redrawn if the
+ * canvas state changes.
+ * TK_ITEM_DONT_REDRAW - 1 means that the object redraw is already been
+ * prepared, so the general canvas code doesn't
+ * need to do that any more.
*/
#define TK_ITEM_STATE_DEPENDANT 1
#define TK_ITEM_DONT_REDRAW 2
/*
- * Records of the following type are used to describe a type of
- * item (e.g. lines, circles, etc.) that can form part of a
- * canvas widget.
+ * Records of the following type are used to describe a type of item (e.g.
+ * lines, circles, etc.) that can form part of a canvas widget.
*/
#ifdef USE_OLD_CANVAS
@@ -994,13 +983,13 @@ typedef int Tk_ItemCoordProc _ANSI_ARGS_((Tcl_Interp *interp,
#else
typedef int Tk_ItemCreateProc _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST objv[]));
+ 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));
+ 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[]));
+ Tcl_Obj *const argv[]));
#endif
typedef void Tk_ItemDeleteProc _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
@@ -1034,100 +1023,103 @@ typedef void Tk_ItemDCharsProc _ANSI_ARGS_((Tk_Canvas canvas,
#ifndef __NO_OLD_CONFIG
typedef struct Tk_ItemType {
- 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 this type. Used for
- * returning configuration info. */
- Tk_ItemConfigureProc *configProc; /* Procedure to call to change
- * configuration options. */
- Tk_ItemCoordProc *coordProc; /* Procedure to call to get and set
- * the item's coordinates. */
- Tk_ItemDeleteProc *deleteProc; /* Procedure to delete existing item of
- * this type. */
- Tk_ItemDisplayProc *displayProc; /* Procedure to display items of
- * this type. */
- int alwaysRedraw; /* Non-zero means displayProc should
- * be called even when the item has
- * been moved off-screen. */
- Tk_ItemPointProc *pointProc; /* Computes distance from item to
- * a given point. */
- Tk_ItemAreaProc *areaProc; /* Computes whether item is inside,
- * outside, or overlapping an area. */
+ 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
+ * this type. Used for returning configuration
+ * info. */
+ Tk_ItemConfigureProc *configProc;
+ /* Procedure to call to change configuration
+ * options. */
+ Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's
+ * coordinates. */
+ Tk_ItemDeleteProc *deleteProc;
+ /* Procedure to delete existing item of this
+ * type. */
+ Tk_ItemDisplayProc *displayProc;
+ /* Procedure to display items of this type. */
+ int alwaysRedraw; /* Non-zero means displayProc should be called
+ * even when the item has been moved
+ * off-screen. */
+ Tk_ItemPointProc *pointProc;/* Computes distance from item to a given
+ * point. */
+ Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside,
+ * or overlapping an area. */
Tk_ItemPostscriptProc *postscriptProc;
- /* Procedure to write a Postscript
- * description for items of this
- * type. */
- Tk_ItemScaleProc *scaleProc; /* Procedure to rescale items of
- * this type. */
- Tk_ItemTranslateProc *translateProc;/* Procedure to translate items of
- * this type. */
- Tk_ItemIndexProc *indexProc; /* Procedure to determine index of
- * indicated character. NULL if
- * item doesn't support indexing. */
- Tk_ItemCursorProc *icursorProc; /* Procedure to set insert cursor pos.
- * to just before a given position. */
- Tk_ItemSelectionProc *selectionProc;/* Procedure to return selection (in
- * STRING format) when it is in this
- * item. */
- Tk_ItemInsertProc *insertProc; /* Procedure to insert something into
- * an item. */
- Tk_ItemDCharsProc *dCharsProc; /* Procedure to delete characters
- * from an item. */
- struct Tk_ItemType *nextPtr; /* Used to link types together into
- * a list. */
- char *reserved1; /* Reserved for future extension. */
- int reserved2; /* Carefully compatible with */
- char *reserved3; /* Jan Nijtmans dash patch */
+ /* Procedure to write a Postscript description
+ * for items of this type. */
+ Tk_ItemScaleProc *scaleProc;/* Procedure to rescale items of this type. */
+ Tk_ItemTranslateProc *translateProc;
+ /* Procedure to translate items of this
+ * type. */
+ Tk_ItemIndexProc *indexProc;/* Procedure to determine index of indicated
+ * character. NULL if item doesn't support
+ * indexing. */
+ Tk_ItemCursorProc *icursorProc;
+ /* Procedure to set insert cursor posn to just
+ * before a given position. */
+ Tk_ItemSelectionProc *selectionProc;
+ /* Procedure to return selection (in STRING
+ * format) when it is in this item. */
+ Tk_ItemInsertProc *insertProc;
+ /* Procedure to insert something into an
+ * item. */
+ Tk_ItemDCharsProc *dCharsProc;
+ /* Procedure to delete characters from an
+ * item. */
+ struct Tk_ItemType *nextPtr;/* Used to link types together into a list. */
+ char *reserved1; /* Reserved for future extension. */
+ int reserved2; /* Carefully compatible with */
+ char *reserved3; /* Jan Nijtmans dash patch */
char *reserved4;
} Tk_ItemType;
#endif
/*
- * The following structure provides information about the selection and
- * the insertion cursor. It is needed by only a few items, such as
- * those that display text. It is shared by the generic canvas code
- * and the item-specific code, but most of the fields should be written
- * only by the canvas generic code.
+ * The following structure provides information about the selection and the
+ * insertion cursor. It is needed by only a few items, such as those that
+ * display text. It is shared by the generic canvas code and the item-specific
+ * code, but most of the fields should be written only by the canvas generic
+ * code.
*/
typedef struct Tk_CanvasTextInfo {
Tk_3DBorder selBorder; /* Border and background for selected
- * characters. Read-only to items.*/
- int selBorderWidth; /* Width of border around selection.
- * Read-only to items. */
+ * characters. Read-only to items.*/
+ int selBorderWidth; /* Width of border around selection. Read-only
+ * to items. */
XColor *selFgColorPtr; /* Foreground color for selected text.
* Read-only to items. */
- Tk_Item *selItemPtr; /* Pointer to selected item. NULL means
- * selection isn't in this canvas.
- * Writable by items. */
+ Tk_Item *selItemPtr; /* Pointer to selected item. NULL means
+ * selection isn't in this canvas. Writable by
+ * items. */
int selectFirst; /* Character index of first selected
- * character. Writable by items. */
- int selectLast; /* Character index of last selected
- * character. Writable by items. */
- Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor":
- * not necessarily selItemPtr. Read-only
- * to items. */
- int selectAnchor; /* Character index of fixed end of
- * selection (i.e. "select to" operation will
- * use this as one end of the selection).
+ * character. Writable by items. */
+ int selectLast; /* Character index of last selected character.
* Writable by items. */
+ Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not
+ * necessarily selItemPtr. Read-only to
+ * items. */
+ int selectAnchor; /* Character index of fixed end of selection
+ * (i.e. "select to" operation will use this
+ * as one end of the selection). Writable by
+ * items. */
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
- * cursor. Read-only to items. */
- int insertWidth; /* Total width of insertion cursor. Read-only
+ * cursor. Read-only to items. */
+ int insertWidth; /* Total width of insertion cursor. Read-only
* to items. */
int insertBorderWidth; /* Width of 3-D border around insert cursor.
* Read-only to items. */
- Tk_Item *focusItemPtr; /* Item that currently has the input focus,
- * or NULL if no such item. Read-only to
- * items. */
+ Tk_Item *focusItemPtr; /* Item that currently has the input focus, or
+ * NULL if no such item. Read-only to items. */
int gotFocus; /* Non-zero means that the canvas widget has
- * the input focus. Read-only to items.*/
+ * the input focus. Read-only to items.*/
int cursorOn; /* Non-zero means that an insertion cursor
* should be displayed in focusItemPtr.
* Read-only to items.*/
@@ -1146,7 +1138,7 @@ typedef struct Tk_Dash {
} Tk_Dash;
typedef struct Tk_TSOffset {
- int flags; /* flags; see below for possible values */
+ int flags; /* Flags; see below for possible values */
int xoffset; /* x offset */
int yoffset; /* y offset */
} Tk_TSOffset;
@@ -1169,22 +1161,23 @@ typedef struct Tk_Outline {
double width; /* Width of outline. */
double activeWidth; /* Width of outline. */
double disabledWidth; /* Width of outline. */
- int offset; /* Dash offset */
- 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 */
+ int offset; /* Dash offset. */
+ 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;
- Tk_TSOffset tsoffset; /* stipple offset for outline*/
+ Tk_TSOffset tsoffset; /* Stipple offset for outline. */
XColor *color; /* Outline color. */
XColor *activeColor; /* Outline color if state is active. */
XColor *disabledColor; /* Outline color if state is disabled. */
Pixmap stipple; /* Outline Stipple pattern. */
- Pixmap activeStipple; /* Outline Stipple pattern if state is active. */
- Pixmap disabledStipple; /* Outline Stipple pattern if state is disabled. */
+ Pixmap activeStipple; /* Outline Stipple pattern if state is
+ * active. */
+ Pixmap disabledStipple; /* Outline Stipple pattern if state is
+ * disabled. */
} Tk_Outline;
-
/*
*--------------------------------------------------------------
@@ -1201,7 +1194,7 @@ typedef int (Tk_ImageCreateProc) _ANSI_ARGS_((Tcl_Interp *interp,
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,
+ 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,
@@ -1220,39 +1213,37 @@ typedef int (Tk_ImagePostscriptProc) _ANSI_ARGS_((ClientData clientData,
int x, int y, int width, int height, int prepass));
/*
- * The following structure represents a particular type of image
- * (bitmap, xpm image, etc.). It provides information common to
- * all images of that type, such as the type name and a collection
- * of procedures in the image manager that respond to various
- * events. Each image manager is represented by one of these
- * structures.
+ * The following structure represents a particular type of image (bitmap, xpm
+ * image, etc.). It provides information common to all images of that type,
+ * such as the type name and a collection of procedures in the image manager
+ * that respond to various events. Each image manager is represented by one of
+ * these structures.
*/
struct Tk_ImageType {
char *name; /* Name of image type. */
Tk_ImageCreateProc *createProc;
- /* Procedure to call to create a new image
- * of this type. */
+ /* Procedure to call to create a new image of
+ * this type. */
Tk_ImageGetProc *getProc; /* Procedure to call the first time
- * Tk_GetImage is called in a new way
- * (new visual or screen). */
+ * Tk_GetImage is called in a new way (new
+ * visual or screen). */
Tk_ImageDisplayProc *displayProc;
/* Call to draw image, in response to
* Tk_RedrawImage calls. */
- Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage
- * is called to release an instance of an
+ Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage is
+ * called to release an instance of an
* image. */
Tk_ImageDeleteProc *deleteProc;
- /* Procedure to call to delete image. It
- * will not be called until after freeProc
- * has been called for each instance of the
- * image. */
+ /* Procedure to call to delete image. It will
+ * not be called until after freeProc has been
+ * called for each instance of the image. */
Tk_ImagePostscriptProc *postscriptProc;
/* Procedure to call to produce postscript
* output for the image. */
struct Tk_ImageType *nextPtr;
/* Next in list of all image types currently
- * known. Filled in by Tk, not by image
+ * known. Filled in by Tk, not by image
* manager. */
char *reserved; /* reserved for future expansion */
};
@@ -1266,8 +1257,8 @@ struct Tk_ImageType {
*/
/*
- * The following type is used to identify a particular photo image
- * to be manipulated:
+ * The following type is used to identify a particular photo image to be
+ * manipulated:
*/
typedef void *Tk_PhotoHandle;
@@ -1278,29 +1269,28 @@ typedef void *Tk_PhotoHandle;
typedef struct Tk_PhotoImageBlock {
unsigned char *pixelPtr; /* Pointer to the first pixel. */
- int width; /* Width of block, in pixels. */
- int height; /* Height of block, in pixels. */
- int pitch; /* Address difference between corresponding
+ int width; /* Width of block, in pixels. */
+ int height; /* Height of block, in pixels. */
+ int pitch; /* Address difference between corresponding
* pixels in successive lines. */
- int pixelSize; /* Address difference between successive
+ int pixelSize; /* Address difference between successive
* pixels in the same line. */
- int offset[4]; /* Address differences between the red, green,
+ int offset[4]; /* Address differences between the red, green,
* blue and alpha components of the pixel and
* the pixel as a whole. */
} Tk_PhotoImageBlock;
/*
- * The following values control how blocks are combined into photo
- * images when the alpha component of a pixel is not 255, a.k.a. the
- * compositing rule.
+ * The following values control how blocks are combined into photo images when
+ * the alpha component of a pixel is not 255, a.k.a. the compositing rule.
*/
#define TK_PHOTO_COMPOSITE_OVERLAY 0
#define TK_PHOTO_COMPOSITE_SET 1
/*
- * Procedure prototypes and structures used in reading and
- * writing photo images:
+ * Procedure prototypes and structures used in reading and writing photo
+ * images:
*/
typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
@@ -1323,68 +1313,61 @@ typedef int (Tk_ImageStringWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
Tk_PhotoImageBlock *blockPtr));
#else
typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan,
- CONST char *fileName, Tcl_Obj *format, int *widthPtr,
+ 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,
+ 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));
+ 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
/*
- * The following structure represents a particular file format for
- * storing images (e.g., PPM, GIF, JPEG, etc.). It provides information
- * to allow image files of that format to be recognized and read into
- * a photo image.
+ * The following structure represents a particular file format for storing
+ * images (e.g., PPM, GIF, JPEG, etc.). It provides information to allow image
+ * files of that format to be recognized and read into a photo image.
*/
struct Tk_PhotoImageFormat {
char *name; /* Name of image file format */
Tk_ImageFileMatchProc *fileMatchProc;
- /* Procedure to call to determine whether
- * an image file matches this format. */
+ /* Procedure to call to determine whether an
+ * image file matches this format. */
Tk_ImageStringMatchProc *stringMatchProc;
- /* Procedure to call to determine whether
- * the data in a string matches this format. */
+ /* Procedure to call to determine whether the
+ * data in a string matches this format. */
Tk_ImageFileReadProc *fileReadProc;
- /* Procedure to call to read data from
- * an image file into a photo image. */
+ /* Procedure to call to read data from an
+ * image file into a photo image. */
Tk_ImageStringReadProc *stringReadProc;
- /* Procedure to call to read data from
- * a string into a photo image. */
+ /* Procedure to call to read data from a
+ * string into a photo image. */
Tk_ImageFileWriteProc *fileWriteProc;
- /* Procedure to call to write data from
- * a photo image to a file. */
+ /* Procedure to call to write data from a
+ * photo image to a file. */
Tk_ImageStringWriteProc *stringWriteProc;
/* Procedure to call to obtain a string
* representation of the data in a photo
* image.*/
struct Tk_PhotoImageFormat *nextPtr;
/* Next in list of all photo image formats
- * currently known. Filled in by Tk, not
- * by image format handler. */
+ * currently known. Filled in by Tk, not by
+ * image format handler. */
};
-EXTERN void Tk_CreateOldImageType _ANSI_ARGS_((
- Tk_ImageType *typePtr));
-EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
- Tk_PhotoImageFormat *formatPtr));
-
-#if !defined(USE_TK_STUBS) && defined(USE_OLD_IMAGE)
+#ifdef USE_OLD_IMAGE
#define Tk_CreateImageType Tk_CreateOldImageType
#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat
#endif
-
/*
*--------------------------------------------------------------
@@ -1397,6 +1380,7 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
/*
* Style support version tag.
*/
+
#define TK_STYLE_VERSION_1 0x1
#define TK_STYLE_VERSION TK_STYLE_VERSION_1
@@ -1406,16 +1390,16 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
*/
typedef void (Tk_GetElementSizeProc) _ANSI_ARGS_((ClientData clientData,
- char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin,
+ 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,
+ 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));
+ 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,
+ 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 {
@@ -1430,22 +1414,18 @@ typedef struct Tk_ElementSpec {
Tk_ElementOptionSpec *options;
/* List of required options. Last one's name
* must be NULL. */
-
- /*
- * Hooks
- */
-
Tk_GetElementSizeProc *getSize;
- /* Compute the external (resp. internal) size of
- * the element from its desired internal (resp.
- * external) size. */
+ /* Compute the external (resp. internal) size
+ * of the element from its desired internal
+ * (resp. external) size. */
Tk_GetElementBoxProc *getBox;
/* Compute the inscribed or bounding boxes
* within a given area. */
Tk_GetElementBorderWidthProc *getBorderWidth;
/* Return the element's internal border width.
* Mostly useful for widgets. */
- Tk_DrawElementProc *draw; /* Draw the element in the given bounding box.*/
+ Tk_DrawElementProc *draw; /* Draw the element in the given bounding
+ * box. */
} Tk_ElementSpec;
/*
@@ -1460,9 +1440,9 @@ typedef struct Tk_ElementSpec {
/*
*--------------------------------------------------------------
*
- * 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.
+ * 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.
*
*--------------------------------------------------------------
*/
@@ -1505,23 +1485,20 @@ typedef struct Tk_ElementSpec {
#define Tk_Main(argc, argv, proc) \
Tk_MainEx(argc, argv, proc, Tcl_CreateInterp())
-CONST char *Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, char *version, int exact));
+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));
#ifndef USE_TK_STUBS
#define Tk_InitStubs(interp, version, exact) \
- Tcl_PkgRequire(interp, "Tk", version, exact)
+ Tk_PkgInitStubsCheck(interp, version, exact)
#endif
-void Tk_InitImageArgs _ANSI_ARGS_((Tcl_Interp *interp, int argc, char ***argv));
-
-#if !defined(USE_TK_STUBS) || !defined(USE_OLD_IMAGE)
-
#define Tk_InitImageArgs(interp, argc, argv) /**/
-#endif
-
/*
*--------------------------------------------------------------
@@ -1547,7 +1524,6 @@ typedef Tk_RestrictAction (Tk_RestrictProc) _ANSI_ARGS_((
typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
int offset, char *buffer, int maxBytes));
-
/*
*--------------------------------------------------------------
*
@@ -1559,12 +1535,11 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
#include "tkDecls.h"
/*
- * Allow users to say that they don't want to alter their source to
- * add the extra argument to Tk_PhotoPutBlock(); DO NOT DEFINE THIS
- * WHEN BUILDING TK.
+ * 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.
*
- * This goes after the inclusion of the stubbed-decls so that the
- * declarations of what is actually there can be correct.
+ * This goes after the inclusion of the stubbed-decls so that the declarations
+ * of what is actually there can be correct.
*/
#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
@@ -1576,13 +1551,34 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
# undef Tk_PhotoPutZoomedBlock
# endif
# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite
+# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE
+#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
+# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
+# ifdef Tk_PhotoPutBlock
+# undef Tk_PhotoPutBlock
+# endif
+# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic
+# ifdef Tk_PhotoPutZoomedBlock
+# undef Tk_PhotoPutZoomedBlock
+# endif
+# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic
+# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
+#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
+# ifdef Tk_PhotoExpand
+# undef Tk_PhotoExpand
+# endif
+# define Tk_PhotoExpand Tk_PhotoExpand_Panic
+# ifdef Tk_PhotoSetSize
+# undef Tk_PhotoSetSize
+# 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
@@ -1591,9 +1587,17 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
/*
* end block for C++
*/
-
+
#ifdef __cplusplus
}
#endif
-
+
#endif /* _TK */
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 4d9d163..caa40dd 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -1,40 +1,41 @@
-/*
+/*
* tk3d.c --
*
- * This module provides procedures to draw borders in
- * the three-dimensional Motif style.
+ * This module provides procedures to draw borders in the
+ * three-dimensional Motif style.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tk3d.h"
/*
- * The following table defines the string values for reliefs, which are
- * used by Tk_GetReliefFromObj.
+ * The following table defines the string values for reliefs, which are used
+ * by Tk_GetReliefFromObj.
*/
-static CONST char *reliefStrings[] = {"flat", "groove", "raised",
- "ridge", "solid", "sunken",
- (char *) NULL};
+static CONST char *reliefStrings[] = {
+ "flat", "groove", "raised", "ridge", "solid", "sunken", NULL
+};
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void BorderInit _ANSI_ARGS_((TkDisplay *dispPtr));
-static void DupBorderObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
- Tcl_Obj *dupObjPtr));
-static void FreeBorderObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
-static int Intersect _ANSI_ARGS_((XPoint *a1Ptr, XPoint *a2Ptr,
- XPoint *b1Ptr, XPoint *b2Ptr, XPoint *iPtr));
-static void InitBorderObj _ANSI_ARGS_((Tcl_Obj *objPtr));
-static void ShiftLine _ANSI_ARGS_((XPoint *p1Ptr, XPoint *p2Ptr,
- int distance, XPoint *p3Ptr));
+static void BorderInit(TkDisplay *dispPtr);
+static void DupBorderObjProc(Tcl_Obj *srcObjPtr,
+ Tcl_Obj *dupObjPtr);
+static void FreeBorderObjProc(Tcl_Obj *objPtr);
+static int Intersect(XPoint *a1Ptr, XPoint *a2Ptr,
+ XPoint *b1Ptr, XPoint *b2Ptr, XPoint *iPtr);
+static void InitBorderObj(Tcl_Obj *objPtr);
+static void ShiftLine(XPoint *p1Ptr, XPoint *p2Ptr,
+ int distance, XPoint *p3Ptr);
/*
* The following structure defines the implementation of the "border" Tcl
@@ -57,30 +58,30 @@ Tcl_ObjType tkBorderObjType = {
*
* Tk_Alloc3DBorderFromObj --
*
- * Given a Tcl_Obj *, map the value to a corresponding
- * Tk_3DBorder structure based on the tkwin given.
+ * Given a Tcl_Obj *, map the value to a corresponding Tk_3DBorder
+ * structure based on the tkwin given.
*
* Results:
- * The return value is a token for a data structure describing a
- * 3-D border. This token may be passed to procedures such as
- * Tk_Draw3DRectangle and Tk_Free3DBorder. If an error prevented
- * the border from being created then NULL is returned and an error
- * message will be left in the interp's result.
+ * The return value is a token for a data structure describing a 3-D
+ * border. This token may be passed to functions such as
+ * Tk_Draw3DRectangle and Tk_Free3DBorder. If an error prevented the
+ * border from being created then NULL is returned and an error message
+ * will be left in the interp's result.
*
* Side effects:
- * The border is added to an internal database with a reference
- * count. For each call to this procedure, there should eventually
- * be a call to FreeBorderObjProc so that the database is
- * cleaned up when borders aren't in use anymore.
+ * 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.
*
*----------------------------------------------------------------------
*/
Tk_3DBorder
-Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
- Tcl_Interp *interp; /* Interp for error results. */
- Tk_Window tkwin; /* Need the screen the border is used on.*/
- Tcl_Obj *objPtr; /* Object giving name of color for window
+Tk_Alloc3DBorderFromObj(
+ Tcl_Interp *interp, /* Interp for error results. */
+ Tk_Window tkwin, /* Need the screen the border is used on.*/
+ Tcl_Obj *objPtr) /* Object giving name of color for window
* background. */
{
TkBorder *borderPtr;
@@ -91,15 +92,15 @@ Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
/*
- * If the object currently points to a TkBorder, see if it's the
- * one we want. If so, increment its reference count and return.
+ * If the object currently points to a TkBorder, see if it's the one we
+ * want. If so, increment its reference count and return.
*/
if (borderPtr != NULL) {
if (borderPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a border that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a border that's no
+ * longer in use. Clear the reference.
*/
FreeBorderObjProc(objPtr);
@@ -112,24 +113,22 @@ Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
}
/*
- * 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.
+ * 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.
+ * 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.
*
- * If the value is not NULL, the internal rep is the value
- * of the color the last time this object was accessed. Check
- * the screen and colormap of the last access, and if they
- * match, we are done.
+ * If the value is not NULL, the internal rep is the value of the color
+ * the last time this object was accessed. Check the screen and colormap
+ * of the last access, and if they match, we are done.
*/
if (borderPtr != NULL) {
- TkBorder *firstBorderPtr =
+ TkBorder *firstBorderPtr =
(TkBorder *) Tcl_GetHashValue(borderPtr->hashPtr);
FreeBorderObjProc(objPtr);
for (borderPtr = firstBorderPtr ; borderPtr != NULL;
@@ -138,19 +137,19 @@ Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
borderPtr->resourceRefCount++;
borderPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) borderPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
return (Tk_3DBorder) borderPtr;
}
}
}
/*
- * Still no luck. Call Tk_Get3DBorder to allocate a new border.
+ * Still no luck. Call Tk_Get3DBorder to allocate a new border.
*/
borderPtr = (TkBorder *) Tk_Get3DBorder(interp, tkwin,
Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) borderPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
if (borderPtr != NULL) {
borderPtr->objRefCount++;
}
@@ -165,31 +164,31 @@ Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
* Create a data structure for displaying a 3-D border.
*
* Results:
- * The return value is a token for a data structure describing a
- * 3-D border. This token may be passed to procedures such as
- * Tk_Draw3DRectangle and Tk_Free3DBorder. If an error prevented
- * the border from being created then NULL is returned and an error
- * message will be left in the interp's result.
+ * The return value is a token for a data structure describing a 3-D
+ * border. This token may be passed to functions such as
+ * Tk_Draw3DRectangle and Tk_Free3DBorder. If an error prevented the
+ * border from being created then NULL is returned and an error message
+ * will be left in the interp's result.
*
* Side effects:
- * Data structures, graphics contexts, etc. are allocated.
- * It is the caller's responsibility to eventually call
- * Tk_Free3DBorder to release the resources.
+ * Data structures, graphics contexts, etc. are allocated. It is the
+ * caller's responsibility to eventually call Tk_Free3DBorder to release
+ * the resources.
*
*--------------------------------------------------------------
*/
Tk_3DBorder
-Tk_Get3DBorder(interp, tkwin, colorName)
- Tcl_Interp *interp; /* Place to store an error message. */
- Tk_Window tkwin; /* Token for window in which border will
- * be drawn. */
- Tk_Uid colorName; /* String giving name of color
- * for window background. */
+Tk_Get3DBorder(
+ Tcl_Interp *interp, /* Place to store an error message. */
+ Tk_Window tkwin, /* Token for window in which border will be
+ * drawn. */
+ Tk_Uid colorName) /* String giving name of color for window
+ * background. */
{
Tcl_HashEntry *hashPtr;
TkBorder *borderPtr, *existingBorderPtr;
- int new;
+ int isNew;
XGCValues gcValues;
XColor *bgColorPtr;
TkDisplay *dispPtr;
@@ -200,8 +199,8 @@ Tk_Get3DBorder(interp, tkwin, colorName)
BorderInit(dispPtr);
}
- hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &new);
- if (!new) {
+ hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew);
+ if (!isNew) {
existingBorderPtr = (TkBorder *) Tcl_GetHashValue(hashPtr);
for (borderPtr = existingBorderPtr; borderPtr != NULL;
borderPtr = borderPtr->nextPtr) {
@@ -216,12 +215,12 @@ Tk_Get3DBorder(interp, tkwin, colorName)
}
/*
- * No satisfactory border exists yet. Initialize a new one.
+ * No satisfactory border exists yet. Initialize a new one.
*/
bgColorPtr = Tk_GetColor(interp, tkwin, colorName);
if (bgColorPtr == NULL) {
- if (new) {
+ if (isNew) {
Tcl_DeleteHashEntry(hashPtr);
}
return NULL;
@@ -246,9 +245,8 @@ Tk_Get3DBorder(interp, tkwin, colorName)
Tcl_SetHashValue(hashPtr, borderPtr);
/*
- * Create the information for displaying the background color,
- * but delay the allocation of shadows until they are actually
- * needed for drawing.
+ * Create the information for displaying the background color, but delay
+ * the allocation of shadows until they are actually needed for drawing.
*/
gcValues.foreground = borderPtr->bgColorPtr->pixel;
@@ -267,25 +265,24 @@ Tk_Get3DBorder(interp, tkwin, colorName)
* None.
*
* Side effects:
- * A 3-D border will be drawn in the indicated drawable.
- * The outside edges of the border will be determined by x,
- * y, width, and height. The inside edges of the border
- * will be determined by the borderWidth argument.
+ * A 3-D border will be drawn in the indicated drawable. The outside
+ * edges of the border will be determined by x, y, width, and height. The
+ * inside edges of the border will be determined by the borderWidth
+ * argument.
*
*--------------------------------------------------------------
*/
void
-Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height,
- borderWidth, relief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Tk_3DBorder border; /* Token for border to draw. */
- int x, y, width, height; /* Outside area of region in
- * which border will be drawn. */
- int borderWidth; /* Desired width for border, in
- * pixels. */
- int relief; /* Type of relief: TK_RELIEF_RAISED,
+Tk_Draw3DRectangle(
+ Tk_Window tkwin, /* Window for which border was allocated. */
+ Drawable drawable, /* X window or pixmap in which to draw. */
+ Tk_3DBorder border, /* Token for border to draw. */
+ int x, int y, int width, int height,
+ /* Outside area of region in which border will
+ * be drawn. */
+ int borderWidth, /* Desired width for border, in pixels. */
+ int relief) /* Type of relief: TK_RELIEF_RAISED,
* TK_RELIEF_SUNKEN, TK_RELIEF_GROOVE, etc. */
{
if (width < 2*borderWidth) {
@@ -309,12 +306,11 @@ Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height,
*
* Tk_NameOf3DBorder --
*
- * Given a border, return a textual string identifying the
- * border's color.
+ * Given a border, return a textual string identifying the border's
+ * color.
*
* Results:
- * The return value is the string that was used to create
- * the border.
+ * The return value is the string that was used to create the border.
*
* Side effects:
* None.
@@ -323,8 +319,8 @@ Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height,
*/
CONST char *
-Tk_NameOf3DBorder(border)
- Tk_3DBorder border; /* Token for border. */
+Tk_NameOf3DBorder(
+ Tk_3DBorder border) /* Token for border. */
{
TkBorder *borderPtr = (TkBorder *) border;
@@ -336,8 +332,7 @@ Tk_NameOf3DBorder(border)
*
* Tk_3DBorderColor --
*
- * Given a 3D border, return the X color used for the "flat"
- * surfaces.
+ * Given a 3D border, return the X color used for the "flat" surfaces.
*
* Results:
* Returns the color used drawing flat surfaces with the border.
@@ -348,10 +343,10 @@ Tk_NameOf3DBorder(border)
*--------------------------------------------------------------------
*/
XColor *
-Tk_3DBorderColor(border)
- Tk_3DBorder border; /* Border whose color is wanted. */
+Tk_3DBorderColor(
+ Tk_3DBorder border) /* Border whose color is wanted. */
{
- return(((TkBorder *) border)->bgColorPtr);
+ return ((TkBorder *) border)->bgColorPtr;
}
/*
@@ -359,8 +354,8 @@ Tk_3DBorderColor(border)
*
* Tk_3DBorderGC --
*
- * Given a 3D border, returns one of the graphics contexts used to
- * draw the border.
+ * Given a 3D border, returns one of the graphics contexts used to draw
+ * the border.
*
* Results:
* Returns the graphics context given by the "which" argument.
@@ -371,10 +366,10 @@ Tk_3DBorderColor(border)
*--------------------------------------------------------------------
*/
GC
-Tk_3DBorderGC(tkwin, border, which)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Tk_3DBorder border; /* Border whose GC is wanted. */
- int which; /* Selects one of the border's 3 GC's:
+Tk_3DBorderGC(
+ Tk_Window tkwin, /* Window for which border was allocated. */
+ Tk_3DBorder border, /* Border whose GC is wanted. */
+ int which) /* Selects one of the border's 3 GC's:
* TK_3D_FLAT_GC, TK_3D_LIGHT_GC, or
* TK_3D_DARK_GC. */
{
@@ -390,11 +385,11 @@ Tk_3DBorderGC(tkwin, border, which)
} else if (which == TK_3D_DARK_GC){
return borderPtr->darkGC;
}
- panic("bogus \"which\" value in Tk_3DBorderGC");
+ Tcl_Panic("bogus \"which\" value in Tk_3DBorderGC");
/*
- * The code below will never be executed, but it's needed to
- * keep compilers happy.
+ * The code below will never be executed, but it's needed to keep
+ * compilers happy.
*/
return (GC) None;
@@ -405,10 +400,9 @@ Tk_3DBorderGC(tkwin, border, which)
*
* Tk_Free3DBorder --
*
- * This procedure is called when a 3D border is no longer
- * needed. It frees the resources associated with the
- * border. After this call, the caller should never again
- * use the "border" token.
+ * This function is called when a 3D border is no longer needed. It frees
+ * the resources associated with the border. After this call, the caller
+ * should never again use the "border" token.
*
* Results:
* None.
@@ -420,8 +414,8 @@ Tk_3DBorderGC(tkwin, border, which)
*/
void
-Tk_Free3DBorder(border)
- Tk_3DBorder border; /* Token for border to be released. */
+Tk_Free3DBorder(
+ Tk_3DBorder border) /* Token for border to be released. */
{
TkBorder *borderPtr = (TkBorder *) border;
Display *display = DisplayOfScreen(borderPtr->screen);
@@ -477,27 +471,27 @@ Tk_Free3DBorder(border)
*
* Tk_Free3DBorderFromObj --
*
- * This procedure is called to release a border allocated by
- * Tk_Alloc3DBorderFromObj. It does not throw away the Tcl_Obj *;
- * it only gets rid of the hash table entry for this border
- * and clears the cached value that is normally stored in the object.
+ * This function is called to release a border allocated by
+ * Tk_Alloc3DBorderFromObj. It does not throw away the Tcl_Obj *; it only
+ * gets rid of the hash table entry for this border and clears the cached
+ * value that is normally stored in the object.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with the border represented by
- * objPtr is decremented, and the border's resources are released
- * to X if there are no remaining uses for it.
+ * The reference count associated with the border represented by objPtr
+ * is decremented, and the border's resources are released to X if there
+ * are no remaining uses for it.
*
*----------------------------------------------------------------------
*/
void
-Tk_Free3DBorderFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window this border lives in. Needed
- * for the screen and colormap values. */
- Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+Tk_Free3DBorderFromObj(
+ Tk_Window tkwin, /* The window this border lives in. Needed for
+ * the screen and colormap values. */
+ Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
Tk_Free3DBorder(Tk_Get3DBorderFromObj(tkwin, objPtr));
FreeBorderObjProc(objPtr);
@@ -506,66 +500,65 @@ Tk_Free3DBorderFromObj(tkwin, objPtr)
/*
*---------------------------------------------------------------------------
*
- * FreeBorderObjProc --
+ * FreeBorderObjProc --
*
- * 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 borderPtr needs to be changed.
+ * 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
+ * borderPtr needs to be changed.
*
* Results:
* None.
*
* Side effects:
- * The object reference count is decremented. When both it
- * and the hash ref count go to zero, the border's resources
- * are released.
+ * The object reference count is decremented. When both it and the hash
+ * ref count go to zero, the border's resources are released.
*
*---------------------------------------------------------------------------
*/
static void
-FreeBorderObjProc(objPtr)
- Tcl_Obj *objPtr; /* The object we are releasing. */
+FreeBorderObjProc(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
{
TkBorder *borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
if (borderPtr != NULL) {
borderPtr->objRefCount--;
- if ((borderPtr->objRefCount == 0)
+ if ((borderPtr->objRefCount == 0)
&& (borderPtr->resourceRefCount == 0)) {
ckfree((char *) borderPtr);
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
/*
*---------------------------------------------------------------------------
*
- * DupBorderObjProc --
+ * DupBorderObjProc --
*
- * When a cached border object is duplicated, this is called to
- * update the internal reps.
+ * When a cached border object is duplicated, this is called to update
+ * the internal reps.
*
* Results:
* None.
*
* Side effects:
- * The border's objRefCount is incremented and the internal rep
- * of the copy is set to point to it.
+ * The border's objRefCount is incremented and the internal rep of the
+ * copy is set to point to it.
*
*---------------------------------------------------------------------------
*/
static void
-DupBorderObjProc(srcObjPtr, dupObjPtr)
- Tcl_Obj *srcObjPtr; /* The object we are copying from. */
- Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+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;
-
+
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (VOID *) borderPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
if (borderPtr != NULL) {
borderPtr->objRefCount++;
@@ -577,8 +570,8 @@ DupBorderObjProc(srcObjPtr, dupObjPtr)
*
* Tk_SetBackgroundFromBorder --
*
- * Change the background of a window to one appropriate for a given
- * 3-D border.
+ * Change the background of a window to one appropriate for a given 3-D
+ * border.
*
* Results:
* None.
@@ -590,9 +583,9 @@ DupBorderObjProc(srcObjPtr, dupObjPtr)
*/
void
-Tk_SetBackgroundFromBorder(tkwin, border)
- Tk_Window tkwin; /* Window whose background is to be set. */
- Tk_3DBorder border; /* Token for border. */
+Tk_SetBackgroundFromBorder(
+ Tk_Window tkwin, /* Window whose background is to be set. */
+ Tk_3DBorder border) /* Token for border. */
{
register TkBorder *borderPtr = (TkBorder *) border;
@@ -618,13 +611,13 @@ Tk_SetBackgroundFromBorder(tkwin, border)
*/
int
-Tk_GetReliefFromObj(interp, objPtr, resultPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tcl_Obj *objPtr; /* The object we are trying to get the
- * value from. */
- int *resultPtr; /* Where to place the answer. */
+Tk_GetReliefFromObj(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Obj *objPtr, /* The object we are trying to get the value
+ * from. */
+ int *resultPtr) /* Where to place the answer. */
{
- return Tcl_GetIndexFromObj(interp, objPtr, reliefStrings, "relief", 0,
+ return Tcl_GetIndexFromObj(interp, objPtr, reliefStrings, "relief", 0,
resultPtr);
}
@@ -633,13 +626,13 @@ Tk_GetReliefFromObj(interp, objPtr, resultPtr)
*
* Tk_GetRelief --
*
- * Parse a relief description and return the corresponding
- * relief value, or an error.
+ * Parse a relief description and return the corresponding relief value,
+ * or an error.
*
* Results:
- * A standard Tcl return value. If all goes well then
- * *reliefPtr is filled in with one of the values
- * TK_RELIEF_RAISED, TK_RELIEF_FLAT, or TK_RELIEF_SUNKEN.
+ * A standard Tcl return value. If all goes well then *reliefPtr is
+ * filled in with one of the values TK_RELIEF_RAISED, TK_RELIEF_FLAT, or
+ * TK_RELIEF_SUNKEN.
*
* Side effects:
* None.
@@ -648,10 +641,10 @@ Tk_GetReliefFromObj(interp, objPtr, resultPtr)
*/
int
-Tk_GetRelief(interp, name, reliefPtr)
- Tcl_Interp *interp; /* For error messages. */
- CONST char *name; /* Name of a relief type. */
- int *reliefPtr; /* Where to store converted relief. */
+Tk_GetRelief(
+ Tcl_Interp *interp, /* For error messages. */
+ CONST char *name, /* Name of a relief type. */
+ int *reliefPtr) /* Where to store converted relief. */
{
char c;
size_t length;
@@ -688,12 +681,10 @@ Tk_GetRelief(interp, name, reliefPtr)
*
* Tk_NameOfRelief --
*
- * Given a relief value, produce a string describing that
- * relief value.
+ * Given a relief value, produce a string describing that relief value.
*
* Results:
- * The return value is a static string that is equivalent
- * to relief.
+ * The return value is a static string that is equivalent to relief.
*
* Side effects:
* None.
@@ -702,9 +693,9 @@ Tk_GetRelief(interp, name, reliefPtr)
*/
CONST char *
-Tk_NameOfRelief(relief)
- int relief; /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED,
- * or TK_RELIEF_SUNKEN. */
+Tk_NameOfRelief(
+ int relief) /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED, or
+ * TK_RELIEF_SUNKEN. */
{
if (relief == TK_RELIEF_FLAT) {
return "flat";
@@ -730,39 +721,35 @@ Tk_NameOfRelief(relief)
*
* Tk_Draw3DPolygon --
*
- * Draw a border with 3-D appearance around the edge of a
- * given polygon.
+ * Draw a border with 3-D appearance around the edge of a given polygon.
*
* Results:
* None.
*
* Side effects:
- * Information is drawn in "drawable" in the form of a
- * 3-D border borderWidth units width wide on the left
- * of the trajectory given by pointPtr and numPoints (or
- * -borderWidth units wide on the right side, if borderWidth
- * is negative).
+ * Information is drawn in "drawable" in the form of a 3-D border
+ * borderWidth units width wide on the left of the trajectory given by
+ * pointPtr and numPoints (or -borderWidth units wide on the right side,
+ * if borderWidth is negative).
*
*--------------------------------------------------------------
*/
void
-Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
- borderWidth, leftRelief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Tk_3DBorder border; /* Token for border to draw. */
- XPoint *pointPtr; /* Array of points describing
- * polygon. All points must be
- * absolute (CoordModeOrigin). */
- int numPoints; /* Number of points at *pointPtr. */
- int borderWidth; /* Width of border, measured in
- * pixels to the left of the polygon's
- * trajectory. May be negative. */
- int leftRelief; /* TK_RELIEF_RAISED or
- * TK_RELIEF_SUNKEN: indicates how
- * stuff to left of trajectory looks
- * relative to stuff on right. */
+Tk_Draw3DPolygon(
+ Tk_Window tkwin, /* Window for which border was allocated. */
+ Drawable drawable, /* X window or pixmap in which to draw. */
+ Tk_3DBorder border, /* Token for border to draw. */
+ XPoint *pointPtr, /* Array of points describing polygon. All
+ * points must be absolute
+ * (CoordModeOrigin). */
+ int numPoints, /* Number of points at *pointPtr. */
+ int borderWidth, /* Width of border, measured in pixels to the
+ * left of the polygon's trajectory. May be
+ * negative. */
+ int leftRelief) /* TK_RELIEF_RAISED or TK_RELIEF_SUNKEN:
+ * indicates how stuff to left of trajectory
+ * looks relative to stuff on right. */
{
XPoint poly[4], b1, b2, newB1, newB2;
XPoint perp, c, shift1, shift2; /* Used for handling parallel lines. */
@@ -794,8 +781,8 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
}
/*
- * If the polygon is already closed, drop the last point from it
- * (we'll close it automatically).
+ * If the polygon is already closed, drop the last point from it (we'll
+ * close it automatically).
*/
p1Ptr = &pointPtr[numPoints-1];
@@ -805,8 +792,8 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
}
/*
- * The loop below is executed once for each vertex in the polgon.
- * At the beginning of each iteration things look like this:
+ * The loop below is executed once for each vertex in the polgon. At the
+ * beginning of each iteration things look like this:
*
* poly[1] /
* * /
@@ -824,23 +811,21 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
* x-------------------------
*
* The job of this iteration is to do the following:
- * (a) Compute x (the border corner corresponding to
- * pointPtr[i]) and put it in poly[2]. As part of
- * this, compute a new b1 and b2 value for the next
- * side of the polygon.
+ * (a) Compute x (the border corner corresponding to pointPtr[i]) and put
+ * it in poly[2]. As part of this, compute a new b1 and b2 value for
+ * the next side of the polygon.
* (b) Put pointPtr[i] into poly[3].
* (c) Draw the polygon given by poly[0..3].
- * (d) Advance poly[0], poly[1], b1, and b2 for the
- * next side of the polygon.
+ * (d) Advance poly[0], poly[1], b1, and b2 for the next side of the
+ * polygon.
*/
/*
- * The above situation doesn't first come into existence until
- * two points have been processed; the first two points are
- * used to "prime the pump", so some parts of the processing
- * are ommitted for these points. The variable "pointsSeen"
- * keeps track of the priming process; it has to be separate
- * from i in order to be able to ignore duplicate points in the
+ * The above situation doesn't first come into existence until two points
+ * have been processed; the first two points are used to "prime the pump",
+ * so some parts of the processing are ommitted for these points. The
+ * variable "pointsSeen" keeps track of the priming process; it has to be
+ * separate from i in order to be able to ignore duplicate points in the
* polygon.
*/
@@ -852,9 +837,10 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
}
if ((p2Ptr->x == p1Ptr->x) && (p2Ptr->y == p1Ptr->y)) {
/*
- * Ignore duplicate points (they'd cause core dumps in
- * ShiftLine calls below).
+ * Ignore duplicate points (they'd cause core dumps in ShiftLine
+ * calls below).
*/
+
continue;
}
ShiftLine(p1Ptr, p2Ptr, borderWidth, &newB1);
@@ -866,9 +852,8 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
parallel = Intersect(&newB1, &newB2, &b1, &b2, &poly[2]);
/*
- * If two consecutive segments of the polygon are parallel,
- * then things get more complex. Consider the following
- * diagram:
+ * If two consecutive segments of the polygon are parallel, then
+ * things get more complex. Consider the following diagram:
*
* poly[1]
* *----b1-----------b2------a
@@ -880,16 +865,16 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
* --*--------*----c
* newB1 newB2
*
- * Instead of using x and *p1Ptr for poly[2] and poly[3], as
- * in the original diagram, use a and b as above. Then instead
- * of using x and *p1Ptr for the new poly[0] and poly[1], use
- * b and c as above.
+ * Instead of using x and *p1Ptr for poly[2] and poly[3], as in
+ * the original diagram, use a and b as above. Then instead of
+ * using x and *p1Ptr for the new poly[0] and poly[1], use b and c
+ * as above.
*
* Do the computation in three stages:
- * 1. Compute a point "perp" such that the line p1Ptr-perp
- * is perpendicular to p1Ptr-p2Ptr.
- * 2. Compute the points a and c by intersecting the lines
- * b1-b2 and newB1-newB2 with p1Ptr-perp.
+ * 1. Compute a point "perp" such that the line p1Ptr-perp is
+ * perpendicular to p1Ptr-p2Ptr.
+ * 2. Compute the points a and c by intersecting the lines b1-b2
+ * and newB1-newB2 with p1Ptr-perp.
* 3. Compute b by shifting p1Ptr-perp to the right and
* intersecting it with p1Ptr-p2Ptr.
*/
@@ -955,33 +940,34 @@ Tk_Draw3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
*/
void
-Tk_Fill3DRectangle(tkwin, drawable, border, x, y, width,
- height, borderWidth, relief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Tk_3DBorder border; /* Token for border to draw. */
- int x, y, width, height; /* Outside area of rectangular region. */
- int borderWidth; /* Desired width for border, in
- * pixels. Border will be *inside* region. */
- int relief; /* Indicates 3D effect: TK_RELIEF_FLAT,
+Tk_Fill3DRectangle(
+ Tk_Window tkwin, /* Window for which border was allocated. */
+ Drawable drawable, /* X window or pixmap in which to draw. */
+ Tk_3DBorder border, /* Token for border to draw. */
+ int x, int y, int width, int height,
+ /* Outside area of rectangular region. */
+ int borderWidth, /* Desired width for border, in pixels. Border
+ * will be *inside* region. */
+ int relief) /* Indicates 3D effect: TK_RELIEF_FLAT,
* TK_RELIEF_RAISED, or TK_RELIEF_SUNKEN. */
{
register TkBorder *borderPtr = (TkBorder *) border;
int doubleBorder;
/*
- * This code is slightly tricky because it only draws the background
- * in areas not covered by the 3D border. This avoids flashing
- * effects on the screen for the border region.
+ * This code is slightly tricky because it only draws the background in
+ * areas not covered by the 3D border. This avoids flashing effects on the
+ * screen for the border region.
*/
-
+
if (relief == TK_RELIEF_FLAT) {
borderWidth = 0;
} else {
/*
- * We need to make this extra check, otherwise we will leave
- * garbage in thin frames [Bug: 3596]
+ * We need to make this extra check, otherwise we will leave garbage
+ * in thin frames [Bug: 3596]
*/
+
if (width < 2*borderWidth) {
borderWidth = width/2;
}
@@ -1020,22 +1006,21 @@ Tk_Fill3DRectangle(tkwin, drawable, border, x, y, width,
*/
void
-Tk_Fill3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
- borderWidth, leftRelief)
- Tk_Window tkwin; /* Window for which border was allocated. */
- Drawable drawable; /* X window or pixmap in which to draw. */
- Tk_3DBorder border; /* Token for border to draw. */
- XPoint *pointPtr; /* Array of points describing
- * polygon. All points must be
- * absolute (CoordModeOrigin). */
- int numPoints; /* Number of points at *pointPtr. */
- int borderWidth; /* Width of border, measured in
- * pixels to the left of the polygon's
- * trajectory. May be negative. */
- int leftRelief; /* Indicates 3D effect of left side of
+Tk_Fill3DPolygon(
+ Tk_Window tkwin, /* Window for which border was allocated. */
+ Drawable drawable, /* X window or pixmap in which to draw. */
+ Tk_3DBorder border, /* Token for border to draw. */
+ XPoint *pointPtr, /* Array of points describing polygon. All
+ * points must be absolute
+ * (CoordModeOrigin). */
+ int numPoints, /* Number of points at *pointPtr. */
+ int borderWidth, /* Width of border, measured in pixels to the
+ * left of the polygon's trajectory. May be
+ * negative. */
+ int leftRelief) /* Indicates 3D effect of left side of
* trajectory relative to right:
- * TK_RELIEF_FLAT, TK_RELIEF_RAISED,
- * or TK_RELIEF_SUNKEN. */
+ * TK_RELIEF_FLAT, TK_RELIEF_RAISED, or
+ * TK_RELIEF_SUNKEN. */
{
register TkBorder *borderPtr = (TkBorder *) border;
@@ -1064,8 +1049,8 @@ Tk_Fill3DPolygon(tkwin, drawable, border, pointPtr, numPoints,
*/
static void
-BorderInit(dispPtr)
- TkDisplay * dispPtr; /* Used to access thread-specific data. */
+BorderInit(
+ TkDisplay *dispPtr) /* Used to access thread-specific data. */
{
dispPtr->borderInit = 1;
Tcl_InitHashTable(&dispPtr->borderTable, TCL_STRING_KEYS);
@@ -1076,9 +1061,8 @@ BorderInit(dispPtr)
*
* ShiftLine --
*
- * Given two points on a line, compute a point on a
- * new line that is parallel to the given line and
- * a given distance away from it.
+ * Given two points on a line, compute a point on a new line that is
+ * parallel to the given line and a given distance away from it.
*
* Results:
* None.
@@ -1090,36 +1074,31 @@ BorderInit(dispPtr)
*/
static void
-ShiftLine(p1Ptr, p2Ptr, distance, p3Ptr)
- XPoint *p1Ptr; /* First point on line. */
- XPoint *p2Ptr; /* Second point on line. */
- int distance; /* New line is to be this many
- * units to the left of original
- * line, when looking from p1 to
- * p2. May be negative. */
- XPoint *p3Ptr; /* Store coords of point on new
- * line here. */
+ShiftLine(
+ XPoint *p1Ptr, /* First point on line. */
+ XPoint *p2Ptr, /* Second point on line. */
+ int distance, /* New line is to be this many units to the
+ * left of original line, when looking from p1
+ * to p2. May be negative. */
+ XPoint *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.
+ * The table below is used for a quick approximation in computing the new
+ * point. An index into the table is 128 times the slope of the original
+ * line (the slope must always be between 0 and 1). The value of the table
+ * entry is 128 times the amount to displace the new line in y for each
+ * unit of perpendicular distance. In other words, the table maps from the
+ * tangent of an angle to the inverse of its cosine. If the slope of the
+ * original line is greater than 1, then the displacement is done in x
+ * rather than in y.
*/
static int shiftTable[129];
/*
- * Initialize the table if this is the first time it is
- * used.
+ * Initialize the table if this is the first time it is used.
*/
if (shiftTable[0] == 0) {
@@ -1171,10 +1150,9 @@ ShiftLine(p1Ptr, p2Ptr, distance, p3Ptr)
* Find the intersection point between two lines.
*
* Results:
- * Under normal conditions 0 is returned and the point
- * at *iPtr is filled in with the intersection between
- * the two lines. If the two lines are parallel, then
- * -1 is returned and *iPtr isn't modified.
+ * Under normal conditions 0 is returned and the point at *iPtr is filled
+ * in with the intersection between the two lines. If the two lines are
+ * parallel, then -1 is returned and *iPtr isn't modified.
*
* Side effects:
* None.
@@ -1183,19 +1161,19 @@ ShiftLine(p1Ptr, p2Ptr, distance, p3Ptr)
*/
static int
-Intersect(a1Ptr, a2Ptr, b1Ptr, b2Ptr, iPtr)
- XPoint *a1Ptr; /* First point of first line. */
- XPoint *a2Ptr; /* Second point of first line. */
- XPoint *b1Ptr; /* First point of second line. */
- XPoint *b2Ptr; /* Second point of second line. */
- XPoint *iPtr; /* Filled in with intersection point. */
+Intersect(
+ XPoint *a1Ptr, /* First point of first line. */
+ XPoint *a2Ptr, /* Second point of first line. */
+ XPoint *b1Ptr, /* First point of second line. */
+ XPoint *b2Ptr, /* Second point of second line. */
+ XPoint *iPtr) /* Filled in with intersection point. */
{
int dxadyb, dxbdya, dxadxb, dyadyb, p, q;
/*
- * The code below is just a straightforward manipulation of two
- * equations of the form y = (x-x1)*(y2-y1)/(x2-x1) + y1 to solve
- * for the x-coordinate of intersection, then the y-coordinate.
+ * The code below is just a straightforward manipulation of two equations
+ * of the form y = (x-x1)*(y2-y1)/(x2-x1) + y1 to solve for the
+ * x-coordinate of intersection, then the y-coordinate.
*/
dxadyb = (a2Ptr->x - a1Ptr->x)*(b2Ptr->y - b1Ptr->y);
@@ -1236,26 +1214,26 @@ Intersect(a1Ptr, a2Ptr, b1Ptr, b2Ptr, iPtr)
*
* Tk_Get3DBorderFromObj --
*
- * Returns the border referred to by a Tcl object. The border must
- * already have been allocated via a call to Tk_Alloc3DBorderFromObj
- * or Tk_Get3DBorder.
+ * Returns the border referred to by a Tcl object. The border must
+ * already have been allocated via a call to Tk_Alloc3DBorderFromObj or
+ * Tk_Get3DBorder.
*
* Results:
- * Returns the Tk_3DBorder that matches the tkwin and the string rep
- * of the name of the border given in objPtr.
+ * Returns the Tk_3DBorder that matches the tkwin and the string rep of
+ * the name of the border given in objPtr.
*
* Side effects:
- * If the object is not already a border, the conversion will free
- * any old internal representation.
+ * If the object is not already a border, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
Tk_3DBorder
-Tk_Get3DBorderFromObj(tkwin, objPtr)
- Tk_Window tkwin;
- Tcl_Obj *objPtr; /* The object whose string value selects
- * a border. */
+Tk_Get3DBorderFromObj(
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr) /* The object whose string value selects a
+ * border. */
{
TkBorder *borderPtr = NULL;
Tcl_HashEntry *hashPtr;
@@ -1266,10 +1244,9 @@ Tk_Get3DBorderFromObj(tkwin, objPtr)
}
/*
- * If we are lucky (and the user doesn't use too many different
- * displays, screens, or colormaps...) then the TkBorder
- * structure we need will be cached in the internal
- * representation of the Tcl_Obj. Check it out...
+ * If we are lucky (and the user doesn't use too many different displays,
+ * screens, or colormaps...) then the TkBorder structure we need will be
+ * cached in the internal representation of the Tcl_Obj. Check it out...
*/
borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -1278,22 +1255,22 @@ Tk_Get3DBorderFromObj(tkwin, objPtr)
&& (Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
/*
- * The object already points to the right border structure.
- * Just return it.
+ * The object already points to the right border structure. Just
+ * return it.
*/
+
return (Tk_3DBorder) borderPtr;
}
/*
- * If we make it here, it means we aren't so lucky. Either there
- * was no cached TkBorder in the Tcl_Obj, or the TkBorder that was
- * there is for the wrong screen/colormap. Either way, we have
- * to search for the right TkBorder. For each color name, there is
- * linked list of TkBorder structures, one structure for each
- * screen/colormap combination. The head of the linked list is
- * recorded in a hash table (where the key is the color name)
- * attached to the TkDisplay structure. Walk this list to find
- * the right TkBorder structure.
+ * If we make it here, it means we aren't so lucky. Either there was no
+ * cached TkBorder in the Tcl_Obj, or the TkBorder that was there is for
+ * the wrong screen/colormap. Either way, we have to search for the right
+ * TkBorder. For each color name, there is linked list of TkBorder
+ * structures, one structure for each screen/colormap combination. The
+ * head of the linked list is recorded in a hash table (where the key is
+ * the color name) attached to the TkDisplay structure. Walk this list to
+ * find the right TkBorder structure.
*/
hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, Tcl_GetString(objPtr));
@@ -1305,14 +1282,14 @@ Tk_Get3DBorderFromObj(tkwin, objPtr)
if ((Tk_Screen(tkwin) == borderPtr->screen)
&& (Tk_Colormap(tkwin) == borderPtr->colormap)) {
FreeBorderObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) borderPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) borderPtr;
borderPtr->objRefCount++;
return (Tk_3DBorder) borderPtr;
}
}
- error:
- panic("Tk_Get3DBorderFromObj called with non-existent border!");
+ error:
+ Tcl_Panic("Tk_Get3DBorderFromObj called with non-existent border!");
/*
* The following code isn't reached; it's just there to please compilers.
*/
@@ -1333,20 +1310,20 @@ Tk_Get3DBorderFromObj(tkwin, objPtr)
* unless "interp" is NULL.
*
* Side effects:
- * If no error occurs, a blank internal format for a border value
- * is intialized. The final form cannot be done without a Tk_Window.
+ * If no error occurs, a blank internal format for a border value is
+ * intialized. The final form cannot be done without a Tk_Window.
*
*----------------------------------------------------------------------
*/
static void
-InitBorderObj(objPtr)
- Tcl_Obj *objPtr; /* The object to convert. */
+InitBorderObj(
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetString(objPtr);
@@ -1355,7 +1332,7 @@ InitBorderObj(objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
objPtr->typePtr = &tkBorderObjType;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
/*
@@ -1363,13 +1340,13 @@ InitBorderObj(objPtr)
*
* TkDebugBorder --
*
- * This procedure returns debugging information about a border.
+ * This function returns debugging information about a border.
*
* Results:
* The return value is a list with one sublist for each TkBorder
- * corresponding to "name". Each sublist has two elements that
- * contain the resourceRefCount and objRefCount fields from the
- * TkBorder structure.
+ * corresponding to "name". Each sublist has two elements that contain
+ * the resourceRefCount and objRefCount fields from the TkBorder
+ * structure.
*
* Side effects:
* None.
@@ -1378,10 +1355,10 @@ InitBorderObj(objPtr)
*/
Tcl_Obj *
-TkDebugBorder(tkwin, name)
- Tk_Window tkwin; /* The window in which the border will be
- * used (not currently used). */
- char *name; /* Name of the desired color. */
+TkDebugBorder(
+ Tk_Window tkwin, /* The window in which the border will be used
+ * (not currently used). */
+ char *name) /* Name of the desired color. */
{
TkBorder *borderPtr;
Tcl_HashEntry *hashPtr;
@@ -1393,16 +1370,24 @@ TkDebugBorder(tkwin, name)
if (hashPtr != NULL) {
borderPtr = (TkBorder *) Tcl_GetHashValue(hashPtr);
if (borderPtr == NULL) {
- panic("TkDebugBorder found empty hash table entry");
+ Tcl_Panic("TkDebugBorder found empty hash table entry");
}
for ( ; (borderPtr != NULL); borderPtr = borderPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(borderPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(borderPtr->objRefCount));
+ Tcl_NewIntObj(borderPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
return resultPtr;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tk3d.h b/generic/tk3d.h
index 2905ff5..5e0a0cf 100644
--- a/generic/tk3d.h
+++ b/generic/tk3d.h
@@ -1,13 +1,12 @@
/*
* tk3d.h --
*
- * Declarations of types and functions shared by the 3d border
- * module.
+ * Declarations of types and functions shared by the 3d border module.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TK3D
@@ -22,9 +21,8 @@
/*
* One of the following data structures is allocated for each 3-D border
- * currently in use. Structures of this type are indexed by
- * borderTable, so that a single structure can be shared for several
- * uses.
+ * currently in use. Structures of this type are indexed by borderTable, so
+ * that a single structure can be shared for several uses.
*/
typedef struct TkBorder {
@@ -38,18 +36,17 @@ typedef struct TkBorder {
int resourceRefCount; /* Number of active uses of this color (each
* active use corresponds to a call to
* Tk_Alloc3DBorderFromObj or Tk_Get3DBorder).
- * If this count is 0, then this structure
- * is no longer valid and it isn't present
- * in borderTable: it is being kept around
- * only because there are objects referring
- * to it. The structure is freed when
- * resourceRefCount and objRefCount are
- * both 0. */
+ * If this count is 0, then this structure is
+ * no longer valid and it isn't present in
+ * borderTable: it is being kept around only
+ * because there are objects referring to it.
+ * The structure is freed when
+ * resourceRefCount and objRefCount are both
+ * 0. */
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
- XColor *bgColorPtr; /* Background color (intensity
- * between lightColorPtr and
- * darkColorPtr). */
+ XColor *bgColorPtr; /* Background color (intensity between
+ * lightColorPtr and darkColorPtr). */
XColor *darkColorPtr; /* Color for darker areas (must free when
* deleting structure). NULL means shadows
* haven't been allocated yet.*/
@@ -57,28 +54,26 @@ typedef struct TkBorder {
* (must free this when deleting structure).
* NULL means shadows haven't been allocated
* yet. */
- Pixmap shadow; /* Stipple pattern to use for drawing
- * shadows areas. Used for displays with
- * <= 64 colors or where colormap has filled
- * up. */
- GC bgGC; /* Used (if necessary) to draw areas in
- * the background color. */
- GC darkGC; /* Used to draw darker parts of the
- * border. None means the shadow colors
- * haven't been allocated yet.*/
- GC lightGC; /* Used to draw lighter parts of
- * the border. None means the shadow colors
- * haven't been allocated yet. */
- Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in
- * order to delete structure). */
+ Pixmap shadow; /* Stipple pattern to use for drawing shadows
+ * areas. Used for displays with <= 64 colors
+ * or where colormap has filled up. */
+ GC bgGC; /* Used (if necessary) to draw areas in the
+ * background color. */
+ GC darkGC; /* Used to draw darker parts of the border.
+ * None means the shadow colors haven't been
+ * allocated yet.*/
+ GC lightGC; /* Used to draw lighter parts of the border.
+ * None means the shadow colors haven't been
+ * allocated yet. */
+ Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to
+ * delete structure). */
struct TkBorder *nextPtr; /* Points to the next TkBorder structure with
- * the same color name. Borders with the
- * same name but different screens or
- * colormaps are chained together off a
- * single entry in borderTable. */
+ * the same color name. Borders with the same
+ * name but different screens or colormaps are
+ * chained together off a single entry in
+ * borderTable. */
} TkBorder;
-
/*
* Maximum intensity for a color:
*/
@@ -89,10 +84,9 @@ typedef struct TkBorder {
* Declarations for platform specific interfaces used by this module.
*/
-EXTERN TkBorder * TkpGetBorder _ANSI_ARGS_((void));
-EXTERN void TkpGetShadows _ANSI_ARGS_((TkBorder *borderPtr,
- Tk_Window tkwin));
-EXTERN void TkpFreeBorder _ANSI_ARGS_((TkBorder *borderPtr));
+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
diff --git a/generic/tkArgv.c b/generic/tkArgv.c
index 4821f41..a338e45 100644
--- a/generic/tkArgv.c
+++ b/generic/tkArgv.c
@@ -1,85 +1,81 @@
/*
* tkArgv.c --
*
- * This file contains a procedure that handles table-based
- * argv-argc parsing.
+ * This file contains a function that handles table-based argv-argc
+ * parsing.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
-#include "tk.h"
+#include "tkInt.h"
/*
- * Default table of argument descriptors. These are normally available
- * in every application.
+ * Default table of argument descriptors. These are normally available in
+ * every application.
*/
static Tk_ArgvInfo defaultTable[] = {
- {"-help", TK_ARGV_HELP, (char *) NULL, (char *) NULL,
+ {"-help", TK_ARGV_HELP, NULL, NULL,
"Print summary of command-line options and abort"},
- {NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
- (char *) NULL}
+ {NULL, TK_ARGV_END, NULL, NULL, NULL}
};
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void PrintUsage _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_ArgvInfo *argTable, int flags));
+static void PrintUsage(Tcl_Interp *interp, Tk_ArgvInfo *argTable,
+ int flags);
/*
*----------------------------------------------------------------------
*
* Tk_ParseArgv --
*
- * Process an argv array according to a table of expected
- * command-line options. See the manual page for more details.
+ * Process an argv array according to a table of expected command-line
+ * options. See the manual page for more details.
*
* Results:
- * The return value is a standard Tcl return value. If an
- * error occurs then an error message is left in the interp's result.
- * Under normal conditions, both *argcPtr and *argv are modified
- * to return the arguments that couldn't be processed here (they
- * didn't match the option table, or followed an TK_ARGV_REST
- * argument).
+ * The return value is a standard Tcl return value. If an error occurs
+ * then an error message is left in the interp's result. Under normal
+ * conditions, both *argcPtr and *argv are modified to return the
+ * arguments that couldn't be processed here (they didn't match the
+ * option table, or followed an TK_ARGV_REST argument).
*
* Side effects:
- * Variables may be modified, resources may be entered for tkwin,
- * or procedures may be called. It all depends on the arguments
- * and their entries in argTable. See the user documentation
- * for details.
+ * Variables may be modified, resources may be entered for tkwin, or
+ * functions may be called. It all depends on the arguments and their
+ * entries in argTable. See the user documentation for details.
*
*----------------------------------------------------------------------
*/
int
-Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
- Tcl_Interp *interp; /* Place to store error message. */
- Tk_Window tkwin; /* Window to use for setting Tk options.
- * NULL 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 that couldn't be processed here. */
- Tk_ArgvInfo *argTable; /* Array of option descriptions */
- int flags; /* Or'ed combination of various flag bits,
+Tk_ParseArgv(
+ Tcl_Interp *interp, /* Place to store error message. */
+ Tk_Window tkwin, /* Window to use for setting Tk options. NULL
+ * 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
+ * that couldn't be processed here. */
+ 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;
- /* Pointer to the current entry in the
- * table of argument descriptions. */
+ /* Pointer to the current entry in the table
+ * of argument descriptions. */
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 '-'). */
+ * quick check for matching; use 2nd char.
+ * because first char. will almost always be
+ * '-'). */
int srcIndex; /* Location from which to read next argument
* from argv. */
int dstIndex; /* Index into argv to which next unused
@@ -109,9 +105,8 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
}
/*
- * Loop throught the argument descriptors searching for one with
- * the matching key string. If found, leave a pointer to it in
- * matchPtr.
+ * Loop throught the argument descriptors searching for one with the
+ * matching key string. If found, leave a pointer to it in matchPtr.
*/
matchPtr = NULL;
@@ -123,44 +118,43 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
}
for (; (infoPtr != NULL) && (infoPtr->type != TK_ARGV_END);
infoPtr++) {
- if (infoPtr->key == NULL) {
- continue;
- }
- if ((infoPtr->key[1] != c)
- || (strncmp(infoPtr->key, curArg, length) != 0)) {
- continue;
- }
- if ((tkwin == NULL)
- && ((infoPtr->type == TK_ARGV_CONST_OPTION)
- || (infoPtr->type == TK_ARGV_OPTION_VALUE)
- || (infoPtr->type == TK_ARGV_OPTION_NAME_VALUE))) {
- continue;
- }
- if (infoPtr->key[length] == 0) {
- matchPtr = infoPtr;
- goto gotMatch;
- }
- if (flags & TK_ARGV_NO_ABBREV) {
- continue;
- }
- if (matchPtr != NULL) {
- Tcl_AppendResult(interp, "ambiguous option \"", curArg,
- "\"", (char *) NULL);
- return TCL_ERROR;
- }
- matchPtr = infoPtr;
+ if (infoPtr->key == NULL) {
+ continue;
+ }
+ if ((infoPtr->key[1] != c)
+ || (strncmp(infoPtr->key, curArg, length) != 0)) {
+ continue;
+ }
+ if ((tkwin == NULL)
+ && ((infoPtr->type == TK_ARGV_CONST_OPTION)
+ || (infoPtr->type == TK_ARGV_OPTION_VALUE)
+ || (infoPtr->type == TK_ARGV_OPTION_NAME_VALUE))) {
+ continue;
+ }
+ if (infoPtr->key[length] == 0) {
+ matchPtr = infoPtr;
+ goto gotMatch;
+ }
+ if (flags & TK_ARGV_NO_ABBREV) {
+ continue;
+ }
+ if (matchPtr != NULL) {
+ Tcl_AppendResult(interp, "ambiguous option \"", curArg,
+ "\"", NULL);
+ return TCL_ERROR;
+ }
+ matchPtr = infoPtr;
}
}
if (matchPtr == NULL) {
-
/*
- * Unrecognized argument. Just copy it down, unless the caller
+ * Unrecognized argument. Just copy it down, unless the caller
* prefers an error to be registered.
*/
if (flags & TK_ARGV_NO_LEFTOVERS) {
Tcl_AppendResult(interp, "unrecognized argument \"",
- curArg, "\"", (char *) NULL);
+ curArg, "\"", NULL);
return TCL_ERROR;
}
argv[dstIndex] = curArg;
@@ -172,154 +166,143 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
* Take the appropriate action based on the option type
*/
- gotMatch:
+ gotMatch:
infoPtr = matchPtr;
switch (infoPtr->type) {
- case TK_ARGV_CONSTANT:
- *((int *) infoPtr->dst) = (int) infoPtr->src;
- break;
- case TK_ARGV_INT:
- if (argc == 0) {
- goto missingArg;
- } else {
- char *endPtr;
-
- *((int *) infoPtr->dst) =
- strtol(argv[srcIndex], &endPtr, 0);
- if ((endPtr == argv[srcIndex]) || (*endPtr != 0)) {
- Tcl_AppendResult(interp, "expected integer argument ",
- "for \"", infoPtr->key, "\" but got \"",
- argv[srcIndex], "\"", (char *) NULL);
- return TCL_ERROR;
- }
- srcIndex++;
- argc--;
- }
- break;
- case TK_ARGV_STRING:
- if (argc == 0) {
- goto missingArg;
- } else {
- *((CONST char **)infoPtr->dst) = argv[srcIndex];
- srcIndex++;
- argc--;
- }
- break;
- case TK_ARGV_UID:
- if (argc == 0) {
- goto missingArg;
- } else {
- *((Tk_Uid *)infoPtr->dst) = Tk_GetUid(argv[srcIndex]);
- srcIndex++;
- argc--;
- }
- break;
- case TK_ARGV_REST:
- *((int *) infoPtr->dst) = dstIndex;
- goto argsDone;
- case TK_ARGV_FLOAT:
- if (argc == 0) {
- goto missingArg;
- } else {
- char *endPtr;
-
- *((double *) infoPtr->dst) =
- strtod(argv[srcIndex], &endPtr);
- if ((endPtr == argv[srcIndex]) || (*endPtr != 0)) {
- Tcl_AppendResult(interp, "expected floating-point ",
- "argument for \"", infoPtr->key,
- "\" but got \"", argv[srcIndex], "\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- srcIndex++;
- argc--;
- }
- break;
- case TK_ARGV_FUNC: {
- typedef int (ArgvFunc) _ANSI_ARGS_ ((char *, char *,
- CONST char *));
- ArgvFunc *handlerProc;
+ case TK_ARGV_CONSTANT:
+ *((int *) infoPtr->dst) = PTR2INT(infoPtr->src);
+ break;
+ case TK_ARGV_INT:
+ if (argc == 0) {
+ goto missingArg;
+ } else {
+ char *endPtr;
- handlerProc = (ArgvFunc *) infoPtr->src;
- if ((*handlerProc)(infoPtr->dst, infoPtr->key,
- argv[srcIndex])) {
- srcIndex += 1;
- argc -= 1;
+ *((int *) infoPtr->dst) = strtol(argv[srcIndex], &endPtr, 0);
+ if ((endPtr == argv[srcIndex]) || (*endPtr != 0)) {
+ Tcl_AppendResult(interp,"expected integer argument for \"",
+ infoPtr->key, "\" but got \"", argv[srcIndex],
+ "\"", NULL);
+ return TCL_ERROR;
}
- break;
+ srcIndex++;
+ argc--;
+ }
+ break;
+ case TK_ARGV_STRING:
+ if (argc == 0) {
+ goto missingArg;
+ }
+ *((CONST char **)infoPtr->dst) = argv[srcIndex];
+ srcIndex++;
+ argc--;
+ break;
+ case TK_ARGV_UID:
+ if (argc == 0) {
+ goto missingArg;
}
- case TK_ARGV_GENFUNC: {
- typedef int (ArgvGenFunc)_ANSI_ARGS_((char *, Tcl_Interp *,
- char *, int, CONST char **));
- ArgvGenFunc *handlerProc;
+ *((Tk_Uid *)infoPtr->dst) = Tk_GetUid(argv[srcIndex]);
+ srcIndex++;
+ argc--;
+ break;
+ case TK_ARGV_REST:
+ *((int *) infoPtr->dst) = dstIndex;
+ goto argsDone;
+ case TK_ARGV_FLOAT:
+ if (argc == 0) {
+ goto missingArg;
+ } else {
+ char *endPtr;
- handlerProc = (ArgvGenFunc *) infoPtr->src;
- argc = (*handlerProc)(infoPtr->dst, interp, infoPtr->key,
- argc, argv+srcIndex);
- if (argc < 0) {
+ *((double *) infoPtr->dst) = strtod(argv[srcIndex], &endPtr);
+ if ((endPtr == argv[srcIndex]) || (*endPtr != 0)) {
+ Tcl_AppendResult(interp, "expected floating-point ",
+ "argument for \"", infoPtr->key, "\" but got \"",
+ argv[srcIndex], "\"", NULL);
return TCL_ERROR;
}
- break;
+ srcIndex++;
+ argc--;
}
- case TK_ARGV_HELP:
- PrintUsage (interp, argTable, flags);
- return TCL_ERROR;
- case TK_ARGV_CONST_OPTION:
- Tk_AddOption(tkwin, infoPtr->dst, infoPtr->src,
- TK_INTERACTIVE_PRIO);
- break;
- case TK_ARGV_OPTION_VALUE:
- if (argc < 1) {
- goto missingArg;
- }
- Tk_AddOption(tkwin, infoPtr->dst, argv[srcIndex],
- TK_INTERACTIVE_PRIO);
+ break;
+ case TK_ARGV_FUNC: {
+ typedef int (ArgvFunc)(char *, char *, CONST char *);
+ ArgvFunc *handlerProc = (ArgvFunc *) infoPtr->src;
+
+ if ((*handlerProc)(infoPtr->dst, infoPtr->key, argv[srcIndex])) {
srcIndex++;
argc--;
- break;
- case TK_ARGV_OPTION_NAME_VALUE:
- if (argc < 2) {
- Tcl_AppendResult(interp, "\"", curArg,
- "\" option requires two following arguments",
- (char *) NULL);
- return TCL_ERROR;
- }
- Tk_AddOption(tkwin, argv[srcIndex], argv[srcIndex+1],
- TK_INTERACTIVE_PRIO);
- srcIndex += 2;
- argc -= 2;
- break;
- default: {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "bad argument type %d in Tk_ArgvInfo",
- infoPtr->type);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ break;
+ }
+ case TK_ARGV_GENFUNC: {
+ typedef int (ArgvGenFunc)(char *, Tcl_Interp *, char *, int,
+ CONST char **);
+ ArgvGenFunc *handlerProc = (ArgvGenFunc *) infoPtr->src;
+
+ argc = (*handlerProc)(infoPtr->dst, interp, infoPtr->key,
+ argc, argv+srcIndex);
+ if (argc < 0) {
+ return TCL_ERROR;
+ }
+ break;
+ }
+ case TK_ARGV_HELP:
+ PrintUsage(interp, argTable, flags);
+ return TCL_ERROR;
+ case TK_ARGV_CONST_OPTION:
+ Tk_AddOption(tkwin, infoPtr->dst, infoPtr->src,
+ TK_INTERACTIVE_PRIO);
+ break;
+ case TK_ARGV_OPTION_VALUE:
+ if (argc < 1) {
+ goto missingArg;
+ }
+ Tk_AddOption(tkwin, infoPtr->dst, argv[srcIndex],
+ TK_INTERACTIVE_PRIO);
+ srcIndex++;
+ argc--;
+ break;
+ case TK_ARGV_OPTION_NAME_VALUE:
+ if (argc < 2) {
+ Tcl_AppendResult(interp, "\"", curArg,
+ "\" option requires two following arguments", NULL);
return TCL_ERROR;
}
+ Tk_AddOption(tkwin, argv[srcIndex], argv[srcIndex+1],
+ TK_INTERACTIVE_PRIO);
+ srcIndex += 2;
+ argc -= 2;
+ break;
+ default: {
+ char buf[64 + TCL_INTEGER_SPACE];
+
+ sprintf(buf, "bad argument type %d in Tk_ArgvInfo", infoPtr->type);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_ERROR;
+ }
}
}
/*
- * If we broke out of the loop because of an OPT_REST argument,
- * copy the remaining arguments down.
+ * If we broke out of the loop because of an OPT_REST argument, copy the
+ * remaining arguments down.
*/
- argsDone:
+ argsDone:
while (argc) {
argv[dstIndex] = argv[srcIndex];
srcIndex++;
dstIndex++;
argc--;
}
- argv[dstIndex] = (char *) NULL;
+ argv[dstIndex] = NULL;
*argcPtr = dstIndex;
return TCL_OK;
- missingArg:
+ missingArg:
Tcl_AppendResult(interp, "\"", curArg,
- "\" option requires an additional argument", (char *) NULL);
+ "\" option requires an additional argument", NULL);
return TCL_ERROR;
}
@@ -331,10 +314,9 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
* Generate a help string describing command-line options.
*
* Results:
- * The interp's result will be modified to hold a help string
- * describing all the options in argTable, plus all those
- * in the default table unless TK_ARGV_NO_DEFAULTS is
- * specified in flags.
+ * The interp's result will be modified to hold a help string describing
+ * all the options in argTable, plus all those in the default table
+ * unless TK_ARGV_NO_DEFAULTS is specified in flags.
*
* Side effects:
* None.
@@ -343,31 +325,29 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
*/
static void
-PrintUsage(interp, argTable, flags)
- Tcl_Interp *interp; /* Place information in this interp's
- * result area. */
- Tk_ArgvInfo *argTable; /* Array of command-specific argument
+PrintUsage(
+ Tcl_Interp *interp, /* Place information in this interp's result
+ * area. */
+ 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. */
+ 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;
- int width, i, numSpaces;
-#define NUM_SPACES 20
- static char spaces[] = " ";
+ size_t width, i, numSpaces;
char tmp[TCL_DOUBLE_SPACE];
/*
- * First, compute the width of the widest option key, so that we
- * can make everything line up.
+ * First, compute the width of the widest option key, so that we can make
+ * everything line up.
*/
width = 4;
for (i = 0; i < 2; i++) {
for (infoPtr = i ? defaultTable : argTable;
infoPtr->type != TK_ARGV_END; infoPtr++) {
- int length;
+ size_t length;
if (infoPtr->key == NULL) {
continue;
}
@@ -378,59 +358,54 @@ PrintUsage(interp, argTable, flags)
}
}
- Tcl_AppendResult(interp, "Command-specific options:", (char *) NULL);
+ Tcl_AppendResult(interp, "Command-specific options:", NULL);
for (i = 0; ; i++) {
for (infoPtr = i ? defaultTable : argTable;
infoPtr->type != TK_ARGV_END; infoPtr++) {
if ((infoPtr->type == TK_ARGV_HELP) && (infoPtr->key == NULL)) {
- Tcl_AppendResult(interp, "\n", infoPtr->help, (char *) NULL);
+ Tcl_AppendResult(interp, "\n", infoPtr->help, NULL);
continue;
}
- Tcl_AppendResult(interp, "\n ", infoPtr->key, ":", (char *) NULL);
+ Tcl_AppendResult(interp, "\n ", infoPtr->key, ":", NULL);
numSpaces = width + 1 - strlen(infoPtr->key);
- while (numSpaces > 0) {
- if (numSpaces >= NUM_SPACES) {
- Tcl_AppendResult(interp, spaces, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, spaces+NUM_SPACES-numSpaces,
- (char *) NULL);
- }
- numSpaces -= NUM_SPACES;
+ while (numSpaces-- > 0) {
+ Tcl_AppendResult(interp, " ", NULL);
}
- Tcl_AppendResult(interp, infoPtr->help, (char *) NULL);
+ Tcl_AppendResult(interp, infoPtr->help, NULL);
switch (infoPtr->type) {
- case TK_ARGV_INT: {
- sprintf(tmp, "%d", *((int *) infoPtr->dst));
- Tcl_AppendResult(interp, "\n\t\tDefault value: ",
- tmp, (char *) NULL);
- break;
- }
- case TK_ARGV_FLOAT: {
- sprintf(tmp, "%g", *((double *) infoPtr->dst));
- Tcl_AppendResult(interp, "\n\t\tDefault value: ",
- tmp, (char *) NULL);
- break;
- }
- case TK_ARGV_STRING: {
- char *string;
+ case TK_ARGV_INT:
+ sprintf(tmp, "%d", *((int *) infoPtr->dst));
+ Tcl_AppendResult(interp, "\n\t\tDefault value: ", tmp, NULL);
+ break;
+ case TK_ARGV_FLOAT:
+ Tcl_PrintDouble(NULL, *((double *) infoPtr->dst), tmp);
+ Tcl_AppendResult(interp, "\n\t\tDefault value: ", tmp, NULL);
+ break;
+ case TK_ARGV_STRING: {
+ char *string = *((char **) infoPtr->dst);
- string = *((char **) infoPtr->dst);
- if (string != NULL) {
- Tcl_AppendResult(interp, "\n\t\tDefault value: \"",
- string, "\"", (char *) NULL);
- }
- break;
- }
- default: {
- break;
+ if (string != NULL) {
+ Tcl_AppendResult(interp, "\n\t\tDefault value: \"", string,
+ "\"", NULL);
}
+ break;
+ }
+ default:
+ break;
}
}
if ((flags & TK_ARGV_NO_DEFAULTS) || (i > 0)) {
break;
}
- Tcl_AppendResult(interp, "\nGeneric options for all commands:",
- (char *) NULL);
+ Tcl_AppendResult(interp, "\nGeneric options for all commands:", NULL);
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkAtom.c b/generic/tkAtom.c
index f94af81..85d3748 100644
--- a/generic/tkAtom.c
+++ b/generic/tkAtom.c
@@ -1,25 +1,23 @@
-/*
+/*
* tkAtom.c --
*
- * This file manages a cache of X Atoms in order to avoid
- * interactions with the X server. It's much like the Xmu
- * routines, except it has a cleaner interface (caller
- * doesn't have to provide permanent storage for atom names,
- * for example).
+ * This file manages a cache of X Atoms in order to avoid interactions
+ * with the X server. It's much like the Xmu routines, except it has a
+ * cleaner interface (caller doesn't have to provide permanent storage
+ * for atom names, for example).
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
- * The following are a list of the predefined atom strings.
- * They should match those found in xatom.h
+ * The following are a list of the predefined atom strings. They should match
+ * those found in xatom.h
*/
static char * atomNameArray[] = {
@@ -46,24 +44,24 @@ static char * atomNameArray[] = {
"COPYRIGHT", "NOTICE", "FONT_NAME",
"FAMILY_NAME", "FULL_NAME", "CAP_HEIGHT",
"WM_CLASS", "WM_TRANSIENT_FOR",
- (char *) NULL
+ NULL
};
/*
- * Forward references to procedures defined in this file:
+ * Forward references to functions defined in this file:
*/
-static void AtomInit _ANSI_ARGS_((TkDisplay *dispPtr));
+static void AtomInit(TkDisplay *dispPtr);
/*
*--------------------------------------------------------------
*
* Tk_InternAtom --
*
- * Given a string, produce the equivalent X atom. This
- * procedure is equivalent to XInternAtom, except that it
- * keeps a local cache of atoms. Once a name is known,
- * the server need not be contacted again for that name.
+ * Given a string, produce the equivalent X atom. This function is
+ * equivalent to XInternAtom, except that it keeps a local cache of
+ * atoms. Once a name is known, the server need not be contacted again
+ * for that name.
*
* Results:
* The return value is the Atom corresponding to name.
@@ -75,29 +73,28 @@ static void AtomInit _ANSI_ARGS_((TkDisplay *dispPtr));
*/
Atom
-Tk_InternAtom(tkwin, name)
- Tk_Window tkwin; /* Window token; map name to atom
- * for this window's display. */
- CONST char *name; /* Name to turn into 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. */
{
register TkDisplay *dispPtr;
register Tcl_HashEntry *hPtr;
- int new;
+ int isNew;
dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (!dispPtr->atomInit) {
AtomInit(dispPtr);
}
- hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &new);
- if (new) {
+ hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew);
+ if (isNew) {
Tcl_HashEntry *hPtr2;
Atom atom;
atom = XInternAtom(dispPtr->display, name, False);
Tcl_SetHashValue(hPtr, atom);
- hPtr2 = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom,
- &new);
+ hPtr2 = Tcl_CreateHashEntry(&dispPtr->atomTable, (char*) atom, &isNew);
Tcl_SetHashValue(hPtr2, Tcl_GetHashKey(&dispPtr->nameTable, hPtr));
}
return (Atom) Tcl_GetHashValue(hPtr);
@@ -108,16 +105,15 @@ Tk_InternAtom(tkwin, name)
*
* Tk_GetAtomName --
*
- * This procedure is equivalent to XGetAtomName except that
- * it uses the local atom cache to avoid contacting the
- * server.
+ * This function is equivalent to XGetAtomName except that it uses the
+ * local atom cache to avoid contacting the server.
*
* Results:
- * The return value is a character string corresponding to
- * the atom given by "atom". This string's storage space
- * is static: it need not be freed by the caller, and should
- * not be modified by the caller. If "atom" doesn't exist
- * on tkwin's display, then the string "?bad atom?" is returned.
+ * The return value is a character string corresponding to the atom given
+ * by "atom". This string's storage space is static: it need not be freed
+ * by the caller, and should not be modified by the caller. If "atom"
+ * doesn't exist on tkwin's display, then the string "?bad atom?" is
+ * returned.
*
* Side effects:
* None.
@@ -126,11 +122,10 @@ Tk_InternAtom(tkwin, name)
*/
CONST char *
-Tk_GetAtomName(tkwin, atom)
- Tk_Window tkwin; /* Window token; map atom to name
- * relative to this window's
- * display. */
- Atom atom; /* Atom whose name is wanted. */
+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;
@@ -144,10 +139,10 @@ Tk_GetAtomName(tkwin, atom)
if (hPtr == NULL) {
char *name;
Tk_ErrorHandler handler;
- int new, mustFree;
+ int isNew, mustFree;
- handler= Tk_CreateErrorHandler(dispPtr->display, BadAtom,
- -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ handler = Tk_CreateErrorHandler(dispPtr->display, BadAtom, -1, -1,
+ NULL, (ClientData) NULL);
name = XGetAtomName(dispPtr->display, atom);
mustFree = 1;
if (name == NULL) {
@@ -155,15 +150,13 @@ Tk_GetAtomName(tkwin, atom)
mustFree = 0;
}
Tk_DeleteErrorHandler(handler);
- hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, (char *) name,
- &new);
+ hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew);
Tcl_SetHashValue(hPtr, atom);
if (mustFree) {
XFree(name);
}
name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr);
- hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom,
- &new);
+ hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &isNew);
Tcl_SetHashValue(hPtr, name);
}
return Tcl_GetHashValue(hPtr);
@@ -186,8 +179,8 @@ Tk_GetAtomName(tkwin, atom)
*/
static void
-AtomInit(dispPtr)
- register TkDisplay *dispPtr; /* Display to initialize. */
+AtomInit(
+ register TkDisplay *dispPtr)/* Display to initialize. */
{
Tcl_HashEntry *hPtr;
Atom atom;
@@ -197,19 +190,27 @@ AtomInit(dispPtr)
Tcl_InitHashTable(&dispPtr->atomTable, TCL_ONE_WORD_KEYS);
for (atom = 1; atom <= XA_LAST_PREDEFINED; atom++) {
+ char *name;
+ int isNew;
+
hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom);
- if (hPtr == NULL) {
- char *name;
- int new;
-
- name = atomNameArray[atom - 1];
- hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, (char *) name,
- &new);
- Tcl_SetHashValue(hPtr, atom);
- name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr);
- hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom,
- &new);
- Tcl_SetHashValue(hPtr, name);
+ if (hPtr != NULL) {
+ continue;
}
+
+ name = atomNameArray[atom - 1];
+ hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew);
+ Tcl_SetHashValue(hPtr, atom);
+ name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr);
+ hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &isNew);
+ Tcl_SetHashValue(hPtr, name);
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkBind.c b/generic/tkBind.c
index c3ee5a1..cf8ed1d 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -1,29 +1,27 @@
-/*
+/*
* tkBind.c --
*
- * This file provides procedures that associate Tcl commands
- * with X events or sequences of X events.
+ * This file provides functions that associate Tcl commands with X events
+ * or sequences of X events.
*
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
#ifdef __WIN32__
#include "tkWinInt.h"
#endif
-#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* UNIX */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* UNIX */
#include "tkUnixInt.h"
#endif
-
/*
* File structure:
*
@@ -44,111 +42,109 @@
* Non-package-specific helpers.
*/
-
/*
- * The following union is used to hold the detail information from an
- * XEvent (including Tk's XVirtualEvent extension).
+ * The following union is used to hold the detail information from an XEvent
+ * (including Tk's XVirtualEvent extension).
*/
+
typedef union {
- KeySym keySym; /* KeySym that corresponds to xkey.keycode. */
- int button; /* Button that was pressed (xbutton.button). */
- Tk_Uid name; /* Tk_Uid of virtual event. */
- ClientData clientData; /* Used when type of Detail is unknown, and to
- * ensure that all bytes of Detail are initialized
- * when this structure is used in a hash key. */
+ KeySym keySym; /* KeySym that corresponds to xkey.keycode. */
+ int button; /* Button that was pressed (xbutton.button). */
+ Tk_Uid name; /* Tk_Uid of virtual event. */
+ ClientData clientData; /* Used when type of Detail is unknown, and to
+ * ensure that all bytes of Detail are
+ * initialized when this structure is used in
+ * a hash key. */
} Detail;
/*
- * The structure below represents a binding table. A binding table
- * represents a domain in which event bindings may occur. It includes
- * a space of objects relative to which events occur (usually windows,
- * but not always), a history of recent events in the domain, and
- * a set of mappings that associate particular Tcl commands with sequences
- * of events in the domain. Multiple binding tables may exist at once,
- * either because there are multiple applications open, or because there
- * are multiple domains within an application with separate event
- * bindings for each (for example, each canvas widget has a separate
- * binding table for associating events with the items in the canvas).
- *
- * Note: it is probably a bad idea to reduce EVENT_BUFFER_SIZE much
- * below 30. To see this, consider a triple mouse button click while
- * the Shift key is down (and auto-repeating). There may be as many
- * as 3 auto-repeat events after each mouse button press or release
- * (see the first large comment block within Tk_BindEvent for more on
- * this), for a total of 20 events to cover the three button presses
- * and two intervening releases. If you reduce EVENT_BUFFER_SIZE too
- * much, shift multi-clicks will be lost.
- *
+ * The structure below represents a binding table. A binding table represents
+ * a domain in which event bindings may occur. It includes a space of objects
+ * relative to which events occur (usually windows, but not always), a history
+ * of recent events in the domain, and a set of mappings that associate
+ * particular Tcl commands with sequences of events in the domain. Multiple
+ * binding tables may exist at once, either because there are multiple
+ * applications open, or because there are multiple domains within an
+ * application with separate event bindings for each (for example, each canvas
+ * widget has a separate binding table for associating events with the items
+ * in the canvas).
+ *
+ * Note: it is probably a bad idea to reduce EVENT_BUFFER_SIZE much below 30.
+ * To see this, consider a triple mouse button click while the Shift key is
+ * down (and auto-repeating). There may be as many as 3 auto-repeat events
+ * after each mouse button press or release (see the first large comment block
+ * within Tk_BindEvent for more on this), for a total of 20 events to cover
+ * the three button presses and two intervening releases. If you reduce
+ * EVENT_BUFFER_SIZE too much, shift multi-clicks will be lost.
*/
#define EVENT_BUFFER_SIZE 30
typedef struct BindingTable {
- XEvent eventRing[EVENT_BUFFER_SIZE];/* Circular queue of recent events
- * (higher indices are for more recent
- * events). */
- Detail detailRing[EVENT_BUFFER_SIZE];/* "Detail" information (keySym,
- * button, Tk_Uid, or 0) for each
- * entry in eventRing. */
- int curEvent; /* Index in eventRing of most recent
- * event. Newer events have higher
- * indices. */
- Tcl_HashTable patternTable; /* Used to map from an event to a
- * list of patterns that may match that
- * event. Keys are PatternTableKey
- * structs, values are (PatSeq *). */
- Tcl_HashTable objectTable; /* Used to map from an object to a
- * list of patterns associated with
- * that object. Keys are ClientData,
- * values are (PatSeq *). */
- Tcl_Interp *interp; /* Interpreter in which commands are
- * executed. */
+ XEvent eventRing[EVENT_BUFFER_SIZE];
+ /* Circular queue of recent events (higher
+ * indices are for more recent events). */
+ Detail detailRing[EVENT_BUFFER_SIZE];
+ /* "Detail" information (keySym, button,
+ * Tk_Uid, or 0) for each entry in
+ * eventRing. */
+ int curEvent; /* Index in eventRing of most recent event.
+ * Newer events have higher indices. */
+ Tcl_HashTable patternTable; /* Used to map from an event to a list of
+ * patterns that may match that event. Keys
+ * are PatternTableKey structs, values are
+ * (PatSeq *). */
+ Tcl_HashTable objectTable; /* Used to map from an object to a list of
+ * patterns associated with that object. Keys
+ * are ClientData, values are (PatSeq *). */
+ Tcl_Interp *interp; /* Interpreter in which commands are
+ * executed. */
} BindingTable;
/*
- * The following structure represents virtual event table. A virtual event
- * table provides a way to map from platform-specific physical events such
- * as button clicks or key presses to virtual events such as <<Paste>>,
+ * The following structure represents virtual event table. A virtual event
+ * table provides a way to map from platform-specific physical events such as
+ * button clicks or key presses to virtual events such as <<Paste>>,
* <<Close>>, or <<ScrollWindow>>.
*
* 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, no lookup of the virtual event will need to be done using
- * this table, because the virtual event is actually in the event stream.
+ * 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,
+ * 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 {
- 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 (PatSeq *). */
- Tcl_HashTable nameTable; /* Used to map a virtual event name to
- * the array of physical events that can
- * trigger it. Keys are the Tk_Uid names
- * of the virtual events, values are
- * PhysicalsOwned structs. */
+ 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
+ * (PatSeq *). */
+ Tcl_HashTable nameTable; /* Used to map a virtual event name to the
+ * array of physical events that can trigger
+ * it. Keys are the Tk_Uid names of the
+ * virtual events, values are PhysicalsOwned
+ * structs. */
} VirtualEventTable;
/*
- * The following structure is used as a key in a patternTable for both
- * binding tables and a virtual event tables.
+ * The following structure is used as a key in a patternTable for both binding
+ * tables and a virtual event tables.
*
- * In a binding table, the object field corresponds to the binding tag
- * for the widget whose bindings are being accessed.
+ * In a binding table, the object field corresponds to the binding tag for the
+ * widget whose bindings are being accessed.
*
- * In a virtual event table, the object field is always NULL. Virtual
- * events are a global definiton and are not tied to a particular
- * binding tag.
+ * In a virtual event table, the object field is always NULL. Virtual events
+ * are a global definiton and are not tied to a particular binding tag.
*
- * The same key is used for both types of pattern tables so that the
- * helper functions that traverse and match patterns will work for both
- * binding tables and virtual event tables.
+ * The same key is used for both types of pattern tables so that the helper
+ * functions that traverse and match patterns will work for both binding
+ * tables and virtual event tables.
*/
+
typedef struct PatternTableKey {
ClientData object; /* For binding table, identifies the binding
* tag of the object (or class of objects)
- * relative to which the event occurred.
- * For virtual event table, always NULL. */
+ * relative to which the event occurred. For
+ * virtual event table, always NULL. */
int type; /* Type of event (from X). */
Detail detail; /* Additional information, such as keysym,
* button, Tk_Uid, or 0 if nothing
@@ -162,37 +158,34 @@ typedef struct PatternTableKey {
typedef struct Pattern {
int eventType; /* Type of X event, e.g. ButtonPress. */
- int needMods; /* Mask of modifiers that must be
- * present (0 means no modifiers are
- * required). */
- Detail detail; /* Additional information that must
- * match event. Normally this is 0,
- * meaning no additional information
- * must match. For KeyPress and
- * KeyRelease events, a keySym may
- * be specified to select a
- * particular keystroke (0 means any
- * keystrokes). For button events,
- * specifies a particular button (0
- * means any buttons are OK). For virtual
- * events, specifies the Tk_Uid of the
+ int needMods; /* Mask of modifiers that must be present (0
+ * means no modifiers are required). */
+ Detail detail; /* Additional information that must match
+ * event. Normally this is 0, meaning no
+ * additional information must match. For
+ * KeyPress and KeyRelease events, a keySym
+ * may be specified to select a particular
+ * keystroke (0 means any keystrokes). For
+ * button events, specifies a particular
+ * button (0 means any buttons are OK). For
+ * virtual events, specifies the Tk_Uid of the
* virtual event name (never 0). */
} Pattern;
/*
* The following structure defines a pattern sequence, which consists of one
- * or more patterns. In order to trigger, a pattern sequence must match
- * the most recent X events (first pattern to most recent event, next
- * pattern to next event, and so on). It is used as the hash value in a
- * patternTable for both binding tables and virtual event tables.
- *
- * In a binding table, it is the sequence of physical events that make up
- * a binding for an object.
- *
- * In a virtual event table, it is the sequence of physical events that
- * define a virtual event.
- *
- * The same structure is used for both types of pattern tables so that the
+ * or more patterns. In order to trigger, a pattern sequence must match the
+ * most recent X events (first pattern to most recent event, next pattern to
+ * next event, and so on). It is used as the hash value in a patternTable for
+ * both binding tables and virtual event tables.
+ *
+ * In a binding table, it is the sequence of physical events that make up a
+ * binding for an object.
+ *
+ * In a virtual event table, it is the sequence of physical events that define
+ * a virtual event.
+ *
+ * The same structure is used for both types of pattern tables so that the
* helper functions that traverse and match patterns will work for both
* binding tables and virtual event tables.
*/
@@ -200,57 +193,56 @@ typedef struct Pattern {
typedef struct PatSeq {
int numPats; /* Number of patterns in sequence (usually
* 1). */
- TkBindEvalProc *eventProc; /* The procedure that will be invoked on
- * the clientData when this pattern sequence
+ TkBindEvalProc *eventProc; /* The function that will be invoked on the
+ * clientData when this pattern sequence
* matches. */
- TkBindFreeProc *freeProc; /* The procedure that will be invoked to
+ 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. */
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. */
- Tcl_HashEntry *hPtr; /* Pointer to hash table entry for the
- * initial pattern. This is the head of the
- * list of which nextSeqPtr forms a part. */
- struct VirtualOwners *voPtr;/* In a binding table, always NULL. In a
+ 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. */
+ Tcl_HashEntry *hPtr; /* Pointer to hash table entry for the initial
+ * pattern. This is the head of the list of
+ * which nextSeqPtr forms a part. */
+ struct VirtualOwners *voPtr;/* In a binding table, always NULL. In a
* virtual event table, identifies the array
* of virtual events that can be triggered by
* this event. */
- struct PatSeq *nextObjPtr; /* In a binding table, next in list of all
+ struct PatSeq *nextObjPtr; /* In a binding table, next in list of all
* pattern sequences for the same object (NULL
- * for end of list). Needed to implement
- * Tk_DeleteAllBindings. In a virtual event
+ * for end of list). Needed to implement
+ * Tk_DeleteAllBindings. In a virtual event
* table, always NULL. */
- Pattern pats[1]; /* Array of "numPats" patterns. Only one
+ Pattern pats[1]; /* Array of "numPats" patterns. Only one
* element is declared here but in actuality
- * enough space will be allocated for "numPats"
- * patterns. To match, pats[0] must match
- * event n, pats[1] must match event n-1, etc.
- */
+ * enough space will be allocated for
+ * "numPats" patterns. To match, pats[0] must
+ * match event n, pats[1] must match event
+ * n-1, etc. */
} PatSeq;
/*
* Flag values for PatSeq structures:
*
- * PAT_NEARBY 1 means that all of the events matching
- * this sequence must occur with nearby X
- * and Y mouse coordinates and close in time.
- * This is typically used to restrict multiple
- * button presses.
+ * PAT_NEARBY 1 means that all of the events matching this sequence
+ * 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
+ * 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.
*/
@@ -258,52 +250,49 @@ typedef struct PatSeq {
#define MARKED_DELETED 0x2
/*
- * Constants that define how close together two events must be
- * in milliseconds or pixels to meet the PAT_NEARBY constraint:
+ * Constants that define how close together two events must be in milliseconds
+ * or pixels to meet the PAT_NEARBY constraint:
*/
#define NEARBY_PIXELS 5
#define NEARBY_MS 500
-
/*
* The following structure keeps track of all the virtual events that are
- * associated with a particular physical event. It is pointed to by the
- * voPtr field in a PatSeq in the patternTable of a virtual event table.
+ * associated with a particular physical event. It is pointed to by the voPtr
+ * field in a PatSeq in the patternTable of a virtual event table.
*/
typedef struct VirtualOwners {
- int numOwners; /* Number of virtual events to trigger. */
- Tcl_HashEntry *owners[1]; /* Array of pointers to entries in
- * nameTable. Enough space will
- * actually be allocated for numOwners
- * hash entries. */
+ int numOwners; /* Number of virtual events to trigger. */
+ Tcl_HashEntry *owners[1]; /* Array of pointers to entries in nameTable.
+ * Enough space will actually be allocated for
+ * numOwners hash entries. */
} VirtualOwners;
/*
- * The following structure is used in the nameTable of a virtual event
- * table to associate a virtual event with all the physical events that can
- * trigger it.
+ * The following structure is used in the nameTable of a virtual event table
+ * to associate a virtual event with all the physical events that can trigger
+ * it.
*/
typedef struct PhysicalsOwned {
- int numOwned; /* Number of physical events owned. */
- PatSeq *patSeqs[1]; /* Array of pointers to physical event
- * patterns. Enough space will actually
- * be allocated to hold numOwned. */
+ int numOwned; /* Number of physical events owned. */
+ PatSeq *patSeqs[1]; /* Array of pointers to physical event
+ * patterns. Enough space will actually be
+ * allocated to hold numOwned. */
} PhysicalsOwned;
/*
- * One of the following structures exists for each interpreter. This
- * structure keeps track of the current display and screen in the
- * interpreter, so that a script can be invoked whenever the display/screen
- * changes (the script does things like point tk::Priv at a display-specific
- * structure).
+ * One of the following structures exists for each interpreter. This structure
+ * keeps track of the current display and screen in the interpreter, so that a
+ * script can be invoked whenever the display/screen changes (the script does
+ * things like point tk::Priv at a display-specific structure).
*/
typedef struct {
- TkDisplay *curDispPtr; /* Display for last binding command invoked
- * in this application. */
- int curScreenIndex; /* Index of screen for last binding command. */
+ TkDisplay *curDispPtr; /* Display for last binding command invoked in
+ * this application. */
+ int curScreenIndex; /* Index of screen for last binding command */
int bindingDepth; /* Number of active instances of Tk_BindEvent
* in this application. */
} ScreenInfo;
@@ -311,21 +300,21 @@ typedef struct {
/*
* 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.
+ * 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
+ /* 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
+ 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
@@ -333,8 +322,8 @@ typedef struct PendingBinding {
} PendingBinding;
/*
- * The following structure keeps track of all the information local to
- * the binding package on a per interpreter basis.
+ * The following structure keeps track of all the information local to the
+ * binding package on a per interpreter basis.
*/
typedef struct BindInfo {
@@ -342,39 +331,38 @@ typedef struct BindInfo {
/* 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. */
+ * 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. */
+ int deleted; /* 1 the application has been deleted but the
+ * structure has been preserved. */
} BindInfo;
-
+
/*
- * In X11R4 and earlier versions, XStringToKeysym is ridiculously
- * slow. The data structure and hash table below, along with the
- * code that uses them, implement a fast mapping from strings to
- * keysyms. In X11R5 and later releases XStringToKeysym is plenty
- * fast so this stuff isn't needed. The #define REDO_KEYSYM_LOOKUP
- * is normally undefined, so that XStringToKeysym gets used. It
- * can be set in the Makefile to enable the use of the hash table
- * below.
+ * In X11R4 and earlier versions, XStringToKeysym is ridiculously slow. The
+ * data structure and hash table below, along with the code that uses them,
+ * implement a fast mapping from strings to keysyms. In X11R5 and later
+ * releases XStringToKeysym is plenty fast so this stuff isn't needed. The
+ * #define REDO_KEYSYM_LOOKUP is normally undefined, so that XStringToKeysym
+ * gets used. It can be set in the Makefile to enable the use of the hash
+ * table below.
*/
#ifdef REDO_KEYSYM_LOOKUP
typedef struct {
- char *name; /* Name of keysym. */
- KeySym value; /* Numeric identifier for keysym. */
+ char *name; /* Name of keysym. */
+ KeySym value; /* Numeric identifier for keysym. */
} KeySymInfo;
static KeySymInfo keyArray[] = {
#ifndef lint
#include "ks_names.h"
#endif
- {(char *) NULL, 0}
+ {NULL, 0}
};
-static Tcl_HashTable keySymTable; /* keyArray hashed by keysym value. */
-static Tcl_HashTable nameTable; /* keyArray hashed by keysym name. */
+static Tcl_HashTable keySymTable; /* keyArray hashed by keysym value. */
+static Tcl_HashTable nameTable; /* keyArray hashed by keysym name. */
#endif /* REDO_KEYSYM_LOOKUP */
/*
@@ -386,16 +374,17 @@ static int initialized = 0;
TCL_DECLARE_MUTEX(bindMutex)
/*
- * A hash table is kept to map from the string names of event
- * modifiers to information about those modifiers. The structure
- * for storing this information, and the hash table built at
- * initialization time, are defined below.
+ * A hash table is kept to map from the string names of event modifiers to
+ * information about those modifiers. The structure for storing this
+ * information, and the hash table built at initialization time, are defined
+ * below.
*/
typedef struct {
char *name; /* Name of modifier. */
- int mask; /* Button/modifier mask value, * such as Button1Mask. */
- int flags; /* Various flags; see below for
+ int mask; /* Button/modifier mask value, such as
+ * Button1Mask. */
+ int flags; /* Various flags; see below for
* definitions. */
} ModInfo;
@@ -423,6 +412,7 @@ static ModInfo modArray[] = {
{"Meta", META_MASK, 0},
{"M", META_MASK, 0},
{"Alt", ALT_MASK, 0},
+ {"Extended", EXTENDED_MASK, 0},
{"B1", Button1Mask, 0},
{"Button1", Button1Mask, 0},
{"B2", Button2Mask, 0},
@@ -448,32 +438,29 @@ static ModInfo modArray[] = {
{"Double", 0, DOUBLE},
{"Triple", 0, TRIPLE},
{"Quadruple", 0, QUADRUPLE},
- {"Any", 0, 0}, /* Ignored: historical relic. */
+ {"Any", 0, 0}, /* Ignored: historical relic */
{NULL, 0, 0}
};
static Tcl_HashTable modTable;
/*
- * This module also keeps a hash table mapping from event names
- * to information about those events. The structure, an array
- * to use to initialize the hash table, and the hash table are
- * all defined below.
+ * This module also keeps a hash table mapping from event names to information
+ * about those events. The structure, an array to use to initialize the hash
+ * table, and the hash table are all defined below.
*/
typedef struct {
char *name; /* Name of event. */
- int type; /* Event type for X, such as
- * ButtonPress. */
- int eventMask; /* Mask bits (for XSelectInput)
- * for this event type. */
+ int type; /* Event type for X, such as ButtonPress. */
+ int eventMask; /* Mask bits (for XSelectInput) for this event
+ * type. */
} EventInfo;
/*
- * Note: some of the masks below are an OR-ed combination of
- * several masks. This is necessary because X doesn't report
- * up events unless you also ask for down events. Also, X
- * doesn't report button state in motion events unless you've
- * asked about button events.
+ * Note: some of the masks below are an OR-ed combination of several masks.
+ * This is necessary because X doesn't report up events unless you also ask
+ * for down events. Also, X doesn't report button state in motion events
+ * unless you've asked about button events.
*/
static EventInfo eventArray[] = {
@@ -507,18 +494,18 @@ static EventInfo eventArray[] = {
{"CirculateRequest", CirculateRequest, SubstructureRedirectMask},
{"ConfigureRequest", ConfigureRequest, SubstructureRedirectMask},
{"Create", CreateNotify, SubstructureNotifyMask},
- {"MapRequest", MapRequest, SubstructureRedirectMask},
+ {"MapRequest", MapRequest, SubstructureRedirectMask},
{"ResizeRequest", ResizeRequest, ResizeRedirectMask},
- {(char *) NULL, 0, 0}
+ {NULL, 0, 0}
};
static Tcl_HashTable eventTable;
/*
- * The defines and table below are used to classify events into
- * various groups. The reason for this is that logically identical
- * fields (e.g. "state") appear at different places in different
- * types of events. The classification masks can be used to figure
- * out quickly where to extract information from events.
+ * The defines and table below are used to classify events into various
+ * groups. The reason for this is that logically identical fields (e.g.
+ * "state") appear at different places in different types of events. The
+ * classification masks can be used to figure out quickly where to extract
+ * information from events.
*/
#define KEY 0x1
@@ -546,7 +533,7 @@ static Tcl_HashTable eventTable;
#define CIRCREQ 0x400000
#define KEY_BUTTON_MOTION_VIRTUAL (KEY|BUTTON|MOTION|VIRTUAL)
-#define KEY_BUTTON_MOTION_CROSSING (KEY|BUTTON|MOTION|CROSSING|VIRTUAL)
+#define KEY_BUTTON_MOTION_CROSSING (KEY|BUTTON|MOTION|VIRTUAL|CROSSING)
static int flagArray[TK_LASTEVENT] = {
/* Not used */ 0,
@@ -585,18 +572,17 @@ static int flagArray[TK_LASTEVENT] = {
/* ClientMessage */ 0,
/* MappingNotify */ 0,
/* VirtualEvent */ VIRTUAL,
- /* Activate */ ACTIVATE,
+ /* Activate */ ACTIVATE,
/* Deactivate */ ACTIVATE,
/* MouseWheel */ KEY
};
/*
- * The following table is used to map between the location where an
- * generated event should be queued and the string used to specify the
- * location.
+ * The following table is used to map between the location where an generated
+ * event should be queued and the string used to specify the location.
*/
-
-static TkStateMap queuePosition[] = {
+
+static const TkStateMap queuePosition[] = {
{-1, "now"},
{TCL_QUEUE_HEAD, "head"},
{TCL_QUEUE_MARK, "mark"},
@@ -605,13 +591,13 @@ static TkStateMap queuePosition[] = {
};
/*
- * The following tables are used as a two-way map between X's internal
- * numeric values for fields in an XEvent and the strings used in Tcl. The
- * tables are used both when constructing an XEvent from user input and
- * when providing data from an XEvent to the user.
+ * The following tables are used as a two-way map between X's internal numeric
+ * values for fields in an XEvent and the strings used in Tcl. The tables are
+ * used both when constructing an XEvent from user input and when providing
+ * data from an XEvent to the user.
*/
-static TkStateMap notifyMode[] = {
+static const TkStateMap notifyMode[] = {
{NotifyNormal, "NotifyNormal"},
{NotifyGrab, "NotifyGrab"},
{NotifyUngrab, "NotifyUngrab"},
@@ -619,7 +605,7 @@ static TkStateMap notifyMode[] = {
{-1, NULL}
};
-static TkStateMap notifyDetail[] = {
+static const TkStateMap notifyDetail[] = {
{NotifyAncestor, "NotifyAncestor"},
{NotifyVirtual, "NotifyVirtual"},
{NotifyInferior, "NotifyInferior"},
@@ -631,20 +617,20 @@ static TkStateMap notifyDetail[] = {
{-1, NULL}
};
-static TkStateMap circPlace[] = {
+static const TkStateMap circPlace[] = {
{PlaceOnTop, "PlaceOnTop"},
{PlaceOnBottom, "PlaceOnBottom"},
{-1, NULL}
};
-static TkStateMap visNotify[] = {
- {VisibilityUnobscured, "VisibilityUnobscured"},
- {VisibilityPartiallyObscured, "VisibilityPartiallyObscured"},
- {VisibilityFullyObscured, "VisibilityFullyObscured"},
+static const TkStateMap visNotify[] = {
+ {VisibilityUnobscured, "VisibilityUnobscured"},
+ {VisibilityPartiallyObscured, "VisibilityPartiallyObscured"},
+ {VisibilityFullyObscured, "VisibilityFullyObscured"},
{-1, NULL}
};
-static TkStateMap configureRequestDetail[] = {
+static const TkStateMap configureRequestDetail[] = {
{None, "None"},
{Above, "Above"},
{Below, "Below"},
@@ -654,79 +640,71 @@ static TkStateMap configureRequestDetail[] = {
{-1, NULL}
};
-static TkStateMap propNotify[] = {
+static const TkStateMap propNotify[] = {
{PropertyNewValue, "NewValue"},
{PropertyDelete, "Delete"},
{-1, NULL}
};
/*
- * Prototypes for local procedures defined in this file:
+ * Prototypes for local functions defined in this file:
*/
-static void ChangeScreen _ANSI_ARGS_((Tcl_Interp *interp,
- char *dispName, int screenIndex));
-static int CreateVirtualEvent _ANSI_ARGS_((Tcl_Interp *interp,
+static void ChangeScreen(Tcl_Interp *interp, char *dispName,
+ int screenIndex);
+static int CreateVirtualEvent(Tcl_Interp *interp,
VirtualEventTable *vetPtr, char *virtString,
- char *eventString));
-static int DeleteVirtualEvent _ANSI_ARGS_((Tcl_Interp *interp,
+ char *eventString);
+static int DeleteVirtualEvent(Tcl_Interp *interp,
VirtualEventTable *vetPtr, char *virtString,
- char *eventString));
-static void DeleteVirtualEventTable _ANSI_ARGS_((
- VirtualEventTable *vetPtr));
-static void ExpandPercents _ANSI_ARGS_((TkWindow *winPtr,
- CONST char *before, XEvent *eventPtr, KeySym keySym,
- Tcl_DString *dsPtr));
-static void FreeTclBinding _ANSI_ARGS_((ClientData clientData));
-static PatSeq * FindSequence _ANSI_ARGS_((Tcl_Interp *interp,
+ 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,
- int allowVirtual, unsigned long *maskPtr));
-static void GetAllVirtualEvents _ANSI_ARGS_((Tcl_Interp *interp,
- VirtualEventTable *vetPtr));
-static char * GetField _ANSI_ARGS_((char *p, char *copy, int size));
-static void GetPatternString _ANSI_ARGS_((PatSeq *psPtr,
- Tcl_DString *dsPtr));
-static int GetVirtualEvent _ANSI_ARGS_((Tcl_Interp *interp,
- VirtualEventTable *vetPtr, char *virtString));
-static Tk_Uid GetVirtualEventUid _ANSI_ARGS_((Tcl_Interp *interp,
- char *virtString));
-static int HandleEventGenerate _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window main, int objc,
- Tcl_Obj *CONST objv[]));
-static void InitVirtualEventTable _ANSI_ARGS_((
- VirtualEventTable *vetPtr));
-static PatSeq * MatchPatterns _ANSI_ARGS_((TkDisplay *dispPtr,
+ const char *eventString, int create,
+ int allowVirtual, unsigned long *maskPtr);
+static void GetAllVirtualEvents(Tcl_Interp *interp,
+ VirtualEventTable *vetPtr);
+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);
+static Tk_Uid GetVirtualEventUid(Tcl_Interp *interp,
+ char *virtString);
+static int HandleEventGenerate(Tcl_Interp *interp, Tk_Window main,
+ int objc, Tcl_Obj *const objv[]);
+static void InitVirtualEventTable(VirtualEventTable *vetPtr);
+static PatSeq * MatchPatterns(TkDisplay *dispPtr,
BindingTable *bindPtr, PatSeq *psPtr,
PatSeq *bestPtr, ClientData *objectPtr,
- PatSeq **sourcePtrPtr));
-static int NameToWindow _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window main, Tcl_Obj *objPtr,
- Tk_Window *tkwinPtr));
-static int ParseEventDescription _ANSI_ARGS_((Tcl_Interp *interp,
- CONST char **eventStringPtr, Pattern *patPtr,
- unsigned long *eventMaskPtr));
-static void DoWarp _ANSI_ARGS_((ClientData clientData));
+ PatSeq **sourcePtrPtr);
+static int NameToWindow(Tcl_Interp *interp, Tk_Window main,
+ Tcl_Obj *objPtr, Tk_Window *tkwinPtr);
+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
- * procedure 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.
+ * 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)
-
/*
*---------------------------------------------------------------------------
*
* TkBindInit --
*
- * This procedure is called when an application is created. It
- * initializes all the structures used by bindings and virtual
- * events. It must be called before any other functions in this
- * file are called.
+ * This function is called when an application is created. It initializes
+ * all the structures used by bindings and virtual events. It must be
+ * called before any other functions in this file are called.
*
* Results:
* None.
@@ -738,39 +716,37 @@ static void DoWarp _ANSI_ARGS_((ClientData clientData));
*/
void
-TkBindInit(mainPtr)
- TkMainInfo *mainPtr; /* The newly created application. */
+TkBindInit(
+ TkMainInfo *mainPtr) /* The newly created application. */
{
BindInfo *bindInfoPtr;
if (sizeof(XEvent) < sizeof(XVirtualEvent)) {
- panic("TkBindInit: virtual events can't be supported");
+ Tcl_Panic("TkBindInit: virtual events can't be supported");
}
/*
- * Initialize the static data structures used by the binding package.
- * They are only initialized once, no matter how many interps are
- * created.
+ * Initialize the static data structures used by the binding package. They
+ * are only initialized once, no matter how many interps are created.
*/
if (!initialized) {
- Tcl_MutexLock(&bindMutex);
+ Tcl_MutexLock(&bindMutex);
if (!initialized) {
Tcl_HashEntry *hPtr;
ModInfo *modPtr;
EventInfo *eiPtr;
int newEntry;
-
#ifdef REDO_KEYSYM_LOOKUP
KeySymInfo *kPtr;
Tcl_InitHashTable(&keySymTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&nameTable, TCL_ONE_WORD_KEYS);
for (kPtr = keyArray; kPtr->name != NULL; kPtr++) {
- hPtr = Tcl_CreateHashEntry(&keySymTable, kPtr->name, &newEntry);
+ hPtr = Tcl_CreateHashEntry(&keySymTable, kPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, kPtr->value);
hPtr = Tcl_CreateHashEntry(&nameTable, (char *) kPtr->value,
- &newEntry);
+ &newEntry);
if (newEntry) {
Tcl_SetHashValue(hPtr, kPtr->name);
}
@@ -779,18 +755,18 @@ TkBindInit(mainPtr)
Tcl_InitHashTable(&modTable, TCL_STRING_KEYS);
for (modPtr = modArray; modPtr->name != NULL; modPtr++) {
- hPtr = Tcl_CreateHashEntry(&modTable, modPtr->name, &newEntry);
+ hPtr = Tcl_CreateHashEntry(&modTable, modPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, modPtr);
}
-
+
Tcl_InitHashTable(&eventTable, TCL_STRING_KEYS);
for (eiPtr = eventArray; eiPtr->name != NULL; eiPtr++) {
- hPtr = Tcl_CreateHashEntry(&eventTable, eiPtr->name, &newEntry);
+ hPtr = Tcl_CreateHashEntry(&eventTable, eiPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, eiPtr);
}
initialized = 1;
}
- Tcl_MutexUnlock(&bindMutex);
+ Tcl_MutexUnlock(&bindMutex);
}
mainPtr->bindingTable = Tk_CreateBindingTable(mainPtr->interp);
@@ -812,8 +788,8 @@ TkBindInit(mainPtr)
*
* TkBindFree --
*
- * This procedure is called when an application is deleted. It
- * deletes all the structures used by bindings and virtual events.
+ * This function is called when an application is deleted. It deletes all
+ * the structures used by bindings and virtual events.
*
* Results:
* None.
@@ -825,11 +801,11 @@ TkBindInit(mainPtr)
*/
void
-TkBindFree(mainPtr)
- TkMainInfo *mainPtr; /* The newly created application. */
+TkBindFree(
+ TkMainInfo *mainPtr) /* The newly created application. */
{
BindInfo *bindInfoPtr;
-
+
Tk_DeleteBindingTable(mainPtr->bindingTable);
mainPtr->bindingTable = NULL;
@@ -848,8 +824,8 @@ TkBindFree(mainPtr)
* Set up a new domain in which event bindings may be created.
*
* Results:
- * The return value is a token for the new table, which must
- * be passed to procedures like Tk_CreateBinding.
+ * The return value is a token for the new table, which must be passed to
+ * functions like Tk_CreateBinding.
*
* Side effects:
* Memory is allocated for the new table.
@@ -858,9 +834,9 @@ TkBindFree(mainPtr)
*/
Tk_BindingTable
-Tk_CreateBindingTable(interp)
- Tcl_Interp *interp; /* Interpreter to associate with the binding
- * table: commands are executed in this
+Tk_CreateBindingTable(
+ Tcl_Interp *interp) /* Interpreter to associate with the binding
+ * table: commands are executed in this
* interpreter. */
{
BindingTable *bindPtr;
@@ -887,9 +863,8 @@ Tk_CreateBindingTable(interp)
*
* Tk_DeleteBindingTable --
*
- * Destroy a binding table and free up all its memory.
- * The caller should not use bindingTable again after
- * this procedure returns.
+ * Destroy a binding table and free up all its memory. The caller should
+ * not use bindingTable again after this function returns.
*
* Results:
* None.
@@ -901,9 +876,9 @@ Tk_CreateBindingTable(interp)
*/
void
-Tk_DeleteBindingTable(bindingTable)
- Tk_BindingTable bindingTable; /* Token for the binding table to
- * destroy. */
+Tk_DeleteBindingTable(
+ Tk_BindingTable bindingTable)
+ /* Token for the binding table to destroy. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr, *nextPtr;
@@ -911,8 +886,7 @@ Tk_DeleteBindingTable(bindingTable)
Tcl_HashSearch search;
/*
- * Find and delete all of the patterns associated with the binding
- * table.
+ * Find and delete all of the patterns associated with the binding table.
*/
for (hPtr = Tcl_FirstHashEntry(&bindPtr->patternTable, &search);
@@ -931,8 +905,7 @@ Tk_DeleteBindingTable(bindingTable)
}
/*
- * Clean up the rest of the information associated with the
- * binding table.
+ * Clean up the rest of the information associated with the binding table.
*/
Tcl_DeleteHashTable(&bindPtr->patternTable);
@@ -945,41 +918,39 @@ Tk_DeleteBindingTable(bindingTable)
*
* Tk_CreateBinding --
*
- * Add a binding to a binding table, so that future calls to
- * Tk_BindEvent may execute the command in the binding.
+ * Add a binding to a binding table, so that future calls to Tk_BindEvent
+ * may execute the command 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
+ * 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:
- * An existing binding on the same event sequence may be
- * replaced.
- * The new binding may cause future calls to Tk_BindEvent to
- * behave differently than they did previously.
+ * An existing binding on the same event sequence may be replaced. The
+ * new binding may cause future calls to Tk_BindEvent to behave
+ * differently than they did previously.
*
*--------------------------------------------------------------
*/
unsigned long
-Tk_CreateBinding(interp, bindingTable, object, eventString, command, append)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_BindingTable bindingTable;
+Tk_CreateBinding(
+ 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
+ ClientData object, /* Token for object with which binding is
* associated. */
- CONST char *eventString; /* String describing event sequence that
+ const char *eventString, /* String describing event sequence that
* triggers binding. */
- CONST char *command; /* Contains Tcl command to execute when
+ const char *command, /* Contains Tcl command to execute when
* binding triggers. */
- int append; /* 0 means replace any existing binding for
+ int append) /* 0 means replace any existing binding for
* eventString; 1 means append to that
- * binding. If the existing binding is for a
+ * binding. If the existing binding is for a
* callback function and not a Tcl command
* string, the existing binding will always be
* replaced. */
@@ -987,27 +958,30 @@ Tk_CreateBinding(interp, bindingTable, object, eventString, command, append)
BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
unsigned long eventMask;
- char *new, *old;
+ char *newStr, *oldStr;
+ if (!*command) {
+ /* Silently ignore empty scripts -- see SF#3006842 */
+ return 1;
+ }
psPtr = FindSequence(interp, &bindPtr->patternTable, object, eventString,
1, 1, &eventMask);
if (psPtr == NULL) {
return 0;
}
if (psPtr->eventProc == NULL) {
- int new;
+ 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.
+ * 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,
- &new);
- if (new) {
+ &isNew);
+ if (isNew) {
psPtr->nextObjPtr = NULL;
} else {
psPtr->nextObjPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
@@ -1025,23 +999,23 @@ Tk_CreateBinding(interp, bindingTable, object, eventString, command, append)
append = 0;
}
- old = (char *) psPtr->clientData;
- if ((append != 0) && (old != NULL)) {
- int length;
+ oldStr = (char *) psPtr->clientData;
+ if ((append != 0) && (oldStr != NULL)) {
+ size_t length;
- length = strlen(old) + strlen(command) + 2;
- new = (char *) ckalloc((unsigned) length);
- sprintf(new, "%s\n%s", old, command);
+ length = strlen(oldStr) + strlen(command) + 2;
+ newStr = (char *) ckalloc((unsigned) length);
+ sprintf(newStr, "%s\n%s", oldStr, command);
} else {
- new = (char *) ckalloc((unsigned) strlen(command) + 1);
- strcpy(new, command);
+ newStr = (char *) ckalloc((unsigned) strlen(command) + 1);
+ strcpy(newStr, command);
}
- if (old != NULL) {
- ckfree(old);
+ if (oldStr != NULL) {
+ ckfree(oldStr);
}
psPtr->eventProc = EvalTclBinding;
psPtr->freeProc = FreeTclBinding;
- psPtr->clientData = (ClientData) new;
+ psPtr->clientData = (ClientData) newStr;
return eventMask;
}
@@ -1051,39 +1025,37 @@ Tk_CreateBinding(interp, bindingTable, object, eventString, command, append)
* TkCreateBindingProcedure --
*
* Add a C binding to a binding table, so that future calls to
- * Tk_BindEvent may callback the procedure in the binding.
+ * 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
+
+ * 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.
+ * Any existing binding on the same event sequence will be replaced.
*
*---------------------------------------------------------------------------
*/
unsigned long
-TkCreateBindingProcedure(interp, bindingTable, object, eventString,
- eventProc, freeProc, clientData)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_BindingTable bindingTable;
+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
+ ClientData object, /* Token for object with which binding is
* associated. */
- CONST char *eventString; /* String describing event sequence that
+ const char *eventString, /* String describing event sequence that
* triggers binding. */
- TkBindEvalProc *eventProc; /* Procedure to invoke when binding
- * triggers. Must not be NULL. */
- TkBindFreeProc *freeProc; /* Procedure to invoke when binding is
- * freed. May be NULL for no procedure. */
- ClientData clientData; /* Arbitrary ClientData to pass to eventProc
+ 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;
@@ -1096,26 +1068,24 @@ TkCreateBindingProcedure(interp, bindingTable, object, eventString,
return 0;
}
if (psPtr->eventProc == NULL) {
- int new;
+ 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.
+ * 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,
- &new);
- if (new) {
+ &isNew);
+ if (isNew) {
psPtr->nextObjPtr = NULL;
} else {
psPtr->nextObjPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
}
Tcl_SetHashValue(hPtr, psPtr);
} else {
-
/*
* Free existing callback.
*/
@@ -1139,24 +1109,25 @@ TkCreateBindingProcedure(interp, bindingTable, object, eventString,
* Remove an event binding from a binding table.
*
* Results:
- * The result is a standard Tcl return value. If an error
- * occurs then the interp's result will contain an error message.
+ * The result is a standard Tcl return value. If an error occurs then the
+ * interp's result will contain an error message.
*
* Side effects:
- * The binding given by object and eventString is removed
- * from bindingTable.
+ * The binding given by object and eventString is removed from
+ * bindingTable.
*
*--------------------------------------------------------------
*/
int
-Tk_DeleteBinding(interp, bindingTable, object, eventString)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_BindingTable bindingTable; /* 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. */
+Tk_DeleteBinding(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_BindingTable bindingTable,
+ /* 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;
@@ -1171,13 +1142,13 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
}
/*
- * Unlink the binding from the list for its object, then from the
- * list for its pattern.
+ * Unlink the binding from the list for its object, then from the list for
+ * its pattern.
*/
hPtr = Tcl_FindHashEntry(&bindPtr->objectTable, (char *) object);
if (hPtr == NULL) {
- panic("Tk_DeleteBinding couldn't find object table entry");
+ Tcl_Panic("Tk_DeleteBinding couldn't find object table entry");
}
prevPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
if (prevPtr == psPtr) {
@@ -1185,7 +1156,7 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
} else {
for ( ; ; prevPtr = prevPtr->nextObjPtr) {
if (prevPtr == NULL) {
- panic("Tk_DeleteBinding couldn't find on object list");
+ Tcl_Panic("Tk_DeleteBinding couldn't find on object list");
}
if (prevPtr->nextObjPtr == psPtr) {
prevPtr->nextObjPtr = psPtr->nextObjPtr;
@@ -1203,7 +1174,7 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
} else {
for ( ; ; prevPtr = prevPtr->nextSeqPtr) {
if (prevPtr == NULL) {
- panic("Tk_DeleteBinding couldn't find on hash chain");
+ Tcl_Panic("Tk_DeleteBinding couldn't find on hash chain");
}
if (prevPtr->nextSeqPtr == psPtr) {
prevPtr->nextSeqPtr = psPtr->nextSeqPtr;
@@ -1230,13 +1201,12 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
* Return the command associated with a given event string.
*
* Results:
- * The return value is a pointer to the command string
- * 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 result. The return value is semi-static: it
- * will persist until the binding is changed or deleted.
+ * The return value is a pointer to the command string 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
+ * result. The return value is semi-static: it will persist until the
+ * binding is changed or deleted.
*
* Side effects:
* None.
@@ -1244,15 +1214,15 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
*--------------------------------------------------------------
*/
-CONST char *
-Tk_GetBinding(interp, bindingTable, object, eventString)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_BindingTable bindingTable; /* Table in which to look for
- * binding. */
- ClientData object; /* Token for object with which binding
- * is associated. */
- CONST char *eventString; /* String describing event sequence
- * that triggers binding. */
+const char *
+Tk_GetBinding(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_BindingTable bindingTable,
+ /* Table in which to look for binding. */
+ ClientData object, /* Token for object with which binding is
+ * associated. */
+ const char *eventString) /* String describing event sequence that
+ * triggers binding. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
@@ -1264,7 +1234,7 @@ Tk_GetBinding(interp, bindingTable, object, eventString)
return NULL;
}
if (psPtr->eventProc == EvalTclBinding) {
- return (CONST char *) psPtr->clientData;
+ return (const char *) psPtr->clientData;
}
return "";
}
@@ -1274,14 +1244,14 @@ Tk_GetBinding(interp, bindingTable, object, eventString)
*
* Tk_GetAllBindings --
*
- * Return a list of event strings for all the bindings
- * associated with a given object.
+ * Return a list of event strings for all the bindings associated with a
+ * given object.
*
* Results:
- * There is no return value. The interp's result is modified to
- * hold a Tcl list with one entry for each binding associated
- * with object in bindingTable. Each entry in the list
- * contains the event string associated with one binding.
+ * There is no return value. The interp's result is modified to hold a
+ * Tcl list with one entry for each binding associated with object in
+ * bindingTable. Each entry in the list contains the event string
+ * associated with one binding.
*
* Side effects:
* None.
@@ -1290,13 +1260,11 @@ Tk_GetBinding(interp, bindingTable, object, eventString)
*/
void
-Tk_GetAllBindings(interp, bindingTable, object)
- Tcl_Interp *interp; /* Interpreter returning result or
- * error. */
- Tk_BindingTable bindingTable; /* Table in which to look for
- * bindings. */
- ClientData object; /* Token for object. */
-
+Tk_GetAllBindings(
+ Tcl_Interp *interp, /* Interpreter returning result or error. */
+ Tk_BindingTable bindingTable,
+ /* Table in which to look for bindings. */
+ ClientData object) /* Token for object. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr;
@@ -1310,11 +1278,11 @@ Tk_GetAllBindings(interp, bindingTable, object)
Tcl_DStringInit(&ds);
for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = psPtr->nextObjPtr) {
- /*
- * For each binding, output information about each of the
- * patterns in its sequence.
+ /*
+ * For each binding, output information about each of the patterns in
+ * its sequence.
*/
-
+
Tcl_DStringSetLength(&ds, 0);
GetPatternString(psPtr, &ds);
Tcl_AppendElement(interp, Tcl_DStringValue(&ds));
@@ -1327,12 +1295,11 @@ Tk_GetAllBindings(interp, bindingTable, object)
*
* Tk_DeleteAllBindings --
*
- * Remove all bindings associated with a given object in a
- * given binding table.
+ * Remove all bindings associated with a given object in a given binding
+ * table.
*
* Results:
- * All bindings associated with object are removed from
- * bindingTable.
+ * All bindings associated with object are removed from bindingTable.
*
* Side effects:
* None.
@@ -1341,10 +1308,10 @@ Tk_GetAllBindings(interp, bindingTable, object)
*/
void
-Tk_DeleteAllBindings(bindingTable, object)
- Tk_BindingTable bindingTable; /* Table in which to delete
- * bindings. */
- ClientData object; /* Token for object. */
+Tk_DeleteAllBindings(
+ Tk_BindingTable bindingTable,
+ /* Table in which to delete bindings. */
+ ClientData object) /* Token for object. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
PatSeq *psPtr, *prevPtr;
@@ -1357,12 +1324,12 @@ Tk_DeleteAllBindings(bindingTable, object)
}
for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = nextPtr) {
- nextPtr = psPtr->nextObjPtr;
+ nextPtr = psPtr->nextObjPtr;
/*
- * Be sure to remove each binding from its hash chain in the
- * pattern table. If this is the last pattern in the chain,
- * then delete the hash entry too.
+ * Be sure to remove each binding from its hash chain in the pattern
+ * table. If this is the last pattern in the chain, then delete the
+ * hash entry too.
*/
prevPtr = (PatSeq *) Tcl_GetHashValue(psPtr->hPtr);
@@ -1375,7 +1342,7 @@ Tk_DeleteAllBindings(bindingTable, object)
} else {
for ( ; ; prevPtr = prevPtr->nextSeqPtr) {
if (prevPtr == NULL) {
- panic("Tk_DeleteAllBindings couldn't find on hash chain");
+ Tcl_Panic("Tk_DeleteAllBindings couldn't find on hash chain");
}
if (prevPtr->nextSeqPtr == psPtr) {
prevPtr->nextSeqPtr = psPtr->nextSeqPtr;
@@ -1400,11 +1367,10 @@ Tk_DeleteAllBindings(bindingTable, object)
*
* Tk_BindEvent --
*
- * This procedure is invoked to process an X event. The
- * event is added to those recorded for the binding table.
- * Then each of the objects at *objectPtr is checked in
- * order to see if it has a binding that matches the recent
- * events. If so, the most specific binding is invoked for
+ * This function is invoked to process an X event. The event is added to
+ * those recorded for the binding table. Then each of the objects at
+ * *objectPtr is checked in order to see if it has a binding that matches
+ * the recent events. If so, the most specific binding is invoked for
* each object.
*
* Results:
@@ -1413,32 +1379,32 @@ Tk_DeleteAllBindings(bindingTable, object)
* Side effects:
* Depends on the command associated with the matching binding.
*
- * All Tcl bindings 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 procedures. 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 procedure will be called. If the
- * window itself is deleted, no further C binding procedures will be
- * called for this window. When both Tcl binding scripts and C binding
- * procedures are interleaved, the above rules still apply.
+ * All Tcl bindings 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(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
- Tk_BindingTable bindingTable; /* 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 information). */
- int numObjects; /* Number of objects at *objectPtr. */
- ClientData *objectPtr; /* Array of one or more objects
- * to check for a matching binding. */
+Tk_BindEvent(
+ Tk_BindingTable bindingTable,
+ /* 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
+ * information). */
+ int numObjects, /* Number of objects at *objectPtr. */
+ ClientData *objectPtr) /* Array of one or more objects to check for a
+ * matching binding. */
{
BindingTable *bindPtr;
TkDisplay *dispPtr;
@@ -1453,15 +1419,14 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
Tcl_DString scripts, savedResult;
Detail detail;
char *p, *end;
- PendingBinding *pendingPtr;
- PendingBinding staticPending;
- TkWindow *winPtr = (TkWindow *)tkwin;
+ 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 wrapper windows that shouldn't be visible to the
- * application.
+ * Ignore events on windows that don't have names: these are windows like
+ * wrapper windows that shouldn't be visible to the application.
*/
if (winPtr->pathName == NULL) {
@@ -1469,21 +1434,20 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
}
/*
- * Ignore the event completely if it is an Enter, Leave, FocusIn,
- * or FocusOut event with detail NotifyInferior. The reason for
- * ignoring these events is that we don't want transitions between
- * a window and its children to visible to bindings on the parent:
- * this would cause problems for mega-widgets, since the internal
- * structure of a mega-widget isn't supposed to be visible to
- * people watching the parent.
+ * Ignore the event completely if it is an Enter, Leave, FocusIn, or
+ * FocusOut event with detail NotifyInferior. The reason for ignoring
+ * these events is that we don't want transitions between a window and its
+ * children to visible to bindings on the parent: this would cause
+ * problems for mega-widgets, since the internal structure of a
+ * mega-widget isn't supposed to be visible to people watching the parent.
*/
- if ((eventPtr->type == EnterNotify) || (eventPtr->type == LeaveNotify)) {
+ if ((eventPtr->type == EnterNotify) || (eventPtr->type == LeaveNotify)) {
if (eventPtr->xcrossing.detail == NotifyInferior) {
return;
}
}
- if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
+ if ((eventPtr->type == FocusIn) || (eventPtr->type == FocusOut)) {
if (eventPtr->xfocus.detail == NotifyInferior) {
return;
}
@@ -1494,20 +1458,19 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
bindInfoPtr = (BindInfo *) winPtr->mainPtr->bindInfo;
/*
- * Add the new event to the ring of saved events for the
- * binding table. Two tricky points:
+ * Add the new event to the ring of saved events for the binding table.
+ * Two tricky points:
*
- * 1. Combine consecutive MotionNotify events. Do this by putting
- * the new event *on top* of the previous event.
+ * 1. Combine consecutive MotionNotify events. Do this by putting the new
+ * event *on top* of the previous event.
* 2. If a modifier key is held down, it auto-repeats to generate
- * continuous KeyPress and KeyRelease events. These can flush
- * the event ring so that valuable information is lost (such
- * as repeated button clicks). To handle this, check for the
- * special case of a modifier KeyPress arriving when the previous
- * two events are a KeyRelease and KeyPress of the same key.
- * If this happens, mark the most recent event (the KeyRelease)
- * invalid and put the new event on top of the event before that
- * (the KeyPress).
+ * continuous KeyPress and KeyRelease events. These can flush the event
+ * ring so that valuable information is lost (such as repeated button
+ * clicks). To handle this, check for the special case of a modifier
+ * KeyPress arriving when the previous two events are a KeyRelease and
+ * KeyPress of the same key. If this happens, mark the most recent
+ * event (the KeyRelease) invalid and put the new event on top of the
+ * event before that (the KeyPress).
*/
if ((eventPtr->type == MotionNotify)
@@ -1517,6 +1480,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
*/
} else if (eventPtr->type == KeyPress) {
int i;
+
for (i = 0; ; i++) {
if (i >= dispPtr->numModKeyCodes) {
goto advanceRingPointer;
@@ -1543,14 +1507,15 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
bindPtr->eventRing[bindPtr->curEvent].type = -1;
bindPtr->curEvent = i;
} else {
- advanceRingPointer:
+
+ advanceRingPointer:
bindPtr->curEvent++;
if (bindPtr->curEvent >= EVENT_BUFFER_SIZE) {
bindPtr->curEvent = 0;
}
}
ringPtr = &bindPtr->eventRing[bindPtr->curEvent];
- memcpy((VOID *) ringPtr, (VOID *) eventPtr, sizeof(XEvent));
+ memcpy((void *) ringPtr, (void *) eventPtr, sizeof(XEvent));
detail.clientData = 0;
flags = flagArray[ringPtr->type];
if (flags & KEY) {
@@ -1575,14 +1540,12 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
memset(&key, 0, sizeof(key));
if (ringPtr->type != VirtualEvent) {
- Tcl_HashTable *veptPtr;
+ Tcl_HashTable *veptPtr = &bindInfoPtr->virtualEventTable.patternTable;
Tcl_HashEntry *hPtr;
- veptPtr = &bindInfoPtr->virtualEventTable.patternTable;
-
- key.object = NULL;
- key.type = ringPtr->type;
- key.detail = detail;
+ key.object = NULL;
+ key.type = ringPtr->type;
+ key.detail = detail;
hPtr = Tcl_FindHashEntry(veptPtr, (char *) &key);
if (hPtr != NULL) {
@@ -1593,37 +1556,34 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
key.detail.clientData = 0;
hPtr = Tcl_FindHashEntry(veptPtr, (char *) &key);
if (hPtr != NULL) {
- vMatchNoDetailList = (PatSeq *) Tcl_GetHashValue(hPtr);
+ vMatchNoDetailList = (PatSeq *) Tcl_GetHashValue(hPtr);
}
}
}
/*
- * 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.
+ * 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.
*/
-
+
pendingPtr = &staticPending;
matchCount = 0;
matchSpace = sizeof(staticPending.matchArray) / sizeof(PatSeq *);
Tcl_DStringInit(&scripts);
for ( ; numObjects > 0; numObjects--, objectPtr++) {
- PatSeq *matchPtr, *sourcePtr;
+ PatSeq *matchPtr = NULL, *sourcePtr = NULL;
Tcl_HashEntry *hPtr;
- matchPtr = NULL;
- sourcePtr = NULL;
-
/*
* Match the new event against those recorded in the pattern table,
- * saving the longest matching pattern. For events with details
- * (button and key events), look for a binding for the specific
- * key or button. First see if the event matches a physical event
- * that the object is interested in, then look for a virtual event.
+ * saving the longest matching pattern. For events with details
+ * (button and key events), look for a binding for the specific key or
+ * button. First see if the event matches a physical event that the
+ * object is interested in, then look for a virtual event.
*/
key.object = *objectPtr;
@@ -1631,7 +1591,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
key.detail = detail;
hPtr = Tcl_FindHashEntry(&bindPtr->patternTable, (char *) &key);
if (hPtr != NULL) {
- matchPtr = MatchPatterns(dispPtr, bindPtr,
+ matchPtr = MatchPatterns(dispPtr, bindPtr,
(PatSeq *) Tcl_GetHashValue(hPtr), matchPtr, NULL,
&sourcePtr);
}
@@ -1643,7 +1603,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
/*
* If no match was found, look for a binding for all keys or buttons
- * (detail of 0). Again, first match on a virtual event.
+ * (detail of 0). Again, first match on a virtual event.
*/
if ((detail.clientData != 0) && (matchPtr == NULL)) {
@@ -1656,24 +1616,24 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
}
if (vMatchNoDetailList != NULL) {
- matchPtr = MatchPatterns(dispPtr, bindPtr, vMatchNoDetailList,
+ matchPtr = MatchPatterns(dispPtr, bindPtr, vMatchNoDetailList,
matchPtr, objectPtr, &sourcePtr);
}
}
-
+
if (matchPtr != NULL) {
if (sourcePtr->eventProc == NULL) {
- panic("Tk_BindEvent: missing command");
+ Tcl_Panic("Tk_BindEvent: missing command");
}
if (sourcePtr->eventProc == EvalTclBinding) {
ExpandPercents(winPtr, (char *) sourcePtr->clientData,
eventPtr, detail.keySym, &scripts);
} else {
if (matchCount >= matchSpace) {
- PendingBinding *new;
+ PendingBinding *newPtr;
unsigned int oldSize, newSize;
-
+
oldSize = sizeof(staticPending)
- sizeof(staticPending.matchArray)
+ matchSpace * sizeof(PatSeq*);
@@ -1681,20 +1641,21 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
newSize = sizeof(staticPending)
- sizeof(staticPending.matchArray)
+ matchSpace * sizeof(PatSeq*);
- new = (PendingBinding *) ckalloc(newSize);
- memcpy((VOID *) new, (VOID *) pendingPtr, oldSize);
+ newPtr = (PendingBinding *) ckalloc(newSize);
+ memcpy((void *) newPtr, (void *) pendingPtr, oldSize);
if (pendingPtr != &staticPending) {
ckfree((char *) pendingPtr);
}
- pendingPtr = new;
+ pendingPtr = newPtr;
}
sourcePtr->refCount++;
pendingPtr->matchArray[matchCount] = sourcePtr;
matchCount++;
}
+
/*
- * A "" is added to the scripts string to separate the
- * various scripts that should be invoked.
+ * A "" is added to the scripts string to separate the various
+ * scripts that should be invoked.
*/
Tcl_DStringAppend(&scripts, "", 1);
@@ -1705,29 +1666,28 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
}
/*
- * Now go back through and evaluate the binding for each object,
- * in order, dealing with "break" and "continue" exceptions
- * appropriately.
+ * Now go back through and evaluate the binding for each object, in order,
+ * dealing with "break" and "continue" exceptions appropriately.
*
* There are two tricks here:
- * 1. Bindings can be invoked from in the middle of Tcl commands,
- * where the interp's result is significant (for example, a widget
- * might be deleted because of an error in creating it, so the
- * result contains an error message that is eventually going to
- * be returned by the creating command). To preserve the result,
- * we save it in a dynamic string.
- * 2. The binding's action can potentially delete the binding,
- * so bindPtr may not point to anything valid once the action
- * completes. Thus we have to save bindPtr->interp in a
- * local variable in order to restore the result.
+ * 1. Bindings can be invoked from in the middle of Tcl commands, where
+ * the interp's result is significant (for example, a widget might be
+ * deleted because of an error in creating it, so the result contains
+ * an error message that is eventually going to be returned by the
+ * creating command). To preserve the result, we save it in a dynamic
+ * string.
+ * 2. The binding's action can potentially delete the binding, so bindPtr
+ * may not point to anything valid once the action completes. Thus we
+ * have to save bindPtr->interp in a local variable in order to restore
+ * the result.
*/
interp = bindPtr->interp;
Tcl_DStringInit(&savedResult);
/*
- * Save information about the current screen, then invoke a script
- * if the screen has changed.
+ * Save information about the current screen, then invoke a script if the
+ * screen has changed.
*/
Tcl_DStringGetResult(interp, &savedResult);
@@ -1744,9 +1704,8 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
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.
+ * 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;
@@ -1754,11 +1713,11 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
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.
+ * 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;
@@ -1769,16 +1728,15 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
i = 0;
/*
- * Be carefule when dereferencing screenPtr or bindInfoPtr. If we
- * evaluate something that destroys ".", bindInfoPtr would have been
- * freed, but we can tell that by first checking to see if
- * winPtr->mainPtr == NULL.
+ * Be carefule when dereferencing screenPtr or bindInfoPtr. If we evaluate
+ * something that destroys ".", bindInfoPtr would have been freed, but we
+ * can tell that by first checking to see if winPtr->mainPtr == NULL.
*/
Tcl_Preserve((ClientData) bindInfoPtr);
while (p < end) {
int code;
-
+
if (!bindInfoPtr->deleted) {
screenPtr->bindingDepth++;
}
@@ -1786,7 +1744,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
if (*p == '\0') {
PatSeq *psPtr;
-
+
psPtr = pendingPtr->matchArray[i];
i++;
code = TCL_OK;
@@ -1804,6 +1762,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
}
} else {
int len = (int) strlen(p);
+
code = Tcl_EvalEx(interp, p, len, TCL_EVAL_GLOBAL);
p += len;
}
@@ -1815,7 +1774,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
if (code != TCL_OK) {
if (code == TCL_CONTINUE) {
/*
- * Do nothing: just go on to the next command.
+ * Do nothing: just go on to the next command.
*/
} else if (code == TCL_BREAK) {
break;
@@ -1829,13 +1788,13 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
if (matchCount > 0 && !pendingPtr->deleted) {
/*
- * Restore the original modal flag value and invoke the modal loop
- * if needed.
+ * 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);
+ winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL)
+ | (flags & TK_DEFER_MODAL);
if (deferModal) {
modalProc = Tk_GetClassProc(winPtr->classProcsPtr, modalProc);
if (modalProc != NULL) {
@@ -1846,12 +1805,10 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
if (!bindInfoPtr->deleted && (screenPtr->bindingDepth != 0)
&& ((oldDispPtr != screenPtr->curDispPtr)
- || (oldScreen != screenPtr->curScreenIndex))) {
-
+ || (oldScreen != screenPtr->curScreenIndex))) {
/*
- * Some other binding script is currently executing, but its
- * screen is no longer current. Change the current display
- * back again.
+ * Some other binding script is currently executing, but its screen is
+ * no longer current. Change the current display back again.
*/
screenPtr->curDispPtr = oldDispPtr;
@@ -1864,10 +1821,10 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
if (matchCount > 0) {
if (!bindInfoPtr->deleted) {
/*
- * Delete the pending list from the list of pending scripts
- * for this window.
+ * Delete the pending list from the list of pending scripts for
+ * this window.
*/
-
+
PendingBinding **curPtrPtr;
for (curPtrPtr = &bindInfoPtr->pendingList; ; ) {
@@ -1890,8 +1847,8 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
*
* TkBindDeadWindow --
*
- * This procedure is invoked when it is determined that a window is
- * dead. It cleans up bind-related information about the window
+ * This function is invoked when it is determined that a window is dead.
+ * It cleans up bind-related information about the window
*
* Results:
* None.
@@ -1901,20 +1858,22 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
*
*---------------------------------------------------------------------------
*/
-
+
void
-TkBindDeadWindow(winPtr)
- TkWindow *winPtr; /* The window that is being deleted. */
+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.
+ * Certain special windows like those used for send and clipboard have no
+ * mainPtr.
*/
- if (winPtr->mainPtr == NULL)
- return;
+
+ if (winPtr->mainPtr == NULL) {
+ return;
+ }
bindInfoPtr = (BindInfo *) winPtr->mainPtr->bindInfo;
curPtr = bindInfoPtr->pendingList;
@@ -1931,58 +1890,59 @@ TkBindDeadWindow(winPtr)
*
* MatchPatterns --
*
- * Given a list of pattern sequences and a list of recent events,
- * return the pattern sequence that best matches the event list,
- * if there is one.
+ * Given a list of pattern sequences and a list of recent events, return
+ * the pattern sequence that best matches the event list, if there is
+ * one.
*
- * This procedure is used in two different ways. In the simplest
- * use, "object" is NULL and psPtr is a list of pattern sequences,
- * each of which corresponds to a binding. In this case, the
- * procedure finds the pattern sequences that match the event list
- * and returns the most specific of those, if there is more than one.
+ * This function is used in two different ways. In the simplest use,
+ * "object" is NULL and psPtr is a list of pattern sequences, each of
+ * which corresponds to a binding. In this case, the function finds the
+ * pattern sequences that match the event list and returns the most
+ * specific of those, if there is more than one.
*
- * In the second case, psPtr is a list of pattern sequences, each
- * of which corresponds to a definition for a virtual binding.
- * In order for one of these sequences to "match", it must match
- * the events (as above) but in addition there must be a binding
- * for its associated virtual event on the current object. The
- * "object" argument indicates which object the binding must be for.
+ * In the second case, psPtr is a list of pattern sequences, each of
+ * which corresponds to a definition for a virtual binding. In order for
+ * one of these sequences to "match", it must match the events (as above)
+ * but in addition there must be a binding for its associated virtual
+ * event on the current object. The "object" argument indicates which
+ * object the binding must be for.
*
* Results:
- * The return value is NULL if bestPtr is NULL and no pattern matches
- * the recent events from bindPtr. Otherwise the return value is
- * the most specific pattern sequence among bestPtr and all those
- * at psPtr that match the event list and object. If a pattern
- * sequence other than bestPtr is returned, then *bestCommandPtr
- * is filled in with a pointer to the command from the best sequence.
+
+ * The return value is NULL if bestPtr is NULL and no pattern matches the
+ * recent events from bindPtr. Otherwise the return value is the most
+ * specific pattern sequence among bestPtr and all those at psPtr that
+ * match the event list and object. If a pattern sequence other than
+ * bestPtr is returned, then *bestCommandPtr is filled in with a pointer
+ * to the command from the best sequence.
*
* Side effects:
- * None.
+ * None.
*
*----------------------------------------------------------------------
*/
static PatSeq *
-MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
- TkDisplay *dispPtr; /* Display from which the event came. */
- BindingTable *bindPtr; /* Information about binding table, such as
+MatchPatterns(
+ TkDisplay *dispPtr, /* Display from which the event came. */
+ BindingTable *bindPtr, /* Information about binding table, such as
* ring of recent events. */
- PatSeq *psPtr; /* List of pattern sequences. */
- PatSeq *bestPtr; /* The best match seen so far, from a
- * previous call to this procedure. NULL
- * means no prior best match. */
- ClientData *objectPtr; /* If NULL, the sequences at psPtr
- * correspond to "normal" bindings. If
- * non-NULL, the sequences at psPtr correspond
- * to virtual bindings; in order to match each
- * sequence must correspond to a virtual
- * binding for which a binding exists for
- * object in bindPtr. */
- PatSeq **sourcePtrPtr; /* Filled with the pattern sequence that
+ PatSeq *psPtr, /* List of pattern sequences. */
+ PatSeq *bestPtr, /* The best match seen so far, from a previous
+ * call to this function. NULL means no prior
+ * best match. */
+ ClientData *objectPtr, /* If NULL, the sequences at psPtr correspond
+ * to "normal" bindings. If non-NULL, the
+ * sequences at psPtr correspond to virtual
+ * bindings; in order to match each sequence
+ * must correspond to a virtual binding for
+ * which a binding exists for object in
+ * bindPtr. */
+ PatSeq **sourcePtrPtr) /* Filled with the pattern sequence that
* contains the eventProc and clientData
- * associated with the best match. If this
+ * associated with the best match. If this
* differs from the return value, it is the
* virtual event that most closely matched the
- * return value (a physical event). Not
+ * return value (a physical event). Not
* modified unless a result other than bestPtr
* is returned. */
{
@@ -1995,22 +1955,17 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
*/
for ( ; psPtr != NULL; psPtr = psPtr->nextSeqPtr) {
- XEvent *eventPtr;
- Pattern *patPtr;
- Window window;
- Detail *detailPtr;
- int patCount, ringCount, flags, state;
- int modMask;
+ XEvent *eventPtr = &bindPtr->eventRing[bindPtr->curEvent];
+ Detail *detailPtr = &bindPtr->detailRing[bindPtr->curEvent];
+ Pattern *patPtr = psPtr->pats;
+ Window window = eventPtr->xany.window;
+ int patCount, ringCount, flags, state, modMask, i;
/*
- * Iterate over all the patterns in a sequence to be
- * sure that they all match.
+ * Iterate over all the patterns in a sequence to be sure that they
+ * all match.
*/
- eventPtr = &bindPtr->eventRing[bindPtr->curEvent];
- detailPtr = &bindPtr->detailRing[bindPtr->curEvent];
- window = eventPtr->xany.window;
- patPtr = psPtr->pats;
patCount = psPtr->numPats;
ringCount = EVENT_BUFFER_SIZE;
while (patCount > 0) {
@@ -2019,21 +1974,21 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
}
if (eventPtr->xany.type != patPtr->eventType) {
/*
- * Most of the event types are considered superfluous
- * in that they are ignored if they occur in the middle
- * of a pattern sequence and have mismatching types. The
- * only ones that cannot be ignored are ButtonPress and
- * ButtonRelease events (if the next event in the pattern
- * is a KeyPress or KeyRelease) and KeyPress and KeyRelease
- * events (if the next pattern event is a ButtonPress or
- * ButtonRelease). Here are some tricky cases to consider:
+ * Most of the event types are considered superfluous in that
+ * they are ignored if they occur in the middle of a pattern
+ * sequence and have mismatching types. The only ones that
+ * cannot be ignored are ButtonPress and ButtonRelease events
+ * (if the next event in the pattern is a KeyPress or
+ * KeyRelease) and KeyPress and KeyRelease events (if the next
+ * pattern event is a ButtonPress or ButtonRelease). Here are
+ * some tricky cases to consider:
* 1. Double-Button or Double-Key events.
* 2. Double-ButtonRelease or Double-KeyRelease events.
- * 3. The arrival of various events like Enter and Leave
- * and FocusIn and GraphicsExpose between two button
- * presses or key presses.
- * 4. Modifier keys like Shift and Control shouldn't
- * generate conflicts with button events.
+ * 3. The arrival of various events like Enter and Leave and
+ * FocusIn and GraphicsExpose between two button presses or
+ * key presses.
+ * 4. Modifier keys like Shift and Control shouldn't generate
+ * conflicts with button events.
*/
if ((patPtr->eventType == KeyPress)
@@ -2046,8 +2001,6 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
|| (patPtr->eventType == ButtonRelease)) {
if ((eventPtr->xany.type == KeyPress)
|| (eventPtr->xany.type == KeyRelease)) {
- int i;
-
/*
* Ignore key events if they are modifier keys.
*/
@@ -2058,6 +2011,7 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
/*
* This key is a modifier key, so ignore it.
*/
+
goto nextEvent;
}
}
@@ -2067,32 +2021,28 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
goto nextEvent;
}
if (eventPtr->xany.type == CreateNotify
- && eventPtr->xcreatewindow.parent != window) {
+ && eventPtr->xcreatewindow.parent != window) {
goto nextSequence;
- } else
- if (eventPtr->xany.window != window) {
+ } else if (eventPtr->xany.window != window) {
goto nextSequence;
}
/*
- * Note: it's important for the keysym check to go before
- * the modifier check, so we can ignore unwanted modifier
- * keys before choking on the modifier check.
+ * Note: it's important for the keysym check to go before the
+ * modifier check, so we can ignore unwanted modifier keys before
+ * choking on the modifier check.
*/
if ((patPtr->detail.clientData != 0)
&& (patPtr->detail.clientData != detailPtr->clientData)) {
/*
- * The detail appears not to match. However, if the event
- * is a KeyPress for a modifier key then just ignore the
- * event. Otherwise event sequences like "aD" never match
- * because the shift key goes down between the "a" and the
- * "D".
+ * The detail appears not to match. However, if the event is a
+ * KeyPress for a modifier key then just ignore the event.
+ * Otherwise event sequences like "aD" never match because the
+ * shift key goes down between the "a" and the "D".
*/
if (eventPtr->xany.type == KeyPress) {
- int i;
-
for (i = 0; i < dispPtr->numModKeyCodes; i++) {
if (dispPtr->modKeyCodes[i] == eventPtr->xkey.keycode) {
goto nextEvent;
@@ -2102,7 +2052,7 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
goto nextSequence;
}
flags = flagArray[eventPtr->type];
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
state = eventPtr->xkey.state;
} else if (flags & CROSSING) {
state = eventPtr->xcrossing.state;
@@ -2130,10 +2080,9 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
}
}
if (psPtr->flags & PAT_NEARBY) {
- XEvent *firstPtr;
+ XEvent *firstPtr = &bindPtr->eventRing[bindPtr->curEvent];
int timeDiff;
- firstPtr = &bindPtr->eventRing[bindPtr->curEvent];
timeDiff = (Time) firstPtr->xkey.time - eventPtr->xkey.time;
if ((firstPtr->xkey.x_root
< (eventPtr->xkey.x_root - NEARBY_PIXELS))
@@ -2149,7 +2098,7 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
}
patPtr++;
patCount--;
- nextEvent:
+ nextEvent:
if (eventPtr == bindPtr->eventRing) {
eventPtr = &bindPtr->eventRing[EVENT_BUFFER_SIZE-1];
detailPtr = &bindPtr->detailRing[EVENT_BUFFER_SIZE-1];
@@ -2169,9 +2118,9 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
PatternTableKey key;
/*
- * The sequence matches the physical constraints.
- * Is this object interested in any of the virtual events
- * that correspond to this sequence?
+ * The sequence matches the physical constraints. Is this object
+ * interested in any of the virtual events that correspond to this
+ * sequence?
*/
voPtr = psPtr->voPtr;
@@ -2182,26 +2131,24 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
key.detail.clientData = 0;
for (iVirt = 0; iVirt < voPtr->numOwners; iVirt++) {
- Tcl_HashEntry *hPtr = voPtr->owners[iVirt];
+ Tcl_HashEntry *hPtr = voPtr->owners[iVirt];
- key.detail.name = (Tk_Uid) Tcl_GetHashKey(hPtr->tablePtr,
+ key.detail.name = (Tk_Uid) Tcl_GetHashKey(hPtr->tablePtr,
hPtr);
hPtr = Tcl_FindHashEntry(&bindPtr->patternTable,
(char *) &key);
if (hPtr != NULL) {
-
/*
* This tag is interested in this virtual event and its
* corresponding physical event is a good match with the
* virtual event's definition.
*/
- PatSeq *virtMatchPtr;
+ PatSeq *virtMatchPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
- virtMatchPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
if ((virtMatchPtr->numPats != 1)
|| (virtMatchPtr->nextSeqPtr != NULL)) {
- panic("MatchPattern: badly constructed virtual event");
+ Tcl_Panic("MatchPattern: badly constructed virtual event");
}
sourcePtr = virtMatchPtr;
goto match;
@@ -2212,19 +2159,19 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
* The physical event matches a virtual event's definition, but
* the tag isn't interested in it.
*/
+
goto nextSequence;
}
- match:
+ match:
/*
- * This sequence matches. If we've already got another match,
- * pick whichever is most specific. Detail is most important,
- * then needMods.
+ * This sequence matches. If we've already got another match, pick
+ * whichever is most specific. Detail is most important, then
+ * needMods.
*/
if (bestPtr != NULL) {
Pattern *patPtr2;
- int i;
if (matchPtr->numPats != bestPtr->numPats) {
if (bestPtr->numPats > matchPtr->numPats) {
@@ -2252,51 +2199,49 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
}
}
}
+
/*
* Tie goes to current best pattern.
*
- * (1) For virtual vs. virtual, the least recently defined
- * virtual wins, because virtuals are examined in order of
- * definition. This order is _not_ guaranteed in the
- * documentation.
+ * (1) For virtual vs. virtual, the least recently defined virtual
+ * wins, because virtuals are examined in order of definition.
+ * This order is _not_ guaranteed in the documentation.
*
- * (2) For virtual vs. physical, the physical wins because all
- * the physicals are examined before the virtuals. This order
- * is guaranteed in the documentation.
+ * (2) For virtual vs. physical, the physical wins because all the
+ * physicals are examined before the virtuals. This order is
+ * guaranteed in the documentation.
*
* (3) For physical vs. physical pattern, the most recently
* defined physical wins, because physicals are examined in
- * reverse order of definition. This order is guaranteed in
- * the documentation.
+ * reverse order of definition. This order is guaranteed in the
+ * documentation.
*/
- goto nextSequence;
+ goto nextSequence;
}
- newBest:
+ newBest:
bestPtr = matchPtr;
bestSourcePtr = sourcePtr;
- nextSequence:
+ nextSequence:
continue;
}
*sourcePtrPtr = bestSourcePtr;
return bestPtr;
}
-
/*
*--------------------------------------------------------------
*
* ExpandPercents --
*
- * Given a command and an event, produce a new command
- * by replacing % constructs in the original command
- * with information from the X event.
+ * Given a command and an event, produce a new command by replacing %
+ * constructs in the original command with information from the X event.
*
* Results:
- * The new expanded command is appended to the dynamic string
- * given by dsPtr.
+ * The new expanded command is appended to the dynamic string given by
+ * dsPtr.
*
* Side effects:
* None.
@@ -2305,23 +2250,23 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
*/
static void
-ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
- TkWindow *winPtr; /* Window where event occurred: needed to
- * get input context. */
- CONST char *before; /* Command containing percent expressions
- * to be replaced. */
- XEvent *eventPtr; /* X event containing information to be
- * used in % replacements. */
- KeySym keySym; /* KeySym: only relevant for KeyPress and
+ExpandPercents(
+ TkWindow *winPtr, /* Window where event occurred: needed to get
+ * input context. */
+ const char *before, /* Command containing percent expressions to
+ * be replaced. */
+ XEvent *eventPtr, /* X event containing information to be used
+ * in % replacements. */
+ KeySym keySym, /* KeySym: only relevant for KeyPress and
* KeyRelease events). */
- Tcl_DString *dsPtr; /* Dynamic string in which to append new
+ Tcl_DString *dsPtr) /* Dynamic string in which to append new
* command. */
{
int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl
* list element. */
int number, flags, length;
#define NUM_SIZE 40
- CONST char *string;
+ const char *string;
Tcl_DString buf;
char numStorage[NUM_SIZE+1];
@@ -2332,10 +2277,11 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
} else {
flags = 0;
}
+
while (1) {
/*
- * Find everything up to the next % character and append it
- * to the result string.
+ * Find everything up to the next % character and append it to the
+ * result string.
*/
for (string = before; (*string != 0) && (*string != '%'); string++) {
@@ -2350,323 +2296,333 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
}
/*
- * There's a percent sequence here. Process it.
+ * There's a percent sequence here. Process it.
*/
number = 0;
string = "??";
switch (before[1]) {
- case '#':
- number = eventPtr->xany.serial;
- goto doNumber;
- case 'a':
- if (flags & CONFIG) {
- TkpPrintWindowId(numStorage, eventPtr->xconfigure.above);
- string = numStorage;
- }
- goto doString;
- case 'b':
- if (flags & BUTTON) {
- number = eventPtr->xbutton.button;
- goto doNumber;
- }
- goto doString;
- case 'c':
- if (flags & EXPOSE) {
- number = eventPtr->xexpose.count;
- goto doNumber;
- }
- goto doString;
- case 'd':
- if (flags & (CROSSING|FOCUS)) {
- if (flags & FOCUS) {
- number = eventPtr->xfocus.detail;
- } else {
- number = eventPtr->xcrossing.detail;
- }
- string = TkFindStateString(notifyDetail, number);
- } else if (flags & CONFIGREQ) {
- if (eventPtr->xconfigurerequest.value_mask & CWStackMode) {
- string = TkFindStateString(configureRequestDetail,
- eventPtr->xconfigurerequest.detail);
- } else {
- string = "";
- }
- }
- goto doString;
- case 'f':
- if (flags & CROSSING) {
- number = eventPtr->xcrossing.focus;
- goto doNumber;
- }
- goto doString;
- case 'h':
- if (flags & EXPOSE) {
- number = eventPtr->xexpose.height;
- } else if (flags & (CONFIG)) {
- number = eventPtr->xconfigure.height;
- } else if (flags & CREATE) {
- number = eventPtr->xcreatewindow.height;
- } else if (flags & CONFIGREQ) {
- number = eventPtr->xconfigurerequest.height;
- } else if (flags & RESIZEREQ) {
- number = eventPtr->xresizerequest.height;
- } else {
- goto doString;
- }
- goto doNumber;
- case 'i':
- if (flags & CREATE) {
- TkpPrintWindowId(numStorage, eventPtr->xcreatewindow.window);
- } else if (flags & CONFIGREQ) {
- TkpPrintWindowId(numStorage, eventPtr->xconfigurerequest.window);
- } else if (flags & MAPREQ) {
- TkpPrintWindowId(numStorage, eventPtr->xmaprequest.window);
- } else {
- TkpPrintWindowId(numStorage, eventPtr->xany.window);
- }
+ case '#':
+ number = eventPtr->xany.serial;
+ goto doNumber;
+ case 'a':
+ if (flags & CONFIG) {
+ TkpPrintWindowId(numStorage, eventPtr->xconfigure.above);
string = numStorage;
- goto doString;
- case 'k':
- if (flags & KEY) {
- number = eventPtr->xkey.keycode;
- goto doNumber;
- }
- goto doString;
- case 'm':
- if (flags & CROSSING) {
- number = eventPtr->xcrossing.mode;
- string = TkFindStateString(notifyMode, number);
- } else if (flags & FOCUS) {
- number = eventPtr->xfocus.mode;
- string = TkFindStateString(notifyMode, number);
- }
- goto doString;
- case 'o':
- if (flags & CREATE) {
- number = eventPtr->xcreatewindow.override_redirect;
- } else if (flags & MAP) {
- number = eventPtr->xmap.override_redirect;
- } else if (flags & REPARENT) {
- number = eventPtr->xreparent.override_redirect;
- } else if (flags & CONFIG) {
- number = eventPtr->xconfigure.override_redirect;
- } else {
- goto doString;
- }
- goto doNumber;
- case 'p':
- if (flags & CIRC) {
- string = TkFindStateString(circPlace, eventPtr->xcirculate.place);
- } else if (flags & CIRCREQ) {
- string = TkFindStateString(circPlace, eventPtr->xcirculaterequest.place);
- }
- goto doString;
- case 's':
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- number = eventPtr->xkey.state;
- } else if (flags & CROSSING) {
- number = eventPtr->xcrossing.state;
- } else if (flags & PROP) {
- string = TkFindStateString(propNotify,
- eventPtr->xproperty.state);
- goto doString;
- } else if (flags & VISIBILITY) {
- string = TkFindStateString(visNotify,
- eventPtr->xvisibility.state);
- goto doString;
- } else {
- goto doString;
- }
- goto doNumber;
- case 't':
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- number = (int) eventPtr->xkey.time;
- } else if (flags & CROSSING) {
- number = (int) eventPtr->xcrossing.time;
- } else if (flags & PROP) {
- number = (int) eventPtr->xproperty.time;
- } else {
- goto doString;
- }
+ }
+ goto doString;
+ case 'b':
+ if (flags & BUTTON) {
+ number = eventPtr->xbutton.button;
goto doNumber;
- case 'v':
- number = eventPtr->xconfigurerequest.value_mask;
+ }
+ goto doString;
+ case 'c':
+ if (flags & EXPOSE) {
+ number = eventPtr->xexpose.count;
goto doNumber;
- case 'w':
- if (flags & EXPOSE) {
- number = eventPtr->xexpose.width;
- } else if (flags & CONFIG) {
- number = eventPtr->xconfigure.width;
- } else if (flags & CREATE) {
- number = eventPtr->xcreatewindow.width;
- } else if (flags & CONFIGREQ) {
- number = eventPtr->xconfigurerequest.width;
- } else if (flags & RESIZEREQ) {
- number = eventPtr->xresizerequest.width;
+ }
+ goto doString;
+ case 'd':
+ if (flags & (CROSSING|FOCUS)) {
+ if (flags & FOCUS) {
+ number = eventPtr->xfocus.detail;
} else {
- goto doString;
+ number = eventPtr->xcrossing.detail;
}
- goto doNumber;
- case 'x':
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- number = eventPtr->xkey.x;
- } else if (flags & CROSSING) {
- number = eventPtr->xcrossing.x;
- } else if (flags & EXPOSE) {
- number = eventPtr->xexpose.x;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- number = eventPtr->xcreatewindow.x;
- } else if (flags & REPARENT) {
- number = eventPtr->xreparent.x;
- } else if (flags & CREATE) {
- number = eventPtr->xcreatewindow.x;
- } else if (flags & CONFIGREQ) {
- number = eventPtr->xconfigurerequest.x;
+ string = TkFindStateString(notifyDetail, number);
+ } else if (flags & CONFIGREQ) {
+ if (eventPtr->xconfigurerequest.value_mask & CWStackMode) {
+ string = TkFindStateString(configureRequestDetail,
+ eventPtr->xconfigurerequest.detail);
} else {
- goto doString;
+ string = "";
}
- goto doNumber;
- case 'y':
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- number = eventPtr->xkey.y;
- } else if (flags & EXPOSE) {
- number = eventPtr->xexpose.y;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- number = eventPtr->xcreatewindow.y;
- } else if (flags & REPARENT) {
- number = eventPtr->xreparent.y;
- } else if (flags & CROSSING) {
- number = eventPtr->xcrossing.y;
- } else if (flags & CREATE) {
- number = eventPtr->xcreatewindow.y;
- } else if (flags & CONFIGREQ) {
- number = eventPtr->xconfigurerequest.y;
+ } else if (flags & VIRTUAL) {
+ XVirtualEvent *vePtr = (XVirtualEvent *) eventPtr;
+
+ if (vePtr->user_data != NULL) {
+ string = Tcl_GetString(vePtr->user_data);
} else {
- goto doString;
+ string = "";
}
+ }
+ goto doString;
+ case 'f':
+ if (flags & CROSSING) {
+ number = eventPtr->xcrossing.focus;
goto doNumber;
- case 'A':
- if (flags & KEY) {
- Tcl_DStringFree(&buf);
- string = TkpGetString(winPtr, eventPtr, &buf);
- }
+ }
+ goto doString;
+ case 'h':
+ if (flags & EXPOSE) {
+ number = eventPtr->xexpose.height;
+ } else if (flags & CONFIG) {
+ number = eventPtr->xconfigure.height;
+ } else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.height;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.height;
+ } else if (flags & RESIZEREQ) {
+ number = eventPtr->xresizerequest.height;
+ } else {
goto doString;
- case 'B':
- if (flags & CREATE) {
- number = eventPtr->xcreatewindow.border_width;
- } else if (flags & CONFIGREQ) {
- number = eventPtr->xconfigurerequest.border_width;
- } else if (flags & CONFIG) {
- number = eventPtr->xconfigure.border_width;
- } else {
- goto doString;
- }
+ }
+ goto doNumber;
+ case 'i':
+ if (flags & CREATE) {
+ TkpPrintWindowId(numStorage, eventPtr->xcreatewindow.window);
+ } else if (flags & CONFIGREQ) {
+ TkpPrintWindowId(numStorage,
+ eventPtr->xconfigurerequest.window);
+ } else if (flags & MAPREQ) {
+ TkpPrintWindowId(numStorage, eventPtr->xmaprequest.window);
+ } else {
+ TkpPrintWindowId(numStorage, eventPtr->xany.window);
+ }
+ string = numStorage;
+ goto doString;
+ case 'k':
+ if (flags & KEY) {
+ number = eventPtr->xkey.keycode;
goto doNumber;
- case 'D':
- /*
- * This is used only by the MouseWheel event.
- */
- if (flags & KEY) {
- number = eventPtr->xkey.keycode;
- goto doNumber;
- }
+ }
+ goto doString;
+ case 'm':
+ if (flags & CROSSING) {
+ number = eventPtr->xcrossing.mode;
+ string = TkFindStateString(notifyMode, number);
+ } else if (flags & FOCUS) {
+ number = eventPtr->xfocus.mode;
+ string = TkFindStateString(notifyMode, number);
+ }
+ goto doString;
+ case 'o':
+ if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.override_redirect;
+ } else if (flags & MAP) {
+ number = eventPtr->xmap.override_redirect;
+ } else if (flags & REPARENT) {
+ number = eventPtr->xreparent.override_redirect;
+ } else if (flags & CONFIG) {
+ number = eventPtr->xconfigure.override_redirect;
+ } else {
goto doString;
- case 'E':
- number = (int) eventPtr->xany.send_event;
+ }
+ goto doNumber;
+ case 'p':
+ if (flags & CIRC) {
+ string = TkFindStateString(circPlace,
+ eventPtr->xcirculate.place);
+ } else if (flags & CIRCREQ) {
+ string = TkFindStateString(circPlace,
+ eventPtr->xcirculaterequest.place);
+ }
+ goto doString;
+ case 's':
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ number = eventPtr->xkey.state;
goto doNumber;
- case 'K':
- if (flags & KEY) {
- char *name;
-
- name = TkKeysymToString(keySym);
- if (name != NULL) {
- string = name;
- }
- }
+ } else if (flags & CROSSING) {
+ number = eventPtr->xcrossing.state;
+ goto doNumber;
+ } else if (flags & PROP) {
+ string = TkFindStateString(propNotify,
+ eventPtr->xproperty.state);
+ } else if (flags & VISIBILITY) {
+ string = TkFindStateString(visNotify,
+ eventPtr->xvisibility.state);
+ }
+ goto doString;
+ case 't':
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ number = (int) eventPtr->xkey.time;
+ } else if (flags & CROSSING) {
+ number = (int) eventPtr->xcrossing.time;
+ } else if (flags & PROP) {
+ number = (int) eventPtr->xproperty.time;
+ } else {
goto doString;
- case 'N':
- if (flags & KEY) {
- number = (int) keySym;
- goto doNumber;
- }
+ }
+ goto doNumber;
+ case 'v':
+ number = eventPtr->xconfigurerequest.value_mask;
+ goto doNumber;
+ case 'w':
+ if (flags & EXPOSE) {
+ number = eventPtr->xexpose.width;
+ } else if (flags & CONFIG) {
+ number = eventPtr->xconfigure.width;
+ } else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.width;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.width;
+ } else if (flags & RESIZEREQ) {
+ number = eventPtr->xresizerequest.width;
+ } else {
goto doString;
- case 'P':
- if (flags & PROP) {
- string = Tk_GetAtomName((Tk_Window) winPtr, eventPtr->xproperty.atom);
- }
+ }
+ goto doNumber;
+ case 'x':
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ number = eventPtr->xkey.x;
+ } else if (flags & CROSSING) {
+ number = eventPtr->xcrossing.x;
+ } else if (flags & EXPOSE) {
+ number = eventPtr->xexpose.x;
+ } else if (flags & (CREATE|CONFIG|GRAVITY)) {
+ number = eventPtr->xcreatewindow.x;
+ } else if (flags & REPARENT) {
+ number = eventPtr->xreparent.x;
+ } else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.x;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.x;
+ } else {
goto doString;
- case 'R':
- if (flags & KEY_BUTTON_MOTION_CROSSING) {
- TkpPrintWindowId(numStorage, eventPtr->xkey.root);
- string = numStorage;
- }
+ }
+ goto doNumber;
+ case 'y':
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ number = eventPtr->xkey.y;
+ } else if (flags & EXPOSE) {
+ number = eventPtr->xexpose.y;
+ } else if (flags & (CREATE|CONFIG|GRAVITY)) {
+ number = eventPtr->xcreatewindow.y;
+ } else if (flags & REPARENT) {
+ number = eventPtr->xreparent.y;
+ } else if (flags & CROSSING) {
+ number = eventPtr->xcrossing.y;
+ } else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.y;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.y;
+ } else {
goto doString;
- case 'S':
- if (flags & KEY_BUTTON_MOTION_CROSSING) {
- TkpPrintWindowId(numStorage, eventPtr->xkey.subwindow);
- string = numStorage;
- }
+ }
+ goto doNumber;
+ case 'A':
+ if (flags & KEY) {
+ Tcl_DStringFree(&buf);
+ string = TkpGetString(winPtr, eventPtr, &buf);
+ }
+ goto doString;
+ case 'B':
+ if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.border_width;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.border_width;
+ } else if (flags & CONFIG) {
+ number = eventPtr->xconfigure.border_width;
+ } else {
goto doString;
- case 'T':
- number = eventPtr->type;
+ }
+ goto doNumber;
+ case 'D':
+ /*
+ * This is used only by the MouseWheel event.
+ */
+
+ if (flags & KEY) {
+ number = eventPtr->xkey.keycode;
goto doNumber;
- case 'W': {
+ }
+ goto doString;
+ case 'E':
+ number = (int) eventPtr->xany.send_event;
+ goto doNumber;
+ case 'K':
+ if (flags & KEY) {
+ char *name = TkKeysymToString(keySym);
+
+ if (name != NULL) {
+ string = name;
+ }
+ }
+ goto doString;
+ case 'N':
+ if (flags & KEY) {
+ number = (int) keySym;
+ goto doNumber;
+ }
+ goto doString;
+ case 'P':
+ if (flags & PROP) {
+ string = Tk_GetAtomName((Tk_Window) winPtr,
+ eventPtr->xproperty.atom);
+ }
+ goto doString;
+ case 'R':
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ TkpPrintWindowId(numStorage, eventPtr->xkey.root);
+ string = numStorage;
+ }
+ goto doString;
+ case 'S':
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ TkpPrintWindowId(numStorage, eventPtr->xkey.subwindow);
+ string = numStorage;
+ }
+ goto doString;
+ case 'T':
+ number = eventPtr->type;
+ goto doNumber;
+ case 'W': {
+ Tk_Window tkwin;
+
+ tkwin = Tk_IdToWindow(eventPtr->xany.display,
+ eventPtr->xany.window);
+ if (tkwin != NULL) {
+ string = Tk_PathName(tkwin);
+ } else {
+ string = "??";
+ }
+ goto doString;
+ }
+ case 'X':
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
Tk_Window tkwin;
+ int x, y;
+ int width, height;
+ number = eventPtr->xkey.x_root;
tkwin = Tk_IdToWindow(eventPtr->xany.display,
eventPtr->xany.window);
if (tkwin != NULL) {
- string = Tk_PathName(tkwin);
- } else {
- string = "??";
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ number -= x;
}
- goto doString;
+ goto doNumber;
}
- case 'X':
- if (flags & KEY_BUTTON_MOTION_CROSSING) {
- Tk_Window tkwin;
- int x, y;
- int width, height;
-
- number = eventPtr->xkey.x_root;
- tkwin = Tk_IdToWindow(eventPtr->xany.display,
- eventPtr->xany.window);
- if (tkwin != NULL) {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- number -= x;
- }
- goto doNumber;
- }
- goto doString;
- case 'Y':
- if (flags & KEY_BUTTON_MOTION_CROSSING) {
- Tk_Window tkwin;
- int x, y;
- int width, height;
-
- number = eventPtr->xkey.y_root;
- tkwin = Tk_IdToWindow(eventPtr->xany.display,
- eventPtr->xany.window);
- if (tkwin != NULL) {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- number -= y;
- }
- goto doNumber;
+ goto doString;
+ case 'Y':
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ Tk_Window tkwin;
+ int x, y;
+ int width, height;
+
+ number = eventPtr->xkey.y_root;
+ tkwin = Tk_IdToWindow(eventPtr->xany.display,
+ eventPtr->xany.window);
+ if (tkwin != NULL) {
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ number -= y;
}
- goto doString;
- default:
- numStorage[0] = before[1];
- numStorage[1] = '\0';
- string = numStorage;
- goto doString;
+ goto doNumber;
+ }
+ goto doString;
+ default:
+ numStorage[0] = before[1];
+ numStorage[1] = '\0';
+ string = numStorage;
+ goto doString;
}
- doNumber:
+ doNumber:
sprintf(numStorage, "%d", number);
string = numStorage;
- doString:
+ doString:
spaceNeeded = Tcl_ScanElement(string, &cvtFlags);
length = Tcl_DStringLength(dsPtr);
Tcl_DStringSetLength(dsPtr, length + spaceNeeded);
@@ -2684,28 +2640,27 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
*
* ChangeScreen --
*
- * This procedure is invoked whenever the current screen changes
- * in an application. It invokes a Tcl procedure named
- * "tk::ScreenChanged", passing it the screen name as argument.
- * tk::ScreenChanged does things like making the tk::Priv variable
- * point to an array for the current display.
+ * This function is invoked whenever the current screen changes in an
+ * application. It invokes a Tcl command named "tk::ScreenChanged",
+ * passing it the screen name as argument. tk::ScreenChanged does things
+ * like making the tk::Priv variable point to an array for the current
+ * display.
*
* Results:
* None.
*
* Side effects:
- * Depends on what tk::ScreenChanged does. If an error occurs
- * them bgerror will be invoked.
+ * Depends on what tk::ScreenChanged does. If an error occurs then
+ * bgerror will be invoked.
*
*----------------------------------------------------------------------
*/
static void
-ChangeScreen(interp, dispName, screenIndex)
- Tcl_Interp *interp; /* Interpreter in which to invoke
- * command. */
- char *dispName; /* Name of new display. */
- int screenIndex; /* Index of new screen. */
+ChangeScreen(
+ Tcl_Interp *interp, /* Interpreter in which to invoke command. */
+ char *dispName, /* Name of new display. */
+ int screenIndex) /* Index of new screen. */
{
Tcl_DString cmd;
int code;
@@ -2718,21 +2673,21 @@ ChangeScreen(interp, dispName, screenIndex)
Tcl_DStringAppend(&cmd, screen, -1);
code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd),
TCL_EVAL_GLOBAL);
+ Tcl_DStringFree(&cmd);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (changing screen in event binding)");
Tcl_BackgroundError(interp);
}
}
-
/*
*----------------------------------------------------------------------
*
* Tk_EventCmd --
*
- * This procedure is invoked to process the "event" Tcl command.
- * It is used to define and generate events.
+ * This function is invoked to process the "event" Tcl command. It is
+ * used to define and generate events.
*
* Results:
* A standard Tcl result.
@@ -2744,17 +2699,17 @@ ChangeScreen(interp, dispName, screenIndex)
*/
int
-Tk_EventObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_EventObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int index;
Tk_Window tkwin;
VirtualEventTable *vetPtr;
TkBindInfo bindInfo;
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"add", "delete", "generate", "info",
NULL
};
@@ -2776,64 +2731,61 @@ Tk_EventObjCmd(clientData, interp, objc, objv)
}
switch ((enum options) index) {
- case EVENT_ADD: {
- int i;
- char *name, *event;
-
- if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "virtual sequence ?sequence ...?");
- return TCL_ERROR;
- }
- name = Tcl_GetStringFromObj(objv[2], NULL);
- for (i = 3; i < objc; i++) {
- event = Tcl_GetStringFromObj(objv[i], NULL);
- if (CreateVirtualEvent(interp, vetPtr, name, event) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- break;
+ case EVENT_ADD: {
+ int i;
+ char *name, *event;
+
+ if (objc < 4) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "virtual sequence ?sequence ...?");
+ return TCL_ERROR;
}
- case EVENT_DELETE: {
- int i;
- char *name, *event;
-
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "virtual ?sequence sequence ...?");
+ name = Tcl_GetString(objv[2]);
+ for (i = 3; i < objc; i++) {
+ event = Tcl_GetString(objv[i]);
+ if (CreateVirtualEvent(interp, vetPtr, name, event) != TCL_OK) {
return TCL_ERROR;
}
- name = Tcl_GetStringFromObj(objv[2], NULL);
- if (objc == 3) {
- return DeleteVirtualEvent(interp, vetPtr, name, NULL);
- }
- for (i = 3; i < objc; i++) {
- event = Tcl_GetStringFromObj(objv[i], NULL);
- if (DeleteVirtualEvent(interp, vetPtr, name, event) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- break;
}
- case EVENT_GENERATE: {
- if (objc < 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "window event ?options?");
- return TCL_ERROR;
- }
- return HandleEventGenerate(interp, tkwin, objc - 2, objv + 2);
+ break;
+ }
+ case EVENT_DELETE: {
+ int i;
+ char *name, *event;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "virtual ?sequence sequence ...?");
+ return TCL_ERROR;
}
- case EVENT_INFO: {
- if (objc == 2) {
- GetAllVirtualEvents(interp, vetPtr);
- return TCL_OK;
- } else if (objc == 3) {
- return GetVirtualEvent(interp, vetPtr,
- Tcl_GetStringFromObj(objv[2], NULL));
- } else {
- Tcl_WrongNumArgs(interp, 2, objv, "?virtual?");
+ name = Tcl_GetString(objv[2]);
+ if (objc == 3) {
+ return DeleteVirtualEvent(interp, vetPtr, name, NULL);
+ }
+ for (i = 3; i < objc; i++) {
+ event = Tcl_GetString(objv[i]);
+ if (DeleteVirtualEvent(interp, vetPtr, name, event) != TCL_OK) {
return TCL_ERROR;
}
}
+ break;
+ }
+ case EVENT_GENERATE:
+ if (objc < 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window event ?options?");
+ return TCL_ERROR;
+ }
+ return HandleEventGenerate(interp, tkwin, objc - 2, objv + 2);
+ case EVENT_INFO:
+ if (objc == 2) {
+ GetAllVirtualEvents(interp, vetPtr);
+ return TCL_OK;
+ } else if (objc == 3) {
+ return GetVirtualEvent(interp, vetPtr, Tcl_GetString(objv[2]));
+ } else {
+ Tcl_WrongNumArgs(interp, 2, objv, "?virtual?");
+ return TCL_ERROR;
+ }
}
return TCL_OK;
}
@@ -2843,8 +2795,8 @@ Tk_EventObjCmd(clientData, interp, objc, objv)
*
* InitVirtualEventTable --
*
- * Given storage for a virtual event table, set up the fields to
- * prepare a new domain in which virtual events may be defined.
+ * Given storage for a virtual event table, set up the fields to prepare
+ * a new domain in which virtual events may be defined.
*
* Results:
* None.
@@ -2856,9 +2808,9 @@ Tk_EventObjCmd(clientData, interp, objc, objv)
*/
static void
-InitVirtualEventTable(vetPtr)
- VirtualEventTable *vetPtr; /* Pointer to virtual event table. Memory
- * is supplied by the caller. */
+InitVirtualEventTable(
+ VirtualEventTable *vetPtr) /* Pointer to virtual event table. Memory is
+ * supplied by the caller. */
{
Tcl_InitHashTable(&vetPtr->patternTable,
sizeof(PatternTableKey) / sizeof(int));
@@ -2870,7 +2822,7 @@ InitVirtualEventTable(vetPtr)
*
* DeleteVirtualEventTable --
*
- * Delete the contents of a virtual event table. The caller is
+ * Delete the contents of a virtual event table. The caller is
* responsible for freeing any memory used by the table itself.
*
* Results:
@@ -2883,8 +2835,8 @@ InitVirtualEventTable(vetPtr)
*/
static void
-DeleteVirtualEventTable(vetPtr)
- VirtualEventTable *vetPtr; /* The virtual event table to delete. */
+DeleteVirtualEventTable(
+ VirtualEventTable *vetPtr) /* The virtual event table to delete. */
{
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
@@ -2903,7 +2855,7 @@ DeleteVirtualEventTable(vetPtr)
hPtr = Tcl_FirstHashEntry(&vetPtr->nameTable, &search);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- ckfree((char *) Tcl_GetHashValue(hPtr));
+ ckfree((char *) Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(&vetPtr->nameTable);
}
@@ -2913,29 +2865,27 @@ DeleteVirtualEventTable(vetPtr)
*
* CreateVirtualEvent --
*
- * Add a new definition for a virtual event. If the virtual event
- * is already defined, the new definition augments those that
- * already exist.
+ * Add a new definition for a virtual event. If the virtual event is
+ * already defined, the new definition augments those that already exist.
*
* Results:
- * The return value is TCL_ERROR if an error occured while
- * creating the virtual binding. In this case, an error message
- * will be left in the interp's result. If all went well then the
- * return value is TCL_OK.
+ * The return value is TCL_ERROR if an error occured while creating the
+ * virtual binding. In this case, an error message will be left in the
+ * interp's result. If all went well then the return value is TCL_OK.
*
* Side effects:
- * The virtual event may cause future calls to Tk_BindEvent to
- * behave differently than they did previously.
+ * The virtual event may cause future calls to Tk_BindEvent to behave
+ * differently than they did previously.
*
*----------------------------------------------------------------------
*/
static int
-CreateVirtualEvent(interp, vetPtr, virtString, eventString)
- 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
+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
* triggers virtual event. */
{
PatSeq *psPtr;
@@ -2945,10 +2895,10 @@ CreateVirtualEvent(interp, vetPtr, virtString, eventString)
PhysicalsOwned *poPtr;
VirtualOwners *voPtr;
Tk_Uid virtUid;
-
+
virtUid = GetVirtualEventUid(interp, virtString);
if (virtUid == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
/*
@@ -2958,7 +2908,7 @@ CreateVirtualEvent(interp, vetPtr, virtString, eventString)
psPtr = FindSequence(interp, &vetPtr->patternTable, NULL, eventString,
1, 0, &eventMask);
if (psPtr == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
/*
@@ -2976,20 +2926,21 @@ CreateVirtualEvent(interp, vetPtr, virtString, eventString)
poPtr = (PhysicalsOwned *) ckalloc(sizeof(PhysicalsOwned));
poPtr->numOwned = 0;
} else {
- /*
+ /*
* See if this virtual event is already defined for this physical
* event and just return if it is.
*/
int i;
+
for (i = 0; i < poPtr->numOwned; i++) {
if (poPtr->patSeqs[i] == psPtr) {
- return TCL_OK;
+ return TCL_OK;
}
}
poPtr = (PhysicalsOwned *) ckrealloc((char *) poPtr,
sizeof(PhysicalsOwned) + poPtr->numOwned * sizeof(PatSeq *));
- }
+ }
Tcl_SetHashValue(vhPtr, (ClientData) poPtr);
poPtr->patSeqs[poPtr->numOwned] = psPtr;
poPtr->numOwned++;
@@ -3000,10 +2951,10 @@ CreateVirtualEvent(interp, vetPtr, virtString, eventString)
voPtr = psPtr->voPtr;
if (voPtr == NULL) {
- voPtr = (VirtualOwners *) ckalloc(sizeof(VirtualOwners));
+ voPtr = (VirtualOwners *) ckalloc(sizeof(VirtualOwners));
voPtr->numOwners = 0;
} else {
- voPtr = (VirtualOwners *) ckrealloc((char *) voPtr,
+ voPtr = (VirtualOwners *) ckrealloc((char *) voPtr,
sizeof(VirtualOwners)
+ voPtr->numOwners * sizeof(Tcl_HashEntry *));
}
@@ -3019,31 +2970,31 @@ CreateVirtualEvent(interp, vetPtr, virtString, eventString)
*
* DeleteVirtualEvent --
*
- * Remove the definition of a given virtual event. If the
- * event string is NULL, all definitions of the virtual event
- * will be removed. Otherwise, just the specified definition
- * of the virtual event will be removed.
+ * Remove the definition of a given virtual event. If the event string is
+ * NULL, all definitions of the virtual event will be removed.
+ * Otherwise, just the specified definition of the virtual event will be
+ * removed.
*
* Results:
- * The result is a standard Tcl return value. If an error
- * occurs then the interp's result will contain an error message.
- * It is not an error to attempt to delete a virtual event that
- * does not exist or a definition that does not exist.
+ * The result is a standard Tcl return value. If an error occurs then the
+ * interp's result will contain an error message. It is not an error to
+ * attempt to delete a virtual event that does not exist or a definition
+ * that does not exist.
*
* Side effects:
- * The virtual event given by virtString may be removed from the
- * virtual event table.
+ * The virtual event given by virtString may be removed from the virtual
+ * event table.
*
*--------------------------------------------------------------
*/
static int
-DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
- Tcl_Interp *interp; /* Used for error reporting. */
- VirtualEventTable *vetPtr;/* Table in which to delete event. */
- char *virtString; /* String describing event sequence that
+DeleteVirtualEvent(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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,
+ char *eventString) /* The event sequence that should be deleted,
* or NULL to delete all event sequences for
* the entire virtual event. */
{
@@ -3055,12 +3006,12 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
virtUid = GetVirtualEventUid(interp, virtString);
if (virtUid == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
-
+
vhPtr = Tcl_FindHashEntry(&vetPtr->nameTable, virtUid);
if (vhPtr == NULL) {
- return TCL_OK;
+ return TCL_OK;
}
poPtr = (PhysicalsOwned *) Tcl_GetHashValue(vhPtr);
@@ -3069,28 +3020,27 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
unsigned long eventMask;
/*
- * Delete only the specific physical event associated with the
- * virtual event. If the physical event doesn't already exist, or
- * the virtual event doesn't own that physical event, return w/o
- * doing anything.
+ * Delete only the specific physical event associated with the virtual
+ * event. If the physical event doesn't already exist, or the virtual
+ * event doesn't own that physical event, return w/o doing anything.
*/
eventPSPtr = FindSequence(interp, &vetPtr->patternTable, NULL,
eventString, 0, 0, &eventMask);
if (eventPSPtr == NULL) {
- CONST char *string;
+ const char *string = Tcl_GetStringResult(interp);
- string = Tcl_GetStringResult(interp);
return (string[0] != '\0') ? TCL_ERROR : TCL_OK;
}
}
for (iPhys = poPtr->numOwned; --iPhys >= 0; ) {
PatSeq *psPtr = poPtr->patSeqs[iPhys];
+
if ((eventPSPtr == NULL) || (psPtr == eventPSPtr)) {
int iVirt;
VirtualOwners *voPtr;
-
+
/*
* Remove association between this physical event and the given
* virtual event that it triggers.
@@ -3103,15 +3053,17 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
}
}
if (iVirt == voPtr->numOwners) {
- panic("DeleteVirtualEvent: couldn't find owner");
+ Tcl_Panic("DeleteVirtualEvent: couldn't find owner");
}
voPtr->numOwners--;
if (voPtr->numOwners == 0) {
/*
- * Removed last reference to this physical event, so
- * remove it from physical->virtual map.
+ * Removed last reference to this physical event, so remove it
+ * from physical->virtual map.
*/
+
PatSeq *prevPtr = (PatSeq *) Tcl_GetHashValue(psPtr->hPtr);
+
if (prevPtr == psPtr) {
if (psPtr->nextSeqPtr == NULL) {
Tcl_DeleteHashEntry(psPtr->hPtr);
@@ -3122,7 +3074,7 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
} else {
for ( ; ; prevPtr = prevPtr->nextSeqPtr) {
if (prevPtr == NULL) {
- panic("DeleteVirtualEvent couldn't find on hash chain");
+ Tcl_Panic("DeleteVirtualEvent couldn't find on hash chain");
}
if (prevPtr->nextSeqPtr == psPtr) {
prevPtr->nextSeqPtr = psPtr->nextSeqPtr;
@@ -3135,23 +3087,23 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
} else {
/*
* This physical event still triggers some other virtual
- * event(s). Consolidate the list of virtual owners for
- * this physical event so it no longer triggers the
- * given virtual event.
+ * event(s). Consolidate the list of virtual owners for this
+ * physical event so it no longer triggers the given virtual
+ * event.
*/
+
voPtr->owners[iVirt] = voPtr->owners[voPtr->numOwners];
}
/*
- * Now delete the virtual event's reference to the physical
- * event.
+ * Now delete the virtual event's reference to the physical event.
*/
poPtr->numOwned--;
if (eventPSPtr != NULL && poPtr->numOwned != 0) {
- /*
- * Just deleting this one physical event. Consolidate list
- * of owned physical events and return.
+ /*
+ * Just deleting this one physical event. Consolidate list of
+ * owned physical events and return.
*/
poPtr->patSeqs[iPhys] = poPtr->patSeqs[poPtr->numOwned];
@@ -3162,10 +3114,10 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
if (poPtr->numOwned == 0) {
/*
- * All the physical events for this virtual event were deleted,
- * either because there was only one associated physical event or
- * because the caller was deleting the entire virtual event. Now
- * the virtual event itself should be deleted.
+ * All the physical events for this virtual event were deleted, either
+ * because there was only one associated physical event or because the
+ * caller was deleting the entire virtual event. Now the virtual event
+ * itself should be deleted.
*/
ckfree((char *) poPtr);
@@ -3179,16 +3131,16 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
*
* GetVirtualEvent --
*
- * Return the list of physical events that can invoke the
- * given virtual event.
+ * Return the list of physical events that can invoke the given virtual
+ * event.
*
* Results:
* The return value is TCL_OK and the interp's result is filled with the
* string representation of the physical events associated with the
* virtual event; if there are no physical events for the given virtual
- * event, the interp's result is filled with and empty string. If the
- * virtual event string is improperly formed, then TCL_ERROR is
- * returned and an error message is left in the interp's result.
+ * event, the interp's result is filled with and empty string. If the
+ * virtual event string is improperly formed, then TCL_ERROR is returned
+ * and an error message is left in the interp's result.
*
* Side effects:
* None.
@@ -3197,10 +3149,10 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
*/
static int
-GetVirtualEvent(interp, vetPtr, virtString)
- Tcl_Interp *interp; /* Interpreter for reporting. */
- VirtualEventTable *vetPtr;/* Table in which to look for event. */
- char *virtString; /* String describing virtual event. */
+GetVirtualEvent(
+ Tcl_Interp *interp, /* Interpreter for reporting. */
+ VirtualEventTable *vetPtr, /* Table in which to look for event. */
+ char *virtString) /* String describing virtual event. */
{
Tcl_HashEntry *vhPtr;
Tcl_DString ds;
@@ -3210,12 +3162,12 @@ GetVirtualEvent(interp, vetPtr, virtString)
virtUid = GetVirtualEventUid(interp, virtString);
if (virtUid == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
vhPtr = Tcl_FindHashEntry(&vetPtr->nameTable, virtUid);
if (vhPtr == NULL) {
- return TCL_OK;
+ return TCL_OK;
}
Tcl_DStringInit(&ds);
@@ -3236,13 +3188,12 @@ GetVirtualEvent(interp, vetPtr, virtString)
*
* GetAllVirtualEvents --
*
- * Return a list that contains the names of all the virtual
- * event defined.
+ * Return a list that contains the names of all the virtual event
+ * defined.
*
* Results:
- * There is no return value. The interp's result is modified to
- * hold a Tcl list with one entry for each virtual event in
- * nameTable.
+ * There is no return value. The interp's result is modified to hold a
+ * Tcl list with one entry for each virtual event in nameTable.
*
* Side effects:
* None.
@@ -3251,9 +3202,9 @@ GetVirtualEvent(interp, vetPtr, virtString)
*/
static void
-GetAllVirtualEvents(interp, vetPtr)
- Tcl_Interp *interp; /* Interpreter returning result. */
- VirtualEventTable *vetPtr;/* Table containing events. */
+GetAllVirtualEvents(
+ Tcl_Interp *interp, /* Interpreter returning result. */
+ VirtualEventTable *vetPtr) /* Table containing events. */
{
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
@@ -3263,11 +3214,11 @@ GetAllVirtualEvents(interp, vetPtr)
hPtr = Tcl_FirstHashEntry(&vetPtr->nameTable, &search);
for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_DStringSetLength(&ds, 0);
+ Tcl_DStringSetLength(&ds, 0);
Tcl_DStringAppend(&ds, "<<", 2);
Tcl_DStringAppend(&ds, Tcl_GetHashKey(hPtr->tablePtr, hPtr), -1);
Tcl_DStringAppend(&ds, ">>", 2);
- Tcl_AppendElement(interp, Tcl_DStringValue(&ds));
+ Tcl_AppendElement(interp, Tcl_DStringValue(&ds));
}
Tcl_DStringFree(&ds);
@@ -3278,45 +3229,45 @@ GetAllVirtualEvents(interp, vetPtr)
*
* HandleEventGenerate --
*
- * Helper function for the "event generate" command. Generate and
- * process an XEvent, constructed from information parsed from the
- * event description string and its optional arguments.
+ * Helper function for the "event generate" command. Generate and process
+ * an XEvent, constructed from information parsed from the event
+ * description string and its optional arguments.
*
* argv[0] contains name of the target window.
* argv[1] contains pattern string for one event (e.g, <Control-v>).
- * argv[2..argc-1] contains -field/option pairs for specifying
- * additional detail in the generated event.
+ * argv[2..argc-1] contains -field/option pairs for specifying additional
+ * detail in the generated event.
*
- * Either virtual or physical events can be generated this way.
- * The event description string must contain the specification
- * for only one event.
+ * Either virtual or physical events can be generated this way. The event
+ * description string must contain the specification for only one event.
*
* Results:
* None.
*
* Side effects:
- * When constructing the event,
- * event.xany.serial is filled with the current X serial number.
- * event.xany.window is filled with the target window.
- * event.xany.display is filled with the target window's display.
+ * When constructing the event,
+ * event.xany.serial is filled with the current X serial number.
+ * event.xany.window is filled with the target window.
+ * event.xany.display is filled with the target window's display.
* Any other fields in eventPtr which are not specified by the pattern
* string or the optional arguments, are set to 0.
*
- * The event may be handled sychronously or asynchronously, depending
- * on the value specified by the optional "-when" option. The
- * default setting is synchronous.
+ * The event may be handled sychronously or asynchronously, depending on
+ * the value specified by the optional "-when" option. The default
+ * setting is synchronous.
*
*---------------------------------------------------------------------------
*/
+
static int
-HandleEventGenerate(interp, mainWin, objc, objv)
- Tcl_Interp *interp; /* Interp for errors return and name lookup. */
- Tk_Window mainWin; /* Main window associated with interp. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+HandleEventGenerate(
+ Tcl_Interp *interp, /* Interp for errors return and name lookup. */
+ Tk_Window mainWin, /* Main window associated with interp. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
- XEvent event;
- CONST char *p;
+ union {XEvent general; XVirtualEvent virtual;} event;
+ const char *p;
char *name, *windowName;
int count, flags, synch, i, number, warp;
Tcl_QueuePosition pos;
@@ -3324,10 +3275,11 @@ HandleEventGenerate(interp, mainWin, objc, objv)
Tk_Window tkwin, tkwin2;
TkWindow *mainPtr;
unsigned long eventMask;
- static CONST char *fieldStrings[] = {
+ Tcl_Obj *userDataObj;
+ static const char *fieldStrings[] = {
"-when", "-above", "-borderwidth", "-button",
- "-count", "-delta", "-detail", "-focus",
- "-height",
+ "-count", "-data", "-delta", "-detail",
+ "-focus", "-height",
"-keycode", "-keysym", "-mode", "-override",
"-place", "-root", "-rootx", "-rooty",
"-sendevent", "-serial", "-state", "-subwindow",
@@ -3336,8 +3288,8 @@ HandleEventGenerate(interp, mainWin, objc, objv)
};
enum field {
EVENT_WHEN, EVENT_ABOVE, EVENT_BORDER, EVENT_BUTTON,
- EVENT_COUNT, EVENT_DELTA, EVENT_DETAIL, EVENT_FOCUS,
- EVENT_HEIGHT,
+ EVENT_COUNT, EVENT_DATA, EVENT_DELTA, EVENT_DETAIL,
+ EVENT_FOCUS, EVENT_HEIGHT,
EVENT_KEYCODE, EVENT_KEYSYM, EVENT_MODE, EVENT_OVERRIDE,
EVENT_PLACE, EVENT_ROOT, EVENT_ROOTX, EVENT_ROOTY,
EVENT_SEND, EVENT_SERIAL, EVENT_STATE, EVENT_SUBWINDOW,
@@ -3345,7 +3297,7 @@ HandleEventGenerate(interp, mainWin, objc, objv)
EVENT_X, EVENT_Y
};
- windowName = Tcl_GetStringFromObj(objv[0], NULL);
+ windowName = Tcl_GetString(objv[0]);
if (!windowName[0]) {
tkwin = mainWin;
} else if (NameToWindow(interp, mainWin, objv[0], &tkwin) != TCL_OK) {
@@ -3355,18 +3307,16 @@ HandleEventGenerate(interp, mainWin, objc, objv)
mainPtr = (TkWindow *) mainWin;
if ((tkwin == NULL)
|| (mainPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr)) {
- char *name;
-
- name = Tcl_GetStringFromObj(objv[0], NULL);
- Tcl_AppendResult(interp, "window id \"", name,
- "\" doesn't exist in this application", (char *) NULL);
+ Tcl_AppendResult(interp, "window id \"", Tcl_GetString(objv[0]),
+ "\" doesn't exist in this application", NULL);
return TCL_ERROR;
}
- name = Tcl_GetStringFromObj(objv[1], NULL);
+ name = Tcl_GetString(objv[1]);
p = name;
eventMask = 0;
+ userDataObj = NULL;
count = ParseEventDescription(interp, &p, &pat, &eventMask);
if (count == 0) {
return TCL_ERROR;
@@ -3382,48 +3332,49 @@ HandleEventGenerate(interp, mainWin, objc, objv)
return TCL_ERROR;
}
- memset((VOID *) &event, 0, sizeof(event));
- event.xany.type = pat.eventType;
- event.xany.serial = NextRequest(Tk_Display(tkwin));
- event.xany.send_event = False;
+ memset((void *) &event, 0, sizeof(event));
+ event.general.xany.type = pat.eventType;
+ event.general.xany.serial = NextRequest(Tk_Display(tkwin));
+ event.general.xany.send_event = False;
if (windowName[0]) {
- event.xany.window = Tk_WindowId(tkwin);
+ event.general.xany.window = Tk_WindowId(tkwin);
} else {
- event.xany.window = RootWindow(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
+ event.general.xany.window =
+ RootWindow(Tk_Display(tkwin), Tk_ScreenNumber(tkwin));
}
- event.xany.display = Tk_Display(tkwin);
+ event.general.xany.display = Tk_Display(tkwin);
- flags = flagArray[event.xany.type];
+ flags = flagArray[event.general.xany.type];
if (flags & DESTROY) {
/*
- * Event DesotryNotify should be generated by destroying
- * the window.
+ * Event DestroyNotify should be generated by destroying the window.
*/
+
Tk_DestroyWindow(tkwin);
return TCL_OK;
}
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- event.xkey.state = pat.needMods;
- if ((flags & KEY) && (event.xany.type != MouseWheelEvent)) {
- TkpSetKeycodeAndState(tkwin, pat.detail.keySym, &event);
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ event.general.xkey.state = pat.needMods;
+ if ((flags & KEY) && (event.general.xany.type != MouseWheelEvent)) {
+ TkpSetKeycodeAndState(tkwin, pat.detail.keySym, &event.general);
} else if (flags & BUTTON) {
- event.xbutton.button = pat.detail.button;
+ event.general.xbutton.button = pat.detail.button;
} else if (flags & VIRTUAL) {
- ((XVirtualEvent *) &event)->name = pat.detail.name;
+ event.virtual.name = pat.detail.name;
}
}
if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
- event.xcreatewindow.window = event.xany.window;
+ event.general.xcreatewindow.window = event.general.xany.window;
}
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x_root = -1;
- event.xkey.y_root = -1;
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.x_root = -1;
+ event.general.xkey.y_root = -1;
}
/*
- * Process the remaining arguments to fill in additional fields
- * of the event.
+ * Process the remaining arguments to fill in additional fields of the
+ * event.
*/
synch = 1;
@@ -3432,7 +3383,7 @@ HandleEventGenerate(interp, mainWin, objc, objv)
for (i = 2; i < objc; i += 2) {
Tcl_Obj *optionPtr, *valuePtr;
int index;
-
+
optionPtr = objv[i];
valuePtr = objv[i + 1];
@@ -3442,446 +3393,451 @@ HandleEventGenerate(interp, mainWin, objc, objv)
}
if (objc & 1) {
/*
- * This test occurs after Tcl_GetIndexFromObj() so that
- * "event generate <Button> -xyz" will return the error message
- * that "-xyz" is a bad option, rather than that the value
- * for "-xyz" is missing.
+ * This test occurs after Tcl_GetIndexFromObj() so that "event
+ * generate <Button> -xyz" will return the error message that
+ * "-xyz" is a bad option, rather than that the value for "-xyz"
+ * is missing.
*/
- Tcl_AppendResult(interp, "value for \"",
- Tcl_GetStringFromObj(optionPtr, NULL), "\" missing",
- (char *) NULL);
+ Tcl_AppendResult(interp, "value for \"", Tcl_GetString(optionPtr),
+ "\" missing", NULL);
return TCL_ERROR;
}
switch ((enum field) index) {
- case EVENT_WARP: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &warp) != TCL_OK) {
- return TCL_ERROR;
- }
- if (!(flags & (KEY_BUTTON_MOTION_VIRTUAL))) {
- goto badopt;
- }
- break;
+ case EVENT_WARP:
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &warp) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_WHEN: {
- pos = (Tcl_QueuePosition) TkFindStateNumObj(interp, optionPtr,
- queuePosition, valuePtr);
- if ((int) pos < -1) {
- return TCL_ERROR;
- }
- synch = 0;
- if ((int) pos == -1) {
- synch = 1;
- }
- break;
+ if (!(flags & KEY_BUTTON_MOTION_VIRTUAL)) {
+ goto badopt;
}
- case EVENT_ABOVE: {
- if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CONFIG) {
- event.xconfigure.above = Tk_WindowId(tkwin2);
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_WHEN:
+ pos = (Tcl_QueuePosition) TkFindStateNumObj(interp, optionPtr,
+ queuePosition, valuePtr);
+ if ((int) pos < -1) {
+ return TCL_ERROR;
}
- case EVENT_BORDER: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (CREATE|CONFIG)) {
- event.xcreatewindow.border_width = number;
- } else {
- goto badopt;
- }
- break;
+ synch = 0;
+ if ((int) pos == -1) {
+ synch = 1;
}
- case EVENT_BUTTON: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & BUTTON) {
- event.xbutton.button = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_ABOVE:
+ if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_COUNT: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & EXPOSE) {
- event.xexpose.count = number;
- } else {
- goto badopt;
- }
- break;
+ if (flags & CONFIG) {
+ event.general.xconfigure.above = Tk_WindowId(tkwin2);
+ } else {
+ goto badopt;
}
- case EVENT_DELTA: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((flags & KEY) && (event.xkey.type == MouseWheelEvent)) {
- event.xkey.keycode = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_BORDER:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_DETAIL: {
- number = TkFindStateNumObj(interp, optionPtr, notifyDetail,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & FOCUS) {
- event.xfocus.detail = number;
- } else if (flags & CROSSING) {
- event.xcrossing.detail = number;
- } else {
- goto badopt;
- }
- break;
+ if (flags & (CREATE|CONFIG)) {
+ event.general.xcreatewindow.border_width = number;
+ } else {
+ goto badopt;
}
- case EVENT_FOCUS: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CROSSING) {
- event.xcrossing.focus = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_BUTTON:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_HEIGHT: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & EXPOSE) {
- event.xexpose.height = number;
- } else if (flags & CONFIG) {
- event.xconfigure.height = number;
- } else {
- goto badopt;
- }
- break;
+ if (flags & BUTTON) {
+ event.general.xbutton.button = number;
+ } else {
+ goto badopt;
}
- case EVENT_KEYCODE: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((flags & KEY) && (event.xkey.type != MouseWheelEvent)) {
- event.xkey.keycode = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_COUNT:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & EXPOSE) {
+ event.general.xexpose.count = number;
+ } else {
+ goto badopt;
}
- case EVENT_KEYSYM: {
- KeySym keysym;
- char *value;
+ break;
+ case EVENT_DATA:
+ if (flags & VIRTUAL) {
+ /*
+ * Do not increment reference count until after parsing
+ * completes and we know that the event generation is really
+ * going to happen.
+ */
- value = Tcl_GetStringFromObj(valuePtr, NULL);
- keysym = TkStringToKeysym(value);
- if (keysym == NoSymbol) {
- Tcl_AppendResult(interp, "unknown keysym \"", value, "\"",
- (char *) NULL);
- return TCL_ERROR;
- }
+ userDataObj = valuePtr;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_DELTA:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if ((flags & KEY) && (event.general.xkey.type == MouseWheelEvent)) {
+ event.general.xkey.keycode = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_DETAIL:
+ number = TkFindStateNumObj(interp, optionPtr, notifyDetail,
+ valuePtr);
+ if (number < 0) {
+ return TCL_ERROR;
+ }
+ if (flags & FOCUS) {
+ event.general.xfocus.detail = number;
+ } else if (flags & CROSSING) {
+ event.general.xcrossing.detail = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_FOCUS:
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & CROSSING) {
+ event.general.xcrossing.focus = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_HEIGHT:
+ if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
+ &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & EXPOSE) {
+ event.general.xexpose.height = number;
+ } else if (flags & CONFIG) {
+ event.general.xconfigure.height = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_KEYCODE:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if ((flags & KEY) && (event.general.xkey.type != MouseWheelEvent)) {
+ event.general.xkey.keycode = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_KEYSYM: {
+ KeySym keysym;
+ char *value;
+
+ value = Tcl_GetString(valuePtr);
+ keysym = TkStringToKeysym(value);
+ if (keysym == NoSymbol) {
+ Tcl_AppendResult(interp, "unknown keysym \"", value, "\"",
+ NULL);
+ return TCL_ERROR;
+ }
- TkpSetKeycodeAndState(tkwin, keysym, &event);
- if (event.xkey.keycode == 0) {
- Tcl_AppendResult(interp, "no keycode for keysym \"", value,
- "\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (!(flags & KEY) || (event.xkey.type == MouseWheelEvent)) {
- goto badopt;
- }
- break;
+ TkpSetKeycodeAndState(tkwin, keysym, &event.general);
+ if (event.general.xkey.keycode == 0) {
+ Tcl_AppendResult(interp, "no keycode for keysym \"", value,
+ "\"", NULL);
+ return TCL_ERROR;
}
- case EVENT_MODE: {
- number = TkFindStateNumObj(interp, optionPtr, notifyMode,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & CROSSING) {
- event.xcrossing.mode = number;
- } else if (flags & FOCUS) {
- event.xfocus.mode = number;
- } else {
- goto badopt;
- }
- break;
+ if (!(flags & KEY)
+ || (event.general.xkey.type == MouseWheelEvent)) {
+ goto badopt;
}
- case EVENT_OVERRIDE: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & CREATE) {
- event.xcreatewindow.override_redirect = number;
- } else if (flags & MAP) {
- event.xmap.override_redirect = number;
- } else if (flags & REPARENT) {
- event.xreparent.override_redirect = number;
- } else if (flags & CONFIG) {
- event.xconfigure.override_redirect = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ }
+ case EVENT_MODE:
+ number = TkFindStateNumObj(interp,optionPtr,notifyMode,valuePtr);
+ if (number < 0) {
+ return TCL_ERROR;
}
- case EVENT_PLACE: {
- number = TkFindStateNumObj(interp, optionPtr, circPlace,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- if (flags & CIRC) {
- event.xcirculate.place = number;
- } else {
- goto badopt;
- }
- break;
+ if (flags & CROSSING) {
+ event.general.xcrossing.mode = number;
+ } else if (flags & FOCUS) {
+ event.general.xfocus.mode = number;
+ } else {
+ goto badopt;
}
- case EVENT_ROOT: {
- if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.root = Tk_WindowId(tkwin2);
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_OVERRIDE:
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_ROOTX: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x_root = number;
- } else {
- goto badopt;
- }
- break;
+ if (flags & CREATE) {
+ event.general.xcreatewindow.override_redirect = number;
+ } else if (flags & MAP) {
+ event.general.xmap.override_redirect = number;
+ } else if (flags & REPARENT) {
+ event.general.xreparent.override_redirect = number;
+ } else if (flags & CONFIG) {
+ event.general.xconfigure.override_redirect = number;
+ } else {
+ goto badopt;
}
- case EVENT_ROOTY: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.y_root = number;
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_PLACE:
+ number = TkFindStateNumObj(interp, optionPtr, circPlace, valuePtr);
+ if (number < 0) {
+ return TCL_ERROR;
+ }
+ if (flags & CIRC) {
+ event.general.xcirculate.place = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_ROOT:
+ if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_SEND: {
- CONST char *value;
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.root = Tk_WindowId(tkwin2);
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_ROOTX:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.x_root = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_ROOTY:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.y_root = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_SEND: {
+ const char *value;
- value = Tcl_GetStringFromObj(valuePtr, NULL);
- if (isdigit(UCHAR(value[0]))) {
- /*
- * Allow arbitrary integer values for the field; they
- * are needed by a few of the tests in the Tk test suite.
- */
+ value = Tcl_GetString(valuePtr);
+ if (isdigit(UCHAR(value[0]))) {
+ /*
+ * Allow arbitrary integer values for the field; they are
+ * needed by a few of the tests in the Tk test suite.
+ */
- if (Tcl_GetIntFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- } else {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- event.xany.send_event = number;
- break;
- }
- case EVENT_SERIAL: {
if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
return TCL_ERROR;
}
- event.xany.serial = number;
- break;
- }
- case EVENT_STATE: {
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- if (Tcl_GetIntFromObj(interp, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
- event.xkey.state = number;
- } else {
- event.xcrossing.state = number;
- }
- } else if (flags & VISIBILITY) {
- number = TkFindStateNumObj(interp, optionPtr, visNotify,
- valuePtr);
- if (number < 0) {
- return TCL_ERROR;
- }
- event.xvisibility.state = number;
- } else {
- goto badopt;
- }
- break;
- }
- case EVENT_SUBWINDOW: {
- if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
+ } else {
+ if (Tcl_GetBooleanFromObj(interp,valuePtr,&number) != TCL_OK) {
return TCL_ERROR;
}
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.subwindow = Tk_WindowId(tkwin2);
- } else {
- goto badopt;
- }
- break;
}
- case EVENT_TIME: {
+ event.general.xany.send_event = number;
+ break;
+ }
+ case EVENT_SERIAL:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ event.general.xany.serial = number;
+ break;
+ case EVENT_STATE:
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
return TCL_ERROR;
}
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.time = (Time) number;
- } else if (flags & PROP) {
- event.xproperty.time = (Time) number;
+ if (flags & KEY_BUTTON_MOTION_VIRTUAL) {
+ event.general.xkey.state = number;
} else {
- goto badopt;
+ event.general.xcrossing.state = number;
}
- break;
- }
- case EVENT_WIDTH: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
+ } else if (flags & VISIBILITY) {
+ number = TkFindStateNumObj(interp, optionPtr, visNotify,
+ valuePtr);
+ if (number < 0) {
return TCL_ERROR;
}
- if (flags & EXPOSE) {
- event.xexpose.width = number;
- } else if (flags & (CREATE|CONFIG)) {
- event.xcreatewindow.width = number;
- } else {
- goto badopt;
- }
- break;
+ event.general.xvisibility.state = number;
+ } else {
+ goto badopt;
}
- case EVENT_WINDOW: {
- if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG
- |GRAVITY|CIRC)) {
- event.xcreatewindow.window = Tk_WindowId(tkwin2);
- } else {
- goto badopt;
- }
- break;
+ break;
+ case EVENT_SUBWINDOW:
+ if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
}
- case EVENT_X: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.x = number;
- /*
- * Only modify rootx as well if it hasn't been changed.
- */
- if (event.xkey.x_root == -1) {
- int rootX, rootY;
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.subwindow = Tk_WindowId(tkwin2);
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_TIME:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.time = (Time) number;
+ } else if (flags & PROP) {
+ event.general.xproperty.time = (Time) number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_WIDTH:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & EXPOSE) {
+ event.general.xexpose.width = number;
+ } else if (flags & (CREATE|CONFIG)) {
+ event.general.xcreatewindow.width = number;
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_WINDOW:
+ if (NameToWindow(interp, tkwin, valuePtr, &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & (CREATE|UNMAP|MAP|REPARENT|CONFIG|GRAVITY|CIRC)) {
+ event.general.xcreatewindow.window = Tk_WindowId(tkwin2);
+ } else {
+ goto badopt;
+ }
+ break;
+ case EVENT_X:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
+ event.general.xkey.x = number;
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- event.xkey.x_root = rootX + number;
- }
- } else if (flags & EXPOSE) {
- event.xexpose.x = number;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- event.xcreatewindow.x = number;
- } else if (flags & REPARENT) {
- event.xreparent.x = number;
- } else {
- goto badopt;
+ /*
+ * Only modify rootx as well if it hasn't been changed.
+ */
+
+ if (event.general.xkey.x_root == -1) {
+ int rootX, rootY;
+
+ Tk_GetRootCoords(tkwin, &rootX, &rootY);
+ event.general.xkey.x_root = rootX + number;
}
- break;
+ } else if (flags & EXPOSE) {
+ event.general.xexpose.x = number;
+ } else if (flags & (CREATE|CONFIG|GRAVITY)) {
+ event.general.xcreatewindow.x = number;
+ } else if (flags & REPARENT) {
+ event.general.xreparent.x = number;
+ } else {
+ goto badopt;
}
- case EVENT_Y: {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr, &number)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (flags & (KEY_BUTTON_MOTION_VIRTUAL|CROSSING)) {
- event.xkey.y = number;
- /*
- * Only modify rooty as well if it hasn't been changed.
- */
- if (event.xkey.y_root == -1) {
- int rootX, rootY;
+ break;
+ case EVENT_Y:
+ if (Tk_GetPixelsFromObj(interp,tkwin,valuePtr,&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (flags & KEY_BUTTON_MOTION_CROSSING) {
+ event.general.xkey.y = number;
- Tk_GetRootCoords(tkwin, &rootX, &rootY);
- event.xkey.y_root = rootY + number;
- }
- } else if (flags & EXPOSE) {
- event.xexpose.y = number;
- } else if (flags & (CREATE|CONFIG|GRAVITY)) {
- event.xcreatewindow.y = number;
- } else if (flags & REPARENT) {
- event.xreparent.y = number;
- } else {
- goto badopt;
+ /*
+ * Only modify rooty as well if it hasn't been changed.
+ */
+
+ if (event.general.xkey.y_root == -1) {
+ int rootX, rootY;
+
+ Tk_GetRootCoords(tkwin, &rootX, &rootY);
+ event.general.xkey.y_root = rootY + number;
}
- break;
+ } else if (flags & EXPOSE) {
+ event.general.xexpose.y = number;
+ } else if (flags & (CREATE|CONFIG|GRAVITY)) {
+ event.general.xcreatewindow.y = number;
+ } else if (flags & REPARENT) {
+ event.general.xreparent.y = number;
+ } else {
+ goto badopt;
}
+ break;
}
continue;
-
- badopt:
+
+ badopt:
Tcl_AppendResult(interp, name, " event doesn't accept \"",
- Tcl_GetStringFromObj(optionPtr, NULL), "\" option", NULL);
+ Tcl_GetString(optionPtr), "\" option", NULL);
return TCL_ERROR;
}
+ if (userDataObj != NULL) {
+ XVirtualEvent *vePtr = (XVirtualEvent *) &event;
+
+ /*
+ * Must be virtual event to set that variable to non-NULL. Now we want
+ * to install the object into the event. Note that we must incr the
+ * refcount before firing it into the low-level event subsystem; the
+ * refcount will be decremented once the event has been processed.
+ */
+
+ vePtr->user_data = userDataObj;
+ Tcl_IncrRefCount(userDataObj);
+ }
+
+ /*
+ * Now we have constructed the event, inject it into the event handling
+ * code.
+ */
+
if (synch != 0) {
- Tk_HandleEvent(&event);
+ Tk_HandleEvent(&event.general);
} else {
- Tk_QueueWindowEvent(&event, pos);
+ Tk_QueueWindowEvent(&event.general, pos);
}
+
/*
- * We only allow warping if the window is mapped
+ * We only allow warping if the window is mapped.
*/
+
if ((warp != 0) && Tk_IsMapped(tkwin)) {
- TkDisplay *dispPtr;
- dispPtr = TkGetDisplay(event.xmotion.display);
+ TkDisplay *dispPtr = TkGetDisplay(event.general.xmotion.display);
+
if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) {
Tcl_DoWhenIdle(DoWarp, (ClientData) dispPtr);
dispPtr->flags |= TK_DISPLAY_IN_WARP;
}
- dispPtr->warpWindow = event.xany.window;
- dispPtr->warpX = event.xkey.x;
- dispPtr->warpY = event.xkey.y;
+ dispPtr->warpWindow = event.general.xany.window;
+ dispPtr->warpX = event.general.xkey.x;
+ dispPtr->warpY = event.general.xkey.y;
}
Tcl_ResetResult(interp);
return TCL_OK;
-
}
+
static int
-NameToWindow(interp, mainWin, objPtr, tkwinPtr)
- Tcl_Interp *interp; /* Interp for error return and name lookup. */
- Tk_Window mainWin; /* Main window of application. */
- Tcl_Obj *objPtr; /* Contains name or id string of window. */
- Tk_Window *tkwinPtr; /* Filled with token for window. */
+NameToWindow(
+ Tcl_Interp *interp, /* Interp for error return and name lookup. */
+ Tk_Window mainWin, /* Main window of application. */
+ Tcl_Obj *objPtr, /* Contains name or id string of window. */
+ Tk_Window *tkwinPtr) /* Filled with token for window. */
{
char *name;
Tk_Window tkwin;
Window id;
- name = Tcl_GetStringFromObj(objPtr, NULL);
+ name = Tcl_GetString(objPtr);
if (name[0] == '.') {
tkwin = Tk_NameToWindow(interp, name, mainWin);
if (tkwin == NULL) {
@@ -3891,14 +3847,14 @@ NameToWindow(interp, mainWin, objPtr, tkwinPtr)
} else {
/*
* Check for the winPtr being valid, even if it looks ok to
- * TkpScanWindowId. [Bug #411307]
+ * TkpScanWindowId. [Bug #411307]
*/
if ((TkpScanWindowId(NULL, name, &id) != TCL_OK) ||
((*tkwinPtr = Tk_IdToWindow(Tk_Display(mainWin), id))
== NULL)) {
Tcl_AppendResult(interp, "bad window name/identifier \"",
- name, "\"", (char *) NULL);
+ name, "\"", NULL);
return TCL_ERROR;
}
}
@@ -3921,13 +3877,13 @@ NameToWindow(interp, mainWin, objPtr, tkwinPtr)
*-------------------------------------------------------------------------
*/
static void
-DoWarp(clientData)
- ClientData clientData;
+DoWarp(
+ ClientData clientData)
{
TkDisplay *dispPtr = (TkDisplay *) clientData;
XWarpPointer(dispPtr->display, (Window) None, (Window) dispPtr->warpWindow,
- 0, 0, 0, 0, (int) dispPtr->warpX, (int) dispPtr->warpY);
+ 0, 0, 0, 0, (int) dispPtr->warpX, (int) dispPtr->warpY);
XForceScreenSaver(dispPtr->display, ScreenSaverReset);
dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}
@@ -3937,35 +3893,36 @@ DoWarp(clientData)
*
* GetVirtualEventUid --
*
- * Determine if the given string is in the proper format for a
- * virtual event.
+ * Determine if the given string is in the proper format for a virtual
+ * event.
*
* Results:
- * The return value is NULL if the virtual event string was
- * not in the proper format. In this case, an error message
- * will be left in the interp's result. Otherwise the return
- * value is a Tk_Uid that represents the virtual event.
+ * The return value is NULL if the virtual event string was not in the
+ * proper format. In this case, an error message will be left in the
+ * interp's result. Otherwise the return value is a Tk_Uid that
+ * represents the virtual event.
*
* Side effects:
* None.
*
*-------------------------------------------------------------------------
*/
+
static Tk_Uid
-GetVirtualEventUid(interp, virtString)
- Tcl_Interp *interp;
- char *virtString;
+GetVirtualEventUid(
+ Tcl_Interp *interp,
+ char *virtString)
{
Tk_Uid uid;
- int length;
+ size_t length;
length = strlen(virtString);
if (length < 5 || virtString[0] != '<' || virtString[1] != '<' ||
virtString[length - 2] != '>' || virtString[length - 1] != '>') {
- Tcl_AppendResult(interp, "virtual event \"", virtString,
- "\" is badly formed", (char *) NULL);
- return NULL;
+ Tcl_AppendResult(interp, "virtual event \"", virtString,
+ "\" is badly formed", NULL);
+ return NULL;
}
virtString[length - 2] = '\0';
uid = Tk_GetUid(virtString + 2);
@@ -3973,27 +3930,24 @@ GetVirtualEventUid(interp, virtString)
return uid;
}
-
/*
*----------------------------------------------------------------------
*
* FindSequence --
*
- * Find the entry in the pattern table that corresponds to a
- * particular pattern string, and return a pointer to that
- * entry.
+ * Find the entry in the pattern table that corresponds to a particular
+ * pattern string, and return a pointer to that entry.
*
* Results:
- * The return value is normally a pointer to the PatSeq
- * in patternTable that corresponds to eventString. If an error
- * was found while parsing eventString, or if "create" is 0 and
- * no pattern sequence previously existed, then NULL is returned
- * and the interp's result contains a message describing the problem.
- * If no pattern sequence previously existed for eventString, then
- * a new one is created with a NULL command field. In a successful
- * return, *maskPtr is filled in with a mask of the event types
- * on which the pattern sequence depends.
+ * The return value is normally a pointer to the PatSeq in patternTable
+ * that corresponds to eventString. If an error was found while parsing
+ * eventString, or if "create" is 0 and no pattern sequence previously
+ * existed, then NULL is returned and the interp's result contains a
+ * message describing the problem. If no pattern sequence previously
+ * existed for eventString, then a new one is created with a NULL command
+ * field. In a successful return, *maskPtr is filled in with a mask of
+ * the event types on which the pattern sequence depends.
*
* Side effects:
* A new pattern sequence may be allocated.
@@ -4002,45 +3956,39 @@ GetVirtualEventUid(interp, virtString)
*/
static PatSeq *
-FindSequence(interp, patternTablePtr, object, eventString, create,
- allowVirtual, maskPtr)
- Tcl_Interp *interp; /* Interpreter to use for error
- * reporting. */
- Tcl_HashTable *patternTablePtr; /* Table to use for lookup. */
- ClientData object; /* For binding table, token for object with
- * which binding is associated.
- * For virtual event table, NULL. */
- CONST char *eventString; /* String description of pattern to
- * match on. See user documentation
- * for details. */
- int create; /* 0 means don't create the entry if
- * it doesn't already exist. Non-zero
- * means create. */
- int allowVirtual; /* 0 means that virtual events are not
- * allowed in the sequence. Non-zero
- * otherwise. */
- unsigned long *maskPtr; /* *maskPtr is filled in with the event
- * types on which this pattern sequence
- * depends. */
+FindSequence(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ Tcl_HashTable *patternTablePtr,
+ /* Table to use for lookup. */
+ ClientData object, /* For binding table, token for object with
+ * which binding is associated. For virtual
+ * event table, NULL. */
+ const char *eventString, /* String description of pattern to match on.
+ * See user documentation for details. */
+ int create, /* 0 means don't create the entry if it
+ * doesn't already exist. Non-zero means
+ * create. */
+ int allowVirtual, /* 0 means that virtual events are not allowed
+ * in the sequence. Non-zero otherwise. */
+ unsigned long *maskPtr) /* *maskPtr is filled in with the event types
+ * on which this pattern sequence depends. */
{
-
Pattern pats[EVENT_BUFFER_SIZE];
int numPats, virtualFound;
- CONST char *p;
+ const char *p;
Pattern *patPtr;
PatSeq *psPtr;
Tcl_HashEntry *hPtr;
- int flags, count, new;
+ int flags, count, isNew;
size_t sequenceSize;
unsigned long eventMask;
PatternTableKey key;
/*
*-------------------------------------------------------------
- * Step 1: parse the pattern string to produce an array
- * of Patterns. The array is generated backwards, so
- * that the lowest-indexed pattern corresponds to the last
- * event that must occur.
+ * Step 1: parse the pattern string to produce an array of Patterns. The
+ * array is generated backwards, so that the lowest-indexed pattern
+ * corresponds to the last event that must occur.
*-------------------------------------------------------------
*/
@@ -4065,7 +4013,7 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
if (eventMask & VirtualEventMask) {
if (allowVirtual == 0) {
- Tcl_SetResult(interp,
+ Tcl_SetResult(interp,
"virtual event not allowed in definition of another virtual event",
TCL_STATIC);
return NULL;
@@ -4087,8 +4035,8 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
/*
*-------------------------------------------------------------
- * Step 2: find the sequence in the binding table if it exists,
- * and add a new sequence to the table if it doesn't.
+ * Step 2: find the sequence in the binding table if it exists, and add a
+ * new sequence to the table if it doesn't.
*-------------------------------------------------------------
*/
@@ -4101,15 +4049,15 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
TCL_STATIC);
return NULL;
}
-
+
patPtr = &pats[EVENT_BUFFER_SIZE-numPats];
memset(&key, 0, sizeof(key));
key.object = object;
key.type = patPtr->eventType;
key.detail = patPtr->detail;
- hPtr = Tcl_CreateHashEntry(patternTablePtr, (char *) &key, &new);
+ hPtr = Tcl_CreateHashEntry(patternTablePtr, (char *) &key, &isNew);
sequenceSize = numPats*sizeof(Pattern);
- if (!new) {
+ if (!isNew) {
for (psPtr = (PatSeq *) Tcl_GetHashValue(hPtr); psPtr != NULL;
psPtr = psPtr->nextSeqPtr) {
if ((numPats == psPtr->numPats)
@@ -4121,17 +4069,18 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
}
}
if (!create) {
- if (new) {
+ if (isNew) {
Tcl_DeleteHashEntry(hPtr);
}
+
/*
- * No binding exists for the sequence, so return an empty error.
- * This is a special error that the caller will check for in order
- * to silently ignore this case. This is a hack that maintains
- * backward compatibility for Tk_GetBinding but the various "bind"
- * commands silently ignore missing bindings.
+ * No binding exists for the sequence, so return an empty error. This
+ * is a special error that the caller will check for in order to
+ * silently ignore this case. This is a hack that maintains backward
+ * compatibility for Tk_GetBinding but the various "bind" commands
+ * silently ignore missing bindings.
*/
-
+
return NULL;
}
psPtr = (PatSeq *) ckalloc((unsigned) (sizeof(PatSeq)
@@ -4148,9 +4097,9 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
psPtr->nextObjPtr = NULL;
Tcl_SetHashValue(hPtr, psPtr);
- memcpy((VOID *) psPtr->pats, (VOID *) patPtr, sequenceSize);
+ memcpy((void *) psPtr->pats, (void *) patPtr, sequenceSize);
- done:
+ done:
*maskPtr = eventMask;
return psPtr;
}
@@ -4160,34 +4109,31 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
*
* ParseEventDescription --
*
- * Fill Pattern buffer with information about event from
- * event string.
+ * Fill Pattern buffer with information about event from event string.
*
* Results:
- * Leaves error message in interp and returns 0 if there was an
- * error due to a badly formed event string. Returns 1 if proper
- * event was specified, 2 if Double modifier was used in event
- * string, or 3 if Triple was used.
+ * Leaves error message in interp and returns 0 if there was an error due
+ * to a badly formed event string. Returns 1 if proper event was
+ * specified, 2 if Double modifier was used in event string, or 3 if
+ * Triple was used.
*
* Side effects:
* On exit, eventStringPtr points to rest of event string (after the
- * closing '>', so that this procedure can be called repeatedly to
- * parse all the events in the entire sequence.
+ * closing '>', so that this function can be called repeatedly to parse
+ * all the events in the entire sequence.
*
*---------------------------------------------------------------------------
*/
static int
-ParseEventDescription(interp, eventStringPtr, patPtr,
- eventMaskPtr)
- Tcl_Interp *interp; /* For error messages. */
- CONST char **eventStringPtr;/* On input, holds a pointer to start of
- * event string. On exit, gets pointer to
- * rest of string after parsed event. */
- Pattern *patPtr; /* Filled with the pattern parsed from the
+ParseEventDescription(
+ Tcl_Interp *interp, /* For error messages. */
+ const char **eventStringPtr,/* On input, holds a pointer to start of event
+ * string. On exit, gets pointer to rest of
+ * string after parsed event. */
+ Pattern *patPtr, /* Filled with the pattern parsed from the
* event string. */
- unsigned long *eventMaskPtr;/* Filled with event mask of matched event. */
-
+ unsigned long *eventMaskPtr)/* Filled with event mask of matched event. */
{
char *p;
unsigned long eventMask;
@@ -4206,7 +4152,7 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
eventMask = 0;
count = 1;
-
+
/*
* Handle simple ASCII characters.
*/
@@ -4224,7 +4170,7 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
patPtr->detail.keySym = *p;
} else {
char buf[64];
-
+
sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
count = 0;
@@ -4236,8 +4182,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
}
/*
- * A fancier event description. This can be either a virtual event
- * or a physical event.
+ * A fancier event description. This can be either a virtual event or a
+ * physical event.
*
* A virtual event description consists of:
*
@@ -4248,30 +4194,30 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
* A physical event description consists of:
*
* 1. open angle bracket.
- * 2. any number of modifiers, each followed by spaces
- * or dashes.
+ * 2. any number of modifiers, each followed by spaces or dashes.
* 3. an optional event name.
- * 4. an option button or keysym name. Either this or
- * item 3 *must* be present; if both are present
- * then they are separated by spaces or dashes.
+ * 4. an option button or keysym name. Either this or item 3 *must* be
+ * present; if both are present then they are separated by spaces or
+ * dashes.
* 5. a close angle bracket.
*/
p++;
if (*p == '<') {
/*
- * This is a virtual event: soak up all the characters up to
- * the next '>'.
+ * This is a virtual event: soak up all the characters up to the next
+ * '>'.
*/
- char *field = p + 1;
+ char *field = p + 1;
+
p = strchr(field, '>');
if (p == field) {
Tcl_SetResult(interp, "virtual event \"<<>>\" is badly formed",
TCL_STATIC);
count = 0;
goto done;
- }
+ }
if ((p == NULL) || (p[1] != '>')) {
Tcl_SetResult(interp, "missing \">\" in virtual binding",
TCL_STATIC);
@@ -4290,13 +4236,15 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
while (1) {
ModInfo *modPtr;
+
p = GetField(p, field, FIELD_SIZE);
if (*p == '>') {
/*
* This solves the problem of, e.g., <Control-M> being
- * misinterpreted as Control + Meta + missing keysym
- * instead of Control + KeyPress + M.
+ * misinterpreted as Control + Meta + missing keysym instead of
+ * Control + KeyPress + M.
*/
+
break;
}
hPtr = Tcl_FindHashEntry(&modTable, field);
@@ -4305,10 +4253,13 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
}
modPtr = (ModInfo *) Tcl_GetHashValue(hPtr);
patPtr->needMods |= modPtr->mask;
- if (modPtr->flags & (MULT_CLICKS)) {
+ if (modPtr->flags & MULT_CLICKS) {
int i = modPtr->flags & MULT_CLICKS;
+
count = 2;
- while (i >>= 1) count++;
+ while (i >>= 1) {
+ count++;
+ }
}
while ((*p == '-') || isspace(UCHAR(*p))) {
p++;
@@ -4318,8 +4269,7 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
eventFlags = 0;
hPtr = Tcl_FindHashEntry(&eventTable, field);
if (hPtr != NULL) {
- EventInfo *eiPtr;
- eiPtr = (EventInfo *) Tcl_GetHashValue(hPtr);
+ EventInfo *eiPtr = (EventInfo *) Tcl_GetHashValue(hPtr);
patPtr->eventType = eiPtr->type;
eventFlags = flagArray[eiPtr->type];
@@ -4338,17 +4288,18 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
goto getKeysym;
} else if ((eventFlags & BUTTON) == 0) {
Tcl_AppendResult(interp, "specified button \"", field,
- "\" for non-button event", (char *) NULL);
+ "\" for non-button event", NULL);
count = 0;
goto done;
}
patPtr->detail.button = (*field - '0');
} else {
- getKeysym:
+
+ getKeysym:
patPtr->detail.keySym = TkStringToKeysym(field);
if (patPtr->detail.keySym == NoSymbol) {
Tcl_AppendResult(interp, "bad event type or keysym \"",
- field, "\"", (char *) NULL);
+ field, "\"", NULL);
count = 0;
goto done;
}
@@ -4357,7 +4308,7 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
eventMask = KeyPressMask;
} else if ((eventFlags & KEY) == 0) {
Tcl_AppendResult(interp, "specified keysym \"", field,
- "\" for non-key event", (char *) NULL);
+ "\" for non-key event", NULL);
count = 0;
goto done;
}
@@ -4389,10 +4340,10 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
}
p++;
-end:
+ end:
*eventStringPtr += (p - Tcl_DStringValue(&copy));
*eventMaskPtr |= eventMask;
-done:
+ done:
Tcl_DStringFree(&copy);
return count;
}
@@ -4402,17 +4353,15 @@ done:
*
* GetField --
*
- * Used to parse pattern descriptions. Copies up to
- * size characters from p to copy, stopping at end of
- * string, space, "-", ">", or whenever size is
- * exceeded.
+ * Used to parse pattern descriptions. Copies up to size characters from
+ * p to copy, stopping at end of string, space, "-", ">", or whenever
+ * size is exceeded.
*
* Results:
- * The return value is a pointer to the character just
- * after the last one copied (usually "-" or space or
- * ">", but could be anything if size was exceeded).
- * Also places NULL-terminated string (up to size
- * character, including NULL), at copy.
+ * The return value is a pointer to the character just after the last one
+ * copied (usually "-" or space or ">", but could be anything if size was
+ * exceeded). Also places NULL-terminated string (up to size character,
+ * including NULL), at copy.
*
* Side effects:
* None.
@@ -4421,11 +4370,10 @@ done:
*/
static char *
-GetField(p, copy, size)
- char *p; /* Pointer to part of pattern. */
- char *copy; /* Place to copy field. */
- int size; /* Maximum number of characters to
- * copy. */
+GetField(
+ char *p, /* Pointer to part of pattern. */
+ char *copy, /* Place to copy field. */
+ int size) /* Maximum number of characters to copy. */
{
while ((*p != '\0') && !isspace(UCHAR(*p)) && (*p != '>')
&& (*p != '-') && (size > 1)) {
@@ -4443,22 +4391,23 @@ GetField(p, copy, size)
*
* GetPatternString --
*
- * Produce a string version of the given event, for displaying to
- * the user.
+ * Produce a string version of the given event, for displaying to the
+ * user.
*
* Results:
* The string is left in dsPtr.
*
* Side effects:
- * It is the caller's responsibility to initialize the DString before
- * and to free it after calling this procedure.
+ * It is the caller's responsibility to initialize the DString before and
+ * to free it after calling this function.
*
*---------------------------------------------------------------------------
*/
+
static void
-GetPatternString(psPtr, dsPtr)
- PatSeq *psPtr;
- Tcl_DString *dsPtr;
+GetPatternString(
+ PatSeq *psPtr,
+ Tcl_DString *dsPtr)
{
Pattern *patPtr;
char c, buffer[TCL_INTEGER_SPACE];
@@ -4473,19 +4422,17 @@ GetPatternString(psPtr, dsPtr)
for (patsLeft = psPtr->numPats, patPtr = &psPtr->pats[psPtr->numPats - 1];
patsLeft > 0; patsLeft--, patPtr--) {
-
/*
* Check for simple case of an ASCII character.
*/
if ((patPtr->eventType == KeyPress)
- && ((psPtr->flags & PAT_NEARBY) == 0)
+ && ((psPtr->flags & PAT_NEARBY) == 0)
&& (patPtr->needMods == 0)
&& (patPtr->detail.keySym < 128)
&& isprint(UCHAR(patPtr->detail.keySym))
&& (patPtr->detail.keySym != '<')
&& (patPtr->detail.keySym != ' ')) {
-
c = (char) patPtr->detail.keySym;
Tcl_DStringAppend(dsPtr, &c, 1);
continue;
@@ -4503,12 +4450,13 @@ GetPatternString(psPtr, dsPtr)
}
/*
- * It's a more general event specification. First check
- * for "Double", "Triple", "Quadruple", then modifiers,
- * then event type, then keysym or button detail.
+ * It's a more general event specification. First check for "Double",
+ * "Triple", "Quadruple", then modifiers, then event type, then keysym
+ * or button detail.
*/
Tcl_DStringAppend(dsPtr, "<", 1);
+
if ((psPtr->flags & PAT_NEARBY) && (patsLeft > 1)
&& (memcmp((char *) patPtr, (char *) (patPtr-1),
sizeof(Pattern)) == 0)) {
@@ -4530,6 +4478,7 @@ GetPatternString(psPtr, dsPtr)
Tcl_DStringAppend(dsPtr, "Double-", 7);
}
}
+
for (needMods = patPtr->needMods, modPtr = modArray;
needMods != 0; modPtr++) {
if (modPtr->mask & needMods) {
@@ -4538,6 +4487,7 @@ GetPatternString(psPtr, dsPtr)
Tcl_DStringAppend(dsPtr, "-", 1);
}
}
+
for (eiPtr = eventArray; eiPtr->name != NULL; eiPtr++) {
if (eiPtr->type == patPtr->eventType) {
Tcl_DStringAppend(dsPtr, eiPtr->name, -1);
@@ -4551,9 +4501,7 @@ GetPatternString(psPtr, dsPtr)
if (patPtr->detail.clientData != 0) {
if ((patPtr->eventType == KeyPress)
|| (patPtr->eventType == KeyRelease)) {
- char *string;
-
- string = TkKeysymToString(patPtr->detail.keySym);
+ char *string = TkKeysymToString(patPtr->detail.keySym);
if (string != NULL) {
Tcl_DStringAppend(dsPtr, string, -1);
}
@@ -4562,6 +4510,7 @@ GetPatternString(psPtr, dsPtr)
Tcl_DStringAppend(dsPtr, buffer, -1);
}
}
+
Tcl_DStringAppend(dsPtr, ">", 1);
}
}
@@ -4571,8 +4520,8 @@ GetPatternString(psPtr, dsPtr)
*
* EvalTclBinding --
*
- * The procedure that is invoked by Tk_BindEvent when a Tcl binding
- * is fired.
+ * 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
@@ -4585,8 +4534,8 @@ GetPatternString(psPtr, dsPtr)
*/
static void
-FreeTclBinding(clientData)
- ClientData clientData;
+FreeTclBinding(
+ ClientData clientData)
{
ckfree((char *) clientData);
}
@@ -4596,12 +4545,11 @@ FreeTclBinding(clientData)
*
* TkStringToKeysym --
*
- * This procedure finds the keysym associated with a given keysym
- * name.
+ * This function finds the keysym associated with a given keysym name.
*
* Results:
- * The return value is the keysym that corresponds to name, or
- * NoSymbol if there is no such keysym.
+ * The return value is the keysym that corresponds to name, or NoSymbol
+ * if there is no such keysym.
*
* Side effects:
* None.
@@ -4610,19 +4558,18 @@ FreeTclBinding(clientData)
*/
KeySym
-TkStringToKeysym(name)
- char *name; /* Name of a keysym. */
+TkStringToKeysym(
+ char *name) /* Name of a keysym. */
{
#ifdef REDO_KEYSYM_LOOKUP
- Tcl_HashEntry *hPtr;
- KeySym keysym;
+ Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&keySymTable, name);
- hPtr = Tcl_FindHashEntry(&keySymTable, name);
if (hPtr != NULL) {
return (KeySym) Tcl_GetHashValue(hPtr);
}
if (strlen(name) == 1) {
- keysym = (KeySym) (unsigned char) name[0];
+ KeySym keysym = (KeySym) (unsigned char) name[0];
+
if (TkKeysymToString(keysym) != NULL) {
return keysym;
}
@@ -4636,12 +4583,11 @@ TkStringToKeysym(name)
*
* TkKeysymToString --
*
- * This procedure finds the keysym name associated with a given
- * keysym.
+ * This function finds the keysym name associated with a given keysym.
*
* Results:
- * The return value is a pointer to a static string containing
- * the name of the given keysym, or NULL if there is no known name.
+ * The return value is a pointer to a static string containing the name
+ * of the given keysym, or NULL if there is no known name.
*
* Side effects:
* None.
@@ -4650,17 +4596,17 @@ TkStringToKeysym(name)
*/
char *
-TkKeysymToString(keysym)
- KeySym keysym;
+TkKeysymToString(
+ KeySym keysym)
{
#ifdef REDO_KEYSYM_LOOKUP
- Tcl_HashEntry *hPtr;
+ Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&nameTable, (char *)keysym);
- hPtr = Tcl_FindHashEntry(&nameTable, (char *)keysym);
if (hPtr != NULL) {
return (char *) Tcl_GetHashValue(hPtr);
}
#endif /* REDO_KEYSYM_LOOKUP */
+
return XKeysymToString(keysym);
}
@@ -4669,25 +4615,24 @@ TkKeysymToString(keysym)
*
* TkCopyAndGlobalEval --
*
- * This procedure makes a copy of a script then passes to Tcl
- * to evaluate it. It's used in situations where the execution of
- * a command may cause the original command string to be reallocated.
+ * 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.
+ * Returns the result of evaluating script, including both a standard Tcl
+ * completion code and a string in the interp's result.
*
* Side effects:
- * None.
+ * Any; depends on script.
*
*----------------------------------------------------------------------
*/
int
-TkCopyAndGlobalEval(interp, script)
- Tcl_Interp *interp; /* Interpreter in which to evaluate
- * script. */
- char *script; /* Script to evaluate. */
+TkCopyAndGlobalEval(
+ Tcl_Interp *interp, /* Interpreter in which to evaluate script. */
+ char *script) /* Script to evaluate. */
{
Tcl_DString buffer;
int code;
@@ -4699,5 +4644,40 @@ TkCopyAndGlobalEval(interp, script)
Tcl_DStringFree(&buffer);
return code;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetBindingXEvent --
+ *
+ * This function returns the XEvent associated with the currently
+ * executing binding. This function can only be invoked while a binding
+ * is executing.
+ *
+ * Results:
+ * Returns a pointer to the XEvent that caused the current binding code
+ * to be run.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+XEvent *
+TkpGetBindingXEvent(
+ Tcl_Interp *interp) /* Interpreter. */
+{
+ TkWindow *winPtr = (TkWindow *) Tk_MainWindow(interp);
+ BindingTable *bindPtr = (BindingTable *) winPtr->mainPtr->bindingTable;
+ return &(bindPtr->eventRing[bindPtr->curEvent]);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 173de25..81e9678 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -1,126 +1,123 @@
-/*
+/*
* tkBitmap.c --
*
* This file maintains a database of read-only bitmaps for the Tk
- * toolkit. This allows bitmaps to be shared between widgets and
- * also avoids interactions with the X server.
+ * toolkit. This allows bitmaps to be shared between widgets and also
+ * avoids interactions with the X server.
*
* Copyright (c) 1990-1994 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.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
* The includes below are for pre-defined bitmaps.
*
- * Platform-specific issue: Windows complains when the bitmaps are
- * included, because an array of characters is being initialized with
- * integers as elements. For lint purposes, the following pragmas
- * temporarily turn off that warning message.
+ * Platform-specific issue: Windows complains when the bitmaps are included,
+ * because an array of characters is being initialized with integers as
+ * elements. For lint purposes, the following pragmas temporarily turn off
+ * that warning message.
*/
-#if defined(__WIN32__) || defined(_WIN32)
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__)
#pragma warning (disable : 4305)
#endif
-#include "error.bmp"
-#include "gray12.bmp"
-#include "gray25.bmp"
-#include "gray50.bmp"
-#include "gray75.bmp"
-#include "hourglass.bmp"
-#include "info.bmp"
-#include "questhead.bmp"
-#include "question.bmp"
-#include "warning.bmp"
-
-#if defined(__WIN32__) || defined(_WIN32)
+#include "error.xbm"
+#include "gray12.xbm"
+#include "gray25.xbm"
+#include "gray50.xbm"
+#include "gray75.xbm"
+#include "hourglass.xbm"
+#include "info.xbm"
+#include "questhead.xbm"
+#include "question.xbm"
+#include "warning.xbm"
+
+#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__)
#pragma warning (default : 4305)
#endif
/*
* One of the following data structures exists for each bitmap that is
- * currently in use. Each structure is indexed with both "idTable" and
+ * currently in use. Each structure is indexed with both "idTable" and
* "nameTable".
*/
typedef struct TkBitmap {
- Pixmap bitmap; /* X identifier for bitmap. None means this
- * bitmap was created by Tk_DefineBitmap
- * and it isn't currently in use. */
+ Pixmap bitmap; /* X identifier for bitmap. None means this
+ * bitmap was created by Tk_DefineBitmap and
+ * it isn't currently in use. */
int width, height; /* Dimensions of bitmap. */
Display *display; /* Display for which bitmap is valid. */
- int screenNum; /* Screen on which bitmap is valid */
+ int screenNum; /* Screen on which bitmap is valid. */
int resourceRefCount; /* Number of active uses of this bitmap (each
* active use corresponds to a call to
- * Tk_AllocBitmapFromObj or Tk_GetBitmap).
- * If this count is 0, then this TkBitmap
+ * Tk_AllocBitmapFromObj or Tk_GetBitmap). If
+ * this count is 0, then this TkBitmap
* structure is no longer valid and it isn't
* present in nameTable: it is being kept
* around only because there are objects
- * referring to it. The structure is freed
- * when resourceRefCount and objRefCount
- * are both 0. */
- int objRefCount; /* Number of Tcl_Obj's that reference
- * this structure. */
+ * referring to it. The structure is freed
+ * when resourceRefCount and objRefCount are
+ * both 0. */
+ int objRefCount; /* Number of Tcl_Obj's that reference this
+ * structure. */
Tcl_HashEntry *nameHashPtr; /* Entry in nameTable for this structure
* (needed when deleting). */
- Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure
- * (needed when deleting). */
+ Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure (needed
+ * when deleting). */
struct TkBitmap *nextPtr; /* Points to the next TkBitmap structure with
- * the same name. All bitmaps with the
- * same name (but different displays or
- * screens) are chained together off a
- * single entry in nameTable. */
+ * the same name. All bitmaps with the same
+ * name (but different displays or screens)
+ * are chained together off a single entry in
+ * nameTable. */
} TkBitmap;
-/*
- * Used in bitmapDataTable, stored in the TkDisplay structure, to map
- * between in-core data about a bitmap to its TkBitmap structure.
+/*
+ * Used in bitmapDataTable, stored in the TkDisplay structure, to map between
+ * in-core data about a bitmap to its TkBitmap structure.
*/
typedef struct {
- CONST char *source; /* Bitmap bits. */
+ const char *source; /* Bitmap bits. */
int width, height; /* Dimensions of bitmap. */
} DataKey;
typedef struct ThreadSpecificData {
- int initialized; /* 0 means table below needs initializing. */
+ int initialized; /* 0 means table below needs initializing. */
Tcl_HashTable predefBitmapTable;
- /* Hash table created by Tk_DefineBitmap
- * to map from a name to a collection
- * of in-core data about a bitmap. The
- * table is indexed by the address of the
- * data for the bitmap, and the entries
- * contain pointers to TkPredefBitmap
- * structures. */
+ /* Hash table created by Tk_DefineBitmap to
+ * map from a name to a collection of in-core
+ * data about a bitmap. The table is indexed
+ * by the address of the data for the bitmap,
+ * and the entries contain pointers to
+ * TkPredefBitmap structures. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void BitmapInit _ANSI_ARGS_((TkDisplay *dispPtr));
-static void DupBitmapObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
- Tcl_Obj *dupObjPtr));
-static void FreeBitmap _ANSI_ARGS_((TkBitmap *bitmapPtr));
-static void FreeBitmapObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
-static TkBitmap * GetBitmap _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *name));
-static TkBitmap * GetBitmapFromObj _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj *objPtr));
-static void InitBitmapObj _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void BitmapInit(TkDisplay *dispPtr);
+static void DupBitmapObjProc(Tcl_Obj *srcObjPtr,
+ Tcl_Obj *dupObjPtr);
+static void FreeBitmap(TkBitmap *bitmapPtr);
+static void FreeBitmapObjProc(Tcl_Obj *objPtr);
+static TkBitmap * GetBitmap(Tcl_Interp *interp, Tk_Window tkwin,
+ const char *name);
+static TkBitmap * GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr);
+static void InitBitmapObj(Tcl_Obj *objPtr);
/*
* The following structure defines the implementation of the "bitmap" Tcl
- * object, which maps a string bitmap name to a TkBitmap object. The
- * ptr1 field of the Tcl_Obj points to a TkBitmap object.
+ * object, which maps a string bitmap name to a TkBitmap object. The ptr1
+ * field of the Tcl_Obj points to a TkBitmap object.
*/
Tcl_ObjType tkBitmapObjType = {
@@ -136,33 +133,33 @@ Tcl_ObjType tkBitmapObjType = {
*
* Tk_AllocBitmapFromObj --
*
- * Given a Tcl_Obj *, map the value to a corresponding
- * Pixmap structure based on the tkwin given.
+ * Given a Tcl_Obj *, map the value to a corresponding Pixmap structure
+ * based on the tkwin given.
*
* Results:
- * The return value is the X identifer for the desired bitmap
- * (i.e. a Pixmap with a single plane), unless string couldn't be
- * parsed correctly. In this case, None is returned and an error
- * message is left in the interp's result. The caller should never
- * modify the bitmap that is returned, and should eventually call
- * Tk_FreeBitmapFromObj when the bitmap is no longer needed.
+ * The return value is the X identifer for the desired bitmap (i.e. a
+ * Pixmap with a single plane), unless string couldn't be parsed
+ * correctly. In this case, None is returned and an error message is left
+ * in the interp's result. The caller should never modify the bitmap that
+ * is returned, and should eventually call Tk_FreeBitmapFromObj when the
+ * bitmap is no longer needed.
*
* Side effects:
* The bitmap is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeBitmapFromObj, so that the database can be cleaned up
- * when bitmaps aren't needed anymore.
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeBitmapFromObj, so that the database can be cleaned up when
+ * bitmaps aren't needed anymore.
*
*----------------------------------------------------------------------
*/
Pixmap
-Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
- Tcl_Interp *interp; /* Interp for error results. This may
- * be NULL. */
- Tk_Window tkwin; /* Need the screen the bitmap is used on.*/
- Tcl_Obj *objPtr; /* Object describing bitmap; see manual
- * entry for legal syntax of string value. */
+Tk_AllocBitmapFromObj(
+ Tcl_Interp *interp, /* Interp for error results. This may be
+ * NULL. */
+ Tk_Window tkwin, /* Need the screen the bitmap is used on.*/
+ Tcl_Obj *objPtr) /* Object describing bitmap; see manual entry
+ * for legal syntax of string value. */
{
TkBitmap *bitmapPtr;
@@ -172,54 +169,54 @@ Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
/*
- * If the object currently points to a TkBitmap, see if it's the
- * one we want. If so, increment its reference count and return.
+ * If the object currently points to a TkBitmap, see if it's the one we
+ * want. If so, increment its reference count and return.
*/
if (bitmapPtr != NULL) {
if (bitmapPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a TkBitmap that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a TkBitmap that's no
+ * longer in use. Clear the reference.
*/
FreeBitmapObjProc(objPtr);
bitmapPtr = NULL;
- } else if ( (Tk_Display(tkwin) == bitmapPtr->display)
- && (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum) ) {
+ } else if ((Tk_Display(tkwin) == bitmapPtr->display)
+ && (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum)) {
bitmapPtr->resourceRefCount++;
return bitmapPtr->bitmap;
}
}
/*
- * The object didn't point to the TkBitmap that we wanted. Search
- * the list of TkBitmaps with the same name to see if one of the
- * others is the right one.
+ * The object didn't point to the TkBitmap that we wanted. Search the list
+ * of TkBitmaps with the same name to see if one of the others is the
+ * right one.
*/
if (bitmapPtr != NULL) {
- TkBitmap *firstBitmapPtr =
- (TkBitmap *) Tcl_GetHashValue(bitmapPtr->nameHashPtr);
+ TkBitmap *firstBitmapPtr = (TkBitmap *)
+ Tcl_GetHashValue(bitmapPtr->nameHashPtr);
FreeBitmapObjProc(objPtr);
for (bitmapPtr = firstBitmapPtr; 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++;
bitmapPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
return bitmapPtr->bitmap;
}
}
}
/*
- * Still no luck. Call GetBitmap to allocate a new TkBitmap object.
+ * Still no luck. Call GetBitmap to allocate a new TkBitmap object.
*/
bitmapPtr = GetBitmap(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
if (bitmapPtr == NULL) {
return None;
}
@@ -232,35 +229,36 @@ Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
*
* Tk_GetBitmap --
*
- * Given a string describing a bitmap, locate (or create if necessary)
- * a bitmap that fits the description.
+ * Given a string describing a bitmap, locate (or create if necessary) a
+ * bitmap that fits the description.
*
* Results:
- * The return value is the X identifer for the desired bitmap
- * (i.e. a Pixmap with a single plane), unless string couldn't be
- * parsed correctly. In this case, None is returned and an error
- * message is left in the interp's result. The caller should never
- * modify the bitmap that is returned, and should eventually call
- * Tk_FreeBitmap when the bitmap is no longer needed.
+ * The return value is the X identifer for the desired bitmap (i.e. a
+ * Pixmap with a single plane), unless string couldn't be parsed
+ * correctly. In this case, None is returned and an error message is left
+ * in the interp's result. The caller should never modify the bitmap that
+ * is returned, and should eventually call Tk_FreeBitmap when the bitmap
+ * is no longer needed.
*
* Side effects:
* The bitmap is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeBitmap, so that the database can be cleaned up when bitmaps
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeBitmap, so that the database can be cleaned up when bitmaps
* aren't needed anymore.
*
*----------------------------------------------------------------------
*/
Pixmap
-Tk_GetBitmap(interp, tkwin, string)
- Tcl_Interp *interp; /* Interpreter to use for error reporting,
+Tk_GetBitmap(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting,
* this may be NULL. */
- Tk_Window tkwin; /* Window in which bitmap will be used. */
- CONST char *string; /* Description of bitmap. See manual entry
- * for details on legal syntax. */
+ Tk_Window tkwin, /* Window in which bitmap will be used. */
+ const char *string) /* Description of bitmap. See manual entry for
+ * details on legal syntax. */
{
TkBitmap *bitmapPtr = GetBitmap(interp, tkwin, string);
+
if (bitmapPtr == NULL) {
return None;
}
@@ -272,53 +270,52 @@ Tk_GetBitmap(interp, tkwin, string)
*
* GetBitmap --
*
- * Given a string describing a bitmap, locate (or create if necessary)
- * a bitmap that fits the description. This routine returns the
- * internal data structure for the bitmap. This avoids extra
- * hash table lookups in Tk_AllocBitmapFromObj.
+ * Given a string describing a bitmap, locate (or create if necessary) a
+ * bitmap that fits the description. This routine returns the internal
+ * data structure for the bitmap. This avoids extra hash table lookups in
+ * Tk_AllocBitmapFromObj.
*
* Results:
- * The return value is the X identifer for the desired bitmap
- * (i.e. a Pixmap with a single plane), unless string couldn't be
- * parsed correctly. In this case, None is returned and an error
- * message is left in the interp's result. The caller should never
- * modify the bitmap that is returned, and should eventually call
- * Tk_FreeBitmap when the bitmap is no longer needed.
+ * The return value is the X identifer for the desired bitmap (i.e. a
+ * Pixmap with a single plane), unless string couldn't be parsed
+ * correctly. In this case, None is returned and an error message is left
+ * in the interp's result. The caller should never modify the bitmap that
+ * is returned, and should eventually call Tk_FreeBitmap when the bitmap
+ * is no longer needed.
*
* Side effects:
* The bitmap is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeBitmap or Tk_FreeBitmapFromObj, so that the database can
- * be cleaned up when bitmaps aren't needed anymore.
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeBitmap or Tk_FreeBitmapFromObj, so that the database can be
+ * cleaned up when bitmaps aren't needed anymore.
*
*----------------------------------------------------------------------
*/
static TkBitmap *
-GetBitmap(interp, tkwin, string)
- Tcl_Interp *interp; /* Interpreter to use for error reporting,
+GetBitmap(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting,
* this may be NULL. */
- Tk_Window tkwin; /* Window in which bitmap will be used. */
- CONST char *string; /* Description of bitmap. See manual entry
- * for details on legal syntax. */
+ Tk_Window tkwin, /* Window in which bitmap will be used. */
+ const char *string) /* Description of bitmap. See manual entry for
+ * details on legal syntax. */
{
Tcl_HashEntry *nameHashPtr, *predefHashPtr;
TkBitmap *bitmapPtr, *existingBitmapPtr;
TkPredefBitmap *predefPtr;
- int new;
Pixmap bitmap;
- int width, height;
- int dummy2;
+ int isNew, width, height, dummy2;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!dispPtr->bitmapInit) {
BitmapInit(dispPtr);
}
- nameHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapNameTable, string, &new);
- if (!new) {
+ nameHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapNameTable, string,
+ &isNew);
+ if (!isNew) {
existingBitmapPtr = (TkBitmap *) Tcl_GetHashValue(nameHashPtr);
for (bitmapPtr = existingBitmapPtr; bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
@@ -333,26 +330,25 @@ GetBitmap(interp, tkwin, string)
}
/*
- * No suitable bitmap exists. Create a new bitmap from the
- * information contained in the string. If the string starts
- * with "@" then the rest of the string is a file name containing
- * the bitmap. Otherwise the string must refer to a bitmap
- * defined by a call to Tk_DefineBitmap.
+ * No suitable bitmap exists. Create a new bitmap from the information
+ * contained in the string. If the string starts with "@" then the rest of
+ * the string is a file name containing the bitmap. Otherwise the string
+ * must refer to a bitmap defined by a call to Tk_DefineBitmap.
*/
if (*string == '@') { /* INTL: ISO char */
Tcl_DString buffer;
int result;
- if (Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't specify bitmap with '@' in a",
- " safe interpreter", (char *) NULL);
- goto error;
- }
+ if (Tcl_IsSafe(interp)) {
+ Tcl_AppendResult(interp, "can't specify bitmap with '@' in a",
+ " safe interpreter", NULL);
+ goto error;
+ }
/*
- * Note that we need to cast away the CONST from the string because
- * Tcl_TranslateFileName is non const, even though it doesn't modify
+ * Note that we need to cast away the const from the string because
+ * Tcl_TranslateFileName is non-const, even though it doesn't modify
* the string.
*/
@@ -366,29 +362,29 @@ GetBitmap(interp, tkwin, string)
&bitmap, &dummy2, &dummy2);
if (result != BitmapSuccess) {
if (interp != NULL) {
- Tcl_AppendResult(interp, "error reading bitmap file \"", string,
- "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "error reading bitmap file \"",
+ string, "\"", NULL);
}
Tcl_DStringFree(&buffer);
goto error;
}
Tcl_DStringFree(&buffer);
} else {
- predefHashPtr = Tcl_FindHashEntry(&tsdPtr->predefBitmapTable,
- string);
+ predefHashPtr = Tcl_FindHashEntry(&tsdPtr->predefBitmapTable, string);
if (predefHashPtr == NULL) {
/*
- * The following platform specific call allows the user to
- * define bitmaps that may only exist during run time. If
- * it returns None nothing was found and we return the error.
+ * The following platform specific call allows the user to define
+ * bitmaps that may only exist during run time. If it returns None
+ * nothing was found and we return the error.
*/
+
bitmap = TkpGetNativeAppBitmap(Tk_Display(tkwin), string,
&width, &height);
-
+
if (bitmap == None) {
if (interp != NULL) {
Tcl_AppendResult(interp, "bitmap \"", string,
- "\" not defined", (char *) NULL);
+ "\" not defined", NULL);
}
goto error;
}
@@ -400,13 +396,12 @@ GetBitmap(interp, tkwin, string)
bitmap = TkpCreateNativeBitmap(Tk_Display(tkwin),
predefPtr->source);
if (bitmap == None) {
- panic("native bitmap creation failed");
+ Tcl_Panic("native bitmap creation failed");
}
} else {
bitmap = XCreateBitmapFromData(Tk_Display(tkwin),
- RootWindowOfScreen(Tk_Screen(tkwin)),
- predefPtr->source,
- (unsigned) width, (unsigned) height);
+ RootWindowOfScreen(Tk_Screen(tkwin)),
+ predefPtr->source, (unsigned)width, (unsigned)height);
}
}
}
@@ -424,18 +419,18 @@ GetBitmap(interp, tkwin, string)
bitmapPtr->resourceRefCount = 1;
bitmapPtr->objRefCount = 0;
bitmapPtr->nameHashPtr = nameHashPtr;
- bitmapPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapIdTable,
- (char *) bitmap, &new);
- if (!new) {
- panic("bitmap already registered in Tk_GetBitmap");
+ bitmapPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapIdTable,
+ (char *) bitmap, &isNew);
+ if (!isNew) {
+ Tcl_Panic("bitmap already registered in Tk_GetBitmap");
}
bitmapPtr->nextPtr = existingBitmapPtr;
Tcl_SetHashValue(nameHashPtr, bitmapPtr);
Tcl_SetHashValue(bitmapPtr->idHashPtr, bitmapPtr);
return bitmapPtr;
- error:
- if (new) {
+ error:
+ if (isNew) {
Tcl_DeleteHashEntry(nameHashPtr);
}
return NULL;
@@ -446,53 +441,53 @@ GetBitmap(interp, tkwin, string)
*
* Tk_DefineBitmap --
*
- * This procedure associates a textual name with a binary bitmap
- * description, so that the name may be used to refer to the
- * bitmap in future calls to Tk_GetBitmap.
+ * This function associates a textual name with a binary bitmap
+ * description, so that the name may be used to refer to the bitmap in
+ * future calls to Tk_GetBitmap.
*
* Results:
- * A standard Tcl result. If an error occurs then TCL_ERROR is
- * returned and a message is left in the interp's result.
+ * 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.
+ * "Name" is entered into the bitmap table and may be used from here on
+ * to refer to the given bitmap.
*
*----------------------------------------------------------------------
*/
int
-Tk_DefineBitmap(interp, name, source, width, height)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- CONST char *name; /* Name to use for bitmap. Must not already
- * be defined as a bitmap. */
- CONST char *source; /* Address of bits for bitmap. */
- int width; /* Width of bitmap. */
- int height; /* Height of bitmap. */
+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 char *source, /* Address of bits for bitmap. */
+ int width, /* Width of bitmap. */
+ int height) /* Height of bitmap. */
{
- int new;
+ int isNew;
Tcl_HashEntry *predefHashPtr;
TkPredefBitmap *predefPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- /*
+ /*
* Initialize the Bitmap module if not initialized already for this
- * thread. Since the current TkDisplay structure cannot be
- * introspected from here, pass a NULL pointer to BitmapInit,
- * which will know to initialize only the data in the
- * ThreadSpecificData structure for the current thread.
- */
+ * thread. Since the current TkDisplay structure cannot be introspected
+ * from here, pass a NULL pointer to BitmapInit, which will know to
+ * initialize only the data in the ThreadSpecificData structure for the
+ * current thread.
+ */
if (!tsdPtr->initialized) {
- BitmapInit((TkDisplay *) NULL);
+ BitmapInit(NULL);
}
- predefHashPtr = Tcl_CreateHashEntry(&tsdPtr->predefBitmapTable,
- name, &new);
- if (!new) {
- Tcl_AppendResult(interp, "bitmap \"", name,
- "\" is already defined", (char *) NULL);
+ predefHashPtr = Tcl_CreateHashEntry(&tsdPtr->predefBitmapTable,
+ name, &isNew);
+ if (!isNew) {
+ Tcl_AppendResult(interp, "bitmap \"", name, "\" is already defined",
+ NULL);
return TCL_ERROR;
}
predefPtr = (TkPredefBitmap *) ckalloc(sizeof(TkPredefBitmap));
@@ -509,8 +504,7 @@ Tk_DefineBitmap(interp, name, source, width, height)
*
* Tk_NameOfBitmap --
*
- * Given a bitmap, return a textual string identifying the
- * bitmap.
+ * Given a bitmap, return a textual string identifying the bitmap.
*
* Results:
* The return value is the string name associated with bitmap.
@@ -521,19 +515,18 @@ Tk_DefineBitmap(interp, name, source, width, height)
*--------------------------------------------------------------
*/
-CONST char *
-Tk_NameOfBitmap(display, bitmap)
- Display *display; /* Display for which bitmap was
- * allocated. */
- Pixmap bitmap; /* Bitmap whose name is wanted. */
+const char *
+Tk_NameOfBitmap(
+ Display *display, /* Display for which bitmap was allocated. */
+ Pixmap bitmap) /* Bitmap whose name is wanted. */
{
Tcl_HashEntry *idHashPtr;
TkBitmap *bitmapPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
if (dispPtr == NULL || !dispPtr->bitmapInit) {
- unknown:
- panic("Tk_NameOfBitmap received unknown bitmap argument");
+ unknown:
+ Tcl_Panic("Tk_NameOfBitmap received unknown bitmap argument");
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
@@ -549,35 +542,33 @@ Tk_NameOfBitmap(display, bitmap)
*
* Tk_SizeOfBitmap --
*
- * Given a bitmap managed by this module, returns the width
- * and height of the bitmap.
+ * Given a bitmap managed by this module, returns the width and height of
+ * the bitmap.
*
* Results:
- * The words at *widthPtr and *heightPtr are filled in with
- * the dimenstions of bitmap.
+ * The words at *widthPtr and *heightPtr are filled in with the
+ * dimenstions of bitmap.
*
* Side effects:
- * If bitmap isn't managed by this module then the procedure
- * panics..
+ * If bitmap isn't managed by this module then the function panics..
*
*--------------------------------------------------------------
*/
void
-Tk_SizeOfBitmap(display, bitmap, widthPtr, heightPtr)
- Display *display; /* Display for which bitmap was
- * allocated. */
- Pixmap bitmap; /* Bitmap whose size is wanted. */
- int *widthPtr; /* Store bitmap width here. */
- int *heightPtr; /* Store bitmap height here. */
+Tk_SizeOfBitmap(
+ Display *display, /* Display for which bitmap was allocated. */
+ Pixmap bitmap, /* Bitmap whose size is wanted. */
+ int *widthPtr, /* Store bitmap width here. */
+ int *heightPtr) /* Store bitmap height here. */
{
Tcl_HashEntry *idHashPtr;
TkBitmap *bitmapPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
if (!dispPtr->bitmapInit) {
- unknownBitmap:
- panic("Tk_SizeOfBitmap received unknown bitmap argument");
+ unknownBitmap:
+ Tcl_Panic("Tk_SizeOfBitmap received unknown bitmap argument");
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
@@ -594,23 +585,23 @@ Tk_SizeOfBitmap(display, bitmap, widthPtr, heightPtr)
*
* FreeBitmap --
*
- * This procedure does all the work of releasing a bitmap allocated by
- * Tk_GetBitmap or TkGetBitmapFromData. It is invoked by both
+ * This function does all the work of releasing a bitmap allocated by
+ * Tk_GetBitmap or TkGetBitmapFromData. It is invoked by both
* Tk_FreeBitmap and Tk_FreeBitmapFromObj
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with bitmap is decremented, and
- * it is officially deallocated if no-one is using it anymore.
+ * The reference count associated with bitmap is decremented, and it is
+ * officially deallocated if no-one is using it anymore.
*
*----------------------------------------------------------------------
*/
static void
-FreeBitmap(bitmapPtr)
- TkBitmap *bitmapPtr; /* Bitmap to be released. */
+FreeBitmap(
+ TkBitmap *bitmapPtr) /* Bitmap to be released. */
{
TkBitmap *prevPtr;
@@ -644,35 +635,34 @@ FreeBitmap(bitmapPtr)
*
* Tk_FreeBitmap --
*
- * This procedure is called to release a bitmap allocated by
- * Tk_GetBitmap or TkGetBitmapFromData.
+ * This function is called to release a bitmap allocated by Tk_GetBitmap
+ * or TkGetBitmapFromData.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with bitmap is decremented, and
- * it is officially deallocated if no-one is using it anymore.
+ * The reference count associated with bitmap is decremented, and it is
+ * officially deallocated if no-one is using it anymore.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeBitmap(display, bitmap)
- Display *display; /* Display for which bitmap was
- * allocated. */
- Pixmap bitmap; /* Bitmap to be released. */
+Tk_FreeBitmap(
+ Display *display, /* Display for which bitmap was allocated. */
+ Pixmap bitmap) /* Bitmap to be released. */
{
Tcl_HashEntry *idHashPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
if (!dispPtr->bitmapInit) {
- panic("Tk_FreeBitmap called before Tk_GetBitmap");
+ Tcl_Panic("Tk_FreeBitmap called before Tk_GetBitmap");
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->bitmapIdTable, (char *) bitmap);
if (idHashPtr == NULL) {
- panic("Tk_FreeBitmap received unknown bitmap argument");
+ Tcl_Panic("Tk_FreeBitmap received unknown bitmap argument");
}
FreeBitmap((TkBitmap *) Tcl_GetHashValue(idHashPtr));
}
@@ -682,27 +672,27 @@ Tk_FreeBitmap(display, bitmap)
*
* Tk_FreeBitmapFromObj --
*
- * This procedure is called to release a bitmap allocated by
- * Tk_AllocBitmapFromObj. It does not throw away the Tcl_Obj *;
- * it only gets rid of the hash table entry for this bitmap
- * and clears the cached value that is normally stored in the object.
+ * This function is called to release a bitmap allocated by
+ * Tk_AllocBitmapFromObj. It does not throw away the Tcl_Obj *; it only
+ * gets rid of the hash table entry for this bitmap and clears the cached
+ * value that is normally stored in the object.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with the bitmap represented by
- * objPtr is decremented, and the bitmap is released to X if there are
- * no remaining uses for it.
+ * The reference count associated with the bitmap represented by objPtr
+ * is decremented, and the bitmap is released to X if there are no
+ * remaining uses for it.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeBitmapFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window this bitmap lives in. Needed
- * for the display value. */
- Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+Tk_FreeBitmapFromObj(
+ Tk_Window tkwin, /* The window this bitmap lives in. Needed for
+ * the display value. */
+ Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
FreeBitmap(GetBitmapFromObj(tkwin, objPtr));
}
@@ -710,26 +700,25 @@ Tk_FreeBitmapFromObj(tkwin, objPtr)
/*
*---------------------------------------------------------------------------
*
- * FreeBitmapObjProc --
+ * FreeBitmapObjProc --
*
* 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 bitmapPtr needs to be changed.
+ * Called when the object's internal rep is released or when the cached
+ * bitmapPtr needs to be changed.
*
* Results:
* None.
*
* Side effects:
- * The object reference count is decremented. When both it
- * and the hash ref count go to zero, the color's resources
- * are released.
+ * The object reference count is decremented. When both it and the hash
+ * ref count go to zero, the color's resources are released.
*
*---------------------------------------------------------------------------
*/
static void
-FreeBitmapObjProc(objPtr)
- Tcl_Obj *objPtr; /* The object we are releasing. */
+FreeBitmapObjProc(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
{
TkBitmap *bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -739,37 +728,37 @@ FreeBitmapObjProc(objPtr)
&& (bitmapPtr->resourceRefCount == 0)) {
ckfree((char *) bitmapPtr);
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
/*
*---------------------------------------------------------------------------
*
- * DupBitmapObjProc --
+ * DupBitmapObjProc --
*
- * When a cached bitmap object is duplicated, this is called to
- * update the internal reps.
+ * When a cached bitmap object is duplicated, this is called to update
+ * the internal reps.
*
* Results:
* None.
*
* Side effects:
- * The color's objRefCount is incremented and the internal rep
- * of the copy is set to point to it.
+ * The color's objRefCount is incremented and the internal rep of the
+ * copy is set to point to it.
*
*---------------------------------------------------------------------------
*/
static void
-DupBitmapObjProc(srcObjPtr, dupObjPtr)
- Tcl_Obj *srcObjPtr; /* The object we are copying from. */
- Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+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;
-
+
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (VOID *) bitmapPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
if (bitmapPtr != NULL) {
bitmapPtr->objRefCount++;
@@ -781,22 +770,22 @@ DupBitmapObjProc(srcObjPtr, dupObjPtr)
*
* Tk_GetBitmapFromData --
*
- * Given a description of the bits for a bitmap, make a bitmap that
- * has the given properties. *** NOTE: this procedure is obsolete
- * and really shouldn't be used anymore. ***
+ * Given a description of the bits for a bitmap, make a bitmap that has
+ * the given properties. *** NOTE: this function is obsolete and really
+ * shouldn't be used anymore. ***
*
* Results:
- * The return value is the X identifer for the desired bitmap
- * (a one-plane Pixmap), unless it couldn't be created properly.
- * In this case, None is returned and an error message is left in
- * the interp's result. The caller should never modify the bitmap that
- * is returned, and should eventually call Tk_FreeBitmap when the
- * bitmap is no longer needed.
+ * The return value is the X identifer for the desired bitmap (a
+ * one-plane Pixmap), unless it couldn't be created properly. In this
+ * case, None is returned and an error message is left in the interp's
+ * result. The caller should never modify the bitmap that is returned,
+ * and should eventually call Tk_FreeBitmap when the bitmap is no longer
+ * needed.
*
* Side effects:
* The bitmap is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeBitmap, so that the database can be cleaned up when bitmaps
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeBitmap, so that the database can be cleaned up when bitmaps
* aren't needed anymore.
*
*----------------------------------------------------------------------
@@ -804,15 +793,15 @@ DupBitmapObjProc(srcObjPtr, dupObjPtr)
/* ARGSUSED */
Pixmap
-Tk_GetBitmapFromData(interp, tkwin, source, width, height)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- Tk_Window tkwin; /* Window in which bitmap will be used. */
- CONST char *source; /* Bitmap data for bitmap shape. */
- int width, height; /* Dimensions of bitmap. */
+Tk_GetBitmapFromData(
+ 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. */
{
DataKey nameKey;
Tcl_HashEntry *dataHashPtr;
- int new;
+ int isNew;
char string[16 + TCL_INTEGER_SPACE];
char *name;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -826,9 +815,9 @@ Tk_GetBitmapFromData(interp, tkwin, source, width, height)
nameKey.source = source;
nameKey.width = width;
nameKey.height = height;
- dataHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapDataTable,
- (char *) &nameKey, &new);
- if (!new) {
+ dataHashPtr = Tcl_CreateHashEntry(&dispPtr->bitmapDataTable,
+ (char *) &nameKey, &isNew);
+ if (!isNew) {
name = (char *) Tcl_GetHashValue(dataHashPtr);
} else {
dispPtr->bitmapAutoNumber++;
@@ -848,27 +837,28 @@ Tk_GetBitmapFromData(interp, tkwin, source, width, height)
*
* Tk_GetBitmapFromObj --
*
- * Returns the bitmap referred to by a Tcl object. The bitmap must
- * already have been allocated via a call to Tk_AllocBitmapFromObj
- * or Tk_GetBitmap.
+ * Returns the bitmap referred to by a Tcl object. The bitmap must
+ * already have been allocated via a call to Tk_AllocBitmapFromObj or
+ * Tk_GetBitmap.
*
* Results:
- * Returns the Pixmap that matches the tkwin and the string rep
- * of objPtr.
+ * Returns the Pixmap that matches the tkwin and the string rep of
+ * objPtr.
*
* Side effects:
- * If the object is not already a bitmap, the conversion will free
- * any old internal representation.
+ * If the object is not already a bitmap, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
Pixmap
-Tk_GetBitmapFromObj(tkwin, objPtr)
- Tk_Window tkwin;
- Tcl_Obj *objPtr; /* The object from which to get pixels. */
+Tk_GetBitmapFromObj(
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr) /* The object from which to get pixels. */
{
TkBitmap *bitmapPtr = GetBitmapFromObj(tkwin, objPtr);
+
return bitmapPtr->bitmap;
}
@@ -877,28 +867,28 @@ Tk_GetBitmapFromObj(tkwin, objPtr)
*
* GetBitmapFromObj --
*
- * Returns the bitmap referred to by a Tcl object. The bitmap must
- * already have been allocated via a call to Tk_AllocBitmapFromObj
- * or Tk_GetBitmap.
+ * Returns the bitmap referred to by a Tcl object. The bitmap must
+ * already have been allocated via a call to Tk_AllocBitmapFromObj or
+ * Tk_GetBitmap.
*
* Results:
- * Returns the TkBitmap * that matches the tkwin and the string rep
- * of objPtr.
+ * Returns the TkBitmap * that matches the tkwin and the string rep of
+ * objPtr.
*
* Side effects:
- * If the object is not already a bitmap, the conversion will free
- * any old internal representation.
+ * If the object is not already a bitmap, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
static TkBitmap *
-GetBitmapFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* Window in which the bitmap will be used. */
- Tcl_Obj *objPtr; /* The object that describes the desired
+GetBitmapFromObj(
+ Tk_Window tkwin, /* Window in which the bitmap will be used. */
+ Tcl_Obj *objPtr) /* The object that describes the desired
* bitmap. */
{
- TkBitmap *bitmapPtr;
+ TkBitmap *bitmapPtr;
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -907,7 +897,7 @@ GetBitmapFromObj(tkwin, objPtr)
}
bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
- if (bitmapPtr != NULL) {
+ if (bitmapPtr != NULL) {
if ((bitmapPtr->resourceRefCount > 0)
&& (Tk_Display(tkwin) == bitmapPtr->display)) {
return bitmapPtr;
@@ -915,29 +905,29 @@ GetBitmapFromObj(tkwin, objPtr)
hashPtr = bitmapPtr->nameHashPtr;
FreeBitmapObjProc(objPtr);
} else {
- hashPtr = Tcl_FindHashEntry(&dispPtr->bitmapNameTable,
- Tcl_GetString(objPtr));
+ hashPtr = Tcl_FindHashEntry(&dispPtr->bitmapNameTable,
+ Tcl_GetString(objPtr));
if (hashPtr == NULL) {
goto error;
}
- }
+ }
/*
- * At this point we've got a hash table entry, off of which hang
- * one or more TkBitmap structures. See if any of them will work.
+ * At this point we've got a hash table entry, off of which hang one or
+ * more TkBitmap structures. See if any of them will work.
*/
for (bitmapPtr = (TkBitmap *) Tcl_GetHashValue(hashPtr);
bitmapPtr != NULL; bitmapPtr = bitmapPtr->nextPtr) {
if (Tk_Display(tkwin) == bitmapPtr->display) {
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) bitmapPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) bitmapPtr;
bitmapPtr->objRefCount++;
return bitmapPtr;
}
}
- error:
- panic("GetBitmapFromObj called with non-existent bitmap!");
+ error:
+ Tcl_Panic("GetBitmapFromObj called with non-existent bitmap!");
/*
* The following code isn't reached; it's just there to please compilers.
*/
@@ -949,27 +939,27 @@ GetBitmapFromObj(tkwin, objPtr)
*
* InitBitmapObj --
*
- * Bookeeping procedure to change an objPtr to a bitmap type.
+ * Bookeeping function to change an objPtr to a bitmap type.
*
* Results:
* None.
*
* Side effects:
- * The old internal rep of the object is freed. The internal
- * rep is cleared. The final form of the object is set
- * by either Tk_AllocBitmapFromObj or GetBitmapFromObj.
+ * The old internal rep of the object is freed. The internal rep is
+ * cleared. The final form of the object is set by either
+ * Tk_AllocBitmapFromObj or GetBitmapFromObj.
*
*----------------------------------------------------------------------
*/
static void
-InitBitmapObj(objPtr)
- Tcl_Obj *objPtr; /* The object to convert. */
+InitBitmapObj(
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetString(objPtr);
@@ -978,21 +968,22 @@ InitBitmapObj(objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
objPtr->typePtr = &tkBitmapObjType;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
/*
*----------------------------------------------------------------------
*
* BitmapInit --
- * Initializes hash tables used by this module. Initializes
- * tables stored in TkDisplay structure if a TkDisplay pointer
- * is passed in. Iinitializes the thread-local data
- * in the current thread's ThreadSpecificData structure.
+ *
+ * Initializes hash tables used by this module. Initializes tables stored
+ * in TkDisplay structure if a TkDisplay pointer is passed in. Also
+ * initializes the thread-local data in the current thread's
+ * ThreadSpecificData structure.
*
* Results:
- * None.
- *
+ * None.
+ *
* Side effects:
* Read the code.
*
@@ -1000,70 +991,70 @@ InitBitmapObj(objPtr)
*/
static void
-BitmapInit(dispPtr)
- TkDisplay *dispPtr; /* TkDisplay structure encapsulating
- * thread-specific data used by this
- * module, or NULL if unavailable. */
+BitmapInit(
+ TkDisplay *dispPtr) /* TkDisplay structure encapsulating
+ * thread-specific data used by this module,
+ * or NULL if unavailable. */
{
Tcl_Interp *dummy;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- /*
- * First initialize the data in the ThreadSpecificData strucuture,
- * if needed.
+ /*
+ * First initialize the data in the ThreadSpecificData strucuture, if
+ * needed.
*/
if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
- dummy = Tcl_CreateInterp();
+ dummy = Tcl_CreateInterp();
Tcl_InitHashTable(&tsdPtr->predefBitmapTable, TCL_STRING_KEYS);
- Tk_DefineBitmap(dummy, "error", (char *) error_bits,
+ Tk_DefineBitmap(dummy, "error", (char *) error_bits,
error_width, error_height);
- Tk_DefineBitmap(dummy, "gray75", (char *) gray75_bits,
- gray75_width, gray75_height);
- Tk_DefineBitmap(dummy, "gray50", (char *) gray50_bits,
- gray50_width, gray50_height);
- Tk_DefineBitmap(dummy, "gray25", (char *) gray25_bits,
- gray25_width, gray25_height);
- Tk_DefineBitmap(dummy, "gray12", (char *) gray12_bits,
- gray12_width, gray12_height);
- Tk_DefineBitmap(dummy, "hourglass", (char *) hourglass_bits,
- hourglass_width, hourglass_height);
- Tk_DefineBitmap(dummy, "info", (char *) info_bits,
- info_width, info_height);
- Tk_DefineBitmap(dummy, "questhead", (char *) questhead_bits,
- questhead_width, questhead_height);
- Tk_DefineBitmap(dummy, "question", (char *) question_bits,
- question_width, question_height);
- Tk_DefineBitmap(dummy, "warning", (char *) warning_bits,
- warning_width, warning_height);
-
- TkpDefineNativeBitmaps();
- Tcl_DeleteInterp(dummy);
+ Tk_DefineBitmap(dummy, "gray75", (char *) gray75_bits,
+ gray75_width, gray75_height);
+ Tk_DefineBitmap(dummy, "gray50", (char *) gray50_bits,
+ gray50_width, gray50_height);
+ Tk_DefineBitmap(dummy, "gray25", (char *) gray25_bits,
+ gray25_width, gray25_height);
+ Tk_DefineBitmap(dummy, "gray12", (char *) gray12_bits,
+ gray12_width, gray12_height);
+ Tk_DefineBitmap(dummy, "hourglass", (char *) hourglass_bits,
+ hourglass_width, hourglass_height);
+ Tk_DefineBitmap(dummy, "info", (char *) info_bits,
+ info_width, info_height);
+ Tk_DefineBitmap(dummy, "questhead", (char *) questhead_bits,
+ questhead_width, questhead_height);
+ Tk_DefineBitmap(dummy, "question", (char *) question_bits,
+ question_width, question_height);
+ Tk_DefineBitmap(dummy, "warning", (char *) warning_bits,
+ warning_width, warning_height);
+
+ TkpDefineNativeBitmaps();
+ Tcl_DeleteInterp(dummy);
}
/*
- * Was a valid TkDisplay pointer passed? If so, initialize the
- * Bitmap module tables in that structure.
+ * Was a valid TkDisplay pointer passed? If so, initialize the Bitmap
+ * module tables in that structure.
*/
if (dispPtr != NULL) {
- dispPtr->bitmapInit = 1;
+ dispPtr->bitmapInit = 1;
Tcl_InitHashTable(&dispPtr->bitmapNameTable, TCL_STRING_KEYS);
- Tcl_InitHashTable(&dispPtr->bitmapDataTable, sizeof(DataKey)
- /sizeof(int));
+ Tcl_InitHashTable(&dispPtr->bitmapDataTable,
+ sizeof(DataKey) / sizeof(int));
/*
- * The call below is tricky: can't use sizeof(IdKey) because it
- * gets padded with extra unpredictable bytes on some 64-bit
- * machines.
+ * The call below is tricky: can't use sizeof(IdKey) because it gets
+ * padded with extra unpredictable bytes on some 64-bit machines.
*/
/*
* The comment above doesn't make sense...
*/
+
Tcl_InitHashTable(&dispPtr->bitmapIdTable, TCL_ONE_WORD_KEYS);
}
}
@@ -1073,8 +1064,8 @@ BitmapInit(dispPtr)
*
* TkReadBitmapFile --
*
- * Loads a bitmap image in X bitmap format into the specified
- * drawable. This is equivelent to the XReadBitmapFile in X.
+ * Loads a bitmap image in X bitmap format into the specified drawable.
+ * This is equivelent to the XReadBitmapFile in X.
*
* Results:
* Sets the size, hotspot, and bitmap on success.
@@ -1086,16 +1077,15 @@ BitmapInit(dispPtr)
*/
int
-TkReadBitmapFile(display, d, filename, width_return, height_return,
- bitmap_return, x_hot_return, y_hot_return)
- 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;
+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)
{
char *data;
@@ -1108,23 +1098,22 @@ TkReadBitmapFile(display, d, filename, width_return, height_return,
*bitmap_return = XCreateBitmapFromData(display, d, data, *width_return,
*height_return);
-
ckfree(data);
return BitmapSuccess;
- }
+}
/*
*----------------------------------------------------------------------
*
* TkDebugBitmap --
*
- * This procedure returns debugging information about a bitmap.
+ * This function returns debugging information about a bitmap.
*
* Results:
* The return value is a list with one sublist for each TkBitmap
- * corresponding to "name". Each sublist has two elements that
- * contain the resourceRefCount and objRefCount fields from the
- * TkBitmap structure.
+ * corresponding to "name". Each sublist has two elements that contain
+ * the resourceRefCount and objRefCount fields from the TkBitmap
+ * structure.
*
* Side effects:
* None.
@@ -1133,10 +1122,10 @@ TkReadBitmapFile(display, d, filename, width_return, height_return,
*/
Tcl_Obj *
-TkDebugBitmap(tkwin, name)
- Tk_Window tkwin; /* The window in which the bitmap will be
- * used (not currently used). */
- char *name; /* Name of the desired color. */
+TkDebugBitmap(
+ Tk_Window tkwin, /* The window in which the bitmap will be used
+ * (not currently used). */
+ char *name) /* Name of the desired color. */
{
TkBitmap *bitmapPtr;
Tcl_HashEntry *hashPtr;
@@ -1148,45 +1137,54 @@ TkDebugBitmap(tkwin, name)
if (hashPtr != NULL) {
bitmapPtr = (TkBitmap *) Tcl_GetHashValue(hashPtr);
if (bitmapPtr == NULL) {
- panic("TkDebugBitmap found empty hash table entry");
+ Tcl_Panic("TkDebugBitmap found empty hash table entry");
}
for ( ; (bitmapPtr != NULL); bitmapPtr = bitmapPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(bitmapPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(bitmapPtr->objRefCount));
+ Tcl_NewIntObj(bitmapPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
return resultPtr;
}
-
/*
*----------------------------------------------------------------------
*
* TkGetBitmapPredefTable --
- * This procedure is used by tkMacBitmap.c to access the thread-
- * specific predefBitmap table that maps from the names of
- * the predefined bitmaps to data associated with those
- * bitmaps. It is required because the table is allocated in
- * thread-local storage and is not visible outside this file.
+ *
+ * This function is used by tkMacBitmap.c to access the thread-specific
+ * predefBitmap table that maps from the names of the predefined bitmaps
+ * to data associated with those bitmaps. It is required because the
+ * table is allocated in thread-local storage and is not visible outside
+ * this file.
* Results:
- * Returns a pointer to the predefined bitmap hash table for
- * the current thread.
+ * Returns a pointer to the predefined bitmap hash table for the current
+ * thread.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
+
Tcl_HashTable *
-TkGetBitmapPredefTable()
+TkGetBitmapPredefTable(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return &tsdPtr->predefBitmapTable;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 3783985..4e3c06c 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -1,39 +1,40 @@
-/*
+/*
* tkButton.c --
*
- * This module implements a collection of button-like
- * widgets for the Tk toolkit. The widgets implemented
- * include labels, buttons, checkbuttons, and radiobuttons.
+ * This module implements a collection of button-like widgets for the Tk
+ * toolkit. The widgets implemented include buttons, checkbuttons,
+ * radiobuttons, and labels.
*
* Copyright (c) 1990-1994 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.
*/
+#include "tkInt.h"
#include "tkButton.h"
#include "default.h"
-typedef struct ThreadSpecificData {
+typedef struct ThreadSpecificData {
int defaultsInitialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Class names for buttons, indexed by one of the type values defined
- * in tkButton.h.
+ * Class names for buttons, indexed by one of the type values defined in
+ * tkButton.h.
*/
-static char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"};
+static const char *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.
+ * The following table defines the legal values for the -default option. It is
+ * used together with the "enum defaultValue" declaration in tkButton.h.
*/
-static char *defaultStrings[] = {
- "active", "disabled", "normal", (char *) NULL
+static const char *defaultStrings[] = {
+ "active", "disabled", "normal", NULL
};
/*
@@ -41,8 +42,8 @@ static char *defaultStrings[] = {
* It is used together with the "enum state" declaration in tkButton.h.
*/
-static char *stateStrings[] = {
- "active", "disabled", "normal", (char *) NULL
+static const char *stateStrings[] = {
+ "active", "disabled", "normal", NULL
};
/*
@@ -50,8 +51,8 @@ static char *stateStrings[] = {
* It is used with the "enum compound" declaration in tkButton.h
*/
-static char *compoundStrings[] = {
- "bottom", "center", "left", "none", "right", "top", (char *) NULL
+static const char *compoundStrings[] = {
+ "bottom", "center", "left", "none", "right", "top", NULL
};
char tkDefButtonBorderWidth[TCL_INTEGER_SPACE] = DEF_BUTTON_BORDER_WIDTH;
@@ -73,10 +74,10 @@ static Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder),
0, (ClientData) DEF_BUTTON_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap),
TK_OPTION_NULL_OK, 0, 0},
@@ -93,8 +94,8 @@ static Tk_OptionSpec labelOptionSpecs[] = {
"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
-1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK,
(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
@@ -143,8 +144,7 @@ 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, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0}
};
static Tk_OptionSpec buttonOptionSpecs[] = {
@@ -159,10 +159,10 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder),
0, (ClientData) DEF_BUTTON_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap),
TK_OPTION_NULL_OK, 0, 0},
@@ -185,8 +185,8 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
-1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK,
(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
@@ -245,8 +245,7 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr),
Tk_Offset(TkButton, wrapLength), 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
static Tk_OptionSpec checkbuttonOptionSpecs[] = {
@@ -261,10 +260,10 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder),
0, (ClientData) DEF_BUTTON_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap),
TK_OPTION_NULL_OK, 0, 0},
@@ -284,8 +283,8 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
-1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK,
(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
@@ -344,6 +343,11 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1,
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage",
+ DEF_BUTTON_IMAGE, Tk_Offset(TkButton, tristateImagePtr), -1,
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue",
+ DEF_BUTTON_TRISTATE_VALUE, Tk_Offset(TkButton, tristateValuePtr), -1, 0, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0},
{TK_OPTION_STRING, "-variable", "variable", "Variable",
@@ -354,8 +358,7 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr),
Tk_Offset(TkButton, wrapLength), 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
static Tk_OptionSpec radiobuttonOptionSpecs[] = {
@@ -370,10 +373,10 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder),
0, (ClientData) DEF_BUTTON_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap),
TK_OPTION_NULL_OK, 0, 0},
@@ -393,8 +396,8 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
"DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR,
-1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK,
(ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
@@ -450,6 +453,11 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_BUTTON_TEXT_VARIABLE, Tk_Offset(TkButton, textVarNamePtr), -1,
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-tristateimage", "tristateImage", "TristateImage",
+ DEF_BUTTON_IMAGE, Tk_Offset(TkButton, tristateImagePtr), -1,
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-tristatevalue", "tristateValue", "TristateValue",
+ DEF_BUTTON_TRISTATE_VALUE, Tk_Offset(TkButton, tristateValuePtr), -1, 0, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
DEF_BUTTON_UNDERLINE, -1, Tk_Offset(TkButton, underline), 0, 0, 0},
{TK_OPTION_STRING, "-value", "value", "Value",
@@ -462,17 +470,15 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_BUTTON_WRAP_LENGTH, Tk_Offset(TkButton, wrapLengthPtr),
Tk_Offset(TkButton, wrapLength), 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
- * The following table maps from one of the type values defined in
- * tkButton.h, such as TYPE_LABEL, to the option template for that
- * class of widgets.
+ * The following table maps from one of the type values defined in tkButton.h,
+ * such as TYPE_LABEL, to the option template for that class of widgets.
*/
-static Tk_OptionSpec *optionSpecs[] = {
+static Tk_OptionSpec * const optionSpecs[] = {
labelOptionSpecs,
buttonOptionSpecs,
checkbuttonOptionSpecs,
@@ -480,18 +486,17 @@ static Tk_OptionSpec *optionSpecs[] = {
};
/*
- * The following tables define the widget commands supported by
- * each of the classes, and map the indexes into the string tables
- * into a single enumerated type used to dispatch the widget command.
+ * The following tables define the widget commands supported by each of the
+ * classes, and map the indexes into the string tables into a single
+ * enumerated type used to dispatch the widget command.
*/
-static CONST char *commandNames[][8] = {
- {"cget", "configure", (char *) NULL},
- {"cget", "configure", "flash", "invoke", (char *) NULL},
- {"cget", "configure", "deselect", "flash", "invoke", "select",
- "toggle", (char *) NULL},
+static const char *commandNames[][8] = {
+ {"cget", "configure", NULL},
+ {"cget", "configure", "flash", "invoke", NULL},
{"cget", "configure", "deselect", "flash", "invoke", "select",
- (char *) NULL}
+ "toggle", NULL},
+ {"cget", "configure", "deselect", "flash", "invoke", "select", NULL}
};
enum command {
COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DESELECT, COMMAND_FLASH,
@@ -507,91 +512,92 @@ static enum command map[][8] = {
};
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static void ButtonCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static int ButtonCreate _ANSI_ARGS_((ClientData clientData,
+static void ButtonCmdDeletedProc(ClientData clientData);
+static int ButtonCreate(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[], int type));
-static void ButtonEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void ButtonImageProc _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[], int type);
+static void ButtonEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void ButtonImageProc(ClientData clientData,
int x, int y, int width, int height,
- int imgWidth, int imgHeight));
-static void ButtonSelectImageProc _ANSI_ARGS_((
- ClientData clientData, int x, int y, int width,
- int height, int imgWidth, int imgHeight));
-static char * ButtonTextVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags));
-static char * ButtonVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags));
-static int ButtonWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
+ int imgWidth, int imgHeight);
+static void ButtonSelectImageProc(ClientData clientData,
+ int x, int y, int width, int height,
+ int imgWidth, int imgHeight);
+static void ButtonTristateImageProc(ClientData clientData,
+ int x, int y, int width, int height,
+ int imgWidth, int imgHeight);
+static char * ButtonTextVarProc(ClientData clientData,
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
+static char * ButtonVarProc(ClientData clientData,
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
+static int ButtonWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static int ConfigureButton _ANSI_ARGS_((Tcl_Interp *interp,
- TkButton *butPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static void DestroyButton _ANSI_ARGS_((TkButton *butPtr));
+ Tcl_Obj *const objv[]);
+static int ConfigureButton(Tcl_Interp *interp, TkButton *butPtr,
+ int objc, Tcl_Obj *const objv[]);
+static void DestroyButton(TkButton *butPtr);
/*
*--------------------------------------------------------------
*
* Tk_ButtonCmd, Tk_CheckbuttonCmd, Tk_LabelCmd, Tk_RadiobuttonCmd --
*
- * These procedures are invoked to process the "button", "label",
- * "radiobutton", and "checkbutton" Tcl commands. See the
- * user documentation for details on what they do.
+ * These functions are invoked to process the "button", "label",
+ * "radiobutton", and "checkbutton" Tcl commands. See the user
+ * documentation for details on what they do.
*
* Results:
* A standard Tcl result.
*
* Side effects:
- * See the user documentation. These procedures are just wrappers;
- * they call ButtonCreate to do all of the real work.
+ * See the user documentation. These functions are just wrappers; they
+ * call ButtonCreate to do all of the real work.
*
*--------------------------------------------------------------
*/
int
-Tk_ButtonObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+Tk_ButtonObjCmd(
+ ClientData clientData, /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_BUTTON);
}
int
-Tk_CheckbuttonObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+Tk_CheckbuttonObjCmd(
+ ClientData clientData, /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_CHECK_BUTTON);
}
int
-Tk_LabelObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+Tk_LabelObjCmd(
+ ClientData clientData, /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_LABEL);
}
int
-Tk_RadiobuttonObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+Tk_RadiobuttonObjCmd(
+ ClientData clientData, /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
return ButtonCreate(clientData, interp, objc, objv, TYPE_RADIO_BUTTON);
}
@@ -601,9 +607,9 @@ Tk_RadiobuttonObjCmd(clientData, interp, objc, objv)
*
* ButtonCreate --
*
- * This procedure does all the real work of implementing the
- * "button", "label", "radiobutton", and "checkbutton" Tcl
- * commands. See the user documentation for details on what it does.
+ * This function does all the real work of implementing the "button",
+ * "label", "radiobutton", and "checkbutton" Tcl commands. See the user
+ * documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -615,20 +621,20 @@ Tk_RadiobuttonObjCmd(clientData, interp, objc, objv)
*/
static int
-ButtonCreate(clientData, interp, objc, objv, type)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
- int type; /* Type of button to create: TYPE_LABEL,
+ButtonCreate(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[], /* Argument values. */
+ int type) /* Type of button to create: TYPE_LABEL,
* TYPE_BUTTON, TYPE_CHECK_BUTTON, or
* TYPE_RADIO_BUTTON. */
{
TkButton *butPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->defaultsInitialized) {
TkpButtonSetDefaults(optionSpecs[type]);
@@ -645,14 +651,14 @@ ButtonCreate(clientData, interp, objc, objv, type)
*/
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
/*
- * Create the option table for this widget class. If it has already
- * been created, the cached pointer will be returned.
+ * Create the option table for this widget class. If it has already been
+ * created, the cached pointer will be returned.
*/
optionTable = Tk_CreateOptionTable(interp, optionSpecs[type]);
@@ -681,6 +687,8 @@ ButtonCreate(clientData, interp, objc, objv, type)
butPtr->image = NULL;
butPtr->selectImagePtr = NULL;
butPtr->selectImage = NULL;
+ butPtr->tristateImagePtr = NULL;
+ butPtr->tristateImage = NULL;
butPtr->state = STATE_NORMAL;
butPtr->normalBorder = NULL;
butPtr->activeBorder = NULL;
@@ -725,6 +733,7 @@ ButtonCreate(clientData, interp, objc, objv, type)
butPtr->selVarNamePtr = NULL;
butPtr->onValuePtr = NULL;
butPtr->offValuePtr = NULL;
+ butPtr->tristateValuePtr = NULL;
butPtr->cursor = None;
butPtr->takeFocusPtr = NULL;
butPtr->commandPtr = NULL;
@@ -754,9 +763,9 @@ ButtonCreate(clientData, interp, objc, objv, type)
*
* ButtonWidgetCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -768,11 +777,11 @@ ButtonCreate(clientData, interp, objc, objv, type)
*/
static int
-ButtonWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about button widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+ButtonWidgetObjCmd(
+ ClientData clientData, /* Information about button widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
TkButton *butPtr = (TkButton *) clientData;
int index;
@@ -791,137 +800,126 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv)
Tcl_Preserve((ClientData) butPtr);
switch (map[butPtr->type][index]) {
- case COMMAND_CGET: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "cget option");
- goto error;
- }
- objPtr = Tk_GetOptionValue(interp, (char *) butPtr,
- butPtr->optionTable, objv[2], butPtr->tkwin);
+ case COMMAND_CGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "cget option");
+ goto error;
+ }
+ objPtr = Tk_GetOptionValue(interp, (char *) butPtr,
+ butPtr->optionTable, objv[2], butPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ break;
+
+ case COMMAND_CONFIGURE:
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) butPtr,
+ butPtr->optionTable, (objc == 3) ? objv[2] : NULL,
+ butPtr->tkwin);
if (objPtr == NULL) {
- goto error;
+ goto error;
} else {
Tcl_SetObjResult(interp, objPtr);
}
- break;
+ } else {
+ result = ConfigureButton(interp, butPtr, objc-2, objv+2);
}
+ break;
- case COMMAND_CONFIGURE: {
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) butPtr,
- butPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- butPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
- } else {
- result = ConfigureButton(interp, butPtr, objc-2, objv+2);
- }
- break;
+ case COMMAND_DESELECT:
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "deselect");
+ goto error;
}
-
- case COMMAND_DESELECT: {
- if (objc > 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "deselect");
+ if (butPtr->type == TYPE_CHECK_BUTTON) {
+ if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
+ butPtr->offValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
+ == NULL) {
goto error;
}
- if (butPtr->type == TYPE_CHECK_BUTTON) {
- if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
- butPtr->offValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
- == NULL) {
- goto error;
- }
- } else if (butPtr->flags & SELECTED) {
- if (Tcl_ObjSetVar2(interp,
- butPtr->selVarNamePtr, NULL, Tcl_NewObj(),
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
- == NULL) {
- goto error;
- }
+ } else if (butPtr->flags & SELECTED) {
+ if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
+ Tcl_NewObj(), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL){
+ goto error;
}
- break;
}
+ break;
- case COMMAND_FLASH: {
+ case COMMAND_FLASH:
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "flash");
+ goto error;
+ }
+ if (butPtr->state != STATE_DISABLED) {
int i;
- if (objc > 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "flash");
- goto error;
- }
- if (butPtr->state != STATE_DISABLED) {
- for (i = 0; i < 4; i++) {
- if (butPtr->state == STATE_NORMAL) {
- butPtr->state = STATE_ACTIVE;
- Tk_SetBackgroundFromBorder(butPtr->tkwin,
- butPtr->activeBorder);
- } else {
- butPtr->state = STATE_NORMAL;
- Tk_SetBackgroundFromBorder(butPtr->tkwin,
- butPtr->normalBorder);
- }
- TkpDisplayButton((ClientData) butPtr);
-
- /*
- * Special note: must cancel any existing idle handler
- * for TkpDisplayButton; it's no longer needed, and
- * TkpDisplayButton cleared the REDRAW_PENDING flag.
- */
-
- Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
- XFlush(butPtr->display);
- Tcl_Sleep(50);
+ for (i = 0; i < 4; i++) {
+ if (butPtr->state == STATE_NORMAL) {
+ butPtr->state = STATE_ACTIVE;
+ Tk_SetBackgroundFromBorder(butPtr->tkwin,
+ butPtr->activeBorder);
+ } else {
+ butPtr->state = STATE_NORMAL;
+ Tk_SetBackgroundFromBorder(butPtr->tkwin,
+ butPtr->normalBorder);
}
+ TkpDisplayButton((ClientData) butPtr);
+
+ /*
+ * Special note: must cancel any existing idle handler for
+ * TkpDisplayButton; it's no longer needed, and
+ * TkpDisplayButton cleared the REDRAW_PENDING flag.
+ */
+
+ Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
+ XFlush(butPtr->display);
+ Tcl_Sleep(50);
}
- break;
}
+ break;
- case COMMAND_INVOKE: {
- if (objc > 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "invoke");
- goto error;
- }
- if (butPtr->state != STATE_DISABLED) {
- result = TkInvokeButton(butPtr);
- }
- break;
+ case COMMAND_INVOKE:
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "invoke");
+ goto error;
+ }
+ if (butPtr->state != STATE_DISABLED) {
+ result = TkInvokeButton(butPtr);
}
+ break;
- case COMMAND_SELECT: {
- if (objc > 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "select");
- goto error;
- }
- if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
- butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
- == NULL) {
- goto error;
- }
- break;
+ case COMMAND_SELECT:
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "select");
+ goto error;
}
+ if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
+ butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
+ == NULL) {
+ goto error;
+ }
+ break;
- case COMMAND_TOGGLE: {
- if (objc > 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "toggle");
- goto error;
- }
- if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
- (butPtr->flags & SELECTED) ? butPtr->offValuePtr
- : butPtr->onValuePtr,
- TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
- == NULL) {
- goto error;
- }
- break;
+ case COMMAND_TOGGLE:
+ if (objc > 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "toggle");
+ goto error;
+ }
+ if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL,
+ (butPtr->flags & SELECTED) ? butPtr->offValuePtr
+ : butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
+ == NULL) {
+ goto error;
}
+ break;
}
Tcl_Release((ClientData) butPtr);
return result;
- error:
+ error:
Tcl_Release((ClientData) butPtr);
return TCL_ERROR;
}
@@ -931,8 +929,8 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv)
*
* DestroyButton --
*
- * This procedure is invoked by ButtonEventProc to free all the
- * resources of a button and clean up its state.
+ * This function is invoked by ButtonEventProc to free all the resources
+ * of a button and clean up its state.
*
* Results:
* None.
@@ -944,8 +942,8 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv)
*/
static void
-DestroyButton(butPtr)
- TkButton *butPtr; /* Info about button widget. */
+DestroyButton(
+ TkButton *butPtr) /* Info about button widget. */
{
butPtr->flags |= BUTTON_DELETED;
TkpDestroyButton(butPtr);
@@ -955,9 +953,8 @@ DestroyButton(butPtr)
}
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeOptions handle all the standard option-related stuff.
*/
Tcl_DeleteCommandFromToken(butPtr->interp, butPtr->widgetCmd);
@@ -972,6 +969,9 @@ DestroyButton(butPtr)
if (butPtr->selectImage != NULL) {
Tk_FreeImage(butPtr->selectImage);
}
+ if (butPtr->tristateImage != NULL) {
+ Tk_FreeImage(butPtr->tristateImage);
+ }
if (butPtr->normalTextGC != None) {
Tk_FreeGC(butPtr->display, butPtr->normalTextGC);
}
@@ -1009,28 +1009,28 @@ DestroyButton(butPtr)
*
* ConfigureButton --
*
- * This procedure is called to process an objc/objv list to set
+ * This function is called to process an objc/objv list to set
* configuration options for a button widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then an error message is left in interp's result.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then an error message is left in interp's result.
*
* Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for butPtr; old resources get freed, if there
- * were any. The button is redisplayed.
+ * Configuration information, such as text string, colors, font, etc. get
+ * set for butPtr; old resources get freed, if there were any. The button
+ * is redisplayed.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureButton(interp, butPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- register TkButton *butPtr; /* Information about widget; may or may
+ConfigureButton(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register TkButton *butPtr, /* Information about widget; may or may
* not already have values for some fields. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument values. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
@@ -1042,21 +1042,21 @@ ConfigureButton(interp, butPtr, objc, objv)
*/
if (butPtr->textVarNamePtr != NULL) {
- Tcl_UntraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr),
+ Tcl_UntraceVar(interp, Tcl_GetString(butPtr->textVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonTextVarProc, (ClientData) butPtr);
}
if (butPtr->selVarNamePtr != NULL) {
- Tcl_UntraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr),
+ Tcl_UntraceVar(interp, Tcl_GetString(butPtr->selVarNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonVarProc, (ClientData) butPtr);
}
/*
- * The following loop is potentially executed twice. During the
- * first pass configuration options get set to their new values.
- * If there is an error in this pass, we execute a second pass
- * to restore all the options to their previous values.
+ * The following loop is potentially executed twice. During the first pass
+ * configuration options get set to their new values. If there is an error
+ * in this pass, we execute a second pass to restore all the options to
+ * their previous values.
*/
for (error = 0; error <= 1; error++) {
@@ -1067,7 +1067,7 @@ ConfigureButton(interp, butPtr, objc, objv)
if (Tk_SetOptions(interp, (char *) butPtr,
butPtr->optionTable, objc, objv,
- butPtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ butPtr->tkwin, &savedOptions, NULL) != TCL_OK) {
continue;
}
} else {
@@ -1089,8 +1089,8 @@ ConfigureButton(interp, butPtr, objc, objv)
/*
* A few options need special processing, such as setting the
- * background from a 3-D border, or filling in complicated
- * defaults that couldn't be specified to Tk_SetOptions.
+ * background from a 3-D border, or filling in complicated defaults
+ * that couldn't be specified to Tk_SetOptions.
*/
if ((butPtr->state == STATE_ACTIVE)
@@ -1114,28 +1114,43 @@ ConfigureButton(interp, butPtr, objc, objv)
if (butPtr->type >= TYPE_CHECK_BUTTON) {
Tcl_Obj *valuePtr, *namePtr;
-
+
if (butPtr->selVarNamePtr == NULL) {
butPtr->selVarNamePtr = Tcl_NewStringObj(
Tk_Name(butPtr->tkwin), -1);
Tcl_IncrRefCount(butPtr->selVarNamePtr);
}
namePtr = butPtr->selVarNamePtr;
-
+
/*
* Select the button if the associated variable has the
- * appropriate value, initialize the variable if it doesn't
- * exist, then set a trace on the variable to monitor future
- * changes to its value.
+ * appropriate value, initialize the variable if it doesn't exist,
+ * then set a trace on the variable to monitor future changes to
+ * its value.
*/
-
+
valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY);
butPtr->flags &= ~SELECTED;
+ butPtr->flags &= ~TRISTATED;
if (valuePtr != NULL) {
- if (strcmp(Tcl_GetString(valuePtr),
- Tcl_GetString(butPtr->onValuePtr)) == 0) {
+ const char *value = Tcl_GetString(valuePtr);
+ if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) {
butPtr->flags |= SELECTED;
- }
+ } else if (strcmp(value,
+ Tcl_GetString(butPtr->tristateValuePtr)) == 0) {
+ butPtr->flags |= TRISTATED;
+
+ /*
+ * For checkbuttons if the tristate value is the
+ * same as the offvalue then prefer off to tristate
+ */
+
+ if (butPtr->offValuePtr
+ && strcmp(value,
+ Tcl_GetString(butPtr->offValuePtr)) == 0) {
+ butPtr->flags &= ~TRISTATED;
+ }
+ }
} else {
if (Tcl_ObjSetVar2(interp, namePtr, NULL,
(butPtr->type == TYPE_CHECK_BUTTON)
@@ -1146,8 +1161,8 @@ ConfigureButton(interp, butPtr, objc, objv)
}
/*
- * If a radiobutton has the empty string as value
- * it should be selected.
+ * If a radiobutton has the empty string as value it should be
+ * selected.
*/
if ((butPtr->type == TYPE_RADIO_BUTTON) &&
@@ -1158,11 +1173,11 @@ ConfigureButton(interp, butPtr, objc, objv)
}
/*
- * Get the images for the widget, if there are any. Allocate the
- * new images before freeing the old ones, so that the reference
- * counts don't go to zero and cause image data to be discarded.
+ * Get the images for the widget, if there are any. Allocate the new
+ * images before freeing the old ones, so that the reference counts
+ * don't go to zero and cause image data to be discarded.
*/
-
+
if (butPtr->imagePtr != NULL) {
image = Tk_GetImage(butPtr->interp, butPtr->tkwin,
Tcl_GetString(butPtr->imagePtr), ButtonImageProc,
@@ -1191,6 +1206,20 @@ ConfigureButton(interp, butPtr, objc, objv)
Tk_FreeImage(butPtr->selectImage);
}
butPtr->selectImage = image;
+ if (butPtr->tristateImagePtr != NULL) {
+ image = Tk_GetImage(butPtr->interp, butPtr->tkwin,
+ Tcl_GetString(butPtr->tristateImagePtr),
+ ButtonTristateImageProc, (ClientData) butPtr);
+ if (image == NULL) {
+ continue;
+ }
+ } else {
+ image = NULL;
+ }
+ if (butPtr->tristateImage != NULL) {
+ Tk_FreeImage(butPtr->tristateImage);
+ }
+ butPtr->tristateImage = image;
haveImage = 0;
if (butPtr->imagePtr != NULL || butPtr->bitmap != None) {
@@ -1203,7 +1232,7 @@ ConfigureButton(interp, butPtr, objc, objv)
* on the variable's value, create the variable if it doesn't
* exist, and fetch its current value.
*/
-
+
Tcl_Obj *valuePtr, *namePtr;
namePtr = butPtr->textVarNamePtr;
@@ -1222,22 +1251,21 @@ ConfigureButton(interp, butPtr, objc, objv)
Tcl_IncrRefCount(butPtr->textPtr);
}
}
-
+
if ((butPtr->bitmap != None) || (butPtr->imagePtr != NULL)) {
/*
- * The button must display the contents of an image or
- * bitmap.
+ * The button must display the contents of an image or bitmap.
*/
if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthPtr,
&butPtr->width) != TCL_OK) {
- widthError:
+ widthError:
Tcl_AddErrorInfo(interp, "\n (processing -width option)");
continue;
}
if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->heightPtr,
&butPtr->height) != TCL_OK) {
- heightError:
+ heightError:
Tcl_AddErrorInfo(interp, "\n (processing -height option)");
continue;
}
@@ -1275,7 +1303,7 @@ ConfigureButton(interp, butPtr, objc, objv)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonVarProc, (ClientData) butPtr);
}
-
+
TkButtonWorldChanged((ClientData) butPtr);
if (error) {
Tcl_SetObjResult(interp, errorResult);
@@ -1291,9 +1319,9 @@ ConfigureButton(interp, butPtr, objc, objv)
*
* TkButtonWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
* None.
@@ -1303,10 +1331,10 @@ ConfigureButton(interp, butPtr, objc, objv)
*
*---------------------------------------------------------------------------
*/
-
+
void
-TkButtonWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+TkButtonWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
GC newGC;
@@ -1322,7 +1350,7 @@ TkButtonWorldChanged(instanceData)
gcValues.font = Tk_FontId(butPtr->tkfont);
gcValues.foreground = butPtr->normalFg->pixel;
gcValues.background = Tk_3DBorderColor(butPtr->normalBorder)->pixel;
-
+
/*
* Note: GraphicsExpose events are disabled in normalTextGC because it's
* used to copy stuff from an off-screen pixmap onto the screen (we know
@@ -1369,8 +1397,8 @@ TkButtonWorldChanged(instanceData)
}
/*
- * Allocate the disabled graphics context, for drawing text in
- * its disabled state.
+ * Allocate the disabled graphics context, for drawing text in its
+ * disabled state.
*/
mask = GCForeground | GCBackground | GCFont;
@@ -1406,31 +1434,31 @@ TkButtonWorldChanged(instanceData)
*
* ButtonEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on buttons.
+ * This function is invoked by the Tk dispatcher for various events on
+ * buttons.
*
* Results:
* None.
*
* Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
+ * When the window gets deleted, internal structures get cleaned up. When
+ * it gets exposed, it is redisplayed.
*
*--------------------------------------------------------------
*/
static void
-ButtonEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+ButtonEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
TkButton *butPtr = (TkButton *) clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
goto redraw;
} else if (eventPtr->type == ConfigureNotify) {
/*
- * Must redraw after size changes, since layout could have changed
- * and borders will need to be redrawn.
+ * Must redraw after size changes, since layout could have changed and
+ * borders will need to be redrawn.
*/
goto redraw;
@@ -1453,7 +1481,7 @@ ButtonEventProc(clientData, eventPtr)
}
return;
- redraw:
+ redraw:
if ((butPtr->tkwin != NULL) && !(butPtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
butPtr->flags |= REDRAW_PENDING;
@@ -1465,9 +1493,9 @@ ButtonEventProc(clientData, eventPtr)
*
* ButtonCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -1479,16 +1507,16 @@ ButtonEventProc(clientData, eventPtr)
*/
static void
-ButtonCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+ButtonCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
TkButton *butPtr = (TkButton *) clientData;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted or because the command
- * was deleted, and then this procedure destroys the widget. The
- * BUTTON_DELETED flag distinguishes these cases.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted or because the command was deleted,
+ * and then this function destroys the widget. The BUTTON_DELETED flag
+ * distinguishes these cases.
*/
if (!(butPtr->flags & BUTTON_DELETED)) {
@@ -1501,14 +1529,14 @@ ButtonCmdDeletedProc(clientData)
*
* TkInvokeButton --
*
- * This procedure is called to carry out the actions associated
- * with a button, such as invoking a Tcl command or setting a
- * variable. This procedure is invoked, for example, when the
- * button is invoked via the mouse.
+ * This function is called to carry out the actions associated with a
+ * button, such as invoking a Tcl command or setting a variable. This
+ * function is invoked, for example, when the button is invoked via the
+ * mouse.
*
* Results:
- * A standard Tcl return value. Information is also left in
- * the interp's result.
+ * A standard Tcl return value. Information is also left in the interp's
+ * result.
*
* Side effects:
* Depends on the button and its associated command.
@@ -1517,8 +1545,8 @@ ButtonCmdDeletedProc(clientData)
*/
int
-TkInvokeButton(butPtr)
- TkButton *butPtr; /* Information about button. */
+TkInvokeButton(
+ TkButton *butPtr) /* Information about button. */
{
Tcl_Obj *namePtr = butPtr->selVarNamePtr;
@@ -1555,10 +1583,9 @@ TkInvokeButton(butPtr)
*
* ButtonVarProc --
*
- * This procedure is invoked when someone changes the
- * state variable associated with a radio button. Depending
- * on the new value of the button's variable, the button
- * may be selected or deselected.
+ * This function is invoked when someone changes the state variable
+ * associated with a radio button. Depending on the new value of the
+ * button's variable, the button may be selected or deselected.
*
* Results:
* NULL is always returned.
@@ -1571,12 +1598,12 @@ TkInvokeButton(butPtr)
/* ARGSUSED */
static char *
-ButtonVarProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Information about button. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Name of variable. */
- CONST char *name2; /* Second part of variable name. */
- int flags; /* Information about what happened. */
+ButtonVarProc(
+ ClientData clientData, /* Information about button. */
+ Tcl_Interp *interp, /* Interpreter containing variable. */
+ const char *name1, /* Name of variable. */
+ const char *name2, /* Second part of variable name. */
+ int flags) /* Information about what happened. */
{
register TkButton *butPtr = (TkButton *) clientData;
char *name, *value;
@@ -1585,12 +1612,13 @@ ButtonVarProc(clientData, interp, name1, name2, flags)
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 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;
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
Tcl_TraceVar(interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
@@ -1600,34 +1628,47 @@ ButtonVarProc(clientData, interp, name1, name2, flags)
}
/*
- * Use the value of the variable to update the selected status of
- * the button.
+ * Use the value of the variable to update the selected status of the
+ * button.
*/
valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY);
if (valuePtr == NULL) {
- value = "";
+ value = Tcl_GetString(butPtr->tristateValuePtr);
} else {
value = Tcl_GetString(valuePtr);
}
if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) {
if (butPtr->flags & SELECTED) {
- return (char *) NULL;
+ return NULL;
}
butPtr->flags |= SELECTED;
- } else if (butPtr->flags & SELECTED) {
- butPtr->flags &= ~SELECTED;
+ butPtr->flags &= ~TRISTATED;
+ } else if (butPtr->offValuePtr
+ && strcmp(value, Tcl_GetString(butPtr->offValuePtr)) == 0) {
+ if (!(butPtr->flags & (SELECTED | TRISTATED))) {
+ return NULL;
+ }
+ butPtr->flags &= ~(SELECTED | TRISTATED);
+ } else if (strcmp(value, Tcl_GetString(butPtr->tristateValuePtr)) == 0) {
+ if (butPtr->flags & TRISTATED) {
+ return NULL;
+ }
+ butPtr->flags |= TRISTATED;
+ butPtr->flags &= ~SELECTED;
+ } else if (butPtr->flags & (SELECTED | TRISTATED)) {
+ butPtr->flags &= ~(SELECTED | TRISTATED);
} else {
- return (char *) NULL;
+ return NULL;
}
- redisplay:
+ redisplay:
if ((butPtr->tkwin != NULL) && Tk_IsMapped(butPtr->tkwin)
&& !(butPtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
butPtr->flags |= REDRAW_PENDING;
}
- return (char *) NULL;
+ return NULL;
}
/*
@@ -1635,52 +1676,51 @@ ButtonVarProc(clientData, interp, name1, name2, flags)
*
* ButtonTextVarProc --
*
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in a button.
+ * This function is invoked when someone changes the variable whose
+ * contents are to be displayed in a button.
*
* Results:
* NULL is always returned.
*
* Side effects:
- * The text displayed in the button will change to match the
- * variable.
+ * The text displayed in the button will change to match the variable.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static char *
-ButtonTextVarProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Information about button. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Not used. */
- CONST char *name2; /* Not used. */
- int flags; /* Information about what happened. */
+ButtonTextVarProc(
+ ClientData clientData, /* Information about button. */
+ Tcl_Interp *interp, /* Interpreter containing variable. */
+ const char *name1, /* Not used. */
+ const char *name2, /* Not used. */
+ int flags) /* Information about what happened. */
{
TkButton *butPtr = (TkButton *) clientData;
char *name;
Tcl_Obj *valuePtr;
if (butPtr->flags & BUTTON_DELETED) {
- return (char *) NULL;
+ return NULL;
}
name = Tcl_GetString(butPtr->textVarNamePtr);
/*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
+ * If the variable is unset, then immediately recreate it unless the whole
+ * interpreter is going away.
*/
if (flags & TCL_TRACE_UNSETS) {
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_SetVar2Ex(interp, name, NULL, butPtr->textPtr,
+ Tcl_SetVar2Ex(interp, name, NULL, butPtr->textPtr,
TCL_GLOBAL_ONLY);
Tcl_TraceVar(interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ButtonTextVarProc, clientData);
}
- return (char *) NULL;
+ return NULL;
}
valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY);
@@ -1697,7 +1737,7 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags)
Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
butPtr->flags |= REDRAW_PENDING;
}
- return (char *) NULL;
+ return NULL;
}
/*
@@ -1705,9 +1745,9 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags)
*
* ButtonImageProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size or contents
- * of an image displayed in a button.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size or contents of an image
+ * displayed in a button.
*
* Results:
* None.
@@ -1719,13 +1759,13 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags)
*/
static void
-ButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
- ClientData clientData; /* Pointer to widget record. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+ButtonImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (might be
+ * <= 0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
register TkButton *butPtr = (TkButton *) clientData;
@@ -1743,9 +1783,9 @@ ButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
*
* ButtonSelectImageProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size or contents
- * of the image displayed in a button when it is selected.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size or contents of the image
+ * displayed in a button when it is selected.
*
* Results:
* None.
@@ -1757,18 +1797,18 @@ ButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
*/
static void
-ButtonSelectImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
- ClientData clientData; /* Pointer to widget record. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+ButtonSelectImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (might be
+ * <= 0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
register TkButton *butPtr = (TkButton *) clientData;
/*
- * Don't recompute geometry: it's controlled by the primary image.
+ * Don't recompute geometry: it's controlled by the primary image.
*/
if ((butPtr->flags & SELECTED) && (butPtr->tkwin != NULL)
@@ -1778,3 +1818,52 @@ ButtonSelectImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
butPtr->flags |= REDRAW_PENDING;
}
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ButtonTristateImageProc --
+ *
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size or contents of the image
+ * displayed in a button when it is selected.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May arrange for the button to get redisplayed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ButtonTristateImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (might be
+ * <= 0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
+{
+ register TkButton *butPtr = (TkButton *) clientData;
+
+ /*
+ * Don't recompute geometry: it's controlled by the primary image.
+ */
+
+ if ((butPtr->flags & TRISTATED) && (butPtr->tkwin != NULL)
+ && Tk_IsMapped(butPtr->tkwin)
+ && !(butPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) butPtr);
+ butPtr->flags |= REDRAW_PENDING;
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkButton.h b/generic/tkButton.h
index 9547c9a..4fde4c1 100644
--- a/generic/tkButton.h
+++ b/generic/tkButton.h
@@ -1,13 +1,13 @@
/*
* tkButton.h --
*
- * Declarations of types and functions used to implement
- * button-like widgets.
+ * Declarations of types and functions used to implement button-like
+ * widgets.
*
* Copyright (c) 1996-1998 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKBUTTON
@@ -48,20 +48,20 @@ enum defaultState {
};
/*
- * A data structure of the following type is kept for each
- * widget managed by this file:
+ * A data structure of the following type is kept for each widget managed by
+ * this file:
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the button. NULL
- * means that the window has been destroyed. */
- Display *display; /* Display containing widget. Needed to
- * free up resources after tkwin is gone. */
+ Tk_Window tkwin; /* Window that embodies the button. NULL means
+ * that the window has been destroyed. */
+ Display *display; /* Display containing widget. Needed to free
+ * up resources after tkwin is gone. */
Tcl_Interp *interp; /* Interpreter associated with button. */
Tcl_Command widgetCmd; /* Token for button's widget command. */
int type; /* Type of widget, such as TYPE_LABEL:
* restricts operations that may be performed
- * on widget. See below for legal values. */
+ * on widget. See below for legal values. */
Tk_OptionTable optionTable; /* Table that defines configuration options
* available for this widget. */
@@ -71,96 +71,102 @@ typedef struct {
Tcl_Obj *textPtr; /* Value of -text option: specifies text to
* display in button. */
- int underline; /* Value of -underline option: specifies
- * index of character to underline. < 0 means
- * don't underline anything. */
+ int underline; /* Value of -underline option: specifies index
+ * of character to underline. < 0 means don't
+ * underline anything. */
Tcl_Obj *textVarNamePtr; /* Value of -textvariable option: specifies
- * name of variable or NULL. If non-NULL,
+ * name of variable or NULL. If non-NULL,
* button displays the contents of this
* variable. */
- Pixmap bitmap; /* Value of -bitmap option. If not None,
+ Pixmap bitmap; /* Value of -bitmap option. If not None,
* specifies bitmap to display and text and
* textVar are ignored. */
- Tcl_Obj *imagePtr; /* Value of -image option: specifies image
- * to display in window, or NULL if none.
- * If non-NULL, bitmap, text, and textVarName
- * are ignored.*/
+ Tcl_Obj *imagePtr; /* Value of -image option: specifies image to
+ * display in window, or NULL if none. If
+ * non-NULL, bitmap, text, and textVarName are
+ * ignored.*/
Tk_Image image; /* Derived from imagePtr by calling
- * Tk_GetImage, or NULL if imagePtr is NULL. */
+ * Tk_GetImage, or NULL if imagePtr is
+ * NULL. */
Tcl_Obj *selectImagePtr; /* Value of -selectimage option: specifies
* image to display in window when selected,
- * or NULL if none. Ignored if imagePtr is
+ * or NULL if none. Ignored if imagePtr is
* NULL. */
Tk_Image selectImage; /* Derived from selectImagePtr by calling
- * Tk_GetImage, or NULL if selectImagePtr
- * is NULL. */
+ * Tk_GetImage, or NULL if selectImagePtr is
+ * NULL. */
+ Tcl_Obj *tristateImagePtr; /* Value of -tristateimage option: specifies
+ * image to display in window when selected,
+ * or NULL if none. Ignored if imagePtr is
+ * NULL. */
+ Tk_Image tristateImage; /* Derived from tristateImagePtr by calling
+ * Tk_GetImage, or NULL if tristateImagePtr is
+ * NULL. */
/*
* Information used when displaying widget:
*/
- enum state state; /* Value of -state option: specifies
- * state of button for display purposes.*/
+ enum state state; /* Value of -state option: specifies state of
+ * button for display purposes.*/
Tk_3DBorder normalBorder; /* Value of -background option: specifies
* color for background (and border) when
* window isn't active. */
- Tk_3DBorder activeBorder; /* Value of -activebackground option:
- * this is the color used to draw 3-D border
- * and background when widget is active. */
+ Tk_3DBorder activeBorder; /* Value of -activebackground option: this is
+ * the color used to draw 3-D border and
+ * background when widget is active. */
Tcl_Obj *borderWidthPtr; /* Value of -borderWidth option: specifies
* width of border in pixels. */
int borderWidth; /* Integer value corresponding to
- * borderWidthPtr. Always >= 0. */
+ * borderWidthPtr. Always >= 0. */
int relief; /* Value of -relief option: specifies 3-d
* effect for border, such as
* TK_RELIEF_RAISED. */
- int overRelief; /* Value of -overrelief option: specifies a 3-d
- * effect for the border, such as
+ int overRelief; /* Value of -overrelief option: specifies a
+ * 3-d effect for the border, such as
* TK_RELIEF_RAISED, to be used when the mouse
* is over the button. */
int offRelief; /* Value of -offrelief option: specifies a 3-d
* effect for the border, such as
* TK_RELIEF_RAISED, to be used when a
- * checkbutton or radiobutton without
- * indicator is off */
+ * checkbutton or radiobutton without
+ * indicator is off. */
Tcl_Obj *highlightWidthPtr; /* Value of -highlightthickness option:
* specifies width in pixels of highlight to
* draw around widget when it has the focus.
* <= 0 means don't draw a highlight. */
int highlightWidth; /* Integer value corresponding to
- * highlightWidthPtr. Always >= 0. */
+ * highlightWidthPtr. Always >= 0. */
Tk_3DBorder highlightBorder;/* Value of -highlightbackground option:
* specifies background with which to draw 3-D
* default ring and focus highlight area when
* highlight is off. */
- XColor *highlightColorPtr; /* Value of -highlightcolor option:
- * specifies color for drawing traversal
- * highlight. */
+ XColor *highlightColorPtr; /* Value of -highlightcolor option: specifies
+ * color for drawing traversal highlight. */
int inset; /* Total width of all borders, including
* traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
- Tk_Font tkfont; /* Value of -font option: specifies font
- * to use for display text. */
+ * Indicates how much interior stuff must be
+ * offset from outside edges to leave room for
+ * borders. */
+ Tk_Font tkfont; /* Value of -font option: specifies font to
+ * use for display text. */
XColor *normalFg; /* Value of -font option: specifies foreground
* color in normal mode. */
XColor *activeFg; /* Value of -activeforeground option:
- * foreground color in active mode. NULL
- * means use -foreground instead. */
+ * foreground color in active mode. NULL means
+ * use -foreground instead. */
XColor *disabledFg; /* Value of -disabledforeground option:
- * foreground color when disabled. NULL
- * means use normalFg with a 50% stipple
- * instead. */
- GC normalTextGC; /* GC for drawing text in normal mode. Also
+ * foreground color when disabled. NULL means
+ * use normalFg with a 50% stipple instead. */
+ GC normalTextGC; /* GC for drawing text in normal mode. Also
* used to copy from off-screen pixmap onto
* screen. */
GC activeTextGC; /* GC for drawing text in active mode (NULL
* means use normalTextGC). */
GC disabledGC; /* Used to produce disabled effect for text
* and check/radio marks. */
- GC stippleGC; /* Used to produce disabled stipple effect
- * for images when disabled. */
+ GC stippleGC; /* Used to produce disabled stipple effect for
+ * images when disabled. */
Pixmap gray; /* Pixmap for displaying disabled text if
* disabledFg is NULL. */
GC copyGC; /* Used for copying information from an
@@ -169,33 +175,34 @@ typedef struct {
int width; /* Integer value corresponding to widthPtr. */
Tcl_Obj *heightPtr; /* Value of -height option. */
int height; /* Integer value corresponding to heightPtr. */
- Tcl_Obj *wrapLengthPtr; /* Value of -wraplength option: specifies
- * line length (in pixels) at which to wrap
- * onto next line. <= 0 means don't wrap
- * except at newlines. */
+ Tcl_Obj *wrapLengthPtr; /* Value of -wraplength option: specifies line
+ * length (in pixels) at which to wrap onto
+ * next line. <= 0 means don't wrap except at
+ * newlines. */
int wrapLength; /* Integer value corresponding to
* wrapLengthPtr. */
Tcl_Obj *padXPtr; /* Value of -padx option: specifies how many
* pixels of extra space to leave on left and
- * right of text. Ignored for bitmaps and
+ * right of text. Ignored for bitmaps and
* images. */
int padX; /* Integer value corresponding to padXPtr. */
Tcl_Obj *padYPtr; /* Value of -padx option: specifies how many
* pixels of extra space to leave above and
- * below text. Ignored for bitmaps and
+ * below text. Ignored for bitmaps and
* images. */
int padY; /* Integer value corresponding to padYPtr. */
Tk_Anchor anchor; /* Value of -anchor option: specifies where
* text/bitmap should be displayed inside
* button region. */
- Tk_Justify justify; /* Value of -justify option: specifies how
- * to align lines of multi-line text. */
- int indicatorOn; /* Value of -indicatoron option: 1 means
- * draw indicator in checkbuttons and
- * radiobuttons, 0 means don't draw it. */
+ Tk_Justify justify; /* Value of -justify option: specifies how to
+ * align lines of multi-line text. */
+ int indicatorOn; /* Value of -indicatoron option: 1 means draw
+ * indicator in checkbuttons and radiobuttons,
+ * 0 means don't draw it. */
Tk_3DBorder selectBorder; /* Value of -selectcolor option: specifies
* color for drawing indicator background, or
- * perhaps widget background, when selected. */
+ * perhaps widget background, when
+ * selected. */
int textWidth; /* Width needed to display text as requested,
* in pixels. */
int textHeight; /* Height needed to display text as requested,
@@ -206,26 +213,28 @@ typedef struct {
int indicatorDiameter; /* Diameter of indicator, in pixels. */
enum defaultState defaultState;
/* Value of -default option, such as
- * DEFAULT_NORMAL: specifies state
- * of default ring for buttons (normal,
- * active, or disabled). NULL for other
- * classes. */
+ * DEFAULT_NORMAL: specifies state of default
+ * ring for buttons (normal, active, or
+ * disabled). NULL for other classes. */
/*
- * For check and radio buttons, the fields below are used
- * to manage the variable indicating the button's state.
+ * For check and radio buttons, the fields below are used to manage the
+ * variable indicating the button's state.
*/
Tcl_Obj *selVarNamePtr; /* Value of -variable option: specifies name
- * of variable used to control selected
- * state of button. */
+ * of variable used to control selected state
+ * of button. */
Tcl_Obj *onValuePtr; /* Value of -offvalue option: specifies value
* to store in variable when this button is
* selected. */
Tcl_Obj *offValuePtr; /* Value of -offvalue option: specifies value
- * to store in variable when this button
- * isn't selected. Used only by
- * checkbuttons. */
+ * to store in variable when this button isn't
+ * selected. Used only by checkbuttons. */
+ Tcl_Obj *tristateValuePtr; /* Value of -tristatevalue option: specifies
+ * value to display Tristate or Multivalue
+ * mode when variable matches this value.
+ * Used by check- buttons. */
/*
* Miscellaneous information:
@@ -233,31 +242,30 @@ typedef struct {
Tk_Cursor cursor; /* Value of -cursor option: if not None,
* specifies current cursor for window. */
- Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
+ Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
* scripts. */
- Tcl_Obj *commandPtr; /* Value of -command option: specifies script
- * to execute when button is invoked. If
- * widget is label or has no command, this
- * is NULL. */
- int compound; /* Value of -compound option; specifies whether
- * the button should show both an image and
- * text, and, if so, how. */
- int repeatDelay; /* Value of -repeatdelay option; specifies
- * the number of ms after which the button will
+ Tcl_Obj *commandPtr; /* Value of -command option: specifies script
+ * to execute when button is invoked. If
+ * widget is label or has no command, this is
+ * NULL. */
+ int compound; /* Value of -compound option; specifies
+ * whether the button should show both an
+ * image and text, and, if so, how. */
+ int repeatDelay; /* Value of -repeatdelay option; specifies the
+ * number of ms after which the button will
* start to auto-repeat its command. */
int repeatInterval; /* Value of -repeatinterval option; specifies
* the number of ms between auto-repeat
* invocataions of the button command. */
- int flags; /* Various flags; see below for
+ int flags; /* Various flags; see below for
* definitions. */
} TkButton;
/*
- * Possible "type" values for buttons. These are the kinds of
- * widgets supported by this file. The ordering of the type
- * numbers is significant: greater means more features and is
- * used in the code.
+ * Possible "type" values for buttons. These are the kinds of widgets
+ * supported by this file. The ordering of the type numbers is significant:
+ * greater means more features and is used in the code.
*/
#define TYPE_LABEL 0
@@ -268,51 +276,46 @@ typedef struct {
/*
* Flag bits for buttons:
*
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * SELECTED: Non-zero means this button is selected,
- * so special highlight should be drawn.
- * GOT_FOCUS: Non-zero means this button currently
- * has the input focus.
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * already been queued to redraw this window.
+ * SELECTED: Non-zero means this button is selected, so
+ * special highlight should be drawn.
+ * GOT_FOCUS: Non-zero means this button currently has the
+ * input focus.
* BUTTON_DELETED: Non-zero needs that this button has been
- * deleted, or is in the process of being
- * deleted.
+ * deleted, or is in the process of being deleted
*/
#define REDRAW_PENDING (1 << 0)
#define SELECTED (1 << 1)
#define GOT_FOCUS (1 << 2)
#define BUTTON_DELETED (1 << 3)
+#define TRISTATED (1 << 4)
+
/*
- * Declaration of button class functions structure
- * and button/label defaults, for use in optionSpecs.
+ * Declaration of variables shared between the files in the button module.
*/
-extern Tk_ClassProcs tkpButtonProcs;
-extern char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
+MODULE_SCOPE Tk_ClassProcs tkpButtonProcs;
+MODULE_SCOPE char tkDefButtonBorderWidth[TCL_INTEGER_SPACE];
/*
- * Declaration of procedures used in the implementation of the button
- * widget.
+ * Declaration of functions used in the implementation of the button widget.
*/
#ifndef TkpButtonSetDefaults
-EXTERN void TkpButtonSetDefaults _ANSI_ARGS_((
- Tk_OptionSpec *specPtr));
+MODULE_SCOPE void TkpButtonSetDefaults(Tk_OptionSpec *specPtr);
#endif
-EXTERN void TkButtonWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-EXTERN void TkpComputeButtonGeometry _ANSI_ARGS_((
- TkButton *butPtr));
-EXTERN TkButton * TkpCreateButton _ANSI_ARGS_((Tk_Window tkwin));
+MODULE_SCOPE void TkButtonWorldChanged(ClientData instanceData);
+MODULE_SCOPE void TkpComputeButtonGeometry(TkButton *butPtr);
+MODULE_SCOPE TkButton *TkpCreateButton(Tk_Window tkwin);
#ifndef TkpDestroyButton
-EXTERN void TkpDestroyButton _ANSI_ARGS_((TkButton *butPtr));
+MODULE_SCOPE void TkpDestroyButton(TkButton *butPtr);
#endif
#ifndef TkpDisplayButton
-EXTERN void TkpDisplayButton _ANSI_ARGS_((ClientData clientData));
+MODULE_SCOPE void TkpDisplayButton(ClientData clientData);
#endif
-EXTERN int TkInvokeButton _ANSI_ARGS_((TkButton *butPtr));
+MODULE_SCOPE int TkInvokeButton(TkButton *butPtr);
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index 9bee1ef..ecd57b8 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvArc.c --
*
* This file implements arc items for canvas widgets.
@@ -6,14 +6,14 @@
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
-#include "tkPort.h"
#include "tkInt.h"
#include "tkCanvas.h"
+
/*
* The structure below defines the record for each arc item.
*/
@@ -22,41 +22,42 @@ typedef enum {
PIESLICE_STYLE, CHORD_STYLE, ARC_STYLE
} Style;
-typedef struct ArcItem {
+typedef struct ArcItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
Tk_Outline outline; /* Outline structure */
double bbox[4]; /* Coordinates (x1, y1, x2, y2) of bounding
* box for oval of which arc is a piece. */
double start; /* Angle at which arc begins, in degrees
* between 0 and 360. */
- double extent; /* Extent of arc (angular distance from
- * start to end of arc) in degrees between
- * -360 and 360. */
- double *outlinePtr; /* Points to (x,y) coordinates for points
- * that define one or two closed polygons
+ double extent; /* Extent of arc (angular distance from start
+ * to end of arc) in degrees between -360 and
+ * 360. */
+ double *outlinePtr; /* Points to (x,y) coordinates for points that
+ * define one or two closed polygons
* representing the portion of the outline
- * that isn't part of the arc (the V-shape
- * for a pie slice or a line-like segment
- * for a chord). Malloc'ed. */
- int numOutlinePoints; /* Number of points at outlinePtr. Zero
- * means no space allocated. */
+ * that isn't part of the arc (the V-shape for
+ * a pie slice or a line-like segment for a
+ * chord). Malloc'ed. */
+ int numOutlinePoints; /* Number of points at outlinePtr. Zero means
+ * no space allocated. */
Tk_TSOffset tsoffset;
XColor *fillColor; /* Color for filling arc (used for drawing
- * outline too when style is "arc"). NULL
+ * outline too when style is "arc"). NULL
* means don't fill arc. */
XColor *activeFillColor; /* Color for filling arc (used for drawing
* outline too when style is "arc" and state
- * is "active"). NULL means use fillColor. */
+ * is "active"). NULL means use fillColor. */
XColor *disabledFillColor; /* Color for filling arc (used for drawing
* outline too when style is "arc" and state
* is "disabled". NULL means use fillColor */
Pixmap fillStipple; /* Stipple bitmap for filling item. */
- Pixmap activeFillStipple; /* Stipple bitmap for filling item if state
- * is active. */
- Pixmap disabledFillStipple; /* Stipple bitmap for filling item if state
- * is disabled. */
- Style style; /* How to draw arc: arc, chord, or pieslice. */
+ Pixmap activeFillStipple; /* Stipple bitmap for filling item if state is
+ * active. */
+ Pixmap disabledFillStipple; /* Stipple bitmap for filling item if state is
+ * disabled. */
+ Style style; /* How to draw arc: arc, chord, or
+ * pieslice. */
GC fillGC; /* Graphics context for filling item. */
double center1[2]; /* Coordinates of center of arc outline at
* start (see ComputeArcOutline). */
@@ -65,8 +66,8 @@ typedef struct ArcItem {
} ArcItem;
/*
- * The definitions below define the sizes of the polygons used to
- * display outline information for various styles of arcs:
+ * The definitions below define the sizes of the polygons used to display
+ * outline information for various styles of arcs:
*/
#define CHORD_OUTLINE_PTS 7
@@ -77,14 +78,11 @@ typedef struct ArcItem {
* Information used for parsing configuration specs:
*/
-static int StyleParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
+static int StyleParseProc(ClientData clientData, Tcl_Interp *interp,
Tk_Window tkwin, CONST char *value,
- char *widgRec, int offset));
-static char * StylePrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
+ char *widgRec, int offset);
+static char * StylePrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr);
static Tk_CustomOption stateOption = {
(Tk_OptionParseProc *) TkStateParseProc,
@@ -112,169 +110,152 @@ static Tk_CustomOption pixelOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_CUSTOM, "-activedash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.activeDash),
+ {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-activefill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, activeFillColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-activeoutline", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.activeColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activeoutlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.activeStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, activeFillStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-activewidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-activefill", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, activeFillColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-activeoutline", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.activeStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, activeFillStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(ArcItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_CUSTOM, "-dash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.dash),
+ {TK_CONFIG_CUSTOM, "-dash", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_PIXELS, "-dashoffset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
"0", Tk_Offset(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-disableddash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.disabledDash),
+ {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-disabledfill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, disabledFillColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-disabledoutline", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.disabledColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledoutlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.disabledStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledstipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, disabledFillStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-disabledwidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.disabledColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.disabledStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, disabledFillStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(ArcItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_DOUBLE, "-extent", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_DOUBLE, "-extent", NULL, NULL,
"90", Tk_Offset(ArcItem, extent), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, fillColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-offset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-fill", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, fillColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(ArcItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
- {TK_CONFIG_COLOR, "-outline", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-outline", NULL, NULL,
"black", Tk_Offset(ArcItem, outline.color), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-outlineoffset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(ArcItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
- {TK_CONFIG_BITMAP, "-outlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, outline.stipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_DOUBLE, "-start", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, outline.stipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_DOUBLE, "-start", NULL, NULL,
"0", Tk_Offset(ArcItem, start), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_BITMAP, "-stipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, fillStipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-style", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ArcItem, style), TK_CONFIG_DONT_SET_DEFAULT,
+ {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},
+ {TK_CONFIG_CUSTOM, "-style", NULL, NULL,
+ NULL, Tk_Offset(ArcItem, style), TK_CONFIG_DONT_SET_DEFAULT,
&styleOption},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_CUSTOM, "-width", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
+ NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
+ {TK_CONFIG_CUSTOM, "-width", NULL, NULL,
"1.0", Tk_Offset(ArcItem, outline.width), TK_CONFIG_DONT_SET_DEFAULT,
&pixelOption},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static void ComputeArcBbox _ANSI_ARGS_((Tk_Canvas canvas,
- ArcItem *arcPtr));
-static int ConfigureArc _ANSI_ARGS_((Tcl_Interp *interp,
+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));
-static int CreateArc _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteArc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayArc _ANSI_ARGS_((Tk_Canvas canvas,
+ 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 _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static int ArcToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double ArcToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *coordPtr));
-static int ArcToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static void ScaleArc _ANSI_ARGS_((Tk_Canvas canvas,
+ 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[]);
+static int ArcToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double ArcToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *coordPtr);
+static int ArcToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+static void ScaleArc(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslateArc _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
-static int AngleInRange _ANSI_ARGS_((double x, double y,
- double start, double extent));
-static void ComputeArcOutline _ANSI_ARGS_((Tk_Canvas canvas,
- ArcItem *arcPtr));
-static int HorizLineToArc _ANSI_ARGS_((double x1, double x2,
+ double scaleX, double scaleY);
+static void TranslateArc(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double deltaX, double deltaY);
+static int AngleInRange(double x, double y,
+ double start, double extent);
+static void ComputeArcOutline(Tk_Canvas canvas, ArcItem *arcPtr);
+static int HorizLineToArc(double x1, double x2,
double y, double rx, double ry,
- double start, double extent));
-static int VertLineToArc _ANSI_ARGS_((double x, double y1,
+ double start, double extent);
+static int VertLineToArc(double x, double y1,
double y2, double rx, double ry,
- double start, double extent));
+ double start, double extent);
/*
- * The structures below defines the arc item types by means of procedures
- * that can be invoked by generic item code.
+ * The structures below defines the arc item types by means of functions that
+ * can be invoked by generic item code.
*/
Tk_ItemType tkArcType = {
- "arc", /* name */
- sizeof(ArcItem), /* itemSize */
- CreateArc, /* createProc */
- configSpecs, /* configSpecs */
- ConfigureArc, /* configureProc */
- ArcCoords, /* coordProc */
- DeleteArc, /* deleteProc */
- DisplayArc, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
- ArcToPoint, /* pointProc */
- ArcToArea, /* areaProc */
- ArcToPostscript, /* postscriptProc */
- ScaleArc, /* scaleProc */
- TranslateArc, /* translateProc */
- (Tk_ItemIndexProc *) NULL, /* indexProc */
- (Tk_ItemCursorProc *) NULL, /* icursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
- (Tk_ItemInsertProc *) NULL, /* insertProc */
- (Tk_ItemDCharsProc *) NULL, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ "arc", /* name */
+ sizeof(ArcItem), /* itemSize */
+ CreateArc, /* createProc */
+ configSpecs, /* configSpecs */
+ ConfigureArc, /* configureProc */
+ ArcCoords, /* coordProc */
+ DeleteArc, /* deleteProc */
+ DisplayArc, /* displayProc */
+ TK_CONFIG_OBJS, /* flags */
+ ArcToPoint, /* pointProc */
+ ArcToArea, /* areaProc */
+ ArcToPostscript, /* postscriptProc */
+ ScaleArc, /* scaleProc */
+ TranslateArc, /* translateProc */
+ NULL, /* indexProc */
+ NULL, /* icursorProc */
+ NULL, /* selectionProc */
+ NULL, /* insertProc */
+ NULL, /* dTextProc */
+ NULL, /* nextPtr */
};
#ifndef PI
-# define PI 3.14159265358979323846
+#define PI 3.14159265358979323846
#endif
-
/*
*--------------------------------------------------------------
*
* CreateArc --
*
- * This procedure is invoked to create a new arc item in
- * a canvas.
+ * This function is invoked to create a new arc item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is
- * left uninitialized, so it can be safely freed by the
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
* caller.
*
* Side effects:
@@ -284,24 +265,24 @@ Tk_ItemType tkArcType = {
*/
static int
-CreateArc(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing arc. */
+CreateArc(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing arc. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
- * Carry out initialization that is needed in order to clean
- * up after errors during the the remainder of this procedure.
+ * Carry out initialization that is needed in order to clean up after
+ * errors during the the remainder of this function.
*/
Tk_CreateOutline(&(arcPtr->outline));
@@ -327,6 +308,7 @@ CreateArc(interp, canvas, itemPtr, objc, objv)
for (i = 1; i < objc; i++) {
char *arg = Tcl_GetString(objv[i]);
+
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
}
@@ -337,7 +319,8 @@ CreateArc(interp, canvas, itemPtr, objc, objv)
if (ConfigureArc(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) {
return TCL_OK;
}
- error:
+
+ error:
DeleteArc(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -347,9 +330,8 @@ CreateArc(interp, canvas, itemPtr, objc, objv)
*
* ArcCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on arcs. See the user documentation for details
- * on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * arcs. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -361,21 +343,20 @@ CreateArc(interp, canvas, itemPtr, objc, objv)
*/
static int
-ArcCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+ArcCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(arcPtr->bbox[0]);
+
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(arcPtr->bbox[1]);
Tcl_ListObjAppendElement(interp, obj, subobj);
@@ -391,7 +372,7 @@ ArcCoords(interp, canvas, itemPtr, objc, objv)
return TCL_ERROR;
} else if (objc != 4) {
char buf[64 + TCL_INTEGER_SPACE];
-
+
sprintf(buf, "wrong # coordinates: expected 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
@@ -410,7 +391,7 @@ ArcCoords(interp, canvas, itemPtr, objc, objv)
ComputeArcBbox(canvas, arcPtr);
} else {
char buf[64 + TCL_INTEGER_SPACE];
-
+
sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
@@ -423,28 +404,28 @@ ArcCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureArc --
*
- * This procedure is invoked to configure various aspects
- * of a arc item, such as its outline and fill colors.
+ * This function is invoked to configure various aspects of a arc item,
+ * such as its outline and fill colors.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
- * Configuration information, such as colors and stipple
- * patterns, may be set for itemPtr.
+ * Configuration information, such as colors and stipple patterns, may be
+ * set for itemPtr.
*
*--------------------------------------------------------------
*/
static int
-ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Arc item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureArc(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
XGCValues gcValues;
@@ -466,8 +447,8 @@ ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
state = itemPtr->state;
/*
- * A few of the options require additional processing, such as
- * style and graphics contexts.
+ * A few of the options require additional processing, such as style and
+ * graphics contexts.
*/
if (arcPtr->outline.activeWidth > arcPtr->outline.width ||
@@ -506,8 +487,7 @@ ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
i = (int) (arcPtr->extent/360.0);
arcPtr->extent -= i*360.0;
- mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr,
- &(arcPtr->outline));
+ mask = Tk_ConfigOutlineGC(&gcValues, canvas, itemPtr, &(arcPtr->outline));
if (mask) {
gcValues.cap_style = CapButt;
mask |= GCCapStyle;
@@ -596,8 +576,8 @@ ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteArc --
*
- * This procedure is called to clean up the data structure
- * associated with a arc item.
+ * This function is called to clean up the data structure associated with
+ * an arc item.
*
* Results:
* None.
@@ -609,11 +589,10 @@ ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteArc(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeleteArc(
+ Tk_Canvas canvas, /* Info about overall canvas. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -649,31 +628,29 @@ DeleteArc(canvas, itemPtr, display)
*
* ComputeArcBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of an arc.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of an arc.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
-ComputeArcBbox(canvas, arcPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- ArcItem *arcPtr; /* Item whose bbox is to be
- * recomputed. */
+ComputeArcBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ ArcItem *arcPtr) /* Item whose bbox is to be recomputed. */
{
double tmp, center[2], point[2];
double width;
Tk_State state = arcPtr->header.state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -700,14 +677,14 @@ ComputeArcBbox(canvas, arcPtr)
*/
if (arcPtr->bbox[1] > arcPtr->bbox[3]) {
- double tmp;
- tmp = arcPtr->bbox[3];
+ double tmp = arcPtr->bbox[3];
+
arcPtr->bbox[3] = arcPtr->bbox[1];
arcPtr->bbox[1] = tmp;
}
if (arcPtr->bbox[0] > arcPtr->bbox[2]) {
- double tmp;
- tmp = arcPtr->bbox[2];
+ double tmp = arcPtr->bbox[2];
+
arcPtr->bbox[2] = arcPtr->bbox[0];
arcPtr->bbox[0] = tmp;
}
@@ -715,10 +692,10 @@ ComputeArcBbox(canvas, arcPtr)
ComputeArcOutline(canvas,arcPtr);
/*
- * To compute the bounding box, start with the the bbox formed
- * by the two endpoints of the arc. Then add in the center of
- * the arc's oval (if relevant) and the 3-o'clock, 6-o'clock,
- * 9-o'clock, and 12-o'clock positions, if they are relevant.
+ * To compute the bounding box, start with the the bbox formed by the two
+ * endpoints of the arc. Then add in the center of the arc's oval (if
+ * relevant) and the 3-o'clock, 6-o'clock, 9-o'clock, and 12-o'clock
+ * positions, if they are relevant.
*/
arcPtr->header.x1 = arcPtr->header.x2 = (int) arcPtr->center1[0];
@@ -768,8 +745,8 @@ ComputeArcBbox(canvas, arcPtr)
}
/*
- * Lastly, expand by the width of the arc (if the arc's outline is
- * being drawn) and add one extra pixel just for safety.
+ * Lastly, expand by the width of the arc (if the arc's outline is being
+ * drawn) and add one extra pixel just for safety.
*/
if (arcPtr->outline.gc == None) {
@@ -788,28 +765,26 @@ ComputeArcBbox(canvas, arcPtr)
*
* DisplayArc --
*
- * This procedure is invoked to draw an arc item in a given
- * drawable.
+ * This function is invoked to draw an arc item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int x, y, width, height; /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayArc(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, /* Describes region of canvas that must be */
+ int width, int height) /* redisplayed (not used). */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
short x1, y1, x2, y2;
@@ -818,7 +793,7 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
Tk_State state = itemPtr->state;
Pixmap stipple;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
lineWidth = arcPtr->outline.width;
@@ -837,7 +812,7 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
if (arcPtr->activeFillStipple != None) {
stipple = arcPtr->activeFillStipple;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (arcPtr->outline.disabledWidth > 0) {
lineWidth = arcPtr->outline.disabledWidth;
}
@@ -850,8 +825,8 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
}
/*
- * Compute the screen coordinates of the bounding box for the item,
- * plus integer values for the angles.
+ * Compute the screen coordinates of the bounding box for the item, plus
+ * integer values for the angles.
*/
Tk_CanvasDrawableCoords(canvas, arcPtr->bbox[0], arcPtr->bbox[1],
@@ -868,16 +843,18 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
extent = (int) ((64*arcPtr->extent) + 0.5);
/*
- * Display filled arc first (if wanted), then outline. If the extent
- * is zero then don't invoke XFillArc or XDrawArc, since this causes
- * some window servers to crash and should be a no-op anyway.
+ * Display filled arc first (if wanted), then outline. If the extent is
+ * zero then don't invoke XFillArc or XDrawArc, since this causes some
+ * window servers to crash and should be a no-op anyway.
*/
if ((arcPtr->fillGC != None) && (extent != 0)) {
if (stipple != None) {
- int w=0; int h=0;
+ int w = 0;
+ int h = 0;
Tk_TSOffset *tsoffset = &arcPtr->tsoffset;
int flags = tsoffset->flags;
+
if (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE)) {
Tk_SizeOfBitmap(display, stipple, &w, &h);
if (flags & TK_OFFSET_CENTER) {
@@ -914,10 +891,10 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
}
/*
- * If the outline width is very thin, don't use polygons to draw
- * the linear parts of the outline (this often results in nothing
- * being displayed); just draw lines instead. The same is done if
- * the outline is dashed, because then polygons don't work.
+ * If the outline width is very thin, don't use polygons to draw the
+ * linear parts of the outline (this often results in nothing being
+ * displayed); just draw lines instead. The same is done if the
+ * outline is dashed, because then polygons don't work.
*/
if (lineWidth < 1.5 || dashnumber != 0) {
@@ -948,8 +925,8 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
display, drawable, arcPtr->outline.gc, None);
TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
- PIE_OUTLINE2_PTS, display, drawable, arcPtr->outline.gc,
- None);
+ PIE_OUTLINE2_PTS, display, drawable,
+ arcPtr->outline.gc, None);
}
}
@@ -962,17 +939,16 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
*
* ArcToPoint --
*
- * Computes the distance from a given point to a given
- * arc, in canvas units.
+ * Computes the distance from a given point to a given arc, in canvas
+ * units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are coordPtr[0] and coordPtr[1] is inside the arc. If the
- * point isn't inside the arc then the return value is the
- * distance from the point to the arc. If itemPtr is filled,
- * then anywhere in the interior is considered "inside"; if
- * itemPtr isn't filled, then "inside" means only the area
- * occupied by the outline.
+ * The return value is 0 if the point whose x and y coordinates are
+ * coordPtr[0] and coordPtr[1] is inside the arc. If the point isn't
+ * inside the arc then the return value is the distance from the point to
+ * the arc. If itemPtr is filled, then anywhere in the interior is
+ * considered "inside"; if itemPtr isn't filled, then "inside" means only
+ * the area occupied by the outline.
*
* Side effects:
* None.
@@ -982,10 +958,10 @@ DisplayArc(canvas, itemPtr, display, drawable, x, y, width, height)
/* ARGSUSED */
static double
-ArcToPoint(canvas, itemPtr, pointPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *pointPtr; /* Pointer to x and y coordinates. */
+ArcToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *pointPtr) /* Pointer to x and y coordinates. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
double vertex[2], pointAngle, diff, dist, newDist;
@@ -993,7 +969,7 @@ ArcToPoint(canvas, itemPtr, pointPtr)
int filled, angleInRange;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -1009,10 +985,9 @@ ArcToPoint(canvas, itemPtr, pointPtr)
}
/*
- * See if the point is within the angular range of the arc.
- * Remember, X angles are backwards from the way we'd normally
- * think of them. Also, compensate for any eccentricity of
- * the oval.
+ * See if the point is within the angular range of the arc. Remember, X
+ * angles are backwards from the way we'd normally think of them. Also,
+ * compensate for any eccentricity of the oval.
*/
vertex[0] = (arcPtr->bbox[0] + arcPtr->bbox[2])/2.0;
@@ -1039,14 +1014,13 @@ ArcToPoint(canvas, itemPtr, pointPtr)
((arcPtr->extent < 0) && ((diff - 360.0) >= arcPtr->extent));
/*
- * Now perform different tests depending on what kind of arc
- * we're dealing with.
+ * Now perform different tests depending on what kind of arc we're dealing
+ * with.
*/
if (arcPtr->style == ARC_STYLE) {
if (angleInRange) {
- return TkOvalToPoint(arcPtr->bbox, width,
- 0, pointPtr);
+ return TkOvalToPoint(arcPtr->bbox, width, 0, pointPtr);
}
dist = hypot(pointPtr[0] - arcPtr->center1[0],
pointPtr[1] - arcPtr->center1[1]);
@@ -1072,7 +1046,7 @@ ArcToPoint(canvas, itemPtr, pointPtr)
dist = TkPolygonToPoint(arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
pointPtr);
newDist = TkPolygonToPoint(arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
- PIE_OUTLINE2_PTS, pointPtr);
+ PIE_OUTLINE2_PTS, pointPtr);
} else {
dist = TkLineToPoint(vertex, arcPtr->center1, pointPtr);
newDist = TkLineToPoint(vertex, arcPtr->center2, pointPtr);
@@ -1090,17 +1064,16 @@ ArcToPoint(canvas, itemPtr, pointPtr)
}
/*
- * This is a chord-style arc. We have to deal specially with the
- * triangular piece that represents the difference between a
- * chord-style arc and a pie-slice arc (for small angles this piece
- * is excluded here where it would be included for pie slices;
- * for large angles the piece is included here but would be
- * excluded for pie slices).
+ * This is a chord-style arc. We have to deal specially with the
+ * triangular piece that represents the difference between a chord-style
+ * arc and a pie-slice arc (for small angles this piece is excluded here
+ * where it would be included for pie slices; for large angles the piece
+ * is included here but would be excluded for pie slices).
*/
if (width > 1.0) {
dist = TkPolygonToPoint(arcPtr->outlinePtr, CHORD_OUTLINE_PTS,
- pointPtr);
+ pointPtr);
} else {
dist = TkLineToPoint(arcPtr->center1, arcPtr->center2, pointPtr);
}
@@ -1134,14 +1107,13 @@ ArcToPoint(canvas, itemPtr, pointPtr)
*
* ArcToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given area.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given area.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -1151,26 +1123,25 @@ ArcToPoint(canvas, itemPtr, pointPtr)
/* ARGSUSED */
static int
-ArcToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against arc. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
- * area. */
+ArcToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against arc. */
+ double *rectPtr) /* Pointer to array of four coordinates (x1,
+ * y1, x2, y2) describing rectangular area. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
- double rx, ry; /* Radii for transformed oval: these define
- * an oval centered at the origin. */
- double tRect[4]; /* Transformed version of x1, y1, x2, y2,
- * for coord. system where arc is centered
- * on the origin. */
+ double rx, ry; /* Radii for transformed oval: these define an
+ * oval centered at the origin. */
+ double tRect[4]; /* Transformed version of x1, y1, x2, y2, for
+ * coord. system where arc is centered on the
+ * origin. */
double center[2], width, angle, tmp;
double points[20], *pointPtr;
int numPoints, filled;
int inside; /* Non-zero means every test so far suggests
- * that arc is inside rectangle. 0 means
- * every test so far shows arc to be outside
- * of rectangle. */
+ * that arc is inside rectangle. 0 means every
+ * test so far shows arc to be outside of
+ * rectangle. */
int newInside;
Tk_State state = itemPtr->state;
@@ -1182,7 +1153,7 @@ ArcToArea(canvas, itemPtr, rectPtr)
if (arcPtr->outline.activeWidth>width) {
width = (double) arcPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (arcPtr->outline.disabledWidth>0) {
width = (double) arcPtr->outline.disabledWidth;
}
@@ -1198,8 +1169,8 @@ ArcToArea(canvas, itemPtr, rectPtr)
}
/*
- * Transform both the arc and the rectangle so that the arc's oval
- * is centered on the origin.
+ * Transform both the arc and the rectangle so that the arc's oval is
+ * centered on the origin.
*/
center[0] = (arcPtr->bbox[0] + arcPtr->bbox[2])/2.0;
@@ -1212,17 +1183,16 @@ ArcToArea(canvas, itemPtr, rectPtr)
ry = arcPtr->bbox[3] - center[1] + width/2.0;
/*
- * Find the extreme points of the arc and see whether these are all
- * inside the rectangle (in which case we're done), partly in and
- * partly out (in which case we're done), or all outside (in which
- * case we have more work to do). The extreme points include the
- * following, which are checked in order:
+ * Find the extreme points of the arc and see whether these are all inside
+ * the rectangle (in which case we're done), partly in and partly out (in
+ * which case we're done), or all outside (in which case we have more work
+ * to do). The extreme points include the following, which are checked in
+ * order:
*
- * 1. The outside points of the arc, corresponding to start and
- * extent.
+ * 1. The outside points of the arc, corresponding to start and extent.
* 2. The center of the arc (but only in pie-slice mode).
- * 3. The 12, 3, 6, and 9-o'clock positions (but only if the arc
- * includes those angles).
+ * 3. The 12, 3, 6, and 9-o'clock positions (but only if the arc includes
+ * those angles).
*/
pointPtr = points;
@@ -1283,8 +1253,8 @@ ArcToArea(canvas, itemPtr, rectPtr)
}
/*
- * Now that we've located the extreme points, loop through them all
- * to see which are inside the rectangle.
+ * Now that we've located the extreme points, loop through them all to see
+ * which are inside the rectangle.
*/
inside = (points[0] > tRect[0]) && (points[0] < tRect[2])
@@ -1302,17 +1272,17 @@ ArcToArea(canvas, itemPtr, rectPtr)
}
/*
- * So far, oval appears to be outside rectangle, but can't yet tell
- * for sure. Next, test each of the four sides of the rectangle
- * against the bounding region for the arc. If any intersections
- * are found, then return "overlapping". First, test against the
- * polygon(s) forming the sides of a chord or pie-slice.
+ * So far, oval appears to be outside rectangle, but can't yet tell for
+ * sure. Next, test each of the four sides of the rectangle against the
+ * bounding region for the arc. If any intersections are found, then
+ * return "overlapping". First, test against the polygon(s) forming the
+ * sides of a chord or pie-slice.
*/
if (arcPtr->style == PIESLICE_STYLE) {
if (width >= 1.0) {
if (TkPolygonToArea(arcPtr->outlinePtr, PIE_OUTLINE1_PTS,
- rectPtr) != -1) {
+ rectPtr) != -1) {
return 0;
}
if (TkPolygonToArea(arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
@@ -1340,9 +1310,9 @@ ArcToArea(canvas, itemPtr, rectPtr)
}
/*
- * Next check for overlap between each of the four sides and the
- * outer perimiter of the arc. If the arc isn't filled, then also
- * check the inner perimeter of the arc.
+ * Next check for overlap between each of the four sides and the outer
+ * perimiter of the arc. If the arc isn't filled, then also check the
+ * inner perimeter of the arc.
*/
if (HorizLineToArc(tRect[0], tRect[2], tRect[1], rx, ry, arcPtr->start,
@@ -1371,11 +1341,11 @@ ArcToArea(canvas, itemPtr, rectPtr)
}
/*
- * The arc still appears to be totally disjoint from the rectangle,
- * but it's also possible that the rectangle is totally inside the arc.
- * Do one last check, which is to check one point of the rectangle
- * to see if it's inside the arc. If it is, we've got overlap. If
- * it isn't, the arc's really outside the rectangle.
+ * The arc still appears to be totally disjoint from the rectangle, but
+ * it's also possible that the rectangle is totally inside the arc. Do one
+ * last check, which is to check one point of the rectangle to see if it's
+ * inside the arc. If it is, we've got overlap. If it isn't, the arc's
+ * really outside the rectangle.
*/
if (ArcToPoint(canvas, itemPtr, rectPtr) == 0.0) {
@@ -1389,15 +1359,14 @@ ArcToArea(canvas, itemPtr, rectPtr)
*
* ScaleArc --
*
- * This procedure is invoked to rescale an arc item.
+ * This function is invoked to rescale an arc item.
*
* Results:
* None.
*
* Side effects:
- * The arc referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point
- * coordinates:
+ * The arc referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -1405,12 +1374,13 @@ ArcToArea(canvas, itemPtr, rectPtr)
*/
static void
-ScaleArc(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing arc. */
- Tk_Item *itemPtr; /* Arc to be scaled. */
- double originX, originY; /* Origin about which to scale rect. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleArc(
+ Tk_Canvas canvas, /* Canvas containing arc. */
+ Tk_Item *itemPtr, /* Arc to be scaled. */
+ double originX, /* Origin about which to scale rect. */
+ double originY,
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -1426,25 +1396,24 @@ ScaleArc(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* TranslateArc --
*
- * This procedure is called to move an arc by a given amount.
+ * This function is called to move an arc by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the arc is offset by (xDelta, yDelta), and
- * the bounding box is updated in the generic part of the item
- * structure.
+ * The position of the arc is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateArc(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslateArc(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, /* Amount by which item is to be moved. */
+ double deltaY)
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -1460,26 +1429,25 @@ TranslateArc(canvas, itemPtr, deltaX, deltaY)
*
* ComputeArcOutline --
*
- * This procedure creates a polygon describing everything in
- * the outline for an arc except what's in the curved part.
- * For a "pie slice" arc this is a V-shaped chunk, and for
- * a "chord" arc this is a linear chunk (with cutaway corners).
- * For "arc" arcs, this stuff isn't relevant.
+ * This function creates a polygon describing everything in the outline
+ * for an arc except what's in the curved part. For a "pie slice" arc
+ * this is a V-shaped chunk, and for a "chord" arc this is a linear chunk
+ * (with cutaway corners). For "arc" arcs, this stuff isn't relevant.
*
* Results:
* None.
*
* Side effects:
- * The information at arcPtr->outlinePtr gets modified, and
- * storage for arcPtr->outlinePtr may be allocated or freed.
+ * The information at arcPtr->outlinePtr gets modified, and storage for
+ * arcPtr->outlinePtr may be allocated or freed.
*
*--------------------------------------------------------------
*/
static void
-ComputeArcOutline(canvas,arcPtr)
- Tk_Canvas canvas; /* Information about overall canvas. */
- ArcItem *arcPtr; /* Information about arc. */
+ComputeArcOutline(
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ ArcItem *arcPtr) /* Information about arc. */
{
double sin1, cos1, sin2, cos2, angle, width, halfWidth;
double boxWidth, boxHeight;
@@ -1487,10 +1455,9 @@ ComputeArcOutline(canvas,arcPtr)
double *outlinePtr;
Tk_State state = arcPtr->header.state;
-
/*
- * Make sure that the outlinePtr array is large enough to hold
- * either a chord or pie-slice outline.
+ * Make sure that the outlinePtr array is large enough to hold either a
+ * chord or pie-slice outline.
*/
if (arcPtr->numOutlinePoints == 0) {
@@ -1500,14 +1467,13 @@ ComputeArcOutline(canvas,arcPtr)
}
outlinePtr = arcPtr->outlinePtr;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
/*
- * First compute the two points that lie at the centers of
- * the ends of the curved arc segment, which are marked with
- * X's in the figure below:
+ * First compute the two points that lie at the centers of the ends of the
+ * curved arc segment, which are marked with X's in the figure below:
*
*
* * * *
@@ -1517,13 +1483,13 @@ ComputeArcOutline(canvas,arcPtr)
* * * * *
* X * * X
*
- * The code is tricky because the arc can be ovular in shape.
- * It computes the position for a unit circle, and then
- * scales to fit the shape of the arc's bounding box.
+ * The code is tricky because the arc can be ovular in shape. It computes
+ * the position for a unit circle, and then scales to fit the shape of the
+ * arc's bounding box.
*
- * Also, watch out because angles go counter-clockwise like you
- * might expect, but the y-coordinate system is inverted. To
- * handle this, just negate the angles in all the computations.
+ * Also, watch out because angles go counter-clockwise like you might
+ * expect, but the y-coordinate system is inverted. To handle this, just
+ * negate the angles in all the computations.
*/
boxWidth = arcPtr->bbox[2] - arcPtr->bbox[0];
@@ -1542,8 +1508,8 @@ ComputeArcOutline(canvas,arcPtr)
arcPtr->center2[1] = vertex[1] + sin2*boxHeight/2.0;
/*
- * Next compute the "outermost corners" of the arc, which are
- * marked with X's in the figure below:
+ * Next compute the "outermost corners" of the arc, which are marked with
+ * X's in the figure below:
*
* * * *
* * *
@@ -1552,12 +1518,11 @@ ComputeArcOutline(canvas,arcPtr)
* X * * X
* * *
*
- * The code below is tricky because it has to handle eccentricity
- * in the shape of the oval. The key in the code below is to
- * realize that the slope of the line from arcPtr->center1 to corner1
- * is (boxWidth*sin1)/(boxHeight*cos1), and similarly for arcPtr->center2
- * and corner2. These formulas can be computed from the formula for
- * the oval.
+ * The code below is tricky because it has to handle eccentricity in the
+ * shape of the oval. The key in the code below is to realize that the
+ * slope of the line from arcPtr->center1 to corner1 is (boxWidth*sin1)
+ * divided by (boxHeight*cos1), and similarly for arcPtr->center2 and
+ * corner2. These formulas can be computed from the formula for the oval.
*/
width = arcPtr->outline.width;
@@ -1565,7 +1530,7 @@ ComputeArcOutline(canvas,arcPtr)
if (arcPtr->outline.activeWidth>arcPtr->outline.width) {
width = arcPtr->outline.activeWidth;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (arcPtr->outline.disabledWidth>arcPtr->outline.width) {
width = arcPtr->outline.disabledWidth;
}
@@ -1588,10 +1553,10 @@ ComputeArcOutline(canvas,arcPtr)
corner2[1] = arcPtr->center2[1] + sin(angle)*halfWidth;
/*
- * For a chord outline, generate a six-sided polygon with three
- * points for each end of the chord. The first and third points
- * for each end are butt points generated on either side of the
- * center point. The second point is the corner point.
+ * For a chord outline, generate a six-sided polygon with three points for
+ * each end of the chord. The first and third points for each end are butt
+ * points generated on either side of the center point. The second point
+ * is the corner point.
*/
if (arcPtr->style == CHORD_STYLE) {
@@ -1611,10 +1576,9 @@ ComputeArcOutline(canvas,arcPtr)
- arcPtr->center1[1];
} else if (arcPtr->style == PIESLICE_STYLE) {
/*
- * For pie slices, generate two polygons, one for each side
- * of the pie slice. The first arm has a shape like this,
- * where the center of the oval is X, arcPtr->center1 is at Y, and
- * corner1 is at Z:
+ * For pie slices, generate two polygons, one for each side of the pie
+ * slice. The first arm has a shape like this, where the center of the
+ * oval is X, arcPtr->center1 is at Y, and corner1 is at Z:
*
* _____________________
* | \
@@ -1622,7 +1586,6 @@ ComputeArcOutline(canvas,arcPtr)
* X Y Z
* | /
* |_____________________/
- *
*/
TkGetButtPoints(arcPtr->center1, vertex, width, 0,
@@ -1639,7 +1602,6 @@ ComputeArcOutline(canvas,arcPtr)
/*
* The second arm has a shape like this:
*
- *
* ______________________
* / \
* / \
@@ -1648,10 +1610,10 @@ ComputeArcOutline(canvas,arcPtr)
* \______________________/
*
* Similar to above X is the center of the oval/circle, Y is
- * arcPtr->center2, and Z is corner2. The extra jog out to the left
- * of X is needed in or to produce a butted joint with the
- * first arm; the corner to the right of X is one of the
- * first two points of the first arm, depending on extent.
+ * arcPtr->center2, and Z is corner2. The extra jog out to the left of
+ * X is needed in or to produce a butted joint with the first arm; the
+ * corner to the right of X is one of the first two points of the
+ * first arm, depending on extent.
*/
TkGetButtPoints(arcPtr->center2, vertex, width, 0,
@@ -1680,15 +1642,13 @@ ComputeArcOutline(canvas,arcPtr)
*
* HorizLineToArc --
*
- * Determines whether a horizontal line segment intersects
- * a given arc.
+ * Determines whether a horizontal line segment intersects a given arc.
*
* Results:
- * The return value is 1 if the given line intersects the
- * infinitely-thin arc section defined by rx, ry, start,
- * and extent, and 0 otherwise. Only the perimeter of the
- * arc is checked: interior areas (e.g. pie-slice or chord)
- * are not checked.
+ * The return value is 1 if the given line intersects the infinitely-thin
+ * arc section defined by rx, ry, start, and extent, and 0 otherwise.
+ * Only the perimeter of the arc is checked: interior areas (e.g. chord
+ * or pie-slice) are not checked.
*
* Side effects:
* None.
@@ -1697,25 +1657,24 @@ ComputeArcOutline(canvas,arcPtr)
*/
static int
-HorizLineToArc(x1, x2, y, rx, ry, start, extent)
- double x1, x2; /* X-coords of endpoints of line segment.
- * X1 must be <= x2. */
- double y; /* Y-coordinate of line segment. */
- double rx, ry; /* These x- and y-radii define an oval
+HorizLineToArc(
+ double x1, double x2, /* X-coords of endpoints of line segment. X1
+ * must be <= x2. */
+ double y, /* Y-coordinate of line segment. */
+ double rx, double ry, /* These x- and y-radii define an oval
* centered at the origin. */
- double start, extent; /* Angles that define extent of arc, in
- * the standard fashion for this module. */
+ double start, double extent)/* Angles that define extent of arc, in the
+ * standard fashion for this module. */
{
- double tmp;
+ double tmp, x;
double tx, ty; /* Coordinates of intersection point in
* transformed coordinate system. */
- double x;
/*
- * Compute the x-coordinate of one possible intersection point
- * between the arc and the line. Use a transformed coordinate
- * system where the oval is a unit circle centered at the origin.
- * Then scale back to get actual x-coordinate.
+ * Compute the x-coordinate of one possible intersection point between the
+ * arc and the line. Use a transformed coordinate system where the oval is
+ * a unit circle centered at the origin. Then scale back to get actual
+ * x-coordinate.
*/
ty = y/ry;
@@ -1744,15 +1703,13 @@ HorizLineToArc(x1, x2, y, rx, ry, start, extent)
*
* VertLineToArc --
*
- * Determines whether a vertical line segment intersects
- * a given arc.
+ * Determines whether a vertical line segment intersects a given arc.
*
* Results:
- * The return value is 1 if the given line intersects the
- * infinitely-thin arc section defined by rx, ry, start,
- * and extent, and 0 otherwise. Only the perimeter of the
- * arc is checked: interior areas (e.g. pie-slice or chord)
- * are not checked.
+ * The return value is 1 if the given line intersects the infinitely-thin
+ * arc section defined by rx, ry, start, and extent, and 0 otherwise.
+ * Only the perimeter of the arc is checked: interior areas (e.g. chord
+ * or pie-slice) are not checked.
*
* Side effects:
* None.
@@ -1761,25 +1718,24 @@ HorizLineToArc(x1, x2, y, rx, ry, start, extent)
*/
static int
-VertLineToArc(x, y1, y2, rx, ry, start, extent)
- double x; /* X-coordinate of line segment. */
- double y1, y2; /* Y-coords of endpoints of line segment.
- * Y1 must be <= y2. */
- double rx, ry; /* These x- and y-radii define an oval
+VertLineToArc(
+ double x, /* X-coordinate of line segment. */
+ double y1, double y2, /* Y-coords of endpoints of line segment. Y1
+ * must be <= y2. */
+ double rx, double ry, /* These x- and y-radii define an oval
* centered at the origin. */
- double start, extent; /* Angles that define extent of arc, in
- * the standard fashion for this module. */
+ double start, double extent)/* Angles that define extent of arc, in the
+ * standard fashion for this module. */
{
- double tmp;
+ double tmp, y;
double tx, ty; /* Coordinates of intersection point in
* transformed coordinate system. */
- double y;
/*
- * Compute the y-coordinate of one possible intersection point
- * between the arc and the line. Use a transformed coordinate
- * system where the oval is a unit circle centered at the origin.
- * Then scale back to get actual y-coordinate.
+ * Compute the y-coordinate of one possible intersection point between the
+ * arc and the line. Use a transformed coordinate system where the oval is
+ * a unit circle centered at the origin. Then scale back to get actual
+ * y-coordinate.
*/
tx = x/rx;
@@ -1808,15 +1764,14 @@ VertLineToArc(x, y1, y2, rx, ry, start, extent)
*
* AngleInRange --
*
- * Determine whether the angle from the origin to a given
- * point is within a given range.
+ * Determine whether the angle from the origin to a given point is within
+ * a given range.
*
* Results:
- * The return value is 1 if the angle from (0,0) to (x,y)
- * is in the range given by start and extent, where angles
- * are interpreted in the standard way for ovals (meaning
- * backwards from normal interpretation). Otherwise the
- * return value is 0.
+ * The return value is 1 if the angle from (0,0) to (x,y) is in the range
+ * given by start and extent, where angles are interpreted in the
+ * standard way for ovals (meaning backwards from normal interpretation).
+ * Otherwise the return value is 0.
*
* Side effects:
* None.
@@ -1825,11 +1780,11 @@ VertLineToArc(x, y1, y2, rx, ry, start, extent)
*/
static int
-AngleInRange(x, y, start, extent)
- double x, y; /* Coordinate of point; angle measured
- * from origin to here, relative to x-axis. */
- double start; /* First angle, degrees, >=0, <=360. */
- double extent; /* Size of arc in degrees >=-360, <=360. */
+AngleInRange(
+ double x, double y, /* Coordinate of point; angle measured from
+ * origin to here, relative to x-axis. */
+ double start, /* First angle, degrees, >=0, <=360. */
+ double extent) /* Size of arc in degrees >=-360, <=360. */
{
double diff;
@@ -1855,15 +1810,13 @@ AngleInRange(x, y, start, extent)
*
* ArcToPostscript --
*
- * This procedure is called to generate Postscript for
- * arc items.
+ * This function is called to generate Postscript for arc items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used
- * to be there. If no error occurs, then Postscript for the
- * item is appended to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -1872,15 +1825,13 @@ AngleInRange(x, y, start, extent)
*/
static int
-ArcToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created. */
+ArcToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
char buffer[400];
@@ -1900,7 +1851,7 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
ang2 = arcPtr->start;
}
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
color = arcPtr->outline.color;
@@ -1920,7 +1871,7 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
if (arcPtr->activeFillStipple!=None) {
fillStipple = arcPtr->activeFillStipple;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (arcPtr->outline.disabledColor!=NULL) {
color = arcPtr->outline.disabledColor;
}
@@ -1936,15 +1887,15 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
}
/*
- * If the arc is filled, output Postscript for the interior region
- * of the arc.
+ * If the arc is filled, output Postscript for the interior region of the
+ * arc.
*/
if (arcPtr->fillGC != None) {
sprintf(buffer, "matrix currentmatrix\n%.15g %.15g translate %.15g %.15g scale\n",
(arcPtr->bbox[0] + arcPtr->bbox[2])/2, (y1 + y2)/2,
(arcPtr->bbox[2] - arcPtr->bbox[0])/2, (y1 - y2)/2);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
if (arcPtr->style == CHORD_STYLE) {
sprintf(buffer, "0 0 1 %.15g %.15g arc closepath\nsetmatrix\n",
ang1, ang2);
@@ -1953,21 +1904,20 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
"0 0 moveto 0 0 1 %.15g %.15g arc closepath\nsetmatrix\n",
ang1, ang2);
}
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
if (Tk_CanvasPsColor(interp, canvas, fillColor) != TCL_OK) {
return TCL_ERROR;
- };
+ }
if (fillStipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
- if (Tk_CanvasPsStipple(interp, canvas, fillStipple)
- != TCL_OK) {
+ Tcl_AppendResult(interp, "clip ", NULL);
+ if (Tk_CanvasPsStipple(interp, canvas, fillStipple) != TCL_OK) {
return TCL_ERROR;
}
if (arcPtr->outline.gc != None) {
- Tcl_AppendResult(interp, "grestore gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
}
@@ -1979,16 +1929,15 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
sprintf(buffer, "matrix currentmatrix\n%.15g %.15g translate %.15g %.15g scale\n",
(arcPtr->bbox[0] + arcPtr->bbox[2])/2, (y1 + y2)/2,
(arcPtr->bbox[2] - arcPtr->bbox[0])/2, (y1 - y2)/2);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
sprintf(buffer, "0 0 1 %.15g %.15g", ang1, ang2);
Tcl_AppendResult(interp, buffer,
- " arc\nsetmatrix\n0 setlinecap\n", (char *) NULL);
- if (Tk_CanvasPsOutline(canvas, itemPtr,
- &(arcPtr->outline)) != TCL_OK) {
+ " arc\nsetmatrix\n0 setlinecap\n", NULL);
+ if (Tk_CanvasPsOutline(canvas, itemPtr, &(arcPtr->outline)) != TCL_OK){
return TCL_ERROR;
}
if (arcPtr->style != ARC_STYLE) {
- Tcl_AppendResult(interp, "grestore gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
if (arcPtr->style == CHORD_STYLE) {
Tk_CanvasPsPath(interp, canvas, arcPtr->outlinePtr,
CHORD_OUTLINE_PTS);
@@ -2000,15 +1949,14 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
- if (Tk_CanvasPsStipple(interp, canvas,
- stipple) != TCL_OK) {
+ Tcl_AppendResult(interp, "clip ", NULL);
+ if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK){
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
- Tcl_AppendResult(interp, "grestore gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
Tk_CanvasPsPath(interp, canvas,
arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS,
PIE_OUTLINE2_PTS);
@@ -2018,13 +1966,12 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
- if (Tk_CanvasPsStipple(interp, canvas,
- stipple) != TCL_OK) {
+ Tcl_AppendResult(interp, "clip ", NULL);
+ if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
}
}
@@ -2037,34 +1984,34 @@ ArcToPostscript(interp, canvas, itemPtr, prepass)
*
* StyleParseProc --
*
- * This procedure is invoked during option processing to handle
- * the "-style" option.
+ * This function is invoked during option processing to handle the
+ * "-style" option.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * The state for a given item gets replaced by the state
- * indicated in the value argument.
+ * The state for a given item gets replaced by the state indicated in the
+ * value argument.
*
*--------------------------------------------------------------
*/
static int
-StyleParseProc(clientData, interp, tkwin, value, widgRec, offset)
- ClientData clientData; /* some flags.*/
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- CONST char *value; /* Value of option. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
+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. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset) /* Offset into item. */
{
int c;
size_t length;
register Style *stylePtr = (Style *) (widgRec + offset);
- if(value == NULL || *value == 0) {
+ if (value == NULL || *value == 0) {
*stylePtr = PIESLICE_STYLE;
return TCL_OK;
}
@@ -2085,9 +2032,8 @@ StyleParseProc(clientData, interp, tkwin, value, widgRec, offset)
return TCL_OK;
}
- Tcl_AppendResult(interp, "bad -style option \"",
- value, "\": must be arc, chord, or pieslice",
- (char *) NULL);
+ Tcl_AppendResult(interp, "bad -style option \"", value,
+ "\": must be arc, chord, or pieslice", NULL);
*stylePtr = PIESLICE_STYLE;
return TCL_ERROR;
}
@@ -2097,16 +2043,15 @@ StyleParseProc(clientData, interp, tkwin, value, widgRec, offset)
*
* StylePrintProc --
*
- * This procedure is invoked by the Tk configuration code
- * to produce a printable string for the "-style"
- * configuration option.
+ * This function is invoked by the Tk configuration code to produce a
+ * printable string for the "-style" configuration option.
*
* Results:
- * The return value is a string describing the state for
- * the item referred to by "widgRec". In addition, *freeProcPtr
- * is filled in with the address of a procedure to call to free
- * the result string when it's no longer needed (or NULL to
- * indicate that the string doesn't need to be freed).
+ * The return value is a string describing the state for the item
+ * referred to by "widgRec". In addition, *freeProcPtr is filled in with
+ * the address of a function to call to free the result string when it's
+ * no longer needed (or NULL to indicate that the string doesn't need to
+ * be freed).
*
* Side effects:
* None.
@@ -2115,22 +2060,30 @@ StyleParseProc(clientData, interp, tkwin, value, widgRec, offset)
*/
static char *
-StylePrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
- ClientData clientData; /* Ignored. */
- Tk_Window tkwin; /* Ignored. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to variable to fill in with
- * information about how to reclaim
- * storage for return string. */
+StylePrintProc(
+ ClientData clientData, /* Ignored. */
+ Tk_Window tkwin, /* Ignored. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset, /* Offset into item. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
+ * information about how to reclaim storage
+ * for return string. */
{
register Style *stylePtr = (Style *) (widgRec + offset);
- if (*stylePtr==ARC_STYLE) {
+ if (*stylePtr == ARC_STYLE) {
return "arc";
- } else if (*stylePtr==CHORD_STYLE) {
+ } else if (*stylePtr == CHORD_STYLE) {
return "chord";
} else {
return "pieslice";
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index f308c52..30aa429 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvBmap.c --
*
* This file implements bitmap items for canvas widgets.
@@ -6,13 +6,12 @@
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
/*
@@ -21,11 +20,10 @@
typedef struct BitmapItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
double x, y; /* Coordinates of positioning point for
* bitmap. */
- Tk_Anchor anchor; /* Where to anchor bitmap relative to
- * (x,y). */
+ Tk_Anchor anchor; /* Where to anchor bitmap relative to (x,y) */
Pixmap bitmap; /* Bitmap to display in window. */
Pixmap activeBitmap; /* Bitmap to display in window. */
Pixmap disabledBitmap; /* Bitmap to display in window. */
@@ -35,8 +33,8 @@ typedef struct BitmapItem {
XColor *bgColor; /* Background color to use for bitmap. */
XColor *activeBgColor; /* Background color to use for bitmap. */
XColor *disabledBgColor; /* Background color to use for bitmap. */
- GC gc; /* Graphics context to use for drawing
- * bitmap on screen. */
+ GC gc; /* Graphics context to use for drawing bitmap
+ * on screen. */
} BitmapItem;
/*
@@ -53,96 +51,95 @@ static Tk_CustomOption tagsOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_COLOR, "-activebackground", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activebitmap", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-activeforeground", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-activebackground", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, activeBgColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activebitmap", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, activeBitmap), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-activeforeground", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, activeFgColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
"center", Tk_Offset(BitmapItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_COLOR, "-background", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-bitmap", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-disabledbackground", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, disabledBgColor),
+ {TK_CONFIG_COLOR, "-background", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, bgColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-bitmap", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, bitmap), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-disabledbackground", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, disabledBgColor),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledbitmap", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, disabledBitmap),
+ {TK_CONFIG_BITMAP, "-disabledbitmap", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, disabledBitmap),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-disabledforeground", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapItem, disabledFgColor),
+ {TK_CONFIG_COLOR, "-disabledforeground", NULL, NULL,
+ NULL, Tk_Offset(BitmapItem, disabledFgColor),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-foreground", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-foreground", NULL, NULL,
"black", Tk_Offset(BitmapItem, fgColor), 0},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
+ {TK_CONFIG_CUSTOM, "-state", NULL, NULL,
+ NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
&stateOption},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_CUSTOM, "-tags", NULL, NULL,
+ NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static int BitmapCoords _ANSI_ARGS_((Tcl_Interp *interp,
+static int BitmapCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static int BitmapToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double BitmapToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *coordPtr));
-static int BitmapToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static void ComputeBitmapBbox _ANSI_ARGS_((Tk_Canvas canvas,
- BitmapItem *bmapPtr));
-static int ConfigureBitmap _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *CONST objv[]);
+static int BitmapToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double BitmapToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *coordPtr);
+static int BitmapToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+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));
-static int TkcCreateBitmap _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteBitmap _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayBitmap _ANSI_ARGS_((Tk_Canvas canvas,
+ int objc, Tcl_Obj *CONST objv[]);
+static void DeleteBitmap(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayBitmap(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static void ScaleBitmap _ANSI_ARGS_((Tk_Canvas canvas,
+ int x, int y, int width, int height);
+static void ScaleBitmap(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslateBitmap _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
+ double scaleX, double scaleY);
+static void TranslateBitmap(Tk_Canvas canvas, Tk_Item *itemPtr,
+ double deltaX, double deltaY);
/*
- * The structures below defines the bitmap item type in terms of
- * procedures that can be invoked by generic item code.
+ * The structures below defines the bitmap item type in terms of functions
+ * that can be invoked by generic item code.
*/
Tk_ItemType tkBitmapType = {
- "bitmap", /* name */
- sizeof(BitmapItem), /* itemSize */
- TkcCreateBitmap, /* createProc */
- configSpecs, /* configSpecs */
- ConfigureBitmap, /* configureProc */
- BitmapCoords, /* coordProc */
- DeleteBitmap, /* deleteProc */
- DisplayBitmap, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
- BitmapToPoint, /* pointProc */
- BitmapToArea, /* areaProc */
- BitmapToPostscript, /* postscriptProc */
- ScaleBitmap, /* scaleProc */
- TranslateBitmap, /* translateProc */
- (Tk_ItemIndexProc *) NULL, /* indexProc */
- (Tk_ItemCursorProc *) NULL, /* icursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
- (Tk_ItemInsertProc *) NULL, /* insertProc */
- (Tk_ItemDCharsProc *) NULL, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ "bitmap", /* name */
+ sizeof(BitmapItem), /* itemSize */
+ TkcCreateBitmap, /* createProc */
+ configSpecs, /* configSpecs */
+ ConfigureBitmap, /* configureProc */
+ BitmapCoords, /* coordProc */
+ DeleteBitmap, /* deleteProc */
+ DisplayBitmap, /* displayProc */
+ TK_CONFIG_OBJS, /* flags */
+ BitmapToPoint, /* pointProc */
+ BitmapToArea, /* areaProc */
+ BitmapToPostscript, /* postscriptProc */
+ ScaleBitmap, /* scaleProc */
+ TranslateBitmap, /* translateProc */
+ NULL, /* indexProc */
+ NULL, /* icursorProc */
+ NULL, /* selectionProc */
+ NULL, /* insertProc */
+ NULL, /* dTextProc */
+ NULL, /* nextPtr */
};
/*
@@ -150,14 +147,13 @@ Tk_ItemType tkBitmapType = {
*
* TkcCreateBitmap --
*
- * This procedure is invoked to create a new bitmap
- * item in a canvas.
+ * This function is invoked to create a new bitmap item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is left uninitialized,
- * so it can be safely freed by the caller.
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
+ * caller.
*
* Side effects:
* A new bitmap item is created.
@@ -166,13 +162,13 @@ Tk_ItemType tkBitmapType = {
*/
static int
-TkcCreateBitmap(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
+TkcCreateBitmap(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
int i;
@@ -198,8 +194,8 @@ TkcCreateBitmap(interp, canvas, itemPtr, objc, objv)
bmapPtr->gc = None;
/*
- * Process the arguments to fill in the item record.
- * Only 1 (list) or 2 (x y) coords are allowed.
+ * Process the arguments to fill in the item record. Only 1 (list) or 2 (x
+ * y) coords are allowed.
*/
if (objc == 1) {
@@ -219,7 +215,7 @@ TkcCreateBitmap(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeleteBitmap(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -229,9 +225,8 @@ TkcCreateBitmap(interp, canvas, itemPtr, objc, objv)
*
* BitmapCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on bitmap items. See the user documentation for
- * details on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * bitmap items. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -243,20 +238,19 @@ TkcCreateBitmap(interp, canvas, itemPtr, objc, objv)
*/
static int
-BitmapCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+BitmapCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
+
Tcl_Obj *subobj = Tcl_NewDoubleObj(bmapPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(bmapPtr->y);
@@ -297,12 +291,12 @@ BitmapCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureBitmap --
*
- * This procedure is invoked to configure various aspects
- * of a bitmap item, such as its anchor position.
+ * This function is invoked to configure various aspects of a bitmap
+ * item, such as its anchor position.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
* Configuration information may be set for itemPtr.
@@ -311,13 +305,13 @@ BitmapCoords(interp, canvas, itemPtr, objc, objv)
*/
static int
-ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Bitmap item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureBitmap(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
XGCValues gcValues;
@@ -336,8 +330,8 @@ ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * A few of the options require additional processing, such as those
- * that determine the graphics context.
+ * A few of the options require additional processing, such as those that
+ * determine the graphics context.
*/
state = itemPtr->state;
@@ -410,8 +404,8 @@ ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteBitmap --
*
- * This procedure is called to clean up the data structure
- * associated with a bitmap item.
+ * This function is called to clean up the data structure associated with
+ * a bitmap item.
*
* Results:
* None.
@@ -423,11 +417,10 @@ ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteBitmap(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeleteBitmap(
+ Tk_Canvas canvas, /* Info about overall canvas widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -468,27 +461,24 @@ DeleteBitmap(canvas, itemPtr, display)
*
* ComputeBitmapBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a bitmap item.
- * This procedure is where the child bitmap's placement is
- * computed.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a bitmap item. This function is where the
+ * child bitmap's placement is computed.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
-ComputeBitmapBbox(canvas, bmapPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- BitmapItem *bmapPtr; /* Item whose bbox is to be
- * recomputed. */
+ComputeBitmapBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ BitmapItem *bmapPtr) /* Item whose bbox is to be recomputed. */
{
int width, height;
int x, y;
@@ -525,36 +515,36 @@ ComputeBitmapBbox(canvas, bmapPtr)
Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bitmap,
&width, &height);
switch (bmapPtr->anchor) {
- case TK_ANCHOR_N:
- x -= width/2;
- break;
- case TK_ANCHOR_NE:
- x -= width;
- break;
- case TK_ANCHOR_E:
- x -= width;
- y -= height/2;
- break;
- case TK_ANCHOR_SE:
- x -= width;
- y -= height;
- break;
- case TK_ANCHOR_S:
- x -= width/2;
- y -= height;
- break;
- case TK_ANCHOR_SW:
- y -= height;
- break;
- case TK_ANCHOR_W:
- y -= height/2;
- break;
- case TK_ANCHOR_NW:
- break;
- case TK_ANCHOR_CENTER:
- x -= width/2;
- y -= height/2;
- break;
+ case TK_ANCHOR_N:
+ x -= width/2;
+ break;
+ case TK_ANCHOR_NE:
+ x -= width;
+ break;
+ case TK_ANCHOR_E:
+ x -= width;
+ y -= height/2;
+ break;
+ case TK_ANCHOR_SE:
+ x -= width;
+ y -= height;
+ break;
+ case TK_ANCHOR_S:
+ x -= width/2;
+ y -= height;
+ break;
+ case TK_ANCHOR_SW:
+ y -= height;
+ break;
+ case TK_ANCHOR_W:
+ y -= height/2;
+ break;
+ case TK_ANCHOR_NW:
+ break;
+ case TK_ANCHOR_CENTER:
+ x -= width/2;
+ y -= height/2;
+ break;
}
/*
@@ -572,28 +562,27 @@ ComputeBitmapBbox(canvas, bmapPtr)
*
* DisplayBitmap --
*
- * This procedure is invoked to draw a bitmap item in a given
- * drawable.
+ * This function is invoked to draw a bitmap item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int x, y, width, height; /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayBitmap(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, int width, int height)
+ /* Describes region of canvas that must be
+ * redisplayed (not used). */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
int bmapX, bmapY, bmapWidth, bmapHeight;
@@ -602,9 +591,8 @@ DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
Tk_State state = itemPtr->state;
/*
- * If the area being displayed doesn't cover the whole bitmap,
- * then only redisplay the part of the bitmap that needs
- * redisplay.
+ * If the area being displayed doesn't cover the whole bitmap, then only
+ * redisplay the part of the bitmap that needs redisplay.
*/
if (state == TK_STATE_NULL) {
@@ -650,9 +638,9 @@ DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
&drawableX, &drawableY);
/*
- * Must modify the mask origin within the graphics context
- * to line up with the bitmap's origin (in order to make
- * bitmaps with "-background {}" work right).
+ * Must modify the mask origin within the graphics context to line up
+ * with the bitmap's origin (in order to make bitmaps with
+ * "-background {}" work right).
*/
XSetClipOrigin(display, bmapPtr->gc, drawableX - bmapX,
@@ -669,14 +657,14 @@ DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
*
* BitmapToPoint --
*
- * Computes the distance from a given point to a given
- * rectangle, in canvas units.
+ * Computes the distance from a given point to a given rectangle, in
+ * canvas units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are coordPtr[0] and coordPtr[1] is inside the bitmap. If the
- * point isn't inside the bitmap then the return value is the
- * distance from the point to the bitmap.
+ * The return value is 0 if the point whose x and y coordinates are
+ * coordPtr[0] and coordPtr[1] is inside the bitmap. If the point isn't
+ * inside the bitmap then the return value is the distance from the point
+ * to the bitmap.
*
* Side effects:
* None.
@@ -686,10 +674,10 @@ DisplayBitmap(canvas, itemPtr, display, drawable, x, y, width, height)
/* ARGSUSED */
static double
-BitmapToPoint(canvas, itemPtr, coordPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *coordPtr; /* Pointer to x and y coordinates. */
+BitmapToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *coordPtr) /* Pointer to x and y coordinates. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
double x1, x2, y1, y2, xDiff, yDiff;
@@ -727,14 +715,13 @@ BitmapToPoint(canvas, itemPtr, coordPtr)
*
* BitmapToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangle.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangle.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -744,12 +731,12 @@ BitmapToPoint(canvas, itemPtr, coordPtr)
/* ARGSUSED */
static int
-BitmapToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against rectangle. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
- * area. */
+BitmapToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against rectangle. */
+ double *rectPtr) /* Pointer to array of four coordinates
+ * (x1,y1,x2,y2) describing rectangular
+ * area. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -773,16 +760,16 @@ BitmapToArea(canvas, itemPtr, rectPtr)
*
* ScaleBitmap --
*
- * This procedure is invoked to rescale a bitmap item in a
- * canvas. It is one of the standard item procedures for
- * bitmap items, and is invoked by the generic canvas code.
+ * This function is invoked to rescale a bitmap item in a canvas. It is
+ * one of the standard item functions for bitmap items, and is invoked by
+ * the generic canvas code.
*
* Results:
* None.
*
* Side effects:
- * The item referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point coordinates:
+ * The item referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -790,12 +777,13 @@ BitmapToArea(canvas, itemPtr, rectPtr)
*/
static void
-ScaleBitmap(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing rectangle. */
- Tk_Item *itemPtr; /* Rectangle to be scaled. */
- double originX, originY; /* Origin about which to scale item. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleBitmap(
+ Tk_Canvas canvas, /* Canvas containing rectangle. */
+ Tk_Item *itemPtr, /* Rectangle to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale item. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -809,25 +797,24 @@ ScaleBitmap(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* TranslateBitmap --
*
- * This procedure is called to move an item by a given amount.
+ * This function is called to move an item by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the item is offset by (xDelta, yDelta), and
- * the bounding box is updated in the generic part of the item
- * structure.
+ * The position of the item is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateBitmap(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslateBitmap(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -841,15 +828,13 @@ TranslateBitmap(canvas, itemPtr, deltaX, deltaY)
*
* BitmapToPostscript --
*
- * This procedure is called to generate Postscript for
- * bitmap items.
+ * This function is called to generate Postscript for bitmap items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used to be there.
- * If no error occurs, then Postscript for the item is appended
- * to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -858,15 +843,13 @@ TranslateBitmap(canvas, itemPtr, deltaX, deltaY)
*/
static int
-BitmapToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created. */
+BitmapToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
double x, y;
@@ -911,8 +894,8 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
}
/*
- * Compute the coordinates of the lower-left corner of the bitmap,
- * taking into account the anchor position for the bitmp.
+ * Compute the coordinates of the lower-left corner of the bitmap, taking
+ * into account the anchor position for the bitmp.
*/
x = bmapPtr->x;
@@ -920,15 +903,15 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
Tk_SizeOfBitmap(Tk_Display(Tk_CanvasTkwin(canvas)), bitmap,
&width, &height);
switch (bmapPtr->anchor) {
- case TK_ANCHOR_NW: y -= height; break;
- case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
- case TK_ANCHOR_NE: x -= width; y -= height; break;
- case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
- case TK_ANCHOR_SE: x -= width; break;
- case TK_ANCHOR_S: x -= width/2.0; break;
- case TK_ANCHOR_SW: break;
- case TK_ANCHOR_W: y -= height/2.0; break;
- case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
+ case TK_ANCHOR_NW: y -= height; break;
+ case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
+ case TK_ANCHOR_NE: x -= width; y -= height; break;
+ case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
+ case TK_ANCHOR_SE: x -= width; break;
+ case TK_ANCHOR_S: x -= width/2.0; break;
+ case TK_ANCHOR_SW: break;
+ case TK_ANCHOR_W: y -= height/2.0; break;
+ case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
}
/*
@@ -939,18 +922,18 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
sprintf(buffer,
"%.15g %.15g moveto %d 0 rlineto 0 %d rlineto %d %s\n",
x, y, width, height, -width, "0 rlineto closepath");
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
if (Tk_CanvasPsColor(interp, canvas, bgColor) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
/*
- * Draw the bitmap, if there is a foreground color. If the bitmap
- * is very large, then chop it up into multiple bitmaps, each
- * consisting of one or more rows. This is needed because Postscript
- * can't handle single strings longer than 64 KBytes long.
+ * Draw the bitmap, if there is a foreground color. If the bitmap is very
+ * large, then chop it up into multiple bitmaps, each consisting of one or
+ * more rows. This is needed because Postscript can't handle single
+ * strings longer than 64 KBytes long.
*/
if (fgColor != NULL) {
@@ -960,8 +943,7 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
if (width > 60000) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "can't generate Postscript",
- " for bitmaps more than 60000 pixels wide",
- (char *) NULL);
+ " for bitmaps more than 60000 pixels wide", NULL);
return TCL_ERROR;
}
rowsAtOnce = 60000/width;
@@ -969,7 +951,7 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
rowsAtOnce = 1;
}
sprintf(buffer, "%.15g %.15g translate\n", x, y+height);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
for (curRow = 0; curRow < height; curRow += rowsAtOnce) {
rowsThisTime = rowsAtOnce;
if (rowsThisTime > (height - curRow)) {
@@ -977,13 +959,21 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
}
sprintf(buffer, "0 -%.15g translate\n%d %d true matrix {\n",
(double) rowsThisTime, width, rowsThisTime);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
if (Tk_CanvasPsBitmap(interp, canvas, bitmap,
0, curRow, width, rowsThisTime) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_AppendResult(interp, "\n} imagemask\n", (char *) NULL);
+ Tcl_AppendResult(interp, "\n} imagemask\n", NULL);
}
}
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index ba85b4f..9e928c7 100644
--- a/generic/tkCanvImg.c
+++ b/generic/tkCanvImg.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvImg.c --
*
* This file implements image items for canvas widgets.
@@ -6,13 +6,12 @@
* Copyright (c) 1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
/*
@@ -21,24 +20,24 @@
typedef struct ImageItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
Tk_Canvas canvas; /* Canvas containing the image. */
double x, y; /* Coordinates of positioning point for
* image. */
- Tk_Anchor anchor; /* Where to anchor image relative to
- * (x,y). */
- char *imageString; /* String describing -image option (malloc-ed).
- * NULL means no image right now. */
+ Tk_Anchor anchor; /* Where to anchor image relative to (x,y). */
+ char *imageString; /* String describing -image option
+ * (malloc-ed). NULL means no image right
+ * now. */
char *activeImageString; /* String describing -activeimage option.
* NULL means no image right now. */
char *disabledImageString; /* String describing -disabledimage option.
* NULL means no image right now. */
- Tk_Image image; /* Image to display in window, or NULL if
- * no image at present. */
- Tk_Image activeImage; /* Image to display in window, or NULL if
- * no image at present. */
- Tk_Image disabledImage; /* Image to display in window, or NULL if
- * no image at present. */
+ Tk_Image image; /* Image to display in window, or NULL if no
+ * image at present. */
+ Tk_Image activeImage; /* Image to display in window, or NULL if no
+ * image at present. */
+ Tk_Image disabledImage; /* Image to display in window, or NULL if no
+ * image at present. */
} ImageItem;
/*
@@ -55,86 +54,81 @@ static Tk_CustomOption tagsOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_STRING, "-activeimage", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ImageItem, activeImageString),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-activeimage", NULL, NULL,
+ NULL, Tk_Offset(ImageItem, activeImageString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
"center", Tk_Offset(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_STRING, "-disabledimage", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ImageItem, disabledImageString),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-image", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_STRING, "-disabledimage", NULL, NULL,
+ NULL, Tk_Offset(ImageItem, disabledImageString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_STRING, "-image", NULL, NULL,
+ NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK},
+ {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}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static void ImageChangedProc _ANSI_ARGS_((ClientData clientData,
+static void ImageChangedProc(ClientData clientData,
int x, int y, int width, int height, int imgWidth,
- int imgHeight));
-static int ImageCoords _ANSI_ARGS_((Tcl_Interp *interp,
+ int imgHeight);
+static int ImageCoords(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]));
-static int ImageToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double ImageToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *coordPtr));
-static int ImageToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static void ComputeImageBbox _ANSI_ARGS_((Tk_Canvas canvas,
- ImageItem *imgPtr));
-static int ConfigureImage _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *CONST argv[]);
+static int ImageToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double ImageToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *coordPtr);
+static int ImageToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+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));
-static int CreateImage _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteImage _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayImage _ANSI_ARGS_((Tk_Canvas canvas,
+ int argc, Tcl_Obj *CONST argv[]);
+static void DeleteImage(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayImage(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static void ScaleImage _ANSI_ARGS_((Tk_Canvas canvas,
+ int x, int y, int width, int height);
+static void ScaleImage(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslateImage _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
+ double scaleX, double scaleY);
+static void TranslateImage(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double deltaX, double deltaY);
/*
- * The structures below defines the image item type in terms of
- * procedures that can be invoked by generic item code.
+ * The structures below defines the image item type in terms of functions that
+ * can be invoked by generic item code.
*/
Tk_ItemType tkImageType = {
- "image", /* name */
- sizeof(ImageItem), /* itemSize */
- CreateImage, /* createProc */
- configSpecs, /* configSpecs */
- ConfigureImage, /* configureProc */
- ImageCoords, /* coordProc */
- DeleteImage, /* deleteProc */
- DisplayImage, /* displayProc */
- TK_CONFIG_OBJS, /* flags */
- ImageToPoint, /* pointProc */
- ImageToArea, /* areaProc */
- ImageToPostscript, /* postscriptProc */
- ScaleImage, /* scaleProc */
- TranslateImage, /* translateProc */
- (Tk_ItemIndexProc *) NULL, /* indexProc */
- (Tk_ItemCursorProc *) NULL, /* icursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
- (Tk_ItemInsertProc *) NULL, /* insertProc */
- (Tk_ItemDCharsProc *) NULL, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ "image", /* name */
+ sizeof(ImageItem), /* itemSize */
+ CreateImage, /* createProc */
+ configSpecs, /* configSpecs */
+ ConfigureImage, /* configureProc */
+ ImageCoords, /* coordProc */
+ DeleteImage, /* deleteProc */
+ DisplayImage, /* displayProc */
+ TK_CONFIG_OBJS, /* flags */
+ ImageToPoint, /* pointProc */
+ ImageToArea, /* areaProc */
+ ImageToPostscript, /* postscriptProc */
+ ScaleImage, /* scaleProc */
+ TranslateImage, /* translateProc */
+ NULL, /* indexProc */
+ NULL, /* icursorProc */
+ NULL, /* selectionProc */
+ NULL, /* insertProc */
+ NULL, /* dTextProc */
+ NULL, /* nextPtr */
};
/*
@@ -142,14 +136,13 @@ Tk_ItemType tkImageType = {
*
* CreateImage --
*
- * This procedure is invoked to create a new image
- * item in a canvas.
+ * This function is invoked to create a new image item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is left uninitialized,
- * so it can be safely freed by the caller.
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
+ * caller.
*
* Side effects:
* A new image item is created.
@@ -158,19 +151,19 @@ Tk_ItemType tkImageType = {
*/
static int
-CreateImage(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
+CreateImage(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
@@ -187,8 +180,8 @@ CreateImage(interp, canvas, itemPtr, objc, objv)
imgPtr->disabledImage = NULL;
/*
- * Process the arguments to fill in the item record.
- * Only 1 (list) or 2 (x y) coords are allowed.
+ * Process the arguments to fill in the item record. Only 1 (list) or 2 (x
+ * y) coords are allowed.
*/
if (objc == 1) {
@@ -207,7 +200,7 @@ CreateImage(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeleteImage(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -217,9 +210,8 @@ CreateImage(interp, canvas, itemPtr, objc, objv)
*
* ImageCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on image items. See the user documentation for
- * details on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * image items. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -231,20 +223,19 @@ CreateImage(interp, canvas, itemPtr, objc, objv)
*/
static int
-ImageCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+ImageCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
+
Tcl_Obj *subobj = Tcl_NewDoubleObj(imgPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(imgPtr->y);
@@ -271,7 +262,7 @@ ImageCoords(interp, canvas, itemPtr, objc, objv)
ComputeImageBbox(canvas, imgPtr);
} else {
char buf[64];
-
+
sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
@@ -284,12 +275,12 @@ ImageCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureImage --
*
- * This procedure is invoked to configure various aspects
- * of an image item, such as its anchor position.
+ * This function is invoked to configure various aspects of an image
+ * item, such as its anchor position.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
* Configuration information may be set for itemPtr.
@@ -298,13 +289,13 @@ ImageCoords(interp, canvas, itemPtr, objc, objv)
*/
static int
-ConfigureImage(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- 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. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureImage(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
Tk_Window tkwin;
@@ -317,10 +308,10 @@ ConfigureImage(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * Create the image. Save the old image around and don't free it
- * until after the new one is allocated. This keeps the reference
- * count from going to zero so the image doesn't have to be recreated
- * if it hasn't changed.
+ * Create the image. Save the old image around and don't free it until
+ * after the new one is allocated. This keeps the reference count from
+ * going to zero so the image doesn't have to be recreated if it hasn't
+ * changed.
*/
if (imgPtr->activeImageString != NULL) {
@@ -376,8 +367,8 @@ ConfigureImage(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteImage --
*
- * This procedure is called to clean up the data structure
- * associated with a image item.
+ * This function is called to clean up the data structure associated with
+ * a image item.
*
* Results:
* None.
@@ -389,11 +380,10 @@ ConfigureImage(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteImage(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeleteImage(
+ Tk_Canvas canvas, /* Info about overall canvas widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -422,27 +412,24 @@ DeleteImage(canvas, itemPtr, display)
*
* ComputeImageBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a image item.
- * This procedure is where the child image's placement is
- * computed.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a image item. This function is where the
+ * child image's placement is computed.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
-ComputeImageBbox(canvas, imgPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- ImageItem *imgPtr; /* Item whose bbox is to be
- * recomputed. */
+ComputeImageBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ ImageItem *imgPtr) /* Item whose bbox is to be recomputed. */
{
int width, height;
int x, y;
@@ -478,36 +465,36 @@ ComputeImageBbox(canvas, imgPtr)
Tk_SizeOfImage(image, &width, &height);
switch (imgPtr->anchor) {
- case TK_ANCHOR_N:
- x -= width/2;
- break;
- case TK_ANCHOR_NE:
- x -= width;
- break;
- case TK_ANCHOR_E:
- x -= width;
- y -= height/2;
- break;
- case TK_ANCHOR_SE:
- x -= width;
- y -= height;
- break;
- case TK_ANCHOR_S:
- x -= width/2;
- y -= height;
- break;
- case TK_ANCHOR_SW:
- y -= height;
- break;
- case TK_ANCHOR_W:
- y -= height/2;
- break;
- case TK_ANCHOR_NW:
- break;
- case TK_ANCHOR_CENTER:
- x -= width/2;
- y -= height/2;
- break;
+ case TK_ANCHOR_N:
+ x -= width/2;
+ break;
+ case TK_ANCHOR_NE:
+ x -= width;
+ break;
+ case TK_ANCHOR_E:
+ x -= width;
+ y -= height/2;
+ break;
+ case TK_ANCHOR_SE:
+ x -= width;
+ y -= height;
+ break;
+ case TK_ANCHOR_S:
+ x -= width/2;
+ y -= height;
+ break;
+ case TK_ANCHOR_SW:
+ y -= height;
+ break;
+ case TK_ANCHOR_W:
+ y -= height/2;
+ break;
+ case TK_ANCHOR_NW:
+ break;
+ case TK_ANCHOR_CENTER:
+ x -= width/2;
+ y -= height/2;
+ break;
}
/*
@@ -525,35 +512,34 @@ ComputeImageBbox(canvas, imgPtr)
*
* DisplayImage --
*
- * This procedure is invoked to draw a image item in a given
- * drawable.
+ * This function is invoked to draw a image item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayImage(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int x, y, width, height; /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayImage(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, int width, int height)
+ /* Describes region of canvas that must be
+ * redisplayed (not used). */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
short drawableX, drawableY;
Tk_Image image;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -587,14 +573,14 @@ DisplayImage(canvas, itemPtr, display, drawable, x, y, width, height)
*
* ImageToPoint --
*
- * Computes the distance from a given point to a given
- * rectangle, in canvas units.
+ * Computes the distance from a given point to a given rectangle, in
+ * canvas units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are coordPtr[0] and coordPtr[1] is inside the image. If the
- * point isn't inside the image then the return value is the
- * distance from the point to the image.
+ * The return value is 0 if the point whose x and y coordinates are
+ * coordPtr[0] and coordPtr[1] is inside the image. If the point isn't
+ * inside the image then the return value is the distance from the point
+ * to the image.
*
* Side effects:
* None.
@@ -603,10 +589,10 @@ DisplayImage(canvas, itemPtr, display, drawable, x, y, width, height)
*/
static double
-ImageToPoint(canvas, itemPtr, coordPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *coordPtr; /* Pointer to x and y coordinates. */
+ImageToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *coordPtr) /* Pointer to x and y coordinates. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
double x1, x2, y1, y2, xDiff, yDiff;
@@ -644,14 +630,13 @@ ImageToPoint(canvas, itemPtr, coordPtr)
*
* ImageToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangle.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangle.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -660,12 +645,12 @@ ImageToPoint(canvas, itemPtr, coordPtr)
*/
static int
-ImageToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against rectangle. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
- * area. */
+ImageToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against rectangle. */
+ double *rectPtr) /* Pointer to array of four coordinates
+ * (x1,y1,x2,y2) describing rectangular
+ * area. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -689,15 +674,13 @@ ImageToArea(canvas, itemPtr, rectPtr)
*
* ImageToPostscript --
*
- * This procedure is called to generate Postscript for
- * image items.
+ * This function is called to generate Postscript for image items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in interp->result, replacing whatever used to be there.
- * If no error occurs, then Postscript for the item is appended
- * to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in interp->result,
+ * replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -706,15 +689,13 @@ ImageToArea(canvas, itemPtr, rectPtr)
*/
static int
-ImageToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created.*/
+ImageToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created.*/
{
ImageItem *imgPtr = (ImageItem *)itemPtr;
Tk_Window canvasWin = Tk_CanvasTkwin(canvas);
@@ -725,7 +706,7 @@ ImageToPostscript(interp, canvas, itemPtr, prepass)
Tk_Image image;
Tk_State state = itemPtr->state;
- if (state == TK_STATE_NULL) {
+ if(state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -743,33 +724,34 @@ ImageToPostscript(interp, canvas, itemPtr, prepass)
/*
* Image item without actual image specified.
*/
- return TCL_OK;
+
+ return TCL_OK;
}
Tk_SizeOfImage(image, &width, &height);
/*
- * Compute the coordinates of the lower-left corner of the image,
- * taking into account the anchor position for the image.
+ * Compute the coordinates of the lower-left corner of the image, taking
+ * into account the anchor position for the image.
*/
x = imgPtr->x;
y = Tk_CanvasPsY(canvas, imgPtr->y);
switch (imgPtr->anchor) {
- case TK_ANCHOR_NW: y -= height; break;
- case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
- case TK_ANCHOR_NE: x -= width; y -= height; break;
- case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
- case TK_ANCHOR_SE: x -= width; break;
- case TK_ANCHOR_S: x -= width/2.0; break;
- case TK_ANCHOR_SW: break;
- case TK_ANCHOR_W: y -= height/2.0; break;
- case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
+ case TK_ANCHOR_NW: y -= height; break;
+ case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
+ case TK_ANCHOR_NE: x -= width; y -= height; break;
+ case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
+ case TK_ANCHOR_SE: x -= width; break;
+ case TK_ANCHOR_S: x -= width/2.0; break;
+ case TK_ANCHOR_SW: break;
+ case TK_ANCHOR_W: y -= height/2.0; break;
+ case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
}
if (!prepass) {
sprintf(buffer, "%.15g %.15g", x, y);
- Tcl_AppendResult(interp, buffer, " translate\n", (char *) NULL);
+ Tcl_AppendResult(interp, buffer, " translate\n", NULL);
}
return Tk_PostscriptImage(image, interp, canvasWin,
@@ -781,14 +763,14 @@ ImageToPostscript(interp, canvas, itemPtr, prepass)
*
* ScaleImage --
*
- * This procedure is invoked to rescale an item.
+ * This function is invoked to rescale an item.
*
* Results:
* None.
*
* Side effects:
- * The item referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point coordinates:
+ * The item referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -796,12 +778,13 @@ ImageToPostscript(interp, canvas, itemPtr, prepass)
*/
static void
-ScaleImage(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing rectangle. */
- Tk_Item *itemPtr; /* Rectangle to be scaled. */
- double originX, originY; /* Origin about which to scale rect. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleImage(
+ Tk_Canvas canvas, /* Canvas containing rectangle. */
+ Tk_Item *itemPtr, /* Rectangle to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale rect. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -815,25 +798,24 @@ ScaleImage(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* TranslateImage --
*
- * This procedure is called to move an item by a given amount.
+ * This function is called to move an item by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the item is offset by (xDelta, yDelta), and
- * the bounding box is updated in the generic part of the item
- * structure.
+ * The position of the item is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateImage(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslateImage(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
ImageItem *imgPtr = (ImageItem *) itemPtr;
@@ -847,9 +829,9 @@ TranslateImage(canvas, itemPtr, deltaX, deltaY)
*
* ImageChangedProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the image's size or
- * how it is displayed.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the image's size or how it is
+ * displayed.
*
* Results:
* None.
@@ -861,21 +843,21 @@ TranslateImage(canvas, itemPtr, deltaX, deltaY)
*/
static void
-ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight)
- ClientData clientData; /* Pointer to canvas item for image. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+ImageChangedProc(
+ ClientData clientData, /* Pointer to canvas item for image. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (may be <=
+ * 0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
ImageItem *imgPtr = (ImageItem *) clientData;
/*
- * If the image's size changed and it's not anchored at its
- * northwest corner then just redisplay the entire area of the
- * image. This is a bit over-conservative, but we need to do
- * something because a size change also means a position change.
+ * If the image's size changed and it's not anchored at its northwest
+ * corner then just redisplay the entire area of the image. This is a bit
+ * over-conservative, but we need to do something because a size change
+ * also means a position change.
*/
if (((imgPtr->header.x2 - imgPtr->header.x1) != imgWidth)
@@ -885,9 +867,17 @@ ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight)
height = imgHeight;
Tk_CanvasEventuallyRedraw(imgPtr->canvas, imgPtr->header.x1,
imgPtr->header.y1, imgPtr->header.x2, imgPtr->header.y2);
- }
+ }
ComputeImageBbox(imgPtr->canvas, imgPtr);
Tk_CanvasEventuallyRedraw(imgPtr->canvas, imgPtr->header.x1 + x,
imgPtr->header.y1 + y, (int) (imgPtr->header.x1 + x + width),
(int) (imgPtr->header.y1 + y + height));
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index 0a08922..41a3d25 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvLine.c --
*
* This file implements line items for canvas widgets.
@@ -7,13 +7,12 @@
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998-1999 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
/*
@@ -26,21 +25,21 @@ typedef enum {
typedef struct LineItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
Tk_Outline outline; /* Outline structure */
- Tk_Canvas canvas; /* Canvas containing item. Needed for
- * parsing arrow shapes. */
+ Tk_Canvas canvas; /* Canvas containing item. Needed for parsing
+ * arrow shapes. */
int numPoints; /* Number of points in line (always >= 0). */
- double *coordPtr; /* Pointer to malloc-ed array containing
- * x- and y-coords of all points in line.
+ double *coordPtr; /* Pointer to malloc-ed array containing x-
+ * and y-coords of all points in line.
* X-coords are even-valued indices, y-coords
* are corresponding odd-valued indices. If
- * the line has arrowheads then the first
- * and last points have been adjusted to refer
- * to the necks of the arrowheads rather than
- * their tips. The actual endpoints are
- * stored in the *firstArrowPtr and
- * *lastArrowPtr, if they exist. */
+ * the line has arrowheads then the first and
+ * last points have been adjusted to refer to
+ * the necks of the arrowheads rather than
+ * their tips. The actual endpoints are stored
+ * in the *firstArrowPtr and *lastArrowPtr, if
+ * they exist. */
int capStyle; /* Cap style for line. */
int joinStyle; /* Join style for line. */
GC arrowGC; /* Graphics context for drawing arrowheads. */
@@ -53,13 +52,13 @@ typedef struct LineItem {
* edge of shaft. */
double *firstArrowPtr; /* Points to array of PTS_IN_ARROW points
* describing polygon for arrowhead at first
- * point in line. First point of arrowhead
- * is tip. Malloc'ed. NULL means no arrowhead
- * at first point. */
+ * point in line. First point of arrowhead is
+ * tip. Malloc'ed. NULL means no arrowhead at
+ * first point. */
double *lastArrowPtr; /* Points to polygon for arrowhead at last
* point in line (PTS_IN_ARROW points, first
- * of which is tip). Malloc'ed. NULL means
- * no arrowhead at last point. */
+ * of which is tip). Malloc'ed. NULL means no
+ * arrowhead at last point. */
Tk_SmoothMethod *smooth; /* Non-zero means draw line smoothed (i.e.
* with Bezier splines). */
int splineSteps; /* Number of steps in each spline segment. */
@@ -72,65 +71,63 @@ typedef struct LineItem {
#define PTS_IN_ARROW 6
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static int ArrowheadPostscript _ANSI_ARGS_((Tcl_Interp *interp,
+static int ArrowheadPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, LineItem *linePtr,
- double *arrowPtr));
-static void ComputeLineBbox _ANSI_ARGS_((Tk_Canvas canvas,
- LineItem *linePtr));
-static int ConfigureLine _ANSI_ARGS_((Tcl_Interp *interp,
+ double *arrowPtr);
+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));
-static int ConfigureArrows _ANSI_ARGS_((Tk_Canvas canvas,
- LineItem *linePtr));
-static int CreateLine _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteLine _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayLine _ANSI_ARGS_((Tk_Canvas canvas,
+ int objc, Tcl_Obj *CONST objv[]);
+static void DeleteLine(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayLine(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static int GetLineIndex _ANSI_ARGS_((Tcl_Interp *interp,
+ int x, int y, int width, int height);
+static int GetLineIndex(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- Tcl_Obj *obj, int *indexPtr));
-static int LineCoords _ANSI_ARGS_((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[]));
-static void LineDeleteCoords _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int first, int last));
-static void LineInsert _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int beforeThis, Tcl_Obj *obj));
-static int LineToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double LineToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *coordPtr));
-static int LineToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static int ArrowParseProc _ANSI_ARGS_((ClientData clientData,
+ 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,
+ Tk_Item *itemPtr, int beforeThis, Tcl_Obj *obj);
+static int LineToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double LineToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *coordPtr);
+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 _ANSI_ARGS_((ClientData clientData,
+ CONST char *value, char *recordPtr, int offset);
+static char * ArrowPrintProc(ClientData clientData,
Tk_Window tkwin, char *recordPtr, int offset,
- Tcl_FreeProc **freeProcPtr));
-static int ParseArrowShape _ANSI_ARGS_((ClientData clientData,
+ Tcl_FreeProc **freeProcPtr);
+static int ParseArrowShape(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *recordPtr, int offset));
-static char * PrintArrowShape _ANSI_ARGS_((ClientData clientData,
+ CONST char *value, char *recordPtr, int offset);
+static char * PrintArrowShape(ClientData clientData,
Tk_Window tkwin, char *recordPtr, int offset,
- Tcl_FreeProc **freeProcPtr));
-static void ScaleLine _ANSI_ARGS_((Tk_Canvas canvas,
+ Tcl_FreeProc **freeProcPtr);
+static void ScaleLine(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslateLine _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
+ 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.
+ * 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 = {
@@ -168,73 +165,65 @@ static Tk_CustomOption pixelOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_CUSTOM, "-activedash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.activeDash),
+ {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-activefill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.activeColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.activeStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-activewidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-activefill", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.activeStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(LineItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_CUSTOM, "-arrow", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-arrow", NULL, NULL,
"none", Tk_Offset(LineItem, arrow), TK_CONFIG_DONT_SET_DEFAULT, &arrowOption},
- {TK_CONFIG_CUSTOM, "-arrowshape", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-arrowshape", NULL, NULL,
"8 10 3", Tk_Offset(LineItem, arrowShapeA),
TK_CONFIG_DONT_SET_DEFAULT, &arrowShapeOption},
- {TK_CONFIG_CAP_STYLE, "-capstyle", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CAP_STYLE, "-capstyle", NULL, NULL,
"butt", Tk_Offset(LineItem, capStyle), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(LineItem, outline.color), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-dash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.dash),
+ {TK_CONFIG_CUSTOM, "-dash", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_PIXELS, "-dashoffset", (char *) NULL, (char *) NULL,
- "0", Tk_Offset(LineItem, outline.offset),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-disableddash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.disabledDash),
+ {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
+ "0", Tk_Offset(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT},
+ {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-disabledfill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.disabledColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledstipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.disabledStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-disabledwidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
+ NULL, Tk_Offset(LineItem, outline.disabledStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(LineItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_JOIN_STYLE, "-joinstyle", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
"round", Tk_Offset(LineItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-offset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(LineItem, outline.tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
- {TK_CONFIG_CUSTOM, "-smooth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-smooth", NULL, NULL,
"0", Tk_Offset(LineItem, smooth),
TK_CONFIG_DONT_SET_DEFAULT, &smoothOption},
- {TK_CONFIG_INT, "-splinesteps", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_INT, "-splinesteps", NULL, NULL,
"12", Tk_Offset(LineItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_BITMAP, "-stipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(LineItem, outline.stipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_CUSTOM, "-width", (char *) NULL, (char *) 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},
+ {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, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * The structures below defines the line item type by means
- * of procedures that can be invoked by generic item code.
+ * The structures below defines the line item type by means of functions that
+ * can be invoked by generic item code.
*/
Tk_ItemType tkLineType = {
@@ -253,17 +242,17 @@ Tk_ItemType tkLineType = {
ScaleLine, /* scaleProc */
TranslateLine, /* translateProc */
(Tk_ItemIndexProc *) GetLineIndex, /* indexProc */
- (Tk_ItemCursorProc *) NULL, /* icursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
+ NULL, /* icursorProc */
+ NULL, /* selectionProc */
(Tk_ItemInsertProc *) LineInsert, /* insertProc */
LineDeleteCoords, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ NULL, /* nextPtr */
};
/*
- * The definition below determines how large are static arrays
- * used to hold spline points (splines larger than this have to
- * have their arrays malloc-ed).
+ * The definition below determines how large are static arrays used to hold
+ * spline points (splines larger than this have to have their arrays
+ * malloc-ed).
*/
#define MAX_STATIC_POINTS 200
@@ -273,14 +262,13 @@ Tk_ItemType tkLineType = {
*
* CreateLine --
*
- * This procedure is invoked to create a new line item in
- * a canvas.
+ * This function is invoked to create a new line item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is left uninitialized,
- * so it can be safely freed by the caller.
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
+ * caller.
*
* Side effects:
* A new line item is created.
@@ -289,25 +277,24 @@ Tk_ItemType tkLineType = {
*/
static int
-CreateLine(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing line. */
+CreateLine(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing line. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
- * Carry out initialization that is needed to set defaults and to
- * allow proper cleanup after errors during the the remainder of
- * this procedure.
+ * Carry out initialization that is needed to set defaults and to allow
+ * proper cleanup after errors during the the remainder of this function.
*/
Tk_CreateOutline(&(linePtr->outline));
@@ -323,17 +310,18 @@ CreateLine(interp, canvas, itemPtr, objc, objv)
linePtr->arrowShapeC = (float)3.0;
linePtr->firstArrowPtr = NULL;
linePtr->lastArrowPtr = NULL;
- linePtr->smooth = (Tk_SmoothMethod *) NULL;
+ linePtr->smooth = NULL;
linePtr->splineSteps = 12;
/*
- * Count the number of points and then parse them into a point
- * array. Leading arguments are assumed to be points if they
- * start with a digit or a minus sign followed by a digit.
+ * Count the number of points and then parse them into a point array.
+ * Leading arguments are assumed to be points if they start with a digit
+ * or a minus sign followed by a digit.
*/
for (i = 1; i < objc; i++) {
char *arg = Tcl_GetString(objv[i]);
+
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
}
@@ -345,7 +333,7 @@ CreateLine(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeleteLine(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -355,9 +343,8 @@ CreateLine(interp, canvas, itemPtr, objc, objv)
*
* LineCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on lines. See the user documentation for details
- * on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * lines. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -369,15 +356,13 @@ CreateLine(interp, canvas, itemPtr, objc, objv)
*/
static int
-LineCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+LineCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i, numPoints;
@@ -414,20 +399,22 @@ LineCoords(interp, canvas, itemPtr, objc, objv)
}
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);
return TCL_ERROR;
} else if (objc < 4) {
char buf[64 + TCL_INTEGER_SPACE];
+
sprintf(buf, "wrong # coordinates: expected at least 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
} else {
numPoints = objc/2;
if (linePtr->numPoints != numPoints) {
- coordPtr = (double *) ckalloc((unsigned)
- (sizeof(double) * objc));
+ coordPtr = (double *)
+ ckalloc((unsigned) (sizeof(double) * objc));
if (linePtr->coordPtr != NULL) {
ckfree((char *) linePtr->coordPtr);
}
@@ -468,28 +455,28 @@ LineCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureLine --
*
- * This procedure is invoked to configure various aspects
- * of a line item such as its background color.
+ * This function is invoked to configure various aspects of a line item
+ * such as its background color.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
- * Configuration information, such as colors and stipple
- * patterns, may be set for itemPtr.
+ * Configuration information, such as colors and stipple patterns, may be
+ * set for itemPtr.
*
*--------------------------------------------------------------
*/
static int
-ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Line item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+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 flags) /* Flags to pass to Tk_ConfigureWidget. */
{
LineItem *linePtr = (LineItem *) itemPtr;
XGCValues gcValues;
@@ -505,8 +492,8 @@ ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * A few of the options require additional processing, such as
- * graphics contexts.
+ * A few of the options require additional processing, such as graphics
+ * contexts.
*/
state = itemPtr->state;
@@ -571,9 +558,8 @@ ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * Setup arrowheads, if needed. If arrowheads are turned off,
- * restore the line's endpoints (they were shortened when the
- * arrowheads were added).
+ * Setup arrowheads, if needed. If arrowheads are turned off, restore the
+ * line's endpoints (they were shortened when the arrowheads were added).
*/
if ((linePtr->firstArrowPtr != NULL) && (linePtr->arrow != ARROWS_FIRST)
@@ -611,8 +597,8 @@ ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteLine --
*
- * This procedure is called to clean up the data structure
- * associated with a line item.
+ * This function is called to clean up the data structure associated with
+ * a line item.
*
* Results:
* None.
@@ -624,11 +610,10 @@ ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteLine(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeleteLine(
+ Tk_Canvas canvas, /* Info about overall canvas widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
LineItem *linePtr = (LineItem *) itemPtr;
@@ -652,24 +637,22 @@ DeleteLine(canvas, itemPtr, display)
*
* ComputeLineBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a line.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a line.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
static void
-ComputeLineBbox(canvas, linePtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- LineItem *linePtr; /* Item whose bbos is to be
- * recomputed. */
+ComputeLineBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ LineItem *linePtr) /* Item whose bbos is to be recomputed. */
{
double *coordPtr;
int i, intWidth;
@@ -705,13 +688,12 @@ ComputeLineBbox(canvas, linePtr)
linePtr->header.y1 = linePtr->header.y2 = (int) coordPtr[1];
/*
- * Compute the bounding box of all the points in the line,
- * then expand in 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. Don't do
- * anything special for curves. This causes an additional
- * overestimate in the bounding box, but is faster.
+ * Compute the bounding box of all the points in the line, then expand in
+ * 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.
*/
for (i = 1, coordPtr = linePtr->coordPtr+2; i < linePtr->numPoints;
@@ -780,9 +762,9 @@ ComputeLineBbox(canvas, linePtr)
}
/*
- * For mitered lines, make a second pass through all the points.
- * Compute the locations of the two miter vertex points and add
- * those into the bounding box.
+ * For mitered lines, make a second pass through all the points. Compute
+ * the locations of the two miter vertex points and add those into the
+ * bounding box.
*/
if (linePtr->joinStyle == JoinMiter) {
@@ -790,7 +772,7 @@ ComputeLineBbox(canvas, linePtr)
i--, coordPtr += 2) {
double miter[4];
int j;
-
+
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
width, miter, miter+2)) {
for (j = 0; j < 4; j += 2) {
@@ -820,8 +802,8 @@ ComputeLineBbox(canvas, linePtr)
}
/*
- * Add one more pixel of fudge factor just to be safe (e.g.
- * X may round differently than we do).
+ * Add one more pixel of fudge factor just to be safe (e.g. X may round
+ * differently than we do).
*/
linePtr->header.x1 -= 1;
@@ -835,28 +817,27 @@ ComputeLineBbox(canvas, linePtr)
*
* DisplayLine --
*
- * This procedure is invoked to draw a line item in a given
- * drawable.
+ * This function is invoked to draw a line item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int x, y, width, height; /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayLine(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, int width, int height)
+ /* Describes region of canvas that must be
+ * redisplayed (not used). */
{
LineItem *linePtr = (LineItem *) itemPtr;
XPoint staticPoints[MAX_STATIC_POINTS*3];
@@ -864,7 +845,6 @@ DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
double linewidth;
int numPoints;
Tk_State state = itemPtr->state;
- Pixmap stipple = linePtr->outline.stipple;
if ((!linePtr->numPoints)||(linePtr->outline.gc==None)) {
return;
@@ -875,31 +855,24 @@ DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
}
linewidth = linePtr->outline.width;
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeStipple != None) {
- stipple = linePtr->outline.activeStipple;
- }
if (linePtr->outline.activeWidth != linewidth) {
linewidth = linePtr->outline.activeWidth;
}
} else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledStipple != None) {
- stipple = linePtr->outline.disabledStipple;
- }
if (linePtr->outline.disabledWidth != linewidth) {
linewidth = linePtr->outline.disabledWidth;
}
}
/*
- * Build up an array of points in screen coordinates. Use a
- * static array unless the line has an enormous number of points;
- * in this case, dynamically allocate an array. For smoothed lines,
- * generate the curve points on each redisplay.
+ * Build up an array of points in screen coordinates. Use a static array
+ * unless the line has an enormous number of points; in this case,
+ * dynamically allocate an array. For smoothed lines, generate the curve
+ * points on each redisplay.
*/
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
- numPoints = linePtr->smooth->coordProc(canvas, (double *) NULL,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = linePtr->smooth->coordProc(canvas, NULL,
+ linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
} else {
numPoints = linePtr->numPoints;
}
@@ -912,18 +885,17 @@ DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
- linePtr->numPoints, linePtr->splineSteps, pointPtr,
- (double *) NULL);
+ linePtr->numPoints, linePtr->splineSteps, pointPtr, NULL);
} else {
numPoints = TkCanvTranslatePath((TkCanvas*)canvas, numPoints,
linePtr->coordPtr, 0, pointPtr);
}
/*
- * Display line, the free up line storage if it was dynamically
- * allocated. If we're stippling, then modify the stipple offset
- * in the GC. Be sure to reset the offset when done, since the
- * GC is supposed to be read-only.
+ * Display line, the free up line storage if it was dynamically allocated.
+ * If we're stippling, then modify the stipple offset in the GC. Be sure
+ * to reset the offset when done, since the GC is supposed to be
+ * read-only.
*/
if (Tk_ChangeOutlineGC(canvas, itemPtr, &(linePtr->outline))) {
@@ -979,24 +951,24 @@ DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
*/
static void
-LineInsert(canvas, itemPtr, beforeThis, obj)
- Tk_Canvas canvas; /* Canvas containing text item. */
- Tk_Item *itemPtr; /* Line item to be modified. */
- int beforeThis; /* Index before which new coordinates
- * are to be inserted. */
- Tcl_Obj *obj; /* New coordinates to be inserted. */
+LineInsert(
+ Tk_Canvas canvas, /* Canvas containing text item. */
+ Tk_Item *itemPtr, /* Line item to be modified. */
+ int beforeThis, /* Index before which new coordinates are to
+ * be inserted. */
+ Tcl_Obj *obj) /* New coordinates to be inserted. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int length, objc, i;
- double *new, *coordPtr;
+ double *newCoordPtr, *coordPtr;
Tk_State state = itemPtr->state;
Tcl_Obj **objv;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
- if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &objc, &objv) != TCL_OK)
+ if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK)
|| !objc || objc&1) {
return;
}
@@ -1015,35 +987,39 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
}
- new = (double *) ckalloc((unsigned)(sizeof(double) * (length + objc)));
- for(i=0; i<beforeThis; i++) {
- new[i] = linePtr->coordPtr[i];
+ newCoordPtr = (double *)
+ ckalloc(sizeof(double) * (unsigned)(length + objc));
+ for (i=0; i<beforeThis; i++) {
+ newCoordPtr[i] = linePtr->coordPtr[i];
}
- for(i=0; i<objc; i++) {
- if (Tcl_GetDoubleFromObj((Tcl_Interp *) NULL,objv[i],
- new+(i+beforeThis))!=TCL_OK) {
+ for (i=0; i<objc; i++) {
+ if (Tcl_GetDoubleFromObj(NULL, objv[i],
+ &newCoordPtr[i + beforeThis]) != TCL_OK) {
Tcl_ResetResult(((TkCanvas *)canvas)->interp);
- ckfree((char *) new);
+ ckfree((char *) newCoordPtr);
return;
}
}
- for(i=beforeThis; i<length; i++) {
- new[i+objc] = linePtr->coordPtr[i];
+ for (i=beforeThis; i<length; i++) {
+ newCoordPtr[i+objc] = linePtr->coordPtr[i];
+ }
+ if (linePtr->coordPtr) {
+ ckfree((char *)linePtr->coordPtr);
}
- if(linePtr->coordPtr) ckfree((char *)linePtr->coordPtr);
- linePtr->coordPtr = new;
+ linePtr->coordPtr = newCoordPtr;
linePtr->numPoints = (length + objc)/2;
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 that part) need to be redrawn. A special flag is set that
- * instructs the general canvas code not to redraw the whole
- * object. If this flag is not set, the canvas will do the redrawing,
- * otherwise I have to do it here.
+ * This is some optimizing code that will result that only the part of
+ * the polygon that changed (and the objects that are overlapping with
+ * that part) need to be redrawn. A special flag is set that instructs
+ * the general canvas code not to redraw the whole object. If this
+ * flag is not set, the canvas will do the redrawing, otherwise I have
+ * to do it here.
*/
+
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
if (beforeThis>0) {beforeThis -= 2; objc+=2; }
@@ -1059,23 +1035,29 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
itemPtr->x1 = itemPtr->x2 = (int) linePtr->coordPtr[beforeThis];
itemPtr->y1 = itemPtr->y2 = (int) linePtr->coordPtr[beforeThis+1];
if ((linePtr->firstArrowPtr != NULL) && (beforeThis<1)) {
- /* include old first arrow */
+ /*
+ * Include old first arrow.
+ */
+
for (i = 0, coordPtr = linePtr->firstArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
}
}
if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+objc)>=length)) {
- /* include old last arrow */
+ /*
+ * Include old last arrow.
+ */
+
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
}
}
coordPtr = linePtr->coordPtr+beforeThis+2;
- for(i=2; i<objc; i+=2) {
+ for (i=2; i<objc; i+=2) {
TkIncludePoint(itemPtr, coordPtr);
- coordPtr+=2;
+ coordPtr+=2;
}
}
if (linePtr->firstArrowPtr != NULL) {
@@ -1087,21 +1069,28 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
- ConfigureArrows(canvas, linePtr);
+ ConfigureArrows(canvas, linePtr);
}
- if(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) {
+ if (itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) {
double width;
int intWidth;
+
if ((linePtr->firstArrowPtr != NULL) && (beforeThis>2)) {
- /* include new first arrow */
+ /*
+ * Include new first arrow.
+ */
+
for (i = 0, coordPtr = linePtr->firstArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+objc)<(length-2))) {
- /* include new right arrow */
+ if ((linePtr->lastArrowPtr != NULL) && (beforeThis+objc < length-2)) {
+ /*
+ * Include new right arrow.
+ */
+
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
@@ -1109,13 +1098,13 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
}
width = linePtr->outline.width;
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
- width = linePtr->outline.activeWidth;
- }
+ if (linePtr->outline.activeWidth>width) {
+ width = linePtr->outline.activeWidth;
+ }
} else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
- width = linePtr->outline.disabledWidth;
- }
+ if (linePtr->outline.disabledWidth>0) {
+ width = linePtr->outline.disabledWidth;
+ }
}
intWidth = (int) (width + 0.5);
if (intWidth < 1) {
@@ -1141,18 +1130,18 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
* None.
*
* Side effects:
- * Characters between "first" and "last", inclusive, get
- * deleted from itemPtr.
+ * Characters between "first" and "last", inclusive, get deleted from
+ * itemPtr.
*
*--------------------------------------------------------------
*/
static void
-LineDeleteCoords(canvas, itemPtr, first, last)
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Item in which to delete characters. */
- int first; /* Index of first character to delete. */
- int last; /* Index of last character to delete. */
+LineDeleteCoords(
+ Tk_Canvas canvas, /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr, /* Item in which to delete characters. */
+ int first, /* Index of first character to delete. */
+ int last) /* Index of last character to delete. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int count, i, first1, last1;
@@ -1160,7 +1149,7 @@ LineDeleteCoords(canvas, itemPtr, first, last)
double *coordPtr;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -1184,36 +1173,51 @@ LineDeleteCoords(canvas, itemPtr, first, last)
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
}
- first1 = first; last1 = last;
- if(first1>0) first1 -= 2;
- if(last1<length-2) last1 += 2;
+ first1 = first;
+ last1 = last;
+ if (first1 > 0) {
+ first1 -= 2;
+ }
+ if (last1 < length-2) {
+ last1 += 2;
+ }
if (linePtr->smooth) {
- if(first1>0) first1 -= 2;
- if(last1<length-2) last1 += 2;
+ if (first1 > 0) {
+ first1 -= 2;
+ }
+ if (last1 < length-2) {
+ last1 += 2;
+ }
}
- 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 that part) need to be redrawn. A special flag is set that
- * instructs the general canvas code not to redraw the whole
- * object. If this flag is set, the redrawing has to be done here,
- * otherwise the general Canvas code will take care of it.
+ * This is some optimizing code that will result that only the part of
+ * the line that changed (and the objects that are overlapping with
+ * that part) need to be redrawn. A special flag is set that instructs
+ * the general canvas code not to redraw the whole object. If this
+ * flag is set, the redrawing has to be done here, otherwise the
+ * general Canvas code will take care of it.
*/
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
itemPtr->x1 = itemPtr->x2 = (int) linePtr->coordPtr[first1];
itemPtr->y1 = itemPtr->y2 = (int) linePtr->coordPtr[first1+1];
- if ((linePtr->firstArrowPtr != NULL) && (first1<2)) {
- /* include old first arrow */
+ if ((linePtr->firstArrowPtr != NULL) && (first1 < 2)) {
+ /*
+ * Include old first arrow.
+ */
+
for (i = 0, coordPtr = linePtr->firstArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && (last1>=length-2)) {
- /* include old last arrow */
+ if ((linePtr->lastArrowPtr != NULL) && (last1 >= length-2)) {
+ /*
+ * Include old last arrow.
+ */
+
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
@@ -1222,7 +1226,7 @@ LineDeleteCoords(canvas, itemPtr, first, last)
coordPtr = linePtr->coordPtr+first1+2;
for (i=first1+2; i<=last1; i+=2) {
TkIncludePoint(itemPtr, coordPtr);
- coordPtr+=2;
+ coordPtr += 2;
}
}
@@ -1240,20 +1244,27 @@ LineDeleteCoords(canvas, itemPtr, first, last)
linePtr->lastArrowPtr = NULL;
}
if (linePtr->arrow != ARROWS_NONE) {
- ConfigureArrows(canvas, linePtr);
+ ConfigureArrows(canvas, linePtr);
}
- if(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) {
+ if (itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW) {
double width;
int intWidth;
- if ((linePtr->firstArrowPtr != NULL) && (first1<4)) {
- /* include new first arrow */
+
+ if ((linePtr->firstArrowPtr != NULL) && (first1 < 4)) {
+ /*
+ * Include new first arrow.
+ */
+
for (i = 0, coordPtr = linePtr->firstArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && (last1>(length-4))) {
- /* include new right arrow */
+ if ((linePtr->lastArrowPtr != NULL) && (last1 > length-4)) {
+ /*
+ * Include new right arrow.
+ */
+
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
TkIncludePoint(itemPtr, coordPtr);
@@ -1261,20 +1272,22 @@ LineDeleteCoords(canvas, itemPtr, first, last)
}
width = linePtr->outline.width;
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeWidth>width) {
- width = linePtr->outline.activeWidth;
- }
+ if (linePtr->outline.activeWidth > width) {
+ width = linePtr->outline.activeWidth;
+ }
} else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledWidth>0) {
- width = linePtr->outline.disabledWidth;
- }
+ if (linePtr->outline.disabledWidth > 0) {
+ width = linePtr->outline.disabledWidth;
+ }
}
intWidth = (int) (width + 0.5);
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);
}
@@ -1286,14 +1299,14 @@ LineDeleteCoords(canvas, itemPtr, first, last)
*
* LineToPoint --
*
- * Computes the distance from a given point to a given
- * line, in canvas units.
+ * Computes the distance from a given point to a given line, in canvas
+ * units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are pointPtr[0] and pointPtr[1] is inside the line. If the
- * point isn't inside the line then the return value is the
- * distance from the point to the line.
+ * The return value is 0 if the point whose x and y coordinates are
+ * pointPtr[0] and pointPtr[1] is inside the line. If the point isn't
+ * inside the line then the return value is the distance from the point
+ * to the line.
*
* Side effects:
* None.
@@ -1303,10 +1316,10 @@ LineDeleteCoords(canvas, itemPtr, first, last)
/* ARGSUSED */
static double
-LineToPoint(canvas, itemPtr, pointPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *pointPtr; /* Pointer to x and y coordinates. */
+LineToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *pointPtr) /* Pointer to x and y coordinates. */
{
Tk_State state = itemPtr->state;
LineItem *linePtr = (LineItem *) itemPtr;
@@ -1315,15 +1328,15 @@ LineToPoint(canvas, itemPtr, pointPtr)
double poly[10];
double bestDist, dist, width;
int numPoints, count;
- int changedMiterToBevel; /* Non-zero means that a mitered corner
- * had to be treated as beveled after all
- * because the angle was < 11 degrees. */
+ int changedMiterToBevel; /* Non-zero means that a mitered corner had to
+ * be treated as beveled after all because the
+ * angle was < 11 degrees. */
bestDist = 1.0e36;
/*
- * Handle smoothed lines by generating an expanded set of points
- * against which to do the check.
+ * Handle smoothed lines by generating an expanded set of points against
+ * which to do the check.
*/
if(state == TK_STATE_NULL) {
@@ -1342,9 +1355,8 @@ LineToPoint(canvas, itemPtr, pointPtr)
}
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
- numPoints = linePtr->smooth->coordProc(canvas, (double *) NULL,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = linePtr->smooth->coordProc(canvas, NULL,
+ linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace;
} else {
@@ -1352,8 +1364,7 @@ LineToPoint(canvas, itemPtr, pointPtr)
(2*numPoints*sizeof(double)));
}
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- linePoints);
+ linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
} else {
numPoints = linePtr->numPoints;
linePoints = linePtr->coordPtr;
@@ -1366,26 +1377,25 @@ LineToPoint(canvas, itemPtr, pointPtr)
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;
+ bestDist = hypot(linePoints[0]-pointPtr[0], linePoints[1]-pointPtr[1])
+ - width/2.0;
if (bestDist < 0) bestDist = 0;
return bestDist;
}
/*
- * The overall idea is to iterate through all of the edges of
- * the line, computing a polygon for each edge and testing the
- * point against that polygon. In addition, there are additional
- * tests to deal with rounded joints and caps.
+ * The overall idea is to iterate through all of the edges of the line,
+ * computing a polygon for each edge and testing the point against that
+ * polygon. In addition, there are additional tests to deal with rounded
+ * joints and caps.
*/
changedMiterToBevel = 0;
for (count = numPoints, coordPtr = linePoints; count >= 2;
count--, coordPtr += 2) {
-
/*
- * If rounding is done around the first point then compute
- * the distance between the point and the point.
+ * If rounding is done around the first point then compute the
+ * distance between the point and the point.
*/
if (((linePtr->capStyle == CapRound) && (count == numPoints))
@@ -1402,9 +1412,9 @@ LineToPoint(canvas, itemPtr, pointPtr)
}
/*
- * Compute the polygonal shape corresponding to this edge,
- * consisting of two points for the first point of the edge
- * and two points for the last point of the edge.
+ * Compute the polygonal shape corresponding to this edge, consisting
+ * of two points for the first point of the edge and two points for
+ * the last point of the edge.
*/
if (count == numPoints) {
@@ -1416,14 +1426,13 @@ LineToPoint(canvas, itemPtr, pointPtr)
poly[2] = poly[4];
poly[3] = poly[5];
} else {
- TkGetButtPoints(coordPtr+2, coordPtr, width, 0,
- poly, poly+2);
+ TkGetButtPoints(coordPtr+2, coordPtr, width, 0, poly, poly+2);
/*
- * If this line uses beveled joints, then check the distance
- * to a polygon comprising the last two points of the previous
- * polygon and the first two from this polygon; this checks
- * the wedges that fill the mitered joint.
+ * If this line uses beveled joints, then check the distance to a
+ * polygon comprising the last two points of the previous polygon
+ * and the first two from this polygon; this checks the wedges
+ * that fill the mitered joint.
*/
if ((linePtr->joinStyle == JoinBevel) || changedMiterToBevel) {
@@ -1446,8 +1455,8 @@ LineToPoint(canvas, itemPtr, pointPtr)
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);
+ TkGetButtPoints(coordPtr, coordPtr+2, width, 0,
+ poly+4, poly+6);
}
} else {
TkGetButtPoints(coordPtr, coordPtr+2, width, 0,
@@ -1465,8 +1474,8 @@ LineToPoint(canvas, itemPtr, pointPtr)
}
/*
- * If caps are rounded, check the distance to the cap around the
- * final end point of the line.
+ * If caps are rounded, check the distance to the cap around the final end
+ * point of the line.
*/
if (linePtr->capStyle == CapRound) {
@@ -1507,7 +1516,7 @@ LineToPoint(canvas, itemPtr, pointPtr)
}
}
- done:
+ done:
if ((linePoints != staticSpace) && (linePoints != linePtr->coordPtr)) {
ckfree((char *) linePoints);
}
@@ -1519,14 +1528,12 @@ LineToPoint(canvas, itemPtr, pointPtr)
*
* LineToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangular area.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangular area.
*
* Results:
- * -1 is returned if the item is entirely outside the
- * area, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area, 0 if it
+ * overlaps, and 1 if it is entirely inside the given area.
*
* Side effects:
* None.
@@ -1536,10 +1543,10 @@ LineToPoint(canvas, itemPtr, pointPtr)
/* ARGSUSED */
static int
-LineToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against line. */
- double *rectPtr;
+LineToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against line. */
+ double *rectPtr)
{
LineItem *linePtr = (LineItem *) itemPtr;
double staticSpace[2*MAX_STATIC_POINTS];
@@ -1568,6 +1575,7 @@ LineToArea(canvas, itemPtr, rectPtr)
return -1;
} else if (linePtr->numPoints == 1) {
double oval[4];
+
oval[0] = linePtr->coordPtr[0]-radius;
oval[1] = linePtr->coordPtr[1]-radius;
oval[2] = linePtr->coordPtr[0]+radius;
@@ -1576,14 +1584,13 @@ LineToArea(canvas, itemPtr, rectPtr)
}
/*
- * Handle smoothed lines by generating an expanded set of points
- * against which to do the check.
+ * Handle smoothed lines by generating an expanded set of points against
+ * which to do the check.
*/
if ((linePtr->smooth) && (linePtr->numPoints > 2)) {
- numPoints = linePtr->smooth->coordProc(canvas, (double *) NULL,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = linePtr->smooth->coordProc(canvas, NULL,
+ linePtr->numPoints, linePtr->splineSteps, NULL, NULL);
if (numPoints <= MAX_STATIC_POINTS) {
linePoints = staticSpace;
} else {
@@ -1591,8 +1598,7 @@ LineToArea(canvas, itemPtr, rectPtr)
(2*numPoints*sizeof(double)));
}
numPoints = linePtr->smooth->coordProc(canvas, linePtr->coordPtr,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- linePoints);
+ linePtr->numPoints, linePtr->splineSteps, NULL, linePoints);
} else {
numPoints = linePtr->numPoints;
linePoints = linePtr->coordPtr;
@@ -1606,7 +1612,7 @@ LineToArea(canvas, itemPtr, rectPtr)
width = 1.0;
}
- result = TkThickPolyLineToArea(linePoints, numPoints,
+ result = TkThickPolyLineToArea(linePoints, numPoints,
width, linePtr->capStyle, linePtr->joinStyle,
rectPtr);
if (result == 0) {
@@ -1634,7 +1640,7 @@ LineToArea(canvas, itemPtr, rectPtr)
}
}
- done:
+ done:
if ((linePoints != staticSpace) && (linePoints != linePtr->coordPtr)) {
ckfree((char *) linePoints);
}
@@ -1646,15 +1652,14 @@ LineToArea(canvas, itemPtr, rectPtr)
*
* ScaleLine --
*
- * This procedure is invoked to rescale a line item.
+ * This function is invoked to rescale a line item.
*
* Results:
* None.
*
* Side effects:
- * The line referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point
- * coordinates:
+ * The line referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -1662,20 +1667,21 @@ LineToArea(canvas, itemPtr, rectPtr)
*/
static void
-ScaleLine(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing line. */
- Tk_Item *itemPtr; /* Line to be scaled. */
- double originX, originY; /* Origin about which to scale rect. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleLine(
+ Tk_Canvas canvas, /* Canvas containing line. */
+ Tk_Item *itemPtr, /* Line to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale rect. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
LineItem *linePtr = (LineItem *) itemPtr;
double *coordPtr;
int i;
/*
- * Delete any arrowheads before scaling all the points (so that
- * the end-points of the line get restored).
+ * Delete any arrowheads before scaling all the points (so that the
+ * end-points of the line get restored).
*/
if (linePtr->firstArrowPtr != NULL) {
@@ -1709,14 +1715,13 @@ ScaleLine(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* GetLineIndex --
*
- * Parse an index into a line item and return either its value
- * or an error.
+ * Parse an index into a line item and return either its value or an
+ * error.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the index (into itemPtr) corresponding to
- * string. Otherwise an error message is left in
- * interp->result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the index (into itemPtr) corresponding to string. Otherwise an
+ * error message is left in interp->result.
*
* Side effects:
* None.
@@ -1725,14 +1730,14 @@ ScaleLine(canvas, itemPtr, originX, originY, scaleX, scaleY)
*/
static int
-GetLineIndex(interp, canvas, itemPtr, obj, indexPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item for which the index is being
+GetLineIndex(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item for which the index is being
* specified. */
- Tcl_Obj *obj; /* Specification of a particular coord
- * in itemPtr's line. */
- int *indexPtr; /* Where to store converted index. */
+ Tcl_Obj *obj, /* Specification of a particular coord in
+ * itemPtr's line. */
+ int *indexPtr) /* Where to store converted index. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int length;
@@ -1742,16 +1747,14 @@ GetLineIndex(interp, canvas, itemPtr, obj, indexPtr)
if (strncmp(string, "end", (unsigned) length) == 0) {
*indexPtr = 2*linePtr->numPoints;
} else {
- badIndex:
-
/*
- * Some of the paths here leave messages in interp->result,
- * so we have to clear it out before storing our own message.
+ * Some of the paths here leave messages in interp->result, so we
+ * have to clear it out before storing our own message.
*/
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad index \"", string, "\"",
- (char *) NULL);
+ badIndex:
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
return TCL_ERROR;
}
} else if (string[0] == '@') {
@@ -1784,7 +1787,7 @@ GetLineIndex(interp, canvas, itemPtr, obj, indexPtr)
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)) {
@@ -1799,25 +1802,24 @@ GetLineIndex(interp, canvas, itemPtr, obj, indexPtr)
*
* TranslateLine --
*
- * This procedure is called to move a line by a given amount.
+ * This function is called to move a line by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the line is offset by (xDelta, yDelta), and
- * the bounding box is updated in the generic part of the item
- * structure.
+ * The position of the line is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateLine(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslateLine(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
LineItem *linePtr = (LineItem *) itemPtr;
double *coordPtr;
@@ -1850,13 +1852,13 @@ TranslateLine(canvas, itemPtr, deltaX, deltaY)
*
* ParseArrowShape --
*
- * This procedure is called back during option parsing to
- * parse arrow shape information.
+ * This function is called back during option parsing to parse arrow
+ * shape information.
*
* Results:
- * The return value is a standard Tcl result: TCL_OK means
- * that the arrow shape information was parsed ok, and
- * TCL_ERROR means it couldn't be parsed.
+ * The return value is a standard Tcl result: TCL_OK means that the arrow
+ * shape information was parsed ok, and TCL_ERROR means it couldn't be
+ * parsed.
*
* Side effects:
* Arrow information in recordPtr is updated.
@@ -1866,14 +1868,14 @@ TranslateLine(canvas, itemPtr, deltaX, deltaY)
/* ARGSUSED */
static int
-ParseArrowShape(clientData, interp, tkwin, value, recordPtr, offset)
- ClientData clientData; /* Not used. */
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Window tkwin; /* Not used. */
- 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
+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. */
+ char *recordPtr, /* Pointer to item record in which to store
+ * arrow information. */
+ int offset) /* Offset of shape information in widget
* record. */
{
LineItem *linePtr = (LineItem *) recordPtr;
@@ -1882,14 +1884,14 @@ ParseArrowShape(clientData, interp, tkwin, value, recordPtr, offset)
CONST char **argv = NULL;
if (offset != Tk_Offset(LineItem, arrowShapeA)) {
- panic("ParseArrowShape received bogus offset");
+ Tcl_Panic("ParseArrowShape received bogus offset");
}
if (Tcl_SplitList(interp, (char *) value, &argc, &argv) != TCL_OK) {
syntaxError:
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad arrow shape \"", value,
- "\": must be list with three numbers", (char *) NULL);
+ "\": must be list with three numbers", NULL);
if (argv != NULL) {
ckfree((char *) argv);
}
@@ -1917,8 +1919,8 @@ ParseArrowShape(clientData, interp, tkwin, value, recordPtr, offset)
*
* PrintArrowShape --
*
- * This procedure is a callback invoked by the configuration
- * code to return a printable value describing an arrow shape.
+ * This function is a callback invoked by the configuration code to
+ * return a printable value describing an arrow shape.
*
* Results:
* None.
@@ -1931,14 +1933,14 @@ ParseArrowShape(clientData, interp, tkwin, value, recordPtr, offset)
/* ARGSUSED */
static char *
-PrintArrowShape(clientData, tkwin, recordPtr, offset, freeProcPtr)
- ClientData clientData; /* Not used. */
- Tk_Window tkwin; /* Window associated with linePtr's widget. */
- char *recordPtr; /* Pointer to item record containing current
+PrintArrowShape(
+ ClientData clientData, /* Not used. */
+ Tk_Window tkwin, /* Window associated with linePtr's widget. */
+ char *recordPtr, /* Pointer to item record containing current
* shape information. */
- int offset; /* Offset of arrow information in record. */
- Tcl_FreeProc **freeProcPtr; /* Store address of procedure to call to
- * free string here. */
+ int offset, /* Offset of arrow information in record. */
+ Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free
+ * string here. */
{
LineItem *linePtr = (LineItem *) recordPtr;
char *buffer;
@@ -1956,27 +1958,27 @@ PrintArrowShape(clientData, tkwin, recordPtr, offset, freeProcPtr)
*
* ArrowParseProc --
*
- * This procedure is invoked during option processing to handle
- * the "-arrow" option.
+ * This function is invoked during option processing to handle the
+ * "-arrow" option.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * The arrow for a given item gets replaced by the arrow
- * indicated in the value argument.
+ * The arrow for a given item gets replaced by the arrow indicated in the
+ * value argument.
*
*--------------------------------------------------------------
*/
static int
-ArrowParseProc(clientData, interp, tkwin, value, widgRec, offset)
- ClientData clientData; /* some flags.*/
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- CONST char *value; /* Value of option. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
+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. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset) /* Offset into item. */
{
int c;
size_t length;
@@ -2008,9 +2010,8 @@ ArrowParseProc(clientData, interp, tkwin, value, widgRec, offset)
return TCL_OK;
}
- Tcl_AppendResult(interp, "bad arrow spec \"", value,
- "\": must be none, first, last, or both",
- (char *) NULL);
+ Tcl_AppendResult(interp, "bad arrow spec \"", value,
+ "\": must be none, first, last, or both", NULL);
*arrowPtr = ARROWS_NONE;
return TCL_ERROR;
}
@@ -2020,16 +2021,15 @@ ArrowParseProc(clientData, interp, tkwin, value, widgRec, offset)
*
* ArrowPrintProc --
*
- * This procedure is invoked by the Tk configuration code
- * to produce a printable string for the "-arrow"
- * configuration option.
+ * This function is invoked by the Tk configuration code to produce a
+ * printable string for the "-arrow" configuration option.
*
* Results:
- * The return value is a string describing the arrows for
- * the item referred to by "widgRec". In addition, *freeProcPtr
- * is filled in with the address of a procedure to call to free
- * the result string when it's no longer needed (or NULL to
- * indicate that the string doesn't need to be freed).
+ * The return value is a string describing the arrows for the item
+ * referred to by "widgRec". In addition, *freeProcPtr is filled in with
+ * the address of a function to call to free the result string when it's
+ * no longer needed (or NULL to indicate that the string doesn't need to
+ * be freed).
*
* Side effects:
* None.
@@ -2038,25 +2038,25 @@ ArrowParseProc(clientData, interp, tkwin, value, widgRec, offset)
*/
static char *
-ArrowPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
- ClientData clientData; /* Ignored. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to variable to fill in with
- * information about how to reclaim
- * storage for return string. */
+ArrowPrintProc(
+ ClientData clientData, /* Ignored. */
+ Tk_Window tkwin, /* Window containing canvas widget. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset, /* Offset into item. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
+ * information about how to reclaim storage
+ * for return string. */
{
register Arrows *arrowPtr = (Arrows *) (widgRec + offset);
switch (*arrowPtr) {
- case ARROWS_FIRST:
+ case ARROWS_FIRST:
return "first";
- case ARROWS_LAST:
+ case ARROWS_LAST:
return "last";
- case ARROWS_BOTH:
+ case ARROWS_BOTH:
return "both";
- default:
+ default:
return "none";
}
}
@@ -2066,40 +2066,38 @@ ArrowPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
*
* ConfigureArrows --
*
- * If arrowheads have been requested for a line, this
- * procedure makes arrangements for the arrowheads.
+ * If arrowheads have been requested for a line, this function makes
+ * arrangements for the arrowheads.
*
* Results:
* Always returns TCL_OK.
*
* Side effects:
- * Information in linePtr is set up for one or two arrowheads.
- * the firstArrowPtr and lastArrowPtr polygons are allocated
- * and initialized, if need be, and the end points of the line
- * are adjusted so that a thick line doesn't stick out past
- * the arrowheads.
+ * Information in linePtr is set up for one or two arrowheads. The
+ * firstArrowPtr and lastArrowPtr polygons are allocated and initialized,
+ * if need be, and the end points of the line are adjusted so that a
+ * thick line doesn't stick out past the arrowheads.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static int
-ConfigureArrows(canvas, linePtr)
- Tk_Canvas canvas; /* Canvas in which arrows will be
- * displayed (interp and tkwin
- * fields are needed). */
- LineItem *linePtr; /* Item to configure for arrows. */
+ConfigureArrows(
+ Tk_Canvas canvas, /* Canvas in which arrows will be displayed
+ * (interp and tkwin fields are needed). */
+ LineItem *linePtr) /* Item to configure for arrows. */
{
double *poly, *coordPtr;
double dx, dy, length, sinTheta, cosTheta, temp;
- double fracHeight; /* Line width as fraction of
- * arrowhead width. */
- double backup; /* Distance to backup end points
- * so the line ends in the middle
- * of the arrowhead. */
- double vertX, vertY; /* Position of arrowhead vertex. */
- double shapeA, shapeB, shapeC; /* Adjusted coordinates (see
- * explanation below). */
+ double fracHeight; /* Line width as fraction of arrowhead
+ * width. */
+ double backup; /* Distance to backup end points so the line
+ * ends in the middle of the arrowhead. */
+ double vertX, vertY; /* Position of arrowhead vertex. */
+ double shapeA, shapeB, shapeC;
+ /* Adjusted coordinates (see explanation
+ * below). */
double width;
Tk_State state = linePtr->header.state;
@@ -2123,10 +2121,10 @@ ConfigureArrows(canvas, linePtr)
}
/*
- * The code below makes a tiny increase in the shape parameters
- * for the line. This is a bit of a hack, but it seems to result
- * in displays that more closely approximate the specified parameters.
- * Without the adjustment, the arrows come out smaller than expected.
+ * The code below makes a tiny increase in the shape parameters for the
+ * line. This is a bit of a hack, but it seems to result in displays that
+ * more closely approximate the specified parameters. Without the
+ * adjustment, the arrows come out smaller than expected.
*/
shapeA = linePtr->arrowShapeA + 0.001;
@@ -2134,9 +2132,9 @@ ConfigureArrows(canvas, linePtr)
shapeC = linePtr->arrowShapeC + width/2.0 + 0.001;
/*
- * If there's an arrowhead on the first point of the line, compute
- * its polygon and adjust the first point of the line so that the
- * line doesn't stick out past the leading edge of the arrowhead.
+ * If there's an arrowhead on the first point of the line, compute its
+ * polygon and adjust the first point of the line so that the line doesn't
+ * stick out past the leading edge of the arrowhead.
*/
fracHeight = (width/2.0)/shapeC;
@@ -2173,9 +2171,8 @@ ConfigureArrows(canvas, linePtr)
poly[7] = poly[9]*fracHeight + vertY*(1.0-fracHeight);
/*
- * Polygon done. Now move the first point towards the second so
- * that the corners at the end of the line are inside the
- * arrowhead.
+ * Polygon done. Now move the first point towards the second so that
+ * the corners at the end of the line are inside the arrowhead.
*/
linePtr->coordPtr[0] = poly[0] - backup*cosTheta;
@@ -2190,8 +2187,8 @@ ConfigureArrows(canvas, linePtr)
coordPtr = linePtr->coordPtr + 2*(linePtr->numPoints-2);
poly = linePtr->lastArrowPtr;
if (poly == NULL) {
- poly = (double *) ckalloc((unsigned)
- (2*PTS_IN_ARROW*sizeof(double)));
+ poly = (double *)
+ ckalloc((unsigned) (2*PTS_IN_ARROW*sizeof(double)));
poly[0] = poly[10] = coordPtr[2];
poly[1] = poly[11] = coordPtr[3];
linePtr->lastArrowPtr = poly;
@@ -2207,10 +2204,10 @@ ConfigureArrows(canvas, linePtr)
}
vertX = poly[0] - shapeA*cosTheta;
vertY = poly[1] - shapeA*sinTheta;
- temp = shapeC*sinTheta;
+ temp = shapeC * sinTheta;
poly[2] = poly[0] - shapeB*cosTheta + temp;
poly[8] = poly[2] - 2*temp;
- temp = shapeC*cosTheta;
+ temp = shapeC * cosTheta;
poly[3] = poly[1] - shapeB*sinTheta - temp;
poly[9] = poly[3] + 2*temp;
poly[4] = poly[2]*fracHeight + vertX*(1.0-fracHeight);
@@ -2229,15 +2226,13 @@ ConfigureArrows(canvas, linePtr)
*
* LineToPostscript --
*
- * This procedure is called to generate Postscript for
- * line items.
+ * This function is called to generate Postscript for line items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used
- * to be there. If no error occurs, then Postscript for the
- * item is appended to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -2246,15 +2241,13 @@ ConfigureArrows(canvas, linePtr)
*/
static int
-LineToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created. */
+LineToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
LineItem *linePtr = (LineItem *) itemPtr;
char buffer[64 + TCL_INTEGER_SPACE];
@@ -2303,24 +2296,23 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
linePtr->coordPtr[0], Tk_CanvasPsY(canvas, linePtr->coordPtr[1]),
width/2.0, width/2.0);
Tcl_AppendResult(interp, "matrix currentmatrix\n",buffer,
- " scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", (char *) NULL);
- if (Tk_CanvasPsColor(interp, canvas, color)
- != TCL_OK) {
+ " scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", NULL);
+ if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) {
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
+ Tcl_AppendResult(interp, "clip ", NULL);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
return TCL_OK;
}
/*
- * Generate a path for the line's center-line (do this differently
- * for straight lines and smoothed lines).
+ * Generate a path for the line's center-line (do this differently for
+ * straight lines and smoothed lines).
*/
if ((!linePtr->smooth) || (linePtr->numPoints < 3)) {
@@ -2331,29 +2323,27 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
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;
- numPoints = linePtr->smooth->coordProc(canvas, (double *) NULL,
- linePtr->numPoints, linePtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ 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, (XPoint *) NULL,
- pointPtr);
+ linePtr->numPoints, linePtr->splineSteps, NULL, pointPtr);
Tk_CanvasPsPath(interp, canvas, pointPtr, numPoints);
if (pointPtr != staticPoints) {
ckfree((char *) pointPtr);
@@ -2371,17 +2361,16 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
} else if (linePtr->capStyle == CapProjecting) {
style = "2 setlinecap\n";
}
- Tcl_AppendResult(interp, style, (char *) NULL);
+ Tcl_AppendResult(interp, style, NULL);
style = "0 setlinejoin\n";
if (linePtr->joinStyle == JoinRound) {
style = "1 setlinejoin\n";
} else if (linePtr->joinStyle == JoinBevel) {
style = "2 setlinejoin\n";
}
- Tcl_AppendResult(interp, style, (char *) NULL);
+ 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;
}
@@ -2391,8 +2380,7 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
if (linePtr->firstArrowPtr != NULL) {
if (stipple != None) {
- Tcl_AppendResult(interp, "grestore gsave\n",
- (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
}
if (ArrowheadPostscript(interp, canvas, linePtr,
linePtr->firstArrowPtr) != TCL_OK) {
@@ -2401,7 +2389,7 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
}
if (linePtr->lastArrowPtr != NULL) {
if (stipple != None) {
- Tcl_AppendResult(interp, "grestore gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
}
if (ArrowheadPostscript(interp, canvas, linePtr,
linePtr->lastArrowPtr) != TCL_OK) {
@@ -2416,15 +2404,14 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
*
* ArrowheadPostscript --
*
- * This procedure is called to generate Postscript for
- * an arrowhead for a line item.
+ * This function is called to generate Postscript for an arrowhead for a
+ * line item.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used
- * to be there. If no error occurs, then Postscript for the
- * arrowhead is appended to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the arrowhead is appended to the result.
*
* Side effects:
* None.
@@ -2433,14 +2420,13 @@ LineToPostscript(interp, canvas, itemPtr, prepass)
*/
static int
-ArrowheadPostscript(interp, canvas, linePtr, arrowPtr)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- LineItem *linePtr; /* Line item for which Postscript is
- * being generated. */
- double *arrowPtr; /* Pointer to first of five points
- * describing arrowhead polygon. */
+ArrowheadPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ LineItem *linePtr, /* Line item for which Postscript is being
+ * generated. */
+ double *arrowPtr) /* Pointer to first of five points describing
+ * arrowhead polygon. */
{
Pixmap stipple;
Tk_State state = linePtr->header.state;
@@ -2462,13 +2448,20 @@ ArrowheadPostscript(interp, canvas, linePtr, arrowPtr)
Tk_CanvasPsPath(interp, canvas, arrowPtr, PTS_IN_ARROW);
if (stipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
- if (Tk_CanvasPsStipple(interp, canvas, stipple)
- != TCL_OK) {
+ Tcl_AppendResult(interp, "clip ", NULL);
+ if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index 3027c88..b86bc63 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvPoly.c --
*
* This file implements polygon items for canvas widgets.
@@ -7,13 +7,12 @@
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 Ajuba Solutions.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
/*
@@ -22,24 +21,28 @@
typedef struct PolygonItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
Tk_Outline outline; /* Outline structure */
- int numPoints; /* Number of points in polygon.
- * Polygon is always closed. */
+ int numPoints; /* Number of points in polygon. Polygon is
+ * always closed. */
int pointsAllocated; /* Number of points for which space is
* allocated at *coordPtr. */
- double *coordPtr; /* Pointer to malloc-ed array containing
- * x- and y-coords of all points in polygon.
+ double *coordPtr; /* Pointer to malloc-ed array containing x-
+ * and y-coords of all points in polygon.
* X-coords are even-valued indices, y-coords
* are corresponding odd-valued indices. */
int joinStyle; /* Join style for outline */
Tk_TSOffset tsoffset;
XColor *fillColor; /* Foreground color for polygon. */
- XColor *activeFillColor; /* Foreground color for polygon if state is active. */
- XColor *disabledFillColor; /* Foreground color for polygon if state is disabled. */
+ XColor *activeFillColor; /* Foreground color for polygon if state is
+ * active. */
+ XColor *disabledFillColor; /* Foreground color for polygon if state is
+ * disabled. */
Pixmap fillStipple; /* Stipple bitmap for filling polygon. */
- Pixmap activeFillStipple; /* Stipple bitmap for filling polygon if state is active. */
- Pixmap disabledFillStipple; /* Stipple bitmap for filling polygon if state is disabled. */
+ Pixmap activeFillStipple; /* Stipple bitmap for filling polygon if state
+ * is active. */
+ 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.
* with Bezier splines). */
@@ -79,125 +82,116 @@ static Tk_CustomOption pixelOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_CUSTOM, "-activedash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.activeDash),
+ {TK_CONFIG_CUSTOM, "-activedash", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.activeDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-activefill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, activeFillColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-activeoutline", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.activeColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activeoutlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.activeStipple),
+ {TK_CONFIG_COLOR, "-activefill", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, activeFillColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-activeoutline", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.activeColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activeoutlinestipple", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.activeStipple),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, activeFillStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-activewidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, activeFillStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-activewidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.activeWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_CUSTOM, "-dash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.dash),
+ {TK_CONFIG_CUSTOM, "-dash", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.dash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_PIXELS, "-dashoffset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL,
"0", Tk_Offset(PolygonItem, outline.offset),
TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-disableddash", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.disabledDash),
+ {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.disabledDash),
TK_CONFIG_NULL_OK, &dashOption},
- {TK_CONFIG_COLOR, "-disabledfill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, disabledFillColor),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-disabledoutline", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.disabledColor),
+ {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-disabledoutline", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.disabledColor),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledoutlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.disabledStipple),
+ {TK_CONFIG_BITMAP, "-disabledoutlinestipple", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.disabledStipple),
TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledstipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, disabledFillStipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-disabledwidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, disabledFillStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL,
"0.0", Tk_Offset(PolygonItem, outline.disabledWidth),
TK_CONFIG_DONT_SET_DEFAULT, &pixelOption},
- {TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(PolygonItem, fillColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_JOIN_STYLE, "-joinstyle", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_JOIN_STYLE, "-joinstyle", NULL, NULL,
"round", Tk_Offset(PolygonItem, joinStyle), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-offset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
- {TK_CONFIG_COLOR, "-outline", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.color),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-outlineoffset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-outline", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.color), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-outlineoffset", NULL, NULL,
"0,0", Tk_Offset(PolygonItem, outline.tsoffset),
TK_CONFIG_NULL_OK, &offsetOption},
- {TK_CONFIG_BITMAP, "-outlinestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, outline.stipple),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-smooth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BITMAP, "-outlinestipple", NULL, NULL,
+ NULL, Tk_Offset(PolygonItem, outline.stipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-smooth", NULL, NULL,
"0", Tk_Offset(PolygonItem, smooth),
TK_CONFIG_DONT_SET_DEFAULT, &smoothOption},
- {TK_CONFIG_INT, "-splinesteps", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_INT, "-splinesteps", NULL, NULL,
"12", Tk_Offset(PolygonItem, splineSteps), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_BITMAP, "-stipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PolygonItem, fillStipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_CUSTOM, "-width", (char *) NULL, (char *) 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},
+ {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, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static void ComputePolygonBbox _ANSI_ARGS_((Tk_Canvas canvas,
- PolygonItem *polyPtr));
-static int ConfigurePolygon _ANSI_ARGS_((Tcl_Interp *interp,
+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));
-static int CreatePolygon _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeletePolygon _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayPolygon _ANSI_ARGS_((Tk_Canvas canvas,
+ int objc, Tcl_Obj *CONST objv[]);
+static void DeletePolygon(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayPolygon(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static int GetPolygonIndex _ANSI_ARGS_((Tcl_Interp *interp,
+ int x, int y, int width, int height);
+static int GetPolygonIndex(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- Tcl_Obj *obj, int *indexPtr));
-static int PolygonCoords _ANSI_ARGS_((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[]));
-static void PolygonDeleteCoords _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int first, int last));
-static void PolygonInsert _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int beforeThis, Tcl_Obj *obj));
-static int PolygonToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double PolygonToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *pointPtr));
-static int PolygonToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static void ScalePolygon _ANSI_ARGS_((Tk_Canvas canvas,
+ 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,
+ Tk_Item *itemPtr, int beforeThis, Tcl_Obj *obj);
+static int PolygonToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double PolygonToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *pointPtr);
+static int PolygonToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+static void ScalePolygon(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslatePolygon _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
+ double scaleX, double scaleY);
+static void TranslatePolygon(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double deltaX, double deltaY);
/*
- * The structures below defines the polygon item type by means
- * of procedures that can be invoked by generic item code.
+ * The structures below defines the polygon item type by means of functions
+ * that can be invoked by generic item code.
*/
Tk_ItemType tkPolygonType = {
@@ -216,17 +210,17 @@ Tk_ItemType tkPolygonType = {
ScalePolygon, /* scaleProc */
TranslatePolygon, /* translateProc */
(Tk_ItemIndexProc *) GetPolygonIndex,/* indexProc */
- (Tk_ItemCursorProc *) NULL, /* icursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
+ NULL, /* icursorProc */
+ NULL, /* selectionProc */
(Tk_ItemInsertProc *) PolygonInsert,/* insertProc */
PolygonDeleteCoords, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ NULL, /* nextPtr */
};
/*
- * The definition below determines how large are static arrays
- * used to hold spline points (splines larger than this have to
- * have their arrays malloc-ed).
+ * The definition below determines how large are static arrays used to hold
+ * spline points (splines larger than this have to have their arrays
+ * malloc-ed).
*/
#define MAX_STATIC_POINTS 200
@@ -236,14 +230,12 @@ Tk_ItemType tkPolygonType = {
*
* CreatePolygon --
*
- * This procedure is invoked to create a new polygon item in
- * a canvas.
+ * This function is invoked to create a new polygon item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is
- * left uninitialized, so it can be safely freed by the
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
* caller.
*
* Side effects:
@@ -253,24 +245,24 @@ Tk_ItemType tkPolygonType = {
*/
static int
-CreatePolygon(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing polygon. */
+CreatePolygon(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing polygon. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
- * Carry out initialization that is needed in order to clean
- * up after errors during the the remainder of this procedure.
+ * Carry out initialization that is needed in order to clean up after
+ * errors during the the remainder of this function.
*/
Tk_CreateOutline(&(polyPtr->outline));
@@ -288,14 +280,14 @@ CreatePolygon(interp, canvas, itemPtr, objc, objv)
polyPtr->activeFillStipple = None;
polyPtr->disabledFillStipple = None;
polyPtr->fillGC = None;
- polyPtr->smooth = (Tk_SmoothMethod *) NULL;
+ polyPtr->smooth = NULL;
polyPtr->splineSteps = 12;
polyPtr->autoClosed = 0;
/*
- * Count the number of points and then parse them into a point
- * array. Leading arguments are assumed to be points if they
- * start with a digit or a minus sign followed by a digit.
+ * Count the number of points and then parse them into a point array.
+ * Leading arguments are assumed to be points if they start with a digit
+ * or a minus sign followed by a digit.
*/
for (i = 0; i < objc; i++) {
@@ -313,7 +305,7 @@ CreatePolygon(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeletePolygon(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -323,9 +315,8 @@ CreatePolygon(interp, canvas, itemPtr, objc, objv)
*
* PolygonCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on polygons. See the user documentation for details
- * on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * polygons. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -337,25 +328,25 @@ CreatePolygon(interp, canvas, itemPtr, objc, objv)
*/
static int
-PolygonCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+PolygonCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i, numPoints;
if (objc == 0) {
/*
- * Print the coords used to create the polygon. If we auto
- * closed the polygon then we don't report the last point.
+ * Print the coords used to create the polygon. If we auto closed the
+ * polygon then we don't report the last point.
*/
+
Tcl_Obj *subobj, *obj = Tcl_NewObj();
+
for (i = 0; i < 2*(polyPtr->numPoints - polyPtr->autoClosed); i++) {
subobj = Tcl_NewDoubleObj(polyPtr->coordPtr[i]);
Tcl_ListObjAppendElement(interp, obj, subobj);
@@ -371,6 +362,7 @@ PolygonCoords(interp, canvas, itemPtr, objc, objv)
}
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);
@@ -383,8 +375,8 @@ PolygonCoords(interp, canvas, itemPtr, objc, objv)
}
/*
- * One extra point gets allocated here, because we always
- * add another point to close the polygon.
+ * One extra point gets allocated here, because we always add
+ * another point to close the polygon.
*/
polyPtr->coordPtr = (double *) ckalloc((unsigned)
@@ -403,7 +395,7 @@ PolygonCoords(interp, canvas, itemPtr, objc, objv)
/*
* 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;
@@ -421,28 +413,28 @@ PolygonCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigurePolygon --
*
- * This procedure is invoked to configure various aspects
- * of a polygon item such as its background color.
+ * This function is invoked to configure various aspects of a polygon
+ * item such as its background color.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
- * Configuration information, such as colors and stipple
- * patterns, may be set for itemPtr.
+ * Configuration information, such as colors and stipple patterns, may be
+ * set for itemPtr.
*
*--------------------------------------------------------------
*/
static int
-ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Polygon item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigurePolygon(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
XGCValues gcValues;
@@ -460,8 +452,8 @@ ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * A few of the options require additional processing, such as
- * graphics contexts.
+ * A few of the options require additional processing, such as graphics
+ * contexts.
*/
state = itemPtr->state;
@@ -562,8 +554,8 @@ ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags)
*
* DeletePolygon --
*
- * This procedure is called to clean up the data structure
- * associated with a polygon item.
+ * This function is called to clean up the data structure associated with
+ * a polygon item.
*
* Results:
* None.
@@ -575,11 +567,10 @@ ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeletePolygon(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeletePolygon(
+ Tk_Canvas canvas, /* Info about overall canvas widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
@@ -615,24 +606,22 @@ DeletePolygon(canvas, itemPtr, display)
*
* ComputePolygonBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a polygon.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a polygon.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
static void
-ComputePolygonBbox(canvas, polyPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- PolygonItem *polyPtr; /* Item whose bbox is to be
- * recomputed. */
+ComputePolygonBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ PolygonItem *polyPtr) /* Item whose bbox is to be recomputed. */
{
double *coordPtr;
int i;
@@ -664,12 +653,11 @@ ComputePolygonBbox(canvas, polyPtr)
polyPtr->header.y1 = polyPtr->header.y2 = (int) coordPtr[1];
/*
- * Compute the bounding box of all the points in the polygon,
- * then expand in all directions by the outline'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. Don't do
- * anything special for curves. This causes an additional
+ * Compute the bounding box of all the points in the polygon, then expand
+ * in all directions by the outline'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. Don't do anything special for curves. This causes an additional
* overestimate in the bounding box, but is faster.
*/
@@ -715,6 +703,7 @@ ComputePolygonBbox(canvas, polyPtr)
if (tsoffset) {
if (tsoffset->flags & TK_OFFSET_INDEX) {
int index = tsoffset->flags & ~TK_OFFSET_INDEX;
+
if (tsoffset->flags == INT_MAX) {
index = (polyPtr->numPoints - 1) * 2;
}
@@ -750,13 +739,14 @@ ComputePolygonBbox(canvas, polyPtr)
/*
* For mitered lines, make a second pass through all the points.
- * Compute the locations of the two miter vertex points and add
- * those into the bounding box.
+ * Compute the locations of the two miter vertex points and add those
+ * into the bounding box.
*/
if (polyPtr->joinStyle == JoinMiter) {
double miter[4];
int j;
+
coordPtr = polyPtr->coordPtr;
if (polyPtr->numPoints>3) {
if (TkGetMiterPoints(coordPtr+2*(polyPtr->numPoints-2),
@@ -767,9 +757,8 @@ ComputePolygonBbox(canvas, polyPtr)
}
}
}
- for (i = polyPtr->numPoints ; i >= 3;
- i--, coordPtr += 2) {
-
+ for (i = polyPtr->numPoints ; i >= 3; i--, coordPtr += 2) {
+
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
width, miter, miter+2)) {
for (j = 0; j < 4; j += 2) {
@@ -781,8 +770,8 @@ ComputePolygonBbox(canvas, polyPtr)
}
/*
- * Add one more pixel of fudge factor just to be safe (e.g.
- * X may round differently than we do).
+ * Add one more pixel of fudge factor just to be safe (e.g. X may round
+ * differently than we do).
*/
polyPtr->header.x1 -= 1;
@@ -796,34 +785,33 @@ ComputePolygonBbox(canvas, polyPtr)
*
* TkFillPolygon --
*
- * This procedure is invoked to convert a polygon to screen
- * coordinates and display it using a particular GC.
+ * This function is invoked to convert a polygon to screen coordinates
+ * and display it using a particular GC.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
void
-TkFillPolygon(canvas, coordPtr, numPoints, display, drawable, gc, outlineGC)
- Tk_Canvas canvas; /* Canvas whose coordinate system
- * is to be used for drawing. */
- double *coordPtr; /* Array of coordinates for polygon:
- * x1, y1, x2, y2, .... */
- int numPoints; /* Twice this many coordinates are
- * present at *coordPtr. */
- Display *display; /* Display on which to draw polygon. */
- Drawable drawable; /* Pixmap or window in which to draw
- * polygon. */
- GC gc; /* Graphics context for drawing. */
- GC outlineGC; /* If not None, use this to draw an
- * outline around the polygon after
- * filling it. */
+TkFillPolygon(
+ Tk_Canvas canvas, /* Canvas whose coordinate system is to be
+ * used for drawing. */
+ double *coordPtr, /* Array of coordinates for polygon: x1, y1,
+ * x2, y2, .... */
+ int numPoints, /* Twice this many coordinates are present at
+ * *coordPtr. */
+ Display *display, /* Display on which to draw polygon. */
+ Drawable drawable, /* Pixmap or window in which to draw
+ * polygon. */
+ GC gc, /* Graphics context for drawing. */
+ GC outlineGC) /* If not None, use this to draw an outline
+ * around the polygon after filling it. */
{
XPoint staticPoints[MAX_STATIC_POINTS];
XPoint *pointPtr;
@@ -831,9 +819,9 @@ TkFillPolygon(canvas, coordPtr, numPoints, display, drawable, gc, outlineGC)
int i;
/*
- * Build up an array of points in screen coordinates. Use a
- * static array unless the polygon has an enormous number of points;
- * in this case, dynamically allocate an array.
+ * Build up an array of points in screen coordinates. Use a static array
+ * unless the polygon has an enormous number of points; in this case,
+ * dynamically allocate an array.
*/
if (numPoints <= MAX_STATIC_POINTS) {
@@ -842,7 +830,7 @@ TkFillPolygon(canvas, coordPtr, numPoints, display, drawable, gc, outlineGC)
pointPtr = (XPoint *) ckalloc((unsigned) (numPoints * sizeof(XPoint)));
}
- for (i = 0, pPtr = pointPtr; i < numPoints; i += 1, coordPtr += 2, pPtr++) {
+ for (i=0, pPtr=pointPtr ; i<numPoints; i+=1, coordPtr+=2, pPtr++) {
Tk_CanvasDrawableCoords(canvas, coordPtr[0], coordPtr[1], &pPtr->x,
&pPtr->y);
}
@@ -870,28 +858,27 @@ TkFillPolygon(canvas, coordPtr, numPoints, display, drawable, gc, outlineGC)
*
* DisplayPolygon --
*
- * This procedure is invoked to draw a polygon item in a given
- * drawable.
+ * This function is invoked to draw a polygon item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int x, y, width, height; /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayPolygon(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, int width, int height)
+ /* Describes region of canvas that must be
+ * redisplayed (not used). */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
Tk_State state = itemPtr->state;
@@ -904,7 +891,7 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
return;
}
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
@@ -922,16 +909,17 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
stipple = polyPtr->disabledFillStipple;
}
}
+
/*
- * If we're stippling then modify the stipple offset in the GC. Be
- * sure to reset the offset when done, since the GC is supposed to be
- * read-only.
+ * If we're stippling then modify the stipple offset in the GC. Be sure to
+ * reset the offset when done, since the GC is supposed to be read-only.
*/
if ((stipple != None) && (polyPtr->fillGC != None)) {
Tk_TSOffset *tsoffset = &polyPtr->tsoffset;
int w=0; int h=0;
int flags = tsoffset->flags;
+
if (!(flags & TK_OFFSET_INDEX) && (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) {
Tk_SizeOfBitmap(display, stipple, &w, &h);
if (flags & TK_OFFSET_CENTER) {
@@ -956,6 +944,7 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
if(polyPtr->numPoints < 3) {
short x,y;
int intLineWidth = (int) (linewidth + 0.5);
+
if (intLineWidth < 1) {
intLineWidth = 1;
}
@@ -974,13 +963,12 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
XPoint *pointPtr;
/*
- * This is a smoothed polygon. Display using a set of generated
- * spline points rather than the original points.
+ * This is a smoothed polygon. Display using a set of generated spline
+ * points rather than the original points.
*/
- numPoints = polyPtr->smooth->coordProc(canvas, (double *) NULL,
- polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = polyPtr->smooth->coordProc(canvas, NULL,
+ polyPtr->numPoints, polyPtr->splineSteps, NULL, NULL);
if (numPoints <= MAX_STATIC_POINTS) {
pointPtr = staticPoints;
} else {
@@ -988,8 +976,7 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
(numPoints * sizeof(XPoint)));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
- polyPtr->numPoints, polyPtr->splineSteps, pointPtr,
- (double *) NULL);
+ polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL);
if (polyPtr->fillGC != None) {
XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr,
numPoints, Complex, CoordModeOrigin);
@@ -1025,118 +1012,134 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height)
*/
static void
-PolygonInsert(canvas, itemPtr, beforeThis, obj)
- Tk_Canvas canvas; /* Canvas containing text item. */
- Tk_Item *itemPtr; /* Line item to be modified. */
- int beforeThis; /* Index before which new coordinates
- * are to be inserted. */
- Tcl_Obj *obj; /* New coordinates to be inserted. */
+PolygonInsert(
+ Tk_Canvas canvas, /* Canvas containing text item. */
+ Tk_Item *itemPtr, /* Line item to be modified. */
+ int beforeThis, /* Index before which new coordinates are to
+ * be inserted. */
+ Tcl_Obj *obj) /* New coordinates to be inserted. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int length, objc, i;
Tcl_Obj **objv;
- double *new;
+ double *newCoordPtr;
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
- if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &objc, &objv) != TCL_OK)
+ if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK)
|| !objc || objc&1) {
return;
}
length = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- while(beforeThis>length) beforeThis-=length;
- while(beforeThis<0) beforeThis+=length;
- new = (double *) ckalloc((unsigned)(sizeof(double) * (length + 2 + objc)));
+ while (beforeThis>length) {
+ beforeThis -= length;
+ }
+ while (beforeThis<0) {
+ beforeThis += length;
+ }
+ newCoordPtr = (double *)
+ ckalloc(sizeof(double) * (unsigned)(length + 2 + objc));
for (i=0; i<beforeThis; i++) {
- new[i] = polyPtr->coordPtr[i];
+ newCoordPtr[i] = polyPtr->coordPtr[i];
}
for (i=0; i<objc; i++) {
- if (Tcl_GetDoubleFromObj((Tcl_Interp *) NULL,objv[i],
- new+(i+beforeThis))!=TCL_OK) {
- ckfree((char *) new);
+ if (Tcl_GetDoubleFromObj(NULL, objv[i],
+ &newCoordPtr[i+beforeThis]) != TCL_OK){
+ ckfree((char *) newCoordPtr);
return;
}
}
- for(i=beforeThis; i<length; i++) {
- new[i+objc] = polyPtr->coordPtr[i];
+ for (i=beforeThis; i<length; i++) {
+ newCoordPtr[i+objc] = polyPtr->coordPtr[i];
}
- if(polyPtr->coordPtr) ckfree((char *) polyPtr->coordPtr);
- length+=objc;
- polyPtr->coordPtr = new;
+ if (polyPtr->coordPtr) {
+ ckfree((char *) polyPtr->coordPtr);
+ }
+ length += objc;
+ polyPtr->coordPtr = newCoordPtr;
polyPtr->numPoints = (length/2) + polyPtr->autoClosed;
/*
- * Close the polygon if it isn't already closed, or remove autoclosing
- * if the user's coordinates are now closed.
+ * Close the polygon if it isn't already closed, or remove autoclosing if
+ * the user's coordinates are now closed.
*/
if (polyPtr->autoClosed) {
- if ((new[length-2] == new[0]) && (new[length-1] == new[1])) {
+ if ((newCoordPtr[length-2] == newCoordPtr[0])
+ && (newCoordPtr[length-1] == newCoordPtr[1])) {
polyPtr->autoClosed = 0;
polyPtr->numPoints--;
}
- }
- else {
- if ((new[length-2] != new[0]) || (new[length-1] != new[1])) {
+ } else {
+ if ((newCoordPtr[length-2] != newCoordPtr[0])
+ || (newCoordPtr[length-1] != newCoordPtr[1])) {
polyPtr->autoClosed = 1;
polyPtr->numPoints++;
}
}
- new[length] = new[0];
- new[length+1] = new[1];
+ newCoordPtr[length] = newCoordPtr[0];
+ newCoordPtr[length+1] = newCoordPtr[1];
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 that part) need to be redrawn. A special flag is set that
- * instructs the general canvas code not to redraw the whole
- * object. If this flag is not set, the canvas will do the redrawing,
- * otherwise I have to do it here.
+ * This is some optimizing code that will result that only the part of
+ * the polygon that changed (and the objects that are overlapping with
+ * that part) need to be redrawn. A special flag is set that instructs
+ * the general canvas code not to redraw the whole object. If this
+ * flag is not set, the canvas will do the redrawing, otherwise I have
+ * to do it here.
*/
+
double width;
int j;
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
/*
- * The header elements that normally are used for the
- * bounding box, are now used to calculate the bounding
- * box for only the part that has to be redrawn. That
- * doesn't matter, because afterwards the bounding
- * box has to be re-calculated anyway.
+ * The header elements that normally are used for the bounding box,
+ * are now used to calculate the bounding box for only the part that
+ * has to be redrawn. That doesn't matter, because afterwards the
+ * bounding box has to be re-calculated anyway.
*/
itemPtr->x1 = itemPtr->x2 = (int) polyPtr->coordPtr[beforeThis];
itemPtr->y1 = itemPtr->y2 = (int) polyPtr->coordPtr[beforeThis+1];
beforeThis-=2; objc+=4;
- if(polyPtr->smooth) {
- beforeThis-=2; objc+=4;
- } /* be carefull; beforeThis could now be negative */
- for(i=beforeThis; i<beforeThis+objc; i+=2) {
- j=i;
- if(j<0) j+=length;
- if(j>=length) j-=length;
- TkIncludePoint(itemPtr, polyPtr->coordPtr+j);
+ if (polyPtr->smooth) {
+ beforeThis-=2;
+ objc+=4;
+ }
+
+ /*
+ * Be careful; beforeThis could now be negative
+ */
+
+ for (i=beforeThis; i<beforeThis+objc; i+=2) {
+ j = i;
+ if (j<0) {
+ j += length;
+ } else if (j>=length) {
+ j -= length;
+ }
+ TkIncludePoint(itemPtr, polyPtr->coordPtr+j);
}
width = polyPtr->outline.width;
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (polyPtr->outline.activeWidth>width) {
- width = polyPtr->outline.activeWidth;
- }
+ if (polyPtr->outline.activeWidth > width) {
+ width = polyPtr->outline.activeWidth;
+ }
} else if (state==TK_STATE_DISABLED) {
- if (polyPtr->outline.disabledWidth>0.0) {
- width = polyPtr->outline.disabledWidth;
- }
+ 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;
Tk_CanvasEventuallyRedraw(canvas,
- itemPtr->x1, itemPtr->y1,
- itemPtr->x2, itemPtr->y2);
+ itemPtr->x1, itemPtr->y1, itemPtr->x2, itemPtr->y2);
}
ComputePolygonBbox(canvas, polyPtr);
@@ -1153,37 +1156,47 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
* None.
*
* Side effects:
- * Characters between "first" and "last", inclusive, get
- * deleted from itemPtr.
+ * Characters between "first" and "last", inclusive, get deleted from
+ * itemPtr.
*
*--------------------------------------------------------------
*/
static void
-PolygonDeleteCoords(canvas, itemPtr, first, last)
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Item in which to delete characters. */
- int first; /* Index of first character to delete. */
- int last; /* Index of last character to delete. */
+PolygonDeleteCoords(
+ Tk_Canvas canvas, /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr, /* Item in which to delete characters. */
+ int first, /* Index of first character to delete. */
+ int last) /* Index of last character to delete. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int count, i;
int length = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- while(first>=length) first-=length;
- while(first<0) first+=length;
- while(last>=length) last-=length;
- while(last<0) last+=length;
+ while (first>=length) {
+ first -= length;
+ }
+ while (first<0) {
+ first += length;
+ }
+ while (last>=length) {
+ last -= length;
+ }
+ while (last<0) {
+ last += length;
+ }
first &= -2;
last &= -2;
count = last + 2 - first;
- if(count<=0) count +=length;
+ if (count<=0) {
+ count += length;
+ }
- if(count >= length) {
+ if (count >= length) {
polyPtr->numPoints = 0;
- if(polyPtr->coordPtr != NULL) {
+ if (polyPtr->coordPtr != NULL) {
ckfree((char *) polyPtr->coordPtr);
polyPtr->coordPtr = NULL;
}
@@ -1191,7 +1204,7 @@ PolygonDeleteCoords(canvas, itemPtr, first, last)
return;
}
- if(last>=first) {
+ if (last>=first) {
for(i=last+2; i<length; i++) {
polyPtr->coordPtr[i-count] = polyPtr->coordPtr[i];
}
@@ -1211,14 +1224,14 @@ PolygonDeleteCoords(canvas, itemPtr, first, last)
*
* PolygonToPoint --
*
- * Computes the distance from a given point to a given
- * polygon, in canvas units.
+ * Computes the distance from a given point to a given polygon, in canvas
+ * units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are pointPtr[0] and pointPtr[1] is inside the polygon. If the
- * point isn't inside the polygon then the return value is the
- * distance from the point to the polygon.
+ * The return value is 0 if the point whose x and y coordinates are
+ * pointPtr[0] and pointPtr[1] is inside the polygon. If the point isn't
+ * inside the polygon then the return value is the distance from the
+ * point to the polygon.
*
* Side effects:
* None.
@@ -1228,10 +1241,10 @@ PolygonDeleteCoords(canvas, itemPtr, first, last)
/* ARGSUSED */
static double
-PolygonToPoint(canvas, itemPtr, pointPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *pointPtr; /* Pointer to x and y coordinates. */
+PolygonToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *pointPtr) /* Pointer to x and y coordinates. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
double *coordPtr, *polyPoints;
@@ -1240,15 +1253,15 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
double radius;
double bestDist, dist;
int numPoints, count;
- int changedMiterToBevel; /* Non-zero means that a mitered corner
- * had to be treated as beveled after all
- * because the angle was < 11 degrees. */
+ int changedMiterToBevel; /* Non-zero means that a mitered corner had to
+ * be treated as beveled after all because the
+ * angle was < 11 degrees. */
double width;
Tk_State state = itemPtr->state;
bestDist = 1.0e36;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
width = polyPtr->outline.width;
@@ -1269,9 +1282,9 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
*/
if ((polyPtr->smooth) && (polyPtr->numPoints>2)) {
- numPoints = polyPtr->smooth->coordProc(canvas, (double *) NULL,
- polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = polyPtr->smooth->coordProc(canvas, NULL,
+ polyPtr->numPoints, polyPtr->splineSteps, NULL,
+ NULL);
if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace;
} else {
@@ -1279,7 +1292,7 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
(2*numPoints*sizeof(double)));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
- polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
+ polyPtr->numPoints, polyPtr->splineSteps, NULL,
polyPoints);
} else {
numPoints = polyPtr->numPoints;
@@ -1300,22 +1313,23 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
}
}
- if ((polyPtr->outline.gc == None) || (width <= 1)) goto donepoint;
+ if ((polyPtr->outline.gc == None) || (width <= 1)) {
+ goto donepoint;
+ }
/*
- * The overall idea is to iterate through all of the edges of
- * the line, computing a polygon for each edge and testing the
- * point against that polygon. In addition, there are additional
- * tests to deal with rounded joints and caps.
+ * The overall idea is to iterate through all of the edges of the line,
+ * computing a polygon for each edge and testing the point against that
+ * polygon. In addition, there are additional tests to deal with rounded
+ * joints and caps.
*/
changedMiterToBevel = 0;
for (count = numPoints, coordPtr = polyPoints; count >= 2;
count--, coordPtr += 2) {
-
/*
- * If rounding is done around the first point then compute
- * the distance between the point and the point.
+ * If rounding is done around the first point then compute the
+ * distance between the point and the point.
*/
if (polyPtr->joinStyle == JoinRound) {
@@ -1330,9 +1344,9 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
}
/*
- * Compute the polygonal shape corresponding to this edge,
- * consisting of two points for the first point of the edge
- * and two points for the last point of the edge.
+ * Compute the polygonal shape corresponding to this edge, consisting
+ * of two points for the first point of the edge and two points for
+ * the last point of the edge.
*/
if (count == numPoints) {
@@ -1348,10 +1362,10 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
poly, poly+2);
/*
- * If this line uses beveled joints, then check the distance
- * to a polygon comprising the last two points of the previous
- * polygon and the first two from this polygon; this checks
- * the wedges that fill the mitered joint.
+ * If this line uses beveled joints, then check the distance to a
+ * polygon comprising the last two points of the previous polygon
+ * and the first two from this polygon; this checks the wedges
+ * that fill the mitered joint.
*/
if ((polyPtr->joinStyle == JoinBevel) || changedMiterToBevel) {
@@ -1374,8 +1388,8 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
(double) width, poly+4, poly+6) == 0) {
changedMiterToBevel = 1;
- TkGetButtPoints(coordPtr, coordPtr+2, (double) width,
- 0, poly+4, poly+6);
+ TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0,
+ poly+4, poly+6);
}
} else {
TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0,
@@ -1392,7 +1406,7 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
}
}
- donepoint:
+ donepoint:
if ((polyPoints != staticSpace) && polyPoints != polyPtr->coordPtr) {
ckfree((char *) polyPoints);
}
@@ -1404,14 +1418,13 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
*
* PolygonToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangular area.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangular area.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -1421,12 +1434,12 @@ PolygonToPoint(canvas, itemPtr, pointPtr)
/* ARGSUSED */
static int
-PolygonToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against polygon. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
- * area. */
+PolygonToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against polygon. */
+ double *rectPtr) /* Pointer to array of four coordinates
+ * (x1,y1,x2,y2) describing rectangular
+ * area. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
double *coordPtr;
@@ -1434,19 +1447,18 @@ PolygonToArea(canvas, itemPtr, rectPtr)
double *polyPoints, poly[10];
double radius;
int numPoints, count;
- int changedMiterToBevel; /* Non-zero means that a mitered corner
- * had to be treated as beveled after all
- * because the angle was < 11 degrees. */
- int inside; /* Tentative guess about what to return,
- * based on all points seen so far: one
- * means everything seen so far was
- * inside the area; -1 means everything
- * was outside the area. 0 means overlap
- * has been found. */
+ int changedMiterToBevel; /* Non-zero means that a mitered corner had to
+ * be treated as beveled after all because the
+ * angle was < 11 degrees. */
+ int inside; /* Tentative guess about what to return, based
+ * on all points seen so far: one means
+ * everything seen so far was inside the area;
+ * -1 means everything was outside the area. 0
+ * means overlap has been found. */
double width;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -1468,60 +1480,62 @@ PolygonToArea(canvas, itemPtr, rectPtr)
return -1;
} else if (polyPtr->numPoints <3) {
double oval[4];
+
oval[0] = polyPtr->coordPtr[0]-radius;
oval[1] = polyPtr->coordPtr[1]-radius;
oval[2] = polyPtr->coordPtr[0]+radius;
oval[3] = polyPtr->coordPtr[1]+radius;
return TkOvalToArea(oval, rectPtr);
}
+
/*
* Handle smoothed polygons by generating an expanded set of points
* against which to do the check.
*/
if (polyPtr->smooth) {
- numPoints = polyPtr->smooth->coordProc(canvas, (double *) NULL,
- polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
- (double *) NULL);
+ numPoints = polyPtr->smooth->coordProc(canvas, NULL,
+ polyPtr->numPoints, polyPtr->splineSteps, NULL, NULL);
if (numPoints <= MAX_STATIC_POINTS) {
polyPoints = staticSpace;
} else {
- polyPoints = (double *) ckalloc((unsigned)
- (2*numPoints*sizeof(double)));
+ polyPoints = (double *)
+ ckalloc((unsigned) (2*numPoints*sizeof(double)));
}
numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr,
- polyPtr->numPoints, polyPtr->splineSteps, (XPoint *) NULL,
- polyPoints);
+ polyPtr->numPoints, polyPtr->splineSteps, NULL, polyPoints);
} else {
numPoints = polyPtr->numPoints;
polyPoints = polyPtr->coordPtr;
}
/*
- * Simple test to see if we are in the polygon. Polygons are
- * different from othe canvas items in that they register points
- * being inside even if it isn't filled.
+ * Simple test to see if we are in the polygon. Polygons are different
+ * from othe canvas items in that they register points being inside even
+ * if it isn't filled.
*/
+
inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
- if (inside==0) goto donearea;
+ if (inside==0) {
+ goto donearea;
+ }
- if (polyPtr->outline.gc == None) goto donearea ;
+ if (polyPtr->outline.gc == None) {
+ goto donearea;
+ }
/*
- * Iterate through all of the edges of the line, computing a polygon
- * for each edge and testing the area against that polygon. In
- * addition, there are additional tests to deal with rounded joints
- * and caps.
+ * Iterate through all of the edges of the line, computing a polygon for
+ * each edge and testing the area against that polygon. In addition, there
+ * are additional tests to deal with rounded joints and caps.
*/
changedMiterToBevel = 0;
for (count = numPoints, coordPtr = polyPoints; count >= 2;
count--, coordPtr += 2) {
-
/*
- * If rounding is done around the first point of the edge
- * then test a circular region around the point with the
- * area.
+ * If rounding is done around the first point of the edge then test a
+ * circular region around the point with the area.
*/
if (polyPtr->joinStyle == JoinRound) {
@@ -1536,28 +1550,26 @@ PolygonToArea(canvas, itemPtr, rectPtr)
}
/*
- * Compute the polygonal shape corresponding to this edge,
- * consisting of two points for the first point of the edge
- * and two points for the last point of the edge.
+ * Compute the polygonal shape corresponding to this edge, consisting
+ * of two points for the first point of the edge and two points for
+ * the last point of the edge.
*/
if (count == numPoints) {
- TkGetButtPoints(coordPtr+2, coordPtr, width,
- 0, poly, poly+2);
+ TkGetButtPoints(coordPtr+2, coordPtr, 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, width, 0,
- poly, poly+2);
+ TkGetButtPoints(coordPtr+2, coordPtr, width, 0, poly, poly+2);
/*
- * If the last joint was beveled, then also check a
- * polygon comprising the last two points of the previous
- * polygon and the first two from this polygon; this checks
- * the wedges that fill the beveled joint.
+ * If the last joint was beveled, then also check a polygon
+ * comprising the last two points of the previous polygon and the
+ * first two from this polygon; this checks the wedges that fill
+ * the beveled joint.
*/
if ((polyPtr->joinStyle == JoinBevel) || changedMiterToBevel) {
@@ -1571,18 +1583,15 @@ PolygonToArea(canvas, itemPtr, rectPtr)
}
}
if (count == 2) {
- TkGetButtPoints(coordPtr, coordPtr+2, width,
- 0, poly+4, poly+6);
+ 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) {
changedMiterToBevel = 1;
- TkGetButtPoints(coordPtr, coordPtr+2, width,
- 0, poly+4, poly+6);
+ TkGetButtPoints(coordPtr, coordPtr+2, width,0, poly+4, poly+6);
}
} else {
- TkGetButtPoints(coordPtr, coordPtr+2, width, 0,
- poly+4, poly+6);
+ TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6);
}
poly[8] = poly[0];
poly[9] = poly[1];
@@ -1592,7 +1601,7 @@ PolygonToArea(canvas, itemPtr, rectPtr)
}
}
- donearea:
+ donearea:
if ((polyPoints != staticSpace) && (polyPoints != polyPtr->coordPtr)) {
ckfree((char *) polyPoints);
}
@@ -1604,15 +1613,14 @@ PolygonToArea(canvas, itemPtr, rectPtr)
*
* ScalePolygon --
*
- * This procedure is invoked to rescale a polygon item.
+ * This function is invoked to rescale a polygon item.
*
* Results:
* None.
*
* Side effects:
- * The polygon referred to by itemPtr is rescaled so that the
- * following transformation is applied to all point
- * coordinates:
+ * The polygon referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -1620,12 +1628,13 @@ PolygonToArea(canvas, itemPtr, rectPtr)
*/
static void
-ScalePolygon(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing polygon. */
- Tk_Item *itemPtr; /* Polygon to be scaled. */
- double originX, originY; /* Origin about which to scale rect. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScalePolygon(
+ Tk_Canvas canvas, /* Canvas containing polygon. */
+ Tk_Item *itemPtr, /* Polygon to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale rect. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
double *coordPtr;
@@ -1644,14 +1653,13 @@ ScalePolygon(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* GetPolygonIndex --
*
- * Parse an index into a polygon item and return either its value
- * or an error.
+ * Parse an index into a polygon item and return either its value or an
+ * error.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the index (into itemPtr) corresponding to
- * string. Otherwise an error message is left in
- * interp->result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the index (into itemPtr) corresponding to string. Otherwise an
+ * error message is left in interp->result.
*
* Side effects:
* None.
@@ -1660,33 +1668,31 @@ ScalePolygon(canvas, itemPtr, originX, originY, scaleX, scaleY)
*/
static int
-GetPolygonIndex(interp, canvas, itemPtr, obj, indexPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item for which the index is being
+GetPolygonIndex(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item for which the index is being
* specified. */
- Tcl_Obj *obj; /* Specification of a particular coord
- * in itemPtr's line. */
- int *indexPtr; /* Where to store converted index. */
+ Tcl_Obj *obj, /* Specification of a particular coord in
+ * itemPtr's line. */
+ int *indexPtr) /* Where to store converted index. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int length;
char *string = Tcl_GetStringFromObj(obj, &length);
if (string[0] == 'e') {
- if (strncmp(string, "end", (unsigned) length) == 0) {
+ if (strncmp(string, "end", (unsigned)length) == 0) {
*indexPtr = 2*(polyPtr->numPoints - polyPtr->autoClosed);
} else {
- badIndex:
-
/*
- * Some of the paths here leave messages in interp->result,
- * so we have to clear it out before storing our own message.
+ * Some of the paths here leave messages in interp->result, so we
+ * have to clear it out before storing our own message.
*/
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad index \"", string, "\"",
- (char *) NULL);
+ badIndex:
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
return TCL_ERROR;
}
} else if (string[0] == '@') {
@@ -1717,6 +1723,7 @@ GetPolygonIndex(interp, canvas, itemPtr, obj, indexPtr)
}
} else {
int count = 2*(polyPtr->numPoints - polyPtr->autoClosed);
+
if (Tcl_GetIntFromObj(interp, obj, indexPtr) != TCL_OK) {
goto badIndex;
}
@@ -1739,26 +1746,24 @@ GetPolygonIndex(interp, canvas, itemPtr, obj, indexPtr)
*
* TranslatePolygon --
*
- * This procedure is called to move a polygon by a given
- * amount.
+ * This function is called to move a polygon by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the polygon is offset by (xDelta, yDelta),
- * and the bounding box is updated in the generic part of the
- * item structure.
+ * The position of the polygon is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslatePolygon(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslatePolygon(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
double *coordPtr;
@@ -1777,15 +1782,13 @@ TranslatePolygon(canvas, itemPtr, deltaX, deltaY)
*
* PolygonToPostscript --
*
- * This procedure is called to generate Postscript for
- * polygon items.
+ * This function is called to generate Postscript for polygon items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used
- * to be there. If no error occurs, then Postscript for the
- * item is appended to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -1794,15 +1797,13 @@ TranslatePolygon(canvas, itemPtr, deltaX, deltaY)
*/
static int
-PolygonToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created. */
+PolygonToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
char *style;
@@ -1868,17 +1869,17 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
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", (char *) NULL);
+ " scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", NULL);
if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) {
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "clip ", (char *) NULL);
+ Tcl_AppendResult(interp, "clip ", NULL);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "fill\n", NULL);
}
return TCL_OK;
}
@@ -1899,16 +1900,15 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
return TCL_ERROR;
}
if (fillStipple != None) {
- Tcl_AppendResult(interp, "eoclip ", (char *) NULL);
- if (Tk_CanvasPsStipple(interp, canvas, fillStipple)
- != TCL_OK) {
+ Tcl_AppendResult(interp, "eoclip ", NULL);
+ if (Tk_CanvasPsStipple(interp, canvas, fillStipple) != TCL_OK) {
return TCL_ERROR;
}
if (color != NULL) {
- Tcl_AppendResult(interp, "grestore gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore gsave\n", NULL);
}
} else {
- Tcl_AppendResult(interp, "eofill\n", (char *) NULL);
+ Tcl_AppendResult(interp, "eofill\n", NULL);
}
}
@@ -1917,13 +1917,12 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
*/
if (color != NULL) {
-
if (!polyPtr->smooth || !polyPtr->smooth->postscriptProc) {
Tk_CanvasPsPath(interp, canvas, polyPtr->coordPtr,
- polyPtr->numPoints);
+ polyPtr->numPoints);
} else {
polyPtr->smooth->postscriptProc(interp, canvas, polyPtr->coordPtr,
- polyPtr->numPoints, polyPtr->splineSteps);
+ polyPtr->numPoints, polyPtr->splineSteps);
}
if (polyPtr->joinStyle == JoinRound) {
@@ -1933,8 +1932,7 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
} else {
style = "0";
}
- Tcl_AppendResult(interp, style," setlinejoin 1 setlinecap\n",
- (char *) NULL);
+ Tcl_AppendResult(interp, style," setlinejoin 1 setlinecap\n", NULL);
if (Tk_CanvasPsOutline(canvas, itemPtr,
&(polyPtr->outline)) != TCL_OK) {
return TCL_ERROR;
@@ -1942,3 +1940,11 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
}
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 88e106a..ac8f105 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -1,28 +1,28 @@
-/*
+/*
* tkCanvPs.c --
*
- * This module provides Postscript output support for canvases,
- * including the "postscript" widget command plus a few utility
- * procedures used for generating Postscript.
+ * This module provides Postscript output support for canvases, including
+ * the "postscript" widget command plus a few utility functions used for
+ * generating Postscript.
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkCanvas.h"
-#include "tkPort.h"
+#include "tkFont.h"
/*
* See tkCanvas.h for key data structures used to implement canvases.
*/
/*
- * The following definition is used in generating postscript for images
- * and windows.
+ * The following definition is used in generating postscript for images and
+ * windows.
*/
typedef struct TkColormapData { /* Hold color information for a window */
@@ -36,11 +36,12 @@ typedef struct TkColormapData { /* Hold color information for a window */
/*
* One of the following structures is created to keep track of Postscript
- * output being generated. It consists mostly of information provided on
- * the widget command line.
+ * output being generated. It consists mostly of information provided on the
+ * widget command line.
*/
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. */
@@ -55,93 +56,90 @@ typedef struct TkPostscriptInfo {
double scale; /* Scale factor for conversion: each pixel
* maps into this many points. */
Tk_Anchor pageAnchor; /* How to anchor bbox on Postscript page. */
- int rotate; /* Non-zero means output should be rotated
- * on page (landscape mode). */
+ int rotate; /* Non-zero means output should be rotated on
+ * page (landscape mode). */
char *fontVar; /* If non-NULL, gives name of global variable
* containing font mapping information.
* Malloc'ed. */
char *colorVar; /* If non-NULL, give name of global variable
* containing color mapping information.
* Malloc'ed. */
- char *colorMode; /* Mode for handling colors: "monochrome",
+ char *colorMode; /* Mode for handling colors: "monochrome",
* "gray", or "color". Malloc'ed. */
- int colorLevel; /* Numeric value corresponding to colorMode:
- * 0 for mono, 1 for gray, 2 for color. */
+ int colorLevel; /* Numeric value corresponding to colorMode: 0
+ * for mono, 1 for gray, 2 for color. */
char *fileName; /* Name of file in which to write Postscript;
* NULL means return Postscript info as
* result. Malloc'ed. */
- char *channelName; /* If -channel is specified, the name of
- * the channel to use. */
+ char *channelName; /* If -channel is specified, the name of the
+ * 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
+ * families used in output. The hash table
* values are not used. */
- int prepass; /* Non-zero means that we're currently in
- * the pre-pass that collects font information,
- * so the Postscript generated isn't
- * relevant. */
- int prolog; /* Non-zero means output should contain
- the file prolog.ps in the header. */
+ int prepass; /* Non-zero means that we're currently in the
+ * 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. */
} TkPostscriptInfo;
/*
- * The table below provides a template that's used to process arguments
- * to the canvas "postscript" command and fill in TkPostscriptInfo
- * structures.
+ * The table below provides a template that's used to process arguments to the
+ * canvas "postscript" command and fill in TkPostscriptInfo structures.
*/
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_STRING, "-colormap", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-colormap", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, colorVar), 0},
- {TK_CONFIG_STRING, "-colormode", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-colormode", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, colorMode), 0},
- {TK_CONFIG_STRING, "-file", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-file", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, fileName), 0},
- {TK_CONFIG_STRING, "-channel", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-channel", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, channelName), 0},
- {TK_CONFIG_STRING, "-fontmap", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-fontmap", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, fontVar), 0},
- {TK_CONFIG_PIXELS, "-height", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-height", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, height), 0},
- {TK_CONFIG_ANCHOR, "-pageanchor", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_ANCHOR, "-pageanchor", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, pageAnchor), 0},
- {TK_CONFIG_STRING, "-pageheight", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-pageheight", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, pageHeightString), 0},
- {TK_CONFIG_STRING, "-pagewidth", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-pagewidth", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, pageWidthString), 0},
- {TK_CONFIG_STRING, "-pagex", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-pagex", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, pageXString), 0},
- {TK_CONFIG_STRING, "-pagey", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-pagey", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, pageYString), 0},
- {TK_CONFIG_BOOLEAN, "-prolog", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BOOLEAN, "-prolog", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, prolog), 0},
- {TK_CONFIG_BOOLEAN, "-rotate", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_BOOLEAN, "-rotate", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, rotate), 0},
- {TK_CONFIG_PIXELS, "-width", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-width", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, width), 0},
- {TK_CONFIG_PIXELS, "-x", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-x", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, x), 0},
- {TK_CONFIG_PIXELS, "-y", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-y", NULL, NULL,
"", Tk_Offset(TkPostscriptInfo, y), 0},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static int GetPostscriptPoints _ANSI_ARGS_((Tcl_Interp *interp,
- char *string, double *doublePtr));
+static int GetPostscriptPoints(Tcl_Interp *interp,
+ char *string, double *doublePtr);
/*
*--------------------------------------------------------------
*
* TkCanvPostscriptCmd --
*
- * This procedure is invoked to process the "postscript" options
- * of the widget command for canvas widgets. See the user
- * documentation for details on what it does.
+ * This function is invoked to process the "postscript" options of the
+ * widget command for canvas widgets. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -154,16 +152,15 @@ static int GetPostscriptPoints _ANSI_ARGS_((Tcl_Interp *interp,
/* ARGSUSED */
int
-TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
- 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 this command enough
- * to know that argv[1] is
- * "postscript". */
+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
+ * this command enough to know that argv[1] is
+ * "postscript". */
{
- TkPostscriptInfo psInfo;
+ TkPostscriptInfo psInfo, *psInfoPtr = &psInfo;
Tk_PostscriptInfo oldInfoPtr;
int result;
Tk_Item *itemPtr;
@@ -173,30 +170,28 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
time_t now;
size_t length;
Tk_Window tkwin = canvasPtr->tkwin;
- 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
- * anchor position). Initial values
- * needed only to stop compiler
- * warnings. */
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
Tcl_DString buffer;
- char psenccmd[]="::tk::ensure_psenc_is_loaded";
+ char psenccmd[] = "::tk::ensure_psenc_is_loaded";
+ 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
+ * anchor position). Initial values needed
+ * only to stop compiler warnings. */
/*
- *----------------------------------------------------------------
- * Initialize the data structure describing Postscript generation,
- * then process all the arguments to fill the data structure in.
- *----------------------------------------------------------------
+ * Initialize the data structure describing Postscript generation, then
+ * process all the arguments to fill the data structure in.
*/
+
result = Tcl_EvalEx(interp,psenccmd,-1,TCL_EVAL_GLOBAL);
if (result != TCL_OK) {
return result;
}
oldInfoPtr = canvasPtr->psInfo;
- canvasPtr->psInfo = (Tk_PostscriptInfo) &psInfo;
+ canvasPtr->psInfo = (Tk_PostscriptInfo) psInfoPtr;
+ psInfo.tkwin = canvasPtr->tkwin;
psInfo.x = canvasPtr->xOrigin;
psInfo.y = canvasPtr->yOrigin;
psInfo.width = -1;
@@ -220,9 +215,8 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
psInfo.prepass = 0;
psInfo.prolog = 1;
Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS);
- result = Tk_ConfigureWidget(interp, tkwin,
- configSpecs, argc-2, argv+2, (char *) &psInfo,
- TK_CONFIG_ARGV_ONLY);
+ result = Tk_ConfigureWidget(interp, tkwin, configSpecs, argc-2, argv+2,
+ (char *) &psInfo, TK_CONFIG_ARGV_ONLY);
if (result != TCL_OK) {
goto cleanup;
}
@@ -265,38 +259,38 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
psInfo.scale /= WidthOfScreen(Tk_Screen(tkwin));
}
switch (psInfo.pageAnchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_W:
- case TK_ANCHOR_SW:
- deltaX = 0;
- break;
- case TK_ANCHOR_N:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_S:
- deltaX = -psInfo.width/2;
- break;
- case TK_ANCHOR_NE:
- case TK_ANCHOR_E:
- case TK_ANCHOR_SE:
- deltaX = -psInfo.width;
- break;
+ case TK_ANCHOR_NW:
+ case TK_ANCHOR_W:
+ case TK_ANCHOR_SW:
+ deltaX = 0;
+ break;
+ case TK_ANCHOR_N:
+ case TK_ANCHOR_CENTER:
+ case TK_ANCHOR_S:
+ deltaX = -psInfo.width/2;
+ break;
+ case TK_ANCHOR_NE:
+ case TK_ANCHOR_E:
+ case TK_ANCHOR_SE:
+ deltaX = -psInfo.width;
+ break;
}
switch (psInfo.pageAnchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_N:
- case TK_ANCHOR_NE:
- deltaY = - psInfo.height;
- break;
- case TK_ANCHOR_W:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_E:
- deltaY = -psInfo.height/2;
- break;
- case TK_ANCHOR_SW:
- case TK_ANCHOR_S:
- case TK_ANCHOR_SE:
- deltaY = 0;
- break;
+ case TK_ANCHOR_NW:
+ case TK_ANCHOR_N:
+ case TK_ANCHOR_NE:
+ deltaY = - psInfo.height;
+ break;
+ case TK_ANCHOR_W:
+ case TK_ANCHOR_CENTER:
+ case TK_ANCHOR_E:
+ deltaY = -psInfo.height/2;
+ break;
+ case TK_ANCHOR_SW:
+ case TK_ANCHOR_S:
+ case TK_ANCHOR_SE:
+ deltaY = 0;
+ break;
}
if (psInfo.colorMode == NULL) {
@@ -310,22 +304,20 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
} else if (strncmp(psInfo.colorMode, "color", length) == 0) {
psInfo.colorLevel = 2;
} else {
- Tcl_AppendResult(interp, "bad color mode \"",
- psInfo.colorMode, "\": must be monochrome, ",
- "gray, or color", (char *) NULL);
+ Tcl_AppendResult(interp, "bad color mode \"", psInfo.colorMode,
+ "\": must be monochrome, gray, or color", NULL);
goto cleanup;
}
}
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", (char *) NULL);
+ " and -channel", NULL);
result = TCL_ERROR;
goto cleanup;
}
@@ -337,11 +329,11 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't specify -file in a",
- " safe interpreter", (char *) NULL);
+ " safe interpreter", NULL);
result = TCL_ERROR;
goto cleanup;
}
-
+
p = Tcl_TranslateFileName(interp, psInfo.fileName, &buffer);
if (p == NULL) {
goto cleanup;
@@ -355,35 +347,31 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
if (psInfo.channelName != NULL) {
int mode;
-
+
/*
- * Check that the channel is found in this interpreter and that it
- * is open for writing.
+ * Check that the channel is found in this interpreter and that it is
+ * open for writing.
*/
- psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName,
- &mode);
+ 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",
- (char *) NULL);
+ Tcl_AppendResult(interp, "channel \"", psInfo.channelName,
+ "\" wasn't opened for writing", NULL);
result = TCL_ERROR;
goto cleanup;
}
}
-
+
/*
- *--------------------------------------------------------
- * Make a pre-pass over all of the items, generating Postscript
- * and then throwing it away. The purpose of this pass is just
- * to collect information about all the fonts in use, so that
- * we can output font information in the proper form required
- * by the Document Structuring Conventions.
- *--------------------------------------------------------
+ * Make a pre-pass over all of the items, generating Postscript and then
+ * throwing it away. The purpose of this pass is just to collect
+ * information about all the fonts in use, so that we can output font
+ * information in the proper form required by the Document Structuring
+ * Conventions.
*/
psInfo.prepass = 1;
@@ -401,11 +389,10 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
Tcl_ResetResult(interp);
if (result != TCL_OK) {
/*
- * An error just occurred. Just skip out of this loop.
- * There's no need to report the error now; it can be
- * reported later (errors can happen later that don't
- * happen now, so we still have to check for errors later
- * anyway).
+ * An error just occurred. Just skip out of this loop. There's no
+ * need to report the error now; it can be reported later (errors
+ * can happen later that don't happen now, so we still have to
+ * check for errors later anyway).
*/
break;
}
@@ -413,117 +400,109 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
psInfo.prepass = 0;
/*
- *--------------------------------------------------------
* Generate the header and prolog for the Postscript.
- *--------------------------------------------------------
*/
if (psInfo.prolog) {
- Tcl_AppendResult(interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
- "%%Creator: Tk Canvas Widget\n", (char *) NULL);
+ Tcl_AppendResult(interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
+ "%%Creator: Tk Canvas Widget\n", NULL);
#ifdef HAVE_PW_GECOS
- if (!Tcl_IsSafe(interp)) {
- struct passwd *pwPtr = getpwuid(getuid()); /* INTL: Native. */
- Tcl_AppendResult(interp, "%%For: ",
- (pwPtr != NULL) ? pwPtr->pw_gecos : "Unknown", "\n",
- (char *) NULL);
- endpwent();
- }
+ if (!Tcl_IsSafe(interp)) {
+ struct passwd *pwPtr = getpwuid(getuid()); /* INTL: Native. */
+
+ Tcl_AppendResult(interp, "%%For: ",
+ (pwPtr != NULL) ? pwPtr->pw_gecos : "Unknown", "\n", NULL);
+ endpwent();
+ }
#endif /* HAVE_PW_GECOS */
- Tcl_AppendResult(interp, "%%Title: Window ",
- Tk_PathName(tkwin), "\n", (char *) NULL);
- time(&now);
- Tcl_AppendResult(interp, "%%CreationDate: ",
- ctime(&now), (char *) NULL); /* INTL: Native. */
- if (!psInfo.rotate) {
- sprintf(string, "%d %d %d %d",
- (int) (psInfo.pageX + psInfo.scale*deltaX),
- (int) (psInfo.pageY + psInfo.scale*deltaY),
- (int) (psInfo.pageX + psInfo.scale*(deltaX + psInfo.width)
- + 1.0),
- (int) (psInfo.pageY + psInfo.scale*(deltaY + psInfo.height)
- + 1.0));
- } else {
- sprintf(string, "%d %d %d %d",
- (int) (psInfo.pageX - psInfo.scale*(deltaY + psInfo.height)),
- (int) (psInfo.pageY + psInfo.scale*deltaX),
- (int) (psInfo.pageX - psInfo.scale*deltaY + 1.0),
- (int) (psInfo.pageY + psInfo.scale*(deltaX + psInfo.width)
- + 1.0));
- }
- Tcl_AppendResult(interp, "%%BoundingBox: ", string,
- "\n", (char *) NULL);
- Tcl_AppendResult(interp, "%%Pages: 1\n",
- "%%DocumentData: Clean7Bit\n", (char *) NULL);
- Tcl_AppendResult(interp, "%%Orientation: ",
- psInfo.rotate ? "Landscape\n" : "Portrait\n", (char *) NULL);
- p = "%%DocumentNeededResources: font ";
- for (hPtr = Tcl_FirstHashEntry(&psInfo.fontTable, &search);
- hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_AppendResult(interp, p,
- Tcl_GetHashKey(&psInfo.fontTable, hPtr),
- "\n", (char *) NULL);
- p = "%%+ font ";
- }
- Tcl_AppendResult(interp, "%%EndComments\n\n", (char *) NULL);
+ Tcl_AppendResult(interp, "%%Title: Window ", Tk_PathName(tkwin), "\n",
+ NULL);
+ time(&now);
+ Tcl_AppendResult(interp, "%%CreationDate: ",
+ ctime(&now), NULL); /* INTL: Native. */
+ if (!psInfo.rotate) {
+ sprintf(string, "%d %d %d %d",
+ (int) (psInfo.pageX + psInfo.scale*deltaX),
+ (int) (psInfo.pageY + psInfo.scale*deltaY),
+ (int) (psInfo.pageX + psInfo.scale*(deltaX + psInfo.width)
+ + 1.0),
+ (int) (psInfo.pageY + psInfo.scale*(deltaY + psInfo.height)
+ + 1.0));
+ } else {
+ sprintf(string, "%d %d %d %d",
+ (int) (psInfo.pageX - psInfo.scale*(deltaY+psInfo.height)),
+ (int) (psInfo.pageY + psInfo.scale*deltaX),
+ (int) (psInfo.pageX - psInfo.scale*deltaY + 1.0),
+ (int) (psInfo.pageY + psInfo.scale*(deltaX + psInfo.width)
+ + 1.0));
+ }
+ Tcl_AppendResult(interp, "%%BoundingBox: ", string, "\n", NULL);
+ Tcl_AppendResult(interp, "%%Pages: 1\n",
+ "%%DocumentData: Clean7Bit\n", NULL);
+ Tcl_AppendResult(interp, "%%Orientation: ",
+ psInfo.rotate ? "Landscape\n" : "Portrait\n", NULL);
+ p = "%%DocumentNeededResources: font ";
+ for (hPtr = Tcl_FirstHashEntry(&psInfo.fontTable, &search);
+ hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
+ Tcl_AppendResult(interp, p,
+ Tcl_GetHashKey(&psInfo.fontTable, hPtr), "\n", NULL);
+ p = "%%+ font ";
+ }
+ Tcl_AppendResult(interp, "%%EndComments\n\n", NULL);
- /*
- * Insert the prolog
- */
- Tcl_AppendResult(interp, Tcl_GetVar(interp,"::tk::ps_preamable",
- TCL_GLOBAL_ONLY), (char *) NULL);
+ /*
+ * Insert the prolog
+ */
- if (psInfo.chan != NULL) {
- Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
- Tcl_ResetResult(canvasPtr->interp);
- }
+ Tcl_AppendResult(interp, Tcl_GetVar(interp,"::tk::ps_preamable",
+ TCL_GLOBAL_ONLY), NULL);
- /*
- *-----------------------------------------------------------
- * Document setup: set the color level and include fonts.
- *-----------------------------------------------------------
- */
+ if (psInfo.chan != NULL) {
+ Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
+ Tcl_ResetResult(canvasPtr->interp);
+ }
- sprintf(string, "/CL %d def\n", psInfo.colorLevel);
- Tcl_AppendResult(interp, "%%BeginSetup\n", string,
- (char *) NULL);
- for (hPtr = Tcl_FirstHashEntry(&psInfo.fontTable, &search);
- hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_AppendResult(interp, "%%IncludeResource: font ",
- Tcl_GetHashKey(&psInfo.fontTable, hPtr), "\n", (char *) NULL);
- }
- Tcl_AppendResult(interp, "%%EndSetup\n\n", (char *) NULL);
+ /*
+ * Document setup: set the color level and include fonts.
+ */
- /*
- *-----------------------------------------------------------
- * Page setup: move to page positioning point, rotate if
- * needed, set scale factor, offset for proper anchor position,
- * and set clip region.
- *-----------------------------------------------------------
- */
+ sprintf(string, "/CL %d def\n", psInfo.colorLevel);
+ Tcl_AppendResult(interp, "%%BeginSetup\n", string, NULL);
+ for (hPtr = Tcl_FirstHashEntry(&psInfo.fontTable, &search);
+ hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
+ Tcl_AppendResult(interp, "%%IncludeResource: font ",
+ Tcl_GetHashKey(&psInfo.fontTable, hPtr), "\n", NULL);
+ }
+ Tcl_AppendResult(interp, "%%EndSetup\n\n", NULL);
- Tcl_AppendResult(interp, "%%Page: 1 1\n", "save\n",
- (char *) NULL);
- sprintf(string, "%.1f %.1f translate\n", psInfo.pageX, psInfo.pageY);
- Tcl_AppendResult(interp, string, (char *) NULL);
- if (psInfo.rotate) {
- Tcl_AppendResult(interp, "90 rotate\n", (char *) NULL);
- }
- sprintf(string, "%.4g %.4g scale\n", psInfo.scale, psInfo.scale);
- Tcl_AppendResult(interp, string, (char *) NULL);
- sprintf(string, "%d %d translate\n", deltaX - psInfo.x, deltaY);
- Tcl_AppendResult(interp, string, (char *) NULL);
- sprintf(string, "%d %.15g moveto %d %.15g lineto %d %.15g lineto %d %.15g",
- psInfo.x,
- Tk_PostscriptY((double) psInfo.y, (Tk_PostscriptInfo) &psInfo),
- psInfo.x2,
- Tk_PostscriptY((double) psInfo.y, (Tk_PostscriptInfo) &psInfo),
- psInfo.x2,
- Tk_PostscriptY((double) psInfo.y2, (Tk_PostscriptInfo) &psInfo),
- psInfo.x,
- Tk_PostscriptY((double) psInfo.y2, (Tk_PostscriptInfo) &psInfo));
- Tcl_AppendResult(interp, string,
- " lineto closepath clip newpath\n", (char *) NULL);
+ /*
+ * Page setup: move to page positioning point, rotate if needed, set
+ * scale factor, offset for proper anchor position, and set clip
+ * region.
+ */
+
+ Tcl_AppendResult(interp, "%%Page: 1 1\n", "save\n", NULL);
+ sprintf(string, "%.1f %.1f translate\n", psInfo.pageX, psInfo.pageY);
+ Tcl_AppendResult(interp, string, NULL);
+ if (psInfo.rotate) {
+ Tcl_AppendResult(interp, "90 rotate\n", NULL);
+ }
+ sprintf(string, "%.4g %.4g scale\n", psInfo.scale, psInfo.scale);
+ Tcl_AppendResult(interp, string, NULL);
+ sprintf(string, "%d %d translate\n", deltaX - psInfo.x, deltaY);
+ Tcl_AppendResult(interp, string, NULL);
+ sprintf(string,
+ "%d %.15g moveto %d %.15g lineto %d %.15g lineto %d %.15g",
+ psInfo.x, Tk_PostscriptY((double)psInfo.y,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x2, Tk_PostscriptY((double)psInfo.y,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x2, Tk_PostscriptY((double)psInfo.y2,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x, Tk_PostscriptY((double)psInfo.y2,
+ (Tk_PostscriptInfo)psInfoPtr));
+ Tcl_AppendResult(interp, string,
+ " lineto closepath clip newpath\n", NULL);
}
if (psInfo.chan != NULL) {
Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
@@ -531,10 +510,8 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
}
/*
- *---------------------------------------------------------------------
* Iterate through all the items, having each relevant one draw itself.
* Quit if any of the items returns an error.
- *---------------------------------------------------------------------
*/
result = TCL_OK;
@@ -550,7 +527,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
if (itemPtr->state == TK_STATE_HIDDEN) {
continue;
}
- Tcl_AppendResult(interp, "gsave\n", (char *) NULL);
+ Tcl_AppendResult(interp, "gsave\n", NULL);
result = (*itemPtr->typePtr->postscriptProc)(interp,
(Tk_Canvas) canvasPtr, itemPtr, 0);
if (result != TCL_OK) {
@@ -561,7 +538,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
Tcl_AddErrorInfo(interp, msg);
goto cleanup;
}
- Tcl_AppendResult(interp, "grestore\n", (char *) NULL);
+ Tcl_AppendResult(interp, "grestore\n", NULL);
if (psInfo.chan != NULL) {
Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
Tcl_ResetResult(interp);
@@ -569,15 +546,13 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
}
/*
- *---------------------------------------------------------------------
- * Output page-end information, such as commands to print the page
- * and document trailer stuff.
- *---------------------------------------------------------------------
+ * Output page-end information, such as commands to print the page and
+ * document trailer stuff.
*/
if (psInfo.prolog) {
- Tcl_AppendResult(interp, "restore showpage\n\n",
- "%%Trailer\nend\n%%EOF\n", (char *) NULL);
+ Tcl_AppendResult(interp, "restore showpage\n\n",
+ "%%Trailer\nend\n%%EOF\n", NULL);
}
if (psInfo.chan != NULL) {
Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
@@ -588,7 +563,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
* Clean up psInfo to release malloc'ed stuff.
*/
- cleanup:
+ cleanup:
if (psInfo.pageXString != NULL) {
ckfree(psInfo.pageXString);
}
@@ -629,16 +604,15 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
*
* Tk_PostscriptColor --
*
- * This procedure is called by individual canvas items when
- * they want to set a color value for output. Given information
- * about an X color, this procedure will generate Postscript
- * commands to set up an appropriate color in Postscript.
+ * This function is called by individual canvas items when they want to
+ * set a color value for output. Given information about an X color, this
+ * function will generate Postscript commands to set up an appropriate
+ * color in Postscript.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in the interp's result.
- * If no error occurs, then additional Postscript will be
- * appended to the interp's result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in the interp's result. If no error occurs, then
+ * additional Postscript will be appended to the interp's result.
*
* Side effects:
* None.
@@ -647,10 +621,10 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
*/
int
-Tk_PostscriptColor(interp, psInfo, colorPtr)
- Tcl_Interp *interp;
- Tk_PostscriptInfo psInfo; /* Postscript info. */
- XColor *colorPtr; /* Information about color. */
+Tk_PostscriptColor(
+ Tcl_Interp *interp,
+ Tk_PostscriptInfo psInfo, /* Postscript info. */
+ XColor *colorPtr) /* Information about color. */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
int tmp;
@@ -662,9 +636,8 @@ Tk_PostscriptColor(interp, psInfo, colorPtr)
}
/*
- * If there is a color map defined, then look up the color's name
- * in the map and use the Postscript commands found there, if there
- * are any.
+ * If there is a color map defined, then look up the color's name in the
+ * map and use the Postscript commands found there, if there are any.
*/
if (psInfoPtr->colorVar != NULL) {
@@ -673,22 +646,21 @@ Tk_PostscriptColor(interp, psInfo, colorPtr)
cmdString = Tcl_GetVar2(interp, psInfoPtr->colorVar,
Tk_NameOfColor(colorPtr), 0);
if (cmdString != NULL) {
- Tcl_AppendResult(interp, cmdString, "\n", (char *) NULL);
+ Tcl_AppendResult(interp, cmdString, "\n", NULL);
return TCL_OK;
}
}
/*
- * No color map entry for this color. Grab the color's intensities
- * and output Postscript commands for them. Special note: X uses
- * a range of 0-65535 for intensities, but most displays only use
- * a range of 0-255, which maps to (0, 256, 512, ... 65280) in the
- * X scale. This means that there's no way to get perfect white,
- * since the highest intensity is only 65280 out of 65535. To
- * work around this problem, rescale the X intensity to a 0-255
- * scale and use that as the basis for the Postscript colors. This
- * scheme still won't work if the display only uses 4 bits per color,
- * but most diplays use at least 8 bits.
+ * No color map entry for this color. Grab the color's intensities and
+ * output Postscript commands for them. Special note: X uses a range of
+ * 0-65535 for intensities, but most displays only use a range of 0-255,
+ * which maps to (0, 256, 512, ... 65280) in the X scale. This means that
+ * there's no way to get perfect white, since the highest intensity is
+ * only 65280 out of 65535. To work around this problem, rescale the X
+ * intensity to a 0-255 scale and use that as the basis for the Postscript
+ * colors. This scheme still won't work if the display only uses 4 bits
+ * per color, but most diplays use at least 8 bits.
*/
tmp = colorPtr->red;
@@ -699,7 +671,7 @@ Tk_PostscriptColor(interp, psInfo, colorPtr)
blue = ((double) (tmp >> 8))/255.0;
sprintf(string, "%.3f %.3f %.3f setrgbcolor AdjustColor\n",
red, green, blue);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
return TCL_OK;
}
@@ -708,88 +680,89 @@ Tk_PostscriptColor(interp, psInfo, colorPtr)
*
* Tk_PostscriptFont --
*
- * This procedure is called by individual canvas items when
- * they want to output text. Given information about an X
- * font, this procedure will generate Postscript commands
- * to set up an appropriate font in Postscript.
+ * This function is called by individual canvas items when they want to
+ * output text. Given information about an X font, this function will
+ * generate Postscript commands to set up an appropriate font in
+ * Postscript.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in the interp's result.
- * If no error occurs, then additional Postscript will be
- * appended to the interp's result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in the interp's result. If no error occurs, then
+ * additional Postscript will be appended to the interp's result.
*
* Side effects:
- * The Postscript font name is entered into psInfoPtr->fontTable
- * if it wasn't already there.
+ * The Postscript font name is entered into psInfoPtr->fontTable if it
+ * wasn't already there.
*
*--------------------------------------------------------------
*/
int
-Tk_PostscriptFont(interp, psInfo, tkfont)
- Tcl_Interp *interp;
- Tk_PostscriptInfo psInfo; /* Postscript Info. */
- Tk_Font tkfont; /* Information about font in which text
- * is to be printed. */
+Tk_PostscriptFont(
+ Tcl_Interp *interp,
+ Tk_PostscriptInfo psInfo, /* Postscript Info. */
+ Tk_Font tkfont) /* Information about font in which text is to
+ * be printed. */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
- char *end;
char pointString[TCL_INTEGER_SPACE];
Tcl_DString ds;
int i, points;
/*
- * First, look up the font's name in the font map, if there is one.
- * If there is an entry for this font, it consists of a list
- * containing font name and size. Use this information.
+ * First, look up the font's name in the font map, if there is one. If
+ * there is an entry for this font, it consists of a list containing font
+ * name and size. Use this information.
*/
- Tcl_DStringInit(&ds);
-
if (psInfoPtr->fontVar != NULL) {
- CONST char *list;
- int argc;
+ CONST char *name = Tk_NameOfFont(tkfont);
+ Tcl_Obj **objv;
+ int objc;
double size;
- CONST char **argv;
- CONST char *name;
+ Tcl_Obj *list = Tcl_GetVar2Ex(interp, psInfoPtr->fontVar, name, 0);
- name = Tk_NameOfFont(tkfont);
- list = Tcl_GetVar2(interp, psInfoPtr->fontVar, name, 0);
if (list != NULL) {
- if (Tcl_SplitList(interp, list, &argc, &argv) != TCL_OK) {
- badMapEntry:
+ CONST char *fontname;
+
+ if (Tcl_ListObjGetElements(interp, list, &objc, &objv) != TCL_OK
+ || objc != 2
+ || Tcl_GetString(objv[0])[0]=='\0'
+ || Tcl_GetDoubleFromObj(interp, objv[1], &size) != TCL_OK
+ || size <= 0) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad font map entry for \"", name,
- "\": \"", list, "\"", (char *) NULL);
+ "\": \"", Tcl_GetString(list), "\"", NULL);
return TCL_ERROR;
}
- if (argc != 2) {
- goto badMapEntry;
- }
- size = strtod(argv[1], &end);
- if ((size <= 0) || (*end != 0)) {
- goto badMapEntry;
- }
- Tcl_DStringAppend(&ds, argv[0], -1);
- points = (int) size;
-
- ckfree((char *) argv);
- goto findfont;
+ fontname = Tcl_GetString(objv[0]);
+ sprintf(pointString, "%d", (int)size);
+
+ Tcl_AppendResult(interp, "/", fontname, " findfont ",
+ pointString, " scalefont ", NULL);
+ if (strncasecmp(fontname, "Symbol", 7) != 0) {
+ Tcl_AppendResult(interp, "ISOEncode ", NULL);
+ }
+ Tcl_AppendResult(interp, "setfont\n", NULL);
+ Tcl_CreateHashEntry(&psInfoPtr->fontTable, fontname, &i);
+ return TCL_OK;
}
- }
+ }
- points = Tk_PostscriptFontName(tkfont, &ds);
+ /*
+ * Nothing in the font map, so fall back to the old guessing technique.
+ */
- findfont:
- sprintf(pointString, "%d", points);
+ Tcl_DStringInit(&ds);
+ points = Tk_PostscriptFontName(tkfont, &ds);
+ sprintf(pointString, "%d", TkFontGetPoints(psInfoPtr->tkwin, points));
Tcl_AppendResult(interp, "/", Tcl_DStringValue(&ds), " findfont ",
- pointString, " scalefont ", (char *) NULL);
+ pointString, " scalefont ", NULL);
if (strncasecmp(Tcl_DStringValue(&ds), "Symbol", 7) != 0) {
- Tcl_AppendResult(interp, "ISOEncode ", (char *) NULL);
+ Tcl_AppendResult(interp, "ISOEncode ", NULL);
}
- Tcl_AppendResult(interp, "setfont\n", (char *) NULL);
+ Tcl_AppendResult(interp, "setfont\n", NULL);
Tcl_CreateHashEntry(&psInfoPtr->fontTable, Tcl_DStringValue(&ds), &i);
Tcl_DStringFree(&ds);
@@ -801,16 +774,14 @@ Tk_PostscriptFont(interp, psInfo, tkfont)
*
* Tk_PostscriptBitmap --
*
- * This procedure is called to output the contents of a
- * sub-region of a bitmap in proper image data format for
- * Postscript (i.e. data between angle brackets, one bit
- * per pixel).
+ * This function is called to output the contents of a sub-region of a
+ * bitmap in proper image data format for Postscript (i.e. data between
+ * angle brackets, one bit per pixel).
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in the interp's result.
- * If no error occurs, then additional Postscript will be
- * appended to the interp's result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in the interp's result. If no error occurs, then
+ * additional Postscript will be appended to the interp's result.
*
* Side effects:
* None.
@@ -819,16 +790,14 @@ Tk_PostscriptFont(interp, psInfo, tkfont)
*/
int
-Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
- height)
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psInfo; /* Postscript info. */
- Pixmap bitmap; /* Bitmap for which to generate
- * Postscript. */
- int startX, startY; /* Coordinates of upper-left corner
- * of rectangular region to output. */
- int width, height; /* Height of rectangular region. */
+Tk_PostscriptBitmap(
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ Tk_PostscriptInfo psInfo, /* Postscript info. */
+ Pixmap bitmap, /* Bitmap for which to generate Postscript. */
+ int startX, int startY, /* Coordinates of upper-left corner of
+ * rectangular region to output. */
+ int width, int height) /* Height of rectangular region. */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
XImage *imagePtr;
@@ -845,10 +814,10 @@ Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
/*
* The following call should probably be a call to Tk_SizeOfBitmap
- * instead, but it seems that we are occasionally invoked by custom
- * item types that create their own bitmaps without registering them
- * with Tk. XGetGeometry is a bit slower than Tk_SizeOfBitmap, but
- * it shouldn't matter here.
+ * instead, but it seems that we are occasionally invoked by custom item
+ * types that create their own bitmaps without registering them with Tk.
+ * XGetGeometry is a bit slower than Tk_SizeOfBitmap, but it shouldn't
+ * matter here.
*/
XGetGeometry(Tk_Display(tkwin), bitmap, &dummyRoot,
@@ -856,7 +825,7 @@ Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
(unsigned int *) &totalHeight, &dummyBorderwidth, &dummyDepth);
imagePtr = XGetImage(Tk_Display(tkwin), bitmap, 0, 0,
totalWidth, totalHeight, 1, XYPixmap);
- Tcl_AppendResult(interp, "<", (char *) NULL);
+ Tcl_AppendResult(interp, "<", NULL);
mask = 0x80;
value = 0;
charsInLine = 0;
@@ -870,25 +839,25 @@ Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
mask >>= 1;
if (mask == 0) {
sprintf(string, "%02x", value);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
mask = 0x80;
value = 0;
charsInLine += 2;
if (charsInLine >= 60) {
- Tcl_AppendResult(interp, "\n", (char *) NULL);
+ Tcl_AppendResult(interp, "\n", NULL);
charsInLine = 0;
}
}
}
if (mask != 0x80) {
sprintf(string, "%02x", value);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
mask = 0x80;
value = 0;
charsInLine += 2;
}
}
- Tcl_AppendResult(interp, ">", (char *) NULL);
+ Tcl_AppendResult(interp, ">", NULL);
XDestroyImage(imagePtr);
return TCL_OK;
}
@@ -898,18 +867,16 @@ Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
*
* Tk_PostscriptStipple --
*
- * This procedure is called by individual canvas items when
- * they have created a path that they'd like to be filled with
- * a stipple pattern. Given information about an X bitmap,
- * this procedure will generate Postscript commands to fill
- * the current clip region using a stipple pattern defined by the
- * bitmap.
+ * This function is called by individual canvas items when they have
+ * created a path that they'd like to be filled with a stipple pattern.
+ * Given information about an X bitmap, this function will generate
+ * Postscript commands to fill the current clip region using a stipple
+ * pattern defined by the bitmap.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in the interp's result.
- * If no error occurs, then additional Postscript will be
- * appended to the interp's result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in the interp's result. If no error occurs, then
+ * additional Postscript will be appended to the interp's result.
*
* Side effects:
* None.
@@ -918,12 +885,12 @@ Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, startX, startY, width,
*/
int
-Tk_PostscriptStipple(interp, tkwin, psInfo, bitmap)
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psInfo; /* Interpreter for returning Postscript
- * or error message. */
- Pixmap bitmap; /* Bitmap to use for stippling. */
+Tk_PostscriptStipple(
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ Tk_PostscriptInfo psInfo, /* Interpreter for returning Postscript or
+ * error message. */
+ Pixmap bitmap) /* Bitmap to use for stippling. */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
int width, height;
@@ -938,22 +905,22 @@ Tk_PostscriptStipple(interp, tkwin, psInfo, bitmap)
/*
* The following call should probably be a call to Tk_SizeOfBitmap
- * instead, but it seems that we are occasionally invoked by custom
- * item types that create their own bitmaps without registering them
- * with Tk. XGetGeometry is a bit slower than Tk_SizeOfBitmap, but
- * it shouldn't matter here.
+ * instead, but it seems that we are occasionally invoked by custom item
+ * types that create their own bitmaps without registering them with Tk.
+ * XGetGeometry is a bit slower than Tk_SizeOfBitmap, but it shouldn't
+ * matter here.
*/
XGetGeometry(Tk_Display(tkwin), bitmap, &dummyRoot,
(int *) &dummyX, (int *) &dummyY, (unsigned *) &width,
(unsigned *) &height, &dummyBorderwidth, &dummyDepth);
sprintf(string, "%d %d ", width, height);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
if (Tk_PostscriptBitmap(interp, tkwin, psInfo, bitmap, 0, 0,
width, height) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_AppendResult(interp, " StippleFill\n", (char *) NULL);
+ Tcl_AppendResult(interp, " StippleFill\n", NULL);
return TCL_OK;
}
@@ -962,12 +929,13 @@ Tk_PostscriptStipple(interp, tkwin, psInfo, bitmap)
*
* Tk_PostscriptY --
*
- * Given a y-coordinate in local coordinates, this procedure
- * returns a y-coordinate to use for Postscript output.
+ * Given a y-coordinate in local coordinates, this function returns a
+ * y-coordinate to use for Postscript output. Required because canvases
+ * have their origin in the top-left, but postscript pages have their
+ * origin in the bottom left.
*
* Results:
- * Returns the Postscript coordinate that corresponds to
- * "y".
+ * Returns the Postscript coordinate that corresponds to "y".
*
* Side effects:
* None.
@@ -976,9 +944,9 @@ Tk_PostscriptStipple(interp, tkwin, psInfo, bitmap)
*/
double
-Tk_PostscriptY(y, psInfo)
- double y; /* Y-coordinate in canvas coords. */
- Tk_PostscriptInfo psInfo; /* Postscript info */
+Tk_PostscriptY(
+ double y, /* Y-coordinate in canvas coords. */
+ Tk_PostscriptInfo psInfo) /* Postscript info */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
@@ -990,8 +958,8 @@ Tk_PostscriptY(y, psInfo)
*
* Tk_PostscriptPath --
*
- * Given an array of points for a path, generate Postscript
- * commands to create the path.
+ * Given an array of points for a path, generate Postscript commands to
+ * create the path.
*
* Results:
* Postscript commands get appended to what's in the interp's result.
@@ -1003,14 +971,13 @@ Tk_PostscriptY(y, psInfo)
*/
void
-Tk_PostscriptPath(interp, psInfo, coordPtr, numPoints)
- Tcl_Interp *interp;
- Tk_PostscriptInfo psInfo; /* Canvas on whose behalf Postscript
- * is being generated. */
- double *coordPtr; /* Pointer to first in array of
- * 2*numPoints coordinates giving
- * points for path. */
- int numPoints; /* Number of points at *coordPtr. */
+Tk_PostscriptPath(
+ Tcl_Interp *interp,
+ Tk_PostscriptInfo psInfo, /* Canvas on whose behalf Postscript is being
+ * generated. */
+ double *coordPtr, /* Pointer to first in array of 2*numPoints
+ * coordinates giving points for path. */
+ int numPoints) /* Number of points at *coordPtr. */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
char buffer[200];
@@ -1020,12 +987,12 @@ Tk_PostscriptPath(interp, psInfo, coordPtr, numPoints)
}
sprintf(buffer, "%.15g %.15g moveto\n", coordPtr[0],
Tk_PostscriptY(coordPtr[1], psInfo));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
for (numPoints--, coordPtr += 2; numPoints > 0;
numPoints--, coordPtr += 2) {
sprintf(buffer, "%.15g %.15g lineto\n", coordPtr[0],
Tk_PostscriptY(coordPtr[1], psInfo));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
}
}
@@ -1034,15 +1001,14 @@ Tk_PostscriptPath(interp, psInfo, coordPtr, numPoints)
*
* GetPostscriptPoints --
*
- * Given a string, returns the number of Postscript points
- * corresponding to that string.
+ * Given a string, returns the number of Postscript points corresponding
+ * to that string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * screen distance is stored at *doublePtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the screen distance is stored
+ * at *doublePtr; otherwise TCL_ERROR is returned and an error message is
+ * left in the interp's result.
*
* Side effects:
* None.
@@ -1051,44 +1017,41 @@ Tk_PostscriptPath(interp, psInfo, coordPtr, numPoints)
*/
static int
-GetPostscriptPoints(interp, string, doublePtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a screen distance. */
- double *doublePtr; /* Place to store converted result. */
+GetPostscriptPoints(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ char *string, /* String describing a screen distance. */
+ double *doublePtr) /* Place to store converted result. */
{
char *end;
double d;
d = strtod(string, &end);
if (end == string) {
- error:
- Tcl_AppendResult(interp, "bad distance \"", string,
- "\"", (char *) NULL);
- return TCL_ERROR;
+ goto error;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
}
switch (*end) {
- case 'c':
- d *= 72.0/2.54;
- end++;
- break;
- case 'i':
- d *= 72.0;
- end++;
- break;
- case 'm':
- d *= 72.0/25.4;
- end++;
- break;
- case 0:
- break;
- case 'p':
- end++;
- break;
- default:
- goto error;
+ case 'c':
+ d *= 72.0/2.54;
+ end++;
+ break;
+ case 'i':
+ d *= 72.0;
+ end++;
+ break;
+ case 'm':
+ d *= 72.0/25.4;
+ end++;
+ break;
+ case 0:
+ break;
+ case 'p':
+ end++;
+ break;
+ default:
+ goto error;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
@@ -1098,34 +1061,37 @@ GetPostscriptPoints(interp, string, doublePtr)
}
*doublePtr = d;
return TCL_OK;
-}
+ error:
+ Tcl_AppendResult(interp, "bad distance \"", string, "\"", NULL);
+ return TCL_ERROR;
+}
+
/*
*--------------------------------------------------------------
*
* TkImageGetColor --
*
- * This procedure converts a pixel value to three floating
- * point numbers, representing the amount of red, green, and
- * blue in that pixel on the screen. It makes use of colormap
- * data passed as an argument, and should work for all Visual
- * types.
+ * This function converts a pixel value to three floating point numbers,
+ * representing the amount of red, green, and blue in that pixel on the
+ * screen. It makes use of colormap data passed as an argument, and
+ * should work for all Visual types.
*
- * This implementation is bogus on Windows because the colormap
- * data is never filled in. Instead all postscript generated
- * data coming through here is expected to be RGB color data.
- * To handle lower bit-depth images properly, XQueryColors
- * must be implemented for Windows.
+ * This implementation is bogus on Windows because the colormap data is
+ * never filled in. Instead all postscript generated data coming through
+ * here is expected to be RGB color data. To handle lower bit-depth
+ * images properly, XQueryColors must be implemented for Windows.
*
* Results:
- * Returns red, green, and blue color values in the range
- * 0 to 1. There are no error returns.
+ * Returns red, green, and blue color values in the range 0 to 1. There
+ * are no error returns.
*
* Side effects:
* None.
*
*--------------------------------------------------------------
*/
+
#ifdef WIN32
#include <windows.h>
@@ -1134,35 +1100,41 @@ GetPostscriptPoints(interp, string, doublePtr)
#define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
-*/
-#else
+ */
+
+#else /* !WIN32 */
+
#define GetRValue(rgb) ((rgb & cdata->red_mask) >> cdata->red_shift)
#define GetGValue(rgb) ((rgb & cdata->green_mask) >> cdata->green_shift)
#define GetBValue(rgb) ((rgb & cdata->blue_mask) >> cdata->blue_shift)
-#endif
+
+#endif /* WIN32 */
#if defined(WIN32) || defined(MAC_OSX_TK)
static void
-TkImageGetColor(cdata, pixel, red, green, blue)
- TkColormapData *cdata; /* Colormap data */
- unsigned long pixel; /* Pixel value to look up */
- double *red, *green, *blue; /* Color data to return */
+TkImageGetColor(
+ TkColormapData *cdata, /* Colormap data */
+ unsigned long pixel, /* Pixel value to look up */
+ double *red, double *green, double *blue)
+ /* Color data to return */
{
*red = (double) GetRValue(pixel) / 255.0;
*green = (double) GetGValue(pixel) / 255.0;
*blue = (double) GetBValue(pixel) / 255.0;
}
-#else
+#else /* ! (WIN32 || MAC_OSX_TK) */
static void
-TkImageGetColor(cdata, pixel, red, green, blue)
- TkColormapData *cdata; /* Colormap data */
- unsigned long pixel; /* Pixel value to look up */
- double *red, *green, *blue; /* Color data to return */
+TkImageGetColor(
+ TkColormapData *cdata, /* Colormap data */
+ unsigned long pixel, /* Pixel value to look up */
+ double *red, double *green, double *blue)
+ /* Color data to return */
{
if (cdata->separated) {
int r = GetRValue(pixel);
int g = GetGValue(pixel);
int b = GetBValue(pixel);
+
*red = cdata->colors[r].red / 65535.0;
*green = cdata->colors[g].green / 65535.0;
*blue = cdata->colors[b].blue / 65535.0;
@@ -1172,24 +1144,22 @@ TkImageGetColor(cdata, pixel, red, green, blue)
*blue = cdata->colors[pixel].blue / 65535.0;
}
}
-#endif
-
+#endif /* WIN32 || MAC_OSX_TK */
+
/*
*--------------------------------------------------------------
*
* TkPostscriptImage --
*
- * This procedure is called to output the contents of an
- * image in Postscript, using a format appropriate for the
- * current color mode (i.e. one bit per pixel in monochrome,
- * one byte per pixel in gray, and three bytes per pixel in
- * color).
+ * This function is called to output the contents of an image in
+ * Postscript, using a format appropriate for the current color mode
+ * (i.e. one bit per pixel in monochrome, one byte per pixel in gray, and
+ * three bytes per pixel in color).
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to interp->result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to interp->result.
*
* Side effects:
* None.
@@ -1198,13 +1168,13 @@ TkImageGetColor(cdata, pixel, red, green, blue)
*/
int
-TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psInfo; /* postscript info */
- XImage *ximage; /* Image to draw */
- int x, y; /* First pixel to output */
- int width, height; /* Width and height of area */
+TkPostscriptImage(
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ Tk_PostscriptInfo psInfo, /* postscript info */
+ XImage *ximage, /* Image to draw */
+ int x, int y, /* First pixel to output */
+ int width, int height) /* Width and height of area */
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
char buffer[256];
@@ -1225,9 +1195,8 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
visual = Tk_Visual(tkwin);
/*
- * Obtain information about the colormap, ie the mapping between
- * pixel values and RGB values. The code below should work
- * for all Visual types.
+ * Obtain information about the colormap, ie the mapping between pixel
+ * values and RGB values. The code below should work for all Visual types.
*/
ncolors = visual->map_entries;
@@ -1242,33 +1211,42 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
cdata.red_shift = 0;
cdata.green_shift = 0;
cdata.blue_shift = 0;
- while ((0x0001 & (cdata.red_mask >> cdata.red_shift)) == 0)
+
+ while ((0x0001 & (cdata.red_mask >> cdata.red_shift)) == 0) {
cdata.red_shift ++;
- while ((0x0001 & (cdata.green_mask >> cdata.green_shift)) == 0)
+ }
+ while ((0x0001 & (cdata.green_mask >> cdata.green_shift)) == 0) {
cdata.green_shift ++;
- while ((0x0001 & (cdata.blue_mask >> cdata.blue_shift)) == 0)
+ }
+ while ((0x0001 & (cdata.blue_mask >> cdata.blue_shift)) == 0) {
cdata.blue_shift ++;
- for (i = 0; i < ncolors; i ++)
+ }
+
+ for (i = 0; i < ncolors; i ++) {
cdata.colors[i].pixel =
- ((i << cdata.red_shift) & cdata.red_mask) |
- ((i << cdata.green_shift) & cdata.green_mask) |
- ((i << cdata.blue_shift) & cdata.blue_mask);
+ ((i << cdata.red_shift) & cdata.red_mask) |
+ ((i << cdata.green_shift) & cdata.green_mask) |
+ ((i << cdata.blue_shift) & cdata.blue_mask);
+ }
} else {
cdata.separated=0;
- for (i = 0; i < ncolors; i ++)
+ for (i = 0; i < ncolors; i ++) {
cdata.colors[i].pixel = i;
+ }
}
- if (visual->class == StaticGray || visual->class == GrayScale)
+
+ if (visual->class == StaticGray || visual->class == GrayScale) {
cdata.color = 0;
- else
+ } else {
cdata.color = 1;
+ }
XQueryColors(Tk_Display(tkwin), cmap, cdata.colors, ncolors);
/*
- * Figure out which color level to use (possibly lower than the
- * one specified by the user). For example, if the user specifies
- * color with monochrome screen, use gray or monochrome mode instead.
+ * Figure out which color level to use (possibly lower than the one
+ * specified by the user). For example, if the user specifies color with
+ * monochrome screen, use gray or monochrome mode instead.
*/
if (!cdata.color && level == 2) {
@@ -1280,15 +1258,15 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
}
/*
- * Check that at least one row of the image can be represented
- * with a string less than 64 KB long (this is a limit in the
- * Postscript interpreter).
+ * Check that at least one row of the image can be represented with a
+ * string less than 64 KB long (this is a limit in the Postscript
+ * interpreter).
*/
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;
+ case 0: bytesPerLine = (width + 7) / 8; maxWidth = 240000; break;
+ case 1: bytesPerLine = width; maxWidth = 60000; break;
+ case 2: bytesPerLine = 3 * width; maxWidth = 20000; break;
}
if (bytesPerLine > 60000) {
@@ -1296,7 +1274,7 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
sprintf(buffer,
"Can't generate Postscript for images more than %d pixels wide",
maxWidth);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
ckfree((char *) cdata.colors);
return TCL_ERROR;
}
@@ -1306,107 +1284,110 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
for (band = height-1; band >= 0; band -= maxRows) {
int rows = (band >= maxRows) ? maxRows : band + 1;
int lineLen = 0;
+
switch (level) {
- case 0:
- sprintf(buffer, "%d %d 1 matrix {\n<", width, rows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- break;
- case 1:
- sprintf(buffer, "%d %d 8 matrix {\n<", width, rows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- break;
- case 2:
- sprintf(buffer, "%d %d 8 matrix {\n<",
- width, rows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- break;
+ case 0:
+ sprintf(buffer, "%d %d 1 matrix {\n<", width, rows);
+ Tcl_AppendResult(interp, buffer, NULL);
+ break;
+ case 1:
+ sprintf(buffer, "%d %d 8 matrix {\n<", width, rows);
+ Tcl_AppendResult(interp, buffer, NULL);
+ break;
+ case 2:
+ sprintf(buffer, "%d %d 8 matrix {\n<", width, rows);
+ Tcl_AppendResult(interp, buffer, NULL);
+ break;
}
for (yy = band; yy > band - rows; yy--) {
switch (level) {
- case 0: {
- /*
- * Generate data for image in monochrome mode.
- * No attempt at dithering is made--instead, just
- * set a threshold.
- */
- unsigned char mask=0x80;
- unsigned char data=0x00;
- for (xx = x; xx< x+width; xx++) {
- TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
- &red, &green, &blue);
- if (0.30 * red + 0.59 * green + 0.11 * blue > 0.5)
- data |= mask;
- mask >>= 1;
- if (mask == 0) {
- sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 2;
- if (lineLen > 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
- mask=0x80;
- data=0x00;
- }
- }
- if ((width % 8) != 0) {
- sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- mask=0x80;
- data=0x00;
+ case 0: {
+ /*
+ * Generate data for image in monochrome mode. No attempt at
+ * dithering is made--instead, just set a threshold.
+ */
+
+ unsigned char mask = 0x80;
+ unsigned char data = 0x00;
+
+ for (xx = x; xx< x+width; xx++) {
+ TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
+ &red, &green, &blue);
+ if (0.30 * red + 0.59 * green + 0.11 * blue > 0.5) {
+ data |= mask;
}
- break;
- }
- case 1: {
- /*
- * Generate data in gray mode--in this case, take a
- * weighted sum of the red, green, and blue values.
- */
- for (xx = x; xx < x+width; xx ++) {
- TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
- &red, &green, &blue);
- sprintf(buffer, "%02X", (int) floor(0.5 + 255.0 *
- (0.30 * red + 0.59 * green + 0.11 * blue)));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ mask >>= 1;
+ if (mask == 0) {
+ sprintf(buffer, "%02X", data);
+ Tcl_AppendResult(interp, buffer, NULL);
lineLen += 2;
if (lineLen > 60) {
lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
+ Tcl_AppendResult(interp, "\n", NULL);
}
+ mask=0x80;
+ data=0x00;
}
- break;
}
- case 2: {
- /*
- * Finally, color mode. Here, just output the red, green,
- * and blue values directly.
- */
- for (xx = x; xx < x+width; xx++) {
- TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
- &red, &green, &blue);
- sprintf(buffer, "%02X%02X%02X",
- (int) floor(0.5 + 255.0 * red),
- (int) floor(0.5 + 255.0 * green),
- (int) floor(0.5 + 255.0 * blue));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 6;
- if (lineLen > 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
+ if ((width % 8) != 0) {
+ sprintf(buffer, "%02X", data);
+ Tcl_AppendResult(interp, buffer, NULL);
+ mask=0x80;
+ data=0x00;
+ }
+ break;
+ }
+ case 1:
+ /*
+ * Generate data in gray mode; in this case, take a weighted
+ * sum of the red, green, and blue values.
+ */
+
+ for (xx = x; xx < x+width; xx ++) {
+ TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
+ &red, &green, &blue);
+ sprintf(buffer, "%02X", (int) floor(0.5 + 255.0 *
+ (0.30 * red + 0.59 * green + 0.11 * blue)));
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 2;
+ if (lineLen > 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
+ }
+ }
+ break;
+ case 2:
+ /*
+ * Finally, color mode. Here, just output the red, green, and
+ * blue values directly.
+ */
+
+ for (xx = x; xx < x+width; xx++) {
+ TkImageGetColor(&cdata, XGetPixel(ximage, xx, yy),
+ &red, &green, &blue);
+ sprintf(buffer, "%02X%02X%02X",
+ (int) floor(0.5 + 255.0 * red),
+ (int) floor(0.5 + 255.0 * green),
+ (int) floor(0.5 + 255.0 * blue));
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 6;
+ if (lineLen > 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
}
- break;
}
+ break;
}
}
switch (level) {
- case 0: sprintf(buffer, ">\n} image\n"); break;
- case 1: sprintf(buffer, ">\n} image\n"); break;
- case 2: sprintf(buffer, ">\n} false 3 colorimage\n"); break;
+ case 0: case 1:
+ sprintf(buffer, ">\n} image\n"); break;
+ case 2:
+ sprintf(buffer, ">\n} false 3 colorimage\n"); break;
}
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
sprintf(buffer, "0 %d translate\n", rows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
}
ckfree((char *) cdata.colors);
return TCL_OK;
@@ -1417,28 +1398,28 @@ TkPostscriptImage(interp, tkwin, psInfo, ximage, x, y, width, height)
*
* Tk_PostscriptPhoto --
*
- * This procedure is called to output the contents of a
- * photo image in Postscript, using a format appropriate for
- * the requested postscript color mode (i.e. one byte per pixel
- * in gray, and three bytes per pixel in color).
+ * This function is called to output the contents of a photo image in
+ * Postscript, using a format appropriate for the requested postscript
+ * color mode (i.e. one byte per pixel in gray, and three bytes per pixel
+ * in color).
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to the interpreter's result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to the interpreter's result.
*
* Side effects:
* None.
*
*--------------------------------------------------------------
*/
+
int
-Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
- Tcl_Interp *interp;
- Tk_PhotoImageBlock *blockPtr;
- Tk_PostscriptInfo psInfo;
- int width, height;
+Tk_PostscriptPhoto(
+ Tcl_Interp *interp,
+ Tk_PhotoImageBlock *blockPtr,
+ Tk_PostscriptInfo psInfo,
+ int width, int height)
{
TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo;
int colorLevel = psInfoPtr->colorLevel;
@@ -1462,20 +1443,20 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
}
/*
- * 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.
+ * 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 (!codeIncluded && (colorLevel != 0)) {
/*
* Color and gray-scale code.
*/
codeIncluded = !0;
- Tcl_AppendResult( interp,
+ Tcl_AppendResult(interp,
"/TkPhoto { \n",
" gsave \n",
" 32 dict begin \n",
@@ -1544,14 +1525,14 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
" } for \n",
" end \n",
" grestore \n",
- "} bind def \n\n\n", (char *) NULL);
- } else if( !codeIncluded && (colorLevel == 0) ) {
+ "} bind def \n\n\n", NULL);
+ } else if (!codeIncluded && (colorLevel == 0)) {
/*
* Monochrome-only code
*/
codeIncluded = !0;
- Tcl_AppendResult( interp,
+ Tcl_AppendResult(interp,
"/TkPhoto { \n",
" gsave \n",
" 32 dict begin \n",
@@ -1588,27 +1569,26 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
" } for \n",
" end \n",
" grestore \n",
- "} bind def \n\n\n", (char *) NULL);
+ "} bind def \n\n\n", NULL);
}
/*
- * Check that at least one row of the image can be represented
- * with a string less than 64 KB long (this is a limit in the
- * Postscript interpreter).
+ * Check that at least one row of the image can be represented with a
+ * string less than 64 KB long (this is a limit in the Postscript
+ * interpreter).
*/
- 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;
- }
+ 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;
+ }
if (bytesPerLine > 60000) {
Tcl_ResetResult(interp);
sprintf(buffer,
"Can't generate Postscript for images more than %d pixels wide",
maxWidth);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
return TCL_ERROR;
}
@@ -1617,45 +1597,37 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
*/
switch (colorLevel) {
- case 0:
- strcpy( cspace, "/DeviceGray");
- strcpy( decode, "[1 0]");
- bpc = 1;
- break;
- case 1:
- strcpy( cspace, "/DeviceGray");
- strcpy( decode, "[0 1]");
- bpc = 8;
- break;
- default:
- strcpy( cspace, "/DeviceRGB");
- strcpy( decode, "[0 1 0 1 0 1]");
- bpc = 8;
- break;
+ case 0:
+ strcpy(cspace, "/DeviceGray");
+ strcpy(decode, "[1 0]");
+ bpc = 1;
+ break;
+ case 1:
+ strcpy(cspace, "/DeviceGray");
+ strcpy(decode, "[0 1]");
+ bpc = 8;
+ break;
+ default:
+ strcpy(cspace, "/DeviceRGB");
+ strcpy(decode, "[0 1 0 1 0 1]");
+ bpc = 8;
+ break;
}
- Tcl_AppendResult(interp,
- cspace, " setcolorspace\n\n", (char *) NULL);
+ Tcl_AppendResult(interp, cspace, " setcolorspace\n\n", NULL);
- sprintf(buffer,
- " /Width %d\n /Height %d\n /BitsPerComponent %d\n",
+ sprintf(buffer, " /Width %d\n /Height %d\n /BitsPerComponent %d\n",
width, height, bpc);
- Tcl_AppendResult(interp,
- "<<\n /ImageType 1\n", buffer,
- " /DataSource currentfile",
- " /ASCIIHexDecode filter\n", (char *) NULL);
-
-
- sprintf(buffer,
- " /ImageMatrix [1 0 0 -1 0 %d]\n", height);
- Tcl_AppendResult(interp, buffer,
- " /Decode ", decode, "\n>>\n1 TkPhoto\n", (char *) NULL);
+ Tcl_AppendResult(interp, "<<\n /ImageType 1\n", buffer,
+ " /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);
/*
- * Check the PhotoImageBlock information.
- * We assume that:
+ * Check the PhotoImageBlock information. We assume that:
* if pixelSize is 1,2 or 4, the image is R,G,B,A;
* if pixelSize is 3, the image is R,G,B and offset[3] is bogus.
*/
@@ -1678,198 +1650,192 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
alphaOffset = blockPtr->offset[3];
}
-
for (yy = 0, lineLen=0; yy < height; yy++) {
switch (colorLevel) {
- case 0: {
- /*
- * Generate data for image in monochrome mode.
- * No attempt at dithering is made--instead, just
- * set a threshold.
- * To handle transparecies we need to output two lines:
- * one for the black pixels, one for the white ones.
- */
+ case 0: {
+ /*
+ * Generate data for image in monochrome mode. No attempt at
+ * dithering is made--instead, just set a threshold. To handle
+ * transparecies we need to output two lines: one for the black
+ * pixels, one for the white ones.
+ */
- unsigned char mask=0x80;
- unsigned char data=0x00;
- for (xx = 0; xx< width; xx ++) {
- pixelPtr = blockPtr->pixelPtr
- + (yy * blockPtr->pitch)
+ unsigned char mask = 0x80;
+ unsigned char data = 0x00;
+
+ for (xx = 0; xx< width; xx ++) {
+ pixelPtr = blockPtr->pixelPtr + (yy * blockPtr->pitch)
+ (xx *blockPtr->pixelSize);
- red = pixelPtr[blockPtr->offset[0]];
- green = pixelPtr[blockPtr->offset[1]];
- blue = pixelPtr[blockPtr->offset[2]];
+ red = pixelPtr[blockPtr->offset[0]];
+ green = pixelPtr[blockPtr->offset[1]];
+ blue = pixelPtr[blockPtr->offset[2]];
- alpha = *(alphaPtr + (yy * alphaPitch)
- + (xx * alphaIncr) + alphaOffset);
+ alpha = *(alphaPtr + (yy * alphaPitch)
+ + (xx * alphaIncr) + alphaOffset);
- /*
- * If pixel is less than threshold, then it is black.
- */
+ /*
+ * If pixel is less than threshold, then it is black.
+ */
- if ((alpha != 0) &&
- ( 0.3086 * red
- + 0.6094 * green
- + 0.082 * blue < 128)) {
- data |= mask;
- }
- mask >>= 1;
- if (mask == 0) {
- sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 2;
- if (lineLen >= 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
- mask=0x80;
- data=0x00;
- }
+ if ((alpha != 0) &&
+ (0.3086*red + 0.6094*green + 0.082*blue < 128)) {
+ data |= mask;
}
- if ((width % 8) != 0) {
+ mask >>= 1;
+ if (mask == 0) {
sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- mask=0x80;
- data=0x00;
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 2;
+ if (lineLen >= 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
+ }
+ mask = 0x80;
+ data = 0x00;
}
+ }
+ if ((width % 8) != 0) {
+ sprintf(buffer, "%02X", data);
+ Tcl_AppendResult(interp, buffer, NULL);
+ mask = 0x80;
+ data = 0x00;
+ }
- mask=0x80;
- data=0x00;
- for (xx = 0; xx< width; xx ++) {
- pixelPtr = blockPtr->pixelPtr
- + (yy * blockPtr->pitch)
+ mask = 0x80;
+ data = 0x00;
+ for (xx=0 ; xx<width ; xx++) {
+ pixelPtr = blockPtr->pixelPtr + (yy * blockPtr->pitch)
+ (xx *blockPtr->pixelSize);
- red = pixelPtr[blockPtr->offset[0]];
- green = pixelPtr[blockPtr->offset[1]];
- blue = pixelPtr[blockPtr->offset[2]];
-
- alpha = *(alphaPtr + (yy * alphaPitch)
- + (xx * alphaIncr) + alphaOffset);
-
- /*
- * If pixel is greater than threshold, then it is white.
- */
-
- if ((alpha != 0) &&
- ( 0.3086 * red
- + 0.6094 * green
- + 0.082 * blue >= 128)) {
- data |= mask;
- }
- mask >>= 1;
- if (mask == 0) {
- sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 2;
- if (lineLen >= 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
- mask=0x80;
- data=0x00;
- }
- }
- if ((width % 8) != 0) {
- sprintf(buffer, "%02X", data);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- mask=0x80;
- data=0x00;
- }
- break;
- }
- case 1: {
+ red = pixelPtr[blockPtr->offset[0]];
+ green = pixelPtr[blockPtr->offset[1]];
+ blue = pixelPtr[blockPtr->offset[2]];
+
+ alpha = *(alphaPtr + (yy * alphaPitch)
+ + (xx * alphaIncr) + alphaOffset);
+
/*
- * Generate transparency data.
- * We must prevent a transparent value of 0
- * because of a bug in some HP printers.
+ * If pixel is greater than threshold, then it is white.
*/
- for (xx = 0; xx < width; xx ++) {
- alpha = *(alphaPtr + (yy * alphaPitch)
- + (xx * alphaIncr) + alphaOffset);
- sprintf(buffer, "%02X", alpha | 0x01);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ if ((alpha != 0) &&
+ (0.3086*red + 0.6094*green + 0.082*blue >= 128)) {
+ data |= mask;
+ }
+ mask >>= 1;
+ if (mask == 0) {
+ sprintf(buffer, "%02X", data);
+ Tcl_AppendResult(interp, buffer, NULL);
lineLen += 2;
if (lineLen >= 60) {
lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
+ Tcl_AppendResult(interp, "\n", NULL);
}
+ mask = 0x80;
+ data = 0x00;
}
+ }
+ if ((width % 8) != 0) {
+ sprintf(buffer, "%02X", data);
+ Tcl_AppendResult(interp, buffer, NULL);
+ mask = 0x80;
+ data = 0x00;
+ }
+ break;
+ }
+ case 1: {
+ /*
+ * Generate transparency data. We must prevent a transparent value
+ * of 0 because of a bug in some HP printers.
+ */
+ for (xx = 0; xx < width; xx ++) {
+ alpha = *(alphaPtr + (yy * alphaPitch)
+ + (xx * alphaIncr) + alphaOffset);
+ sprintf(buffer, "%02X", alpha | 0x01);
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 2;
+ if (lineLen >= 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
+ }
+ }
- /*
- * Generate data in gray mode--in this case, take a
- * weighted sum of the red, green, and blue values.
- */
+ /*
+ * Generate data in gray mode; in this case, take a weighted sum
+ * of the red, green, and blue values.
+ */
- for (xx = 0; xx < width; xx ++) {
- pixelPtr = blockPtr->pixelPtr
- + (yy * blockPtr->pitch)
+ for (xx = 0; xx < width; xx ++) {
+ pixelPtr = blockPtr->pixelPtr + (yy * blockPtr->pitch)
+ (xx *blockPtr->pixelSize);
- red = pixelPtr[blockPtr->offset[0]];
- green = pixelPtr[blockPtr->offset[1]];
- blue = pixelPtr[blockPtr->offset[2]];
-
- sprintf(buffer, "%02X", (int) floor(0.5 +
- ( 0.3086 * red + 0.6094 * green + 0.0820 * blue)));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 2;
- if (lineLen >= 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
+ red = pixelPtr[blockPtr->offset[0]];
+ green = pixelPtr[blockPtr->offset[1]];
+ blue = pixelPtr[blockPtr->offset[2]];
+
+ sprintf(buffer, "%02X", (int) floor(0.5 +
+ ( 0.3086 * red + 0.6094 * green + 0.0820 * blue)));
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 2;
+ if (lineLen >= 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
}
- break;
}
- default: {
- /*
- * Generate transparency data.
- * We must prevent a transparent value of 0
- * because of a bug in some HP printers.
- */
+ break;
+ }
+ default:
+ /*
+ * Generate transparency data. We must prevent a transparent value
+ * of 0 because of a bug in some HP printers.
+ */
- for (xx = 0; xx < width; xx ++) {
- alpha = *(alphaPtr + (yy * alphaPitch)
- + (xx * alphaIncr) + alphaOffset);
- sprintf(buffer, "%02X", alpha | 0x01);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 2;
- if (lineLen >= 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
+ for (xx = 0; xx < width; xx ++) {
+ alpha = *(alphaPtr + (yy * alphaPitch)
+ + (xx * alphaIncr) + alphaOffset);
+ sprintf(buffer, "%02X", alpha | 0x01);
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 2;
+ if (lineLen >= 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
}
+ }
+ /*
+ * Finally, color mode. Here, just output the red, green, and blue
+ * values directly.
+ */
- /*
- * Finally, color mode. Here, just output the red, green,
- * and blue values directly.
- */
-
- for (xx = 0; xx < width; xx ++) {
- pixelPtr = blockPtr->pixelPtr
- + (yy * blockPtr->pitch)
- + (xx *blockPtr->pixelSize);
-
- sprintf(buffer, "%02X%02X%02X",
- pixelPtr[blockPtr->offset[0]],
- pixelPtr[blockPtr->offset[1]],
- pixelPtr[blockPtr->offset[2]]);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- lineLen += 6;
- if (lineLen >= 60) {
- lineLen = 0;
- Tcl_AppendResult(interp, "\n", (char *) NULL);
- }
+ for (xx = 0; xx < width; xx ++) {
+ pixelPtr = blockPtr->pixelPtr + (yy * blockPtr->pitch)
+ + (xx * blockPtr->pixelSize);
+
+ sprintf(buffer, "%02X%02X%02X",
+ pixelPtr[blockPtr->offset[0]],
+ pixelPtr[blockPtr->offset[1]],
+ pixelPtr[blockPtr->offset[2]]);
+ Tcl_AppendResult(interp, buffer, NULL);
+ lineLen += 6;
+ if (lineLen >= 60) {
+ lineLen = 0;
+ Tcl_AppendResult(interp, "\n", NULL);
}
- break;
}
+ break;
}
}
- Tcl_AppendResult(interp, ">\n", (char *) NULL);
+ Tcl_AppendResult(interp, ">\n", NULL);
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 282482f..24c3c7f 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvText.c --
*
* This file implements text items for canvas widgets.
@@ -6,33 +6,32 @@
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
#include "tkCanvas.h"
-#include "tkPort.h"
#include "default.h"
/*
* The structure below defines the record for each text item.
*/
-typedef struct TextItem {
+typedef struct TextItem {
Tk_Item header; /* Generic stuff that's the same for all
- * types. MUST BE FIRST IN STRUCTURE. */
+ * types. MUST BE FIRST IN STRUCTURE. */
Tk_CanvasTextInfo *textInfoPtr;
/* Pointer to a structure containing
* information about the selection and
- * insertion cursor. The structure is owned
- * by (and shared with) the generic canvas
+ * insertion cursor. The structure is owned by
+ * (and shared with) the generic canvas
* code. */
/*
* Fields that are set by widget commands other than "configure".
*/
-
+
double x, y; /* Positioning point for text. */
int insertPos; /* Character index of character just before
* which the insertion cursor is displayed. */
@@ -52,8 +51,10 @@ typedef struct TextItem {
Pixmap activeStipple; /* Stipple bitmap for text, or None. */
Pixmap disabledStipple; /* Stipple bitmap for text, or None. */
char *text; /* Text for item (malloc-ed). */
- int width; /* Width of lines for word-wrap, pixels.
- * Zero means no word-wrap. */
+ int width; /* Width of lines for word-wrap, pixels. Zero
+ * means no word-wrap. */
+ int underline; /* Index of character to put underline beneath
+ * or -1 for no underlining. */
/*
* Fields whose values are derived from the current values of the
@@ -63,18 +64,18 @@ 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 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. */
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. */
+ * it's off. Used if the selection and
+ * insertion cursor colors are the same. */
} TextItem;
/*
@@ -95,89 +96,86 @@ static Tk_CustomOption offsetOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_COLOR, "-activefill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(TextItem, activeColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-activestipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(TextItem, activeStipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,
- "center", Tk_Offset(TextItem, anchor),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_COLOR, "-disabledfill", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(TextItem, disabledColor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_BITMAP, "-disabledstipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_COLOR, "-fill", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_COLOR, "-activefill", NULL, NULL,
+ NULL, Tk_Offset(TextItem, activeColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-activestipple", NULL, NULL,
+ NULL, Tk_Offset(TextItem, activeStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
+ "center", Tk_Offset(TextItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
+ {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL,
+ NULL, Tk_Offset(TextItem, disabledColor), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL,
+ NULL, Tk_Offset(TextItem, disabledStipple), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_COLOR, "-fill", NULL, NULL,
"black", Tk_Offset(TextItem, color), TK_CONFIG_NULL_OK},
- {TK_CONFIG_FONT, "-font", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_FONT, "-font", NULL, NULL,
DEF_CANVTEXT_FONT, Tk_Offset(TextItem, tkfont), 0},
- {TK_CONFIG_JUSTIFY, "-justify", (char *) NULL, (char *) NULL,
- "left", Tk_Offset(TextItem, justify),
- TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-offset", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_JUSTIFY, "-justify", NULL, NULL,
+ "left", Tk_Offset(TextItem, justify), TK_CONFIG_DONT_SET_DEFAULT},
+ {TK_CONFIG_CUSTOM, "-offset", NULL, NULL,
"0,0", Tk_Offset(TextItem, tsoffset),
TK_CONFIG_DONT_SET_DEFAULT, &offsetOption},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_BITMAP, "-stipple", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(TextItem, stipple), TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_STRING, "-text", (char *) NULL, (char *) 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(TextItem, stipple), TK_CONFIG_NULL_OK},
+ {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_CONFIG_PIXELS, "-width", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_INT, "-underline", NULL, NULL,
+ "-1", Tk_Offset(TextItem, underline), 0},
+ {TK_CONFIG_PIXELS, "-width", NULL, NULL,
"0", Tk_Offset(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static void ComputeTextBbox _ANSI_ARGS_((Tk_Canvas canvas,
- TextItem *textPtr));
-static int ConfigureText _ANSI_ARGS_((Tcl_Interp *interp,
+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));
-static int CreateText _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteText _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayCanvText _ANSI_ARGS_((Tk_Canvas canvas,
+ int argc, Tcl_Obj *CONST objv[]);
+static void DeleteText(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayCanvText(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static int GetSelText _ANSI_ARGS_((Tk_Canvas canvas,
+ int x, int y, int width, int height);
+static int GetSelText(Tk_Canvas canvas,
Tk_Item *itemPtr, int offset, char *buffer,
- int maxBytes));
-static int GetTextIndex _ANSI_ARGS_((Tcl_Interp *interp,
+ int maxBytes);
+static int GetTextIndex(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- Tcl_Obj *obj, int *indexPtr));
-static void ScaleText _ANSI_ARGS_((Tk_Canvas canvas,
+ Tcl_Obj *obj, int *indexPtr);
+static void ScaleText(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void SetTextCursor _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int index));
-static int TextCoords _ANSI_ARGS_((Tcl_Interp *interp,
+ double scaleX, double scaleY);
+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[]));
-static void TextDeleteChars _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int first, int last));
-static void TextInsert _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, int beforeThis, char *string));
-static int TextToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static double TextToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *pointPtr));
-static int TextToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static void TranslateText _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
+ 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);
+static int TextToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static double TextToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *pointPtr);
+static int TextToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+static void TranslateText(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double deltaX, double deltaY);
/*
- * The structures below defines the rectangle and oval item types
- * by means of procedures that can be invoked by generic item code.
+ * The structures below defines the rectangle and oval item types by means of
+ * functions that can be invoked by generic item code.
*/
Tk_ItemType tkTextType = {
@@ -200,7 +198,7 @@ Tk_ItemType tkTextType = {
GetSelText, /* selectionProc */
TextInsert, /* insertProc */
TextDeleteChars, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ NULL, /* nextPtr */
};
/*
@@ -208,14 +206,12 @@ Tk_ItemType tkTextType = {
*
* CreateText --
*
- * This procedure is invoked to create a new text item
- * in a canvas.
+ * This function is invoked to create a new text item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item then an error message is left in
- * the interp's result; in this case itemPtr is left uninitialized
- * so it can be safely freed by the caller.
+ * A standard Tcl return value. If an error occurred in creating the item
+ * then an error message is left in the interp's result; in this case
+ * itemPtr is left uninitialized so it can be safely freed by the caller.
*
* Side effects:
* A new text item is created.
@@ -224,24 +220,24 @@ Tk_ItemType tkTextType = {
*/
static int
-CreateText(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header has been
+CreateText(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
{
TextItem *textPtr = (TextItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
* Carry out initialization that is needed in order to clean up after
- * errors during the the remainder of this procedure.
+ * errors during the the remainder of this function.
*/
textPtr->textInfoPtr = Tk_CanvasGetTextInfo(canvas);
@@ -262,6 +258,7 @@ CreateText(interp, canvas, itemPtr, objc, objv)
textPtr->disabledStipple = None;
textPtr->text = NULL;
textPtr->width = 0;
+ textPtr->underline = -1;
textPtr->numChars = 0;
textPtr->numBytes = 0;
@@ -273,14 +270,15 @@ CreateText(interp, canvas, itemPtr, objc, objv)
textPtr->cursorOffGC = None;
/*
- * Process the arguments to fill in the item record.
- * Only 1 (list) or 2 (x y) coords are allowed.
+ * Process the arguments to fill in the item record. Only 1 (list) or 2 (x
+ * y) coords are allowed.
*/
if (objc == 1) {
i = 1;
} else {
char *arg = Tcl_GetString(objv[1]);
+
i = 2;
if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
@@ -293,7 +291,7 @@ CreateText(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeleteText(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -303,9 +301,8 @@ CreateText(interp, canvas, itemPtr, objc, objv)
*
* TextCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on text items. See the user documentation for
- * details on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * text items. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -317,18 +314,19 @@ CreateText(interp, canvas, itemPtr, objc, objv)
*/
static int
-TextCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be read or
+TextCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
- int objc; /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1, x2, y2, ... */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
TextItem *textPtr = (TextItem *) itemPtr;
if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
+
Tcl_Obj *subobj = Tcl_NewDoubleObj(textPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(textPtr->y);
@@ -347,15 +345,16 @@ TextCoords(interp, canvas, itemPtr, objc, objv)
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &textPtr->x) != TCL_OK)
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0],
+ &textPtr->x) != TCL_OK)
|| (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
- &textPtr->y) != TCL_OK)) {
+ &textPtr->y) != TCL_OK)) {
return TCL_ERROR;
}
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);
return TCL_ERROR;
@@ -368,28 +367,28 @@ TextCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureText --
*
- * This procedure is invoked to configure various aspects
- * of a text item, such as its border and background colors.
+ * This function is invoked to configure various aspects of a text item,
+ * such as its border and background colors.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
- * Configuration information, such as colors and stipple
- * patterns, may be set for itemPtr.
+ * Configuration information, such as colors and stipple patterns, may be
+ * set for itemPtr.
*
*--------------------------------------------------------------
*/
static int
-ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Rectangle item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureText(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
TextItem *textPtr = (TextItem *) itemPtr;
XGCValues gcValues;
@@ -409,14 +408,13 @@ ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
}
/*
- * A few of the options require additional processing, such as
- * graphics contexts.
+ * A few of the options require additional processing, such as graphics
+ * contexts.
*/
state = itemPtr->state;
- if (textPtr->activeColor != NULL ||
- textPtr->activeStipple != None) {
+ if (textPtr->activeColor != NULL || textPtr->activeStipple != None) {
itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT;
} else {
itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT;
@@ -497,14 +495,14 @@ ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
/*
- * If the text was changed, move the selection and insertion indices
- * to keep them inside the item.
+ * If the text was changed, move the selection and insertion indices to
+ * keep them inside the item.
*/
textPtr->numBytes = strlen(textPtr->text);
textPtr->numChars = Tcl_NumUtfChars(textPtr->text, textPtr->numBytes);
if (textInfoPtr->selItemPtr == itemPtr) {
-
+
if (textInfoPtr->selectFirst >= textPtr->numChars) {
textInfoPtr->selItemPtr = NULL;
} else {
@@ -530,8 +528,8 @@ ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteText --
*
- * This procedure is called to clean up the data structure
- * associated with a text item.
+ * This function is called to clean up the data structure associated with
+ * a text item.
*
* Results:
* None.
@@ -543,10 +541,10 @@ ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteText(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Info about overall canvas widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for canvas. */
+DeleteText(
+ Tk_Canvas canvas, /* Info about overall canvas widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
TextItem *textPtr = (TextItem *) itemPtr;
@@ -590,26 +588,25 @@ DeleteText(canvas, itemPtr, display)
*
* ComputeTextBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a text item.
- * In addition, it recomputes all of the geometry information
- * used to display a text item or check for mouse hits.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a text item. In addition, it recomputes
+ * all of the geometry information used to display a text item or check
+ * for mouse hits.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr, and the linePtr structure is regenerated
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr,
+ * and the linePtr structure is regenerated for itemPtr.
*
*--------------------------------------------------------------
*/
static void
-ComputeTextBbox(canvas, textPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- TextItem *textPtr; /* Item whose bbox is to be recomputed. */
+ComputeTextBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ TextItem *textPtr) /* Item whose bbox is to be recomputed. */
{
Tk_CanvasTextInfo *textInfoPtr;
int leftX, topY, width, height, fudge;
@@ -629,57 +626,56 @@ ComputeTextBbox(canvas, textPtr)
}
/*
- * Use overall geometry information to compute the top-left corner
- * of the bounding box for the text item.
+ * Use overall geometry information to compute the top-left corner of the
+ * bounding box for the text item.
*/
leftX = (int) floor(textPtr->x + 0.5);
topY = (int) floor(textPtr->y + 0.5);
switch (textPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_N:
- case TK_ANCHOR_NE:
- break;
-
- case TK_ANCHOR_W:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_E:
- topY -= height / 2;
- break;
-
- case TK_ANCHOR_SW:
- case TK_ANCHOR_S:
- case TK_ANCHOR_SE:
- topY -= height;
- break;
+ case TK_ANCHOR_NW:
+ case TK_ANCHOR_N:
+ case TK_ANCHOR_NE:
+ break;
+
+ case TK_ANCHOR_W:
+ case TK_ANCHOR_CENTER:
+ case TK_ANCHOR_E:
+ topY -= height / 2;
+ break;
+
+ case TK_ANCHOR_SW:
+ case TK_ANCHOR_S:
+ case TK_ANCHOR_SE:
+ topY -= height;
+ break;
}
switch (textPtr->anchor) {
- case TK_ANCHOR_NW:
- case TK_ANCHOR_W:
- case TK_ANCHOR_SW:
- break;
+ case TK_ANCHOR_NW:
+ case TK_ANCHOR_W:
+ case TK_ANCHOR_SW:
+ break;
- case TK_ANCHOR_N:
- case TK_ANCHOR_CENTER:
- case TK_ANCHOR_S:
- leftX -= width / 2;
- break;
+ case TK_ANCHOR_N:
+ case TK_ANCHOR_CENTER:
+ case TK_ANCHOR_S:
+ leftX -= width / 2;
+ break;
- case TK_ANCHOR_NE:
- case TK_ANCHOR_E:
- case TK_ANCHOR_SE:
- leftX -= width;
- break;
+ case TK_ANCHOR_NE:
+ case TK_ANCHOR_E:
+ case TK_ANCHOR_SE:
+ leftX -= width;
+ break;
}
- textPtr->leftEdge = leftX;
+ textPtr->leftEdge = leftX;
textPtr->rightEdge = leftX + width;
/*
- * Last of all, update the bounding box for the item. The item's
- * bounding box includes the bounding box of all its lines, plus
- * an extra fudge factor for the cursor border (which could
- * potentially be quite large).
+ * Last of all, update the bounding box for the item. The item's bounding
+ * box includes the bounding box of all its lines, plus an extra fudge
+ * factor for the cursor border (which could potentially be quite large).
*/
textInfoPtr = textPtr->textInfoPtr;
@@ -698,26 +694,26 @@ ComputeTextBbox(canvas, textPtr)
*
* DisplayCanvText --
*
- * This procedure is invoked to draw a text item in a given
- * drawable.
+ * This function is invoked to draw a text item in a given drawable.
*
* Results:
* None.
*
* Side effects:
- * ItemPtr is drawn in drawable using the transformation
- * information in canvas.
+ * ItemPtr is drawn in drawable using the transformation information in
+ * canvas.
*
*--------------------------------------------------------------
*/
static void
-DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw item. */
- int x, y, width, height; /* Describes region of canvas that must be
+DisplayCanvText(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int x, int y, int width, int height)
+ /* Describes region of canvas that must be
* redisplayed (not used). */
{
TextItem *textPtr;
@@ -749,8 +745,8 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
}
/*
- * If we're stippling, then modify the stipple offset in the GC. Be
- * sure to reset the offset when done, since the GC is supposed to be
+ * If we're stippling, then modify the stipple offset in the GC. Be sure
+ * to reset the offset when done, since the GC is supposed to be
* read-only.
*/
@@ -792,7 +788,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
for (y = yFirst ; y <= yLast; y += height) {
if (y == yLast) {
width = xLast + wLast - x;
- } else {
+ } else {
width = textPtr->rightEdge - textPtr->leftEdge - x;
}
Tk_CanvasDrawableCoords(canvas,
@@ -811,11 +807,11 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
/*
* If the insertion point should be displayed, then draw a special
- * background for the cursor before drawing the text. Note: if
- * we're the cursor item but the cursor is turned off, then redraw
- * background over the area of the cursor. This guarantees that
- * the selection won't make the cursor invisible on mono displays,
- * where both are drawn in the same color.
+ * background for the cursor before drawing the text. Note: if we're the
+ * cursor item but the cursor is turned off, then redraw background over
+ * the area of the cursor. This guarantees that the selection won't make
+ * the cursor invisible on mono displays, where both are drawn in the same
+ * color.
*/
if ((textInfoPtr->focusItemPtr == itemPtr) && (textInfoPtr->gotFocus)) {
@@ -836,11 +832,10 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED);
} else if (textPtr->cursorOffGC != None) {
/*
- * Redraw the background over the area of the cursor,
- * even though the cursor is turned off. This
- * guarantees that the selection won't make the cursor
- * invisible on mono displays, where both may be drawn
- * in the same color.
+ * Redraw the background over the area of the cursor, even
+ * though the cursor is turned off. This guarantees that the
+ * selection won't make the cursor invisible on mono displays,
+ * where both may be drawn in the same color.
*/
XFillRectangle(display, drawable, textPtr->cursorOffGC,
@@ -851,16 +846,14 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
}
}
-
/*
- * If there is no selected text or the selected text foreground
- * is the same as the regular text foreground, then draw one
- * text string. If there is selected text and the foregrounds
- * differ, draw the regular text up to the selection, draw
- * the selection, then draw the rest of the regular text.
- * Drawing the regular text and then the selected text over
- * it would causes problems with anti-aliased text because the
- * two anti-aliasing colors would blend together.
+ * If there is no selected text or the selected text foreground is the
+ * same as the regular text foreground, then draw one text string. If
+ * there is selected text and the foregrounds differ, draw the regular
+ * text up to the selection, draw the selection, then draw the rest of the
+ * regular text. Drawing the regular text and then the selected text over
+ * it would causes problems with anti-aliased text because the two
+ * anti-aliasing colors would blend together.
*/
Tk_CanvasDrawableCoords(canvas, (double) textPtr->leftEdge,
@@ -878,6 +871,8 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
Tk_DrawTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
drawableX, drawableY, 0, -1);
}
+ Tk_UnderlineTextLayout(display, drawable, textPtr->gc, textPtr->textLayout,
+ drawableX, drawableY, textPtr->underline);
if (stipple != None) {
XSetTSOrigin(display, textPtr->gc, 0, 0);
@@ -895,24 +890,23 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
* None.
*
* Side effects:
- * The text in the given item is modified. The cursor and
- * selection positions are also modified to reflect the
- * insertion.
+ * The text in the given item is modified. The cursor and selection
+ * positions are also modified to reflect the insertion.
*
*--------------------------------------------------------------
*/
static void
-TextInsert(canvas, itemPtr, index, string)
- Tk_Canvas canvas; /* Canvas containing text item. */
- 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. */
+TextInsert(
+ Tk_Canvas canvas, /* Canvas containing text item. */
+ 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. */
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteIndex, byteCount, charsAdded;
- char *new, *text;
+ char *newStr, *text;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
string = Tcl_GetStringFromObj((Tcl_Obj *) string, &byteCount);
@@ -931,20 +925,20 @@ TextInsert(canvas, itemPtr, index, string)
return;
}
- new = (char *) ckalloc((unsigned) textPtr->numBytes + byteCount + 1);
- memcpy(new, text, (size_t) byteIndex);
- strcpy(new + byteIndex, string);
- strcpy(new + byteIndex + byteCount, text + byteIndex);
+ newStr = (char *) ckalloc((unsigned) textPtr->numBytes + byteCount + 1);
+ memcpy(newStr, text, (size_t) byteIndex);
+ strcpy(newStr + byteIndex, string);
+ strcpy(newStr + byteIndex + byteCount, text + byteIndex);
ckfree(text);
- textPtr->text = new;
+ textPtr->text = newStr;
charsAdded = Tcl_NumUtfChars(string, byteCount);
textPtr->numChars += charsAdded;
textPtr->numBytes += byteCount;
/*
* Inserting characters invalidates indices such as those for the
- * selection and cursor. Update the indices appropriately.
+ * selection and cursor. Update the indices appropriately.
*/
if (textInfoPtr->selItemPtr == itemPtr) {
@@ -976,25 +970,24 @@ TextInsert(canvas, itemPtr, index, string)
* None.
*
* Side effects:
- * Characters between "first" and "last", inclusive, get
- * deleted from itemPtr, and things like the selection
- * position get updated.
+ * Characters between "first" and "last", inclusive, get deleted from
+ * itemPtr, and things like the selection position get updated.
*
*--------------------------------------------------------------
*/
static void
-TextDeleteChars(canvas, itemPtr, first, last)
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Item in which to delete characters. */
- int first; /* Character index of first character to
+TextDeleteChars(
+ Tk_Canvas canvas, /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr, /* Item in which to delete characters. */
+ int first, /* Character index of first character to
* delete. */
- int last; /* Character index of last character to
- * delete (inclusive). */
+ int last) /* Character index of last character to delete
+ * (inclusive). */
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteIndex, byteCount, charsRemoved;
- char *new, *text;
+ char *newStr, *text;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
text = textPtr->text;
@@ -1012,19 +1005,19 @@ TextDeleteChars(canvas, itemPtr, first, last)
byteIndex = Tcl_UtfAtIndex(text, first) - text;
byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved)
- (text + byteIndex);
-
- new = (char *) ckalloc((unsigned) (textPtr->numBytes + 1 - byteCount));
- memcpy(new, text, (size_t) byteIndex);
- strcpy(new + byteIndex, text + byteIndex + byteCount);
+
+ newStr = (char *) ckalloc((unsigned) (textPtr->numBytes + 1 - byteCount));
+ memcpy(newStr, text, (size_t) byteIndex);
+ strcpy(newStr + byteIndex, text + byteIndex + byteCount);
ckfree(text);
- textPtr->text = new;
+ textPtr->text = newStr;
textPtr->numChars -= charsRemoved;
textPtr->numBytes -= byteCount;
/*
- * Update indexes for the selection and cursor to reflect the
- * renumbering of the remaining characters.
+ * Update indexes for the selection and cursor to reflect the renumbering
+ * of the remaining characters.
*/
if (textInfoPtr->selItemPtr == itemPtr) {
@@ -1066,14 +1059,14 @@ TextDeleteChars(canvas, itemPtr, first, last)
*
* TextToPoint --
*
- * Computes the distance from a given point to a given
- * text item, in canvas units.
+ * Computes the distance from a given point to a given text item, in
+ * canvas units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are pointPtr[0] and pointPtr[1] is inside the text item. If
- * the point isn't inside the text item then the return value
- * is the distance from the point to the text item.
+ * The return value is 0 if the point whose x and y coordinates are
+ * pointPtr[0] and pointPtr[1] is inside the text item. If the point
+ * isn't inside the text item then the return value is the distance from
+ * the point to the text item.
*
* Side effects:
* None.
@@ -1082,10 +1075,10 @@ TextDeleteChars(canvas, itemPtr, first, last)
*/
static double
-TextToPoint(canvas, itemPtr, pointPtr)
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *pointPtr; /* Pointer to x and y coordinates. */
+TextToPoint(
+ Tk_Canvas canvas, /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *pointPtr) /* Pointer to x and y coordinates. */
{
TextItem *textPtr;
Tk_State state = itemPtr->state;
@@ -1095,7 +1088,7 @@ TextToPoint(canvas, itemPtr, pointPtr)
state = ((TkCanvas *)canvas)->canvas_state;
}
textPtr = (TextItem *) itemPtr;
- value = (double) Tk_DistanceToTextLayout(textPtr->textLayout,
+ value = (double) Tk_DistanceToTextLayout(textPtr->textLayout,
(int) pointPtr[0] - textPtr->leftEdge,
(int) pointPtr[1] - textPtr->header.y1);
@@ -1111,14 +1104,13 @@ TextToPoint(canvas, itemPtr, pointPtr)
*
* TextToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangle.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangle.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -1127,12 +1119,12 @@ TextToPoint(canvas, itemPtr, pointPtr)
*/
static int
-TextToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Item to check against rectangle. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
- * area. */
+TextToArea(
+ Tk_Canvas canvas, /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr, /* Item to check against rectangle. */
+ double *rectPtr) /* Pointer to array of four coordinates
+ * (x1,y1,x2,y2) describing rectangular
+ * area. */
{
TextItem *textPtr;
Tk_State state = itemPtr->state;
@@ -1154,26 +1146,27 @@ TextToArea(canvas, itemPtr, rectPtr)
*
* ScaleText --
*
- * This procedure is invoked to rescale a text item.
+ * This function is invoked to rescale a text item.
*
* Results:
* None.
*
* Side effects:
- * Scales the position of the text, but not the size
- * of the font for the text.
+ * Scales the position of the text, but not the size of the font for the
+ * text.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static void
-ScaleText(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing rectangle. */
- Tk_Item *itemPtr; /* Rectangle to be scaled. */
- double originX, originY; /* Origin about which to scale rect. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleText(
+ Tk_Canvas canvas, /* Canvas containing rectangle. */
+ Tk_Item *itemPtr, /* Rectangle to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale rect. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
TextItem *textPtr = (TextItem *) itemPtr;
@@ -1188,25 +1181,24 @@ ScaleText(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* TranslateText --
*
- * This procedure is called to move a text item by a
- * given amount.
+ * This function is called to move a text item by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the text item is offset by (xDelta, yDelta),
- * and the bounding box is updated in the generic part of the
- * item structure.
+ * The position of the text item is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateText(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be moved. */
+TranslateText(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
TextItem *textPtr = (TextItem *) itemPtr;
@@ -1220,14 +1212,13 @@ TranslateText(canvas, itemPtr, deltaX, deltaY)
*
* GetTextIndex --
*
- * Parse an index into a text item and return either its value
- * or an error.
+ * Parse an index into a text item and return either its value or an
+ * error.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the index (into itemPtr) corresponding to
- * string. Otherwise an error message is left in
- * the interp's result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the index (into itemPtr) corresponding to string. Otherwise an
+ * error message is left in the interp's result.
*
* Side effects:
* None.
@@ -1236,18 +1227,19 @@ TranslateText(canvas, itemPtr, deltaX, deltaY)
*/
static int
-GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item for which the index is being
+GetTextIndex(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item for which the index is being
* specified. */
- Tcl_Obj *obj; /* Specification of a particular character
- * in itemPtr's text. */
- int *indexPtr; /* Where to store converted character
+ Tcl_Obj *obj, /* Specification of a particular character in
+ * itemPtr's text. */
+ int *indexPtr) /* Where to store converted character
* index. */
{
TextItem *textPtr = (TextItem *) itemPtr;
- int c, length;
+ int length;
+ int c;
TkCanvas *canvasPtr = (TkCanvas *) canvas;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
char *string = Tcl_GetStringFromObj(obj, &length);
@@ -1256,17 +1248,18 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
if ((c == 'e') && (strncmp(string, "end", (unsigned) length) == 0)) {
*indexPtr = textPtr->numChars;
- } else if ((c=='i') && (strncmp(string, "insert", (unsigned) length)==0)) {
+ } else if ((c == 'i')
+ && (strncmp(string, "insert", (unsigned) length) == 0)) {
*indexPtr = textPtr->insertPos;
- } else if ((c=='s') && (strncmp(string, "sel.first", (unsigned) length)==0)
- && (length >= 5)) {
+ } else if ((c == 's') && (length >= 5)
+ && (strncmp(string, "sel.first", (unsigned) length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetResult(interp, "selection isn't in item", TCL_STATIC);
return TCL_ERROR;
}
*indexPtr = textInfoPtr->selectFirst;
- } else if ((c=='s') && (strncmp(string, "sel.last", (unsigned) length)==0)
- && (length >= 5)) {
+ } else if ((c == 's') && (length >= 5)
+ && (strncmp(string, "sel.last", (unsigned) length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetResult(interp, "selection isn't in item", TCL_STATIC);
return TCL_ERROR;
@@ -1292,7 +1285,7 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
*indexPtr = Tk_PointToChar(textPtr->textLayout,
x + canvasPtr->scrollX1 - textPtr->leftEdge,
y + canvasPtr->scrollY1 - textPtr->header.y1);
- } else if (Tcl_GetIntFromObj((Tcl_Interp *)NULL, obj, indexPtr) == TCL_OK) {
+ } else if (Tcl_GetIntFromObj(NULL, obj, indexPtr) == TCL_OK) {
if (*indexPtr < 0){
*indexPtr = 0;
} else if (*indexPtr > textPtr->numChars) {
@@ -1300,14 +1293,13 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
}
} else {
/*
- * Some of the paths here leave messages in the interp's result,
- * so we have to clear it out before storing our own message.
+ * Some of the paths here leave messages in the interp's result, so we
+ * have to clear it out before storing our own message.
*/
- badIndex:
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad index \"", string, "\"",
- (char *) NULL);
+ badIndex:
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
+ Tcl_AppendResult(interp, "bad index \"", string, "\"", NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -1331,18 +1323,18 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
/* ARGSUSED */
static void
-SetTextCursor(canvas, itemPtr, index)
- Tk_Canvas canvas; /* Record describing canvas widget. */
- Tk_Item *itemPtr; /* Text item in which cursor position is to
- * be set. */
- int index; /* Character index of character just before
+SetTextCursor(
+ Tk_Canvas canvas, /* Record describing canvas widget. */
+ Tk_Item *itemPtr, /* Text item in which cursor position is to be
+ * set. */
+ int index) /* Character index of character just before
* which cursor is to be positioned. */
{
TextItem *textPtr = (TextItem *) itemPtr;
if (index < 0) {
textPtr->insertPos = 0;
- } else if (index > textPtr->numChars) {
+ } else if (index > textPtr->numChars) {
textPtr->insertPos = textPtr->numChars;
} else {
textPtr->insertPos = index;
@@ -1354,15 +1346,14 @@ SetTextCursor(canvas, itemPtr, index)
*
* GetSelText --
*
- * This procedure is invoked to return the selected portion
- * of a text item. It is only called when this item has
- * the selection.
+ * This function is invoked to return the selected portion of a text
+ * item. It is only called when this item has the selection.
*
* Results:
- * The return value is the number of non-NULL bytes stored
- * at buffer. Buffer is filled (or partially filled) with a
- * NULL-terminated string containing part or all of the selection,
- * as given by offset and maxBytes.
+ * The return value is the number of non-NULL bytes stored at buffer.
+ * Buffer is filled (or partially filled) with a NULL-terminated string
+ * containing part or all of the selection, as given by offset and
+ * maxBytes.
*
* Side effects:
* None.
@@ -1371,18 +1362,18 @@ SetTextCursor(canvas, itemPtr, index)
*/
static int
-GetSelText(canvas, itemPtr, offset, buffer, maxBytes)
- Tk_Canvas canvas; /* Canvas containing selection. */
- Tk_Item *itemPtr; /* Text item containing selection. */
- int offset; /* Byte offset within selection of first
+GetSelText(
+ Tk_Canvas canvas, /* Canvas containing selection. */
+ Tk_Item *itemPtr, /* Text item containing selection. */
+ int offset, /* Byte offset within selection of first
* character to be returned. */
- char *buffer; /* Location in which to place selection. */
- int maxBytes; /* Maximum number of bytes to place at
- * buffer, not including terminating NULL
+ char *buffer, /* Location in which to place selection. */
+ int maxBytes) /* Maximum number of bytes to place at buffer,
+ * not including terminating NULL
* character. */
{
TextItem *textPtr = (TextItem *) itemPtr;
- int byteCount;
+ int byteCount;
char *text;
CONST char *selStart, *selEnd;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
@@ -1412,15 +1403,13 @@ GetSelText(canvas, itemPtr, offset, buffer, maxBytes)
*
* TextToPostscript --
*
- * This procedure is called to generate Postscript for
- * text items.
+ * This function is called to generate Postscript for text items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in the interp's result, replacing whatever used
- * to be there. If no error occurs, then Postscript for the
- * item is appended to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in the interp's
+ * result, replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -1429,13 +1418,13 @@ GetSelText(canvas, itemPtr, offset, buffer, maxBytes)
*/
static int
-TextToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is wanted. */
- int prepass; /* 1 means this is a prepass to collect
- * font information; 0 means final Postscript
- * is being created. */
+TextToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
TextItem *textPtr = (TextItem *) itemPtr;
int x, y;
@@ -1446,7 +1435,7 @@ TextToPostscript(interp, canvas, itemPtr, prepass)
Pixmap stipple;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
color = textPtr->color;
@@ -1480,41 +1469,53 @@ TextToPostscript(interp, canvas, itemPtr, prepass)
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "/StippleText {\n ",
- (char *) NULL);
+ Tcl_AppendResult(interp, "/StippleText {\n ", NULL);
Tk_CanvasPsStipple(interp, canvas, stipple);
- Tcl_AppendResult(interp, "} bind def\n", (char *) NULL);
+ Tcl_AppendResult(interp, "} bind def\n", NULL);
}
sprintf(buffer, "%.15g %.15g [\n", textPtr->x,
Tk_CanvasPsY(canvas, textPtr->y));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
Tk_TextLayoutToPostscript(interp, textPtr->textLayout);
x = 0; y = 0; justify = NULL; /* lint. */
switch (textPtr->anchor) {
- case TK_ANCHOR_NW: x = 0; y = 0; break;
- case TK_ANCHOR_N: x = 1; y = 0; break;
- case TK_ANCHOR_NE: x = 2; y = 0; break;
- case TK_ANCHOR_E: x = 2; y = 1; break;
- case TK_ANCHOR_SE: x = 2; y = 2; break;
- case TK_ANCHOR_S: x = 1; y = 2; break;
- case TK_ANCHOR_SW: x = 0; y = 2; break;
- case TK_ANCHOR_W: x = 0; y = 1; break;
- case TK_ANCHOR_CENTER: x = 1; y = 1; break;
+ case TK_ANCHOR_NW: x = 0; y = 0; break;
+ case TK_ANCHOR_N: x = 1; y = 0; break;
+ case TK_ANCHOR_NE: x = 2; y = 0; break;
+ case TK_ANCHOR_E: x = 2; y = 1; break;
+ case TK_ANCHOR_SE: x = 2; y = 2; break;
+ case TK_ANCHOR_S: x = 1; y = 2; break;
+ case TK_ANCHOR_SW: x = 0; y = 2; break;
+ case TK_ANCHOR_W: x = 0; y = 1; break;
+ case TK_ANCHOR_CENTER: x = 1; y = 1; break;
}
switch (textPtr->justify) {
- case TK_JUSTIFY_LEFT: justify = "0"; break;
- case TK_JUSTIFY_CENTER: justify = "0.5";break;
- case TK_JUSTIFY_RIGHT: justify = "1"; break;
+ case TK_JUSTIFY_LEFT: justify = "0"; break;
+ case TK_JUSTIFY_CENTER: justify = "0.5"; break;
+ case TK_JUSTIFY_RIGHT: justify = "1"; break;
}
Tk_GetFontMetrics(textPtr->tkfont, &fm);
- sprintf(buffer, "] %d %g %g %s %s DrawText\n",
- fm.linespace, x / -2.0, y / 2.0, justify,
- ((stipple == None) ? "false" : "true"));
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ 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);
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index 8ad3b5c..eca3789 100644
--- a/generic/tkCanvUtil.c
+++ b/generic/tkCanvUtil.c
@@ -1,29 +1,64 @@
-/*
+/*
* tkCanvUtil.c --
*
- * This procedure contains a collection of utility procedures
- * used by the implementations of various canvas item types.
+ * This file contains a collection of utility functions used by the
+ * implementations of various canvas item types.
*
* Copyright (c) 1994 Sun Microsystems, Inc.
- * Copyright (c) 1994 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkCanvas.h"
-#include "tkPort.h"
#include <assert.h>
+/*
+ * Structures defined only in this file.
+ */
+
+typedef struct SmoothAssocData {
+ struct SmoothAssocData *nextPtr;
+ /* Pointer to next SmoothAssocData. */
+ Tk_SmoothMethod smooth; /* Name and functions associated with this
+ * option. */
+} SmoothAssocData;
+
+Tk_SmoothMethod tkBezierSmoothMethod = {
+ "true",
+ TkMakeBezierCurve,
+ (void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
+ int numPoints, int numSteps)) TkMakeBezierPostscript,
+};
+static Tk_SmoothMethod tkRawSmoothMethod = {
+ "raw",
+ TkMakeRawCurve,
+ (void (*) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr,
+ int numPoints, int numSteps)) TkMakeRawCurvePostscript,
+};
+
+/*
+ * Function forward-declarations.
+ */
+
+static void SmoothMethodCleanupProc(ClientData clientData,
+ Tcl_Interp *interp);
+static SmoothAssocData *InitSmoothMethods(Tcl_Interp *interp);
+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);
+
+#define ABS(a) ((a>=0)?(a):(-(a)))
/*
*----------------------------------------------------------------------
*
* Tk_CanvasTkwin --
*
- * Given a token for a canvas, this procedure returns the
- * widget that represents the canvas.
+ * Given a token for a canvas, this function returns the widget that
+ * represents the canvas.
*
* Results:
* The return value is a handle for the widget.
@@ -35,8 +70,8 @@
*/
Tk_Window
-Tk_CanvasTkwin(canvas)
- Tk_Canvas canvas; /* Token for the canvas. */
+Tk_CanvasTkwin(
+ Tk_Canvas canvas) /* Token for the canvas. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
return canvasPtr->tkwin;
@@ -47,16 +82,15 @@ Tk_CanvasTkwin(canvas)
*
* Tk_CanvasDrawableCoords --
*
- * Given an (x,y) coordinate pair within a canvas, this procedure
+ * Given an (x,y) coordinate pair within a canvas, this function
* returns the corresponding coordinates at which the point should
* be drawn in the drawable used for display.
*
* Results:
- * There is no return value. The values at *drawableXPtr and
- * *drawableYPtr are filled in with the coordinates at which
- * x and y should be drawn. These coordinates are clipped
- * to fit within a "short", since this is what X uses in
- * most cases for drawing.
+ * There is no return value. The values at *drawableXPtr and
+ * *drawableYPtr are filled in with the coordinates at which x and y
+ * should be drawn. These coordinates are clipped to fit within a
+ * "short", since this is what X uses in most cases for drawing.
*
* Side effects:
* None.
@@ -65,11 +99,12 @@ Tk_CanvasTkwin(canvas)
*/
void
-Tk_CanvasDrawableCoords(canvas, x, y, drawableXPtr, drawableYPtr)
- Tk_Canvas canvas; /* Token for the canvas. */
- double x, y; /* Coordinates in canvas space. */
- short *drawableXPtr, *drawableYPtr; /* Screen coordinates are stored
- * here. */
+Tk_CanvasDrawableCoords(
+ Tk_Canvas canvas, /* Token for the canvas. */
+ double x, /* Coordinates in canvas space. */
+ double y,
+ short *drawableXPtr, /* Screen coordinates are stored here. */
+ short *drawableYPtr)
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
double tmp;
@@ -88,7 +123,7 @@ Tk_CanvasDrawableCoords(canvas, x, y, drawableXPtr, drawableYPtr)
*drawableXPtr = (short) tmp;
}
- tmp = y - canvasPtr->drawableYOrigin;
+ tmp = y - canvasPtr->drawableYOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -108,15 +143,14 @@ Tk_CanvasDrawableCoords(canvas, x, y, drawableXPtr, drawableYPtr)
*
* Tk_CanvasWindowCoords --
*
- * Given an (x,y) coordinate pair within a canvas, this procedure
- * returns the corresponding coordinates in the canvas's window.
+ * Given an (x,y) coordinate pair within a canvas, this function returns
+ * the corresponding coordinates in the canvas's window.
*
* Results:
- * There is no return value. The values at *screenXPtr and
- * *screenYPtr are filled in with the coordinates at which
- * (x,y) appears in the canvas's window. These coordinates
- * are clipped to fit within a "short", since this is what X
- * uses in most cases for drawing.
+ * There is no return value. The values at *screenXPtr and *screenYPtr
+ * are filled in with the coordinates at which (x,y) appears in the
+ * canvas's window. These coordinates are clipped to fit within a
+ * "short", since this is what X uses in most cases for drawing.
*
* Side effects:
* None.
@@ -125,11 +159,12 @@ Tk_CanvasDrawableCoords(canvas, x, y, drawableXPtr, drawableYPtr)
*/
void
-Tk_CanvasWindowCoords(canvas, x, y, screenXPtr, screenYPtr)
- Tk_Canvas canvas; /* Token for the canvas. */
- double x, y; /* Coordinates in canvas space. */
- short *screenXPtr, *screenYPtr; /* Screen coordinates are stored
- * here. */
+Tk_CanvasWindowCoords(
+ Tk_Canvas canvas, /* Token for the canvas. */
+ double x, /* Coordinates in canvas space. */
+ double y,
+ short *screenXPtr, /* Screen coordinates are stored here. */
+ short *screenYPtr)
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
double tmp;
@@ -148,7 +183,7 @@ Tk_CanvasWindowCoords(canvas, x, y, screenXPtr, screenYPtr)
*screenXPtr = (short) tmp;
}
- tmp = y - canvasPtr->yOrigin;
+ tmp = y - canvasPtr->yOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -172,11 +207,10 @@ Tk_CanvasWindowCoords(canvas, x, y, screenXPtr, screenYPtr)
* corresponding to that string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * canvas coordinate is stored at *doublePtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the canvas coordinate is
+ * stored at *doublePtr; otherwise TCL_ERROR is returned and an error
+ * message is left in the interp's result.
*
* Side effects:
* None.
@@ -185,14 +219,15 @@ Tk_CanvasWindowCoords(canvas, x, y, screenXPtr, screenYPtr)
*/
int
-Tk_CanvasGetCoord(interp, canvas, string, doublePtr)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to which coordinate applies. */
- CONST char *string; /* Describes coordinate (any screen
- * coordinate form may be used here). */
- double *doublePtr; /* Place to store converted coordinate. */
+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
+ * form may be used here). */
+ double *doublePtr) /* Place to store converted coordinate. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
+
if (Tk_GetScreenMM(canvasPtr->interp, canvasPtr->tkwin, string,
doublePtr) != TCL_OK) {
return TCL_ERROR;
@@ -210,11 +245,10 @@ Tk_CanvasGetCoord(interp, canvas, string, doublePtr)
* corresponding to that string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * canvas coordinate is stored at *doublePtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * interp->result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the canvas coordinate is
+ * stored at *doublePtr; otherwise TCL_ERROR is returned and an error
+ * message is left in interp->result.
*
* Side effects:
* None.
@@ -223,20 +257,16 @@ Tk_CanvasGetCoord(interp, canvas, string, doublePtr)
*/
int
-Tk_CanvasGetCoordFromObj(interp, canvas, obj, doublePtr)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to which coordinate applies. */
- Tcl_Obj *obj; /* Describes coordinate (any screen
- * coordinate form may be used here). */
- double *doublePtr; /* Place to store converted coordinate. */
+Tk_CanvasGetCoordFromObj(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to which coordinate applies. */
+ Tcl_Obj *obj, /* Describes coordinate (any screen coordinate
+ * form may be used here). */
+ double *doublePtr) /* Place to store converted coordinate. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
- if (Tk_GetMMFromObj(canvasPtr->interp, canvasPtr->tkwin, obj,
- doublePtr) != TCL_OK) {
- return TCL_ERROR;
- }
- *doublePtr *= canvasPtr->pixelsPerMM;
- return TCL_OK;
+
+ return Tk_GetDoublePixelsFromObj(canvasPtr->interp, canvasPtr->tkwin, obj, doublePtr);
}
/*
@@ -244,9 +274,9 @@ Tk_CanvasGetCoordFromObj(interp, canvas, obj, doublePtr)
*
* Tk_CanvasSetStippleOrigin --
*
- * This procedure sets the stipple origin in a graphics context
- * so that stipples drawn with the GC will line up with other
- * stipples previously drawn in the canvas.
+ * This function sets the stipple origin in a graphics context so that
+ * stipples drawn with the GC will line up with other stipples previously
+ * drawn in the canvas.
*
* Results:
* None.
@@ -258,12 +288,11 @@ Tk_CanvasGetCoordFromObj(interp, canvas, obj, doublePtr)
*/
void
-Tk_CanvasSetStippleOrigin(canvas, gc)
- Tk_Canvas canvas; /* Token for a canvas. */
- GC gc; /* Graphics context that is about to be
- * used to draw a stippled pattern as
- * part of redisplaying the canvas. */
-
+Tk_CanvasSetStippleOrigin(
+ Tk_Canvas canvas, /* Token for a canvas. */
+ GC gc) /* Graphics context that is about to be used
+ * to draw a stippled pattern as part of
+ * redisplaying the canvas. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
@@ -276,9 +305,9 @@ Tk_CanvasSetStippleOrigin(canvas, gc)
*
* Tk_CanvasSetOffset--
*
- * This procedure sets the stipple offset in a graphics
- * context so that stipples drawn with the GC will
- * line up with other stipples with the same offset.
+ * This function sets the stipple offset in a graphics context so that
+ * stipples drawn with the GC will line up with other stipples with the
+ * same offset.
*
* Results:
* None.
@@ -290,12 +319,12 @@ Tk_CanvasSetStippleOrigin(canvas, gc)
*/
void
-Tk_CanvasSetOffset(canvas, gc, offset)
- Tk_Canvas canvas; /* Token for a canvas. */
- GC gc; /* Graphics context that is about to be
- * used to draw a stippled pattern as
- * part of redisplaying the canvas. */
- Tk_TSOffset *offset; /* offset (may be NULL pointer)*/
+Tk_CanvasSetOffset(
+ Tk_Canvas canvas, /* Token for a canvas. */
+ GC gc, /* Graphics context that is about to be used
+ * to draw a stippled pattern as part of
+ * redisplaying the canvas. */
+ Tk_TSOffset *offset) /* Offset (may be NULL pointer)*/
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
int flags = 0;
@@ -320,17 +349,16 @@ Tk_CanvasSetOffset(canvas, gc, offset)
*
* Tk_CanvasGetTextInfo --
*
- * This procedure returns a pointer to a structure containing
- * information about the selection and insertion cursor for
- * a canvas widget. Items such as text items save the pointer
- * and use it to share access to the information with the generic
- * canvas code.
+ * This function returns a pointer to a structure containing information
+ * about the selection and insertion cursor for a canvas widget. Items
+ * such as text items save the pointer and use it to share access to the
+ * information with the generic canvas code.
*
* Results:
* The return value is a pointer to the structure holding text
- * information for the canvas. Most of the fields should not
- * be modified outside the generic canvas code; see the user
- * documentation for details.
+ * information for the canvas. Most of the fields should not be modified
+ * outside the generic canvas code; see the user documentation for
+ * details.
*
* Side effects:
* None.
@@ -339,8 +367,8 @@ Tk_CanvasSetOffset(canvas, gc, offset)
*/
Tk_CanvasTextInfo *
-Tk_CanvasGetTextInfo(canvas)
- Tk_Canvas canvas; /* Token for the canvas widget. */
+Tk_CanvasGetTextInfo(
+ Tk_Canvas canvas) /* Token for the canvas widget. */
{
return &((TkCanvas *) canvas)->textInfo;
}
@@ -350,28 +378,27 @@ Tk_CanvasGetTextInfo(canvas)
*
* Tk_CanvasTagsParseProc --
*
- * This procedure is invoked during option processing to handle
- * "-tags" options for canvas items.
+ * This function is invoked during option processing to handle "-tags"
+ * options for canvas items.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * The tags for a given item get replaced by those indicated
- * in the value argument.
+ * The tags for a given item get replaced by those indicated in the value
+ * argument.
*
*--------------------------------------------------------------
*/
int
-Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset)
- ClientData clientData; /* Not used.*/
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- CONST char *value; /* Value of option (list of tag
- * names). */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item (ignored). */
+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). */
+ char *widgRec, /* Pointer to record for item. */
+ int offset) /* Offset into item (ignored). */
{
register Tk_Item *itemPtr = (Tk_Item *) widgRec;
int argc, i;
@@ -387,8 +414,7 @@ Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset)
}
/*
- * Make sure that there's enough space in the item to hold the
- * tag names.
+ * Make sure that there's enough space in the item to hold the tag names.
*/
if (itemPtr->tagSpace < argc) {
@@ -415,16 +441,16 @@ Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset)
*
* Tk_CanvasTagsPrintProc --
*
- * This procedure is invoked by the Tk configuration code
- * to produce a printable string for the "-tags" configuration
- * option for canvas items.
+ * This function is invoked by the Tk configuration code to produce a
+ * printable string for the "-tags" configuration option for canvas
+ * items.
*
* Results:
- * The return value is a string describing all the tags for
- * the item referred to by "widgRec". In addition, *freeProcPtr
- * is filled in with the address of a procedure to call to free
- * the result string when it's no longer needed (or NULL to
- * indicate that the string doesn't need to be freed).
+ * The return value is a string describing all the tags for the item
+ * referred to by "widgRec". In addition, *freeProcPtr is filled in with
+ * the address of a function to call to free the result string when it's
+ * no longer needed (or NULL to indicate that the string doesn't need to
+ * be freed).
*
* Side effects:
* None.
@@ -433,61 +459,55 @@ Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset)
*/
char *
-Tk_CanvasTagsPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
- ClientData clientData; /* Ignored. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Ignored. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to variable to fill in with
- * information about how to reclaim
- * storage for return string. */
+Tk_CanvasTagsPrintProc(
+ ClientData clientData, /* Ignored. */
+ Tk_Window tkwin, /* Window containing canvas widget. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset, /* Ignored. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
+ * information about how to reclaim storage
+ * for return string. */
{
register Tk_Item *itemPtr = (Tk_Item *) widgRec;
if (itemPtr->numTags == 0) {
- *freeProcPtr = (Tcl_FreeProc *) NULL;
+ *freeProcPtr = NULL;
return "";
}
if (itemPtr->numTags == 1) {
- *freeProcPtr = (Tcl_FreeProc *) NULL;
+ *freeProcPtr = NULL;
return (char *) itemPtr->tagPtr[0];
}
*freeProcPtr = TCL_DYNAMIC;
return Tcl_Merge(itemPtr->numTags, (CONST char **) itemPtr->tagPtr);
}
-
-static int DashConvert _ANSI_ARGS_((char *l, CONST char *p,
- int n, double width));
-#define ABS(a) ((a>=0)?(a):(-(a)))
-
/*
*--------------------------------------------------------------
*
* TkCanvasDashParseProc --
*
- * This procedure is invoked during option processing to handle
- * "-dash", "-activedash" and "-disableddash" options for canvas
- * objects.
+ * This function is invoked during option processing to handle "-dash",
+ * "-activedash" and "-disableddash" options for canvas objects.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * The dash list for a given canvas object gets replaced by
- * those indicated in the value argument.
+ * The dash list for a given canvas object gets replaced by those
+ * indicated in the value argument.
*
*--------------------------------------------------------------
*/
int
-TkCanvasDashParseProc(clientData, interp, tkwin, value, widgRec, offset)
- ClientData clientData; /* Not used.*/
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- CONST char *value; /* Value of option. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
+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. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset) /* Offset into item. */
{
return Tk_GetDash(interp, value, (Tk_Dash *)(widgRec+offset));
}
@@ -497,16 +517,16 @@ TkCanvasDashParseProc(clientData, interp, tkwin, value, widgRec, offset)
*
* TkCanvasDashPrintProc --
*
- * This procedure is invoked by the Tk configuration code
- * to produce a printable string for the "-dash", "-activedash"
- * and "-disableddash" configuration options for canvas items.
+ * This function is invoked by the Tk configuration code to produce a
+ * printable string for the "-dash", "-activedash" and "-disableddash"
+ * configuration options for canvas items.
*
* Results:
- * The return value is a string describing all the dash list for
- * the item referred to by "widgRec"and "offset". In addition,
- * *freeProcPtr is filled in with the address of a procedure to
- * call to free the result string when it's no longer needed (or
- * NULL to indicate that the string doesn't need to be freed).
+ * The return value is a string describing all the dash list for the item
+ * referred to by "widgRec"and "offset". In addition, *freeProcPtr is
+ * filled in with the address of a function to call to free the result
+ * string when it's no longer needed (or NULL to indicate that the string
+ * doesn't need to be freed).
*
* Side effects:
* None.
@@ -515,14 +535,14 @@ TkCanvasDashParseProc(clientData, interp, tkwin, value, widgRec, offset)
*/
char *
-TkCanvasDashPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
- ClientData clientData; /* Ignored. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset in record for item. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to variable to fill in with
- * information about how to reclaim
- * storage for return string. */
+TkCanvasDashPrintProc(
+ ClientData clientData, /* Ignored. */
+ Tk_Window tkwin, /* Window containing canvas widget. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset, /* Offset in record for item. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
+ * information about how to reclaim storage
+ * for return string. */
{
Tk_Dash *dash = (Tk_Dash *) (widgRec+offset);
char *buffer;
@@ -533,18 +553,18 @@ TkCanvasDashPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
i = -i;
*freeProcPtr = TCL_DYNAMIC;
buffer = (char *) ckalloc((unsigned int) (i+1));
- p = (i > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
+ p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
memcpy(buffer, p, (unsigned int) i);
buffer[i] = 0;
return buffer;
} else if (!i) {
- *freeProcPtr = (Tcl_FreeProc *) NULL;
+ *freeProcPtr = NULL;
return "";
}
buffer = (char *)ckalloc((unsigned int) (4*i));
*freeProcPtr = TCL_DYNAMIC;
- p = (i > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
+ p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
sprintf(buffer, "%d", *p++ & 0xff);
while(--i) {
sprintf(buffer+strlen(buffer), " %d", *p++ & 0xff);
@@ -555,46 +575,80 @@ TkCanvasDashPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
/*
*--------------------------------------------------------------
*
- * Tk_CreateSmoothMethod --
+ * InitSmoothMethods --
*
- * This procedure is invoked to add additional values
- * for the "-smooth" option to the list.
+ * This function is invoked to set up the initial state of the list of
+ * "-smooth" methods. It should only be called when the list installed
+ * in the interpreter is NULL.
*
* Results:
- * A standard Tcl return value.
+ * Pointer to the start of the list of default smooth methods.
*
* Side effects:
- * In the future "-smooth <name>" will be accepted as
- * smooth method for the line and polygon.
+ * A linked list of smooth methods is created and attached to the
+ * interpreter's association key "smoothMethod"
*
*--------------------------------------------------------------
*/
-Tk_SmoothMethod tkBezierSmoothMethod = {
- "bezier",
- TkMakeBezierCurve,
- (void (*) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
- double *coordPtr, int numPoints, int numSteps)))
- TkMakeBezierPostscript,
-};
+static SmoothAssocData *
+InitSmoothMethods(
+ Tcl_Interp *interp)
+{
+ SmoothAssocData *methods, *ptr;
-static void SmoothMethodCleanupProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp));
+ methods = (SmoothAssocData *) ckalloc(sizeof(SmoothAssocData));
+ methods->smooth.name = tkRawSmoothMethod.name;
+ methods->smooth.coordProc = tkRawSmoothMethod.coordProc;
+ methods->smooth.postscriptProc = tkRawSmoothMethod.postscriptProc;
-typedef struct SmoothAssocData {
- struct SmoothAssocData *nextPtr; /* pointer to next SmoothAssocData */
- Tk_SmoothMethod smooth; /* name and functions associated with this
- * option */
-} SmoothAssocData;
+ methods->nextPtr = (SmoothAssocData *) ckalloc(sizeof(SmoothAssocData));
+
+ ptr = methods->nextPtr;
+ 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);
+ return methods;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_CreateSmoothMethod --
+ *
+ * This function is invoked to add additional values for the "-smooth"
+ * option to the list.
+ *
+ * Results:
+ * A standard Tcl return value.
+ *
+ * Side effects:
+ * In the future "-smooth <name>" will be accepted as smooth method for
+ * the line and polygon.
+ *
+ *--------------------------------------------------------------
+ */
void
-Tk_CreateSmoothMethod(interp, smooth)
- Tcl_Interp *interp;
- Tk_SmoothMethod *smooth;
+Tk_CreateSmoothMethod(
+ Tcl_Interp *interp,
+ Tk_SmoothMethod *smooth)
{
SmoothAssocData *methods, *typePtr2, *prevPtr, *ptr;
methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod",
- (Tcl_InterpDeleteProc **) NULL);
+ NULL);
+
+ /*
+ * Initialize if we were not previously initialized.
+ */
+
+ if (methods == NULL) {
+ methods = InitSmoothMethods(interp);
+ }
/*
* If there's already a smooth method with the given name, remove it.
@@ -618,15 +672,16 @@ Tk_CreateSmoothMethod(interp, smooth)
ptr->smooth.postscriptProc = smooth->postscriptProc;
ptr->nextPtr = methods;
Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc,
- (ClientData) ptr);
+ (ClientData) ptr);
}
+
/*
*----------------------------------------------------------------------
*
* SmoothMethodCleanupProc --
*
- * This procedure is invoked whenever an interpreter is deleted
- * to cleanup the smooth methods.
+ * This function is invoked whenever an interpreter is deleted to
+ * cleanup the smooth methods.
*
* Results:
* None.
@@ -638,10 +693,10 @@ Tk_CreateSmoothMethod(interp, smooth)
*/
static void
-SmoothMethodCleanupProc(clientData, interp)
- ClientData clientData; /* Points to "smoothMethod" AssocData
- * for the interpreter. */
- Tcl_Interp *interp; /* Interpreter that is being deleted. */
+SmoothMethodCleanupProc(
+ ClientData clientData, /* Points to "smoothMethod" AssocData for the
+ * interpreter. */
+ Tcl_Interp *interp) /* Interpreter that is being deleted. */
{
SmoothAssocData *ptr, *methods = (SmoothAssocData *) clientData;
@@ -655,8 +710,8 @@ SmoothMethodCleanupProc(clientData, interp)
*
* TkSmoothParseProc --
*
- * This procedure is invoked during option processing to handle
- * the "-smooth" option.
+ * This function is invoked during option processing to handle the
+ * "-smooth" option.
*
* Results:
* A standard Tcl return value.
@@ -669,33 +724,54 @@ SmoothMethodCleanupProc(clientData, interp)
*/
int
-TkSmoothParseProc(clientData, interp, tkwin, value, widgRec, offset)
- ClientData clientData; /* some flags.*/
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- CONST char *value; /* Value of option. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
+TkSmoothParseProc(
+ ClientData clientData, /* some flags.*/
+ Tcl_Interp *interp, /* Used for reporting errors. */
+ Tk_Window tkwin, /* Window containing canvas widget. */
+ 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 **) (widgRec + offset);
Tk_SmoothMethod *smooth = NULL;
int b;
size_t length;
SmoothAssocData *methods;
if (value == NULL || *value == 0) {
- *smoothPtr = (Tk_SmoothMethod *) NULL;
+ *smoothPtr = NULL;
return TCL_OK;
}
length = strlen(value);
methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod",
- (Tcl_InterpDeleteProc **) NULL);
- while (methods != (SmoothAssocData *) NULL) {
+ NULL);
+
+ /*
+ * Not initialized yet; fix that now.
+ */
+
+ if (methods == NULL) {
+ methods = InitSmoothMethods(interp);
+ }
+
+ /*
+ * Backward compatability hack.
+ */
+
+ if (strncmp(value, "bezier", length) == 0) {
+ smooth = &tkBezierSmoothMethod;
+ }
+
+ /*
+ * Search the list of installed smooth methods.
+ */
+
+ while (methods != NULL) {
if (strncmp(value, methods->smooth.name, length) == 0) {
- if (smooth != (Tk_SmoothMethod *) NULL) {
- Tcl_AppendResult(interp, "ambigeous smooth method \"", value,
- "\"", (char *) NULL);
+ if (smooth != NULL) {
+ Tcl_AppendResult(interp, "ambiguous smooth method \"", value,
+ "\"", NULL);
return TCL_ERROR;
}
smooth = &methods->smooth;
@@ -705,19 +781,16 @@ TkSmoothParseProc(clientData, interp, tkwin, value, widgRec, offset)
if (smooth) {
*smoothPtr = smooth;
return TCL_OK;
- } else if (strncmp(value, tkBezierSmoothMethod.name, length) == 0) {
- /*
- * We need to do handle the built-in bezier method.
- */
- *smoothPtr = &tkBezierSmoothMethod;
- return TCL_OK;
}
+ /*
+ * Did not find it. Try parsing as a boolean instead.
+ */
if (Tcl_GetBoolean(interp, (char *) value, &b) != TCL_OK) {
return TCL_ERROR;
}
- *smoothPtr = b ? &tkBezierSmoothMethod : (Tk_SmoothMethod*) NULL;
+ *smoothPtr = b ? &tkBezierSmoothMethod : NULL;
return TCL_OK;
}
/*
@@ -725,16 +798,15 @@ TkSmoothParseProc(clientData, interp, tkwin, value, widgRec, offset)
*
* TkSmoothPrintProc --
*
- * This procedure is invoked by the Tk configuration code
- * to produce a printable string for the "-smooth"
- * configuration option.
+ * This function is invoked by the Tk configuration code to produce a
+ * printable string for the "-smooth" configuration option.
*
* Results:
- * The return value is a string describing the smooth option for
- * the item referred to by "widgRec". In addition, *freeProcPtr
- * is filled in with the address of a procedure to call to free
- * the result string when it's no longer needed (or NULL to
- * indicate that the string doesn't need to be freed).
+ * The return value is a string describing the smooth option for the item
+ * referred to by "widgRec". In addition, *freeProcPtr is filled in with
+ * the address of a function to call to free the result string when it's
+ * no longer needed (or NULL to indicate that the string doesn't need to
+ * be freed).
*
* Side effects:
* None.
@@ -743,16 +815,17 @@ TkSmoothParseProc(clientData, interp, tkwin, value, widgRec, offset)
*/
char *
-TkSmoothPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
- ClientData clientData; /* Ignored. */
- Tk_Window tkwin; /* Window containing canvas widget. */
- char *widgRec; /* Pointer to record for item. */
- int offset; /* Offset into item. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to variable to fill in with
- * information about how to reclaim
- * storage for return string. */
+TkSmoothPrintProc(
+ ClientData clientData, /* Ignored. */
+ Tk_Window tkwin, /* Window containing canvas widget. */
+ char *widgRec, /* Pointer to record for item. */
+ int offset, /* Offset into item. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with
+ * information about how to reclaim storage
+ * for return string. */
{
- register Tk_SmoothMethod **smoothPtr = (Tk_SmoothMethod **) (widgRec + offset);
+ register Tk_SmoothMethod **smoothPtr =
+ (Tk_SmoothMethod **) (widgRec + offset);
return (*smoothPtr) ? (*smoothPtr)->name : "0";
}
@@ -761,13 +834,12 @@ TkSmoothPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
*
* Tk_GetDash
*
- * This procedure is used to parse a string, assuming
- * it is dash information.
+ * This function is used to parse a string, assuming it is dash
+ * information.
*
* Results:
- * The return value is a standard Tcl result: TCL_OK means
- * that the dash information was parsed ok, and
- * TCL_ERROR means it couldn't be parsed.
+ * The return value is a standard Tcl result: TCL_OK means that the dash
+ * information was parsed ok, and TCL_ERROR means it couldn't be parsed.
*
* Side effects:
* Dash information in the dash structure is updated.
@@ -776,29 +848,34 @@ TkSmoothPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
*/
int
-Tk_GetDash(interp, value, dash)
- Tcl_Interp *interp; /* Used for error reporting. */
- CONST char *value; /* Textual specification of dash list. */
- Tk_Dash *dash; /* Pointer to record in which to
- * store dash information. */
+Tk_GetDash(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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;
char *pt;
- if ((value==(char *) NULL) || (*value==0) ) {
+ if ((value==NULL) || (*value==0) ) {
dash->number = 0;
return TCL_OK;
}
- if ((*value == '.') || (*value == ',') ||
- (*value == '-') || (*value == '_')) {
- i = DashConvert((char *) NULL, value, -1, 0.0);
+
+ /*
+ * switch is usually compiled more efficiently than a chain of conditions.
+ */
+
+ switch (*value) {
+ case '.': case ',': case '-': case '_':
+ i = DashConvert(NULL, value, -1, 0.0);
if (i>0) {
i = strlen(value);
} else {
goto badDashList;
}
- if (i > sizeof(char *)) {
+ if (i > (int)sizeof(char *)) {
dash->pattern.pt = pt = (char *) ckalloc(strlen(value));
} else {
pt = dash->pattern.array;
@@ -807,26 +884,16 @@ Tk_GetDash(interp, value, dash)
dash->number = -i;
return TCL_OK;
}
+
if (Tcl_SplitList(interp, (char *) value, &argc, &argv) != TCL_OK) {
Tcl_ResetResult(interp);
- badDashList:
- Tcl_AppendResult(interp, "bad dash list \"", value,
- "\": must be a list of integers or a format like \"-..\"",
- (char *) NULL);
- syntaxError:
- if (argv != NULL) {
- ckfree((char *) argv);
- }
- if (ABS(dash->number) > sizeof(char *))
- ckfree((char *) dash->pattern.pt);
- dash->number = 0;
- return TCL_ERROR;
+ goto badDashList;
}
- if (ABS(dash->number) > sizeof(char *)) {
+ if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
ckfree((char *) dash->pattern.pt);
}
- if (argc > sizeof(char *)) {
+ if (argc > (int)sizeof(char *)) {
dash->pattern.pt = pt = (char *) ckalloc((unsigned int) argc);
} else {
pt = dash->pattern.array;
@@ -834,23 +901,41 @@ Tk_GetDash(interp, value, dash)
dash->number = argc;
largv = argv;
- while(argc>0) {
- if (Tcl_GetInt(interp, *largv, &i) != TCL_OK ||
- i < 1 || i>255) {
+ while (argc>0) {
+ if (Tcl_GetInt(interp, *largv, &i) != TCL_OK || i < 1 || i>255) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "expected integer in the range 1..255 but got \"",
- *largv, "\"", (char *) NULL);
+ Tcl_AppendResult(interp,
+ "expected integer in the range 1..255 but got \"",
+ *largv, "\"", NULL);
goto syntaxError;
}
*pt++ = i;
- argc--; largv++;
+ argc--;
+ largv++;
}
-
+
if (argv != NULL) {
ckfree((char *) argv);
}
-
return TCL_OK;
+
+ /*
+ * Something went wrong. Generate error message, clean up and return.
+ */
+
+ badDashList:
+ Tcl_AppendResult(interp, "bad dash list \"", value,
+ "\": must be a list of integers or a format like \"-..\"",
+ NULL);
+ syntaxError:
+ if (argv != NULL) {
+ ckfree((char *) argv);
+ }
+ if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
+ ckfree((char *) dash->pattern.pt);
+ }
+ dash->number = 0;
+ return TCL_ERROR;
}
/*
@@ -858,8 +943,8 @@ Tk_GetDash(interp, value, dash)
*
* Tk_CreateOutline
*
- * This procedure initializes the Tk_Outline structure
- * with default values.
+ * This function initializes the Tk_Outline structure with default
+ * values.
*
* Results:
* None
@@ -870,8 +955,9 @@ Tk_GetDash(interp, value, dash)
*--------------------------------------------------------------
*/
-void Tk_CreateOutline(outline)
- Tk_Outline *outline;
+void
+Tk_CreateOutline(
+ Tk_Outline *outline) /* Outline structure to be filled in. */
{
outline->gc = None;
outline->width = 1.0;
@@ -897,8 +983,8 @@ void Tk_CreateOutline(outline)
*
* Tk_DeleteOutline
*
- * This procedure frees all memory that might be
- * allocated and referenced in the Tk_Outline structure.
+ * This function frees all memory that might be allocated and referenced
+ * in the Tk_Outline structure.
*
* Results:
* None
@@ -909,20 +995,21 @@ void Tk_CreateOutline(outline)
*--------------------------------------------------------------
*/
-void Tk_DeleteOutline(display, outline)
- Display *display; /* Display containing window */
- Tk_Outline *outline;
+void
+Tk_DeleteOutline(
+ Display *display, /* Display containing window. */
+ Tk_Outline *outline)
{
if (outline->gc != None) {
Tk_FreeGC(display, outline->gc);
}
- if (ABS(outline->dash.number) > sizeof(char *)) {
+ if ((unsigned int)ABS(outline->dash.number) > sizeof(char *)) {
ckfree((char *) outline->dash.pattern.pt);
}
- if (ABS(outline->activeDash.number) > sizeof(char *)) {
+ if ((unsigned int)ABS(outline->activeDash.number) > sizeof(char *)) {
ckfree((char *) outline->activeDash.pattern.pt);
}
- if (ABS(outline->disabledDash.number) > sizeof(char *)) {
+ if ((unsigned int)ABS(outline->disabledDash.number) > sizeof(char *)) {
ckfree((char *) outline->disabledDash.pattern.pt);
}
if (outline->color != NULL) {
@@ -950,15 +1037,14 @@ void Tk_DeleteOutline(display, outline)
*
* Tk_ConfigOutlineGC
*
- * This procedure should be called in the canvas object
- * during the configure command. The graphics context
- * description in gcValues is updated according to the
- * information in the dash structure, as far as possible.
+ * This function should be called in the canvas object during the
+ * configure command. The graphics context description in gcValues is
+ * updated according to the information in the dash structure, as far as
+ * possible.
*
* Results:
- * The return-value is a mask, indicating which
- * elements of gcValues have been updated.
- * 0 means there is no outline.
+ * The return-value is a mask, indicating which elements of gcValues have
+ * been updated. 0 means there is no outline.
*
* Side effects:
* GC information in gcValues is updated.
@@ -966,11 +1052,12 @@ void Tk_DeleteOutline(display, outline)
*--------------------------------------------------------------
*/
-int Tk_ConfigOutlineGC(gcValues, canvas, item, outline)
- XGCValues *gcValues;
- Tk_Canvas canvas;
- Tk_Item *item;
- Tk_Outline *outline;
+int
+Tk_ConfigOutlineGC(
+ XGCValues *gcValues,
+ Tk_Canvas canvas,
+ Tk_Item *item,
+ Tk_Outline *outline)
{
int mask = 0;
double width;
@@ -1015,7 +1102,7 @@ int Tk_ConfigOutlineGC(gcValues, canvas, item, outline)
if (outline->activeStipple!=None) {
stipple = outline->activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>0) {
width = outline->disabledWidth;
}
@@ -1047,12 +1134,10 @@ int Tk_ConfigOutlineGC(gcValues, canvas, item, outline)
if (mask && (dash->number != 0)) {
gcValues->line_style = LineOnOffDash;
gcValues->dash_offset = outline->offset;
- if (dash->number >= 2) {
- gcValues->dashes = 4;
- } else if (dash->number > 0) {
+ if (dash->number > 0) {
gcValues->dashes = dash->pattern.array[0];
} else {
- gcValues->dashes = (char) (4 * width);
+ gcValues->dashes = (char) (4 * width + 0.5);
}
mask |= GCLineStyle|GCDashList|GCDashOffset;
}
@@ -1064,15 +1149,12 @@ int Tk_ConfigOutlineGC(gcValues, canvas, item, outline)
*
* Tk_ChangeOutlineGC
*
- * Updates the GC to represent the full information of
- * the dash structure. Partly this is already done in
- * Tk_ConfigOutlineGC().
- * This function should be called just before drawing
- * the dashed item.
+ * Updates the GC to represent the full information of the dash
+ * structure. Partly this is already done in Tk_ConfigOutlineGC(). This
+ * function should be called just before drawing the dashed item.
*
* Results:
- * 1 if there is a stipple pattern.
- * 0 otherwise.
+ * 1 if there is a stipple pattern, and 0 otherwise.
*
* Side effects:
* GC is updated.
@@ -1081,10 +1163,10 @@ int Tk_ConfigOutlineGC(gcValues, canvas, item, outline)
*/
int
-Tk_ChangeOutlineGC(canvas, item, outline)
- Tk_Canvas canvas;
- Tk_Item *item;
- Tk_Outline *outline;
+Tk_ChangeOutlineGC(
+ Tk_Canvas canvas,
+ Tk_Item *item,
+ Tk_Outline *outline)
{
CONST char *p;
double width;
@@ -1134,25 +1216,30 @@ Tk_ChangeOutlineGC(canvas, item, outline)
return 0;
}
- if ((dash->number<-1) || ((dash->number == -1) && (dash->pattern.array[1]!=','))) {
+ if ((dash->number<-1) ||
+ ((dash->number == -1) && (dash->pattern.array[0] != ','))) {
char *q;
int i = -dash->number;
- p = (i > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
+ p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
q = (char *) ckalloc(2*(unsigned int)i);
i = DashConvert(q, p, i, width);
- XSetDashes(((TkCanvas *)canvas)->display, outline->gc, outline->offset, q, i);
+ XSetDashes(((TkCanvas *)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 = (char *) (dash->number > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array;
- XSetDashes(((TkCanvas *)canvas)->display, outline->gc, outline->offset, p, dash->number);
+ } else if (dash->number>2 || (dash->number==2 &&
+ (dash->pattern.array[0]!=dash->pattern.array[1]))) {
+ p = (dash->number > (int)sizeof(char *))
+ ? dash->pattern.pt : dash->pattern.array;
+ XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
+ outline->offset, p, dash->number);
}
if (stipple!=None) {
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))) {
+ if (!(flags & TK_OFFSET_INDEX) &&
+ (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) {
Tk_SizeOfBitmap(((TkCanvas *)canvas)->display, stipple, &w, &h);
if (flags & TK_OFFSET_CENTER) {
w /= 2;
@@ -1181,26 +1268,24 @@ Tk_ChangeOutlineGC(canvas, item, outline)
*
* Tk_ResetOutlineGC
*
- * Restores the GC to the situation before
- * Tk_ChangeDashGC() was called.
- * This function should be called just after the dashed
- * item is drawn, because the GC is supposed to be
- * read-only.
+ * Restores the GC to the situation before Tk_ChangeDashGC() was called.
+ * This function should be called just after the dashed item is drawn,
+ * because the GC is supposed to be read-only.
*
* Results:
- * 1 if there is a stipple pattern.
- * 0 otherwise.
+ * 1 if there is a stipple pattern, and 0 otherwise.
*
* Side effects:
* GC is updated.
*
*--------------------------------------------------------------
*/
+
int
-Tk_ResetOutlineGC(canvas, item, outline)
- Tk_Canvas canvas;
- Tk_Item *item;
- Tk_Outline *outline;
+Tk_ResetOutlineGC(
+ Tk_Canvas canvas,
+ Tk_Item *item,
+ Tk_Outline *outline)
{
char dashList;
double width;
@@ -1232,7 +1317,7 @@ Tk_ResetOutlineGC(canvas, item, outline)
if (outline->activeStipple!=None) {
stipple = outline->activeStipple;
}
- } else if (state==TK_STATE_DISABLED) {
+ } else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>width) {
width = outline->disabledWidth;
}
@@ -1251,14 +1336,12 @@ Tk_ResetOutlineGC(canvas, item, outline)
}
if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 &&
- (dash->pattern.array[0] != dash->pattern.array[1])) ||
- ((dash->number == -1) && (dash->pattern.array[1] != ','))) {
- if (dash->number < 0) {
- dashList = (int) (4 * width + 0.5);
- } else if (dash->number<3) {
+ (dash->pattern.array[0] != dash->pattern.array[1])) ||
+ ((dash->number == -1) && (dash->pattern.array[0] != ','))) {
+ if (dash->number > 0) {
dashList = dash->pattern.array[0];
} else {
- dashList = 4;
+ dashList = (char) (4 * width + 0.5);
}
XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
outline->offset, &dashList , 1);
@@ -1269,30 +1352,30 @@ Tk_ResetOutlineGC(canvas, item, outline)
}
return 0;
}
-
/*
*--------------------------------------------------------------
*
* Tk_CanvasPsOutline
*
- * Creates the postscript command for the correct
- * Outline-information (width, dash, color and stipple).
+ * Creates the postscript command for the correct Outline-information
+ * (width, dash, color and stipple).
*
* Results:
* TCL_OK if succeeded, otherwise TCL_ERROR.
*
* Side effects:
- * canvas->interp->result contains the postscript string,
- * or an error message if the result was TCL_ERROR.
+ * canvas->interp->result contains the postscript string, or an error
+ * message if the result was TCL_ERROR.
*
*--------------------------------------------------------------
*/
+
int
-Tk_CanvasPsOutline(canvas, item, outline)
- Tk_Canvas canvas;
- Tk_Item *item;
- Tk_Outline *outline;
+Tk_CanvasPsOutline(
+ Tk_Canvas canvas,
+ Tk_Item *item,
+ Tk_Outline *outline)
{
char string[41];
char pattern[11];
@@ -1314,6 +1397,7 @@ Tk_CanvasPsOutline(canvas, item, outline)
if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
+
if (((TkCanvas *)canvas)->currentItemPtr == item) {
if (outline->activeWidth > width) {
width = outline->activeWidth;
@@ -1342,7 +1426,7 @@ Tk_CanvasPsOutline(canvas, item, outline)
}
}
sprintf(string, "%.15g setlinewidth\n", width);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
if (dash->number > 10) {
str = (char *)ckalloc((unsigned int) (1 + 4*dash->number));
@@ -1350,38 +1434,40 @@ Tk_CanvasPsOutline(canvas, item, outline)
str = (char *)ckalloc((unsigned int) (1 - 8*dash->number));
lptr = (char *)ckalloc((unsigned int) (1 - 2*dash->number));
}
- ptr = (char *) ((ABS(dash->number) > sizeof(char *)) ) ?
- dash->pattern.pt : dash->pattern.array;
+ ptr = ((unsigned int)ABS(dash->number) > sizeof(char *)) ?
+ dash->pattern.pt : dash->pattern.array;
if (dash->number > 0) {
char *ptr0 = ptr;
+
sprintf(str, "[%d", *ptr++ & 0xff);
i = dash->number-1;
while (i--) {
sprintf(str+strlen(str), " %d", *ptr++ & 0xff);
}
- Tcl_AppendResult(interp, str, (char *)NULL);
+ Tcl_AppendResult(interp, str, NULL);
if (dash->number&1) {
- Tcl_AppendResult(interp, " ", str+1, (char *)NULL);
+ Tcl_AppendResult(interp, " ", str+1, NULL);
}
sprintf(str, "] %d setdash\n", outline->offset);
- Tcl_AppendResult(interp, str, (char *)NULL);
+ Tcl_AppendResult(interp, str, NULL);
ptr = ptr0;
} else if (dash->number < 0) {
if ((i = DashConvert(lptr, ptr, -dash->number, width)) != 0) {
char *lptr0 = lptr;
+
sprintf(str, "[%d", *lptr++ & 0xff);
while (--i) {
sprintf(str+strlen(str), " %d", *lptr++ & 0xff);
}
- Tcl_AppendResult(interp, str, (char *)NULL);
+ Tcl_AppendResult(interp, str, NULL);
sprintf(str, "] %d setdash\n", outline->offset);
- Tcl_AppendResult(interp, str, (char *)NULL);
+ Tcl_AppendResult(interp, str, NULL);
lptr = lptr0;
} else {
- Tcl_AppendResult(interp, "[] 0 setdash\n", (char *)NULL);
+ Tcl_AppendResult(interp, "[] 0 setdash\n", NULL);
}
} else {
- Tcl_AppendResult(interp, "[] 0 setdash\n", (char *)NULL);
+ Tcl_AppendResult(interp, "[] 0 setdash\n", NULL);
}
if (str != string) {
ckfree(str);
@@ -1393,32 +1479,28 @@ Tk_CanvasPsOutline(canvas, item, outline)
return TCL_ERROR;
}
if (stipple != None) {
- Tcl_AppendResult(interp, "StrokeClip ", (char *) NULL);
+ Tcl_AppendResult(interp, "StrokeClip ", NULL);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;
}
} else {
- Tcl_AppendResult(interp, "stroke\n", (char *) NULL);
+ Tcl_AppendResult(interp, "stroke\n", NULL);
}
return TCL_OK;
}
-
/*
*--------------------------------------------------------------
*
* DashConvert
*
- * Converts a character-like dash-list (e.g. "-..")
- * into an X11-style. l must point to a string that
- * holds room to at least 2*n characters. if
- * l == NULL, this function can be used for
- * syntax checking only.
+ * Converts a character-like dash-list (e.g. "-..") into an X11-style. l
+ * must point to a string that holds room to at least 2*n characters. If
+ * l == NULL, this function can be used for syntax checking only.
*
* Results:
- * The length of the resulting X11 compatible
- * dash-list. -1 if failed.
+ * The length of the resulting X11 compatible dash-list. -1 if failed.
*
* Side effects:
* None
@@ -1427,11 +1509,13 @@ Tk_CanvasPsOutline(canvas, item, outline)
*/
static int
-DashConvert (l, p, n, width)
- char *l;
- CONST char *p;
- int n;
- double width;
+DashConvert(
+ char *l, /* Must be at least 2*n chars long, or NULL to
+ * indicate "just check syntax". */
+ 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. */
{
int result = 0;
int size, intWidth;
@@ -1445,30 +1529,28 @@ DashConvert (l, p, n, width)
}
while (n-- && *p) {
switch (*p++) {
- case ' ':
- if (result) {
- if (l) {
- l[-1] += intWidth + 1;
- }
- continue;
- } else {
- return 0;
+ case ' ':
+ if (result) {
+ if (l) {
+ l[-1] += intWidth + 1;
}
- break;
- case '_':
- size = 8;
- break;
- case '-':
- size = 6;
- break;
- case ',':
- size = 4;
- break;
- case '.':
- size = 2;
- break;
- default:
- return -1;
+ continue;
+ }
+ return 0;
+ case '_':
+ size = 8;
+ break;
+ case '-':
+ size = 6;
+ break;
+ case ',':
+ size = 4;
+ break;
+ case '.':
+ size = 2;
+ break;
+ default:
+ return -1;
}
if (l) {
*l++ = size * intWidth;
@@ -1482,14 +1564,14 @@ DashConvert (l, p, n, width)
/*
*----------------------------------------------------------------------
*
- * translateAndAppendCoords --
+ * TranslateAndAppendCoords --
*
* This is a helper routine for TkCanvTranslatePath() below.
*
- * Given an (x,y) coordinate pair within a canvas, this procedure
- * computes the corresponding coordinates at which the point should
- * be drawn in the drawable used for display. Those coordinates are
- * then written into outArr[numOut*2] and outArr[numOut*2+1].
+ * Given an (x,y) coordinate pair within a canvas, this function computes
+ * the corresponding coordinates at which the point should be drawn in
+ * the drawable used for display. Those coordinates are then written into
+ * outArr[numOut*2] and outArr[numOut*2+1].
*
* Results:
* There is no return value.
@@ -1501,11 +1583,12 @@ DashConvert (l, p, n, width)
*/
static void
-translateAndAppendCoords(canvPtr, x, y, outArr, numOut)
- TkCanvas *canvPtr; /* The canvas. */
- double x, y; /* Coordinates in canvas space. */
- XPoint *outArr; /* Write results into this array */
- int numOut; /* Num of prior entries in outArr[] */
+TranslateAndAppendCoords(
+ TkCanvas *canvPtr, /* The canvas. */
+ double x, /* Coordinates in canvas space. */
+ double y,
+ XPoint *outArr, /* Write results into this array */
+ int numOut) /* Num of prior entries in outArr[] */
{
double tmp;
@@ -1517,7 +1600,7 @@ translateAndAppendCoords(canvPtr, x, y, outArr, numOut)
}
outArr[numOut].x = (short) tmp;
- tmp = y - canvPtr->drawableYOrigin;
+ tmp = y - canvPtr->drawableYOrigin;
if (tmp > 0) {
tmp += 0.5;
} else {
@@ -1531,225 +1614,262 @@ translateAndAppendCoords(canvPtr, x, y, outArr, numOut)
*
* TkCanvTranslatePath
*
- * Translate a line or polygon path so that all vertices are
- * within a rectangle that is 1000 pixels larger than the total
- * size of the canvas window. This will prevent pixel coordinates
- * from overflowing the 16-bit integer size limitation imposed by
- * most windowing systems.
- *
- * coordPtr must point to an array of doubles, two doubles per
- * vertex. There are a total of numVertex vertices, or 2*numVertex
- * entries in coordPtr. The result vertices written into outArr
- * have their coordinate origin shifted to canvPtr->drawableXOrigin
- * by canvPtr->drawableYOrigin. There might be as many as 3 times
- * more output vertices than there are input vertices. The calling
- * function should allocate space accordingly.
- *
- * This routine limits the width and height of a canvas window
- * to 31767 pixels. At the highest resolution display devices
- * available today (210 ppi in Jan 2003) that's a window that is
- * over 13 feet wide and tall. Should be enough for the near
- * future.
+ * Translate a line or polygon path so that all vertices are within a
+ * rectangle that is 1000 pixels larger than the total size of the canvas
+ * window. This will prevent pixel coordinates from overflowing the
+ * 16-bit integer size limitation imposed by most windowing systems.
+ *
+ * coordPtr must point to an array of doubles, two doubles per vertex.
+ * There are a total of numVertex vertices, or 2*numVertex entries in
+ * coordPtr. The result vertices written into outArr have their
+ * coordinate origin shifted to canvPtr->drawableXOrigin by
+ * canvPtr->drawableYOrigin. There might be as many as 3 times more
+ * output vertices than there are input vertices. The calling function
+ * should allocate space accordingly.
+ *
+ * This routine limits the width and height of a canvas window to 31767
+ * pixels. At the highest resolution display devices available today (210
+ * ppi in Jan 2003) that's a window that is over 13 feet wide and tall.
+ * Should be enough for the near future.
*
* Results:
- * Clipped and translated path vertices are written into outArr[].
- * There might be as many as twice the vertices in outArr[] as there
- * are in coordPtr[]. The return value is the number of vertices
- * actually written into outArr[].
+ * Clipped and translated path vertices are written into outArr[]. There
+ * might be as many as twice the vertices in outArr[] as there are in
+ * coordPtr[]. The return value is the number of vertices actually
+ * written into outArr[].
*
* Side effects:
* None
*
*--------------------------------------------------------------
*/
+
int
-TkCanvTranslatePath (canvPtr, numVertex, coordArr, closedPath, outArr)
- TkCanvas *canvPtr; /* The canvas */
- int numVertex; /* Number of vertices specified by coordArr[] */
- double *coordArr; /* X and Y coordinates for each vertex */
- int closedPath; /* True if this is a closed polygon */
- XPoint *outArr; /* Write results here, if not NULL */
+TkCanvTranslatePath(
+ TkCanvas *canvPtr, /* The canvas */
+ int numVertex, /* Number of vertices specified by
+ * coordArr[] */
+ double *coordArr, /* X and Y coordinates for each vertex */
+ int closedPath, /* True if this is a closed polygon */
+ XPoint *outArr) /* Write results here, if not NULL */
{
- int numOutput = 0; /* Number of output coordinates */
- double lft, rgh; /* Left and right sides of the bounding box */
- double top, btm; /* Top and bottom sizes of the bounding box */
- double *tempArr; /* Temporary storage used by the clipper */
- 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 */
+ int numOutput = 0; /* Number of output coordinates */
+ double lft, rgh; /* Left and right sides of the bounding box */
+ double top, btm; /* Top and bottom sizes of the bounding box */
+ double *tempArr; /* Temporary storage used by the clipper */
+ 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 */
/*
- ** Constrain all vertices of the path to be within a box that is no
- ** larger than 32000 pixels wide or height. The top-left corner of
- ** this clipping box is 1000 pixels above and to the left of the top
- ** left corner of the window on which the canvas is displayed.
- **
- ** This means that a canvas will not display properly on a canvas
- ** window that is larger than 31000 pixels wide or high. That is not
- ** a problem today, but might someday become a factor for ultra-high
- ** resolutions displays.
- **
- ** The X11 protocol allows us (in theory) to expand the size of the
- ** clipping box to 32767 pixels. But we have found experimentally that
- ** XFree86 sometimes fails to draw lines correctly if they are longer
- ** than about 32500 pixels. So we have left a little margin in the
- ** size to mask that bug.
- */
+ * Constrain all vertices of the path to be within a box that is no larger
+ * than 32000 pixels wide or height. The top-left corner of this clipping
+ * box is 1000 pixels above and to the left of the top left corner of the
+ * window on which the canvas is displayed.
+ *
+ * This means that a canvas will not display properly on a canvas window
+ * that is larger than 31000 pixels wide or high. That is not a problem
+ * today, but might someday become a factor for ultra-high resolutions
+ * displays.
+ *
+ * The X11 protocol allows us (in theory) to expand the size of the
+ * clipping box to 32767 pixels. But we have found experimentally that
+ * XFree86 sometimes fails to draw lines correctly if they are longer than
+ * about 32500 pixels. So we have left a little margin in the size to mask
+ * that bug.
+ */
+
lft = canvPtr->xOrigin - 1000.0;
top = canvPtr->yOrigin - 1000.0;
rgh = lft + 32000.0;
btm = top + 32000.0;
- /* Try the common case first - no clipping. Loop over the input
- ** coordinates and translate them into appropriate output coordinates.
- ** But if a vertex outside of the bounding box is seen, break out of
- ** the loop.
- **
- ** Most of the time, no clipping is needed, so this one loop is
- ** sufficient to do the translation.
- */
- for(i=0; i<numVertex; i++){
- double x, y;
- x = coordArr[i*2];
- y = coordArr[i*2+1];
- if( x<lft || x>rgh || y<top || y>btm ) break;
- translateAndAppendCoords(canvPtr, x, y, outArr, numOutput++);
- }
- if( i==numVertex ){
- assert( numOutput==numVertex );
- return numOutput;
- }
-
- /* If we reach this point, it means that some clipping is required.
- ** Begin by allocating some working storage - at least 6 times as much space
- ** as coordArr[] requires. Divide this space into two separate arrays
- ** a[] and b[]. Initialize a[] to be equal to coordArr[].
- */
- if( numVertex*12 <= sizeof(staticSpace)/sizeof(staticSpace[0]) ){
- tempArr = staticSpace;
+ /*
+ * Try the common case first - no clipping. Loop over the input
+ * coordinates and translate them into appropriate output coordinates.
+ * But if a vertex outside of the bounding box is seen, break out of the
+ * loop.
+ *
+ * Most of the time, no clipping is needed, so this one loop is sufficient
+ * to do the translation.
+ */
+
+ for (i=0; i<numVertex; i++){
+ double x, y;
+
+ x = coordArr[i*2];
+ y = coordArr[i*2+1];
+ if (x<lft || x>rgh || y<top || y>btm) {
+ break;
+ }
+ TranslateAndAppendCoords(canvPtr, x, y, outArr, numOutput++);
+ }
+ if (i == numVertex){
+ assert(numOutput == numVertex);
+ return numOutput;
+ }
+
+ /*
+ * If we reach this point, it means that some clipping is required. Begin
+ * by allocating some working storage - at least 6 times as much space as
+ * coordArr[] requires. Divide this space into two separate arrays a[] and
+ * b[]. Initialize a[] to be equal to coordArr[].
+ */
+
+ if (numVertex*12 <= (int)(sizeof(staticSpace)/sizeof(staticSpace[0]))) {
+ tempArr = staticSpace;
} else {
- tempArr = (double*)ckalloc( numVertex*12*sizeof(tempArr[0]) );
+ tempArr = (double *)ckalloc(numVertex*12*sizeof(tempArr[0]));
}
- for(i=0; i<numVertex*2; i++){
- tempArr[i] = coordArr[i];
+ for (i=0; i<numVertex*2; i++){
+ tempArr[i] = coordArr[i];
}
a = tempArr;
b = &tempArr[numVertex*6];
- /* We will make four passes through the input data. On each pass,
- ** we copy the contents of a[] over into b[]. As we copy, we clip
- ** any line segments that extend to the right past xClip then we
- ** rotate the coordinate system 90 degrees clockwise. After each
- ** pass is complete, we interchange a[] and b[] in preparation for
- ** the next pass.
- **
- ** Each pass clips line segments that extend beyond a single side
- ** of the bounding box, and four passes rotate the coordinate system
- ** back to its original value. I'm not an expert on graphics
- ** algorithms, but I think this is called Cohen-Sutherland polygon
- ** clipping.
- **
- ** The limit[] array contains the xClip value used for each of the
- ** four passes.
- */
+ /*
+ * We will make four passes through the input data. On each pass, we copy
+ * the contents of a[] over into b[]. As we copy, we clip any line
+ * segments that extend to the right past xClip then we rotate the
+ * coordinate system 90 degrees clockwise. After each pass is complete, we
+ * interchange a[] and b[] in preparation for the next pass.
+ *
+ * Each pass clips line segments that extend beyond a single side of the
+ * bounding box, and four passes rotate the coordinate system back to its
+ * original value. I'm not an expert on graphics algorithms, but I think
+ * this is called Cohen-Sutherland polygon clipping.
+ *
+ * The limit[] array contains the xClip value used for each of the four
+ * passes.
+ */
+
limit[0] = rgh;
limit[1] = -top;
limit[2] = -lft;
limit[3] = btm;
- /* This is the loop that makes the four passes through the data.
- */
+ /*
+ * 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;
- double priorY = a[1];
- numOutput = 0;
-
- /* Clip everything to the right of xClip. Store the results in
- ** b[] rotated by 90 degrees clockwise.
- */
- for(i=0; i<numVertex; i++){
- double x = a[i*2];
- double y = a[i*2+1];
- if( x>=xClip ){
- /* The current vertex is to the right of xClip.
- */
- if( inside ){
- /* If the current vertex is to the right of xClip but
- ** the previous vertex was left of xClip, then draw a
- ** line segment from the previous vertex to until it
- ** intersects the vertical at xClip.
- */
- double x0, y0, yN;
- assert( i>0 );
- 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;
- numOutput++;
- assert( numOutput<=maxOutput );
- priorY = yN;
- inside = 0;
- }else if( i==0 ){
- /* If the first vertex is to the right of xClip, add
- ** a vertex that is the projection of the first vertex
- ** onto the vertical xClip line.
- */
- b[0] = -y;
- b[1] = xClip;
- numOutput = 1;
- priorY = y;
- }
- }else{
- /* The current vertex is to the left of xClip
- */
- if( !inside ){
- /* 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 the spot where we cross back from right to left.
- */
- double x0, y0, yN;
- assert( i>0 );
- 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;
- numOutput++;
- assert( numOutput<=maxOutput );
- }
- inside = 1;
- }
- b[numOutput*2] = -y;
- b[numOutput*2+1] = x;
- numOutput++;
- assert( numOutput<=maxOutput );
- }
- }
-
- /* Interchange a[] and b[] in preparation for the next pass.
- */
- t = a;
- a = b;
- b = t;
- numVertex = numOutput;
- }
-
- /* All clipping is now finished. Convert the coordinates from doubles
- ** into XPoints and translate the origin for the drawable.
- */
- for(i=0; i<numVertex; i++){
- translateAndAppendCoords(canvPtr, a[i*2], a[i*2+1], outArr, i);
- }
- if( tempArr!=staticSpace ){
- ckfree((char *) tempArr);
+ for (j=0; j<4; j++){
+ double xClip = limit[j];
+ int inside = a[0]<xClip;
+ double priorY = a[1];
+ numOutput = 0;
+
+ /*
+ * Clip everything to the right of xClip. Store the results in b[]
+ * rotated by 90 degrees clockwise.
+ */
+
+ for (i=0; i<numVertex; i++){
+ double x = a[i*2];
+ double y = a[i*2+1];
+
+ if (x >= xClip) {
+ /*
+ * The current vertex is to the right of xClip.
+ */
+
+ if (inside) {
+ /*
+ * If the current vertex is to the right of xClip but the
+ * previous vertex was left of xClip, then draw a line
+ * segment from the previous vertex to until it intersects
+ * the vertical at xClip.
+ */
+
+ double x0, y0, yN;
+
+ assert(i > 0);
+ 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;
+ numOutput++;
+ assert(numOutput <= maxOutput);
+ priorY = yN;
+ inside = 0;
+ } else if (i == 0) {
+ /*
+ * If the first vertex is to the right of xClip, add a
+ * vertex that is the projection of the first vertex onto
+ * the vertical xClip line.
+ */
+
+ b[0] = -y;
+ b[1] = xClip;
+ numOutput = 1;
+ priorY = y;
+ }
+ } else {
+ /*
+ * The current vertex is to the left of xClip
+ */
+ if (!inside) {
+ /* 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
+ * the spot where we cross back from right to left.
+ */
+
+ double x0, y0, yN;
+
+ assert(i > 0);
+ 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;
+ numOutput++;
+ assert(numOutput <= maxOutput);
+ }
+ inside = 1;
+ }
+ b[numOutput*2] = -y;
+ b[numOutput*2+1] = x;
+ numOutput++;
+ assert(numOutput <= maxOutput);
+ }
+ }
+
+ /*
+ * Interchange a[] and b[] in preparation for the next pass.
+ */
+
+ t = a;
+ a = b;
+ b = t;
+ numVertex = numOutput;
+ }
+
+ /*
+ * All clipping is now finished. Convert the coordinates from doubles into
+ * XPoints and translate the origin for the drawable.
+ */
+
+ for (i=0; i<numVertex; i++){
+ TranslateAndAppendCoords(canvPtr, a[i*2], a[i*2+1], outArr, i);
+ }
+ if (tempArr != staticSpace) {
+ ckfree((char *) tempArr);
}
return numOutput;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index 96fcadd..b62859c 100644
--- a/generic/tkCanvWind.c
+++ b/generic/tkCanvWind.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkCanvWind.c --
*
* This file implements window items for canvas widgets.
@@ -6,13 +6,12 @@
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <stdio.h>
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
/*
@@ -49,103 +48,99 @@ static Tk_CustomOption tagsOption = {
};
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_ANCHOR, "-anchor", NULL, NULL,
"center", Tk_Offset(WindowItem, anchor), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_PIXELS, "-height", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_PIXELS, "-height", NULL, NULL,
"0", Tk_Offset(WindowItem, height), TK_CONFIG_DONT_SET_DEFAULT},
- {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK,
- &stateOption},
- {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption},
- {TK_CONFIG_PIXELS, "-width", (char *) NULL, (char *) 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},
- {TK_CONFIG_WINDOW, "-window", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(WindowItem, tkwin), TK_CONFIG_NULL_OK},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_WINDOW, "-window", NULL, NULL,
+ NULL, Tk_Offset(WindowItem, tkwin), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Prototypes for procedures defined in this file:
+ * Prototypes for functions defined in this file:
*/
-static void ComputeWindowBbox _ANSI_ARGS_((Tk_Canvas canvas,
- WindowItem *winItemPtr));
-static int ConfigureWinItem _ANSI_ARGS_((Tcl_Interp *interp,
+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));
-static int CreateWinItem _ANSI_ARGS_((Tcl_Interp *interp,
+ 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[]));
-static void DeleteWinItem _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, Display *display));
-static void DisplayWinItem _ANSI_ARGS_((Tk_Canvas canvas,
+ int objc, Tcl_Obj *CONST objv[]);
+static void DeleteWinItem(Tk_Canvas canvas,
+ Tk_Item *itemPtr, Display *display);
+static void DisplayWinItem(Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
- int x, int y, int width, int height));
-static void ScaleWinItem _ANSI_ARGS_((Tk_Canvas canvas,
+ int x, int y, int width, int height);
+static void ScaleWinItem(Tk_Canvas canvas,
Tk_Item *itemPtr, double originX, double originY,
- double scaleX, double scaleY));
-static void TranslateWinItem _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double deltaX, double deltaY));
-static int WinItemCoords _ANSI_ARGS_((Tcl_Interp *interp,
+ double scaleX, double scaleY);
+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[]));
-static void WinItemLostSlaveProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin));
-static void WinItemRequestProc _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
-static void WinItemStructureProc _ANSI_ARGS_((
- ClientData clientData, XEvent *eventPtr));
-static int WinItemToArea _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *rectPtr));
-static int WinItemToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
-static double WinItemToPoint _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr, double *pointPtr));
+ Tcl_Obj *CONST objv[]);
+static void WinItemLostSlaveProc(ClientData clientData,
+ Tk_Window tkwin);
+static void WinItemRequestProc(ClientData clientData,
+ Tk_Window tkwin);
+static void WinItemStructureProc(ClientData clientData,
+ XEvent *eventPtr);
+static int WinItemToArea(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *rectPtr);
+static int WinItemToPostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
+static double WinItemToPoint(Tk_Canvas canvas,
+ Tk_Item *itemPtr, double *pointPtr);
#ifdef X_GetImage
-static int xerrorhandler _ANSI_ARGS_((ClientData clientData,
- XErrorEvent *e));
+static int xerrorhandler(ClientData clientData, XErrorEvent *e);
#endif
-static int CanvasPsWindow _ANSI_ARGS_((Tcl_Interp *interp,
+static int CanvasPsWindow(Tcl_Interp *interp,
Tk_Window tkwin, Tk_Canvas canvas, double x,
- double y, int width, int height));
+ double y, int width, int height);
/*
- * The structure below defines the window item type by means of procedures
+ * The structure below defines the window item type by means of functions
* that can be invoked by generic item code.
*/
Tk_ItemType tkWindowType = {
- "window", /* name */
- sizeof(WindowItem), /* itemSize */
- CreateWinItem, /* createProc */
- configSpecs, /* configSpecs */
- ConfigureWinItem, /* configureProc */
- WinItemCoords, /* coordProc */
- DeleteWinItem, /* deleteProc */
- DisplayWinItem, /* displayProc */
- 1|TK_CONFIG_OBJS, /* flags */
- WinItemToPoint, /* pointProc */
- WinItemToArea, /* areaProc */
- WinItemToPostscript, /* postscriptProc */
- ScaleWinItem, /* scaleProc */
- TranslateWinItem, /* translateProc */
- (Tk_ItemIndexProc *) NULL, /* indexProc */
- (Tk_ItemCursorProc *) NULL, /* cursorProc */
- (Tk_ItemSelectionProc *) NULL, /* selectionProc */
- (Tk_ItemInsertProc *) NULL, /* insertProc */
- (Tk_ItemDCharsProc *) NULL, /* dTextProc */
- (Tk_ItemType *) NULL, /* nextPtr */
+ "window", /* name */
+ sizeof(WindowItem), /* itemSize */
+ CreateWinItem, /* createProc */
+ configSpecs, /* configSpecs */
+ ConfigureWinItem, /* configureProc */
+ WinItemCoords, /* coordProc */
+ DeleteWinItem, /* deleteProc */
+ DisplayWinItem, /* displayProc */
+ 1|TK_CONFIG_OBJS, /* flags */
+ WinItemToPoint, /* pointProc */
+ WinItemToArea, /* areaProc */
+ WinItemToPostscript, /* postscriptProc */
+ ScaleWinItem, /* scaleProc */
+ TranslateWinItem, /* translateProc */
+ NULL, /* indexProc */
+ NULL, /* cursorProc */
+ NULL, /* selectionProc */
+ NULL, /* insertProc */
+ NULL, /* dTextProc */
+ NULL, /* nextPtr */
};
-
/*
- * The structure below defines the official type record for the
- * placer:
+ * The structure below defines the official type record for the canvas (as
+ * geometry manager):
*/
-static Tk_GeomMgr canvasGeomType = {
+static const Tk_GeomMgr canvasGeomType = {
"canvas", /* name */
WinItemRequestProc, /* requestProc */
WinItemLostSlaveProc, /* lostSlaveProc */
@@ -156,14 +151,12 @@ static Tk_GeomMgr canvasGeomType = {
*
* CreateWinItem --
*
- * This procedure is invoked to create a new window
- * item in a canvas.
+ * This function is invoked to create a new window item in a canvas.
*
* Results:
- * A standard Tcl return value. If an error occurred in
- * creating the item, then an error message is left in
- * the interp's result; in this case itemPtr is
- * left uninitialized, so it can be safely freed by the
+ * A standard Tcl return value. If an error occurred in creating the
+ * item, then an error message is left in the interp's result; in this
+ * case itemPtr is left uninitialized, so it can be safely freed by the
* caller.
*
* Side effects:
@@ -173,19 +166,19 @@ static Tk_GeomMgr canvasGeomType = {
*/
static int
-CreateWinItem(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
- Tk_Item *itemPtr; /* Record to hold new item; header
- * has been initialized by caller. */
- int objc; /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing window. */
+CreateWinItem(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Canvas canvas, /* Canvas to hold new item. */
+ Tk_Item *itemPtr, /* Record to hold new item; header has been
+ * initialized by caller. */
+ int objc, /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments describing window. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
int i;
if (objc == 0) {
- panic("canvas did not pass any coords\n");
+ Tcl_Panic("canvas did not pass any coords\n");
}
/*
@@ -199,8 +192,8 @@ CreateWinItem(interp, canvas, itemPtr, objc, objv)
winItemPtr->canvas = canvas;
/*
- * Process the arguments to fill in the item record.
- * Only 1 (list) or 2 (x y) coords are allowed.
+ * Process the arguments to fill in the item record. Only 1 (list) or 2 (x
+ * y) coords are allowed.
*/
if (objc == 1) {
@@ -220,7 +213,7 @@ CreateWinItem(interp, canvas, itemPtr, objc, objv)
return TCL_OK;
}
- error:
+ error:
DeleteWinItem(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas)));
return TCL_ERROR;
}
@@ -230,9 +223,8 @@ CreateWinItem(interp, canvas, itemPtr, objc, objv)
*
* WinItemCoords --
*
- * This procedure is invoked to process the "coords" widget
- * command on window items. See the user documentation for
- * details on what it does.
+ * This function is invoked to process the "coords" widget command on
+ * window items. See the user documentation for details on what it does.
*
* Results:
* Returns TCL_OK or TCL_ERROR, and sets the interp's result.
@@ -244,15 +236,13 @@ CreateWinItem(interp, canvas, itemPtr, objc, objv)
*/
static int
-WinItemCoords(interp, canvas, itemPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item whose coordinates are to be
- * read or modified. */
- int objc; /* Number of coordinates supplied in
- * objv. */
- Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
+WinItemCoords(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item whose coordinates are to be read or
+ * modified. */
+ int objc, /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -297,12 +287,12 @@ WinItemCoords(interp, canvas, itemPtr, objc, objv)
*
* ConfigureWinItem --
*
- * This procedure is invoked to configure various aspects
- * of a window item, such as its anchor position.
+ * This function is invoked to configure various aspects of a window
+ * item, such as its anchor position.
*
* Results:
- * A standard Tcl result code. If an error occurs, then
- * an error message is left in the interp's result.
+ * A standard Tcl result code. If an error occurs, then an error message
+ * is left in the interp's result.
*
* Side effects:
* Configuration information may be set for itemPtr.
@@ -311,13 +301,13 @@ WinItemCoords(interp, canvas, itemPtr, objc, objv)
*/
static int
-ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* Window item to reconfigure. */
- int objc; /* Number of elements in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureWinItem(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
Tk_Window oldWindow;
@@ -338,8 +328,7 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
if (oldWindow != NULL) {
Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
WinItemStructureProc, (ClientData) winItemPtr);
- Tk_ManageGeometry(oldWindow, (Tk_GeomMgr *) NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL);
Tk_UnmaintainGeometry(oldWindow, canvasTkwin);
Tk_UnmapWindow(oldWindow);
}
@@ -347,10 +336,10 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
Tk_Window ancestor, parent;
/*
- * Make sure that the canvas is either the parent of the
- * window associated with the item or a descendant of that
- * parent. Also, don't allow a top-of-hierarchy window to be
- * managed inside a canvas.
+ * Make sure that the canvas is either the parent of the window
+ * associated with the item or a descendant of that parent. Also,
+ * don't allow a top-of-hierarchy window to be managed inside a
+ * canvas.
*/
parent = Tk_Parent(winItemPtr->tkwin);
@@ -360,10 +349,10 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
break;
}
if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) {
- badWindow:
+ badWindow:
Tcl_AppendResult(interp, "can't use ",
Tk_PathName(winItemPtr->tkwin),
- " in a window item of this canvas", (char *) NULL);
+ " in a window item of this canvas", NULL);
winItemPtr->tkwin = NULL;
return TCL_ERROR;
}
@@ -399,8 +388,8 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
*
* DeleteWinItem --
*
- * This procedure is called to clean up the data structure
- * associated with a window item.
+ * This function is called to clean up the data structure associated with
+ * a window item.
*
* Results:
* None.
@@ -412,11 +401,10 @@ ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
*/
static void
-DeleteWinItem(canvas, itemPtr, display)
- Tk_Canvas canvas; /* Overall info about widget. */
- Tk_Item *itemPtr; /* Item that is being deleted. */
- Display *display; /* Display containing window for
- * canvas. */
+DeleteWinItem(
+ Tk_Canvas canvas, /* Overall info about widget. */
+ Tk_Item *itemPtr, /* Item that is being deleted. */
+ Display *display) /* Display containing window for canvas. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
Tk_Window canvasTkwin = Tk_CanvasTkwin(canvas);
@@ -424,7 +412,7 @@ DeleteWinItem(canvas, itemPtr, display)
if (winItemPtr->tkwin != NULL) {
Tk_DeleteEventHandler(winItemPtr->tkwin, StructureNotifyMask,
WinItemStructureProc, (ClientData) winItemPtr);
- Tk_ManageGeometry(winItemPtr->tkwin, (Tk_GeomMgr *) NULL,
+ Tk_ManageGeometry(winItemPtr->tkwin, NULL,
(ClientData) NULL);
if (canvasTkwin != Tk_Parent(winItemPtr->tkwin)) {
Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin);
@@ -438,26 +426,23 @@ DeleteWinItem(canvas, itemPtr, display)
*
* ComputeWindowBbox --
*
- * This procedure is invoked to compute the bounding box of
- * all the pixels that may be drawn as part of a window item.
- * This procedure is where the child window's placement is
- * computed.
+ * This function is invoked to compute the bounding box of all the pixels
+ * that may be drawn as part of a window item. This function is where the
+ * child window's placement is computed.
*
* Results:
* None.
*
* Side effects:
- * The fields x1, y1, x2, and y2 are updated in the header
- * for itemPtr.
+ * The fields x1, y1, x2, and y2 are updated in the header for itemPtr.
*
*--------------------------------------------------------------
*/
static void
-ComputeWindowBbox(canvas, winItemPtr)
- Tk_Canvas canvas; /* Canvas that contains item. */
- WindowItem *winItemPtr; /* Item whose bbox is to be
- * recomputed. */
+ComputeWindowBbox(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ WindowItem *winItemPtr) /* Item whose bbox is to be recomputed. */
{
int width, height, x, y;
Tk_State state = winItemPtr->header.state;
@@ -470,10 +455,10 @@ ComputeWindowBbox(canvas, winItemPtr)
}
if ((winItemPtr->tkwin == NULL) || (state == TK_STATE_HIDDEN)) {
/*
- * There is no window for this item yet. Just give it a 1x1
- * bounding box. Don't give it a 0x0 bounding box; there are
- * strange cases where this bounding box might be used as the
- * dimensions of the window, and 0x0 causes problems under X.
+ * There is no window for this item yet. Just give it a 1x1 bounding
+ * box. Don't give it a 0x0 bounding box; there are strange cases
+ * where this bounding box might be used as the dimensions of the
+ * window, and 0x0 causes problems under X.
*/
winItemPtr->header.x1 = x;
@@ -507,36 +492,36 @@ ComputeWindowBbox(canvas, winItemPtr)
*/
switch (winItemPtr->anchor) {
- case TK_ANCHOR_N:
- x -= width/2;
- break;
- case TK_ANCHOR_NE:
- x -= width;
- break;
- case TK_ANCHOR_E:
- x -= width;
- y -= height/2;
- break;
- case TK_ANCHOR_SE:
- x -= width;
- y -= height;
- break;
- case TK_ANCHOR_S:
- x -= width/2;
- y -= height;
- break;
- case TK_ANCHOR_SW:
- y -= height;
- break;
- case TK_ANCHOR_W:
- y -= height/2;
- break;
- case TK_ANCHOR_NW:
- break;
- case TK_ANCHOR_CENTER:
- x -= width/2;
- y -= height/2;
- break;
+ case TK_ANCHOR_N:
+ x -= width/2;
+ break;
+ case TK_ANCHOR_NE:
+ x -= width;
+ break;
+ case TK_ANCHOR_E:
+ x -= width;
+ y -= height/2;
+ break;
+ case TK_ANCHOR_SE:
+ x -= width;
+ y -= height;
+ break;
+ case TK_ANCHOR_S:
+ x -= width/2;
+ y -= height;
+ break;
+ case TK_ANCHOR_SW:
+ y -= height;
+ break;
+ case TK_ANCHOR_W:
+ y -= height/2;
+ break;
+ case TK_ANCHOR_NW:
+ break;
+ case TK_ANCHOR_CENTER:
+ x -= width/2;
+ y -= height/2;
+ break;
}
/*
@@ -554,36 +539,32 @@ ComputeWindowBbox(canvas, winItemPtr)
*
* DisplayWinItem --
*
- * This procedure is invoked to "draw" a window item in a given
- * drawable. Since the window draws itself, we needn't do any
- * actual redisplay here. However, this procedure takes care
- * of actually repositioning the child window so that it occupies
- * the correct screen position.
+ * This function is invoked to "draw" a window item in a given drawable.
+ * Since the window draws itself, we needn't do any actual redisplay
+ * here. However, this function takes care of actually repositioning the
+ * child window so that it occupies the correct screen position.
*
* Results:
* None.
*
* Side effects:
- * The child window's position may get changed. Note: this
- * procedure gets called both when a window needs to be displayed
- * and when it ceases to be visible on the screen (e.g. it was
- * scrolled or moved off-screen or the enclosing canvas is
- * unmapped).
+ * The child window's position may get changed. Note: this function gets
+ * called both when a window needs to be displayed and when it ceases to
+ * be visible on the screen (e.g. it was scrolled or moved off-screen or
+ * the enclosing canvas is unmapped).
*
*--------------------------------------------------------------
*/
static void
-DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY,
- regionWidth, regionHeight)
- Tk_Canvas canvas; /* Canvas that contains item. */
- Tk_Item *itemPtr; /* Item to be displayed. */
- Display *display; /* Display on which to draw item. */
- Drawable drawable; /* Pixmap or window in which to draw
- * item. */
- int regionX, regionY, regionWidth, regionHeight;
- /* Describes region of canvas that
- * must be redisplayed (not used). */
+DisplayWinItem(
+ Tk_Canvas canvas, /* Canvas that contains item. */
+ Tk_Item *itemPtr, /* Item to be displayed. */
+ Display *display, /* Display on which to draw item. */
+ Drawable drawable, /* Pixmap or window in which to draw item. */
+ int regionX, int regionY, int regionWidth, int regionHeight)
+ /* Describes region of canvas that must be
+ * redisplayed (not used). */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
int width, height;
@@ -616,16 +597,16 @@ DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY,
height = winItemPtr->header.y2 - winItemPtr->header.y1;
/*
- * If the window is completely out of the visible area of the canvas
- * then unmap it. This code used not to be present (why unmap the
- * window if it isn't visible anyway?) but this could cause the
- * window to suddenly reappear if the canvas window got resized.
+ * If the window is completely out of the visible area of the canvas then
+ * unmap it. This code used not to be present (why unmap the window if it
+ * isn't visible anyway?) but this could cause the window to suddenly
+ * reappear if the canvas window got resized.
*/
if (((x + width) <= 0) || ((y + height) <= 0)
|| (x >= Tk_Width(canvasTkwin)) || (y >= Tk_Height(canvasTkwin))) {
if (canvasTkwin == Tk_Parent(winItemPtr->tkwin)) {
- Tk_UnmapWindow(winItemPtr->tkwin);
+ Tk_UnmapWindow(winItemPtr->tkwin);
} else {
Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin);
}
@@ -633,8 +614,8 @@ DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY,
}
/*
- * Reposition and map the window (but in different ways depending
- * on whether the canvas is the window's parent).
+ * Reposition and map the window (but in different ways depending on
+ * whether the canvas is the window's parent).
*/
if (canvasTkwin == Tk_Parent(winItemPtr->tkwin)) {
@@ -655,14 +636,14 @@ DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY,
*
* WinItemToPoint --
*
- * Computes the distance from a given point to a given
- * window, in canvas units.
+ * Computes the distance from a given point to a given window, in canvas
+ * units.
*
* Results:
- * The return value is 0 if the point whose x and y coordinates
- * are coordPtr[0] and coordPtr[1] is inside the window. If the
- * point isn't inside the window then the return value is the
- * distance from the point to the window.
+ * The return value is 0 if the point whose x and y coordinates are
+ * coordPtr[0] and coordPtr[1] is inside the window. If the point isn't
+ * inside the window then the return value is the distance from the point
+ * to the window.
*
* Side effects:
* None.
@@ -671,10 +652,10 @@ DisplayWinItem(canvas, itemPtr, display, drawable, regionX, regionY,
*/
static double
-WinItemToPoint(canvas, itemPtr, pointPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against point. */
- double *pointPtr; /* Pointer to x and y coordinates. */
+WinItemToPoint(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against point. */
+ double *pointPtr) /* Pointer to x and y coordinates. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
double x1, x2, y1, y2, xDiff, yDiff;
@@ -712,14 +693,13 @@ WinItemToPoint(canvas, itemPtr, pointPtr)
*
* WinItemToArea --
*
- * This procedure is called to determine whether an item
- * lies entirely inside, entirely outside, or overlapping
- * a given rectangle.
+ * This function is called to determine whether an item lies entirely
+ * inside, entirely outside, or overlapping a given rectangle.
*
* Results:
- * -1 is returned if the item is entirely outside the area
- * given by rectPtr, 0 if it overlaps, and 1 if it is entirely
- * inside the given area.
+ * -1 is returned if the item is entirely outside the area given by
+ * rectPtr, 0 if it overlaps, and 1 if it is entirely inside the given
+ * area.
*
* Side effects:
* None.
@@ -728,11 +708,11 @@ WinItemToPoint(canvas, itemPtr, pointPtr)
*/
static int
-WinItemToArea(canvas, itemPtr, rectPtr)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item to check against rectangle. */
- double *rectPtr; /* Pointer to array of four coordinates
- * (x1, y1, x2, y2) describing rectangular
+WinItemToArea(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item to check against rectangle. */
+ double *rectPtr) /* Pointer to array of four coordinates
+ * (x1,y1,x2,y2) describing rectangular
* area. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -757,8 +737,8 @@ WinItemToArea(canvas, itemPtr, rectPtr)
*
* xerrorhandler --
*
- * This is a dummy function to catch X11 errors during an
- * attempt to print a canvas window.
+ * This is a dummy function to catch X11 errors during an attempt to
+ * print a canvas window.
*
* Results:
* None.
@@ -771,11 +751,11 @@ WinItemToArea(canvas, itemPtr, rectPtr)
#ifdef X_GetImage
static int
-xerrorhandler(clientData, e)
- ClientData clientData;
- XErrorEvent *e;
+xerrorhandler(
+ ClientData clientData,
+ XErrorEvent *e)
{
- return 0;
+ return 0;
}
#endif
@@ -785,15 +765,13 @@ xerrorhandler(clientData, e)
*
* WinItemToPostscript --
*
- * This procedure is called to generate Postscript for
- * window items.
+ * This function is called to generate Postscript for window items.
*
* Results:
- * The return value is a standard Tcl result. If an error
- * occurs in generating Postscript then an error message is
- * left in interp->result, replacing whatever used to be there.
- * If no error occurs, then Postscript for the item is appended
- * to the result.
+ * The return value is a standard Tcl result. If an error occurs in
+ * generating Postscript then an error message is left in interp->result,
+ * replacing whatever used to be there. If no error occurs, then
+ * Postscript for the item is appended to the result.
*
* Side effects:
* None.
@@ -802,15 +780,13 @@ xerrorhandler(clientData, e)
*/
static int
-WinItemToPostscript(interp, canvas, itemPtr, prepass)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Canvas canvas; /* Information about overall canvas. */
- Tk_Item *itemPtr; /* Item for which Postscript is
- * wanted. */
- int prepass; /* 1 means this is a prepass to
- * collect font information; 0 means
- * final Postscript is being created.*/
+WinItemToPostscript(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ Tk_Item *itemPtr, /* Item for which Postscript is wanted. */
+ int prepass) /* 1 means this is a prepass to collect font
+ * information; 0 means final Postscript is
+ * being created. */
{
WindowItem *winItemPtr = (WindowItem *)itemPtr;
@@ -821,80 +797,75 @@ WinItemToPostscript(interp, canvas, itemPtr, prepass)
if (prepass || winItemPtr->tkwin == NULL) {
return TCL_OK;
}
-
+
width = Tk_Width(tkwin);
height = Tk_Height(tkwin);
/*
- * Compute the coordinates of the lower-left corner of the window,
- * taking into account the anchor position for the window.
+ * Compute the coordinates of the lower-left corner of the window, taking
+ * into account the anchor position for the window.
*/
x = winItemPtr->x;
y = Tk_CanvasPsY(canvas, winItemPtr->y);
-
+
switch (winItemPtr->anchor) {
- case TK_ANCHOR_NW: y -= height; break;
- case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
- case TK_ANCHOR_NE: x -= width; y -= height; break;
- case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
- case TK_ANCHOR_SE: x -= width; break;
- case TK_ANCHOR_S: x -= width/2.0; break;
- case TK_ANCHOR_SW: break;
- case TK_ANCHOR_W: y -= height/2.0; break;
- case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
+ case TK_ANCHOR_NW: y -= height; break;
+ case TK_ANCHOR_N: x -= width/2.0; y -= height; break;
+ case TK_ANCHOR_NE: x -= width; y -= height; break;
+ case TK_ANCHOR_E: x -= width; y -= height/2.0; break;
+ case TK_ANCHOR_SE: x -= width; break;
+ case TK_ANCHOR_S: x -= width/2.0; break;
+ case TK_ANCHOR_SW: break;
+ case TK_ANCHOR_W: y -= height/2.0; break;
+ case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break;
}
return CanvasPsWindow(interp, tkwin, canvas, x, y, width, height);
}
-
+
static int
-CanvasPsWindow(interp, tkwin, canvas, x, y, width, height)
- Tcl_Interp *interp; /* Leave Postscript or error message
- * here. */
- Tk_Window tkwin; /* window to be printed */
- Tk_Canvas canvas; /* Information about overall canvas. */
- double x, y; /* origin of window. */
- int width, height; /* width/height of window. */
+CanvasPsWindow(
+ Tcl_Interp *interp, /* Leave Postscript or error message here. */
+ Tk_Window tkwin, /* window to be printed */
+ Tk_Canvas canvas, /* Information about overall canvas. */
+ double x, double y, /* origin of window. */
+ int width, int height) /* width/height of window. */
{
char buffer[256];
XImage *ximage;
int result;
Tcl_DString buffer1, buffer2;
#ifdef X_GetImage
- Tk_ErrorHandler handle;
+ Tk_ErrorHandler handle;
#endif
sprintf(buffer, "\n%%%% %s item (%s, %d x %d)\n%.15g %.15g translate\n",
Tk_Class(tkwin), Tk_PathName(tkwin), width, height, x, y);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
- /* first try if the widget has its own "postscript" command. If it
- * exists, this will produce much better postscript than
- * when a pixmap is used.
+ /*
+ * First try if the widget has its own "postscript" command. If it exists,
+ * this will produce much better postscript than when a pixmap is used.
*/
Tcl_DStringInit(&buffer1);
Tcl_DStringInit(&buffer2);
Tcl_DStringGetResult(interp, &buffer2);
- sprintf (buffer, "%s postscript -prolog 0\n", Tk_PathName(tkwin));
+ sprintf(buffer, "%s postscript -prolog 0\n", Tk_PathName(tkwin));
result = Tcl_Eval(interp, buffer);
Tcl_DStringGetResult(interp, &buffer1);
Tcl_DStringResult(interp, &buffer2);
Tcl_DStringFree(&buffer2);
if (result == TCL_OK) {
- Tcl_AppendResult(interp,
- "50 dict begin\nsave\ngsave\n",
- (char *) NULL);
- sprintf (buffer,
- "0 %d moveto %d 0 rlineto 0 -%d rlineto -%d",
+ Tcl_AppendResult(interp, "50 dict begin\nsave\ngsave\n", NULL);
+ sprintf(buffer, "0 %d moveto %d 0 rlineto 0 -%d rlineto -%d",
height, width, height, width);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
Tcl_AppendResult(interp, " 0 rlineto closepath\n",
"1.000 1.000 1.000 setrgbcolor AdjustColor\nfill\ngrestore\n",
- Tcl_DStringValue(&buffer1), "\nrestore\nend\n\n\n",
- (char *) NULL);
+ Tcl_DStringValue(&buffer1), "\nrestore\nend\n\n\n", NULL);
Tcl_DStringFree(&buffer1);
return result;
@@ -902,17 +873,18 @@ CanvasPsWindow(interp, tkwin, canvas, x, y, width, height)
Tcl_DStringFree(&buffer1);
/*
- * If the window is off the screen it will generate an BadMatch/XError
- * We catch any BadMatch errors here
+ * If the window is off the screen it will generate a BadMatch/XError. We
+ * catch any BadMatch errors here
*/
+
#ifdef X_GetImage
handle = Tk_CreateErrorHandler(Tk_Display(tkwin), BadMatch,
X_GetImage, -1, xerrorhandler, (ClientData) tkwin);
#endif
/*
- * Generate an XImage from the window. We can then read pixel
- * values out of the XImage.
+ * Generate an XImage from the window. We can then read pixel values out
+ * of the XImage.
*/
ximage = XGetImage(Tk_Display(tkwin), Tk_WindowId(tkwin), 0, 0,
@@ -922,7 +894,7 @@ CanvasPsWindow(interp, tkwin, canvas, x, y, width, height)
Tk_DeleteErrorHandler(handle);
#endif
- if (ximage == (XImage*) NULL) {
+ if (ximage == NULL) {
return TCL_OK;
}
@@ -938,15 +910,14 @@ CanvasPsWindow(interp, tkwin, canvas, x, y, width, height)
*
* ScaleWinItem --
*
- * This procedure is invoked to rescale a window item.
+ * This function is invoked to rescale a window item.
*
* Results:
* None.
*
* Side effects:
- * The window referred to by itemPtr is rescaled
- * so that the following transformation is applied to all
- * point coordinates:
+ * The window referred to by itemPtr is rescaled so that the following
+ * transformation is applied to all point coordinates:
* x' = originX + scaleX*(x-originX)
* y' = originY + scaleY*(y-originY)
*
@@ -954,12 +925,13 @@ CanvasPsWindow(interp, tkwin, canvas, x, y, width, height)
*/
static void
-ScaleWinItem(canvas, itemPtr, originX, originY, scaleX, scaleY)
- Tk_Canvas canvas; /* Canvas containing window. */
- Tk_Item *itemPtr; /* Window to be scaled. */
- double originX, originY; /* Origin about which to scale window. */
- double scaleX; /* Amount to scale in X direction. */
- double scaleY; /* Amount to scale in Y direction. */
+ScaleWinItem(
+ Tk_Canvas canvas, /* Canvas containing window. */
+ Tk_Item *itemPtr, /* Window to be scaled. */
+ double originX, double originY,
+ /* Origin about which to scale window. */
+ double scaleX, /* Amount to scale in X direction. */
+ double scaleY) /* Amount to scale in Y direction. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -979,25 +951,24 @@ ScaleWinItem(canvas, itemPtr, originX, originY, scaleX, scaleY)
*
* TranslateWinItem --
*
- * This procedure is called to move a window by a given amount.
+ * This function is called to move a window by a given amount.
*
* Results:
* None.
*
* Side effects:
- * The position of the window is offset by (xDelta, yDelta),
- * and the bounding box is updated in the generic part of the
- * item structure.
+ * The position of the window is offset by (xDelta, yDelta), and the
+ * bounding box is updated in the generic part of the item structure.
*
*--------------------------------------------------------------
*/
static void
-TranslateWinItem(canvas, itemPtr, deltaX, deltaY)
- Tk_Canvas canvas; /* Canvas containing item. */
- Tk_Item *itemPtr; /* Item that is being moved. */
- double deltaX, deltaY; /* Amount by which item is to be
- * moved. */
+TranslateWinItem(
+ Tk_Canvas canvas, /* Canvas containing item. */
+ Tk_Item *itemPtr, /* Item that is being moved. */
+ double deltaX, double deltaY)
+ /* Amount by which item is to be moved. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -1011,25 +982,23 @@ TranslateWinItem(canvas, itemPtr, deltaX, deltaY)
*
* WinItemStructureProc --
*
- * This procedure is invoked whenever StructureNotify events
- * occur for a window that's managed as part of a canvas window
- * item. This procudure's only purpose is to clean up when
- * windows are deleted.
+ * This function is invoked whenever StructureNotify events occur for a
+ * window that's managed as part of a canvas window item. This function's
+ * only purpose is to clean up when windows are deleted.
*
* Results:
* None.
*
* Side effects:
- * The window is disassociated from the window item when it is
- * deleted.
+ * The window is disassociated from the window item when it is deleted.
*
*--------------------------------------------------------------
*/
static void
-WinItemStructureProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to record describing window item. */
- XEvent *eventPtr; /* Describes what just happened. */
+WinItemStructureProc(
+ ClientData clientData, /* Pointer to record describing window item. */
+ XEvent *eventPtr) /* Describes what just happened. */
{
WindowItem *winItemPtr = (WindowItem *) clientData;
@@ -1043,8 +1012,8 @@ WinItemStructureProc(clientData, eventPtr)
*
* WinItemRequestProc --
*
- * This procedure is invoked whenever a window that's associated
- * with a window canvas item changes its requested dimensions.
+ * This function is invoked whenever a window that's associated with a
+ * window canvas item changes its requested dimensions.
*
* Results:
* None.
@@ -1057,10 +1026,9 @@ WinItemStructureProc(clientData, eventPtr)
*/
static void
-WinItemRequestProc(clientData, tkwin)
- ClientData clientData; /* Pointer to record for window item. */
- Tk_Window tkwin; /* Window that changed its desired
- * size. */
+WinItemRequestProc(
+ ClientData clientData, /* Pointer to record for window item. */
+ Tk_Window tkwin) /* Window that changed its desired size. */
{
WindowItem *winItemPtr = (WindowItem *) clientData;
@@ -1080,8 +1048,8 @@ WinItemRequestProc(clientData, tkwin)
*
* WinItemLostSlaveProc --
*
- * This procedure is invoked by Tk whenever some other geometry
- * claims control over a slave that used to be managed by us.
+ * This function is invoked by Tk whenever some other geometry claims
+ * control over a slave that used to be managed by us.
*
* Results:
* None.
@@ -1094,10 +1062,10 @@ WinItemRequestProc(clientData, tkwin)
/* ARGSUSED */
static void
-WinItemLostSlaveProc(clientData, tkwin)
- ClientData clientData; /* WindowItem structure for slave window that
+WinItemLostSlaveProc(
+ ClientData clientData, /* WindowItem structure for slave window that
* was stolen away. */
- Tk_Window tkwin; /* Tk's handle for the slave window. */
+ Tk_Window tkwin) /* Tk's handle for the slave window. */
{
WindowItem *winItemPtr = (WindowItem *) clientData;
Tk_Window canvasTkwin = Tk_CanvasTkwin(winItemPtr->canvas);
@@ -1110,3 +1078,11 @@ WinItemLostSlaveProc(clientData, tkwin)
Tk_UnmapWindow(winItemPtr->tkwin);
winItemPtr->tkwin = NULL;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 197f28e..253b184 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1,23 +1,22 @@
-/*
+/*
* tkCanvas.c --
*
- * This module implements canvas widgets for the Tk toolkit.
- * A canvas displays a background and a collection of graphical
- * objects such as rectangles, lines, and texts.
+ * This module implements canvas widgets for the Tk toolkit. A canvas
+ * displays a background and a collection of graphical objects such as
+ * rectangles, lines, and texts.
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998-1999 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
/* #define USE_OLD_TAG_SEARCH 1 */
#include "default.h"
#include "tkInt.h"
-#include "tkPort.h"
#include "tkCanvas.h"
#ifdef TK_NO_DOUBLE_BUFFERING
#ifdef MAC_OSX_TK
@@ -31,32 +30,29 @@
#ifdef USE_OLD_TAG_SEARCH
/*
- * The structure defined below is used to keep track of a tag search
- * in progress. No field should be accessed by anyone other than
- * StartTagSearch and NextItem.
+ * The structure defined below is used to keep track of a tag search in
+ * progress. No field should be accessed by anyone other than StartTagSearch
+ * and NextItem.
*/
typedef struct TagSearch {
TkCanvas *canvasPtr; /* Canvas widget being searched. */
- Tk_Uid tag; /* Tag to search for. 0 means return
- * all items. */
+ Tk_Uid tag; /* Tag to search for. 0 means return all
+ * items. */
Tk_Item *currentPtr; /* Pointer to last item returned. */
- Tk_Item *lastPtr; /* The item right before the currentPtr
- * is tracked so if the currentPtr is
- * deleted we don't have to start from the
- * beginning. */
+ Tk_Item *lastPtr; /* The item right before the currentPtr is
+ * tracked so if the currentPtr is deleted we
+ * don't have to start from the beginning. */
int searchOver; /* Non-zero means NextItem should always
* return NULL. */
} TagSearch;
#else /* USE_OLD_TAG_SEARCH */
/*
- * The structure defined below is used to keep track of a tag search
- * in progress. No field should be accessed by anyone other than
- * TagSearchScan, TagSearchFirst, TagSearchNext,
- * TagSearchScanExpr, TagSearchEvalExpr,
- * TagSearchExprInit, TagSearchExprDestroy,
- * TagSearchDestroy.
+ * The structure defined below is used to keep track of a tag search in
+ * progress. No field should be accessed by anyone other than TagSearchScan,
+ * TagSearchFirst, TagSearchNext, TagSearchScanExpr, TagSearchEvalExpr,
+ * TagSearchExprInit, TagSearchExprDestroy, TagSearchDestroy.
* (
* Not quite accurate: the TagSearch structure is also accessed from:
* CanvasWidgetCmd, FindItems, RelinkItems
@@ -72,24 +68,32 @@ typedef struct TagSearch {
typedef struct TagSearch {
TkCanvas *canvasPtr; /* Canvas widget being searched. */
Tk_Item *currentPtr; /* Pointer to last item returned. */
- Tk_Item *lastPtr; /* The item right before the currentPtr
- * is tracked so if the currentPtr is
- * deleted we don't have to start from the
- * beginning. */
+ Tk_Item *lastPtr; /* The item right before the currentPtr is
+ * tracked so if the currentPtr is deleted we
+ * don't have to start from the beginning. */
int searchOver; /* Non-zero means NextItem should always
* return NULL. */
- int type; /* search type */
- int id; /* item id for searches by id */
+ int type; /* Search type (see #defs below) */
+ int id; /* Item id for searches by id */
+ 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) */
+ unsigned int rewritebufferAllocated;
+ /* Available space for rewrites. */
+ TagSearchExpr *expr; /* Compiled tag expression. */
+} TagSearch;
- char *string; /* tag expression string */
- int stringIndex; /* current position in string scan */
- int stringLength; /* length of tag expression string */
+/*
+ * Values for the TagSearch type field.
+ */
- char *rewritebuffer; /* tag string (after removing escapes) */
- unsigned int rewritebufferAllocated; /* available space for rewrites */
+#define SEARCH_TYPE_EMPTY 0 /* Looking for empty tag */
+#define SEARCH_TYPE_ID 1 /* Looking for an item by id */
+#define SEARCH_TYPE_ALL 2 /* Looking for all items */
+#define SEARCH_TYPE_TAG 3 /* Looking for an item by simple tag */
+#define SEARCH_TYPE_EXPR 4 /* Compound search */
- TagSearchExpr *expr; /* compiled tag expression */
-} TagSearch;
#endif /* USE_OLD_TAG_SEARCH */
/*
@@ -119,10 +123,8 @@ static Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_CANVAS_BG_MONO, Tk_Offset(TkCanvas, bgBorder),
TK_CONFIG_MONO_ONLY},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL,
- (char *) NULL, 0, 0},
- {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL,
- (char *) NULL, 0, 0},
+ {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0},
+ {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0},
{TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_CANVAS_BORDER_WIDTH, Tk_Offset(TkCanvas, borderWidth), 0},
{TK_CONFIG_DOUBLE, "-closeenough", "closeEnough", "CloseEnough",
@@ -203,13 +205,12 @@ static Tk_ConfigSpec configSpecs[] = {
"ScrollIncrement",
DEF_CANVAS_Y_SCROLL_INCREMENT, Tk_Offset(TkCanvas, yScrollIncrement),
0},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * List of all the item types known at present. This is *global* and
- * is protected by typeListMutex.
+ * List of all the item types known at present. This is *global* and is
+ * protected by typeListMutex.
*/
static Tk_ItemType *typeList = NULL; /* NULL means initialization hasn't
@@ -218,9 +219,10 @@ TCL_DECLARE_MUTEX(typeListMutex)
#ifndef USE_OLD_TAG_SEARCH
/*
- * Uids for operands in compiled advanced tag search expressions
+ * Uids for operands in compiled advanced tag search expressions.
* Initialization is done by GetStaticUids()
*/
+
typedef struct {
Tk_Uid allUid;
Tk_Uid currentUid;
@@ -235,107 +237,89 @@ typedef struct {
} SearchUids;
static Tcl_ThreadDataKey dataKey;
-static SearchUids *GetStaticUids _ANSI_ARGS_((void));
+static SearchUids * GetStaticUids(void);
#endif /* USE_OLD_TAG_SEARCH */
/*
- * Standard item types provided by Tk:
+ * Prototypes for functions defined later in this file:
*/
-extern Tk_ItemType tkArcType, tkBitmapType, tkImageType, tkLineType;
-extern Tk_ItemType tkOvalType, tkPolygonType;
-extern Tk_ItemType tkRectangleType, tkTextType, tkWindowType;
-
-/*
- * Prototypes for procedures defined later in this file:
- */
-
-static void CanvasBindProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void CanvasBlinkProc _ANSI_ARGS_((ClientData clientData));
-static void CanvasCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void CanvasDoEvent _ANSI_ARGS_((TkCanvas *canvasPtr,
- XEvent *eventPtr));
-static void CanvasEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static int CanvasFetchSelection _ANSI_ARGS_((
- ClientData clientData, int offset,
- char *buffer, int maxBytes));
-static Tk_Item * CanvasFindClosest _ANSI_ARGS_((TkCanvas *canvasPtr,
- double coords[2]));
-static void CanvasFocusProc _ANSI_ARGS_((TkCanvas *canvasPtr,
- int gotFocus));
-static void CanvasLostSelection _ANSI_ARGS_((
- ClientData clientData));
-static void CanvasSelectTo _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tk_Item *itemPtr, int index));
-static void CanvasSetOrigin _ANSI_ARGS_((TkCanvas *canvasPtr,
- int xOrigin, int yOrigin));
-static void CanvasUpdateScrollbars _ANSI_ARGS_((
- TkCanvas *canvasPtr));
-static int CanvasWidgetCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, Tcl_Obj *CONST *argv));
-static void CanvasWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static int ConfigureCanvas _ANSI_ARGS_((Tcl_Interp *interp,
- TkCanvas *canvasPtr, int argc, Tcl_Obj *CONST *argv,
- int flags));
-static void DestroyCanvas _ANSI_ARGS_((char *memPtr));
-static void DisplayCanvas _ANSI_ARGS_((ClientData clientData));
-static void DoItem _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Item *itemPtr, Tk_Uid tag));
-static void EventuallyRedrawItem _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item *itemPtr));
+static void CanvasBindProc(ClientData clientData,
+ XEvent *eventPtr);
+static void CanvasBlinkProc(ClientData clientData);
+static void CanvasCmdDeletedProc(ClientData clientData);
+static void CanvasDoEvent(TkCanvas *canvasPtr, XEvent *eventPtr);
+static void CanvasEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static int CanvasFetchSelection(ClientData clientData, int offset,
+ char *buffer, int maxBytes);
+static Tk_Item * CanvasFindClosest(TkCanvas *canvasPtr,
+ double coords[2]);
+static void CanvasFocusProc(TkCanvas *canvasPtr, int gotFocus);
+static void CanvasLostSelection(ClientData clientData);
+static void CanvasSelectTo(TkCanvas *canvasPtr,
+ Tk_Item *itemPtr, int index);
+static void CanvasSetOrigin(TkCanvas *canvasPtr,
+ int xOrigin, int yOrigin);
+static void CanvasUpdateScrollbars(TkCanvas *canvasPtr);
+static int CanvasWidgetCmd(ClientData clientData,
+ Tcl_Interp *interp, int argc,
+ 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);
+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,
+ Tk_Item *itemPtr);
#ifdef USE_OLD_TAG_SEARCH
-static int FindItems _ANSI_ARGS_((Tcl_Interp *interp,
- TkCanvas *canvasPtr, int argc, Tcl_Obj *CONST *argv,
- Tcl_Obj *newTagObj, int first));
+static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
+ int argc, Tcl_Obj *CONST *argv,
+ Tcl_Obj *newTagObj, int first);
#else /* USE_OLD_TAG_SEARCH */
-static int FindItems _ANSI_ARGS_((Tcl_Interp *interp,
- TkCanvas *canvasPtr, int argc, Tcl_Obj *CONST *argv,
+static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr,
+ int argc, Tcl_Obj *CONST *argv,
Tcl_Obj *newTagObj, int first,
- TagSearch **searchPtrPtr));
+ TagSearch **searchPtrPtr);
#endif /* USE_OLD_TAG_SEARCH */
-static int FindArea _ANSI_ARGS_((Tcl_Interp *interp,
- TkCanvas *canvasPtr, Tcl_Obj *CONST *argv, Tk_Uid uid,
- int enclosed));
-static double GridAlign _ANSI_ARGS_((double coord, double spacing));
-static CONST char** GetStringsFromObjs _ANSI_ARGS_((int argc,
- Tcl_Obj *CONST *objv));
-static void InitCanvas _ANSI_ARGS_((void));
+static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr,
+ 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 void InitCanvas(void);
#ifdef USE_OLD_TAG_SEARCH
-static Tk_Item * NextItem _ANSI_ARGS_((TagSearch *searchPtr));
+static Tk_Item * NextItem(TagSearch *searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
-static void PickCurrentItem _ANSI_ARGS_((TkCanvas *canvasPtr,
- XEvent *eventPtr));
-static Tcl_Obj * ScrollFractions _ANSI_ARGS_((int screen1,
- int screen2, int object1, int object2));
+static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr);
+static Tcl_Obj * ScrollFractions(int screen1,
+ int screen2, int object1, int object2);
#ifdef USE_OLD_TAG_SEARCH
-static void RelinkItems _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Obj *tag, Tk_Item *prevPtr));
-static Tk_Item * StartTagSearch _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Obj *tag, TagSearch *searchPtr));
+static void RelinkItems(TkCanvas *canvasPtr,
+ Tcl_Obj *tag, Tk_Item *prevPtr);
+static Tk_Item * StartTagSearch(TkCanvas *canvasPtr,
+ Tcl_Obj *tag, TagSearch *searchPtr);
#else /* USE_OLD_TAG_SEARCH */
-static int RelinkItems _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Obj *tag, Tk_Item *prevPtr,
- TagSearch **searchPtrPtr));
-static void TagSearchExprInit _ANSI_ARGS_ ((
- TagSearchExpr **exprPtrPtr));
-static void TagSearchExprDestroy _ANSI_ARGS_((TagSearchExpr *expr));
-static void TagSearchDestroy _ANSI_ARGS_((TagSearch *searchPtr));
-static int TagSearchScan _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Obj *tag, TagSearch **searchPtrPtr));
-static int TagSearchScanExpr _ANSI_ARGS_((Tcl_Interp *interp,
- TagSearch *searchPtr, TagSearchExpr *expr));
-static int TagSearchEvalExpr _ANSI_ARGS_((TagSearchExpr *expr,
- Tk_Item *itemPtr));
-static Tk_Item * TagSearchFirst _ANSI_ARGS_((TagSearch *searchPtr));
-static Tk_Item * TagSearchNext _ANSI_ARGS_((TagSearch *searchPtr));
+static int RelinkItems(TkCanvas *canvasPtr, Tcl_Obj *tag,
+ Tk_Item *prevPtr, TagSearch **searchPtrPtr);
+static void TagSearchExprInit(TagSearchExpr **exprPtrPtr);
+static void TagSearchExprDestroy(TagSearchExpr *expr);
+static void TagSearchDestroy(TagSearch *searchPtr);
+static int TagSearchScan(TkCanvas *canvasPtr,
+ Tcl_Obj *tag, TagSearch **searchPtrPtr);
+static int TagSearchScanExpr(Tcl_Interp *interp,
+ TagSearch *searchPtr, TagSearchExpr *expr);
+static int TagSearchEvalExpr(TagSearchExpr *expr,
+ Tk_Item *itemPtr);
+static Tk_Item * TagSearchFirst(TagSearch *searchPtr);
+static Tk_Item * TagSearchNext(TagSearch *searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
/*
- * The structure below defines canvas class behavior by means of procedures
+ * The structure below defines canvas class behavior by means of functions
* that can be invoked from generic window code.
*/
@@ -344,15 +328,38 @@ static Tk_ClassProcs canvasClass = {
CanvasWorldChanged, /* worldChangedProc */
};
+/*
+ * Macros that significantly simplify all code that finds items.
+ */
+
+#ifdef USE_OLD_TAG_SEARCH
+#define FIRST_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
+ (itemPtr) = StartTagSearch(canvasPtr,(objPtr),&search)
+#define FOR_EVERY_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
+ for ((itemPtr) = StartTagSearch(canvasPtr, (objPtr), &search); \
+ (itemPtr) != NULL; (itemPtr) = NextItem(&search))
+#else /* USE_OLD_TAG_SEARCH */
+#define FIRST_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
+ if ((result=TagSearchScan(canvasPtr,(objPtr),(searchPtrPtr))) != TCL_OK){ \
+ errorExitClause; \
+ } \
+ itemPtr = TagSearchFirst(*(searchPtrPtr));
+#define FOR_EVERY_CANVAS_ITEM_MATCHING(objPtr,searchPtrPtr,errorExitClause) \
+ if ((result=TagSearchScan(canvasPtr,(objPtr),(searchPtrPtr))) != TCL_OK){ \
+ errorExitClause; \
+ } \
+ for (itemPtr = TagSearchFirst(*(searchPtrPtr)); \
+ itemPtr != NULL; itemPtr = TagSearchNext(*(searchPtrPtr)))
+#endif /* USE_OLD_TAG_SEARCH */
+
/*
*--------------------------------------------------------------
*
* Tk_CanvasObjCmd --
*
- * This procedure is invoked to process the "canvas" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This function is invoked to process the "canvas" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -364,16 +371,15 @@ static Tk_ClassProcs canvasClass = {
*/
int
-Tk_CanvasObjCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- Tcl_Obj *CONST argv[]; /* Argument objects. */
+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. */
{
Tk_Window tkwin = (Tk_Window) clientData;
TkCanvas *canvasPtr;
- Tk_Window new;
+ Tk_Window newWin;
if (typeList == NULL) {
InitCanvas();
@@ -384,21 +390,20 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
- new = Tk_CreateWindowFromPath(interp, tkwin,
- Tcl_GetString(argv[1]), (char *) NULL);
- if (new == NULL) {
+ newWin = Tk_CreateWindowFromPath(interp,tkwin,Tcl_GetString(argv[1]),NULL);
+ if (newWin == NULL) {
return TCL_ERROR;
}
/*
- * Initialize fields that won't be initialized by ConfigureCanvas,
- * or which ConfigureCanvas expects to have reasonable values
- * (e.g. resource pointers).
+ * Initialize fields that won't be initialized by ConfigureCanvas, or
+ * which ConfigureCanvas expects to have reasonable values (e.g. resource
+ * pointers).
*/
canvasPtr = (TkCanvas *) ckalloc(sizeof(TkCanvas));
- canvasPtr->tkwin = new;
- canvasPtr->display = Tk_Display(new);
+ canvasPtr->tkwin = newWin;
+ canvasPtr->display = Tk_Display(newWin);
canvasPtr->interp = interp;
canvasPtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(canvasPtr->tkwin), CanvasWidgetCmd,
@@ -460,8 +465,8 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
canvasPtr->hotPrevPtr = NULL;
canvasPtr->cursor = None;
canvasPtr->takeFocus = NULL;
- canvasPtr->pixelsPerMM = WidthOfScreen(Tk_Screen(new));
- canvasPtr->pixelsPerMM /= WidthMMOfScreen(Tk_Screen(new));
+ canvasPtr->pixelsPerMM = WidthOfScreen(Tk_Screen(newWin));
+ canvasPtr->pixelsPerMM /= WidthMMOfScreen(Tk_Screen(newWin));
canvasPtr->flags = 0;
canvasPtr->nextId = 1;
canvasPtr->psInfo = NULL;
@@ -492,7 +497,7 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
Tcl_SetResult(interp, Tk_PathName(canvasPtr->tkwin), TCL_STATIC);
return TCL_OK;
- error:
+ error:
Tk_DestroyWindow(canvasPtr->tkwin);
return TCL_ERROR;
}
@@ -502,9 +507,9 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
*
* CanvasWidgetCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -516,22 +521,21 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
*/
static int
-CanvasWidgetCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about canvas
- * widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+CanvasWidgetCmd(
+ ClientData clientData, /* Information about canvas widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
- int c, length, result;
- Tk_Item *itemPtr = NULL; /* Initialization needed only to
- * prevent compiler warning. */
+ int c, result;
+ Tk_Item *itemPtr = NULL; /* Initialization needed only to prevent
+ * compiler warning. */
#ifdef USE_OLD_TAG_SEARCH
TagSearch search;
#else /* USE_OLD_TAG_SEARCH */
- TagSearch *searchPtr = NULL; /* Allocated by first TagSearchScan
- * Freed by TagSearchDestroy */
+ TagSearch *searchPtr = NULL;/* Allocated by first TagSearchScan, freed by
+ * TagSearchDestroy */
#endif /* USE_OLD_TAG_SEARCH */
int index;
@@ -569,7 +573,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_OK;
switch ((enum options) index) {
- case CANV_ADDTAG: {
+ case CANV_ADDTAG:
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg arg ...?");
result = TCL_ERROR;
@@ -581,13 +585,12 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = FindItems(interp, canvasPtr, objc, objv, objv[2], 3, &searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
break;
- }
- case CANV_BBOX: {
+ case CANV_BBOX: {
int i, gotAny;
- int x1 = 0, y1 = 0, x2 = 0, y2 = 0; /* Initializations needed
- * only to prevent compiler
- * warnings. */
+ int x1 = 0, y1 = 0, x2 = 0, y2 = 0; /* Initializations needed only
+ * to prevent overcautious
+ * compiler warnings. */
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?tagOrId ...?");
@@ -596,17 +599,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
gotAny = 0;
for (i = 2; i < objc; i++) {
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[i], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[i], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
-
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[i], &searchPtr, goto done) {
if ((itemPtr->x1 >= itemPtr->x2)
|| (itemPtr->y1 >= itemPtr->y2)) {
continue;
@@ -635,13 +628,13 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
if (gotAny) {
char buf[TCL_INTEGER_SPACE * 4];
-
+
sprintf(buf, "%d %d %d %d", x1, y1, x2, y2);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
break;
- }
- case CANV_BIND: {
+ }
+ case CANV_BIND: {
ClientData object;
if ((objc < 3) || (objc > 5)) {
@@ -651,8 +644,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
/*
- * Figure out what object to use for the binding (individual
- * item vs. tag).
+ * Figure out what object to use for the binding (individual item vs.
+ * tag).
*/
object = 0;
@@ -674,7 +667,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if (object == 0) {
Tcl_AppendResult(interp, "item \"", Tcl_GetString(objv[2]),
- "\" doesn't exist", (char *) NULL);
+ "\" doesn't exist", NULL);
result = TCL_ERROR;
goto done;
}
@@ -683,13 +676,15 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
object = (ClientData) Tk_GetUid(Tcl_GetString(objv[2]));
}
#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
+ result = TagSearchScan(canvasPtr, objv[2], &searchPtr);
+ if (result != TCL_OK) {
goto done;
}
- if (searchPtr->type == 1) {
+ if (searchPtr->type == SEARCH_TYPE_ID) {
Tcl_HashEntry *entryPtr;
- entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable, (char *) searchPtr->id);
+ entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable,
+ (char *) INT2PTR(searchPtr->id));
if (entryPtr != NULL) {
itemPtr = (Tk_Item *) Tcl_GetHashValue(entryPtr);
object = (ClientData) itemPtr;
@@ -697,7 +692,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if (object == 0) {
Tcl_AppendResult(interp, "item \"", Tcl_GetString(objv[2]),
- "\" doesn't exist", (char *) NULL);
+ "\" doesn't exist", NULL);
result = TCL_ERROR;
goto done;
}
@@ -707,8 +702,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
#endif /* USE_OLD_TAG_SEARCH */
/*
- * Make a binding table if the canvas doesn't already have
- * one.
+ * Make a binding table if the canvas doesn't already have one.
*/
if (canvasPtr->bindingTable == NULL) {
@@ -718,18 +712,19 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if (objc == 5) {
int append = 0;
unsigned long mask;
- char* argv4 = Tcl_GetStringFromObj(objv[4],NULL);
+ char* argv4 = Tcl_GetString(objv[4]);
if (argv4[0] == 0) {
result = Tk_DeleteBinding(interp, canvasPtr->bindingTable,
- object, Tcl_GetStringFromObj(objv[3], NULL));
+ object, Tcl_GetString(objv[3]));
goto done;
}
#ifndef USE_OLD_TAG_SEARCH
- if (searchPtr->type == 4) {
- /*
- * if new tag expression, then insert in linked list
- */
+ if (searchPtr->type == SEARCH_TYPE_EXPR) {
+ /*
+ * If new tag expression, then insert in linked list.
+ */
+
TagSearchExpr *expr, **lastPtr;
lastPtr = &(canvasPtr->bindTagExprs);
@@ -741,25 +736,27 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
if (!expr) {
/*
- * transfer ownership of expr to bindTagExprs list
+ * Transfer ownership of expr to bindTagExprs list.
*/
+
*lastPtr = searchPtr->expr;
searchPtr->expr->next = NULL;
/*
- * flag in TagSearch that expr has changed ownership
- * so that TagSearchDestroy doesn't try to free it
+ * Flag in TagSearch that expr has changed ownership so
+ * that TagSearchDestroy doesn't try to free it.
*/
+
searchPtr->expr = NULL;
}
- }
+ }
#endif /* not USE_OLD_TAG_SEARCH */
if (argv4[0] == '+') {
argv4++;
append = 1;
}
mask = Tk_CreateBinding(interp, canvasPtr->bindingTable,
- object, Tcl_GetStringFromObj(objv[3],NULL), argv4, append);
+ object, Tcl_GetString(objv[3]), argv4, append);
if (mask == 0) {
result = TCL_ERROR;
goto done;
@@ -770,27 +767,28 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
|EnterWindowMask|LeaveWindowMask|KeyPressMask
|KeyReleaseMask|PointerMotionMask|VirtualEventMask)) {
Tk_DeleteBinding(interp, canvasPtr->bindingTable,
- object, Tcl_GetStringFromObj(objv[3], NULL));
+ 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", (char *) NULL);
+ "events may be used", NULL);
result = TCL_ERROR;
goto done;
}
} else if (objc == 4) {
CONST char *command;
-
+
command = Tk_GetBinding(interp, canvasPtr->bindingTable,
- object, Tcl_GetStringFromObj(objv[3], NULL));
+ object, Tcl_GetString(objv[3]));
if (command == NULL) {
CONST char *string;
- string = Tcl_GetStringResult(interp);
+ string = Tcl_GetStringResult(interp);
+
/*
- * Ignore missing binding errors. This is a special hack
- * that relies on the error message returned by FindSequence
- * in tkBind.c.
+ * Ignore missing binding errors. This is a special hack that
+ * relies on the error message returned by FindSequence in
+ * tkBind.c.
*/
if (string[0] != '\0') {
@@ -806,8 +804,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
Tk_GetAllBindings(interp, canvasPtr->bindingTable, object);
}
break;
- }
- case CANV_CANVASX: {
+ }
+ case CANV_CANVASX: {
int x;
double grid;
char buf[TCL_DOUBLE_SPACE];
@@ -834,8 +832,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
Tcl_PrintDouble(interp, GridAlign((double) x, grid), buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
- }
- case CANV_CANVASY: {
+ }
+ case CANV_CANVASY: {
int y;
double grid;
char buf[TCL_DOUBLE_SPACE];
@@ -862,8 +860,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
Tcl_PrintDouble(interp, GridAlign((double) y, grid), buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
- }
- case CANV_CGET: {
+ }
+ case CANV_CGET:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "option");
result = TCL_ERROR;
@@ -872,11 +870,10 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = Tk_ConfigureValue(interp, canvasPtr->tkwin, configSpecs,
(char *) canvasPtr, Tcl_GetString(objv[2]), 0);
break;
- }
- case CANV_CONFIGURE: {
+ case CANV_CONFIGURE:
if (objc == 2) {
result = Tk_ConfigureInfo(interp, canvasPtr->tkwin, configSpecs,
- (char *) canvasPtr, (char *) NULL, 0);
+ (char *) canvasPtr, NULL, 0);
} else if (objc == 3) {
result = Tk_ConfigureInfo(interp, canvasPtr->tkwin, configSpecs,
(char *) canvasPtr, Tcl_GetString(objv[2]), 0);
@@ -885,43 +882,37 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
TK_CONFIG_ARGV_ONLY);
}
break;
- }
- case CANV_COORDS: {
+ case CANV_COORDS:
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?x y x y ...?");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- itemPtr = TagSearchFirst(searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ 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 = GetStringsFromObjs(objc-3, objv+3);
- result = (*itemPtr->typePtr->coordProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args);
- if (args) ckfree((char *) args);
- }
+ 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);
+ }
+ }
}
if (objc != 3) {
EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
}
}
break;
- }
- case CANV_CREATE: {
+ case CANV_CREATE: {
Tk_ItemType *typePtr;
Tk_ItemType *matchPtr = NULL;
Tk_Item *itemPtr;
@@ -929,6 +920,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
int isNew = 0;
Tcl_HashEntry *entryPtr;
char *arg;
+ int length;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg arg ...?");
@@ -940,13 +932,12 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
Tcl_MutexLock(&typeListMutex);
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) == 0)) {
if (matchPtr != NULL) {
Tcl_MutexUnlock(&typeListMutex);
- badType:
+ badType:
Tcl_AppendResult(interp,
- "unknown or ambiguous item type \"",
- arg, "\"", (char *) NULL);
+ "unknown or ambiguous item type \"",arg,"\"",NULL);
result = TCL_ERROR;
goto done;
}
@@ -984,10 +975,12 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
itemPtr, objc-3, objv+3);
} else {
- CONST char **args = GetStringsFromObjs(objc-3, objv+3);
+ CONST char **args = TkGetStringsFromObjs(objc-3, objv+3);
result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
itemPtr, objc-3, (Tcl_Obj **) args);
- if (args) ckfree((char *) args);
+ if (args != NULL) {
+ ckfree((char *) args);
+ }
}
if (result != TCL_OK) {
ckfree((char *) itemPtr);
@@ -996,7 +989,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
itemPtr->nextPtr = NULL;
entryPtr = Tcl_CreateHashEntry(&canvasPtr->idTable,
- (char *) itemPtr->id, &isNew);
+ (char *) INT2PTR(itemPtr->id), &isNew);
Tcl_SetHashValue(entryPtr, itemPtr);
itemPtr->prevPtr = canvasPtr->lastItemPtr;
canvasPtr->hotPtr = itemPtr;
@@ -1013,8 +1006,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
sprintf(buf, "%d", itemPtr->id);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
- }
- case CANV_DCHARS: {
+ }
+ case CANV_DCHARS: {
int first, last;
int x1,x2,y1,y2;
@@ -1023,37 +1016,32 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if ((itemPtr->typePtr->indexProc == NULL)
|| (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);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
+ &first);
} else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[3], NULL), &first);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(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);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[4],
+ &last);
} else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[4], NULL), &last);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr,
+ Tcl_GetString(objv[4]), &last);
}
if (result != TCL_OK) {
goto done;
@@ -1063,10 +1051,10 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
/*
- * Redraw both item's old and new areas: it's possible
- * that a delete could result in a new area larger than
- * the old area. Except if the insertProc sets the
- * TK_ITEM_DONT_REDRAW flag, nothing more needs to be done.
+ * Redraw both item's old and new areas: it's possible that a
+ * delete could result in a new area larger than the old area.
+ * Except if the insertProc sets the TK_ITEM_DONT_REDRAW flag,
+ * nothing more needs to be done.
*/
x1 = itemPtr->x1; y1 = itemPtr->y1;
@@ -1082,22 +1070,13 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
}
break;
- }
- case CANV_DELETE: {
+ }
+ case CANV_DELETE: {
int i;
Tcl_HashEntry *entryPtr;
for (i = 2; i < objc; i++) {
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[i], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[i], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[i], &searchPtr, goto done) {
EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
if (canvasPtr->bindingTable != NULL) {
Tk_DeleteAllBindings(canvasPtr->bindingTable,
@@ -1109,7 +1088,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
ckfree((char *) itemPtr->tagPtr);
}
entryPtr = Tcl_FindHashEntry(&canvasPtr->idTable,
- (char *) itemPtr->id);
+ (char *) INT2PTR(itemPtr->id));
Tcl_DeleteHashEntry(entryPtr);
if (itemPtr->nextPtr != NULL) {
itemPtr->nextPtr->prevPtr = itemPtr->prevPtr;
@@ -1148,8 +1127,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
}
break;
- }
- case CANV_DTAG: {
+ }
+ case CANV_DTAG: {
Tk_Uid tag;
int i;
@@ -1159,20 +1138,11 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
goto done;
}
if (objc == 4) {
- tag = Tk_GetUid(Tcl_GetStringFromObj(objv[3], NULL));
+ tag = Tk_GetUid(Tcl_GetString(objv[3]));
} else {
- tag = Tk_GetUid(Tcl_GetStringFromObj(objv[2], NULL));
+ tag = Tk_GetUid(Tcl_GetString(objv[2]));
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
for (i = itemPtr->numTags-1; i >= 0; i--) {
if (itemPtr->tagPtr[i] == tag) {
itemPtr->tagPtr[i] = itemPtr->tagPtr[itemPtr->numTags-1];
@@ -1181,22 +1151,21 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
}
break;
- }
- case CANV_FIND: {
+ }
+ case CANV_FIND:
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "searchCommand ?arg arg ...?");
result = TCL_ERROR;
goto done;
}
#ifdef USE_OLD_TAG_SEARCH
- result = FindItems(interp, canvasPtr, objc, objv, (Tcl_Obj *) NULL, 2);
+ result = FindItems(interp, canvasPtr, objc, objv, NULL, 2);
#else /* USE_OLD_TAG_SEARCH */
- result = FindItems(interp, canvasPtr, objc, objv,
- (Tcl_Obj *) NULL, 2, &searchPtr);
+ result = FindItems(interp, canvasPtr, objc, objv, NULL, 2,
+ &searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
break;
- }
- case CANV_FOCUS: {
+ case CANV_FOCUS:
if (objc > 3) {
Tcl_WrongNumArgs(interp, 2, objv, "?tagOrId?");
result = TCL_ERROR;
@@ -1206,7 +1175,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if (objc == 2) {
if (itemPtr != NULL) {
char buf[TCL_INTEGER_SPACE];
-
+
sprintf(buf, "%d", itemPtr->id);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
@@ -1215,20 +1184,11 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if ((itemPtr != NULL) && (canvasPtr->textInfo.gotFocus)) {
EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
}
- if (Tcl_GetStringFromObj(objv[2], NULL)[0] == 0) {
+ if (Tcl_GetString(objv[2])[0] == 0) {
canvasPtr->textInfo.focusItemPtr = NULL;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if (itemPtr->typePtr->icursorProc != NULL) {
break;
}
@@ -1241,21 +1201,13 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
EventuallyRedrawItem((Tk_Canvas) canvasPtr, itemPtr);
}
break;
- }
- case CANV_GETTAGS: {
+ case CANV_GETTAGS:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- itemPtr = TagSearchFirst(searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
int i;
for (i = 0; i < itemPtr->numTags; i++) {
@@ -1263,8 +1215,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
}
break;
- }
- case CANV_ICURSOR: {
+ case CANV_ICURSOR: {
int index;
if (objc != 4) {
@@ -1272,26 +1223,19 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if ((itemPtr->typePtr->indexProc == NULL)
|| (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);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
+ &index);
} else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[3], NULL), &index);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[3]),
+ &index);
}
if (result != TCL_OK) {
goto done;
@@ -1304,9 +1248,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
}
break;
- }
- case CANV_INDEX: {
-
+ }
+ case CANV_INDEX: {
int index;
char buf[TCL_INTEGER_SPACE];
@@ -1315,23 +1258,14 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if (itemPtr->typePtr->indexProc != NULL) {
break;
}
}
if (itemPtr == NULL) {
Tcl_AppendResult(interp, "can't find an indexable item \"",
- Tcl_GetStringFromObj(objv[2], NULL), "\"", (char *) NULL);
+ Tcl_GetString(objv[2]), "\"", NULL);
result = TCL_ERROR;
goto done;
}
@@ -1340,7 +1274,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
itemPtr, (char *) objv[3], &index);
} else {
result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[3], NULL), &index);
+ itemPtr, Tcl_GetString(objv[3]), &index);
}
if (result != TCL_OK) {
goto done;
@@ -1348,8 +1282,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
sprintf(buf, "%d", index);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
break;
- }
- case CANV_INSERT: {
+ }
+ case CANV_INSERT: {
int beforeThis;
int x1,x2,y1,y2;
@@ -1358,37 +1292,29 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
if ((itemPtr->typePtr->indexProc == NULL)
|| (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);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[3],
+ &beforeThis);
} else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[3], NULL), &beforeThis);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[3]),
+ &beforeThis);
}
if (result != TCL_OK) {
goto done;
}
/*
- * Redraw both item's old and new areas: it's possible
- * that an insertion could result in a new area either
- * larger or smaller than the old area. Except if the
- * insertProc sets the TK_ITEM_DONT_REDRAW flag, nothing
- * more needs to be done.
+ * Redraw both item's old and new areas: it's possible that an
+ * insertion could result in a new area either larger or smaller
+ * than the old area. Except if the insertProc sets the
+ * TK_ITEM_DONT_REDRAW flag, nothing more needs to be done.
*/
x1 = itemPtr->x1; y1 = itemPtr->y1;
@@ -1399,7 +1325,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
itemPtr, beforeThis, (char *) objv[4]);
} else {
(*itemPtr->typePtr->insertProc)((Tk_Canvas) canvasPtr,
- itemPtr, beforeThis, Tcl_GetStringFromObj(objv[4], NULL));
+ itemPtr, beforeThis, Tcl_GetString(objv[4]));
}
if (!(itemPtr->redraw_flags & TK_ITEM_DONT_REDRAW)) {
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
@@ -1409,48 +1335,31 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW;
}
break;
- }
- case CANV_ITEMCGET: {
+ }
+ case CANV_ITEMCGET:
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId option");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- itemPtr = TagSearchFirst(searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ 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_GetStringFromObj(objv[3], NULL), 0);
+ Tcl_GetString(objv[3]), 0);
}
break;
- }
- case CANV_ITEMCONFIGURE: {
+ case CANV_ITEMCONFIGURE:
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?option value ...?");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ 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,
- (char *) NULL, 0);
+ NULL, 0);
} else if (objc == 4) {
result = Tk_ConfigureInfo(canvasPtr->interp, canvasPtr->tkwin,
itemPtr->typePtr->configSpecs, (char *) itemPtr,
@@ -1458,15 +1367,17 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
} 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);
+ result = (*itemPtr->typePtr->configProc)(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3,
+ TK_CONFIG_ARGV_ONLY);
} else {
- CONST char **args = GetStringsFromObjs(objc-3, objv+3);
- result = (*itemPtr->typePtr->configProc)(interp,
- (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args,
- TK_CONFIG_ARGV_ONLY);
- if (args) ckfree((char *) args);
+ 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);
canvasPtr->flags |= REPICK_NEEDED;
@@ -1476,8 +1387,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
}
break;
- }
- case CANV_LOWER: {
+ case CANV_LOWER: {
Tk_Item *itemPtr;
if ((objc != 3) && (objc != 4)) {
@@ -1487,24 +1397,16 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
/*
- * First find the item just after which we'll insert the
- * named items.
+ * First find the item just after which we'll insert the named items.
*/
if (objc == 3) {
itemPtr = NULL;
} else {
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, objv[3], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[3], &searchPtr)) != TCL_OK) {
- goto done;
- }
- itemPtr = TagSearchFirst(searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ FIRST_CANVAS_ITEM_MATCHING(objv[3], &searchPtr, goto done);
if (itemPtr == NULL) {
Tcl_AppendResult(interp, "tag \"", Tcl_GetString(objv[3]),
- "\" doesn't match any items", (char *) NULL);
+ "\" doesn't match any items", NULL);
goto done;
}
itemPtr = itemPtr->prevPtr;
@@ -1512,13 +1414,11 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
#ifdef USE_OLD_TAG_SEARCH
RelinkItems(canvasPtr, objv[2], itemPtr);
#else /* USE_OLD_TAG_SEARCH */
- if ((result = RelinkItems(canvasPtr, objv[2], itemPtr, &searchPtr)) != TCL_OK) {
- goto done;
- }
+ result = RelinkItems(canvasPtr, objv[2], itemPtr, &searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
break;
- }
- case CANV_MOVE: {
+ }
+ case CANV_MOVE: {
double xAmount, yAmount;
if (objc != 5) {
@@ -1532,16 +1432,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ 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);
@@ -1549,14 +1440,17 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
canvasPtr->flags |= REPICK_NEEDED;
}
break;
- }
- case CANV_POSTSCRIPT: {
- CONST char **args = GetStringsFromObjs(objc, objv);
+ }
+ case CANV_POSTSCRIPT: {
+ CONST char **args = TkGetStringsFromObjs(objc, objv);
+
result = TkCanvPostscriptCmd(canvasPtr, interp, objc, args);
- if (args) ckfree((char *) args);
+ if (args != NULL) {
+ ckfree((char *) args);
+ }
break;
- }
- case CANV_RAISE: {
+ }
+ case CANV_RAISE: {
Tk_Item *prevPtr;
if ((objc != 3) && (objc != 4)) {
@@ -1566,29 +1460,19 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
/*
- * First find the item just after which we'll insert the
- * named items.
+ * First find the item just after which we'll insert the named items.
*/
if (objc == 3) {
prevPtr = canvasPtr->lastItemPtr;
} else {
prevPtr = NULL;
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[3], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[3], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[3], &searchPtr, goto done) {
prevPtr = itemPtr;
}
if (prevPtr == NULL) {
- Tcl_AppendResult(interp, "tagOrId \"", Tcl_GetStringFromObj(objv[3], NULL),
- "\" doesn't match any items", (char *) NULL);
+ Tcl_AppendResult(interp, "tagOrId \"", Tcl_GetString(objv[3]),
+ "\" doesn't match any items", NULL);
result = TCL_ERROR;
goto done;
}
@@ -1596,14 +1480,11 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
#ifdef USE_OLD_TAG_SEARCH
RelinkItems(canvasPtr, objv[2], prevPtr);
#else /* USE_OLD_TAG_SEARCH */
- result = RelinkItems(canvasPtr, objv[2], prevPtr, &searchPtr);
- if (result != TCL_OK) {
- goto done;
- }
+ result = RelinkItems(canvasPtr, objv[2], prevPtr, &searchPtr);
#endif /* USE_OLD_TAG_SEARCH */
break;
- }
- case CANV_SCALE: {
+ }
+ case CANV_SCALE: {
double xOrigin, yOrigin, xScale, yScale;
if (objc != 7) {
@@ -1625,16 +1506,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ 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);
@@ -1642,9 +1514,9 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
canvasPtr->flags |= REPICK_NEEDED;
}
break;
- }
- case CANV_SCAN: {
- int x, y, gain=10;
+ }
+ case CANV_SCAN: {
+ int x, y, gain = 10;
static CONST char *optionStrings[] = {
"mark", "dragto", NULL
};
@@ -1686,8 +1558,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
CanvasSetOrigin(canvasPtr, newXOrigin, newYOrigin);
}
break;
- }
- case CANV_SELECT: {
+ }
+ case CANV_SELECT: {
int index, optionindex;
static CONST char *optionStrings[] = {
"adjust", "clear", "from", "item", "to", NULL
@@ -1702,16 +1574,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
goto done;
}
if (objc >= 4) {
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, objv[3], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[3], &searchPtr)) != TCL_OK) {
- goto done;
- }
- for (itemPtr = TagSearchFirst(searchPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(searchPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[3], &searchPtr, goto done) {
if ((itemPtr->typePtr->indexProc != NULL)
&& (itemPtr->typePtr->selectionProc != NULL)){
break;
@@ -1720,30 +1583,32 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
if (itemPtr == NULL) {
Tcl_AppendResult(interp,
"can't find an indexable and selectable item \"",
- Tcl_GetStringFromObj(objv[3], NULL), "\"", (char *) NULL);
+ Tcl_GetString(objv[3]), "\"", NULL);
result = TCL_ERROR;
goto done;
}
}
if (objc == 5) {
if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, (char *) objv[4], &index);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, (char *) objv[4],
+ &index);
} else {
- result = itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr,
- itemPtr, Tcl_GetStringFromObj(objv[4], NULL), &index);
+ result = itemPtr->typePtr->indexProc(interp,
+ (Tk_Canvas) canvasPtr, itemPtr, Tcl_GetString(objv[4]),
+ &index);
}
if (result != TCL_OK) {
goto done;
}
}
- if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings, "select option", 0,
- &optionindex) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings,
+ "select option", 0, &optionindex) != TCL_OK) {
result = TCL_ERROR;
goto done;
}
switch ((enum options) optionindex) {
- case CANV_ADJUST: {
+ case CANV_ADJUST:
if (objc != 5) {
Tcl_WrongNumArgs(interp, 3, objv, "tagOrId index");
result = TCL_ERROR;
@@ -1761,10 +1626,9 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
CanvasSelectTo(canvasPtr, itemPtr, index);
break;
- }
- case CANV_CLEAR: {
+ case CANV_CLEAR:
if (objc != 3) {
- Tcl_AppendResult(interp, 3, objv, (char *) NULL);
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
result = TCL_ERROR;
goto done;
}
@@ -1775,8 +1639,7 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
goto done;
break;
- }
- case CANV_FROM: {
+ case CANV_FROM:
if (objc != 5) {
Tcl_WrongNumArgs(interp, 3, objv, "tagOrId index");
result = TCL_ERROR;
@@ -1785,22 +1648,18 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
canvasPtr->textInfo.anchorItemPtr = itemPtr;
canvasPtr->textInfo.selectAnchor = index;
break;
- }
- case CANV_ITEM: {
+ case CANV_ITEM:
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
result = TCL_ERROR;
goto done;
}
if (canvasPtr->textInfo.selItemPtr != NULL) {
- char buf[TCL_INTEGER_SPACE];
-
- sprintf(buf, "%d", canvasPtr->textInfo.selItemPtr->id);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj(canvasPtr->textInfo.selItemPtr->id));
}
break;
- }
- case CANV_TO: {
+ case CANV_TO:
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "tagOrId index");
result = TCL_ERROR;
@@ -1808,30 +1667,21 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
}
CanvasSelectTo(canvasPtr, itemPtr, index);
break;
- }
}
break;
- }
- case CANV_TYPE: {
+ }
+ case CANV_TYPE:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "tag");
result = TCL_ERROR;
goto done;
}
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, objv[2], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if ((result = TagSearchScan(canvasPtr, objv[2], &searchPtr)) != TCL_OK) {
- goto done;
- }
- itemPtr = TagSearchFirst(searchPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
Tcl_SetResult(interp, itemPtr->typePtr->name, TCL_STATIC);
}
break;
- }
- case CANV_XVIEW: {
+ case CANV_XVIEW: {
int count, type;
int newX = 0; /* Initialization needed only to prevent
* gcc warnings. */
@@ -1844,84 +1694,89 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
- canvasPtr->inset, canvasPtr->scrollX1,
canvasPtr->scrollX2));
} else {
- CONST char **args = GetStringsFromObjs(objc, objv);
+ CONST char **args = TkGetStringsFromObjs(objc, objv);
type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
- if (args) ckfree((char *) args);
+ if (args != NULL) {
+ ckfree((char *) args);
+ }
switch (type) {
- case TK_SCROLL_ERROR:
- result = TCL_ERROR;
- goto done;
- case TK_SCROLL_MOVETO:
- newX = canvasPtr->scrollX1 - canvasPtr->inset
- + (int) (fraction * (canvasPtr->scrollX2
- - canvasPtr->scrollX1) + 0.5);
- break;
- case TK_SCROLL_PAGES:
- newX = (int) (canvasPtr->xOrigin + count * .9
- * (Tk_Width(canvasPtr->tkwin) - 2*canvasPtr->inset));
- break;
- case TK_SCROLL_UNITS:
- if (canvasPtr->xScrollIncrement > 0) {
- newX = canvasPtr->xOrigin
- + count*canvasPtr->xScrollIncrement;
- } else {
- newX = (int) (canvasPtr->xOrigin + count * .1
- * (Tk_Width(canvasPtr->tkwin)
- - 2*canvasPtr->inset));
- }
- break;
+ case TK_SCROLL_ERROR:
+ result = TCL_ERROR;
+ goto done;
+ case TK_SCROLL_MOVETO:
+ newX = canvasPtr->scrollX1 - canvasPtr->inset
+ + (int) (fraction * (canvasPtr->scrollX2
+ - canvasPtr->scrollX1) + 0.5);
+ break;
+ case TK_SCROLL_PAGES:
+ newX = (int) (canvasPtr->xOrigin + count * .9
+ * (Tk_Width(canvasPtr->tkwin) - 2*canvasPtr->inset));
+ break;
+ case TK_SCROLL_UNITS:
+ if (canvasPtr->xScrollIncrement > 0) {
+ newX = canvasPtr->xOrigin
+ + count*canvasPtr->xScrollIncrement;
+ } else {
+ newX = (int) (canvasPtr->xOrigin + count * .1
+ * (Tk_Width(canvasPtr->tkwin)
+ - 2*canvasPtr->inset));
+ }
+ break;
}
CanvasSetOrigin(canvasPtr, newX, canvasPtr->yOrigin);
}
break;
- }
- case CANV_YVIEW: {
+ }
+ case CANV_YVIEW: {
int count, type;
int newY = 0; /* Initialization needed only to prevent
* gcc warnings. */
double fraction;
if (objc == 2) {
- Tcl_SetObjResult(interp,ScrollFractions(\
+ Tcl_SetObjResult(interp, ScrollFractions(
canvasPtr->yOrigin + canvasPtr->inset,
canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)
- - canvasPtr->inset, canvasPtr->scrollY1,
- canvasPtr->scrollY2));
+ - canvasPtr->inset,
+ canvasPtr->scrollY1, canvasPtr->scrollY2));
} else {
- CONST char **args = GetStringsFromObjs(objc, objv);
+ CONST char **args = TkGetStringsFromObjs(objc, objv);
type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count);
- if (args) ckfree((char *) args);
+ if (args != NULL) {
+ ckfree((char *) args);
+ }
switch (type) {
- case TK_SCROLL_ERROR:
- result = TCL_ERROR;
- goto done;
- case TK_SCROLL_MOVETO:
- newY = canvasPtr->scrollY1 - canvasPtr->inset
- + (int) (fraction*(canvasPtr->scrollY2
- - canvasPtr->scrollY1) + 0.5);
- break;
- case TK_SCROLL_PAGES:
- newY = (int) (canvasPtr->yOrigin + count * .9
+ case TK_SCROLL_ERROR:
+ result = TCL_ERROR;
+ goto done;
+ case TK_SCROLL_MOVETO:
+ newY = canvasPtr->scrollY1 - canvasPtr->inset
+ + (int) (fraction*(canvasPtr->scrollY2
+ - canvasPtr->scrollY1) + 0.5);
+ break;
+ case TK_SCROLL_PAGES:
+ newY = (int) (canvasPtr->yOrigin + count * .9
+ * (Tk_Height(canvasPtr->tkwin)
+ - 2*canvasPtr->inset));
+ break;
+ case TK_SCROLL_UNITS:
+ if (canvasPtr->yScrollIncrement > 0) {
+ newY = canvasPtr->yOrigin
+ + count*canvasPtr->yScrollIncrement;
+ } else {
+ newY = (int) (canvasPtr->yOrigin + count * .1
* (Tk_Height(canvasPtr->tkwin)
- 2*canvasPtr->inset));
- break;
- case TK_SCROLL_UNITS:
- if (canvasPtr->yScrollIncrement > 0) {
- newY = canvasPtr->yOrigin
- + count*canvasPtr->yScrollIncrement;
- } else {
- newY = (int) (canvasPtr->yOrigin + count * .1
- * (Tk_Height(canvasPtr->tkwin)
- - 2*canvasPtr->inset));
- }
- break;
+ }
+ break;
}
CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, newY);
}
break;
- }
}
- done:
+ }
+
+ done:
#ifndef USE_OLD_TAG_SEARCH
TagSearchDestroy(searchPtr);
#endif /* not USE_OLD_TAG_SEARCH */
@@ -1934,9 +1789,9 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
*
* DestroyCanvas --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a canvas at a safe time
- * (when no-one is using it anymore).
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of a canvas at a safe time (when no-one is
+ * using it anymore).
*
* Results:
* None.
@@ -1948,8 +1803,8 @@ CanvasWidgetCmd(clientData, interp, objc, objv)
*/
static void
-DestroyCanvas(memPtr)
- char *memPtr; /* Info about canvas widget. */
+DestroyCanvas(
+ char *memPtr) /* Info about canvas widget. */
{
TkCanvas *canvasPtr = (TkCanvas *) memPtr;
Tk_Item *itemPtr;
@@ -1973,9 +1828,8 @@ DestroyCanvas(memPtr)
}
/*
- * Free up all the stuff that requires special handling,
- * then let Tk_FreeOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeOptions handle all the standard option-related stuff.
*/
Tcl_DeleteHashTable(&canvasPtr->idTable);
@@ -1989,7 +1843,7 @@ DestroyCanvas(memPtr)
TagSearchExprDestroy(expr);
expr = next;
}
-#endif
+#endif /* USE_OLD_TAG_SEARCH */
Tcl_DeleteTimerHandler(canvasPtr->insertBlinkHandler);
if (canvasPtr->bindingTable != NULL) {
Tk_DeleteBindingTable(canvasPtr->bindingTable);
@@ -2004,33 +1858,33 @@ DestroyCanvas(memPtr)
*
* ConfigureCanvas --
*
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a canvas widget.
+ * This function is called to process an objv/objc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a canvas
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as colors, border width,
- * etc. get set for canvasPtr; old resources get freed,
- * if there were any.
+ * Configuration information, such as colors, border width, etc. get set
+ * for canvasPtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- 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. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureCanvas(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
XGCValues gcValues;
- GC new;
+ GC newGC;
+ Tk_State old_canvas_state=canvasPtr->canvas_state;
if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
objc, (CONST char **) objv, (char *) canvasPtr,
@@ -2039,9 +1893,8 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
}
/*
- * A few options need special processing, such as setting the
- * background from a 3-D border and creating a GC for copying
- * bits to the screen.
+ * A few options need special processing, such as setting the background
+ * from a 3-D border and creating a GC for copying bits to the screen.
*/
Tk_SetBackgroundFromBorder(canvasPtr->tkwin, canvasPtr->bgBorder);
@@ -2054,12 +1907,33 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
gcValues.function = GXcopy;
gcValues.graphics_exposures = False;
gcValues.foreground = Tk_3DBorderColor(canvasPtr->bgBorder)->pixel;
- new = Tk_GetGC(canvasPtr->tkwin,
+ newGC = Tk_GetGC(canvasPtr->tkwin,
GCFunction|GCGraphicsExposures|GCForeground, &gcValues);
if (canvasPtr->pixmapGC != None) {
Tk_FreeGC(canvasPtr->display, canvasPtr->pixmapGC);
}
- canvasPtr->pixmapGC = new;
+ canvasPtr->pixmapGC = newGC;
+
+ /*
+ * Reconfigure items to reflect changed state disabled/normal.
+ */
+
+ if ( old_canvas_state != canvasPtr->canvas_state ) {
+ Tk_Item *itemPtr;
+ int result;
+
+ for ( itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
+ itemPtr = itemPtr->nextPtr) {
+ if ( itemPtr->state == TK_STATE_NULL ) {
+ result = (*itemPtr->typePtr->configProc)(canvasPtr->interp,
+ (Tk_Canvas) canvasPtr, itemPtr, 0, NULL,
+ TK_CONFIG_ARGV_ONLY);
+ if (result != TCL_OK) {
+ Tcl_ResetResult(canvasPtr->interp);
+ }
+ }
+ }
+ }
/*
* Reset the desired dimensions for the window.
@@ -2069,8 +1943,8 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
canvasPtr->height + 2*canvasPtr->inset);
/*
- * Restart the cursor timing sequence in case the on-time or off-time
- * just changed.
+ * Restart the cursor timing sequence in case the on-time or off-time just
+ * changed.
*/
if (canvasPtr->textInfo.gotFocus) {
@@ -2095,7 +1969,7 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
}
if (argc2 != 4) {
Tcl_AppendResult(interp, "bad scrollRegion \"",
- canvasPtr->regionString, "\"", (char *) NULL);
+ canvasPtr->regionString, "\"", NULL);
badRegion:
ckfree(canvasPtr->regionString);
ckfree((char *) argv2);
@@ -2132,8 +2006,8 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
}
/*
- * Reset the canvas's origin (this is a no-op unless confine
- * mode has just been turned on or the scroll region has changed).
+ * Reset the canvas's origin (this is a no-op unless confine mode has just
+ * been turned on or the scroll region has changed).
*/
CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin);
@@ -2150,24 +2024,24 @@ ConfigureCanvas(interp, canvasPtr, objc, objv, flags)
*
* CanvasWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Configures all items in the canvas with a empty argc/argv, for
- * the side effect of causing all the items to recompute their
- * geometry and to be redisplayed.
+ * Configures all items in the canvas with a empty argc/argv, for the
+ * side effect of causing all the items to recompute their geometry and
+ * to be redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
static void
-CanvasWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+CanvasWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
TkCanvas *canvasPtr;
Tk_Item *itemPtr;
@@ -2195,9 +2069,9 @@ CanvasWorldChanged(instanceData)
*
* DisplayCanvas --
*
- * This procedure redraws the contents of a canvas 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 function redraws the contents of a canvas 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.
@@ -2209,8 +2083,8 @@ CanvasWorldChanged(instanceData)
*/
static void
-DisplayCanvas(clientData)
- ClientData clientData; /* Information about widget. */
+DisplayCanvas(
+ ClientData clientData) /* Information about widget. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
Tk_Window tkwin = canvasPtr->tkwin;
@@ -2227,8 +2101,8 @@ DisplayCanvas(clientData)
}
/*
- * Choose a new current item if that is needed (this could cause
- * event handlers to be invoked).
+ * Choose a new current item if that is needed (this could cause event
+ * handlers to be invoked).
*/
while (canvasPtr->flags & REPICK_NEEDED) {
@@ -2243,9 +2117,9 @@ DisplayCanvas(clientData)
}
/*
- * Scan through the item list, registering the bounding box
- * for all items that didn't do that for the final coordinates
- * yet. This can be determined by the FORCE_REDRAW flag.
+ * Scan through the item list, registering the bounding box for all items
+ * that didn't do that for the final coordinates yet. This can be
+ * determined by the FORCE_REDRAW flag.
*/
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
@@ -2257,8 +2131,8 @@ DisplayCanvas(clientData)
}
}
/*
- * Compute the intersection between the area that needs redrawing
- * and the area that's visible on the screen.
+ * Compute the intersection between the area that needs redrawing and the
+ * area that's visible on the screen.
*/
if ((canvasPtr->redrawX1 < canvasPtr->redrawX2)
@@ -2282,43 +2156,39 @@ DisplayCanvas(clientData)
if ((screenX1 >= screenX2) || (screenY1 >= screenY2)) {
goto borders;
}
-
+
width = screenX2 - screenX1;
height = screenY2 - screenY1;
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * Redrawing is done in a temporary pixmap that is allocated
- * here and freed at the end of the procedure. All drawing
- * is done to the pixmap, and the pixmap is copied to the
- * screen at the end of the procedure. The temporary pixmap
- * serves two purposes:
+ * Redrawing is done in a temporary pixmap that is allocated here and
+ * freed at the end of the function. All drawing is done to the
+ * pixmap, and the pixmap is copied to the screen at the end of the
+ * function. The temporary pixmap serves two purposes:
*
- * 1. It provides a smoother visual effect (no clearing and
- * gradual redraw will be visible to users).
- * 2. It allows us to redraw only the objects that overlap
- * the redraw area. Otherwise incorrect results could
- * occur from redrawing things that stick outside of
- * the redraw area (we'd have to redraw everything in
- * order to make the overlaps look right).
+ * 1. It provides a smoother visual effect (no clearing and gradual
+ * redraw will be visible to users).
+ * 2. It allows us to redraw only the objects that overlap the redraw
+ * area. Otherwise incorrect results could occur from redrawing
+ * things that stick outside of the redraw area (we'd have to
+ * redraw everything in order to make the overlaps look right).
*
* Some tricky points about the pixmap:
*
- * 1. We only allocate a large enough pixmap to hold the
- * area that has to be redisplayed. This saves time in
- * in the X server for large objects that cover much
- * more than the area being redisplayed: only the area
- * of the pixmap will actually have to be redrawn.
- * 2. Some X servers (e.g. the one for DECstations) have troubles
- * with characters that overlap an edge of the pixmap (on the
- * DEC servers, as of 8/18/92, such characters are drawn one
- * pixel too far to the right). To handle this problem,
- * make the pixmap a bit larger than is absolutely needed
- * so that for normal-sized fonts the characters that overlap
- * the edge of the pixmap will be outside the area we care
- * about.
+ * 1. We only allocate a large enough pixmap to hold the area that has
+ * to be redisplayed. This saves time in in the X server for large
+ * objects that cover much more than the area being redisplayed:
+ * only the area of the pixmap will actually have to be redrawn.
+ * 2. Some X servers (e.g. the one for DECstations) have troubles with
+ * with characters that overlap an edge of the pixmap (on the DEC
+ * servers, as of 8/18/92, such characters are drawn one pixel too
+ * far to the right). To handle this problem, make the pixmap a bit
+ * larger than is absolutely needed so that for normal-sized fonts
+ * the characters that overlap the edge of the pixmap will be
+ * outside the area we care about.
*/
-
+
canvasPtr->drawableXOrigin = screenX1 - 30;
canvasPtr->drawableYOrigin = screenY1 - 30;
pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin),
@@ -2333,24 +2203,24 @@ DisplayCanvas(clientData)
screenX1 - canvasPtr->xOrigin, screenY1 - canvasPtr->yOrigin,
width, height);
#endif /* TK_NO_DOUBLE_BUFFERING */
-
+
/*
* Clear the area to be redrawn.
*/
-
+
XFillRectangle(Tk_Display(tkwin), pixmap, canvasPtr->pixmapGC,
screenX1 - canvasPtr->drawableXOrigin,
screenY1 - canvasPtr->drawableYOrigin, (unsigned int) width,
(unsigned int) height);
-
+
/*
- * Scan through the item list, redrawing those items that need it.
- * An item must be redraw if either (a) it intersects the smaller
+ * Scan through the item list, redrawing those items that need it. An
+ * item must be redraw if either (a) it intersects the smaller
* on-screen area or (b) it intersects the full canvas area and its
- * type requests that it be redrawn always (e.g. so subwindows can
- * be unmapped when they move off-screen).
+ * type requests that it be redrawn always (e.g. so subwindows can be
+ * unmapped when they move off-screen).
*/
-
+
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
itemPtr = itemPtr->nextPtr) {
if ((itemPtr->x1 >= screenX2)
@@ -2374,13 +2244,13 @@ DisplayCanvas(clientData)
canvasPtr->display, pixmap, screenX1, screenY1, width,
height);
}
-
+
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * Copy from the temporary pixmap to the screen, then free up
- * the temporary pixmap.
+ * Copy from the temporary pixmap to the screen, then free up the
+ * temporary pixmap.
*/
-
+
XCopyArea(Tk_Display(tkwin), pixmap, Tk_WindowId(tkwin),
canvasPtr->pixmapGC,
screenX1 - canvasPtr->drawableXOrigin,
@@ -2397,7 +2267,7 @@ DisplayCanvas(clientData)
* Draw the window borders, if needed.
*/
- borders:
+ borders:
if (canvasPtr->flags & REDRAW_BORDERS) {
canvasPtr->flags &= ~REDRAW_BORDERS;
if (canvasPtr->borderWidth > 0) {
@@ -2425,7 +2295,7 @@ DisplayCanvas(clientData)
}
}
- done:
+ done:
canvasPtr->flags &= ~(REDRAW_PENDING|BBOX_NOT_EMPTY);
canvasPtr->redrawX1 = canvasPtr->redrawX2 = 0;
canvasPtr->redrawY1 = canvasPtr->redrawY2 = 0;
@@ -2439,23 +2309,23 @@ DisplayCanvas(clientData)
*
* CanvasEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on canvases.
+ * This function is invoked by the Tk dispatcher for various events on
+ * canvases.
*
* 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.
*
*--------------------------------------------------------------
*/
static void
-CanvasEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+CanvasEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
@@ -2490,8 +2360,8 @@ CanvasEventProc(clientData, eventPtr)
canvasPtr->flags |= UPDATE_SCROLLBARS;
/*
- * The call below is needed in order to recenter the canvas if
- * it's confined and its scroll region is smaller than the window.
+ * The call below is needed in order to recenter the canvas if it's
+ * confined and its scroll region is smaller than the window.
*/
CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin);
@@ -2512,9 +2382,9 @@ CanvasEventProc(clientData, eventPtr)
Tk_Item *itemPtr;
/*
- * Special hack: if the canvas is unmapped, then must notify
- * all items with "alwaysRedraw" set, so that they know that
- * they are no longer displayed.
+ * Special hack: if the canvas is unmapped, then must notify all items
+ * with "alwaysRedraw" set, so that they know that they are no longer
+ * displayed.
*/
for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
@@ -2532,9 +2402,9 @@ CanvasEventProc(clientData, eventPtr)
*
* CanvasCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -2546,17 +2416,17 @@ CanvasEventProc(clientData, eventPtr)
*/
static void
-CanvasCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+CanvasCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
Tk_Window tkwin = canvasPtr->tkwin;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (tkwin != NULL) {
@@ -2570,8 +2440,8 @@ CanvasCmdDeletedProc(clientData)
*
* Tk_CanvasEventuallyRedraw --
*
- * Arrange for part or all of a canvas widget to redrawn at
- * some convenient time in the future.
+ * Arrange for part or all of a canvas widget to redrawn at some
+ * convenient time in the future.
*
* Results:
* None.
@@ -2583,18 +2453,20 @@ CanvasCmdDeletedProc(clientData)
*/
void
-Tk_CanvasEventuallyRedraw(canvas, x1, y1, x2, y2)
- Tk_Canvas canvas; /* Information about widget. */
- int x1, y1; /* Upper left corner of area to redraw.
- * Pixels on edge are redrawn. */
- int x2, y2; /* Lower right corner of area to redraw.
+Tk_CanvasEventuallyRedraw(
+ Tk_Canvas canvas, /* Information about widget. */
+ int x1, int y1, /* Upper left corner of area to redraw. Pixels
+ * on edge are redrawn. */
+ int x2, int y2) /* Lower right corner of area to redraw.
* Pixels on edge are not redrawn. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
+
/*
* If tkwin is NULL, the canvas has been destroyed, so we can't really
* redraw it.
*/
+
if (canvasPtr->tkwin == NULL) {
return;
}
@@ -2636,8 +2508,8 @@ Tk_CanvasEventuallyRedraw(canvas, x1, y1, x2, y2)
*
* EventuallyRedrawItem --
*
- * Arrange for part or all of a canvas widget to redrawn at
- * some convenient time in the future.
+ * Arrange for part or all of a canvas widget to redrawn at some
+ * convenient time in the future.
*
* Results:
* None.
@@ -2649,9 +2521,9 @@ Tk_CanvasEventuallyRedraw(canvas, x1, y1, x2, y2)
*/
static void
-EventuallyRedrawItem(canvas, itemPtr)
- Tk_Canvas canvas; /* Information about widget. */
- Tk_Item *itemPtr; /* item to be redrawn. */
+EventuallyRedrawItem(
+ Tk_Canvas canvas, /* Information about widget. */
+ Tk_Item *itemPtr) /* Item to be redrawn. */
{
TkCanvas *canvasPtr = (TkCanvas *) canvas;
if ((itemPtr->x1 >= itemPtr->x2) || (itemPtr->y1 >= itemPtr->y2) ||
@@ -2697,27 +2569,26 @@ EventuallyRedrawItem(canvas, itemPtr)
*
* Tk_CreateItemType --
*
- * This procedure may be invoked to add a new kind of canvas
- * element to the core item types supported by Tk.
+ * This function may be invoked to add a new kind of canvas element to
+ * the core item types supported by Tk.
*
* Results:
* None.
*
* Side effects:
- * From now on, the new item type will be useable in canvas
- * widgets (e.g. typePtr->name can be used as the item type
- * in "create" widget commands). If there was already a
- * type with the same name as in typePtr, it is replaced with
- * the new type.
+ * From now on, the new item type will be useable in canvas widgets
+ * (e.g. typePtr->name can be used as the item type in "create" widget
+ * commands). If there was already a type with the same name as in
+ * typePtr, it is replaced with the new type.
*
*--------------------------------------------------------------
*/
void
-Tk_CreateItemType(typePtr)
- Tk_ItemType *typePtr; /* Information about item type;
- * storage must be statically
- * allocated (must live forever). */
+Tk_CreateItemType(
+ Tk_ItemType *typePtr) /* Information about item type; storage must
+ * be statically allocated (must live
+ * forever). */
{
Tk_ItemType *typePtr2, *prevPtr;
@@ -2751,14 +2622,14 @@ Tk_CreateItemType(typePtr)
*
* Tk_GetItemTypes --
*
- * This procedure returns a pointer to the list of all item
- * types. Note that this is inherently thread-unsafe, but since
- * item types are only ever registered very rarely this is
- * unlikely to be a problem in practice.
+ * This function returns a pointer to the list of all item types. Note
+ * that this is inherently thread-unsafe, but since item types are only
+ * ever registered very rarely this is unlikely to be a problem in
+ * practice.
*
* Results:
- * The return value is a pointer to the first in the list
- * of item types currently supported by canvases.
+ * The return value is a pointer to the first in the list of item types
+ * currently supported by canvases.
*
* Side effects:
* None.
@@ -2767,7 +2638,7 @@ Tk_CreateItemType(typePtr)
*/
Tk_ItemType *
-Tk_GetItemTypes()
+Tk_GetItemTypes(void)
{
if (typeList == NULL) {
InitCanvas();
@@ -2776,13 +2647,12 @@ Tk_GetItemTypes()
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* InitCanvas --
*
- * This procedure is invoked to perform once-only-ever
- * initialization for the module, such as setting up the type
- * table.
+ * This function is invoked to perform once-only-ever initialization for
+ * the module, such as setting up the type table.
*
* Results:
* None.
@@ -2790,11 +2660,11 @@ Tk_GetItemTypes()
* Side effects:
* None.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-InitCanvas()
+InitCanvas(void)
{
Tcl_MutexLock(&typeListMutex);
if (typeList != NULL) {
@@ -2820,33 +2690,30 @@ InitCanvas()
*
* StartTagSearch --
*
- * This procedure is called to initiate an enumeration of
- * all items in a given canvas that contain a given tag.
+ * This function is called to initiate an enumeration of all items in a
+ * given canvas that contain a given tag.
*
* Results:
- * The return value is a pointer to the first item in
- * canvasPtr that matches tag, or NULL if there is no
- * such item. The information at *searchPtr is initialized
- * such that successive calls to NextItem will return
- * successive items that match tag.
+ * The return value is a pointer to the first item in canvasPtr that
+ * matches tag, or NULL if there is no such item. The information at
+ * *searchPtr is initialized such that successive calls to NextItem will
+ * return successive items that match tag.
*
* Side effects:
- * SearchPtr is linked into a list of searches in progress
- * on canvasPtr, so that elements can safely be deleted
- * while the search is in progress. EndTagSearch must be
- * called at the end of the search to unlink searchPtr from
- * this list.
+ * SearchPtr is linked into a list of searches in progress on canvasPtr,
+ * so that elements can safely be deleted while the search is in
+ * progress. EndTagSearch must be called at the end of the search to
+ * unlink searchPtr from this list.
*
*--------------------------------------------------------------
*/
static Tk_Item *
-StartTagSearch(canvasPtr, tagObj, searchPtr)
- TkCanvas *canvasPtr; /* Canvas whose items are to be
- * searched. */
- Tcl_Obj *tagObj; /* Object giving tag value. */
- TagSearch *searchPtr; /* Record describing tag search;
- * will be initialized here. */
+StartTagSearch(
+ TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */
+ Tcl_Obj *tagObj, /* Object giving tag value. */
+ TagSearch *searchPtr) /* Record describing tag search; will be
+ * initialized here. */
{
int id;
Tk_Item *itemPtr, *lastPtr;
@@ -2868,10 +2735,10 @@ StartTagSearch(canvasPtr, tagObj, searchPtr)
searchPtr->searchOver = 0;
/*
- * Find the first matching item in one of several ways. If the tag
- * is a number then it selects the single item with the matching
- * identifier. In this case see if the item being requested is the
- * hot item, in which case the search can be skipped.
+ * Find the first matching item in one of several ways. If the tag is a
+ * number then it selects the single item with the matching identifier.
+ * In this case see if the item being requested is the hot item, in which
+ * case the search can be skipped.
*/
if (isdigit(UCHAR(*tag))) {
@@ -2882,7 +2749,7 @@ StartTagSearch(canvasPtr, tagObj, searchPtr)
id = strtoul(tag, &end, 0);
if (*end == 0) {
itemPtr = canvasPtr->hotPtr;
- lastPtr = canvasPtr->hotPrevPtr;
+ lastPtr = canvasPtr->hotPrevPtr;
if ((itemPtr == NULL) || (itemPtr->id != id) || (lastPtr == NULL)
|| (lastPtr->nextPtr != itemPtr)) {
dispPtr->numSlowSearches++;
@@ -2915,7 +2782,7 @@ StartTagSearch(canvasPtr, tagObj, searchPtr)
}
/*
- * None of the above. Search for an item with a matching tag.
+ * None of the above. Search for an item with a matching tag.
*/
for (lastPtr = NULL, itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL;
@@ -2939,15 +2806,15 @@ StartTagSearch(canvasPtr, tagObj, searchPtr)
*
* NextItem --
*
- * This procedure returns successive items that match a given
- * tag; it should be called only after StartTagSearch has been
- * used to begin a search.
+ * This function returns successive items that match a given tag; it
+ * should be called only after StartTagSearch has been used to begin a
+ * search.
*
* Results:
- * The return value is a pointer to the next item that matches
- * the tag specified to StartTagSearch, or NULL if no such
- * item exists. *SearchPtr is updated so that the next call
- * to this procedure will return the next item.
+ * The return value is a pointer to the next item that matches the tag
+ * specified to StartTagSearch, or NULL if no such item exists.
+ * *SearchPtr is updated so that the next call to this function will
+ * return the next item.
*
* Side effects:
* None.
@@ -2956,9 +2823,8 @@ StartTagSearch(canvasPtr, tagObj, searchPtr)
*/
static Tk_Item *
-NextItem(searchPtr)
- TagSearch *searchPtr; /* Record describing search in
- * progress. */
+NextItem(
+ TagSearch *searchPtr) /* Record describing search in progress. */
{
Tk_Item *itemPtr, *lastPtr;
int count;
@@ -2966,8 +2832,8 @@ NextItem(searchPtr)
Tk_Uid *tagPtr;
/*
- * Find next item in list (this may not actually be a suitable
- * one to return), and return if there are no items left.
+ * Find next item in list (this may not actually be a suitable one to
+ * return), and return if there are no items left.
*/
lastPtr = searchPtr->lastPtr;
@@ -2982,10 +2848,10 @@ NextItem(searchPtr)
}
if (itemPtr != searchPtr->currentPtr) {
/*
- * The structure of the list has changed. Probably the
- * previously-returned item was removed from the list.
- * In this case, don't advance lastPtr; just return
- * its new successor (i.e. do nothing here).
+ * The structure of the list has changed. Probably the previously-
+ * returned item was removed from the list. In this case, don't
+ * advance lastPtr; just return its new successor (i.e. do nothing
+ * here).
*/
} else {
lastPtr = itemPtr;
@@ -3022,29 +2888,28 @@ NextItem(searchPtr)
return NULL;
}
-#else /* USE_OLD_TAG_SEARCH */
+#else /* !USE_OLD_TAG_SEARCH */
/*
*----------------------------------------------------------------------
*
* GetStaticUids --
*
- *This procedure is invoked to return a structure filled with
- *the Uids used when doing tag searching. If it was never before
- *called in the current thread, it initializes the structure for
- *that thread (uids are only ever local to one thread [Bug
- *1114977]).
+ * This function is invoked to return a structure filled with the Uids
+ * used when doing tag searching. If it was never before called in the
+ * current thread, it initializes the structure for that thread (uids are
+ * only ever local to one thread [Bug 1114977]).
*
* Results:
- *None.
+ * None.
*
* Side effects:
- *None.
+ * None.
*
*----------------------------------------------------------------------
*/
static SearchUids *
-GetStaticUids()
+GetStaticUids(void)
{
SearchUids *searchUids = (SearchUids *)
Tcl_GetThreadData(&dataKey, sizeof(SearchUids));
@@ -3069,7 +2934,7 @@ GetStaticUids()
*
* TagSearchExprInit --
*
- * This procedure allocates and initializes one TagSearchExpr struct.
+ * This function allocates and initializes one TagSearchExpr struct.
*
* Results:
*
@@ -3079,8 +2944,8 @@ GetStaticUids()
*/
static void
-TagSearchExprInit(exprPtrPtr)
- TagSearchExpr **exprPtrPtr;
+TagSearchExprInit(
+ TagSearchExpr **exprPtrPtr)
{
TagSearchExpr* expr = *exprPtrPtr;
@@ -3095,67 +2960,63 @@ TagSearchExprInit(exprPtrPtr)
expr->length = 0;
*exprPtrPtr = expr;
}
-
+
/*
*--------------------------------------------------------------
*
* TagSearchExprDestroy --
*
- * This procedure destroys one TagSearchExpr structure.
+ * This function destroys one TagSearchExpr structure.
*
* Results:
*
* Side effects:
*
*--------------------------------------------------------------
- */
+ */
static void
-TagSearchExprDestroy(expr)
- TagSearchExpr *expr;
+TagSearchExprDestroy(
+ TagSearchExpr *expr)
{
if (expr) {
if (expr->uids) {
- ckfree((char *)expr->uids);
+ ckfree((char *)expr->uids);
}
- ckfree((char *)expr);
+ ckfree((char *)expr);
}
}
-
+
/*
*--------------------------------------------------------------
*
* TagSearchScan --
*
- * This procedure is called to initiate an enumeration of
- * all items in a given canvas that contain a tag that matches
- * the tagOrId expression.
+ * This function is called to initiate an enumeration of all items in a
+ * given canvas that contain a tag that matches the tagOrId expression.
*
* Results:
- * The return value indicates if the tagOrId expression
- * was successfully scanned (syntax).
- * The information at *searchPtr is initialized
- * such that a call to TagSearchFirst, followed by
- * successive calls to TagSearchNext will return items
- * that match tag.
+ * The return value indicates if the tagOrId expression was successfully
+ * scanned (syntax). The information at *searchPtr is initialized such
+ * that a call to TagSearchFirst, followed by successive calls to
+ * TagSearchNext will return items that match tag.
*
* Side effects:
- * SearchPtr is linked into a list of searches in progress
- * on canvasPtr, so that elements can safely be deleted
- * while the search is in progress.
+ * SearchPtr is linked into a list of searches in progress on canvasPtr,
+ * so that elements can safely be deleted while the search is in
+ * progress.
*
*--------------------------------------------------------------
*/
static int
-TagSearchScan(canvasPtr, tagObj, searchPtrPtr)
- TkCanvas *canvasPtr; /* Canvas whose items are to be
- * searched. */
- Tcl_Obj *tagObj; /* Object giving tag value. */
- TagSearch **searchPtrPtr; /* Record describing tag search;
- * will be initialized here. */
+TagSearchScan(
+ TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */
+ Tcl_Obj *tagObj, /* Object giving tag value. */
+ TagSearch **searchPtrPtr) /* Record describing tag search; will be
+ * initialized here. */
{
- char *tag = Tcl_GetStringFromObj(tagObj,NULL);
+ char *tag = Tcl_GetString(tagObj);
int i;
TagSearch *searchPtr;
@@ -3164,61 +3025,78 @@ TagSearchScan(canvasPtr, tagObj, searchPtrPtr)
*/
if (*searchPtrPtr) {
- searchPtr = *searchPtrPtr;
+ searchPtr = *searchPtrPtr;
} else {
- /* Allocate primary search struct on first call */
- *searchPtrPtr = searchPtr = (TagSearch *) ckalloc(sizeof(TagSearch));
+ /*
+ * Allocate primary search struct on first call.
+ */
+
+ *searchPtrPtr = searchPtr = (TagSearch *) ckalloc(sizeof(TagSearch));
searchPtr->expr = NULL;
- /* Allocate buffer for rewritten tags (after de-escaping) */
- searchPtr->rewritebufferAllocated = 100;
- searchPtr->rewritebuffer =
- ckalloc(searchPtr->rewritebufferAllocated);
+ /*
+ * Allocate buffer for rewritten tags (after de-escaping).
+ */
+
+ searchPtr->rewritebufferAllocated = 100;
+ searchPtr->rewritebuffer = ckalloc(searchPtr->rewritebufferAllocated);
}
TagSearchExprInit(&(searchPtr->expr));
- /* How long is the tagOrId ? */
+ /*
+ * How long is the tagOrId?
+ */
+
searchPtr->stringLength = strlen(tag);
- /* Make sure there is enough buffer to hold rewritten tags */
+ /*
+ * Make sure there is enough buffer to hold rewritten tags.
+ */
+
if ((unsigned int)searchPtr->stringLength >=
searchPtr->rewritebufferAllocated) {
- searchPtr->rewritebufferAllocated = searchPtr->stringLength + 100;
- searchPtr->rewritebuffer =
- ckrealloc(searchPtr->rewritebuffer,
- searchPtr->rewritebufferAllocated);
+ searchPtr->rewritebufferAllocated = searchPtr->stringLength + 100;
+ searchPtr->rewritebuffer =
+ ckrealloc(searchPtr->rewritebuffer,
+ searchPtr->rewritebufferAllocated);
}
- /* Initialize search */
+ /*
+ * Initialize search.
+ */
+
searchPtr->canvasPtr = canvasPtr;
searchPtr->searchOver = 0;
- searchPtr->type = 0;
+ searchPtr->type = SEARCH_TYPE_EMPTY;
/*
- * Find the first matching item in one of several ways. If the tag
- * is a number then it selects the single item with the matching
- * identifier. In this case see if the item being requested is the
- * hot item, in which case the search can be skipped.
+ * Find the first matching item in one of several ways. If the tag is a
+ * number then it selects the single item with the matching identifier.
+ * In this case see if the item being requested is the hot item, in which
+ * case the search can be skipped.
*/
if (searchPtr->stringLength && isdigit(UCHAR(*tag))) {
- char *end;
+ char *end;
- searchPtr->id = strtoul(tag, &end, 0);
- if (*end == 0) {
- searchPtr->type = 1;
- return TCL_OK;
+ searchPtr->id = strtoul(tag, &end, 0);
+ if (*end == 0) {
+ searchPtr->type = SEARCH_TYPE_ID;
+ return TCL_OK;
}
}
/*
- * For all other tags and tag expressions convert to a UID.
- * This UID is kept forever, but this should be thought of
- * as a cache rather than as a memory leak.
+ * For all other tags and tag expressions convert to a UID. This UID is
+ * kept forever, but this should be thought of as a cache rather than as a
+ * memory leak.
*/
searchPtr->expr->uid = Tk_GetUid(tag);
- /* short circuit impossible searches for null tags */
+ /*
+ * Short circuit impossible searches for null tags.
+ */
+
if (searchPtr->stringLength == 0) {
return TCL_OK;
}
@@ -3227,55 +3105,58 @@ TagSearchScan(canvasPtr, tagObj, searchPtrPtr)
* Pre-scan tag for at least one unquoted "&&" "||" "^" "!"
* if not found then use string as simple tag
*/
+
for (i = 0; i < searchPtr->stringLength ; i++) {
- if (tag[i] == '"') {
- i++;
- for ( ; i < searchPtr->stringLength; i++) {
- if (tag[i] == '\\') {
- i++;
- continue;
- }
- if (tag[i] == '"') {
- break;
- }
- }
- } else {
- if ((tag[i] == '&' && tag[i+1] == '&')
- || (tag[i] == '|' && tag[i+1] == '|')
- || (tag[i] == '^')
- || (tag[i] == '!')) {
- searchPtr->type = 4;
- break;
- }
- }
+ if (tag[i] == '"') {
+ i++;
+ for ( ; i < searchPtr->stringLength; i++) {
+ if (tag[i] == '\\') {
+ i++;
+ continue;
+ }
+ if (tag[i] == '"') {
+ break;
+ }
+ }
+ } else if ((tag[i] == '&' && tag[i+1] == '&')
+ || (tag[i] == '|' && tag[i+1] == '|')
+ || (tag[i] == '^')
+ || (tag[i] == '!')) {
+ searchPtr->type = SEARCH_TYPE_EXPR;
+ break;
+ }
}
searchPtr->string = tag;
searchPtr->stringIndex = 0;
- if (searchPtr->type == 4) {
- /*
- * an operator was found in the prescan, so
- * now compile the tag expression into array of Tk_Uid
- * flagging any syntax errors found
- */
- if (TagSearchScanExpr(canvasPtr->interp, searchPtr, searchPtr->expr) != TCL_OK) {
- /* Syntax error in tag expression */
- /* Result message set by TagSearchScanExpr */
+ if (searchPtr->type == SEARCH_TYPE_EXPR) {
+ /*
+ * An operator was found in the prescan, so now compile the tag
+ * expression into array of Tk_Uid flagging any syntax errors found.
+ */
+
+ if (TagSearchScanExpr(canvasPtr->interp, searchPtr,
+ searchPtr->expr) != TCL_OK) {
+ /*
+ * Syntax error in tag expression. The result message was set by
+ * TagSearchScanExpr.
+ */
+
return TCL_ERROR;
}
searchPtr->expr->length = searchPtr->expr->index;
+ } else if (searchPtr->expr->uid == GetStaticUids()->allUid) {
+ /*
+ * All items match.
+ */
+
+ searchPtr->type = SEARCH_TYPE_ALL;
} else {
- if (searchPtr->expr->uid == GetStaticUids()->allUid) {
- /*
- * All items match.
- */
- searchPtr->type = 2;
- } else {
- /*
- * Optimized single-tag search
- */
- searchPtr->type = 3;
- }
+ /*
+ * Optimized single-tag search
+ */
+
+ searchPtr->type = SEARCH_TYPE_TAG;
}
return TCL_OK;
}
@@ -3285,24 +3166,26 @@ TagSearchScan(canvasPtr, tagObj, searchPtrPtr)
*
* TagSearchDestroy --
*
- * This procedure destroys any dynamic structures that
- * may have been allocated by TagSearchScan.
+ * This function destroys any dynamic structures that may have been
+ * allocated by TagSearchScan.
*
* Results:
+ * None
*
* Side effects:
+ * Deallocates memory.
*
*--------------------------------------------------------------
*/
static void
-TagSearchDestroy(searchPtr)
- TagSearch *searchPtr; /* Record describing tag search */
+TagSearchDestroy(
+ TagSearch *searchPtr) /* Record describing tag search */
{
if (searchPtr) {
- TagSearchExprDestroy(searchPtr->expr);
- ckfree((char *)searchPtr->rewritebuffer);
- ckfree((char *)searchPtr);
+ TagSearchExprDestroy(searchPtr->expr);
+ ckfree((char *)searchPtr->rewritebuffer);
+ ckfree((char *)searchPtr);
}
}
@@ -3311,16 +3194,14 @@ TagSearchDestroy(searchPtr)
*
* TagSearchScanExpr --
*
- * This recursive procedure is called to scan a tag expression
- * and compile it into an array of Tk_Uids.
+ * This recursive function is called to scan a tag expression and compile
+ * it into an array of Tk_Uids.
*
* Results:
- * The return value indicates if the tagOrId expression
- * was successfully scanned (syntax).
- * The information at *searchPtr is initialized
- * such that a call to TagSearchFirst, followed by
- * successive calls to TagSearchNext will return items
- * that match tag.
+ * The return value indicates if the tagOrId expression was successfully
+ * scanned (syntax). The information at *searchPtr is initialized such
+ * that a call to TagSearchFirst, followed by successive calls to
+ * TagSearchNext will return items that match tag.
*
* Side effects:
*
@@ -3328,216 +3209,233 @@ TagSearchDestroy(searchPtr)
*/
static int
-TagSearchScanExpr(interp, searchPtr, expr)
- Tcl_Interp *interp; /* Current interpreter. */
- TagSearch *searchPtr; /* Search data */
- TagSearchExpr *expr; /* compiled expression result */
+TagSearchScanExpr(
+ Tcl_Interp *interp, /* Current interpreter. */
+ 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 */
+ 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 */
char c;
SearchUids *searchUids; /* Collection of uids for basic search
* expression terms. */
-
+
searchUids = GetStaticUids();
negate_result = 0;
found_tag = 0;
looking_for_tag = 1;
while (searchPtr->stringIndex < searchPtr->stringLength) {
- c = searchPtr->string[searchPtr->stringIndex++];
+ c = searchPtr->string[searchPtr->stringIndex++];
- if (expr->allocated == expr->index) {
- expr->allocated += 15;
+ /*
+ * Need two slots free at this point, not one. [Bug 2931374]
+ */
+
+ 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 = (Tk_Uid *)
+ ckrealloc((char *)(expr->uids),
+ (expr->allocated)*sizeof(Tk_Uid));
} else {
- expr->uids =
- (Tk_Uid *) ckalloc((expr->allocated)*sizeof(Tk_Uid));
+ expr->uids = (Tk_Uid *)
+ ckalloc((expr->allocated)*sizeof(Tk_Uid));
}
- }
-
- if (looking_for_tag) {
-
- switch (c) {
- case ' ' : /* ignore unquoted whitespace */
- case '\t' :
- case '\n' :
- case '\r' :
- break;
-
- case '!' : /* negate next tag or subexpr */
- if (looking_for_tag > 1) {
- Tcl_AppendResult(interp,
- "Too many '!' in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- looking_for_tag++;
- negate_result = 1;
- break;
-
- case '(' : /* scan (negated) subexpr recursively */
- if (negate_result) {
- expr->uids[expr->index++] = searchUids->negparenUid;
- negate_result = 0;
- } else {
- expr->uids[expr->index++] = searchUids->parenUid;
+ }
+
+ if (looking_for_tag) {
+
+ switch (c) {
+ case ' ': /* ignore unquoted whitespace */
+ case '\t':
+ case '\n':
+ case '\r':
+ break;
+
+ case '!': /* negate next tag or subexpr */
+ if (looking_for_tag > 1) {
+ Tcl_AppendResult(interp,
+ "Too many '!' in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ looking_for_tag++;
+ negate_result = 1;
+ break;
+
+ case '(': /* scan (negated) subexpr recursively */
+ if (negate_result) {
+ expr->uids[expr->index++] = searchUids->negparenUid;
+ negate_result = 0;
+ } else {
+ expr->uids[expr->index++] = searchUids->parenUid;
+ }
+ if (TagSearchScanExpr(interp, searchPtr, expr) != TCL_OK) {
+ /*
+ * Result string should be already set by nested call to
+ * tag_expr_scan()
+ */
+
+ return TCL_ERROR;
+ }
+ looking_for_tag = 0;
+ found_tag = 1;
+ break;
+
+ case '"': /* quoted tag string */
+ if (negate_result) {
+ expr->uids[expr->index++] = searchUids->negtagvalUid;
+ negate_result = 0;
+ } else {
+ expr->uids[expr->index++] = searchUids->tagvalUid;
+ }
+ tag = searchPtr->rewritebuffer;
+ found_endquote = 0;
+ while (searchPtr->stringIndex < searchPtr->stringLength) {
+ c = searchPtr->string[searchPtr->stringIndex++];
+ if (c == '\\') {
+ c = searchPtr->string[searchPtr->stringIndex++];
}
- if (TagSearchScanExpr(interp, searchPtr, expr) != TCL_OK) {
- /* Result string should be already set
- * by nested call to tag_expr_scan() */
- return TCL_ERROR;
+ if (c == '"') {
+ found_endquote = 1;
+ break;
}
- looking_for_tag = 0;
- found_tag = 1;
- break;
-
- case '"' : /* quoted tag string */
- if (negate_result) {
- expr->uids[expr->index++] = searchUids->negtagvalUid;
- negate_result = 0;
- } else {
- expr->uids[expr->index++] = searchUids->tagvalUid;
+ *tag++ = c;
+ }
+ if (! found_endquote) {
+ Tcl_AppendResult(interp,
+ "Missing endquote in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ if (! (tag - searchPtr->rewritebuffer)) {
+ Tcl_AppendResult(interp,
+ "Null quoted tag string in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ *tag++ = '\0';
+ expr->uids[expr->index++] =
+ Tk_GetUid(searchPtr->rewritebuffer);
+ looking_for_tag = 0;
+ found_tag = 1;
+ break;
+
+ case '&': /* illegal chars when looking for tag */
+ case '|':
+ case '^':
+ case ')':
+ Tcl_AppendResult(interp,
+ "Unexpected operator in tag search expression",
+ NULL);
+ return TCL_ERROR;
+
+ default: /* unquoted tag string */
+ if (negate_result) {
+ expr->uids[expr->index++] = searchUids->negtagvalUid;
+ negate_result = 0;
+ } else {
+ expr->uids[expr->index++] = searchUids->tagvalUid;
+ }
+ tag = searchPtr->rewritebuffer;
+ *tag++ = c;
+
+ /*
+ * Copy rest of tag, including any embedded whitespace.
+ */
+
+ while (searchPtr->stringIndex < searchPtr->stringLength) {
+ c = searchPtr->string[searchPtr->stringIndex];
+ if (c == '!' || c == '&' || c == '|' || c == '^'
+ || c == '(' || c == ')' || c == '"') {
+ break;
}
- tag = searchPtr->rewritebuffer;
- found_endquote = 0;
- while (searchPtr->stringIndex < searchPtr->stringLength) {
- c = searchPtr->string[searchPtr->stringIndex++];
- if (c == '\\') {
- c = searchPtr->string[searchPtr->stringIndex++];
- }
- if (c == '"') {
- found_endquote = 1;
- break;
- }
- *tag++ = c;
- }
- if (! found_endquote) {
- Tcl_AppendResult(interp,
- "Missing endquote in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (! (tag - searchPtr->rewritebuffer)) {
- Tcl_AppendResult(interp,
- "Null quoted tag string in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- *tag++ = '\0';
- expr->uids[expr->index++] =
- Tk_GetUid(searchPtr->rewritebuffer);
- looking_for_tag = 0;
- found_tag = 1;
- break;
-
- case '&' : /* illegal chars when looking for tag */
- case '|' :
- case '^' :
- case ')' :
- Tcl_AppendResult(interp,
- "Unexpected operator in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
-
- default : /* unquoted tag string */
- if (negate_result) {
- expr->uids[expr->index++] = searchUids->negtagvalUid;
- negate_result = 0;
- } else {
- expr->uids[expr->index++] = searchUids->tagvalUid;
- }
- tag = searchPtr->rewritebuffer;
- *tag++ = c;
- /* copy rest of tag, including any embedded whitespace */
- while (searchPtr->stringIndex < searchPtr->stringLength) {
- c = searchPtr->string[searchPtr->stringIndex];
- if (c == '!' || c == '&' || c == '|' || c == '^'
- || c == '(' || c == ')' || c == '"') {
- break;
- }
- *tag++ = c;
- searchPtr->stringIndex++;
- }
- /* remove trailing whitespace */
- while (1) {
- c = *--tag;
- /* there must have been one non-whitespace char,
- * so this will terminate */
- if (c != ' ' && c != '\t' && c != '\n' && c != '\r') {
- break;
- }
- }
- *++tag = '\0';
- expr->uids[expr->index++] =
- Tk_GetUid(searchPtr->rewritebuffer);
- looking_for_tag = 0;
- found_tag = 1;
- }
-
- } else { /* ! looking_for_tag */
-
- switch (c) {
- case ' ' : /* ignore whitespace */
- case '\t' :
- case '\n' :
- case '\r' :
- break;
-
- case '&' : /* AND operator */
- c = searchPtr->string[searchPtr->stringIndex++];
- if (c != '&') {
- Tcl_AppendResult(interp,
- "Singleton '&' in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- expr->uids[expr->index++] = searchUids->andUid;
- looking_for_tag = 1;
- break;
-
- case '|' : /* OR operator */
- c = searchPtr->string[searchPtr->stringIndex++];
- if (c != '|') {
- Tcl_AppendResult(interp,
- "Singleton '|' in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- expr->uids[expr->index++] = searchUids->orUid;
- looking_for_tag = 1;
- break;
-
- case '^' : /* XOR operator */
- expr->uids[expr->index++] = searchUids->xorUid;
- looking_for_tag = 1;
- break;
-
- case ')' : /* end subexpression */
- expr->uids[expr->index++] = searchUids->endparenUid;
- goto breakwhile;
-
- default : /* syntax error */
- Tcl_AppendResult(interp,
- "Invalid boolean operator in tag search expression",
- (char *) NULL);
- return TCL_ERROR;
- }
- }
- }
- breakwhile:
+ *tag++ = c;
+ searchPtr->stringIndex++;
+ }
+
+ /*
+ * Remove trailing whitespace.
+ */
+
+ while (1) {
+ c = *--tag;
+
+ /*
+ * There must have been one non-whitespace char, so this
+ * will terminate.
+ */
+
+ if (c != ' ' && c != '\t' && c != '\n' && c != '\r') {
+ break;
+ }
+ }
+ *++tag = '\0';
+ expr->uids[expr->index++] =
+ Tk_GetUid(searchPtr->rewritebuffer);
+ looking_for_tag = 0;
+ found_tag = 1;
+ }
+
+ } else { /* ! looking_for_tag */
+ switch (c) {
+ case ' ': /* ignore whitespace */
+ case '\t':
+ case '\n':
+ case '\r':
+ break;
+
+ case '&': /* AND operator */
+ c = searchPtr->string[searchPtr->stringIndex++];
+ if (c != '&') {
+ Tcl_AppendResult(interp,
+ "Singleton '&' in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ expr->uids[expr->index++] = searchUids->andUid;
+ looking_for_tag = 1;
+ break;
+
+ case '|': /* OR operator */
+ c = searchPtr->string[searchPtr->stringIndex++];
+ if (c != '|') {
+ Tcl_AppendResult(interp,
+ "Singleton '|' in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ expr->uids[expr->index++] = searchUids->orUid;
+ looking_for_tag = 1;
+ break;
+
+ case '^' : /* XOR operator */
+ expr->uids[expr->index++] = searchUids->xorUid;
+ looking_for_tag = 1;
+ break;
+
+ case ')' : /* end subexpression */
+ expr->uids[expr->index++] = searchUids->endparenUid;
+ goto breakwhile;
+
+ default: /* syntax error */
+ Tcl_AppendResult(interp,
+ "Invalid boolean operator in tag search expression",
+ NULL);
+ return TCL_ERROR;
+ }
+ }
+ }
+
+ breakwhile:
if (found_tag && ! looking_for_tag) {
- return TCL_OK;
+ return TCL_OK;
}
- Tcl_AppendResult(interp, "Missing tag in tag search expression",
- (char *) NULL);
+ Tcl_AppendResult(interp, "Missing tag in tag search expression", NULL);
return TCL_ERROR;
}
@@ -3546,11 +3444,11 @@ TagSearchScanExpr(interp, searchPtr, expr)
*
* TagSearchEvalExpr --
*
- * This recursive procedure is called to eval a tag expression.
+ * This recursive function is called to eval a tag expression.
*
* Results:
- * The return value indicates if the tagOrId expression
- * successfully matched the tags of the current item.
+ * The return value indicates if the tagOrId expression successfully
+ * matched the tags of the current item.
*
* Side effects:
*
@@ -3558,18 +3456,17 @@ TagSearchScanExpr(interp, searchPtr, expr)
*/
static int
-TagSearchEvalExpr(expr, itemPtr)
- TagSearchExpr *expr; /* Search expression */
- Tk_Item *itemPtr; /* Item being test for match */
+TagSearchEvalExpr(
+ TagSearchExpr *expr, /* Search expression */
+ Tk_Item *itemPtr) /* Item being test for match */
{
- int looking_for_tag; /* When true, scanner expects
- * next char(s) to be a tag,
- * else operand expected */
- int negate_result; /* Pending negation of next tag value */
+ int looking_for_tag; /* When true, scanner expects next char(s) to
+ * be a tag, else operand expected. */
+ int negate_result; /* Pending negation of next tag value */
Tk_Uid uid;
Tk_Uid *tagPtr;
int count;
- int result; /* Value of expr so far */
+ int result; /* Value of expr so far */
int parendepth;
SearchUids *searchUids; /* Collection of uids for basic search
* expression terms. */
@@ -3580,77 +3477,84 @@ TagSearchEvalExpr(expr, itemPtr)
negate_result = 0;
looking_for_tag = 1;
while (expr->index < expr->length) {
- uid = expr->uids[expr->index++];
- if (looking_for_tag) {
- if (uid == searchUids->tagvalUid) {
+ uid = expr->uids[expr->index++];
+ if (looking_for_tag) {
+ if (uid == searchUids->tagvalUid) {
/*
- * assert(expr->index < expr->length);
+ * assert(expr->index < expr->length);
*/
- uid = expr->uids[expr->index++];
- result = 0;
- /*
- * set result 1 if tag is found in item's tags
- */
- for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
- count > 0; tagPtr++, count--) {
- if (*tagPtr == uid) {
- result = 1;
- break;
- }
- }
-
- } else if (uid == searchUids->negtagvalUid) {
- negate_result = ! negate_result;
+ uid = expr->uids[expr->index++];
+ result = 0;
+
+ /*
+ * set result 1 if tag is found in item's tags
+ */
+
+ for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
+ count > 0; tagPtr++, count--) {
+ if (*tagPtr == uid) {
+ result = 1;
+ break;
+ }
+ }
+
+ } else if (uid == searchUids->negtagvalUid) {
+ negate_result = ! negate_result;
/*
- * assert(expr->index < expr->length);
+ * assert(expr->index < expr->length);
*/
- uid = expr->uids[expr->index++];
- result = 0;
- /*
- * set result 1 if tag is found in item's tags
- */
- for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
- count > 0; tagPtr++, count--) {
- if (*tagPtr == uid) {
- result = 1;
- break;
- }
- }
-
- } else if (uid == searchUids->parenUid) {
- /*
- * evaluate subexpressions with recursion
- */
- result = TagSearchEvalExpr(expr, itemPtr);
-
- } else if (uid == searchUids->negparenUid) {
- negate_result = ! negate_result;
- /*
- * evaluate subexpressions with recursion
- */
- result = TagSearchEvalExpr(expr, itemPtr);
+ uid = expr->uids[expr->index++];
+ result = 0;
+
+ /*
+ * set result 1 if tag is found in item's tags
+ */
+
+ for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
+ count > 0; tagPtr++, count--) {
+ if (*tagPtr == uid) {
+ result = 1;
+ break;
+ }
+ }
+
+ } else if (uid == searchUids->parenUid) {
+ /*
+ * Evaluate subexpressions with recursion
+ */
+
+ result = TagSearchEvalExpr(expr, itemPtr);
+
+ } else if (uid == searchUids->negparenUid) {
+ negate_result = ! negate_result;
+
+ /*
+ * Evaluate subexpressions with recursion
+ */
+
+ result = TagSearchEvalExpr(expr, itemPtr);
/*
- * } else {
- * assert(0);
+ * } else {
+ * assert(0);
*/
- }
- if (negate_result) {
- result = ! result;
- negate_result = 0;
- }
- looking_for_tag = 0;
- } else { /* ! looking_for_tag */
- if (((uid == searchUids->andUid) && (!result)) ||
+ }
+ if (negate_result) {
+ result = ! result;
+ negate_result = 0;
+ }
+ looking_for_tag = 0;
+ } else { /* ! looking_for_tag */
+ if (((uid == searchUids->andUid) && (!result)) ||
((uid == searchUids->orUid) && result)) {
- /*
- * short circuit expression evaluation
- *
- * if result before && is 0, or result before || is 1,
- * then the expression is decided and no further
- * evaluation is needed.
- */
-
- parendepth = 0;
+ /*
+ * Short circuit expression evaluation.
+ *
+ * if result before && is 0, or result before || is 1, then
+ * the expression is decided and no further evaluation is
+ * needed.
+ */
+
+ parendepth = 0;
while (expr->index < expr->length) {
uid = expr->uids[expr->index++];
if (uid == searchUids->tagvalUid ||
@@ -3662,7 +3566,7 @@ TagSearchEvalExpr(expr, itemPtr)
uid == searchUids->negparenUid) {
parendepth++;
continue;
- }
+ }
if (uid == searchUids->endparenUid) {
parendepth--;
if (parendepth < 0) {
@@ -3670,24 +3574,24 @@ TagSearchEvalExpr(expr, itemPtr)
}
}
}
- return result;
+ return result;
- } else if (uid == searchUids->xorUid) {
- /*
- * if the previous result was 1
- * then negate the next result
- */
- negate_result = result;
+ } else if (uid == searchUids->xorUid) {
+ /*
+ * If the previous result was 1 then negate the next result.
+ */
- } else if (uid == searchUids->endparenUid) {
- return result;
+ negate_result = result;
+
+ } else if (uid == searchUids->endparenUid) {
+ return result;
/*
- * } else {
- * assert(0);
+ * } else {
+ * assert(0);
*/
- }
- looking_for_tag = 1;
- }
+ }
+ looking_for_tag = 1;
+ }
}
/*
* assert(! looking_for_tag);
@@ -3700,104 +3604,103 @@ TagSearchEvalExpr(expr, itemPtr)
*
* TagSearchFirst --
*
- * This procedure is called to get the first item
- * item that matches a preestablished search predicate
- * that was set by TagSearchScan.
+ * This function is called to get the first item item that matches a
+ * preestablished search predicate that was set by TagSearchScan.
*
* Results:
- * The return value is a pointer to the first item, or NULL
- * if there is no such item. The information at *searchPtr
- * is updated such that successive calls to TagSearchNext
- * will return successive items.
+ * The return value is a pointer to the first item, or NULL if there is
+ * no such item. The information at *searchPtr is updated such that
+ * successive calls to TagSearchNext will return successive items.
*
* Side effects:
- * SearchPtr is linked into a list of searches in progress
- * on canvasPtr, so that elements can safely be deleted
- * while the search is in progress.
+ * SearchPtr is linked into a list of searches in progress on canvasPtr,
+ * so that elements can safely be deleted while the search is in
+ * progress.
*
*--------------------------------------------------------------
*/
static Tk_Item *
-TagSearchFirst(searchPtr)
- TagSearch *searchPtr; /* Record describing tag search */
+TagSearchFirst(
+ TagSearch *searchPtr) /* Record describing tag search */
{
Tk_Item *itemPtr, *lastPtr;
Tk_Uid uid, *tagPtr;
int count;
- /* short circuit impossible searches for null tags */
+ /*
+ * Short circuit impossible searches for null tags.
+ */
+
if (searchPtr->stringLength == 0) {
- return NULL;
+ return NULL;
}
/*
- * Find the first matching item in one of several ways. If the tag
- * is a number then it selects the single item with the matching
- * identifier. In this case see if the item being requested is the
- * hot item, in which case the search can be skipped.
+ * Find the first matching item in one of several ways. If the tag is a
+ * number then it selects the single item with the matching identifier.
+ * In this case see if the item being requested is the hot item, in which
+ * case the search can be skipped.
*/
- if (searchPtr->type == 1) {
- Tcl_HashEntry *entryPtr;
-
- itemPtr = searchPtr->canvasPtr->hotPtr;
- lastPtr = searchPtr->canvasPtr->hotPrevPtr;
- if ((itemPtr == NULL) || (itemPtr->id != searchPtr->id) ||
- (lastPtr == NULL) || (lastPtr->nextPtr != itemPtr)) {
- entryPtr = Tcl_FindHashEntry(&searchPtr->canvasPtr->idTable,
- (char *) searchPtr->id);
- if (entryPtr != NULL) {
- itemPtr = (Tk_Item *)Tcl_GetHashValue(entryPtr);
- lastPtr = itemPtr->prevPtr;
- } else {
- lastPtr = itemPtr = NULL;
- }
- }
- searchPtr->lastPtr = lastPtr;
- searchPtr->searchOver = 1;
- searchPtr->canvasPtr->hotPtr = itemPtr;
- searchPtr->canvasPtr->hotPrevPtr = lastPtr;
- return itemPtr;
- }
-
- if (searchPtr->type == 2) {
-
- /*
- * All items match.
- */
-
- searchPtr->lastPtr = NULL;
- searchPtr->currentPtr = searchPtr->canvasPtr->firstItemPtr;
- return searchPtr->canvasPtr->firstItemPtr;
- }
-
- if (searchPtr->type == 3) {
-
- /*
- * Optimized single-tag search
- */
-
- uid = searchPtr->expr->uid;
- for (lastPtr = NULL, itemPtr = searchPtr->canvasPtr->firstItemPtr;
- itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
- for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
- count > 0; tagPtr++, count--) {
- if (*tagPtr == uid) {
- searchPtr->lastPtr = lastPtr;
- searchPtr->currentPtr = itemPtr;
- return itemPtr;
- }
- }
- }
+ if (searchPtr->type == SEARCH_TYPE_ID) {
+ Tcl_HashEntry *entryPtr;
+
+ itemPtr = searchPtr->canvasPtr->hotPtr;
+ lastPtr = searchPtr->canvasPtr->hotPrevPtr;
+ if ((itemPtr == NULL) || (itemPtr->id != searchPtr->id)
+ || (lastPtr == NULL) || (lastPtr->nextPtr != itemPtr)) {
+ entryPtr = Tcl_FindHashEntry(&searchPtr->canvasPtr->idTable,
+ (char *) INT2PTR(searchPtr->id));
+ if (entryPtr != NULL) {
+ itemPtr = (Tk_Item *)Tcl_GetHashValue(entryPtr);
+ lastPtr = itemPtr->prevPtr;
+ } else {
+ lastPtr = itemPtr = NULL;
+ }
+ }
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->searchOver = 1;
+ searchPtr->canvasPtr->hotPtr = itemPtr;
+ searchPtr->canvasPtr->hotPrevPtr = lastPtr;
+ return itemPtr;
+ }
+
+ if (searchPtr->type == SEARCH_TYPE_ALL) {
+ /*
+ * All items match.
+ */
+
+ searchPtr->lastPtr = NULL;
+ searchPtr->currentPtr = searchPtr->canvasPtr->firstItemPtr;
+ return searchPtr->canvasPtr->firstItemPtr;
+ }
+
+ if (searchPtr->type == SEARCH_TYPE_TAG) {
+ /*
+ * Optimized single-tag search
+ */
+
+ uid = searchPtr->expr->uid;
+ for (lastPtr = NULL, itemPtr = searchPtr->canvasPtr->firstItemPtr;
+ itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
+ for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
+ count > 0; tagPtr++, count--) {
+ if (*tagPtr == uid) {
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->currentPtr = itemPtr;
+ return itemPtr;
+ }
+ }
+ }
} else {
/*
- * None of the above. Search for an item matching the tag expression.
+ * None of the above. Search for an item matching the tag expression.
*/
for (lastPtr = NULL, itemPtr = searchPtr->canvasPtr->firstItemPtr;
- itemPtr != NULL; lastPtr=itemPtr, itemPtr=itemPtr->nextPtr) {
+ itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
searchPtr->expr->index = 0;
if (TagSearchEvalExpr(searchPtr->expr, itemPtr)) {
searchPtr->lastPtr = lastPtr;
@@ -3816,89 +3719,86 @@ TagSearchFirst(searchPtr)
*
* TagSearchNext --
*
- * This procedure returns successive items that match a given
- * tag; it should be called only after TagSearchFirst has been
- * used to begin a search.
+ * This function returns successive items that match a given tag; it
+ * should be called only after TagSearchFirst has been used to begin a
+ * search.
*
* Results:
- * The return value is a pointer to the next item that matches
- * the tag expr specified to TagSearchScan, or NULL if no such
- * item exists. *SearchPtr is updated so that the next call
- * to this procedure will return the next item.
+ * The return value is a pointer to the next item that matches the tag
+ * expr specified to TagSearchScan, or NULL if no such item exists.
+ * *SearchPtr is updated so that the next call to this function will
+ * return the next item.
*
* Side effects:
- * None.
+ * None.
*
*--------------------------------------------------------------
*/
static Tk_Item *
-TagSearchNext(searchPtr)
- TagSearch *searchPtr; /* Record describing search in
- * progress. */
+TagSearchNext(
+ TagSearch *searchPtr) /* Record describing search in progress. */
{
Tk_Item *itemPtr, *lastPtr;
Tk_Uid uid, *tagPtr;
int count;
/*
- * Find next item in list (this may not actually be a suitable
- * one to return), and return if there are no items left.
+ * Find next item in list (this may not actually be a suitable one to
+ * return), and return if there are no items left.
*/
lastPtr = searchPtr->lastPtr;
if (lastPtr == NULL) {
- itemPtr = searchPtr->canvasPtr->firstItemPtr;
+ itemPtr = searchPtr->canvasPtr->firstItemPtr;
} else {
- itemPtr = lastPtr->nextPtr;
+ itemPtr = lastPtr->nextPtr;
}
if ((itemPtr == NULL) || (searchPtr->searchOver)) {
- searchPtr->searchOver = 1;
- return NULL;
+ searchPtr->searchOver = 1;
+ return NULL;
}
if (itemPtr != searchPtr->currentPtr) {
- /*
- * The structure of the list has changed. Probably the
- * previously-returned item was removed from the list.
- * In this case, don't advance lastPtr; just return
- * its new successor (i.e. do nothing here).
- */
+ /*
+ * The structure of the list has changed. Probably the previously-
+ * returned item was removed from the list. In this case, don't
+ * advance lastPtr; just return its new successor (i.e. do nothing
+ * here).
+ */
} else {
- lastPtr = itemPtr;
- itemPtr = lastPtr->nextPtr;
+ lastPtr = itemPtr;
+ itemPtr = lastPtr->nextPtr;
}
- if (searchPtr->type == 2) {
-
- /*
- * All items match.
- */
+ if (searchPtr->type == SEARCH_TYPE_ALL) {
+ /*
+ * All items match.
+ */
- searchPtr->lastPtr = lastPtr;
- searchPtr->currentPtr = itemPtr;
- return itemPtr;
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->currentPtr = itemPtr;
+ return itemPtr;
}
- if (searchPtr->type == 3) {
-
- /*
- * Optimized single-tag search
- */
+ if (searchPtr->type == SEARCH_TYPE_TAG) {
+ /*
+ * Optimized single-tag search
+ */
- uid = searchPtr->expr->uid;
- for ( ; itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
- for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
- count > 0; tagPtr++, count--) {
- if (*tagPtr == uid) {
- searchPtr->lastPtr = lastPtr;
- searchPtr->currentPtr = itemPtr;
- return itemPtr;
- }
- }
- }
- searchPtr->lastPtr = lastPtr;
- searchPtr->searchOver = 1;
- return NULL;
+ uid = searchPtr->expr->uid;
+ for (; itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
+ for (tagPtr = itemPtr->tagPtr, count = itemPtr->numTags;
+ count > 0; tagPtr++, count--) {
+ if (*tagPtr == uid) {
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->currentPtr = itemPtr;
+ return itemPtr;
+ }
+ }
+ }
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->searchOver = 1;
+ return NULL;
}
/*
@@ -3906,12 +3806,12 @@ TagSearchNext(searchPtr)
*/
for ( ; itemPtr != NULL; lastPtr = itemPtr, itemPtr = itemPtr->nextPtr) {
- searchPtr->expr->index = 0;
- if (TagSearchEvalExpr(searchPtr->expr, itemPtr)) {
- searchPtr->lastPtr = lastPtr;
- searchPtr->currentPtr = itemPtr;
- return itemPtr;
- }
+ searchPtr->expr->index = 0;
+ if (TagSearchEvalExpr(searchPtr->expr, itemPtr)) {
+ searchPtr->lastPtr = lastPtr;
+ searchPtr->currentPtr = itemPtr;
+ return itemPtr;
+ }
}
searchPtr->lastPtr = lastPtr;
searchPtr->searchOver = 1;
@@ -3924,29 +3824,27 @@ TagSearchNext(searchPtr)
*
* DoItem --
*
- * This is a utility procedure called by FindItems. It
- * either adds itemPtr's id to the result forming in interp,
- * or it adds a new tag to itemPtr, depending on the value
- * of tag.
+ * This is a utility function called by FindItems. It either adds
+ * itemPtr's id to the result forming in interp, or it adds a new tag to
+ * itemPtr, depending on the value of tag.
*
* Results:
* None.
*
* Side effects:
- * If tag is NULL then itemPtr's id is added as a list element
- * to the interp's result; otherwise tag is added to itemPtr's
- * list of tags.
+ * If tag is NULL then itemPtr's id is added as a list element to the
+ * interp's result; otherwise tag is added to itemPtr's list of tags.
*
*--------------------------------------------------------------
*/
static void
-DoItem(interp, itemPtr, tag)
- Tcl_Interp *interp; /* Interpreter in which to (possibly)
- * record item id. */
- Tk_Item *itemPtr; /* Item to (possibly) modify. */
- Tk_Uid tag; /* Tag to add to those already
- * present for item, or NULL. */
+DoItem(
+ Tcl_Interp *interp, /* Interpreter in which to (possibly) record
+ * item id. */
+ Tk_Item *itemPtr, /* Item to (possibly) modify. */
+ Tk_Uid tag) /* Tag to add to those already present for
+ * item, or NULL. */
{
Tk_Uid *tagPtr;
int count;
@@ -3971,18 +3869,17 @@ DoItem(interp, itemPtr, tag)
}
/*
- * Grow the tag space if there's no more room left in the current
- * block.
+ * Grow the tag space if there's no more room left in the current block.
*/
if (itemPtr->tagSpace == itemPtr->numTags) {
Tk_Uid *newTagPtr;
itemPtr->tagSpace += 5;
- newTagPtr = (Tk_Uid *) ckalloc((unsigned)
- (itemPtr->tagSpace * sizeof(Tk_Uid)));
- memcpy((VOID *) newTagPtr, (VOID *) itemPtr->tagPtr,
- (itemPtr->numTags * sizeof(Tk_Uid)));
+ newTagPtr = (Tk_Uid *)
+ ckalloc((unsigned) (itemPtr->tagSpace * sizeof(Tk_Uid)));
+ memcpy((void *) newTagPtr, itemPtr->tagPtr,
+ itemPtr->numTags * sizeof(Tk_Uid));
if (itemPtr->tagPtr != itemPtr->staticTagSpace) {
ckfree((char *) itemPtr->tagPtr);
}
@@ -4003,57 +3900,51 @@ DoItem(interp, itemPtr, tag)
*
* FindItems --
*
- * This procedure does all the work of implementing the
- * "find" and "addtag" options of the canvas widget command,
- * which locate items that have certain features (location,
- * tags, position in display list, etc.).
+ * This function does all the work of implementing the "find" and
+ * "addtag" options of the canvas widget command, which locate items that
+ * have certain features (location, tags, position in display list, etc.)
*
* Results:
- * A standard Tcl return value. If newTag is NULL, then a
- * list of ids from all the items that match argc/argv is
- * returned in the interp's result. If newTag is NULL, then
- * the normal the interp's result is an empty string. If an error
- * occurs, then the interp's result will hold an error message.
+ * A standard Tcl return value. If newTag is NULL, then a list of ids
+ * from all the items that match objc/objv is returned in the interp's
+ * result. If newTag is NULL, then the normal the interp's result is an
+ * empty string. If an error occurs, then the interp's result will hold
+ * an error message.
*
* Side effects:
- * If newTag is non-NULL, then all the items that match the
- * information in argc/argv have that tag added to their
- * lists of tags.
+ * If newTag is non-NULL, then all the items that match the information
+ * in objc/objv have that tag added to their lists of tags.
*
*--------------------------------------------------------------
*/
static int
-#ifdef USE_OLD_TAG_SEARCH
-FindItems(interp, canvasPtr, argc, argv, newTag, first)
-#else /* USE_OLD_TAG_SEARCH */
-FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
-#endif /* USE_OLD_TAG_SEARCH */
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- TkCanvas *canvasPtr; /* Canvas whose items are to be
- * searched. */
- int argc; /* Number of entries in argv. Must be
- * greater than zero. */
- Tcl_Obj *CONST *argv; /* 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 found items; if NULL, then
- * ids of found items are returned
- * in the interp's result. */
- int first; /* For error messages: gives number
- * of elements of argv which are already
- * handled. */
+FindItems(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ 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
+ * search for (see user doc on "find" and
+ * "addtag" options). */
+ Tcl_Obj *newTag, /* If non-NULL, gives new tag to set on all
+ * found items; if NULL, then ids of found
+ * items are returned in the interp's
+ * result. */
+ int first /* For error messages: gives number of
+ * elements of objv which are already
+ * handled. */
#ifndef USE_OLD_TAG_SEARCH
- TagSearch **searchPtrPtr; /* From CanvasWidgetCmd local vars*/
+ ,TagSearch **searchPtrPtr /* From CanvasWidgetCmd local vars*/
#endif /* not USE_OLD_TAG_SEARCH */
+ )
{
#ifdef USE_OLD_TAG_SEARCH
TagSearch search;
#endif /* USE_OLD_TAG_SEARCH */
Tk_Item *itemPtr;
Tk_Uid uid;
- int index;
+ int index, result;
static CONST char *optionStrings[] = {
"above", "all", "below", "closest",
"enclosed", "overlapping", "withtag", NULL
@@ -4064,41 +3955,34 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
};
if (newTag != NULL) {
- uid = Tk_GetUid(Tcl_GetStringFromObj(newTag, NULL));
+ uid = Tk_GetUid(Tcl_GetString(newTag));
} else {
uid = NULL;
}
- if (Tcl_GetIndexFromObj(interp, argv[first], optionStrings, "search command", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[first], optionStrings,
+ "search command", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum options) index) {
- case CANV_ABOVE: {
+ case CANV_ABOVE: {
Tk_Item *lastPtr = NULL;
- if (argc != first+2) {
- Tcl_WrongNumArgs(interp, first+1, argv, "tagOrId");
+
+ if (objc != first+2) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "tagOrId");
return TCL_ERROR;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, argv[first+1], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if (TagSearchScan(canvasPtr, argv[first+1], searchPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = TagSearchFirst(*searchPtrPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(*searchPtrPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[first+1], searchPtrPtr,
+ return TCL_ERROR) {
lastPtr = itemPtr;
}
if ((lastPtr != NULL) && (lastPtr->nextPtr != NULL)) {
DoItem(interp, lastPtr->nextPtr, uid);
}
break;
- }
- case CANV_ALL: {
- if (argc != first+1) {
- Tcl_WrongNumArgs(interp, first+1, argv, (char *) NULL);
+ }
+ case CANV_ALL:
+ if (objc != first+1) {
+ Tcl_WrongNumArgs(interp, first+1, objv, NULL);
return TCL_ERROR;
}
@@ -4107,52 +3991,43 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
DoItem(interp, itemPtr, uid);
}
break;
- }
- case CANV_BELOW: {
- Tk_Item *itemPtr;
- if (argc != first+2) {
- Tcl_WrongNumArgs(interp, first+1, argv, "tagOrId");
+ case CANV_BELOW:
+ if (objc != first+2) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "tagOrId");
return TCL_ERROR;
}
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, argv[first+1], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if (TagSearchScan(canvasPtr, argv[first+1], searchPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- itemPtr = TagSearchFirst(*searchPtrPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ FIRST_CANVAS_ITEM_MATCHING(objv[first+1], searchPtrPtr,
+ return TCL_ERROR);
if (itemPtr != NULL) {
if (itemPtr->prevPtr != NULL) {
DoItem(interp, itemPtr->prevPtr, uid);
}
}
break;
- }
- case CANV_CLOSEST: {
+ case CANV_CLOSEST: {
double closestDist;
Tk_Item *startPtr, *closestPtr;
double coords[2], halo;
int x1, y1, x2, y2;
- if ((argc < first+3) || (argc > first+5)) {
- Tcl_WrongNumArgs(interp, first+1, argv, "x y ?halo? ?start?");
+ if ((objc < first+3) || (objc > first+5)) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "x y ?halo? ?start?");
return TCL_ERROR;
}
- if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[first+1],
+ if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[first+1],
&coords[0]) != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp,
- (Tk_Canvas) canvasPtr, argv[first+2], &coords[1]) != TCL_OK)) {
+ (Tk_Canvas) canvasPtr, objv[first+2], &coords[1]) != TCL_OK)) {
return TCL_ERROR;
}
- if (argc > first+3) {
- if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[first+3],
+ if (objc > first+3) {
+ if (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[first+3],
&halo) != TCL_OK) {
return TCL_ERROR;
}
if (halo < 0.0) {
Tcl_AppendResult(interp, "can't have negative halo value \"",
- Tcl_GetString(argv[3]), "\"", (char *) NULL);
+ Tcl_GetString(objv[3]), "\"", NULL);
return TCL_ERROR;
}
} else {
@@ -4164,31 +4039,26 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
*/
startPtr = canvasPtr->firstItemPtr;
- if (argc == first+5) {
-#ifdef USE_OLD_TAG_SEARCH
- itemPtr = StartTagSearch(canvasPtr, argv[first+4], &search);
-#else /* USE_OLD_TAG_SEARCH */
- if (TagSearchScan(canvasPtr, argv[first+4], searchPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- itemPtr = TagSearchFirst(*searchPtrPtr);
-#endif /* USE_OLD_TAG_SEARCH */
+ if (objc == first+5) {
+ FIRST_CANVAS_ITEM_MATCHING(objv[first+4], searchPtrPtr,
+ return TCL_ERROR);
if (itemPtr != NULL) {
startPtr = itemPtr;
}
}
/*
- * The code below is optimized so that it can eliminate most
- * items without having to call their item-specific procedures.
- * This is done by keeping a bounding box (x1, y1, x2, y2) that
- * an item's bbox must overlap if the item is to have any
- * chance of being closer than the closest so far.
+ * The code below is optimized so that it can eliminate most items
+ * without having to call their item-specific functions. This is done
+ * by keeping a bounding box (x1, y1, x2, y2) that an item's bbox must
+ * overlap if the item is to have any chance of being closer than the
+ * closest so far.
*/
itemPtr = startPtr;
while(itemPtr && (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))) {
itemPtr = itemPtr->nextPtr;
}
if (itemPtr == NULL) {
@@ -4203,8 +4073,8 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
double newDist;
/*
- * Update the bounding box using itemPtr, which is the
- * new closest item.
+ * Update the bounding box using itemPtr, which is the new closest
+ * item.
*/
x1 = (int) (coords[0] - closestDist - halo - 1);
@@ -4214,9 +4084,9 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
closestPtr = itemPtr;
/*
- * Search for an item that beats the current closest one.
- * Work circularly through the canvas's item list until
- * getting back to the starting item.
+ * Search for an item that beats the current closest one. Work
+ * circularly through the canvas's item list until getting back to
+ * the starting item.
*/
while (1) {
@@ -4228,7 +4098,8 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
DoItem(interp, closestPtr, uid);
return TCL_OK;
}
- if (itemPtr->state == TK_STATE_HIDDEN || (itemPtr->state == TK_STATE_NULL &&
+ if (itemPtr->state == TK_STATE_HIDDEN ||
+ (itemPtr->state == TK_STATE_NULL &&
canvasPtr->canvas_state == TK_STATE_HIDDEN)) {
continue;
}
@@ -4248,39 +4119,28 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
}
}
break;
- }
- case CANV_ENCLOSED: {
- if (argc != first+5) {
- Tcl_WrongNumArgs(interp, first+1, argv, "x1 y1 x2 y2");
+ }
+ case CANV_ENCLOSED:
+ if (objc != first+5) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "x1 y1 x2 y2");
return TCL_ERROR;
}
- return FindArea(interp, canvasPtr, argv+first+1, uid, 1);
- }
- case CANV_OVERLAPPING: {
- if (argc != first+5) {
- Tcl_WrongNumArgs(interp, first+1, argv, "x1 y1 x2 y2");
+ return FindArea(interp, canvasPtr, objv+first+1, uid, 1);
+ case CANV_OVERLAPPING:
+ if (objc != first+5) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "x1 y1 x2 y2");
return TCL_ERROR;
}
- return FindArea(interp, canvasPtr, argv+first+1, uid, 0);
- }
- case CANV_WITHTAG: {
- if (argc != first+2) {
- Tcl_WrongNumArgs(interp, first+1, argv, "tagOrId");
+ return FindArea(interp, canvasPtr, objv+first+1, uid, 0);
+ case CANV_WITHTAG:
+ if (objc != first+2) {
+ Tcl_WrongNumArgs(interp, first+1, objv, "tagOrId");
return TCL_ERROR;
}
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, argv[first+1], &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if (TagSearchScan(canvasPtr, argv[first+1], searchPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = TagSearchFirst(*searchPtrPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(*searchPtrPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(objv[first+1], searchPtrPtr,
+ return TCL_ERROR) {
DoItem(interp, itemPtr, uid);
}
- }
}
return TCL_OK;
}
@@ -4290,53 +4150,49 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
*
* FindArea --
*
- * This procedure implements area searches for the "find"
- * and "addtag" options.
+ * This function implements area searches for the "find" and "addtag"
+ * options.
*
* Results:
- * A standard Tcl return value. If newTag is NULL, then a
- * list of ids from all the items overlapping or enclosed
- * by the rectangle given by argc is returned in the interp's result.
- * If newTag is NULL, then the normal the interp's result is an
- * empty string. If an error occurs, then the interp's result will
- * hold an error message.
+ * A standard Tcl return value. If newTag is NULL, then a list of ids
+ * from all the items overlapping or enclosed by the rectangle given by
+ * objc is returned in the interp's result. If newTag is NULL, then the
+ * normal the interp's result is an empty string. If an error occurs,
+ * then the interp's result will hold an error message.
*
* Side effects:
- * If uid is non-NULL, then all the items overlapping
- * or enclosed by the area in argv have that tag added to
- * their lists of tags.
+ * If uid is non-NULL, then all the items overlapping or enclosed by the
+ * area in objv have that tag added to their lists of tags.
*
*--------------------------------------------------------------
*/
static int
-FindArea(interp, canvasPtr, argv, uid, enclosed)
- Tcl_Interp *interp; /* Interpreter for error reporting
- * and result storing. */
- TkCanvas *canvasPtr; /* Canvas whose items are to be
- * searched. */
- Tcl_Obj *CONST *argv; /* 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 found items; if NULL, then
- * ids of found items are returned
- * in the interp's result. */
- int enclosed; /* 0 means overlapping or enclosed
- * items are OK, 1 means only enclosed
- * items are OK. */
+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
+ * coordinates of the rectangular area to
+ * search. */
+ Tk_Uid uid, /* If non-NULL, gives new tag to set on all
+ * found items; if NULL, then ids of found
+ * items are returned in the interp's
+ * result. */
+ int enclosed) /* 0 means overlapping or enclosed items are
+ * OK, 1 means only enclosed items are OK. */
{
double rect[4], tmp;
int x1, y1, x2, y2;
Tk_Item *itemPtr;
- if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[0],
+ if ((Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[0],
&rect[0]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[1],
+ || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[1],
&rect[1]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[2],
+ || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[2],
&rect[2]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, argv[3],
+ || (Tk_CanvasGetCoordFromObj(interp, (Tk_Canvas) canvasPtr, objv[3],
&rect[3]) != TCL_OK)) {
return TCL_ERROR;
}
@@ -4348,8 +4204,8 @@ FindArea(interp, canvasPtr, argv, uid, enclosed)
}
/*
- * Use an integer bounding box for a quick test, to avoid
- * calling item-specific code except for items that are close.
+ * Use an integer bounding box for a quick test, to avoid calling
+ * item-specific code except for items that are close.
*/
x1 = (int) (rect[0]-1.0);
@@ -4379,65 +4235,60 @@ FindArea(interp, canvasPtr, argv, uid, enclosed)
*
* RelinkItems --
*
- * Move one or more items to a different place in the
- * display order for a canvas.
+ * Move one or more items to a different place in the display order for a
+ * canvas.
*
* Results:
* None.
*
* Side effects:
- * The items identified by "tag" are moved so that they
- * are all together in the display list and immediately
- * after prevPtr. The order of the moved items relative
- * to each other is not changed.
+ * The items identified by "tag" are moved so that they are all together
+ * in the display list and immediately after prevPtr. The order of the
+ * moved items relative to each other is not changed.
*
*--------------------------------------------------------------
*/
#ifdef USE_OLD_TAG_SEARCH
static void
-RelinkItems(canvasPtr, tag, prevPtr)
+RelinkItems(
+ TkCanvas *canvasPtr, /* Canvas to be modified. */
+ Tcl_Obj *tag, /* Tag identifying items to be moved in the
+ * redisplay list. */
+ Tk_Item *prevPtr) /* Reposition the items so that they go just
+ * after this item (NULL means put at
+ * beginning of list). */
#else /* USE_OLD_TAG_SEARCH */
static int
-RelinkItems(canvasPtr, tag, prevPtr, searchPtrPtr)
+RelinkItems(
+ TkCanvas *canvasPtr, /* Canvas to be modified. */
+ Tcl_Obj *tag, /* Tag identifying items to be moved in the
+ * redisplay list. */
+ Tk_Item *prevPtr, /* Reposition the items so that they go just
+ * after this item (NULL means put at
+ * beginning of list). */
+ TagSearch **searchPtrPtr) /* From CanvasWidgetCmd local vars */
#endif /* USE_OLD_TAG_SEARCH */
- TkCanvas *canvasPtr; /* Canvas to be modified. */
- Tcl_Obj *tag; /* Tag identifying items to be moved
- * in the redisplay list. */
- Tk_Item *prevPtr; /* Reposition the items so that they
- * go just after this item (NULL means
- * put at beginning of list). */
-#ifndef USE_OLD_TAG_SEARCH
- TagSearch **searchPtrPtr; /* From CanvasWidgetCmd local vars */
-#endif /* not USE_OLD_TAG_SEARCH */
{
Tk_Item *itemPtr;
#ifdef USE_OLD_TAG_SEARCH
TagSearch search;
#endif /* USE_OLD_TAG_SEARCH */
Tk_Item *firstMovePtr, *lastMovePtr;
+ int result;
/*
- * Find all of the items to be moved and remove them from
- * the list, making an auxiliary list running from firstMovePtr
- * to lastMovePtr. Record their areas for redisplay.
+ * Find all of the items to be moved and remove them from the list, making
+ * an auxiliary list running from firstMovePtr to lastMovePtr. Record
+ * their areas for redisplay.
*/
firstMovePtr = lastMovePtr = NULL;
-#ifdef USE_OLD_TAG_SEARCH
- for (itemPtr = StartTagSearch(canvasPtr, tag, &search);
- itemPtr != NULL; itemPtr = NextItem(&search)) {
-#else /* USE_OLD_TAG_SEARCH */
- if (TagSearchScan(canvasPtr, tag, searchPtrPtr) != TCL_OK) {
- return TCL_ERROR;
- }
- for (itemPtr = TagSearchFirst(*searchPtrPtr);
- itemPtr != NULL; itemPtr = TagSearchNext(*searchPtrPtr)) {
-#endif /* USE_OLD_TAG_SEARCH */
+ FOR_EVERY_CANVAS_ITEM_MATCHING(tag, searchPtrPtr, return TCL_ERROR) {
if (itemPtr == prevPtr) {
/*
- * Item after which insertion is to occur is being
- * moved! Switch to insert after its predecessor.
+ * Item after which insertion is to occur is being moved! Switch
+ * to insert after its predecessor.
*/
prevPtr = prevPtr->prevPtr;
@@ -4469,15 +4320,15 @@ RelinkItems(canvasPtr, tag, prevPtr, searchPtrPtr)
}
/*
- * Insert the list of to-be-moved items back into the canvas's
- * at the desired position.
+ * Insert the list of to-be-moved items back into the canvas's at the
+ * desired position.
*/
if (firstMovePtr == NULL) {
#ifdef USE_OLD_TAG_SEARCH
return;
#else /* USE_OLD_TAG_SEARCH */
- return TCL_OK;
+ return TCL_OK;
#endif /* USE_OLD_TAG_SEARCH */
}
if (prevPtr == NULL) {
@@ -4509,24 +4360,23 @@ RelinkItems(canvasPtr, tag, prevPtr, searchPtrPtr)
*
* CanvasBindProc --
*
- * This procedure is invoked by the Tk dispatcher to handle
- * events associated with bindings on items.
+ * This function is invoked by the Tk dispatcher to handle events
+ * associated with bindings on items.
*
* Results:
* None.
*
* Side effects:
- * Depends on the command invoked as part of the binding
- * (if there was any).
+ * Depends on the command invoked as part of the binding (if there was
+ * any).
*
*--------------------------------------------------------------
*/
static void
-CanvasBindProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to canvas structure. */
- XEvent *eventPtr; /* Pointer to X event that just
- * happened. */
+CanvasBindProc(
+ ClientData clientData, /* Pointer to canvas structure. */
+ XEvent *eventPtr) /* Pointer to X event that just happened. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
@@ -4534,47 +4384,46 @@ CanvasBindProc(clientData, eventPtr)
/*
* This code below keeps track of the current modifier state in
- * canvasPtr>state. This information is used to defer repicks of
- * the current item while buttons are down.
+ * canvasPtr>state. This information is used to defer repicks of the
+ * current item while buttons are down.
*/
if ((eventPtr->type == ButtonPress) || (eventPtr->type == ButtonRelease)) {
int mask;
switch (eventPtr->xbutton.button) {
- case Button1:
- mask = Button1Mask;
- break;
- case Button2:
- mask = Button2Mask;
- break;
- case Button3:
- mask = Button3Mask;
- break;
- case Button4:
- mask = Button4Mask;
- break;
- case Button5:
- mask = Button5Mask;
- break;
- default:
- mask = 0;
- break;
+ case Button1:
+ mask = Button1Mask;
+ break;
+ case Button2:
+ mask = Button2Mask;
+ break;
+ case Button3:
+ mask = Button3Mask;
+ break;
+ case Button4:
+ mask = Button4Mask;
+ break;
+ case Button5:
+ mask = Button5Mask;
+ break;
+ default:
+ mask = 0;
+ break;
}
/*
- * For button press events, repick the current item using the
- * button state before the event, then process the event. For
- * button release events, first process the event, then repick
- * the current item using the button state *after* the event
- * (the button has logically gone up before we change the
- * current item).
+ * For button press events, repick the current item using the button
+ * state before the event, then process the event. For button release
+ * events, first process the event, then repick the current item using
+ * the button state *after* the event (the button has logically gone
+ * up before we change the current item).
*/
if (eventPtr->type == ButtonPress) {
/*
- * On a button press, first repick the current item using
- * the button state before the event, the process the event.
+ * On a button press, first repick the current item using the
+ * button state before the event, the process the event.
*/
canvasPtr->state = eventPtr->xbutton.state;
@@ -4583,9 +4432,9 @@ CanvasBindProc(clientData, eventPtr)
CanvasDoEvent(canvasPtr, eventPtr);
} else {
/*
- * Button release: first process the event, with the button
- * still considered to be down. Then repick the current
- * item under the assumption that the button is no longer down.
+ * Button release: first process the event, with the button still
+ * considered to be down. Then repick the current item under the
+ * assumption that the button is no longer down.
*/
canvasPtr->state = eventPtr->xbutton.state;
@@ -4607,7 +4456,7 @@ CanvasBindProc(clientData, eventPtr)
}
CanvasDoEvent(canvasPtr, eventPtr);
- done:
+ done:
Tcl_Release((ClientData) canvasPtr);
}
@@ -4616,34 +4465,31 @@ CanvasBindProc(clientData, eventPtr)
*
* PickCurrentItem --
*
- * Find the topmost item in a canvas that contains a given
- * location and mark the the current item. If the current
- * item has changed, generate a fake exit event on the old
- * current item, a fake enter event on the new current item
- * item and force a redraw of the two items. Canvas items
- * that are hidden or disabled are ignored.
+ * Find the topmost item in a canvas that contains a given location and
+ * mark the the current item. If the current item has changed, generate a
+ * fake exit event on the old current item, a fake enter event on the new
+ * current item item and force a redraw of the two items. Canvas items
+ * that are hidden or disabled are ignored.
*
* Results:
* None.
*
* Side effects:
- * The current item for canvasPtr may change. If it does,
- * then the commands associated with item entry and exit
- * could do just about anything. A binding script could
- * delete the canvas, so callers should protect themselves
- * with Tcl_Preserve and Tcl_Release.
+ * The current item for canvasPtr may change. If it does, then the
+ * commands associated with item entry and exit could do just about
+ * anything. A binding script could delete the canvas, so callers should
+ * protect themselves with Tcl_Preserve and Tcl_Release.
*
*--------------------------------------------------------------
*/
static void
-PickCurrentItem(canvasPtr, eventPtr)
- TkCanvas *canvasPtr; /* Canvas widget in which to select
- * current item. */
- XEvent *eventPtr; /* Event describing location of
- * mouse cursor. Must be EnterWindow,
- * LeaveWindow, ButtonRelease, or
- * MotionNotify. */
+PickCurrentItem(
+ TkCanvas *canvasPtr, /* Canvas widget in which to select current
+ * item. */
+ XEvent *eventPtr) /* Event describing location of mouse cursor.
+ * Must be EnterWindow, LeaveWindow,
+ * ButtonRelease, or MotionNotify. */
{
double coords[2];
int buttonDown;
@@ -4653,23 +4499,24 @@ PickCurrentItem(canvasPtr, eventPtr)
#endif
/*
- * Check whether or not a button is down. If so, we'll log entry
- * and exit into and out of the current item, but not entry into
- * any other item. This implements a form of grabbing equivalent
- * to what the X server does for windows.
+ * Check whether or not a button is down. If so, we'll log entry and exit
+ * into and out of the current item, but not entry into any other item.
+ * This implements a form of grabbing equivalent to what the X server does
+ * for windows.
*/
buttonDown = canvasPtr->state
& (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask);
/*
- * Save information about this event in the canvas. The event in
- * the canvas is used for two purposes:
+ * Save information about this event in the canvas. The event in the
+ * canvas is used for two purposes:
*
* 1. Event bindings: if the current item changes, fake events are
* generated to allow item-enter and item-leave bindings to trigger.
- * 2. Reselection: if the current item gets deleted, can use the
- * saved event to find a new current item.
+ * 2. Reselection: if the current item gets deleted, can use the saved
+ * event to find a new current item.
+ *
* Translate MotionNotify events into EnterNotify events, since that's
* what gets reported to item handlers.
*/
@@ -4702,10 +4549,10 @@ PickCurrentItem(canvasPtr, eventPtr)
}
/*
- * If this is a recursive call (there's already a partially completed
- * call pending on the stack; it's in the middle of processing a
- * Leave event handler for the old current item) then just return;
- * the pending call will do everything that's needed.
+ * If this is a recursive call (there's already a partially completed call
+ * pending on the stack; it's in the middle of processing a Leave event
+ * handler for the old current item) then just return; the pending call
+ * will do everything that's needed.
*/
if (canvasPtr->flags & REPICK_IN_PROGRESS) {
@@ -4713,8 +4560,8 @@ PickCurrentItem(canvasPtr, eventPtr)
}
/*
- * A LeaveNotify event automatically means that there's no current
- * object, so the check for closest item can be skipped.
+ * A LeaveNotify event automatically means that there's no current object,
+ * so the check for closest item can be skipped.
*/
coords[0] = canvasPtr->pickEvent.xcrossing.x + canvasPtr->xOrigin;
@@ -4737,12 +4584,11 @@ PickCurrentItem(canvasPtr, eventPtr)
if (!buttonDown) {
canvasPtr->flags &= ~LEFT_GRABBED_ITEM;
}
-
+
/*
- * Simulate a LeaveNotify event on the previous current item and
- * an EnterNotify event on the new current item. Remove the "current"
- * tag from the previous current item and place it on the new current
- * item.
+ * Simulate a LeaveNotify event on the previous current item and an
+ * EnterNotify event on the new current item. Remove the "current" tag
+ * from the previous current item and place it on the new current item.
*/
if ((canvasPtr->newCurrentPtr != canvasPtr->currentItemPtr)
@@ -4756,9 +4602,9 @@ PickCurrentItem(canvasPtr, eventPtr)
event.type = LeaveNotify;
/*
- * If the event's detail happens to be NotifyInferior the
- * binding mechanism will discard the event. To be consistent,
- * always use NotifyAncestor.
+ * If the event's detail happens to be NotifyInferior the binding
+ * mechanism will discard the event. To be consistent, always use
+ * NotifyAncestor.
*/
event.xcrossing.detail = NotifyAncestor;
@@ -4767,28 +4613,29 @@ PickCurrentItem(canvasPtr, eventPtr)
canvasPtr->flags &= ~REPICK_IN_PROGRESS;
/*
- * The check below is needed because there could be an event
- * handler for <LeaveNotify> that deletes the current item.
+ * The check below is needed because there could be an event handler
+ * for <LeaveNotify> that deletes the current item.
*/
if ((itemPtr == canvasPtr->currentItemPtr) && !buttonDown) {
for (i = itemPtr->numTags-1; i >= 0; i--) {
#ifdef USE_OLD_TAG_SEARCH
- if (itemPtr->tagPtr[i] == Tk_GetUid("current")) {
+ if (itemPtr->tagPtr[i] == Tk_GetUid("current"))
#else /* USE_OLD_TAG_SEARCH */
- if (itemPtr->tagPtr[i] == searchUids->currentUid) {
+ if (itemPtr->tagPtr[i] == searchUids->currentUid)
#endif /* USE_OLD_TAG_SEARCH */
+ /* then */ {
itemPtr->tagPtr[i] = itemPtr->tagPtr[itemPtr->numTags-1];
itemPtr->numTags--;
break;
}
}
}
-
+
/*
- * Note: during CanvasDoEvent above, it's possible that
- * canvasPtr->newCurrentPtr got reset to NULL because the
- * item was deleted.
+ * Note: during CanvasDoEvent above, it's possible that
+ * canvasPtr->newCurrentPtr got reset to NULL because the item was
+ * deleted.
*/
}
if ((canvasPtr->newCurrentPtr != canvasPtr->currentItemPtr) && buttonDown) {
@@ -4797,9 +4644,9 @@ PickCurrentItem(canvasPtr, eventPtr)
}
/*
- * Special note: it's possible that canvasPtr->newCurrentPtr ==
- * canvasPtr->currentItemPtr here. This can happen, for example,
- * if LEFT_GRABBED_ITEM was set.
+ * Special note: it's possible that canvasPtr->newCurrentPtr ==
+ * canvasPtr->currentItemPtr here. This can happen, for example, if
+ * LEFT_GRABBED_ITEM was set.
*/
prevItemPtr = canvasPtr->currentItemPtr;
@@ -4809,23 +4656,21 @@ PickCurrentItem(canvasPtr, eventPtr)
(prevItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT)) {
EventuallyRedrawItem((Tk_Canvas) canvasPtr, prevItemPtr);
(*prevItemPtr->typePtr->configProc)(canvasPtr->interp,
- (Tk_Canvas) canvasPtr, prevItemPtr, 0, (Tcl_Obj **) NULL,
+ (Tk_Canvas) canvasPtr, prevItemPtr, 0, NULL,
TK_CONFIG_ARGV_ONLY);
}
if (canvasPtr->currentItemPtr != NULL) {
XEvent event;
#ifdef USE_OLD_TAG_SEARCH
- DoItem((Tcl_Interp *) NULL, canvasPtr->currentItemPtr,
- Tk_GetUid("current"));
+ DoItem(NULL, canvasPtr->currentItemPtr, Tk_GetUid("current"));
#else /* USE_OLD_TAG_SEARCH */
- DoItem((Tcl_Interp *) NULL, canvasPtr->currentItemPtr,
- searchUids->currentUid);
+ 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, (Tcl_Obj **) NULL,
+ (Tk_Canvas) canvasPtr, canvasPtr->currentItemPtr, 0, NULL,
TK_CONFIG_ARGV_ONLY);
EventuallyRedrawItem((Tk_Canvas) canvasPtr,
canvasPtr->currentItemPtr);
@@ -4842,13 +4687,13 @@ PickCurrentItem(canvasPtr, eventPtr)
*
* CanvasFindClosest --
*
- * Given x and y coordinates, find the topmost canvas item that
- * is "close" to the coordinates. Canvas items that are hidden
- * or disabled are ignored.
+ * Given x and y coordinates, find the topmost canvas item that is
+ * "close" to the coordinates. Canvas items that are hidden or disabled
+ * are ignored.
*
* Results:
- * The return value is a pointer to the topmost item that is
- * close to (x,y), or NULL if no item is close.
+ * The return value is a pointer to the topmost item that is close to
+ * (x,y), or NULL if no item is close.
*
* Side effects:
* None.
@@ -4857,10 +4702,10 @@ PickCurrentItem(canvasPtr, eventPtr)
*/
static Tk_Item *
-CanvasFindClosest(canvasPtr, coords)
- TkCanvas *canvasPtr; /* Canvas widget to search. */
- double coords[2]; /* Desired x,y position in canvas,
- * not screen, coordinates.) */
+CanvasFindClosest(
+ TkCanvas *canvasPtr, /* Canvas widget to search. */
+ double coords[2]) /* Desired x,y position in canvas, not screen,
+ * coordinates.) */
{
Tk_Item *itemPtr;
Tk_Item *bestPtr;
@@ -4896,27 +4741,25 @@ CanvasFindClosest(canvasPtr, coords)
*
* CanvasDoEvent --
*
- * This procedure is called to invoke binding processing
- * for a new event that is associated with the current item
- * for a canvas.
+ * This function is called to invoke binding processing for a new event
+ * that is associated with the current item for a canvas.
*
* Results:
* None.
*
* Side effects:
- * Depends on the bindings for the canvas. A binding script
- * could delete the canvas, so callers should protect themselves
- * with Tcl_Preserve and Tcl_Release.
+ * Depends on the bindings for the canvas. A binding script could delete
+ * the canvas, so callers should protect themselves with Tcl_Preserve and
+ * Tcl_Release.
*
*--------------------------------------------------------------
*/
static void
-CanvasDoEvent(canvasPtr, eventPtr)
- TkCanvas *canvasPtr; /* Canvas widget in which event
- * occurred. */
- XEvent *eventPtr; /* Real or simulated X event that
- * is to be processed. */
+CanvasDoEvent(
+ TkCanvas *canvasPtr, /* Canvas widget in which event occurred. */
+ XEvent *eventPtr) /* Real or simulated X event that is to be
+ * processed. */
{
#define NUM_STATIC 3
ClientData staticObjects[NUM_STATIC];
@@ -4943,30 +4786,30 @@ CanvasDoEvent(canvasPtr, eventPtr)
#ifdef USE_OLD_TAG_SEARCH
/*
- * Set up an array with all the relevant objects for processing
- * this event. The relevant objects are (a) the event's item,
- * (b) the tags associated with the event's item, and (c) the
- * tag "all". If there are a lot of tags then malloc an array
- * to hold all of the objects.
+ * Set up an array with all the relevant objects for processing this
+ * event. The relevant objects are (a) the event's item, (b) the tags
+ * associated with the event's item, and (c) the tag "all". If there are a
+ * lot of tags then malloc an array to hold all of the objects.
*/
numObjects = itemPtr->numTags + 2;
#else /* USE_OLD_TAG_SEARCH */
/*
- * Set up an array with all the relevant objects for processing
- * this event. The relevant objects are:
+ * Set up an array with all the relevant objects for processing this
+ * event. The relevant objects are:
* (a) the event's item,
- * (b) the tags associated with the event's item,
+ * (b) the tags associated with the event's item,
* (c) the expressions that are true for the event's item's tags, and
- * (d) the tag "all".
+ * (d) the tag "all".
*
- * If there are a lot of tags then malloc an array to hold all of
- * the objects.
+ * If there are a lot of tags then malloc an array to hold all of the
+ * objects.
*/
/*
- * flag and count all expressions that match item's tags
+ * Flag and count all expressions that match item's tags.
*/
+
numExprs = 0;
expr = canvasPtr->bindTagExprs;
while (expr) {
@@ -4983,8 +4826,8 @@ CanvasDoEvent(canvasPtr, eventPtr)
if (numObjects <= NUM_STATIC) {
objectPtr = staticObjects;
} else {
- objectPtr = (ClientData *)
- ckalloc((unsigned) (numObjects * sizeof(ClientData)));
+ objectPtr = (ClientData *) ckalloc((unsigned)
+ (numObjects * sizeof(ClientData)));
}
#ifdef USE_OLD_TAG_SEARCH
objectPtr[0] = (ClientData) Tk_GetUid("all");
@@ -4995,10 +4838,12 @@ CanvasDoEvent(canvasPtr, eventPtr)
objectPtr[i+1] = (ClientData) itemPtr->tagPtr[i];
}
objectPtr[itemPtr->numTags+1] = (ClientData) itemPtr;
+
#ifndef USE_OLD_TAG_SEARCH
/*
- * copy uids of matching expressions into object array
+ * Copy uids of matching expressions into object array
*/
+
i = itemPtr->numTags+2;
expr = canvasPtr->bindTagExprs;
while (expr) {
@@ -5010,8 +4855,8 @@ CanvasDoEvent(canvasPtr, eventPtr)
#endif /* not USE_OLD_TAG_SEARCH */
/*
- * Invoke the binding system, then free up the object array if
- * it was malloc-ed.
+ * Invoke the binding system, then free up the object array if it was
+ * malloc-ed.
*/
if (canvasPtr->tkwin != NULL) {
@@ -5028,22 +4873,22 @@ CanvasDoEvent(canvasPtr, eventPtr)
*
* CanvasBlinkProc --
*
- * This procedure is called as a timer handler to blink the
- * insertion cursor off and on.
+ * This function is called as a timer handler to blink the insertion
+ * cursor off and on.
*
* Results:
* None.
*
* Side effects:
- * The cursor gets turned on or off, redisplay gets invoked,
- * and this procedure reschedules itself.
+ * The cursor gets turned on or off, redisplay gets invoked, and this
+ * function reschedules itself.
*
*----------------------------------------------------------------------
*/
static void
-CanvasBlinkProc(clientData)
- ClientData clientData; /* Pointer to record describing entry. */
+CanvasBlinkProc(
+ ClientData clientData) /* Pointer to record describing entry. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
@@ -5072,9 +4917,9 @@ CanvasBlinkProc(clientData)
*
* CanvasFocusProc --
*
- * This procedure is called whenever a canvas gets or loses the
- * input focus. It's also called whenever the window is
- * reconfigured while it has the focus.
+ * This function is called whenever a canvas gets or loses the input
+ * focus. It's also called whenever the window is reconfigured while it
+ * has the focus.
*
* Results:
* None.
@@ -5086,9 +4931,9 @@ CanvasBlinkProc(clientData)
*/
static void
-CanvasFocusProc(canvasPtr, gotFocus)
- TkCanvas *canvasPtr; /* Canvas that just got or lost focus. */
- int gotFocus; /* 1 means window is getting focus, 0 means
+CanvasFocusProc(
+ TkCanvas *canvasPtr, /* Canvas that just got or lost focus. */
+ int gotFocus) /* 1 means window is getting focus, 0 means
* it's losing it. */
{
Tcl_DeleteTimerHandler(canvasPtr->insertBlinkHandler);
@@ -5123,8 +4968,8 @@ CanvasFocusProc(canvasPtr, gotFocus)
*
* CanvasSelectTo --
*
- * Modify the selection by moving its un-anchored end. This could
- * make the selection either larger or smaller.
+ * Modify the selection by moving its un-anchored end. This could make
+ * the selection either larger or smaller.
*
* Results:
* None.
@@ -5136,10 +4981,10 @@ CanvasFocusProc(canvasPtr, gotFocus)
*/
static void
-CanvasSelectTo(canvasPtr, itemPtr, index)
- TkCanvas *canvasPtr; /* Information about widget. */
- Tk_Item *itemPtr; /* Item that is to hold selection. */
- int index; /* Index of element that is to become the
+CanvasSelectTo(
+ TkCanvas *canvasPtr, /* Information about widget. */
+ Tk_Item *itemPtr, /* Item that is to hold selection. */
+ int index) /* Index of element that is to become the
* "other" end of the selection. */
{
int oldFirst, oldLast;
@@ -5185,15 +5030,15 @@ CanvasSelectTo(canvasPtr, itemPtr, index)
*
* CanvasFetchSelection --
*
- * This procedure is invoked by Tk to return part or all of
- * the selection, when the selection is in a canvas widget.
- * This procedure always returns the selection as a STRING.
+ * This function is invoked by Tk to return part or all of the selection,
+ * when the selection is in a canvas widget. This function always returns
+ * the selection as a STRING.
*
* Results:
- * The return value is the number of non-NULL bytes stored
- * at buffer. Buffer is filled (or partially filled) with a
- * NULL-terminated string containing part or all of the selection,
- * as given by offset and maxBytes.
+ * The return value is the number of non-NULL bytes stored at buffer.
+ * Buffer is filled (or partially filled) with a NULL-terminated string
+ * containing part or all of the selection, as given by offset and
+ * maxBytes.
*
* Side effects:
* None.
@@ -5202,15 +5047,14 @@ CanvasSelectTo(canvasPtr, itemPtr, index)
*/
static int
-CanvasFetchSelection(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Information about canvas widget. */
- int offset; /* Offset within selection of first
- * character to be returned. */
- char *buffer; /* Location in which to place
- * selection. */
- int maxBytes; /* Maximum number of bytes to place
- * at buffer, not including terminating
- * NULL character. */
+CanvasFetchSelection(
+ ClientData clientData, /* Information about canvas widget. */
+ int offset, /* Offset within selection of first character
+ * to be returned. */
+ char *buffer, /* Location in which to place selection. */
+ int maxBytes) /* Maximum number of bytes to place at buffer,
+ * not including terminating NULL
+ * character. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
@@ -5230,22 +5074,22 @@ CanvasFetchSelection(clientData, offset, buffer, maxBytes)
*
* CanvasLostSelection --
*
- * This procedure is called back by Tk when the selection is
- * grabbed away from a canvas widget.
+ * This function is called back by Tk when the selection is grabbed away
+ * from a canvas widget.
*
* Results:
* None.
*
* Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
+ * The existing selection is unhighlighted, and the window is marked as
+ * not containing a selection.
*
*----------------------------------------------------------------------
*/
static void
-CanvasLostSelection(clientData)
- ClientData clientData; /* Information about entry widget. */
+CanvasLostSelection(
+ ClientData clientData) /* Information about entry widget. */
{
TkCanvas *canvasPtr = (TkCanvas *) clientData;
@@ -5261,13 +5105,11 @@ CanvasLostSelection(clientData)
*
* GridAlign --
*
- * Given a coordinate and a grid spacing, this procedure
- * computes the location of the nearest grid line to the
- * coordinate.
+ * Given a coordinate and a grid spacing, this function computes the
+ * location of the nearest grid line to the coordinate.
*
* Results:
- * The return value is the location of the grid line nearest
- * to coord.
+ * The return value is the location of the grid line nearest to coord.
*
* Side effects:
* None.
@@ -5276,10 +5118,10 @@ CanvasLostSelection(clientData)
*/
static double
-GridAlign(coord, spacing)
- double coord; /* Coordinate to grid-align. */
- double spacing; /* Spacing between grid lines. If <= 0
- * then no alignment is done. */
+GridAlign(
+ double coord, /* Coordinate to grid-align. */
+ double spacing) /* Spacing between grid lines. If <= 0 then no
+ * alignment is done. */
{
if (spacing <= 0.0) {
return coord;
@@ -5295,15 +5137,14 @@ GridAlign(coord, spacing)
*
* ScrollFractions --
*
- * Given the range that's visible in the window and the "100%
- * range" for what's in the canvas, return a list of two
- * doubles representing the scroll fractions. This procedure
- * is used for both x and y scrolling.
+ * Given the range that's visible in the window and the "100% range" for
+ * what's in the canvas, return a list of two doubles representing the
+ * scroll fractions. This function is used for both x and y scrolling.
*
* Results:
- * The memory pointed to by string is modified to hold
- * two real numbers containing the scroll fractions (between
- * 0 and 1) corresponding to the other arguments.
+ * A List Tcl_Obj with two real numbers (Double Tcl_Objs) containing the
+ * scroll fractions (between 0 and 1) corresponding to the other
+ * arguments.
*
* Side effects:
* None.
@@ -5312,14 +5153,14 @@ GridAlign(coord, spacing)
*/
static Tcl_Obj *
-ScrollFractions(screen1, screen2, object1, object2)
- int screen1; /* Lowest coordinate visible in the window. */
- int screen2; /* Highest coordinate visible in the window. */
- int object1; /* Lowest coordinate in the object. */
- int object2; /* Highest coordinate in the object. */
+ScrollFractions(
+ int screen1, /* Lowest coordinate visible in the window. */
+ int screen2, /* Highest coordinate visible in the window. */
+ int object1, /* Lowest coordinate in the object. */
+ int object2) /* Highest coordinate in the object. */
{
+ Tcl_Obj *buffer[2];
double range, f1, f2;
- char buffer[2*TCL_DOUBLE_SPACE+2];
range = object2 - object1;
if (range <= 0) {
@@ -5338,8 +5179,9 @@ ScrollFractions(screen1, screen2, object1, object2)
f2 = f1;
}
}
- sprintf(buffer, "%g %g", f1, f2);
- return Tcl_NewStringObj(buffer, -1);
+ buffer[0] = Tcl_NewDoubleObj(f1);
+ buffer[1] = Tcl_NewDoubleObj(f2);
+ return Tcl_NewListObj(2, buffer);
}
/*
@@ -5347,46 +5189,45 @@ ScrollFractions(screen1, screen2, object1, object2)
*
* CanvasUpdateScrollbars --
*
- * This procedure is invoked whenever a canvas has changed in
- * a way that requires scrollbars to be redisplayed (e.g. the
- * view in the canvas has changed).
+ * This function is invoked whenever a canvas has changed in a way that
+ * requires scrollbars to be redisplayed (e.g. the view in the canvas has
+ * changed).
*
* Results:
* None.
*
* Side effects:
- * If there are scrollbars associated with the canvas, then
- * their scrolling commands are invoked to cause them to
- * redisplay. If errors occur, additional Tcl commands may
- * be invoked to process the errors.
+ * If there are scrollbars associated with the canvas, then their
+ * scrolling commands are invoked to cause them to redisplay. If errors
+ * occur, additional Tcl commands may be invoked to process the errors.
*
*--------------------------------------------------------------
*/
static void
-CanvasUpdateScrollbars(canvasPtr)
- TkCanvas *canvasPtr; /* Information about canvas. */
+CanvasUpdateScrollbars(
+ TkCanvas *canvasPtr) /* Information about canvas. */
{
int result;
Tcl_Interp *interp;
- int xOrigin, yOrigin, inset, width, height, scrollX1, scrollX2,
- scrollY1, scrollY2;
+ int xOrigin, yOrigin, inset, width, height;
+ int scrollX1, scrollX2, scrollY1, scrollY2;
char *xScrollCmd, *yScrollCmd;
/*
* Save all the relevant values from the canvasPtr, because it might be
* deleted as part of either of the two calls to Tcl_VarEval below.
*/
-
+
interp = canvasPtr->interp;
Tcl_Preserve((ClientData) interp);
xScrollCmd = canvasPtr->xScrollCmd;
- if (xScrollCmd != (char *) NULL) {
- Tcl_Preserve((ClientData) xScrollCmd);
+ if (xScrollCmd != NULL) {
+ Tcl_Preserve((ClientData) xScrollCmd);
}
yScrollCmd = canvasPtr->yScrollCmd;
- if (yScrollCmd != (char *) NULL) {
- Tcl_Preserve((ClientData) yScrollCmd);
+ if (yScrollCmd != NULL) {
+ Tcl_Preserve((ClientData) yScrollCmd);
}
xOrigin = canvasPtr->xOrigin;
yOrigin = canvasPtr->yOrigin;
@@ -5401,27 +5242,27 @@ CanvasUpdateScrollbars(canvasPtr)
if (canvasPtr->xScrollCmd != NULL) {
Tcl_Obj *fractions = ScrollFractions(xOrigin + inset,
xOrigin + width - inset, scrollX1, scrollX2);
- result = Tcl_VarEval(interp, xScrollCmd, " ",
- Tcl_GetString(fractions), (char *) NULL);
+ result = Tcl_VarEval(interp, xScrollCmd, " ", Tcl_GetString(fractions),
+ NULL);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundError(interp);
}
Tcl_ResetResult(interp);
- Tcl_Release((ClientData) xScrollCmd);
+ Tcl_Release((ClientData) xScrollCmd);
}
if (yScrollCmd != NULL) {
Tcl_Obj *fractions = ScrollFractions(yOrigin + inset,
yOrigin + height - inset, scrollY1, scrollY2);
- result = Tcl_VarEval(interp, yScrollCmd, " ",
- Tcl_GetString(fractions), (char *) NULL);
+ result = Tcl_VarEval(interp, yScrollCmd, " ", Tcl_GetString(fractions),
+ NULL);
Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundError(interp);
}
Tcl_ResetResult(interp);
- Tcl_Release((ClientData) yScrollCmd);
+ Tcl_Release((ClientData) yScrollCmd);
}
Tcl_Release((ClientData) interp);
}
@@ -5431,38 +5272,35 @@ CanvasUpdateScrollbars(canvasPtr)
*
* CanvasSetOrigin --
*
- * This procedure is invoked to change the mapping between
- * canvas coordinates and screen coordinates in the canvas
- * window.
+ * This function is invoked to change the mapping between canvas
+ * coordinates and screen coordinates in the canvas window.
*
* Results:
* None.
*
* Side effects:
- * The canvas will be redisplayed to reflect the change in
- * view. In addition, scrollbars will be updated if there
- * are any.
+ * The canvas will be redisplayed to reflect the change in view. In
+ * addition, scrollbars will be updated if there are any.
*
*--------------------------------------------------------------
*/
static void
-CanvasSetOrigin(canvasPtr, xOrigin, yOrigin)
- TkCanvas *canvasPtr; /* Information about canvas. */
- int xOrigin; /* New X origin for canvas (canvas x-coord
+CanvasSetOrigin(
+ TkCanvas *canvasPtr, /* Information about canvas. */
+ int xOrigin, /* New X origin for canvas (canvas x-coord
* corresponding to left edge of canvas
* window). */
- int yOrigin; /* New Y origin for canvas (canvas y-coord
+ int yOrigin) /* New Y origin for canvas (canvas y-coord
* corresponding to top edge of canvas
* window). */
{
int left, right, top, bottom, delta;
/*
- * If scroll increments have been set, round the window origin
- * to the nearest multiple of the increments. Remember, the
- * origin is the place just inside the borders, not the upper
- * left corner.
+ * If scroll increments have been set, round the window origin to the
+ * nearest multiple of the increments. Remember, the origin is the place
+ * just inside the borders, not the upper left corner.
*/
if (canvasPtr->xScrollIncrement > 0) {
@@ -5490,13 +5328,13 @@ CanvasSetOrigin(canvasPtr, xOrigin, yOrigin)
/*
* 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.
+ * 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.
*/
if ((canvasPtr->confine) && (canvasPtr->regionString != NULL)) {
@@ -5539,11 +5377,11 @@ CanvasSetOrigin(canvasPtr, xOrigin, yOrigin)
}
/*
- * Tricky point: must redisplay not only everything that's visible
- * in the window's final configuration, but also everything that was
- * visible in the initial configuration. This is needed because some
- * item types, like windows, need to know when they move off-screen
- * so they can explicitly undisplay themselves.
+ * Tricky point: must redisplay not only everything that's visible in the
+ * window's final configuration, but also everything that was visible in
+ * the initial configuration. This is needed because some item types, like
+ * windows, need to know when they move off-screen so they can explicitly
+ * undisplay themselves.
*/
Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr,
@@ -5558,37 +5396,38 @@ CanvasSetOrigin(canvasPtr, xOrigin, yOrigin)
canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin),
canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin));
}
-
+
/*
*----------------------------------------------------------------------
*
- * GetStringsFromObjs
+ * TkGetStringsFromObjs --
*
* Results:
* Converts object list into string list.
*
* Side effects:
- * Memory is allocated for the argv array, which must
- * be freed using ckfree() when no longer needed.
+ * Memory is allocated for the objv array, which must be freed using
+ * ckfree() when no longer needed.
*
*----------------------------------------------------------------------
*/
+
/* ARGSUSED */
static CONST char **
-GetStringsFromObjs(argc, objv)
- int argc;
- Tcl_Obj *CONST objv[];
+TkGetStringsFromObjs(
+ int objc,
+ Tcl_Obj *CONST objv[])
{
register int i;
CONST char **argv;
- if (argc <= 0) {
+ if (objc <= 0) {
return NULL;
}
- argv = (CONST char **) ckalloc((argc+1) * sizeof(char *));
- for (i = 0; i < argc; i++) {
- argv[i] = Tcl_GetStringFromObj(objv[i], NULL);
+ argv = (CONST char **) ckalloc((objc+1) * sizeof(char *));
+ for (i = 0; i < objc; i++) {
+ argv[i] = Tcl_GetString(objv[i]);
}
- argv[argc] = 0;
+ argv[objc] = 0;
return argv;
}
@@ -5597,16 +5436,15 @@ GetStringsFromObjs(argc, objv)
*
* Tk_CanvasPsColor --
*
- * This procedure is called by individual canvas items when
- * they want to set a color value for output. Given information
- * about an X color, this procedure will generate Postscript
- * commands to set up an appropriate color in Postscript.
+ * This function is called by individual canvas items when they want to
+ * set a color value for output. Given information about an X color, this
+ * function will generate Postscript commands to set up an appropriate
+ * color in Postscript.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to interp->result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to interp->result.
*
* Side effects:
* None.
@@ -5615,11 +5453,11 @@ GetStringsFromObjs(argc, objv)
*/
int
-Tk_CanvasPsColor(interp, canvas, colorPtr)
- Tcl_Interp *interp; /* Interpreter for returning Postscript
- * or error message. */
- Tk_Canvas canvas; /* Information about canvas. */
- XColor *colorPtr; /* Information about color. */
+Tk_CanvasPsColor(
+ Tcl_Interp *interp, /* Interpreter for returning Postscript or
+ * error message. */
+ Tk_Canvas canvas, /* Information about canvas. */
+ XColor *colorPtr) /* Information about color. */
{
return Tk_PostscriptColor(interp, ((TkCanvas *) canvas)->psInfo,
colorPtr);
@@ -5630,31 +5468,30 @@ Tk_CanvasPsColor(interp, canvas, colorPtr)
*
* Tk_CanvasPsFont --
*
- * This procedure is called by individual canvas items when
- * they want to output text. Given information about an X
- * font, this procedure will generate Postscript commands
- * to set up an appropriate font in Postscript.
+ * This function is called by individual canvas items when they want to
+ * output text. Given information about an X font, this function will
+ * generate Postscript commands to set up an appropriate font in
+ * Postscript.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to the interp->result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to the interp->result.
*
* Side effects:
- * The Postscript font name is entered into psInfoPtr->fontTable
- * if it wasn't already there.
+ * The Postscript font name is entered into psInfoPtr->fontTable if it
+ * wasn't already there.
*
*--------------------------------------------------------------
*/
int
-Tk_CanvasPsFont(interp, canvas, tkfont)
- Tcl_Interp *interp; /* Interpreter for returning Postscript
- * or error message. */
- Tk_Canvas canvas; /* Information about canvas. */
- Tk_Font tkfont; /* Information about font in which text
- * is to be printed. */
+Tk_CanvasPsFont(
+ Tcl_Interp *interp, /* Interpreter for returning Postscript or
+ * error message. */
+ Tk_Canvas canvas, /* Information about canvas. */
+ Tk_Font tkfont) /* Information about font in which text is to
+ * be printed. */
{
return Tk_PostscriptFont(interp, ((TkCanvas *) canvas)->psInfo, tkfont);
}
@@ -5664,16 +5501,14 @@ Tk_CanvasPsFont(interp, canvas, tkfont)
*
* Tk_CanvasPsBitmap --
*
- * This procedure is called to output the contents of a
- * sub-region of a bitmap in proper image data format for
- * Postscript (i.e. data between angle brackets, one bit
- * per pixel).
+ * This function is called to output the contents of a sub-region of a
+ * bitmap in proper image data format for Postscript (i.e. data between
+ * angle brackets, one bit per pixel).
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to interp->result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to interp->result.
*
* Side effects:
* None.
@@ -5682,15 +5517,14 @@ Tk_CanvasPsFont(interp, canvas, tkfont)
*/
int
-Tk_CanvasPsBitmap(interp, canvas, bitmap, startX, startY, width, height)
- Tcl_Interp *interp; /* Interpreter for returning Postscript
- * or error message. */
- Tk_Canvas canvas; /* Information about canvas. */
- Pixmap bitmap; /* Bitmap for which to generate
- * Postscript. */
- int startX, startY; /* Coordinates of upper-left corner
- * of rectangular region to output. */
- int width, height; /* Height of rectangular region. */
+Tk_CanvasPsBitmap(
+ Tcl_Interp *interp, /* Interpreter for returning Postscript or
+ * error message. */
+ Tk_Canvas canvas, /* Information about canvas. */
+ Pixmap bitmap, /* Bitmap for which to generate Postscript. */
+ int startX, int startY, /* Coordinates of upper-left corner of
+ * 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,
@@ -5702,18 +5536,16 @@ Tk_CanvasPsBitmap(interp, canvas, bitmap, startX, startY, width, height)
*
* Tk_CanvasPsStipple --
*
- * This procedure is called by individual canvas items when
- * they have created a path that they'd like to be filled with
- * a stipple pattern. Given information about an X bitmap,
- * this procedure will generate Postscript commands to fill
- * the current clip region using a stipple pattern defined by the
- * bitmap.
+ * This function is called by individual canvas items when they have
+ * created a path that they'd like to be filled with a stipple pattern.
+ * Given information about an X bitmap, this function will generate
+ * Postscript commands to fill the current clip region using a stipple
+ * pattern defined by the bitmap.
*
* Results:
- * Returns a standard Tcl return value. If an error occurs
- * then an error message will be left in interp->result.
- * If no error occurs, then additional Postscript will be
- * appended to interp->result.
+ * Returns a standard Tcl return value. If an error occurs then an error
+ * message will be left in interp->result. If no error occurs, then
+ * additional Postscript will be appended to interp->result.
*
* Side effects:
* None.
@@ -5722,11 +5554,11 @@ Tk_CanvasPsBitmap(interp, canvas, bitmap, startX, startY, width, height)
*/
int
-Tk_CanvasPsStipple(interp, canvas, bitmap)
- Tcl_Interp *interp; /* Interpreter for returning Postscript
- * or error message. */
- Tk_Canvas canvas; /* Information about canvas. */
- Pixmap bitmap; /* Bitmap to use for stippling. */
+Tk_CanvasPsStipple(
+ Tcl_Interp *interp, /* Interpreter for returning Postscript or
+ * error message. */
+ Tk_Canvas canvas, /* Information about canvas. */
+ Pixmap bitmap) /* Bitmap to use for stippling. */
{
return Tk_PostscriptStipple(interp, ((TkCanvas *) canvas)->tkwin,
((TkCanvas *) canvas)->psInfo, bitmap);
@@ -5737,12 +5569,11 @@ Tk_CanvasPsStipple(interp, canvas, bitmap)
*
* Tk_CanvasPsY --
*
- * Given a y-coordinate in canvas coordinates, this procedure
- * returns a y-coordinate to use for Postscript output.
+ * Given a y-coordinate in canvas coordinates, this function returns a
+ * y-coordinate to use for Postscript output.
*
* Results:
- * Returns the Postscript coordinate that corresponds to
- * "y".
+ * Returns the Postscript coordinate that corresponds to "y".
*
* Side effects:
* None.
@@ -5751,10 +5582,10 @@ Tk_CanvasPsStipple(interp, canvas, bitmap)
*/
double
-Tk_CanvasPsY(canvas, y)
- Tk_Canvas canvas; /* Token for canvas on whose behalf
- * Postscript is being generated. */
- double y; /* Y-coordinate in canvas coords. */
+Tk_CanvasPsY(
+ Tk_Canvas canvas, /* Token for canvas on whose behalf Postscript
+ * is being generated. */
+ double y) /* Y-coordinate in canvas coords. */
{
return Tk_PostscriptY(y, ((TkCanvas *) canvas)->psInfo);
}
@@ -5764,8 +5595,8 @@ Tk_CanvasPsY(canvas, y)
*
* Tk_CanvasPsPath --
*
- * Given an array of points for a path, generate Postscript
- * commands to create the path.
+ * Given an array of points for a path, generate Postscript commands to
+ * create the path.
*
* Results:
* Postscript commands get appended to what's in interp->result.
@@ -5777,16 +5608,23 @@ Tk_CanvasPsY(canvas, y)
*/
void
-Tk_CanvasPsPath(interp, canvas, coordPtr, numPoints)
- Tcl_Interp *interp; /* Put generated Postscript in this
- * interpreter's result field. */
- Tk_Canvas canvas; /* Canvas on whose behalf Postscript
- * is being generated. */
- double *coordPtr; /* Pointer to first in array of
- * 2*numPoints coordinates giving
- * points for path. */
- int numPoints; /* Number of points at *coordPtr. */
+Tk_CanvasPsPath(
+ Tcl_Interp *interp, /* Put generated Postscript in this
+ * interpreter's result field. */
+ Tk_Canvas canvas, /* Canvas on whose behalf Postscript is being
+ * generated. */
+ double *coordPtr, /* Pointer to first in array of 2*numPoints
+ * coordinates giving points for path. */
+ int numPoints) /* Number of points at *coordPtr. */
{
Tk_PostscriptPath(interp, ((TkCanvas *) canvas)->psInfo,
coordPtr, numPoints);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h
index ad6c555..d009cfa 100644
--- a/generic/tkCanvas.h
+++ b/generic/tkCanvas.h
@@ -1,15 +1,14 @@
/*
* tkCanvas.h --
*
- * Declarations shared among all the files that implement
- * canvas widgets.
+ * Declarations shared among all the files that implement canvas widgets.
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKCANVAS
@@ -23,36 +22,39 @@
typedef struct TagSearchExpr_s TagSearchExpr;
struct TagSearchExpr_s {
- TagSearchExpr *next; /* for linked lists of expressions - used in bindings */
- Tk_Uid uid; /* the uid of the whole expression */
- Tk_Uid *uids; /* expresion compiled to an array of uids */
- int allocated; /* available space for array of uids */
- int length; /* length of expression */
- int index; /* current position in expression evaluation */
- int match; /* this expression matches event's item's tags*/
+ TagSearchExpr *next; /* For linked lists of expressions - used in
+ * bindings. */
+ Tk_Uid uid; /* The uid of the whole expression. */
+ Tk_Uid *uids; /* Expresion compiled to an array of uids. */
+ int allocated; /* Available space for array of uids. */
+ int length; /* Length of expression. */
+ int index; /* Current position in expression
+ * evaluation. */
+ int match; /* This expression matches event's item's
+ * tags. */
};
#endif /* not USE_OLD_TAG_SEARCH */
/*
- * The record below describes a canvas widget. It is made available
- * to the item procedures so they can access certain shared fields such
- * as the overall displacement and scale factor for the canvas.
+ * The record below describes a canvas widget. It is made available to the
+ * item functions so they can access certain shared fields such as the overall
+ * displacement and scale factor for the canvas.
*/
typedef struct TkCanvas {
- Tk_Window tkwin; /* Window that embodies the canvas. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget; needed, among
+ Tk_Window tkwin; /* Window that embodies the canvas. NULL means
+ * that the window has been destroyed but the
+ * data structures haven't yet been cleaned
+ * up.*/
+ Display *display; /* Display containing widget; needed, among
* other things, to release resources after
* tkwin has already gone away. */
Tcl_Interp *interp; /* Interpreter associated with canvas. */
Tcl_Command widgetCmd; /* Token for canvas's widget command. */
- Tk_Item *firstItemPtr; /* First in list of all items in canvas,
- * or NULL if canvas empty. */
- Tk_Item *lastItemPtr; /* Last in list of all items in canvas,
- * or NULL if canvas empty. */
+ Tk_Item *firstItemPtr; /* First in list of all items in canvas, or
+ * NULL if canvas empty. */
+ Tk_Item *lastItemPtr; /* Last in list of all items in canvas, or
+ * NULL if canvas empty. */
/*
* Information used when displaying widget:
@@ -62,39 +64,39 @@ typedef struct TkCanvas {
Tk_3DBorder bgBorder; /* Used for canvas background. */
int relief; /* Indicates whether window as a whole is
* raised, sunken, or flat. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
+ int highlightWidth; /* Width in pixels of highlight to draw around
+ * widget when it has the focus. <= 0 means
+ * don't draw a highlight. */
XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
+ /* Color for drawing traversal highlight area
+ * when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
int inset; /* Total width of all borders, including
* traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
+ * Indicates how much interior stuff must be
+ * offset from outside edges to leave room for
+ * borders. */
GC pixmapGC; /* Used to copy bits from a pixmap to the
* screen and also to clear the pixmap. */
int width, height; /* Dimensions to request for canvas window,
* specified in pixels. */
- int redrawX1, redrawY1; /* Upper left corner of area to redraw,
- * in pixel coordinates. Border pixels
- * are included. Only valid if
- * REDRAW_PENDING flag is set. */
- int redrawX2, redrawY2; /* Lower right corner of area to redraw,
- * in integer canvas coordinates. Border
- * pixels will *not* be redrawn. */
- int confine; /* Non-zero means constrain view to keep
- * as much of canvas visible as possible. */
+ int redrawX1, redrawY1; /* Upper left corner of area to redraw, in
+ * pixel coordinates. Border pixels are
+ * included. Only valid if REDRAW_PENDING flag
+ * is set. */
+ int redrawX2, redrawY2; /* Lower right corner of area to redraw, in
+ * integer canvas coordinates. Border pixels
+ * will *not* be redrawn. */
+ int confine; /* Non-zero means constrain view to keep as
+ * much of canvas visible as possible. */
/*
* Information used to manage the selection and insertion cursor:
*/
- Tk_CanvasTextInfo textInfo; /* Contains lots of fields; see tk.h for
- * details. This structure is shared with
- * the code that implements individual items. */
+ Tk_CanvasTextInfo textInfo; /* Contains lots of fields; see tk.h for
+ * details. This structure is shared with the
+ * code that implements individual items. */
int insertOnTime; /* Number of milliseconds cursor should spend
* in "on" state for each blink. */
int insertOffTime; /* Number of milliseconds cursor should spend
@@ -104,7 +106,7 @@ typedef struct TkCanvas {
* off. */
/*
- * Transformation applied to canvas as a whole: to compute screen
+ * Transformation applied to canvas as a whole: to compute screen
* coordinates (X,Y) from canvas coordinates (x,y), do the following:
*
* X = x - xOrigin;
@@ -116,65 +118,63 @@ typedef struct TkCanvas {
* canvas pixel units. */
int drawableXOrigin, drawableYOrigin;
/* During redisplay, these fields give the
- * canvas coordinates corresponding to
- * the upper-left corner of the drawable
- * where items are actually being drawn
- * (typically a pixmap smaller than the
- * whole window). */
+ * canvas coordinates corresponding to the
+ * upper-left corner of the drawable where
+ * items are actually being drawn (typically a
+ * pixmap smaller than the whole window). */
/*
* Information used for event bindings associated with items.
*/
Tk_BindingTable bindingTable;
- /* Table of all bindings currently defined
- * for this canvas. NULL means that no
- * bindings exist, so the table hasn't been
- * created. Each "object" used for this
- * table is either a Tk_Uid for a tag or
- * the address of an item named by id. */
+ /* Table of all bindings currently defined for
+ * this canvas. NULL means that no bindings
+ * exist, so the table hasn't been created.
+ * Each "object" used for this table is either
+ * a Tk_Uid for a tag or the address of an
+ * item named by id. */
Tk_Item *currentItemPtr; /* The item currently containing the mouse
* pointer, or NULL if none. */
Tk_Item *newCurrentPtr; /* The item that is about to become the
- * current one, or NULL. This field is
- * used to detect deletions of the new
- * current item pointer that occur during
- * Leave processing of the previous current
- * item. */
- double closeEnough; /* The mouse is assumed to be inside an
- * item if it is this close to it. */
- XEvent pickEvent; /* The event upon which the current choice
- * of currentItem is based. Must be saved
- * so that if the currentItem is deleted,
- * can pick another. */
- int state; /* Last known modifier state. Used to
- * defer picking a new current object
- * while buttons are down. */
+ * current one, or NULL. This field is used to
+ * detect deletions of the new current item
+ * pointer that occur during Leave processing
+ * of the previous current item. */
+ double closeEnough; /* The mouse is assumed to be inside an item
+ * if it is this close to it. */
+ XEvent pickEvent; /* The event upon which the current choice of
+ * currentItem is based. Must be saved so that
+ * if the currentItem is deleted, can pick
+ * another. */
+ int state; /* Last known modifier state. Used to defer
+ * picking a new current object while buttons
+ * are down. */
/*
* Information used for managing scrollbars:
*/
char *xScrollCmd; /* Command prefix for communicating with
- * horizontal scrollbar. NULL means no
- * horizontal scrollbar. Malloc'ed*/
+ * horizontal scrollbar. NULL means no
+ * horizontal scrollbar. Malloc'ed. */
char *yScrollCmd; /* Command prefix for communicating with
- * vertical scrollbar. NULL means no
- * vertical scrollbar. Malloc'ed*/
+ * vertical scrollbar. NULL means no vertical
+ * scrollbar. Malloc'ed. */
int scrollX1, scrollY1, scrollX2, scrollY2;
/* These four coordinates define the region
* that is the 100% area for scrolling (i.e.
* these numbers determine the size and
* location of the sliders on scrollbars).
* Units are pixels in canvas coords. */
- char *regionString; /* The option string from which scrollX1
- * etc. are derived. Malloc'ed. */
+ char *regionString; /* The option string from which scrollX1 etc.
+ * are derived. Malloc'ed. */
int xScrollIncrement; /* If >0, defines a grid for horizontal
- * scrolling. This is the size of the "unit",
+ * scrolling. This is the size of the "unit",
* and the left edge of the screen will always
* lie on an even unit boundary. */
int yScrollIncrement; /* If >0, defines a grid for horizontal
- * scrolling. This is the size of the "unit",
+ * scrolling. This is the size of the "unit",
* and the left edge of the screen will always
* lie on an even unit boundary. */
@@ -195,11 +195,11 @@ typedef struct TkCanvas {
*/
Tk_Item *hotPtr; /* Pointer to "hot" item (one that's been
- * recently used. NULL means there's no
- * hot item. */
+ * recently used. NULL means there's no hot
+ * item. */
Tk_Item *hotPrevPtr; /* Pointer to predecessor to hotPtr (NULL
- * means item is first in list). This is
- * only a hint and may not really be hotPtr's
+ * means item is first in list). This is only
+ * a hint and may not really be hotPtr's
* predecessor. */
/*
@@ -207,61 +207,61 @@ typedef struct TkCanvas {
*/
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- double pixelsPerMM; /* Scale factor between MM and pixels;
- * used when converting coordinates. */
- int flags; /* Various flags; see below for
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
+ double pixelsPerMM; /* Scale factor between MM and pixels; used
+ * when converting coordinates. */
+ int flags; /* Various flags; see below for
* definitions. */
- int nextId; /* Number to use as id for next item
- * created in widget. */
- Tk_PostscriptInfo psInfo;
- /* Pointer to information used for generating
- * Postscript for the canvas. NULL means
- * no Postscript is currently being
- * generated. */
+ int nextId; /* Number to use as id for next item created
+ * in widget. */
+ Tk_PostscriptInfo psInfo; /* Pointer to information used for generating
+ * Postscript for the canvas. NULL means no
+ * Postscript is currently being generated. */
Tcl_HashTable idTable; /* Table of integer indices. */
+
/*
* Additional information, added by the 'dash'-patch
*/
- VOID *reserved1;
- Tk_State canvas_state; /* state of canvas */
- VOID *reserved2;
- VOID *reserved3;
+
+ void *reserved1;
+ Tk_State canvas_state; /* State of canvas. */
+ void *reserved2;
+ void *reserved3;
Tk_TSOffset tsoffset;
#ifndef USE_OLD_TAG_SEARCH
- TagSearchExpr *bindTagExprs; /* linked list of tag expressions used in bindings */
+ TagSearchExpr *bindTagExprs;/* Linked list of tag expressions used in
+ * bindings. */
#endif
} TkCanvas;
/*
* Flag bits for canvases:
*
- * REDRAW_PENDING - 1 means a DoWhenIdle handler has already
- * been created to redraw some or all of the
- * canvas.
+ * REDRAW_PENDING - 1 means a DoWhenIdle handler has already been
+ * created to redraw some or all of the canvas.
* REDRAW_BORDERS - 1 means that the borders need to be redrawn
* during the next redisplay operation.
* REPICK_NEEDED - 1 means DisplayCanvas should pick a new
* current item before redrawing the canvas.
- * GOT_FOCUS - 1 means the focus is currently in this
- * widget, so should draw the insertion cursor
- * and traversal highlight.
+ * GOT_FOCUS - 1 means the focus is currently in this widget,
+ * so should draw the insertion cursor and
+ * traversal highlight.
* CURSOR_ON - 1 means the insertion cursor is in the "on"
- * phase of its blink cycle. 0 means either
- * we don't have the focus or the cursor is in
- * the "off" phase of its cycle.
- * UPDATE_SCROLLBARS - 1 means the scrollbars should get updated
- * as part of the next display operation.
- * LEFT_GRABBED_ITEM - 1 means that the mouse left the current
- * item while a grab was in effect, so we
- * didn't change canvasPtr->currentItemPtr.
+ * phase of its blink cycle. 0 means either we
+ * don't have the focus or the cursor is in the
+ * "off" phase of its cycle.
+ * UPDATE_SCROLLBARS - 1 means the scrollbars should get updated as
+ * part of the next display operation.
+ * LEFT_GRABBED_ITEM - 1 means that the mouse left the current item
+ * while a grab was in effect, so we didn't
+ * change canvasPtr->currentItemPtr.
* REPICK_IN_PROGRESS - 1 means PickCurrentItem is currently
- * executing. If it should be called recursively,
+ * executing. If it should be called recursively,
* it should simply return immediately.
- * BBOX_NOT_EMPTY - 1 means that the bounding box of the area
- * that should be redrawn is not empty.
+ * BBOX_NOT_EMPTY - 1 means that the bounding box of the area that
+ * should be redrawn is not empty.
*/
#define REDRAW_PENDING 1
@@ -277,8 +277,8 @@ typedef struct TkCanvas {
/*
* Flag bits for canvas items (redraw_flags):
*
- * FORCE_REDRAW - 1 means that the new coordinates of some
- * item are not yet registered using
+ * FORCE_REDRAW - 1 means that the new coordinates of some item
+ * are not yet registered using
* Tk_CanvasEventuallyRedraw(). It should still
* be done by the general canvas code.
*/
@@ -286,20 +286,21 @@ typedef struct TkCanvas {
#define FORCE_REDRAW 8
/*
- * Canvas-related procedures that are shared among Tk modules but not
- * exported to the outside world:
+ * Canvas-related functions that are shared among Tk modules but not exported
+ * to the outside world:
*/
-extern int TkCanvPostscriptCmd _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Interp *interp, int argc, CONST char **argv));
-
+MODULE_SCOPE int TkCanvPostscriptCmd(TkCanvas *canvasPtr,
+ Tcl_Interp *interp, int argc, CONST char **argv);
+MODULE_SCOPE int TkCanvTranslatePath(TkCanvas *canvPtr,
+ int numVertex, double *coordPtr, int closed,
+ XPoint *outPtr);
/*
- * Other procedures that are shared among Tk canvas modules but not exported
- * to the outside world:
+ * Standard item types provided by Tk:
*/
-extern int TkCanvTranslatePath _ANSI_ARGS_((TkCanvas *canvPtr,
- int numVertex, double *coordPtr, int closed,
- XPoint *outPtr));
+MODULE_SCOPE Tk_ItemType tkArcType, tkBitmapType, tkImageType, tkLineType;
+MODULE_SCOPE Tk_ItemType tkOvalType, tkPolygonType;
+MODULE_SCOPE Tk_ItemType tkRectangleType, tkTextType, tkWindowType;
#endif /* _TKCANVAS */
diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c
index 8c37f09..9428894 100644
--- a/generic/tkClipboard.c
+++ b/generic/tkClipboard.c
@@ -1,48 +1,46 @@
/*
* tkClipboard.c --
*
- * This file manages the clipboard for the Tk toolkit,
- * maintaining a collection of data buffers that will be
- * supplied on demand to requesting applications.
+ * This file manages the clipboard for the Tk toolkit, maintaining a
+ * collection of data buffers that will be supplied on demand to
+ * requesting applications.
*
* Copyright (c) 1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkPort.h"
#include "tkSelect.h"
/*
- * Prototypes for procedures used only in this file:
+ * Prototypes for functions used only in this file:
*/
-static int ClipboardAppHandler _ANSI_ARGS_((ClientData clientData,
- int offset, char *buffer, int maxBytes));
-static int ClipboardHandler _ANSI_ARGS_((ClientData clientData,
- int offset, char *buffer, int maxBytes));
-static int ClipboardWindowHandler _ANSI_ARGS_((
- ClientData clientData, int offset, char *buffer,
- int maxBytes));
-static void ClipboardLostSel _ANSI_ARGS_((ClientData clientData));
-static int ClipboardGetProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *portion));
+static int ClipboardAppHandler(ClientData clientData,
+ int offset, char *buffer, int maxBytes);
+static int ClipboardHandler(ClientData clientData,
+ int offset, char *buffer, int maxBytes);
+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);
/*
*----------------------------------------------------------------------
*
* ClipboardHandler --
*
- * This procedure acts as selection handler for the
- * clipboard manager. It extracts the required chunk of
- * data from the buffer chain for a given selection target.
+ * This function acts as selection handler for the clipboard manager. It
+ * extracts the required chunk of data from the buffer chain for a given
+ * selection target.
*
* Results:
- * The return value is a count of the number of bytes
- * actually stored at buffer.
+ * The return value is a count of the number of bytes actually stored at
+ * buffer.
*
* Side effects:
* None.
@@ -51,17 +49,17 @@ static int ClipboardGetProc _ANSI_ARGS_((ClientData clientData,
*/
static int
-ClipboardHandler(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Information about data to fetch. */
- int offset; /* Return selection bytes starting at this
+ClipboardHandler(
+ ClientData clientData, /* Information about data to fetch. */
+ int offset, /* Return selection bytes starting at this
* offset. */
- char *buffer; /* Place to store converted selection. */
- int maxBytes; /* Maximum # of bytes to store at buffer. */
+ char *buffer, /* Place to store converted selection. */
+ int maxBytes) /* Maximum # of bytes to store at buffer. */
{
TkClipboardTarget *targetPtr = (TkClipboardTarget*) clientData;
TkClipboardBuffer *cbPtr;
char *srcPtr, *destPtr;
- int count = 0;
+ size_t count = 0;
int scanned = 0;
size_t length, freeCount;
@@ -104,7 +102,7 @@ ClipboardHandler(clientData, offset, buffer, maxBytes)
srcPtr = cbPtr->buffer;
length = cbPtr->length;
}
- return count;
+ return (int)count;
}
/*
@@ -112,16 +110,15 @@ ClipboardHandler(clientData, offset, buffer, maxBytes)
*
* ClipboardAppHandler --
*
- * This procedure acts as selection handler for retrievals of type
- * TK_APPLICATION. It returns the name of the application that
- * owns the clipboard. Note: we can't use the default Tk
- * selection handler for this selection type, because the clipboard
- * window isn't a "real" window and doesn't have the necessary
- * information.
+ * This function acts as selection handler for retrievals of type
+ * TK_APPLICATION. It returns the name of the application that owns the
+ * clipboard. Note: we can't use the default Tk selection handler for
+ * this selection type, because the clipboard window isn't a "real"
+ * window and doesn't have the necessary information.
*
* Results:
- * The return value is a count of the number of bytes
- * actually stored at buffer.
+ * The return value is a count of the number of bytes actually stored at
+ * buffer.
*
* Side effects:
* None.
@@ -130,12 +127,12 @@ ClipboardHandler(clientData, offset, buffer, maxBytes)
*/
static int
-ClipboardAppHandler(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Pointer to TkDisplay structure. */
- int offset; /* Return selection bytes starting at this
+ClipboardAppHandler(
+ ClientData clientData, /* Pointer to TkDisplay structure. */
+ int offset, /* Return selection bytes starting at this
* offset. */
- char *buffer; /* Place to store converted selection. */
- int maxBytes; /* Maximum # of bytes to store at buffer. */
+ char *buffer, /* Place to store converted selection. */
+ int maxBytes) /* Maximum # of bytes to store at buffer. */
{
TkDisplay *dispPtr = (TkDisplay *) clientData;
size_t length;
@@ -151,7 +148,7 @@ ClipboardAppHandler(clientData, offset, buffer, maxBytes)
length = maxBytes;
}
strncpy(buffer, p, length);
- return length;
+ return (int)length;
}
/*
@@ -159,15 +156,13 @@ ClipboardAppHandler(clientData, offset, buffer, maxBytes)
*
* ClipboardWindowHandler --
*
- * This procedure acts as selection handler for retrievals of
- * type TK_WINDOW. Since the clipboard doesn't correspond to
- * any particular window, we just return ".". We can't use Tk's
- * default handler for this selection type, because the clipboard
- * window isn't a valid window.
+ * This function acts as selection handler for retrievals of type
+ * TK_WINDOW. Since the clipboard doesn't correspond to any particular
+ * window, we just return ".". We can't use Tk's default handler for this
+ * selection type, because the clipboard window isn't a valid window.
*
* Results:
- * The return value is 1, the number of non-null bytes stored
- * at buffer.
+ * The return value is 1, the number of non-null bytes stored at buffer.
*
* Side effects:
* None.
@@ -176,12 +171,12 @@ ClipboardAppHandler(clientData, offset, buffer, maxBytes)
*/
static int
-ClipboardWindowHandler(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Not used. */
- int offset; /* Return selection bytes starting at this
+ClipboardWindowHandler(
+ ClientData clientData, /* Not used. */
+ int offset, /* Return selection bytes starting at this
* offset. */
- char *buffer; /* Place to store converted selection. */
- int maxBytes; /* Maximum # of bytes to store at buffer. */
+ char *buffer, /* Place to store converted selection. */
+ int maxBytes) /* Maximum # of bytes to store at buffer. */
{
buffer[0] = '.';
buffer[1] = 0;
@@ -193,9 +188,9 @@ ClipboardWindowHandler(clientData, offset, buffer, maxBytes)
*
* ClipboardLostSel --
*
- * This procedure is invoked whenever clipboard ownership is
- * claimed by another window. It just sets a flag so that we
- * know the clipboard was taken away.
+ * This function is invoked whenever clipboard ownership is claimed by
+ * another window. It just sets a flag so that we know the clipboard was
+ * taken away.
*
* Results:
* None.
@@ -207,8 +202,8 @@ ClipboardWindowHandler(clientData, offset, buffer, maxBytes)
*/
static void
-ClipboardLostSel(clientData)
- ClientData clientData; /* Pointer to TkDisplay structure. */
+ClipboardLostSel(
+ ClientData clientData) /* Pointer to TkDisplay structure. */
{
TkDisplay *dispPtr = (TkDisplay*) clientData;
@@ -220,33 +215,31 @@ ClipboardLostSel(clientData)
*
* Tk_ClipboardClear --
*
- * Take control of the clipboard and clear out the previous
- * contents. This procedure must be invoked before any
- * calls to Tk_ClipboardAppend.
+ * Take control of the clipboard and clear out the previous contents.
+ * This function must be invoked before any calls to Tk_ClipboardAppend.
*
* Results:
- * A standard Tcl result. If an error occurs, an error message is
- * left in the interp's result.
+ * A standard Tcl result. If an error occurs, an error message is left in
+ * the interp's result.
*
* Side effects:
- * From now on, requests for the CLIPBOARD selection will be
- * directed to the clipboard manager routines associated with
- * clipWindow for the display of tkwin. In order to guarantee
- * atomicity, no event handling should occur between
- * Tk_ClipboardClear and the following Tk_ClipboardAppend
- * calls. This procedure may cause a user-defined LostSel command
- * to be invoked when the CLIPBOARD is claimed, so any calling
- * function should be reentrant at the point Tk_ClipboardClear is
+ * From now on, requests for the CLIPBOARD selection will be directed to
+ * the clipboard manager routines associated with clipWindow for the
+ * display of tkwin. In order to guarantee atomicity, no event handling
+ * should occur between Tk_ClipboardClear and the following
+ * Tk_ClipboardAppend calls. This function may cause a user-defined
+ * LostSel command to be invoked when the CLIPBOARD is claimed, so any
+ * calling function should be reentrant at the point Tk_ClipboardClear is
* invoked.
*
*----------------------------------------------------------------------
*/
int
-Tk_ClipboardClear(interp, tkwin)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- Tk_Window tkwin; /* Window in application that is clearing
- * clipboard; identifies application and
+Tk_ClipboardClear(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ Tk_Window tkwin) /* Window in application that is clearing
+ * clipboard; identifies application and
* display. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -264,8 +257,8 @@ Tk_ClipboardClear(interp, tkwin)
}
/*
- * Discard any existing clipboard data and delete the selection
- * handler(s) associated with that data.
+ * Discard any existing clipboard data and delete the selection handler(s)
+ * associated with that data.
*/
for (targetPtr = dispPtr->clipTargetPtr; targetPtr != NULL;
@@ -301,38 +294,37 @@ Tk_ClipboardClear(interp, tkwin)
*
* Tk_ClipboardAppend --
*
- * Append a buffer of data to the clipboard. The first buffer of
- * a given type determines the format for that type. Any successive
- * appends to that type must have the same format or an error will
- * be returned. Tk_ClipboardClear must be called before a sequence
- * of Tk_ClipboardAppend calls can be issued. In order to guarantee
+ * Append a buffer of data to the clipboard. The first buffer of a given
+ * type determines the format for that type. Any successive appends to
+ * that type must have the same format or an error will be returned.
+ * Tk_ClipboardClear must be called before a sequence of
+ * Tk_ClipboardAppend calls can be issued. In order to guarantee
* atomicity, no event handling should occur between Tk_ClipboardClear
* and the following Tk_ClipboardAppend calls.
*
* Results:
- * A standard Tcl result. If an error is returned, an error message
- * is left in the interp's result.
+ * A standard Tcl result. If an error is returned, an error message is
+ * left in the interp's result.
*
* Side effects:
- * The specified buffer will be copied onto the end of the clipboard.
- * The clipboard maintains a list of buffers which will be used to
- * supply the data for a selection get request. The first time a given
- * type is appended, Tk_ClipboardAppend will register a selection
- * handler of the appropriate type.
+ * The specified buffer will be copied onto the end of the clipboard.
+ * The clipboard maintains a list of buffers which will be used to supply
+ * the data for a selection get request. The first time a given type is
+ * appended, Tk_ClipboardAppend will register a selection handler of the
+ * appropriate type.
*
*----------------------------------------------------------------------
*/
int
-Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Window tkwin; /* Window that selects a display. */
- Atom type; /* The desired conversion type for this
+Tk_ClipboardAppend(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Window tkwin, /* Window that selects a display. */
+ Atom type, /* The desired conversion type for this
* 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
+ Atom format, /* Format in which the selection information
+ * should be returned to the requestor. */
+ char* buffer) /* NULL terminated string containing the data
* to be added to the clipboard. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -341,8 +333,8 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
TkClipboardBuffer *cbPtr;
/*
- * If this application doesn't already own the clipboard, clear
- * the clipboard. If we don't own the clipboard selection, claim it.
+ * If this application doesn't already own the clipboard, clear the
+ * clipboard. If we don't own the clipboard selection, claim it.
*/
if (dispPtr->clipboardAppPtr != winPtr->mainPtr) {
@@ -355,14 +347,15 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
/*
* Check to see if the specified target is already present on the
- * clipboard. If it isn't, we need to create a new target; otherwise,
- * we just append the new buffer to the clipboard list.
+ * clipboard. If it isn't, we need to create a new target; otherwise, we
+ * just append the new buffer to the clipboard list.
*/
for (targetPtr = dispPtr->clipTargetPtr; targetPtr != NULL;
targetPtr = targetPtr->nextPtr) {
- if (targetPtr->type == type)
+ if (targetPtr->type == type) {
break;
+ }
}
if (targetPtr == NULL) {
targetPtr = (TkClipboardTarget*) ckalloc(sizeof(TkClipboardTarget));
@@ -377,7 +370,7 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
Tcl_AppendResult(interp, "format \"", Tk_GetAtomName(tkwin, format),
"\" does not match current format \"",
Tk_GetAtomName(tkwin, targetPtr->format),"\" for ",
- Tk_GetAtomName(tkwin, type), (char *) NULL);
+ Tk_GetAtomName(tkwin, type), NULL);
return TCL_ERROR;
}
@@ -408,9 +401,8 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
*
* Tk_ClipboardObjCmd --
*
- * This procedure is invoked to process the "clipboard" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This function is invoked to process the "clipboard" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -422,12 +414,11 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
*/
int
-Tk_ClipboardObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+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. */
{
Tk_Window tkwin = (Tk_Window) clientData;
char *path = NULL;
@@ -447,173 +438,173 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
}
switch ((enum options) index) {
- case CLIPBOARD_APPEND: {
- Atom target, format;
- char *targetName = NULL;
- char *formatName = NULL;
- char *string;
- static CONST char *appendOptionStrings[] = {
- "-displayof", "-format", "-type", NULL
- };
- enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT,
- APPEND_TYPE };
- int subIndex, length;
-
- for (i = 2; i < objc - 1; i++) {
- string = Tcl_GetStringFromObj(objv[i], &length);
- if (string[0] != '-') {
- break;
- }
-
- /*
- * If the argument is "--", it signifies the end of arguments.
- */
- if (string[1] == '-' && length == 2) {
- i++;
- break;
- }
- if (Tcl_GetIndexFromObj(interp, objv[i], appendOptionStrings,
- "option", 0, &subIndex) != TCL_OK) {
- return TCL_ERROR;
- }
-
- /*
- * Increment i so that it points to the value for the flag
- * instead of the flag itself.
- */
+ case CLIPBOARD_APPEND: {
+ Atom target, format;
+ char *targetName = NULL;
+ char *formatName = NULL;
+ char *string;
+ static CONST char *appendOptionStrings[] = {
+ "-displayof", "-format", "-type", NULL
+ };
+ enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE };
+ int subIndex, length;
+
+ for (i = 2; i < objc - 1; i++) {
+ string = Tcl_GetStringFromObj(objv[i], &length);
+ if (string[0] != '-') {
+ break;
+ }
+ /*
+ * If the argument is "--", it signifies the end of arguments.
+ */
+ if (string[1] == '-' && length == 2) {
i++;
- if (i >= objc) {
- Tcl_AppendResult(interp, "value for \"", string,
- "\" missing", (char *) NULL);
- return TCL_ERROR;
- }
- switch ((enum appendOptions) subIndex) {
- case APPEND_DISPLAYOF:
- path = Tcl_GetString(objv[i]);
- break;
- case APPEND_FORMAT:
- formatName = Tcl_GetString(objv[i]);
- break;
- case APPEND_TYPE:
- targetName = Tcl_GetString(objv[i]);
- break;
- }
+ break;
}
- if (objc - i != 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options? data");
+ if (Tcl_GetIndexFromObj(interp, objv[i], appendOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
return TCL_ERROR;
}
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
+
+ /*
+ * Increment i so that it points to the value for the flag instead
+ * of the flag itself.
+ */
+
+ i++;
+ if (i >= objc) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", NULL);
return TCL_ERROR;
}
- if (targetName != NULL) {
- target = Tk_InternAtom(tkwin, targetName);
- } else {
- target = XA_STRING;
- }
- if (formatName != NULL) {
- format = Tk_InternAtom(tkwin, formatName);
- } else {
- format = XA_STRING;
+ switch ((enum appendOptions) subIndex) {
+ case APPEND_DISPLAYOF:
+ path = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_FORMAT:
+ formatName = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_TYPE:
+ targetName = Tcl_GetString(objv[i]);
+ break;
}
- return Tk_ClipboardAppend(interp, tkwin, target, format,
- Tcl_GetString(objv[i]));
}
- case CLIPBOARD_CLEAR: {
- static CONST char *clearOptionStrings[] = { "-displayof", NULL };
- enum clearOptions { CLEAR_DISPLAYOF };
- int subIndex;
- if (objc != 2 && objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
- return TCL_ERROR;
- }
+ if (objc - i != 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options? data");
+ return TCL_ERROR;
+ }
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
+ }
+ if (formatName != NULL) {
+ format = Tk_InternAtom(tkwin, formatName);
+ } else {
+ format = XA_STRING;
+ }
+ return Tk_ClipboardAppend(interp, tkwin, target, format,
+ Tcl_GetString(objv[i]));
+ }
+ case CLIPBOARD_CLEAR: {
+ static CONST char *clearOptionStrings[] = { "-displayof", NULL };
+ enum clearOptions { CLEAR_DISPLAYOF };
+ int subIndex;
+
+ if (objc != 2 && objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
+ return TCL_ERROR;
+ }
- if (objc == 4) {
- if (Tcl_GetIndexFromObj(interp, objv[2], clearOptionStrings,
- "option", 0, &subIndex) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((enum clearOptions) subIndex == CLEAR_DISPLAYOF) {
- path = Tcl_GetString(objv[3]);
- }
- }
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
+ if (objc == 4) {
+ if (Tcl_GetIndexFromObj(interp, objv[2], clearOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
return TCL_ERROR;
}
- return Tk_ClipboardClear(interp, tkwin);
- }
- case CLIPBOARD_GET: {
- Atom target;
- char *targetName = NULL;
- Tcl_DString selBytes;
- int result;
- char *string;
- static CONST char *getOptionStrings[] = {
- "-displayof", "-type", NULL
- };
- enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE };
- int subIndex;
-
- for (i = 2; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- if (string[0] != '-') {
- break;
- }
- if (Tcl_GetIndexFromObj(interp, objv[i], getOptionStrings,
- "option", 0, &subIndex) != TCL_OK) {
- return TCL_ERROR;
- }
- i++;
- if (i >= objc) {
- Tcl_AppendResult(interp, "value for \"", string,
- "\" missing", (char *) NULL);
- return TCL_ERROR;
- }
- switch ((enum getOptions) subIndex) {
- case APPEND_DISPLAYOF:
- path = Tcl_GetString(objv[i]);
- break;
- case APPEND_TYPE:
- targetName = Tcl_GetString(objv[i]);
- break;
- }
+ if ((enum clearOptions) subIndex == CLEAR_DISPLAYOF) {
+ path = Tcl_GetString(objv[3]);
}
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ return Tk_ClipboardClear(interp, tkwin);
+ }
+ case CLIPBOARD_GET: {
+ Atom target;
+ char *targetName = NULL;
+ Tcl_DString selBytes;
+ int result;
+ char *string;
+ static CONST char *getOptionStrings[] = {
+ "-displayof", "-type", NULL
+ };
+ enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE };
+ int subIndex;
+
+ for (i = 2; i < objc; i++) {
+ string = Tcl_GetString(objv[i]);
+ if (string[0] != '-') {
+ break;
}
- if (tkwin == NULL) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], getOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
return TCL_ERROR;
}
- selection = Tk_InternAtom(tkwin, "CLIPBOARD");
-
- if (objc - i > 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ i++;
+ if (i >= objc) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", NULL);
return TCL_ERROR;
- } else if (objc - i == 1) {
- target = Tk_InternAtom(tkwin, Tcl_GetString(objv[i]));
- } else if (targetName != NULL) {
- target = Tk_InternAtom(tkwin, targetName);
- } else {
- target = XA_STRING;
}
-
- Tcl_DStringInit(&selBytes);
- result = Tk_GetSelection(interp, tkwin, selection, target,
- ClipboardGetProc, (ClientData) &selBytes);
- if (result == TCL_OK) {
- Tcl_DStringResult(interp, &selBytes);
- } else {
- Tcl_DStringFree(&selBytes);
+ switch ((enum getOptions) subIndex) {
+ case APPEND_DISPLAYOF:
+ path = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_TYPE:
+ targetName = Tcl_GetString(objv[i]);
+ break;
}
- return result;
}
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ selection = Tk_InternAtom(tkwin, "CLIPBOARD");
+
+ if (objc - i > 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options?");
+ return TCL_ERROR;
+ } else if (objc - i == 1) {
+ target = Tk_InternAtom(tkwin, Tcl_GetString(objv[i]));
+ } else if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
+ }
+
+ Tcl_DStringInit(&selBytes);
+ result = Tk_GetSelection(interp, tkwin, selection, target,
+ ClipboardGetProc, (ClientData) &selBytes);
+ if (result == TCL_OK) {
+ Tcl_DStringResult(interp, &selBytes);
+ } else {
+ Tcl_DStringFree(&selBytes);
+ }
+ return result;
+ }
}
return TCL_OK;
}
@@ -623,8 +614,8 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
*
* TkClipInit --
*
- * This procedure is called to initialize the window for claiming
- * clipboard ownership and for receiving selection get results. This
+ * This function is called to initialize the window for claiming
+ * clipboard ownership and for receiving selection get results. This
* function is called from tkSelect.c as well as tkClipboard.c.
*
* Results:
@@ -639,17 +630,16 @@ Tk_ClipboardObjCmd(clientData, interp, objc, objv)
*/
int
-TkClipInit(interp, dispPtr)
- Tcl_Interp *interp; /* Interpreter to use for error
- * reporting. */
- register TkDisplay *dispPtr;/* Display to initialize. */
+TkClipInit(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ register TkDisplay *dispPtr)/* Display to initialize. */
{
XSetWindowAttributes atts;
dispPtr->clipTargetPtr = NULL;
dispPtr->clipboardActive = 0;
dispPtr->clipboardAppPtr = NULL;
-
+
/*
* Create the window used for clipboard ownership and selection retrieval,
* and set up an event handler for it.
@@ -667,17 +657,17 @@ TkClipInit(interp, dispPtr)
if (dispPtr->multipleAtom == None) {
/*
- * Need to invoke selection initialization to make sure that
- * atoms we depend on below are defined.
+ * Need to invoke selection initialization to make sure that atoms we
+ * depend on below are defined.
*/
TkSelInit(dispPtr->clipWindow);
}
/*
- * Create selection handlers for types TK_APPLICATION and TK_WINDOW
- * on this window. Can't use the default handlers for these types
- * because this isn't a full-fledged window.
+ * Create selection handlers for types TK_APPLICATION and TK_WINDOW on
+ * this window. Can't use the default handlers for these types because
+ * this isn't a full-fledged window.
*/
Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
@@ -694,29 +684,37 @@ TkClipInit(interp, dispPtr)
*
* ClipboardGetProc --
*
- * This procedure is invoked to process pieces of the selection
- * as they arrive during "clipboard get" commands.
+ * This function is invoked to process pieces of the selection as they
+ * arrive during "clipboard get" commands.
*
* Results:
* Always returns TCL_OK.
*
* Side effects:
- * Bytes get appended to the dynamic string pointed to by the
- * clientData argument.
+ * Bytes get appended to the dynamic string pointed to by the clientData
+ * argument.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static int
-ClipboardGetProc(clientData, interp, portion)
- ClientData clientData; /* Dynamic string holding partially
- * assembled selection. */
- Tcl_Interp *interp; /* Interpreter used for error
- * reporting (not used). */
- char *portion; /* New information to be appended. */
+ClipboardGetProc(
+ ClientData clientData, /* Dynamic string holding partially assembled
+ * selection. */
+ Tcl_Interp *interp, /* Interpreter used for error reporting (not
+ * used). */
+ char *portion) /* New information to be appended. */
{
Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1);
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index 16cfd8d..a86ef84 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -1,50 +1,47 @@
-/*
+/*
* tkCmds.c --
*
- * This file contains a collection of Tk-related Tcl commands
- * that didn't fit in any particular file of the toolkit.
+ * This file contains a collection of Tk-related Tcl commands that didn't
+ * fit in any particular file of the toolkit.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 2000 Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
#if defined(WIN32)
#include "tkWinInt.h"
-#elif defined(MAC_TCL)
-#include "tkMacInt.h"
-#elif defined(MAC_OSX_TK)
+#elif defined(MAC_OSX_TK)
#include "tkMacOSXInt.h"
#else
#include "tkUnixInt.h"
#endif
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static TkWindow * GetToplevel _ANSI_ARGS_((Tk_Window tkwin));
-static char * WaitVariableProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags));
-static void WaitVisibilityProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void WaitWindowProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
+static TkWindow * GetTopHierarchy(Tk_Window tkwin);
+static char * WaitVariableProc(ClientData clientData,
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
+static void WaitVisibilityProc(ClientData clientData,
+ XEvent *eventPtr);
+static void WaitWindowProc(ClientData clientData,
+ XEvent *eventPtr);
/*
*----------------------------------------------------------------------
*
* Tk_BellObjCmd --
*
- * This procedure is invoked to process the "bell" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "bell" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -56,18 +53,21 @@ static void WaitWindowProc _ANSI_ARGS_((ClientData clientData,
*/
int
-Tk_BellObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_BellObjCmd(
+ 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 *bellOptions[] = {"-displayof", "-nice", (char *) NULL};
+ static const char *bellOptions[] = {
+ "-displayof", "-nice", NULL
+ };
enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE };
Tk_Window tkwin = (Tk_Window) clientData;
int i, index, nice = 0;
if (objc > 4) {
+ wrongArgs:
Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?-nice?");
return TCL_ERROR;
}
@@ -78,20 +78,18 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
switch ((enum options) index) {
- case TK_BELL_DISPLAYOF:
- if (++i >= objc) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "?-displayof window? ?-nice?");
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- break;
- case TK_BELL_NICE:
- nice = 1;
- break;
+ case TK_BELL_DISPLAYOF:
+ if (++i >= objc) {
+ goto wrongArgs;
+ }
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_BELL_NICE:
+ nice = 1;
+ break;
}
}
XBell(Tk_Display(tkwin), 0);
@@ -107,8 +105,8 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
*
* Tk_BindObjCmd --
*
- * This procedure is invoked to process the "bind" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "bind" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -120,23 +118,23 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
*/
int
-Tk_BindObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_BindObjCmd(
+ 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;
TkWindow *winPtr;
ClientData object;
char *string;
-
+
if ((objc < 2) || (objc > 4)) {
Tcl_WrongNumArgs(interp, 1, objv, "window ?pattern? ?command?");
return TCL_ERROR;
}
string = Tcl_GetString(objv[1]);
-
+
/*
* Bind tags either a window name or a tag name for the first argument.
* If the argument starts with ".", assume it is a window; otherwise, it
@@ -155,8 +153,8 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
}
/*
- * If there are four arguments, the command is modifying a binding. If
- * there are three arguments, the command is querying a binding. If there
+ * If there are four arguments, the command is modifying a binding. If
+ * there are three arguments, the command is querying a binding. If there
* are only two arguments, the command is querying all the bindings for
* the given tag/window.
*/
@@ -167,7 +165,7 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
char *sequence, *script;
sequence = Tcl_GetString(objv[2]);
script = Tcl_GetString(objv[3]);
-
+
/*
* If the script is null, just delete the binding.
*/
@@ -181,7 +179,7 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
* If the script begins with "+", append this script to the existing
* binding.
*/
-
+
if (script[0] == '+') {
script++;
append = 1;
@@ -192,7 +190,7 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
} else if (objc == 3) {
- CONST char *command;
+ const char *command;
command = Tk_GetBinding(interp, winPtr->mainPtr->bindingTable,
object, Tcl_GetString(objv[2]));
@@ -212,8 +210,8 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
*
* TkBindEventProc --
*
- * This procedure is invoked by Tk_HandleEvent for each event; it
- * causes any appropriate bindings for that event to be invoked.
+ * This function is invoked by Tk_HandleEvent for each event; it causes
+ * any appropriate bindings for that event to be invoked.
*
* Results:
* None.
@@ -226,9 +224,9 @@ Tk_BindObjCmd(clientData, interp, objc, objv)
*/
void
-TkBindEventProc(winPtr, eventPtr)
- TkWindow *winPtr; /* Pointer to info about window. */
- XEvent *eventPtr; /* Information about event. */
+TkBindEventProc(
+ TkWindow *winPtr, /* Pointer to info about window. */
+ XEvent *eventPtr) /* Information about event. */
{
#define MAX_OBJS 20
ClientData objects[MAX_OBJS], *objPtr;
@@ -244,8 +242,8 @@ TkBindEventProc(winPtr, eventPtr)
objPtr = objects;
if (winPtr->numTags != 0) {
/*
- * Make a copy of the tags for the window, replacing window names
- * with pointers to the pathName from the appropriate window.
+ * Make a copy of the tags for the window, replacing window names with
+ * pointers to the pathName from the appropriate window.
*/
if (winPtr->numTags > MAX_OBJS) {
@@ -293,8 +291,8 @@ TkBindEventProc(winPtr, eventPtr)
*
* Tk_BindtagsObjCmd --
*
- * This procedure is invoked to process the "bindtags" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "bindtags" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -306,18 +304,18 @@ TkBindEventProc(winPtr, eventPtr)
*/
int
-Tk_BindtagsObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_BindtagsObjCmd(
+ 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;
TkWindow *winPtr, *winPtr2;
int i, length;
char *p;
Tcl_Obj *listPtr, **tags;
-
+
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "window ?taglist?");
return TCL_ERROR;
@@ -375,9 +373,9 @@ Tk_BindtagsObjCmd(clientData, interp, objc, objv)
/*
* Handle names starting with "." specially: store a malloc'ed
- * string, rather than a Uid; at event time we'll look up the
- * name in the window table and use the corresponding window,
- * if there is one.
+ * string, rather than a Uid; at event time we'll look up the name
+ * in the window table and use the corresponding window, if there
+ * is one.
*/
copy = (char *) ckalloc((unsigned) (strlen(p) + 1));
@@ -395,9 +393,9 @@ Tk_BindtagsObjCmd(clientData, interp, objc, objv)
*
* TkFreeBindingTags --
*
- * This procedure is called to free all of the binding tags
- * associated with a window; typically it is only invoked where
- * there are window-specific tags.
+ * This function is called to free all of the binding tags associated
+ * with a window; typically it is only invoked where there are
+ * window-specific tags.
*
* Results:
* None.
@@ -409,8 +407,8 @@ Tk_BindtagsObjCmd(clientData, interp, objc, objv)
*/
void
-TkFreeBindingTags(winPtr)
- TkWindow *winPtr; /* Window whose tags are to be released. */
+TkFreeBindingTags(
+ TkWindow *winPtr) /* Window whose tags are to be released. */
{
int i;
char *p;
@@ -419,10 +417,10 @@ TkFreeBindingTags(winPtr)
p = (char *) (winPtr->tagPtr[i]);
if (*p == '.') {
/*
- * Names starting with "." are malloced rather than Uids, so
- * they have to be freed.
+ * Names starting with "." are malloced rather than Uids, so they
+ * have to be freed.
*/
-
+
ckfree(p);
}
}
@@ -436,8 +434,8 @@ TkFreeBindingTags(winPtr)
*
* Tk_DestroyObjCmd --
*
- * This procedure is invoked to process the "destroy" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "destroy" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -449,12 +447,11 @@ TkFreeBindingTags(winPtr)
*/
int
-Tk_DestroyObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_DestroyObjCmd(
+ 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 window;
Tk_Window tkwin = (Tk_Window) clientData;
@@ -469,13 +466,12 @@ Tk_DestroyObjCmd(clientData, interp, objc, objv)
Tk_DestroyWindow(window);
if (window == tkwin) {
/*
- * We just deleted the main window for the application! This
- * makes it impossible to do anything more (tkwin isn't
- * valid anymore).
+ * We just deleted the main window for the application! This makes
+ * it impossible to do anything more (tkwin isn't valid anymore).
*/
break;
- }
+ }
}
return TCL_OK;
}
@@ -485,8 +481,8 @@ Tk_DestroyObjCmd(clientData, interp, objc, objv)
*
* Tk_LowerObjCmd --
*
- * This procedure is invoked to process the "lower" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "lower" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -499,12 +495,11 @@ Tk_DestroyObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
int
-Tk_LowerObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_LowerObjCmd(
+ 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 mainwin = (Tk_Window) clientData;
Tk_Window tkwin, other;
@@ -529,7 +524,7 @@ Tk_LowerObjCmd(clientData, interp, objc, objv)
if (Tk_RestackWindow(tkwin, Below, other) != TCL_OK) {
Tcl_AppendResult(interp, "can't lower \"", Tcl_GetString(objv[1]),
"\" below \"", (other ? Tcl_GetString(objv[2]) : ""),
- "\"", (char *) NULL);
+ "\"", NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -540,8 +535,8 @@ Tk_LowerObjCmd(clientData, interp, objc, objv)
*
* Tk_RaiseObjCmd --
*
- * This procedure is invoked to process the "raise" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "raise" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -554,12 +549,11 @@ Tk_LowerObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
int
-Tk_RaiseObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_RaiseObjCmd(
+ 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 mainwin = (Tk_Window) clientData;
Tk_Window tkwin, other;
@@ -584,7 +578,7 @@ Tk_RaiseObjCmd(clientData, interp, objc, objv)
if (Tk_RestackWindow(tkwin, Above, other) != TCL_OK) {
Tcl_AppendResult(interp, "can't raise \"", Tcl_GetString(objv[1]),
"\" above \"", (other ? Tcl_GetString(objv[2]) : ""),
- "\"", (char *) NULL);
+ "\"", NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -595,8 +589,8 @@ Tk_RaiseObjCmd(clientData, interp, objc, objv)
*
* Tk_TkObjCmd --
*
- * This procedure is invoked to process the "tk" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "tk" Tcl command. See the user
+ * documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -608,21 +602,21 @@ Tk_RaiseObjCmd(clientData, interp, objc, objv)
*/
int
-Tk_TkObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_TkObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int index;
Tk_Window tkwin;
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"appname", "caret", "scaling", "useinputmethods",
- "windowingsystem", NULL
+ "windowingsystem", "inactive", NULL
};
enum options {
TK_APPNAME, TK_CARET, TK_SCALING, TK_USE_IM,
- TK_WINDOWINGSYSTEM
+ TK_WINDOWINGSYSTEM, TK_INACTIVE
};
tkwin = (Tk_Window) clientData;
@@ -637,216 +631,257 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
}
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;
- }
+ 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;
+ }
- winPtr = (TkWindow *) tkwin;
+ winPtr = (TkWindow *) tkwin;
- if (objc > 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?newName?");
- return TCL_ERROR;
- }
- if (objc == 3) {
- string = Tcl_GetStringFromObj(objv[2], NULL);
- winPtr->nameUid = Tk_GetUid(Tk_SetAppName(tkwin, string));
- }
- Tcl_AppendResult(interp, winPtr->nameUid, NULL);
- break;
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ string = Tcl_GetString(objv[2]);
+ winPtr->nameUid = Tk_GetUid(Tk_SetAppName(tkwin, string));
+ }
+ 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;
}
- 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?");
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
+ }
+ caretPtr = &(((TkWindow *) window)->dispPtr->caret);
+ if (objc == 3) {
+ /*
+ * Return all the current values
+ */
+
+ objPtr = Tcl_NewObj();
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-height", 7));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->height));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-x", 2));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->x));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-y", 2));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->y));
+ Tcl_SetObjResult(interp, objPtr);
+ } else if (objc == 4) {
+ int value;
+
+ /*
+ * Return the current value of the selected option
+ */
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], caretStrings,
+ "caret option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
- window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
- if (window == NULL) {
- return TCL_ERROR;
+ if (index == TK_CARET_X) {
+ value = caretPtr->x;
+ } else if (index == TK_CARET_Y) {
+ value = caretPtr->y;
+ } else /* if (index == TK_CARET_HEIGHT) -- last case */ {
+ value = caretPtr->height;
}
- caretPtr = &(((TkWindow *) window)->dispPtr->caret);
- if (objc == 3) {
- /*
- * Return all the current values
- */
- objPtr = Tcl_NewObj();
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewStringObj("-height", 7));
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewIntObj(caretPtr->height));
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewStringObj("-x", 2));
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewIntObj(caretPtr->x));
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewStringObj("-y", 2));
- Tcl_ListObjAppendElement(interp, objPtr,
- Tcl_NewIntObj(caretPtr->y));
- Tcl_SetObjResult(interp, objPtr);
- } else if (objc == 4) {
- int value;
- /*
- * Return the current value of the selected option
- */
- if (Tcl_GetIndexFromObj(interp, objv[3], caretStrings,
- "caret option", 0, &index) != TCL_OK) {
+ 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) {
- 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;
- }
- 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);
+ height = value;
}
- Tk_SetCaretPos(window, x, y, height);
}
- break;
+ if (height < 0) {
+ height = Tk_Height(window);
+ }
+ Tk_SetCaretPos(window, x, y, height);
+ }
+ break;
+ }
+ case TK_SCALING: {
+ Screen *screenPtr;
+ int skip, width, height;
+ double d;
+
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "scaling not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
}
- case TK_SCALING: {
- Screen *screenPtr;
- int skip, width, height;
- double d;
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "scaling not accessible in a safe interpreter",
- TCL_STATIC);
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ 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;
}
-
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
+ d = (25.4 / 72) / d;
+ width = (int) (d * WidthOfScreen(screenPtr) + 0.5);
+ if (width <= 0) {
+ width = 1;
}
- 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;
+ height = (int) (d * HeightOfScreen(screenPtr) + 0.5);
+ if (height <= 0) {
+ height = 1;
}
- break;
+ WidthMMOfScreen(screenPtr) = width;
+ HeightMMOfScreen(screenPtr) = height;
+ } else {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "?-displayof window? ?factor?");
+ return TCL_ERROR;
+ }
+ break;
+ }
+ case TK_USE_IM: {
+ TkDisplay *dispPtr;
+ int skip;
+
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "useinputmethods not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
}
- case TK_USE_IM: {
- TkDisplay *dispPtr;
- int skip;
- if (Tcl_IsSafe(interp)) {
- Tcl_SetResult(interp,
- "useinputmethods not accessible in a safe interpreter",
- TCL_STATIC);
- return TCL_ERROR;
- }
+ skip = TkGetDisplayOf(interp, objc-2, objv+2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ 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.
+ */
- skip = TkGetDisplayOf(interp, objc-2, objv+2, &tkwin);
- if (skip < 0) {
+ int boolVal;
+
+ if (Tcl_GetBooleanFromObj(interp, objv[2+skip],
+ &boolVal) != TCL_OK) {
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.
- */
- int boolVal;
- 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?");
- return TCL_ERROR;
+ if (boolVal) {
+ dispPtr->flags |= TK_DISPLAY_USE_IM;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_USE_IM;
}
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- (int) (dispPtr->flags & TK_DISPLAY_USE_IM));
- break;
+#endif /* TK_USE_INPUT_METHODS */
+ } else if ((objc - skip) != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "?-displayof window? ?boolean?");
+ return TCL_ERROR;
+ }
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
+ (int) (dispPtr->flags & TK_DISPLAY_USE_IM));
+ break;
+ }
+ case TK_WINDOWINGSYSTEM: {
+ const char *windowingsystem;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ return TCL_ERROR;
}
- case TK_WINDOWINGSYSTEM: {
- CONST char *windowingsystem;
-
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- return TCL_ERROR;
- }
#if defined(WIN32)
- windowingsystem = "win32";
-#elif defined(MAC_TCL)
- windowingsystem = "classic";
+ 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;
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), windowingsystem, -1);
+ break;
+ }
+ case TK_INACTIVE: {
+ int skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ if (objc - skip == 2) {
+ long inactive;
+
+ inactive = (Tcl_IsSafe(interp) ? -1 :
+ Tk_GetUserInactiveTime(Tk_Display(tkwin)));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(inactive));
+
+ } else if (objc - skip == 3) {
+ char *string;
+
+ 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;
+ }
+ 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?");
+ return TCL_ERROR;
}
+ break;
+ }
}
return TCL_OK;
}
@@ -856,8 +891,8 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
*
* Tk_TkwaitObjCmd --
*
- * This procedure is invoked to process the "tkwait" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "tkwait" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -870,19 +905,21 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
int
-Tk_TkwaitObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_TkwaitObjCmd(
+ 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;
int done, index;
- static CONST char *optionStrings[] = { "variable", "visibility", "window",
- (char *) NULL };
- enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
-
+ static const char *optionStrings[] = {
+ "variable", "visibility", "window", NULL
+ };
+ enum options {
+ TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW
+ };
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "variable|visibility|window name");
return TCL_ERROR;
@@ -894,78 +931,78 @@ Tk_TkwaitObjCmd(clientData, interp, objc, objv)
}
switch ((enum options) index) {
- case TKWAIT_VARIABLE: {
- if (Tcl_TraceVar(interp, Tcl_GetString(objv[2]),
- TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- WaitVariableProc, (ClientData) &done) != TCL_OK) {
- return TCL_ERROR;
- }
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
- Tcl_UntraceVar(interp, Tcl_GetString(objv[2]),
- TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- WaitVariableProc, (ClientData) &done);
- break;
+ case TKWAIT_VARIABLE:
+ if (Tcl_TraceVar(interp, Tcl_GetString(objv[2]),
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
}
-
- case TKWAIT_VISIBILITY: {
- Tk_Window window;
+ Tcl_UntraceVar(interp, Tcl_GetString(objv[2]),
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done);
+ break;
- window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
- if (window == NULL) {
- return TCL_ERROR;
- }
- Tk_CreateEventHandler(window,
- VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
- if (done != 1) {
- /*
- * Note that we do not delete the event handler because it
- * was deleted automatically when the window was destroyed.
- */
-
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "window \"", Tcl_GetString(objv[2]),
- "\" was deleted before its visibility changed",
- (char *) NULL);
- return TCL_ERROR;
- }
- Tk_DeleteEventHandler(window,
- VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
- break;
+ case TKWAIT_VISIBILITY: {
+ Tk_Window window;
+
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
}
-
- case TKWAIT_WINDOW: {
- Tk_Window window;
-
- window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
- if (window == NULL) {
- return TCL_ERROR;
- }
- Tk_CreateEventHandler(window, StructureNotifyMask,
- WaitWindowProc, (ClientData) &done);
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
+ Tk_CreateEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
+ }
+ if (done != 1) {
/*
- * Note: there's no need to delete the event handler. It was
+ * Note that we do not delete the event handler because it was
* deleted automatically when the window was destroyed.
*/
- break;
+
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", Tcl_GetString(objv[2]),
+ "\" was deleted before its visibility changed", NULL);
+ return TCL_ERROR;
}
+ Tk_DeleteEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+ break;
+ }
+
+ case TKWAIT_WINDOW: {
+ Tk_Window window;
+
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
+ }
+ Tk_CreateEventHandler(window, StructureNotifyMask,
+ WaitWindowProc, (ClientData) &done);
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
+ }
+
+ /*
+ * Note: there's no need to delete the event handler. It was deleted
+ * automatically when the window was destroyed.
+ */
+
+ break;
+ }
}
/*
- * Clear out the interpreter's result, since it may have been set
- * by event handlers.
+ * Clear out the interpreter's result, since it may have been set by event
+ * handlers.
*/
Tcl_ResetResult(interp);
@@ -974,24 +1011,24 @@ Tk_TkwaitObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
static char *
-WaitVariableProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Pointer to integer to set to 1. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Name of variable. */
- CONST char *name2; /* Second part of variable name. */
- int flags; /* Information about what happened. */
+WaitVariableProc(
+ ClientData clientData, /* Pointer to integer to set to 1. */
+ Tcl_Interp *interp, /* Interpreter containing variable. */
+ const char *name1, /* Name of variable. */
+ const char *name2, /* Second part of variable name. */
+ int flags) /* Information about what happened. */
{
int *donePtr = (int *) clientData;
*donePtr = 1;
- return (char *) NULL;
+ return NULL;
}
/*ARGSUSED*/
static void
-WaitVisibilityProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to integer to set to 1. */
- XEvent *eventPtr; /* Information about event (not used). */
+WaitVisibilityProc(
+ ClientData clientData, /* Pointer to integer to set to 1. */
+ XEvent *eventPtr) /* Information about event (not used). */
{
int *donePtr = (int *) clientData;
@@ -1004,9 +1041,9 @@ WaitVisibilityProc(clientData, eventPtr)
}
static void
-WaitWindowProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to integer to set to 1. */
- XEvent *eventPtr; /* Information about event. */
+WaitWindowProc(
+ ClientData clientData, /* Pointer to integer to set to 1. */
+ XEvent *eventPtr) /* Information about event. */
{
int *donePtr = (int *) clientData;
@@ -1020,8 +1057,8 @@ WaitWindowProc(clientData, eventPtr)
*
* Tk_UpdateObjCmd --
*
- * This procedure is invoked to process the "update" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "update" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1034,14 +1071,13 @@ WaitWindowProc(clientData, eventPtr)
/* ARGSUSED */
int
-Tk_UpdateObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_UpdateObjCmd(
+ 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 *updateOptions[] = {"idletasks", (char *) NULL};
+ static const char *updateOptions[] = {"idletasks", NULL};
int flags, index;
TkDisplay *dispPtr;
@@ -1054,19 +1090,18 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
}
flags = TCL_IDLE_EVENTS;
} else {
- Tcl_WrongNumArgs(interp, 1, objv, "?idletasks?");
+ Tcl_WrongNumArgs(interp, 1, objv, "?idletasks?");
return TCL_ERROR;
}
/*
- * Handle all pending events, sync all displays, and repeat over
- * and over again until all pending events have been handled.
- * Special note: it's possible that the entire application could
- * be destroyed by an event handler that occurs during the update.
- * Thus, don't use any information from tkwin after calling
- * Tcl_DoOneEvent.
+ * Handle all pending events, sync all displays, and repeat over and over
+ * again until all pending events have been handled. Special note: it's
+ * possible that the entire application could be destroyed by an event
+ * handler that occurs during the update. Thus, don't use any information
+ * from tkwin after calling Tcl_DoOneEvent.
*/
-
+
while (1) {
while (Tcl_DoOneEvent(flags) != 0) {
/* Empty loop body */
@@ -1081,8 +1116,8 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
}
/*
- * Must clear the interpreter's result because event handlers could
- * have executed commands.
+ * Must clear the interpreter's result because event handlers could have
+ * executed commands.
*/
Tcl_ResetResult(interp);
@@ -1094,8 +1129,8 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
*
* Tk_WinfoObjCmd --
*
- * This procedure is invoked to process the "winfo" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "winfo" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1107,12 +1142,11 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
*/
int
-Tk_WinfoObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_WinfoObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int index, x, y, width, height, useX, useY, class, skip;
char *string;
@@ -1120,7 +1154,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
Tcl_Obj *resultPtr;
- static TkStateMap visualMap[] = {
+ static const TkStateMap visualMap[] = {
{PseudoColor, "pseudocolor"},
{GrayScale, "grayscale"},
{DirectColor, "directcolor"},
@@ -1129,7 +1163,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
{StaticGray, "staticgray"},
{-1, NULL}
};
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"cells", "children", "class", "colormapfull",
"depth", "geometry", "height", "id",
"ismapped", "manager", "name", "parent",
@@ -1140,7 +1174,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
"toplevel", "viewable", "visual", "visualid",
"vrootheight", "vrootwidth", "vrootx", "vrooty",
"width", "x", "y",
-
+
"atom", "atomname", "containing", "interps",
"pathname",
@@ -1160,7 +1194,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
WIN_TOPLEVEL, WIN_VIEWABLE, WIN_VISUAL, WIN_VISUALID,
WIN_VROOTHEIGHT,WIN_VROOTWIDTH, WIN_VROOTX, WIN_VROOTY,
WIN_WIDTH, WIN_X, WIN_Y,
-
+
WIN_ATOM, WIN_ATOMNAME, WIN_CONTAINING, WIN_INTERPS,
WIN_PATHNAME,
@@ -1169,7 +1203,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
};
tkwin = (Tk_Window) clientData;
-
+
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?");
return TCL_ERROR;
@@ -1184,7 +1218,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- string = Tcl_GetStringFromObj(objv[2], NULL);
+ string = Tcl_GetString(objv[2]);
tkwin = Tk_NameToWindow(interp, string, tkwin);
if (tkwin == NULL) {
return TCL_ERROR;
@@ -1194,502 +1228,468 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
resultPtr = Tcl_GetObjResult(interp);
switch ((enum options) index) {
- case WIN_CELLS: {
- Tcl_SetIntObj(resultPtr, Tk_Visual(tkwin)->map_entries);
- break;
- }
- case WIN_CHILDREN: {
- Tcl_Obj *strPtr;
-
- winPtr = winPtr->childList;
- for ( ; winPtr != NULL; winPtr = winPtr->nextPtr) {
- if (!(winPtr->flags & TK_ANONYMOUS_WINDOW)) {
- strPtr = Tcl_NewStringObj(winPtr->pathName, -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
- }
+ case WIN_CELLS:
+ Tcl_SetIntObj(resultPtr, Tk_Visual(tkwin)->map_entries);
+ break;
+ case WIN_CHILDREN: {
+ Tcl_Obj *strPtr;
+
+ winPtr = winPtr->childList;
+ for ( ; winPtr != NULL; winPtr = winPtr->nextPtr) {
+ if (!(winPtr->flags & TK_ANONYMOUS_WINDOW)) {
+ strPtr = Tcl_NewStringObj(winPtr->pathName, -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
- break;
- }
- case WIN_CLASS: {
- Tcl_SetStringObj(resultPtr, Tk_Class(tkwin), -1);
- break;
- }
- case WIN_COLORMAPFULL: {
- Tcl_SetBooleanObj(resultPtr,
- TkpCmapStressed(tkwin, Tk_Colormap(tkwin)));
- break;
}
- case WIN_DEPTH: {
- Tcl_SetIntObj(resultPtr, Tk_Depth(tkwin));
- break;
- }
- case WIN_GEOMETRY: {
- char buf[16 + TCL_INTEGER_SPACE * 4];
+ break;
+ }
+ case WIN_CLASS:
+ Tcl_SetStringObj(resultPtr, Tk_Class(tkwin), -1);
+ break;
+ case WIN_COLORMAPFULL:
+ Tcl_SetBooleanObj(resultPtr,
+ TkpCmapStressed(tkwin, Tk_Colormap(tkwin)));
+ break;
+ case WIN_DEPTH:
+ Tcl_SetIntObj(resultPtr, 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);
+ break;
+ }
+ case WIN_HEIGHT:
+ Tcl_SetIntObj(resultPtr, Tk_Height(tkwin));
+ break;
+ case WIN_ID: {
+ char buf[TCL_INTEGER_SPACE];
- sprintf(buf, "%dx%d+%d+%d", Tk_Width(tkwin), Tk_Height(tkwin),
- Tk_X(tkwin), Tk_Y(tkwin));
- Tcl_SetStringObj(resultPtr, buf, -1);
- break;
- }
- case WIN_HEIGHT: {
- Tcl_SetIntObj(resultPtr, Tk_Height(tkwin));
- break;
+ Tk_MakeWindowExist(tkwin);
+ TkpPrintWindowId(buf, Tk_WindowId(tkwin));
+
+ /*
+ * interp result may have changed, refetch it
+ */
+
+ resultPtr = Tcl_GetObjResult(interp);
+ Tcl_SetStringObj(resultPtr, buf, -1);
+ break;
+ }
+ case WIN_ISMAPPED:
+ Tcl_SetBooleanObj(resultPtr, (int) Tk_IsMapped(tkwin));
+ break;
+ case WIN_MANAGER:
+ if (winPtr->geomMgrPtr != NULL) {
+ Tcl_SetStringObj(resultPtr, winPtr->geomMgrPtr->name, -1);
+ }
+ break;
+ case WIN_NAME:
+ Tcl_SetStringObj(resultPtr, Tk_Name(tkwin), -1);
+ break;
+ case WIN_PARENT:
+ if (winPtr->parentPtr != NULL) {
+ Tcl_SetStringObj(resultPtr, winPtr->parentPtr->pathName, -1);
+ }
+ break;
+ case WIN_POINTERX:
+ useX = 1;
+ useY = 0;
+ goto pointerxy;
+ case WIN_POINTERY:
+ useX = 0;
+ useY = 1;
+ goto pointerxy;
+ case WIN_POINTERXY:
+ useX = 1;
+ useY = 1;
+
+ pointerxy:
+ winPtr = GetTopHierarchy(tkwin);
+ if (winPtr == NULL) {
+ x = -1;
+ y = -1;
+ } else {
+ TkGetPointerCoords((Tk_Window) winPtr, &x, &y);
}
- 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);
+ if (useX & useY) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", x, y);
Tcl_SetStringObj(resultPtr, buf, -1);
- break;
- }
- case WIN_ISMAPPED: {
- Tcl_SetBooleanObj(resultPtr, (int) Tk_IsMapped(tkwin));
- break;
- }
- case WIN_MANAGER: {
- if (winPtr->geomMgrPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->geomMgrPtr->name, -1);
- }
- break;
- }
- case WIN_NAME: {
- Tcl_SetStringObj(resultPtr, Tk_Name(tkwin), -1);
- break;
- }
- case WIN_PARENT: {
- if (winPtr->parentPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->parentPtr->pathName, -1);
- }
- break;
+ } else if (useX) {
+ Tcl_SetIntObj(resultPtr, x);
+ } else {
+ Tcl_SetIntObj(resultPtr, y);
}
- case WIN_POINTERX: {
- useX = 1;
- useY = 0;
- goto pointerxy;
- }
- case WIN_POINTERY: {
- useX = 0;
- useY = 1;
- goto pointerxy;
- }
- case WIN_POINTERXY: {
- useX = 1;
- useY = 1;
-
- pointerxy:
- winPtr = GetToplevel(tkwin);
- if (winPtr == NULL) {
- x = -1;
- y = -1;
- } else {
- TkGetPointerCoords((Tk_Window) winPtr, &x, &y);
+ break;
+ case WIN_REQHEIGHT:
+ Tcl_SetIntObj(resultPtr, Tk_ReqHeight(tkwin));
+ break;
+ case WIN_REQWIDTH:
+ Tcl_SetIntObj(resultPtr, Tk_ReqWidth(tkwin));
+ break;
+ case WIN_ROOTX:
+ Tk_GetRootCoords(tkwin, &x, &y);
+ Tcl_SetIntObj(resultPtr, x);
+ break;
+ case WIN_ROOTY:
+ Tk_GetRootCoords(tkwin, &x, &y);
+ Tcl_SetIntObj(resultPtr, y);
+ break;
+ case WIN_SCREEN: {
+ char buf[TCL_INTEGER_SPACE];
+
+ sprintf(buf, "%d", Tk_ScreenNumber(tkwin));
+ Tcl_AppendStringsToObj(resultPtr, Tk_DisplayName(tkwin),".",buf, NULL);
+ break;
+ }
+ case WIN_SCREENCELLS:
+ Tcl_SetIntObj(resultPtr, CellsOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENDEPTH:
+ Tcl_SetIntObj(resultPtr, DefaultDepthOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENHEIGHT:
+ Tcl_SetIntObj(resultPtr, HeightOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENWIDTH:
+ Tcl_SetIntObj(resultPtr, WidthOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENMMHEIGHT:
+ Tcl_SetIntObj(resultPtr, HeightMMOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENMMWIDTH:
+ Tcl_SetIntObj(resultPtr, WidthMMOfScreen(Tk_Screen(tkwin)));
+ break;
+ case WIN_SCREENVISUAL:
+ class = DefaultVisualOfScreen(Tk_Screen(tkwin))->class;
+ goto visual;
+ case WIN_SERVER:
+ TkGetServerInfo(interp, tkwin);
+ break;
+ case WIN_TOPLEVEL:
+ winPtr = GetTopHierarchy(tkwin);
+ if (winPtr != NULL) {
+ Tcl_SetStringObj(resultPtr, winPtr->pathName, -1);
+ }
+ break;
+ case WIN_VIEWABLE: {
+ int viewable = 0;
+
+ for ( ; ; winPtr = winPtr->parentPtr) {
+ if ((winPtr == NULL) || !(winPtr->flags & TK_MAPPED)) {
+ break;
}
- if (useX & useY) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d", x, y);
- Tcl_SetStringObj(resultPtr, buf, -1);
- } else if (useX) {
- Tcl_SetIntObj(resultPtr, x);
- } else {
- Tcl_SetIntObj(resultPtr, y);
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
+ viewable = 1;
+ break;
}
- break;
}
- case WIN_REQHEIGHT: {
- Tcl_SetIntObj(resultPtr, Tk_ReqHeight(tkwin));
- break;
- }
- case WIN_REQWIDTH: {
- Tcl_SetIntObj(resultPtr, Tk_ReqWidth(tkwin));
- break;
- }
- case WIN_ROOTX: {
- Tk_GetRootCoords(tkwin, &x, &y);
- Tcl_SetIntObj(resultPtr, x);
- break;
- }
- case WIN_ROOTY: {
- Tk_GetRootCoords(tkwin, &x, &y);
- Tcl_SetIntObj(resultPtr, y);
- break;
+
+ Tcl_SetBooleanObj(resultPtr, viewable);
+ break;
+ }
+ case WIN_VISUAL:
+ class = Tk_Visual(tkwin)->class;
+
+ visual:
+ string = TkFindStateString(visualMap, class);
+ if (string == NULL) {
+ string = "unknown";
+ }
+ Tcl_SetStringObj(resultPtr, 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);
+ break;
+ }
+ case WIN_VROOTHEIGHT:
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ Tcl_SetIntObj(resultPtr, height);
+ break;
+ case WIN_VROOTWIDTH:
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ Tcl_SetIntObj(resultPtr, width);
+ break;
+ case WIN_VROOTX:
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ Tcl_SetIntObj(resultPtr, x);
+ break;
+ case WIN_VROOTY:
+ Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
+ Tcl_SetIntObj(resultPtr, y);
+ break;
+ case WIN_WIDTH:
+ Tcl_SetIntObj(resultPtr, Tk_Width(tkwin));
+ break;
+ case WIN_X:
+ Tcl_SetIntObj(resultPtr, Tk_X(tkwin));
+ break;
+ case WIN_Y:
+ Tcl_SetIntObj(resultPtr, Tk_Y(tkwin));
+ break;
+
+ /*
+ * Uses -displayof.
+ */
+
+ case WIN_ATOM:
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case WIN_SCREEN: {
- char buf[TCL_INTEGER_SPACE];
-
- sprintf(buf, "%d", Tk_ScreenNumber(tkwin));
- Tcl_AppendStringsToObj(resultPtr, Tk_DisplayName(tkwin), ".",
- buf, NULL);
- break;
+ if (objc - skip != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? name");
+ return TCL_ERROR;
}
- case WIN_SCREENCELLS: {
- Tcl_SetIntObj(resultPtr, CellsOfScreen(Tk_Screen(tkwin)));
- break;
+ objv += skip;
+ string = Tcl_GetString(objv[2]);
+ Tcl_SetLongObj(resultPtr, (long) Tk_InternAtom(tkwin, string));
+ break;
+ case WIN_ATOMNAME: {
+ const char *name;
+ long id;
+
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case WIN_SCREENDEPTH: {
- Tcl_SetIntObj(resultPtr, DefaultDepthOfScreen(Tk_Screen(tkwin)));
- break;
+ if (objc - skip != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? id");
+ return TCL_ERROR;
}
- case WIN_SCREENHEIGHT: {
- Tcl_SetIntObj(resultPtr, HeightOfScreen(Tk_Screen(tkwin)));
- break;
+ objv += skip;
+ if (Tcl_GetLongFromObj(interp, objv[2], &id) != TCL_OK) {
+ return TCL_ERROR;
}
- case WIN_SCREENWIDTH: {
- Tcl_SetIntObj(resultPtr, WidthOfScreen(Tk_Screen(tkwin)));
- break;
+ 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);
+ return TCL_ERROR;
}
- case WIN_SCREENMMHEIGHT: {
- Tcl_SetIntObj(resultPtr, HeightMMOfScreen(Tk_Screen(tkwin)));
- break;
+ Tcl_SetStringObj(resultPtr, name, -1);
+ break;
+ }
+ case WIN_CONTAINING:
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case WIN_SCREENMMWIDTH: {
- Tcl_SetIntObj(resultPtr, WidthMMOfScreen(Tk_Screen(tkwin)));
- break;
+ if (objc - skip != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "?-displayof window? rootX rootY");
+ return TCL_ERROR;
}
- case WIN_SCREENVISUAL: {
- class = DefaultVisualOfScreen(Tk_Screen(tkwin))->class;
- goto visual;
+ objv += skip;
+ string = Tcl_GetString(objv[2]);
+ if (Tk_GetPixels(interp, tkwin, string, &x) != TCL_OK) {
+ return TCL_ERROR;
}
- case WIN_SERVER: {
- TkGetServerInfo(interp, tkwin);
- break;
+ string = Tcl_GetString(objv[3]);
+ if (Tk_GetPixels(interp, tkwin, string, &y) != TCL_OK) {
+ return TCL_ERROR;
}
- case WIN_TOPLEVEL: {
- winPtr = GetToplevel(tkwin);
- if (winPtr != NULL) {
- Tcl_SetStringObj(resultPtr, winPtr->pathName, -1);
- }
- break;
+ tkwin = Tk_CoordsToWindow(x, y, tkwin);
+ if (tkwin != NULL) {
+ Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
}
- case WIN_VIEWABLE: {
- int viewable = 0;
- for ( ; ; winPtr = winPtr->parentPtr) {
- if ((winPtr == NULL) || !(winPtr->flags & TK_MAPPED)) {
- break;
- }
- if (winPtr->flags & TK_TOP_HIERARCHY) {
- viewable = 1;
- break;
- }
- }
+ break;
+ case WIN_INTERPS: {
+ int result;
- Tcl_SetBooleanObj(resultPtr, viewable);
- break;
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case WIN_VISUAL: {
- class = Tk_Visual(tkwin)->class;
-
- visual:
- string = TkFindStateString(visualMap, class);
- if (string == NULL) {
- string = "unknown";
- }
- Tcl_SetStringObj(resultPtr, string, -1);
- break;
+ if (objc - skip != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
+ return TCL_ERROR;
}
- case WIN_VISUALID: {
- char buf[TCL_INTEGER_SPACE];
+ result = TkGetInterpNames(interp, tkwin);
+ return result;
+ }
+ case WIN_PATHNAME: {
+ Window id;
- sprintf(buf, "0x%x",
- (unsigned int) XVisualIDFromVisual(Tk_Visual(tkwin)));
- Tcl_SetStringObj(resultPtr, buf, -1);
- break;
- }
- case WIN_VROOTHEIGHT: {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, height);
- break;
- }
- case WIN_VROOTWIDTH: {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, width);
- break;
- }
- case WIN_VROOTX: {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, x);
- break;
- }
- case WIN_VROOTY: {
- Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
- Tcl_SetIntObj(resultPtr, y);
- break;
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case WIN_WIDTH: {
- Tcl_SetIntObj(resultPtr, Tk_Width(tkwin));
- break;
+ if (objc - skip != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? id");
+ return TCL_ERROR;
}
- case WIN_X: {
- Tcl_SetIntObj(resultPtr, Tk_X(tkwin));
- break;
+ string = Tcl_GetString(objv[2 + skip]);
+ if (TkpScanWindowId(interp, string, &id) != TCL_OK) {
+ return TCL_ERROR;
}
- case WIN_Y: {
- Tcl_SetIntObj(resultPtr, Tk_Y(tkwin));
- break;
+ winPtr = (TkWindow *)Tk_IdToWindow(Tk_Display(tkwin), id);
+ if ((winPtr == NULL) ||
+ (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr)) {
+ Tcl_AppendStringsToObj(resultPtr, "window id \"", string,
+ "\" doesn't exist in this application", NULL);
+ return TCL_ERROR;
}
/*
- * Uses -displayof.
+ * If the window is a utility window with no associated path (such as
+ * a wrapper window or send communication window), just return an
+ * empty string.
*/
-
- case WIN_ATOM: {
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? name");
- return TCL_ERROR;
- }
- objv += skip;
- string = Tcl_GetStringFromObj(objv[2], NULL);
- Tcl_SetLongObj(resultPtr, (long) Tk_InternAtom(tkwin, string));
- break;
- }
- case WIN_ATOMNAME: {
- CONST char *name;
- long id;
-
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? id");
- return TCL_ERROR;
- }
- objv += skip;
- if (Tcl_GetLongFromObj(interp, objv[2], &id) != TCL_OK) {
- return TCL_ERROR;
- }
- name = Tk_GetAtomName(tkwin, (Atom) id);
- if (strcmp(name, "?bad atom?") == 0) {
- string = Tcl_GetStringFromObj(objv[2], NULL);
- Tcl_AppendStringsToObj(resultPtr,
- "no atom exists with id \"", string, "\"", NULL);
- return TCL_ERROR;
- }
- Tcl_SetStringObj(resultPtr, name, -1);
- break;
- }
- case WIN_CONTAINING: {
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 4) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "?-displayof window? rootX rootY");
- return TCL_ERROR;
- }
- objv += skip;
- string = Tcl_GetStringFromObj(objv[2], NULL);
- if (Tk_GetPixels(interp, tkwin, string, &x) != TCL_OK) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3], NULL);
- if (Tk_GetPixels(interp, tkwin, string, &y) != TCL_OK) {
- return TCL_ERROR;
- }
- tkwin = Tk_CoordsToWindow(x, y, tkwin);
- if (tkwin != NULL) {
- Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
- }
- break;
- }
- case WIN_INTERPS: {
- int result;
-
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
- return TCL_ERROR;
- }
- result = TkGetInterpNames(interp, tkwin);
- return result;
- }
- case WIN_PATHNAME: {
- Window id;
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window? id");
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2 + skip], NULL);
- if (TkpScanWindowId(interp, string, &id) != TCL_OK) {
- return TCL_ERROR;
- }
- winPtr = (TkWindow *)Tk_IdToWindow(Tk_Display(tkwin), id);
- if ((winPtr == NULL) ||
- (winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr)) {
- Tcl_AppendStringsToObj(resultPtr, "window id \"", string,
- "\" doesn't exist in this application", (char *) NULL);
- return TCL_ERROR;
- }
-
- /*
- * If the window is a utility window with no associated path
- * (such as a wrapper window or send communication window), just
- * return an empty string.
- */
-
- tkwin = (Tk_Window) winPtr;
- if (Tk_PathName(tkwin) != NULL) {
- Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
- }
- break;
+ tkwin = (Tk_Window) winPtr;
+ if (Tk_PathName(tkwin) != NULL) {
+ Tcl_SetStringObj(resultPtr, Tk_PathName(tkwin), -1);
}
+ break;
+ }
/*
* objv[3] is window.
*/
- case WIN_EXISTS: {
- int alive;
+ case WIN_EXISTS: {
+ int alive;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "window");
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], NULL);
- winPtr = (TkWindow *) Tk_NameToWindow(interp, string, tkwin);
- Tcl_ResetResult(interp);
- resultPtr = Tcl_GetObjResult(interp);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ 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);
- break;
+ alive = 1;
+ if ((winPtr == NULL) || (winPtr->flags & TK_ALREADY_DEAD)) {
+ alive = 0;
}
- case WIN_FPIXELS: {
- double mm, pixels;
+ Tcl_SetBooleanObj(resultPtr, alive);
+ break;
+ }
+ case WIN_FPIXELS: {
+ double mm, pixels;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "window number");
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], NULL);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3], NULL);
- if (Tk_GetScreenMM(interp, tkwin, string, &mm) != TCL_OK) {
- return TCL_ERROR;
- }
- pixels = mm * WidthOfScreen(Tk_Screen(tkwin))
- / WidthMMOfScreen(Tk_Screen(tkwin));
- Tcl_SetDoubleObj(resultPtr, pixels);
- break;
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window number");
+ return TCL_ERROR;
}
- case WIN_PIXELS: {
- int pixels;
-
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "window number");
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], NULL);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3], NULL);
- if (Tk_GetPixels(interp, tkwin, string, &pixels) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_SetIntObj(resultPtr, pixels);
- break;
+ string = Tcl_GetString(objv[2]);
+ tkwin = Tk_NameToWindow(interp, string, tkwin);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ string = Tcl_GetString(objv[3]);
+ if (Tk_GetScreenMM(interp, tkwin, string, &mm) != TCL_OK) {
+ return TCL_ERROR;
}
- case WIN_RGB: {
- XColor *colorPtr;
- char buf[TCL_INTEGER_SPACE * 3];
+ pixels = mm * WidthOfScreen(Tk_Screen(tkwin))
+ / WidthMMOfScreen(Tk_Screen(tkwin));
+ Tcl_SetDoubleObj(resultPtr, pixels);
+ break;
+ }
+ case WIN_PIXELS: {
+ int pixels;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "window colorName");
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[2], NULL);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3], NULL);
- colorPtr = Tk_GetColor(interp, tkwin, string);
- if (colorPtr == NULL) {
- return TCL_ERROR;
- }
- sprintf(buf, "%d %d %d", colorPtr->red, colorPtr->green,
- colorPtr->blue);
- Tk_FreeColor(colorPtr);
- Tcl_SetStringObj(resultPtr, buf, -1);
- break;
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window number");
+ return TCL_ERROR;
}
- case WIN_VISUALSAVAILABLE: {
- XVisualInfo template, *visInfoPtr;
- int count, i;
- int includeVisualId;
- Tcl_Obj *strPtr;
- char buf[16 + TCL_INTEGER_SPACE];
- char visualIdString[TCL_INTEGER_SPACE];
-
- if (objc == 3) {
- includeVisualId = 0;
- } else if ((objc == 4)
- && (strcmp(Tcl_GetStringFromObj(objv[3], NULL),
- "includeids") == 0)) {
- includeVisualId = 1;
- } else {
- Tcl_WrongNumArgs(interp, 2, objv, "window ?includeids?");
- return TCL_ERROR;
- }
+ string = Tcl_GetString(objv[2]);
+ tkwin = Tk_NameToWindow(interp, string, tkwin);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ string = Tcl_GetString(objv[3]);
+ if (Tk_GetPixels(interp, tkwin, string, &pixels) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tcl_SetIntObj(resultPtr, pixels);
+ break;
+ }
+ case WIN_RGB: {
+ XColor *colorPtr;
+ char buf[TCL_INTEGER_SPACE * 3];
- string = Tcl_GetStringFromObj(objv[2], NULL);
- tkwin = Tk_NameToWindow(interp, string, tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
+ 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) {
+ return TCL_ERROR;
+ }
+ string = Tcl_GetString(objv[3]);
+ colorPtr = Tk_GetColor(interp, tkwin, string);
+ if (colorPtr == NULL) {
+ return TCL_ERROR;
+ }
+ sprintf(buf, "%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;
+ char buf[16 + TCL_INTEGER_SPACE];
+ char visualIdString[TCL_INTEGER_SPACE];
+
+ if (objc == 3) {
+ includeVisualId = 0;
+ } else if ((objc == 4)
+ && (strcmp(Tcl_GetString(objv[3]), "includeids") == 0)) {
+ includeVisualId = 1;
+ } else {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?includeids?");
+ return TCL_ERROR;
+ }
- template.screen = Tk_ScreenNumber(tkwin);
- visInfoPtr = XGetVisualInfo(Tk_Display(tkwin), VisualScreenMask,
- &template, &count);
- if (visInfoPtr == NULL) {
- Tcl_SetStringObj(resultPtr,
- "can't find any visuals for screen", -1);
- return TCL_ERROR;
+ string = Tcl_GetString(objv[2]);
+ tkwin = Tk_NameToWindow(interp, string, tkwin);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+
+ template.screen = Tk_ScreenNumber(tkwin);
+ visInfoPtr = XGetVisualInfo(Tk_Display(tkwin), VisualScreenMask,
+ &template, &count);
+ if (visInfoPtr == NULL) {
+ Tcl_SetStringObj(resultPtr,
+ "can't find any visuals for screen", -1);
+ return TCL_ERROR;
+ }
+ for (i = 0; i < count; i++) {
+ string = TkFindStateString(visualMap, visInfoPtr[i].class);
+ if (string == NULL) {
+ strcpy(buf, "unknown");
+ } else {
+ sprintf(buf, "%s %d", string, visInfoPtr[i].depth);
}
- for (i = 0; i < count; i++) {
- string = TkFindStateString(visualMap, visInfoPtr[i].class);
- if (string == NULL) {
- strcpy(buf, "unknown");
- } else {
- sprintf(buf, "%s %d", string, visInfoPtr[i].depth);
- }
- if (includeVisualId) {
- sprintf(visualIdString, " 0x%x",
- (unsigned int) visInfoPtr[i].visualid);
- strcat(buf, visualIdString);
- }
- strPtr = Tcl_NewStringObj(buf, -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ if (includeVisualId) {
+ sprintf(visualIdString, " 0x%x",
+ (unsigned int) visInfoPtr[i].visualid);
+ strcat(buf, visualIdString);
}
- XFree((char *) visInfoPtr);
- break;
+ strPtr = Tcl_NewStringObj(buf, -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
+ XFree((char *) visInfoPtr);
+ break;
+ }
}
return TCL_OK;
}
@@ -1700,8 +1700,8 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
*
* Tk_WmObjCmd --
*
- * This procedure is invoked to process the "wm" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "wm" Tcl command. See the user
+ * documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1714,24 +1714,23 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
int
-Tk_WmObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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;
TkWindow *winPtr;
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"aspect", "client", "command", "deiconify",
"focusmodel", "frame", "geometry", "grid",
"group", "iconbitmap", "iconify", "iconmask",
"iconname", "iconposition", "iconwindow", "maxsize",
"minsize", "overrideredirect", "positionfrom", "protocol",
"resizable", "sizefrom", "state", "title",
- "tracing", "transient", "withdraw", (char *) NULL
+ "tracing", "transient", "withdraw", NULL
};
enum options {
TKWM_ASPECT, TKWM_CLIENT, TKWM_COMMAND, TKWM_DEICONIFY,
@@ -1790,127 +1789,119 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
}
if (!(winPtr->flags & TK_TOP_LEVEL)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
- "\" isn't a top-level window", (char *) NULL);
+ "\" isn't a top-level window", NULL);
return TCL_ERROR;
}
switch ((enum options) index) {
- case TKWM_ASPECT: {
- TkpWmAspectCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_CLIENT: {
- TkpWmClientCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_COMMAND: {
- TkpWmCommandCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_DEICONIFY: {
- TkpWmDeiconifyCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_FOCUSMOD: {
- TkpWmFocusmodCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_FRAME: {
- TkpWmFrameCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_GEOMETRY: {
- TkpWmGeometryCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_GRID: {
- TkpWmGridCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_GROUP: {
- TkpWmGroupCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONBMP: {
- TkpWmIconbitmapCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONIFY: {
- TkpWmIconifyCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONMASK: {
- TkpWmIconmaskCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONNAME: {
- /* slight Unix variation */
- TkpWmIconnameCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONPOS: {
- /* nearly same - 1 line more on Unix */
- TkpWmIconpositionCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_ICONWIN: {
- TkpWmIconwindowCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_MAXSIZE: {
- /* nearly same, win diffs */
- TkpWmMaxsizeCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_MINSIZE: {
- /* nearly same, win diffs */
- TkpWmMinsizeCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_OVERRIDE: {
- /* almost same */
- TkpWmOverrideCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_POSFROM: {
- /* Equal across platforms */
- TkpWmPositionfromCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_PROTOCOL: {
- /* Equal across platforms */
- TkpWmProtocolCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_RESIZABLE: {
- /* almost same */
- TkpWmResizableCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_SIZEFROM: {
- /* Equal across platforms */
- TkpWmSizefromCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_STATE: {
- TkpWmStateCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_TITLE: {
- TkpWmTitleCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_TRANSIENT: {
- TkpWmTransientCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
- case TKWM_WITHDRAW: {
- TkpWmWithdrawCmd(interp, tkwin, winPtr, objc, objv);
- break;
- }
+ case TKWM_ASPECT:
+ TkpWmAspectCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_CLIENT:
+ TkpWmClientCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_COMMAND:
+ TkpWmCommandCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_DEICONIFY:
+ TkpWmDeiconifyCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_FOCUSMOD:
+ TkpWmFocusmodCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_FRAME:
+ TkpWmFrameCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_GEOMETRY:
+ TkpWmGeometryCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_GRID:
+ TkpWmGridCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_GROUP:
+ TkpWmGroupCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONBMP:
+ TkpWmIconbitmapCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONIFY:
+ TkpWmIconifyCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONMASK:
+ TkpWmIconmaskCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONNAME:
+ /*
+ * Slight Unix variation.
+ */
+ TkpWmIconnameCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONPOS:
+ /*
+ * nearly same - 1 line more on Unix.
+ */
+ TkpWmIconpositionCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_ICONWIN:
+ TkpWmIconwindowCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_MAXSIZE:
+ /*
+ * Nearly same, win diffs.
+ */
+ TkpWmMaxsizeCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_MINSIZE:
+ /*
+ * Nearly same, win diffs
+ */
+ TkpWmMinsizeCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_OVERRIDE:
+ /*
+ * Almost same.
+ */
+ TkpWmOverrideCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_POSFROM:
+ /*
+ * Equal across platforms
+ */
+ TkpWmPositionfromCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_PROTOCOL:
+ /*
+ * Equal across platforms
+ */
+ TkpWmProtocolCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_RESIZABLE:
+ /*
+ * Almost same
+ */
+ TkpWmResizableCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_SIZEFROM:
+ /*
+ * Equal across platforms
+ */
+ TkpWmSizefromCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_STATE:
+ TkpWmStateCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_TITLE:
+ TkpWmTitleCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_TRANSIENT:
+ TkpWmTransientCmd(interp, tkwin, winPtr, objc, objv);
+ break;
+ case TKWM_WITHDRAW:
+ TkpWmWithdrawCmd(interp, tkwin, winPtr, objc, objv);
+ break;
}
- updateGeom:
+ updateGeom:
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
@@ -1924,21 +1915,20 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
*
* TkGetDisplayOf --
*
- * Parses a "-displayof window" option for various commands. If
- * present, the literal "-displayof" should be in objv[0] and the
- * window name in objv[1].
+ * Parses a "-displayof window" option for various commands. If present,
+ * the literal "-displayof" should be in objv[0] and the window name in
+ * objv[1].
*
* Results:
- * The return value is 0 if the argument strings did not contain
- * the "-displayof" option. The return value is 2 if the
- * argument strings contained both the "-displayof" option and
- * a valid window name. Otherwise, the return value is -1 if
- * the window name was missing or did not specify a valid window.
+ * The return value is 0 if the argument strings did not contain the
+ * "-displayof" option. The return value is 2 if the argument strings
+ * contained both the "-displayof" option and a valid window name.
+ * Otherwise, the return value is -1 if the window name was missing or
+ * did not specify a valid window.
*
- * If the return value was 2, *tkwinPtr is filled with the
- * token for the window specified on the command line. If the
- * return value was -1, an error message is left in interp's
- * result object.
+ * If the return value was 2, *tkwinPtr is filled with the token for the
+ * window specified on the command line. If the return value was -1, an
+ * error message is left in interp's result object.
*
* Side effects:
* None.
@@ -1947,14 +1937,14 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
*/
int
-TkGetDisplayOf(interp, objc, objv, tkwinPtr)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. If it is present,
+TkGetDisplayOf(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[], /* Argument objects. If it is present,
* "-displayof" should be in objv[0] and
* objv[1] the name of a window. */
- Tk_Window *tkwinPtr; /* On input, contains main window of
- * application associated with interp. On
+ Tk_Window *tkwinPtr) /* On input, contains main window of
+ * application associated with interp. On
* output, filled with window specified as
* option to "-displayof" argument, or
* unmodified if "-displayof" argument was not
@@ -1962,7 +1952,7 @@ TkGetDisplayOf(interp, objc, objv, tkwinPtr)
{
char *string;
int length;
-
+
if (objc < 1) {
return 0;
}
@@ -1974,8 +1964,7 @@ TkGetDisplayOf(interp, objc, objv, tkwinPtr)
"value for \"-displayof\" missing", -1);
return -1;
}
- string = Tcl_GetStringFromObj(objv[1], NULL);
- *tkwinPtr = Tk_NameToWindow(interp, string, *tkwinPtr);
+ *tkwinPtr = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), *tkwinPtr);
if (*tkwinPtr == NULL) {
return -1;
}
@@ -1990,11 +1979,11 @@ TkGetDisplayOf(interp, objc, objv, tkwinPtr)
* TkDeadAppCmd --
*
* If an application has been deleted then all Tk commands will be
- * re-bound to this procedure.
+ * re-bound to this function.
*
* Results:
- * A standard Tcl error is reported to let the user know that
- * the application is dead.
+ * A standard Tcl error is reported to let the user know that the
+ * application is dead.
*
* Side effects:
* See the user documentation.
@@ -2004,28 +1993,28 @@ TkGetDisplayOf(interp, objc, objv, tkwinPtr)
/* ARGSUSED */
int
-TkDeadAppCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Dummy. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- CONST char **argv; /* Argument strings. */
+TkDeadAppCmd(
+ ClientData clientData, /* Dummy. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ const char **argv) /* Argument strings. */
{
Tcl_AppendResult(interp, "can't invoke \"", argv[0],
- "\" command: application has been destroyed", (char *) NULL);
+ "\" command: application has been destroyed", NULL);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
- * GetToplevel --
+ * GetTopHierarchy --
*
- * Retrieves the toplevel window which is the nearest ancestor of
- * of the specified window.
+ * Retrieves the top-of-hierarchy window which is the nearest ancestor of
+ * the specified window.
*
* Results:
- * Returns the toplevel window or NULL if the window has no
- * ancestor which is a toplevel.
+ * Returns the top-of-hierarchy window, or NULL if the window has no
+ * ancestor which is at the top of a physical window hierarchy.
*
* Side effects:
* None.
@@ -2034,17 +2023,22 @@ TkDeadAppCmd(clientData, interp, argc, argv)
*/
static TkWindow *
-GetToplevel(tkwin)
- Tk_Window tkwin; /* Window for which the toplevel should be
- * deterined. */
+GetTopHierarchy(
+ Tk_Window tkwin) /* Window for which the top-of-hierarchy
+ * ancestor should be deterined. */
{
- TkWindow *winPtr = (TkWindow *) tkwin;
-
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
- winPtr = winPtr->parentPtr;
- if (winPtr == NULL) {
- return NULL;
- }
- }
- return winPtr;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ while ((winPtr != NULL) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
+ winPtr = winPtr->parentPtr;
+ }
+ return winPtr;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkColor.c b/generic/tkColor.c
index f06c43f..6836c52 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -1,21 +1,22 @@
-/*
+/*
* tkColor.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.
+ * 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-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkColor.h"
/*
- * Structures of the following following type are used as keys for
+ * Structures of the following following type are used as keys for
* colorValueTable (in TkDisplay).
*/
@@ -26,30 +27,28 @@ typedef struct {
Display *display; /* Display for colormap. */
} ValueKey;
-
/*
- * The structure below is used to allocate thread-local data.
+ * The structure below is used to allocate thread-local data.
*/
typedef struct ThreadSpecificData {
- char rgbString[20]; /* */
+ char rgbString[20]; /* */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void ColorInit _ANSI_ARGS_((TkDisplay *dispPtr));
-static void DupColorObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
- Tcl_Obj *dupObjPtr));
-static void FreeColorObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
-static void InitColorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void ColorInit(TkDisplay *dispPtr);
+static void DupColorObjProc(Tcl_Obj *srcObjPtr,Tcl_Obj *dupObjPtr);
+static void FreeColorObjProc(Tcl_Obj *objPtr);
+static void InitColorObj(Tcl_Obj *objPtr);
/*
* The following structure defines the implementation of the "color" Tcl
- * object, which maps a string color name to a TkColor object. The
- * ptr1 field of the Tcl_Obj points to a TkColor object.
+ * object, which maps a string color name to a TkColor object. The ptr1 field
+ * of the Tcl_Obj points to a TkColor object.
*/
Tcl_ObjType tkColorObjType = {
@@ -65,32 +64,31 @@ Tcl_ObjType tkColorObjType = {
*
* Tk_AllocColorFromObj --
*
- * Given a Tcl_Obj *, map the value to a corresponding
- * XColor structure based on the tkwin given.
+ * Given a Tcl_Obj *, map the value to a corresponding XColor structure
+ * based on the tkwin given.
*
* Results:
- * The return value is a pointer to an XColor structure that
- * indicates the red, blue, and green intensities for the color
- * given by the string in objPtr, and also specifies a pixel value
- * to use to draw in that color. If an error occurs, NULL is
- * returned and an error message will be left in interp's result
- * (unless interp is NULL).
+ * The return value is a pointer to an XColor structure that indicates
+ * the red, blue, and green intensities for the color given by the string
+ * in objPtr, and also specifies a pixel value to use to draw in that
+ * color. If an error occurs, NULL is returned and an error message will
+ * be left in interp's result (unless interp is NULL).
*
* Side effects:
- * The color is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeColorFromObj so that the database is cleaned up when colors
+ * The color is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeColorFromObj so that the database is cleaned up when colors
* aren't in use anymore.
*
*----------------------------------------------------------------------
*/
XColor *
-Tk_AllocColorFromObj(interp, tkwin, objPtr)
- Tcl_Interp *interp; /* Used only for error reporting. If NULL,
+Tk_AllocColorFromObj(
+ Tcl_Interp *interp, /* Used only for error reporting. If NULL,
* then no messages are provided. */
- Tk_Window tkwin; /* Window in which the color will be used.*/
- Tcl_Obj *objPtr; /* Object that describes the color; string
+ Tk_Window tkwin, /* Window in which the color will be used.*/
+ Tcl_Obj *objPtr) /* Object that describes the color; string
* value is a color name such as "red" or
* "#ff0000".*/
{
@@ -102,15 +100,15 @@ Tk_AllocColorFromObj(interp, tkwin, objPtr)
tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
/*
- * If the object currently points to a TkColor, see if it's the
- * one we want. If so, increment its reference count and return.
+ * If the object currently points to a TkColor, see if it's the one we
+ * want. If so, increment its reference count and return.
*/
if (tkColPtr != NULL) {
if (tkColPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a TkColor that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a TkColor that's no
+ * longer in use. Clear the reference.
*/
FreeColorObjProc(objPtr);
@@ -123,14 +121,14 @@ Tk_AllocColorFromObj(interp, tkwin, objPtr)
}
/*
- * The object didn't point to the TkColor that we wanted. Search
- * the list of TkColors with the same name to see if one of the
- * other TkColors is the right one.
+ * The object didn't point to the TkColor that we wanted. Search the list
+ * of TkColors with the same name to see if one of the other TkColors is
+ * the right one.
*/
if (tkColPtr != NULL) {
- TkColor *firstColorPtr =
- (TkColor *) Tcl_GetHashValue(tkColPtr->hashPtr);
+ TkColor *firstColorPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
+
FreeColorObjProc(objPtr);
for (tkColPtr = firstColorPtr; tkColPtr != NULL;
tkColPtr = tkColPtr->nextPtr) {
@@ -138,18 +136,18 @@ Tk_AllocColorFromObj(interp, tkwin, objPtr)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
tkColPtr->resourceRefCount++;
tkColPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tkColPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
return (XColor *) tkColPtr;
}
}
}
/*
- * Still no luck. Call Tk_GetColor to allocate a new TkColor object.
+ * Still no luck. Call Tk_GetColor to allocate a new TkColor object.
*/
tkColPtr = (TkColor *) Tk_GetColor(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tkColPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
if (tkColPtr != NULL) {
tkColPtr->objRefCount++;
}
@@ -165,31 +163,31 @@ Tk_AllocColorFromObj(interp, tkwin, objPtr)
* XColor structure.
*
* Results:
- * The return value is a pointer to an XColor structure that
- * indicates the red, blue, and green intensities for the color
- * given by "name", and also specifies a pixel value to use to
- * draw in that color. If an error occurs, NULL is returned and
- * an error message will be left in the interp's result.
+ * The return value is a pointer to an XColor structure that indicates
+ * the red, blue, and green intensities for the color given by "name",
+ * and also specifies a pixel value to use to draw in that color. If an
+ * error occurs, NULL is returned and an error message will be left in
+ * the interp's result.
*
* Side effects:
- * The color is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeColor so that the database is cleaned up when colors
- * aren't in use anymore.
+ * The color is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeColor so that the database is cleaned up when colors aren't in
+ * use anymore.
*
*----------------------------------------------------------------------
*/
XColor *
-Tk_GetColor(interp, tkwin, name)
- Tcl_Interp *interp; /* Place to leave error message if
- * color can't be found. */
- Tk_Window tkwin; /* Window in which color will be used. */
- Tk_Uid name; /* Name of color to be allocated (in form
+Tk_GetColor(
+ Tcl_Interp *interp, /* Place to leave error message if color can't
+ * be found. */
+ Tk_Window tkwin, /* Window in which color will be used. */
+ Tk_Uid name) /* Name of color to be allocated (in form
* suitable for passing to XParseColor). */
{
Tcl_HashEntry *nameHashPtr;
- int new;
+ int isNew;
TkColor *tkColPtr;
TkColor *existingColPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -199,14 +197,13 @@ Tk_GetColor(interp, tkwin, name)
}
/*
- * First, check to see if there's already a mapping for this color
- * name.
+ * First, check to see if there's already a mapping for this color name.
*/
- nameHashPtr = Tcl_CreateHashEntry(&dispPtr->colorNameTable, name, &new);
- if (!new) {
- existingColPtr = (TkColor *) Tcl_GetHashValue(nameHashPtr);
- for (tkColPtr = existingColPtr; tkColPtr != NULL;
+ nameHashPtr = Tcl_CreateHashEntry(&dispPtr->colorNameTable, name, &isNew);
+ if (!isNew) {
+ existingColPtr = Tcl_GetHashValue(nameHashPtr);
+ for (tkColPtr = existingColPtr; tkColPtr != NULL;
tkColPtr = tkColPtr->nextPtr) {
if ((tkColPtr->screen == Tk_Screen(tkwin))
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
@@ -219,8 +216,7 @@ Tk_GetColor(interp, tkwin, name)
}
/*
- * The name isn't currently known. Map from the name to a pixel
- * value.
+ * The name isn't currently known. Map from the name to a pixel value.
*/
tkColPtr = TkpGetColor(tkwin, name);
@@ -228,28 +224,28 @@ Tk_GetColor(interp, tkwin, name)
if (interp != NULL) {
if (*name == '#') {
Tcl_AppendResult(interp, "invalid color name \"", name,
- "\"", (char *) NULL);
+ "\"", NULL);
} else {
Tcl_AppendResult(interp, "unknown color name \"", name,
- "\"", (char *) NULL);
+ "\"", NULL);
}
}
- if (new) {
+ if (isNew) {
Tcl_DeleteHashEntry(nameHashPtr);
}
- return (XColor *) NULL;
+ return NULL;
}
/*
- * Now create a new TkColor structure and add it to colorNameTable
- * (in TkDisplay).
+ * Now create a new TkColor structure and add it to colorNameTable (in
+ * TkDisplay).
*/
tkColPtr->magic = COLOR_MAGIC;
tkColPtr->gc = None;
tkColPtr->screen = Tk_Screen(tkwin);
tkColPtr->colormap = Tk_Colormap(tkwin);
- tkColPtr->visual = Tk_Visual(tkwin);
+ tkColPtr->visual = Tk_Visual(tkwin);
tkColPtr->resourceRefCount = 1;
tkColPtr->objRefCount = 0;
tkColPtr->type = TK_COLOR_BY_NAME;
@@ -265,34 +261,33 @@ Tk_GetColor(interp, tkwin, name)
*
* Tk_GetColorByValue --
*
- * 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.
+ * 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 XColor 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.
+ * The return value is a pointer to an XColor 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:
- * The color is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeColor, so that the database is cleaned up when colors
- * aren't in use anymore.
+ * The color is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeColor, so that the database is cleaned up when colors aren't in
+ * use anymore.
*
*----------------------------------------------------------------------
*/
XColor *
-Tk_GetColorByValue(tkwin, colorPtr)
- Tk_Window tkwin; /* Window where color will be used. */
- XColor *colorPtr; /* Red, green, and blue fields indicate
+Tk_GetColorByValue(
+ Tk_Window tkwin, /* Window where color will be used. */
+ XColor *colorPtr) /* Red, green, and blue fields indicate
* desired color. */
{
ValueKey valueKey;
Tcl_HashEntry *valueHashPtr;
- int new;
+ int isNew;
TkColor *tkColPtr;
Display *display = Tk_Display(tkwin);
TkDisplay *dispPtr = TkGetDisplay(display);
@@ -302,26 +297,28 @@ Tk_GetColorByValue(tkwin, colorPtr)
}
/*
- * First, check to see if there's already a mapping for this color
- * name.
+ * First, check to see if there's already a mapping for this color name.
+ * Must clear the structure first; it's not tightly packed on 64-bit
+ * systems. [Bug 2911570]
*/
+ memset(&valueKey, 0, sizeof(ValueKey));
valueKey.red = colorPtr->red;
valueKey.green = colorPtr->green;
valueKey.blue = colorPtr->blue;
valueKey.colormap = Tk_Colormap(tkwin);
valueKey.display = display;
- valueHashPtr = Tcl_CreateHashEntry(&dispPtr->colorValueTable,
- (char *) &valueKey, &new);
- if (!new) {
- tkColPtr = (TkColor *) Tcl_GetHashValue(valueHashPtr);
+ valueHashPtr = Tcl_CreateHashEntry(&dispPtr->colorValueTable,
+ (char *) &valueKey, &isNew);
+ if (!isNew) {
+ tkColPtr = Tcl_GetHashValue(valueHashPtr);
tkColPtr->resourceRefCount++;
return &tkColPtr->color;
}
/*
- * The name isn't currently known. Find a pixel value for this
- * color and add a new structure to colorValueTable (in TkDisplay).
+ * The name isn't currently known. Find a pixel value for this color and
+ * add a new structure to colorValueTable (in TkDisplay).
*/
tkColPtr = TkpGetColorByValue(tkwin, colorPtr);
@@ -329,7 +326,7 @@ Tk_GetColorByValue(tkwin, colorPtr)
tkColPtr->gc = None;
tkColPtr->screen = Tk_Screen(tkwin);
tkColPtr->colormap = valueKey.colormap;
- tkColPtr->visual = Tk_Visual(tkwin);
+ tkColPtr->visual = Tk_Visual(tkwin);
tkColPtr->resourceRefCount = 1;
tkColPtr->objRefCount = 0;
tkColPtr->type = TK_COLOR_BY_VALUE;
@@ -344,16 +341,14 @@ Tk_GetColorByValue(tkwin, colorPtr)
*
* Tk_NameOfColor --
*
- * Given a color, return a textual string identifying
- * the color.
+ * Given a color, return a textual string identifying the color.
*
* Results:
- * If colorPtr was created by Tk_GetColor, then the return
- * value is the "string" that was used to create it.
- * Otherwise the return value is a string that could have
- * been passed to Tk_GetColor to allocate that color. The
- * storage for the returned string is only guaranteed to
- * persist up until the next call to this procedure.
+ * If colorPtr was created by Tk_GetColor, then the return value is the
+ * "string" that was used to create it. Otherwise the return value is a
+ * string that could have been passed to Tk_GetColor to allocate that
+ * color. The storage for the returned string is only guaranteed to
+ * persist up until the next call to this function.
*
* Side effects:
* None.
@@ -362,18 +357,18 @@ Tk_GetColorByValue(tkwin, colorPtr)
*/
CONST char *
-Tk_NameOfColor(colorPtr)
- XColor *colorPtr; /* Color whose name is desired. */
+Tk_NameOfColor(
+ XColor *colorPtr) /* Color whose name is desired. */
{
register TkColor *tkColPtr = (TkColor *) colorPtr;
-
- if ((tkColPtr->magic == COLOR_MAGIC) &&
- (tkColPtr->type == TK_COLOR_BY_NAME)) {
+
+ if (tkColPtr->magic==COLOR_MAGIC && tkColPtr->type==TK_COLOR_BY_NAME) {
return tkColPtr->hashPtr->key.string;
} else {
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
colorPtr->green, colorPtr->blue);
return tsdPtr->rgbString;
}
@@ -384,15 +379,14 @@ Tk_NameOfColor(colorPtr)
*
* Tk_GCForColor --
*
- * Given a color allocated from this module, this procedure
- * returns a GC that can be used for simple drawing with that
- * color.
+ * Given a color allocated from this module, this function returns a GC
+ * that can be used for simple drawing with that color.
*
* Results:
- * The return value is a GC with color set as its foreground
- * color and all other fields defaulted. This GC is only valid
- * as long as the color exists; it is freed automatically when
- * the last reference to the color is freed.
+ * The return value is a GC with color set as its foreground color and
+ * all other fields defaulted. This GC is only valid as long as the color
+ * exists; it is freed automatically when the last reference to the color
+ * is freed.
*
* Side effects:
* None.
@@ -401,24 +395,23 @@ Tk_NameOfColor(colorPtr)
*/
GC
-Tk_GCForColor(colorPtr, drawable)
- XColor *colorPtr; /* Color for which a GC is desired. Must
- * have been allocated by Tk_GetColor. */
- Drawable drawable; /* Drawable in which the color will be
- * used (must have same screen and depth
- * as the one for which the color was
- * allocated). */
+Tk_GCForColor(
+ XColor *colorPtr, /* Color for which a GC is desired. Must have
+ * been allocated by Tk_GetColor. */
+ Drawable drawable) /* Drawable in which the color will be used
+ * (must have same screen and depth as the one
+ * for which the color was allocated). */
{
TkColor *tkColPtr = (TkColor *) colorPtr;
XGCValues gcValues;
/*
- * Do a quick sanity check to make sure this color was really
- * allocated by Tk_GetColor.
+ * Do a quick sanity check to make sure this color was really allocated by
+ * Tk_GetColor.
*/
if (tkColPtr->magic != COLOR_MAGIC) {
- panic("Tk_GCForColor called with bogus color");
+ Tcl_Panic("Tk_GCForColor called with bogus color");
}
if (tkColPtr->gc == None) {
@@ -434,23 +427,21 @@ Tk_GCForColor(colorPtr, drawable)
*
* Tk_FreeColor --
*
- * This procedure is called to release a color allocated by
- * Tk_GetColor.
+ * This function is called to release a color allocated by Tk_GetColor.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with colorPtr is deleted, and
- * the color is released to X if there are no remaining uses
- * for it.
+ * The reference count associated with colorPtr is deleted, and the color
+ * is released to X if there are no remaining uses for it.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeColor(colorPtr)
- XColor *colorPtr; /* Color to be released. Must have been
+Tk_FreeColor(
+ XColor *colorPtr) /* Color to be released. Must have been
* allocated by Tk_GetColor or
* Tk_GetColorByValue. */
{
@@ -459,12 +450,12 @@ Tk_FreeColor(colorPtr)
TkColor *prevPtr;
/*
- * Do a quick sanity check to make sure this color was really
- * allocated by Tk_GetColor.
+ * Do a quick sanity check to make sure this color was really allocated by
+ * Tk_GetColor.
*/
if (tkColPtr->magic != COLOR_MAGIC) {
- panic("Tk_FreeColor called with bogus color");
+ Tcl_Panic("Tk_FreeColor called with bogus color");
}
tkColPtr->resourceRefCount--;
@@ -474,8 +465,8 @@ Tk_FreeColor(colorPtr)
/*
* This color is no longer being actively used, so free the color
- * resources associated with it and remove it from the hash table.
- * no longer any objects referencing it.
+ * resources associated with it and remove it from the hash table. No
+ * longer any objects referencing it.
*/
if (tkColPtr->gc != None) {
@@ -484,11 +475,11 @@ Tk_FreeColor(colorPtr)
}
TkpFreeColor(tkColPtr);
- prevPtr = (TkColor *) Tcl_GetHashValue(tkColPtr->hashPtr);
+ prevPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
if (prevPtr == tkColPtr) {
if (tkColPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(tkColPtr->hashPtr);
- } else {
+ } else {
Tcl_SetHashValue(tkColPtr->hashPtr, tkColPtr->nextPtr);
}
} else {
@@ -499,10 +490,9 @@ Tk_FreeColor(colorPtr)
}
/*
- * Free the TkColor structure if there are no objects referencing
- * it. However, if there are objects referencing it then keep the
- * structure around; it will get freed when the last reference is
- * cleared
+ * Free the TkColor structure if there are no objects referencing it.
+ * However, if there are objects referencing it then keep the structure
+ * around; it will get freed when the last reference is cleared
*/
if (tkColPtr->objRefCount == 0) {
@@ -515,27 +505,27 @@ Tk_FreeColor(colorPtr)
*
* Tk_FreeColorFromObj --
*
- * This procedure is called to release a color allocated by
- * Tk_AllocColorFromObj. It does not throw away the Tcl_Obj *;
- * it only gets rid of the hash table entry for this color
- * and clears the cached value that is normally stored in the object.
+ * This function is called to release a color allocated by
+ * Tk_AllocColorFromObj. It does not throw away the Tcl_Obj *; it only
+ * gets rid of the hash table entry for this color and clears the cached
+ * value that is normally stored in the object.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with the color represented by
- * objPtr is decremented, and the color is released to X if there are
- * no remaining uses for it.
+ * The reference count associated with the color represented by objPtr is
+ * decremented, and the color is released to X if there are no remaining
+ * uses for it.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeColorFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window this color lives in. Needed
- * for the screen and colormap values. */
- Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+Tk_FreeColorFromObj(
+ Tk_Window tkwin, /* The window this color lives in. Needed for
+ * the screen and colormap values. */
+ Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
Tk_FreeColor(Tk_GetColorFromObj(tkwin, objPtr));
FreeColorObjProc(objPtr);
@@ -544,66 +534,65 @@ Tk_FreeColorFromObj(tkwin, objPtr)
/*
*---------------------------------------------------------------------------
*
- * FreeColorObjProc --
+ * FreeColorObjProc --
*
- * 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 needs to be changed.
+ * 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
+ * needs to be changed.
*
* Results:
* None.
*
* Side effects:
- * The object reference count is decremented. When both it
- * and the hash ref count go to zero, the color's resources
- * are released.
+ * The object reference count is decremented. When both it and the hash
+ * ref count go to zero, the color's resources are released.
*
*---------------------------------------------------------------------------
*/
static void
-FreeColorObjProc(objPtr)
- Tcl_Obj *objPtr; /* The object we are releasing. */
+FreeColorObjProc(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
{
TkColor *tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
if (tkColPtr != NULL) {
tkColPtr->objRefCount--;
- if ((tkColPtr->objRefCount == 0)
+ if ((tkColPtr->objRefCount == 0)
&& (tkColPtr->resourceRefCount == 0)) {
ckfree((char *) tkColPtr);
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
/*
*---------------------------------------------------------------------------
*
- * DupColorObjProc --
+ * DupColorObjProc --
*
- * When a cached color object is duplicated, this is called to
- * update the internal reps.
+ * When a cached color object is duplicated, this is called to update the
+ * internal reps.
*
* Results:
* None.
*
* Side effects:
- * The color's objRefCount is incremented and the internal rep
- * of the copy is set to point to it.
+ * The color's objRefCount is incremented and the internal rep of the
+ * copy is set to point to it.
*
*---------------------------------------------------------------------------
*/
static void
-DupColorObjProc(srcObjPtr, dupObjPtr)
- Tcl_Obj *srcObjPtr; /* The object we are copying from. */
- Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+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;
-
+
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tkColPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
if (tkColPtr != NULL) {
tkColPtr->objRefCount++;
@@ -615,26 +604,25 @@ DupColorObjProc(srcObjPtr, dupObjPtr)
*
* Tk_GetColorFromObj --
*
- * Returns the color referred to by a Tcl object. The color must
- * already have been allocated via a call to Tk_AllocColorFromObj
- * or Tk_GetColor.
+ * Returns the color referred to by a Tcl object. The color must already
+ * have been allocated via a call to Tk_AllocColorFromObj or Tk_GetColor.
*
* Results:
- * Returns the XColor * that matches the tkwin and the string rep
- * of objPtr.
+ * Returns the XColor * that matches the tkwin and the string rep of
+ * objPtr.
*
* Side effects:
- * If the object is not already a color, the conversion will free
- * any old internal representation.
+ * If the object is not already a color, the conversion will free any old
+ * internal representation.
*
*----------------------------------------------------------------------
*/
XColor *
-Tk_GetColorFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window in which the color will be
+Tk_GetColorFromObj(
+ Tk_Window tkwin, /* The window in which the color will be
* used. */
- Tcl_Obj *objPtr; /* String value contains the name of the
+ Tcl_Obj *objPtr) /* String value contains the name of the
* desired color. */
{
TkColor *tkColPtr;
@@ -644,51 +632,52 @@ Tk_GetColorFromObj(tkwin, objPtr)
if (objPtr->typePtr != &tkColorObjType) {
InitColorObj(objPtr);
}
-
+
/*
- * First check to see if the internal representation of the object
- * is defined and is a color that is valid for the current screen
- * and color map. If it is, we are done.
+ * First check to see if the internal representation of the object is
+ * defined and is a color that is valid for the current screen and color
+ * map. If it is, we are done.
*/
+
tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
if ((tkColPtr != NULL)
&& (tkColPtr->resourceRefCount > 0)
&& (Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
/*
- * The object already points to the right TkColor structure.
- * Just return it.
+ * The object already points to the right TkColor structure. Just
+ * return it.
*/
return (XColor *) tkColPtr;
}
/*
- * If we reach this point, it means that the TkColor structure
- * that we have cached in the internal representation is not valid
- * for the current screen and colormap. But there is a list of
- * other TkColor structures attached to the TkDisplay. Walk this
- * list looking for the right TkColor structure.
+ * If we reach this point, it means that the TkColor structure that we
+ * have cached in the internal representation is not valid for the current
+ * screen and colormap. But there is a list of other TkColor structures
+ * attached to the TkDisplay. Walk this list looking for the right TkColor
+ * structure.
*/
- hashPtr = Tcl_FindHashEntry(&dispPtr->colorNameTable,
+ hashPtr = Tcl_FindHashEntry(&dispPtr->colorNameTable,
Tcl_GetString(objPtr));
if (hashPtr == NULL) {
goto error;
}
- for (tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr);
+ for (tkColPtr = Tcl_GetHashValue(hashPtr);
(tkColPtr != NULL); tkColPtr = tkColPtr->nextPtr) {
if ((Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
FreeColorObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tkColPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr;
tkColPtr->objRefCount++;
return (XColor *) tkColPtr;
}
}
- error:
- panic(" Tk_GetColorFromObj called with non-existent color!");
+ error:
+ Tcl_Panic("Tk_GetColorFromObj called with non-existent color!");
/*
* The following code isn't reached; it's just there to please compilers.
*/
@@ -700,28 +689,27 @@ Tk_GetColorFromObj(tkwin, objPtr)
*
* InitColorObj --
*
- * Bookeeping procedure to change an objPtr to a color type.
+ * Bookeeping function to change an objPtr to a color type.
*
* Results:
* None.
*
* Side effects:
- * The old internal rep of the object is freed. The object's
- * type is set to color with a NULL TkColor pointer (the pointer
- * will be set later by either Tk_AllocColorFromObj or
- * Tk_GetColorFromObj).
+ * The old internal rep of the object is freed. The object's type is set
+ * to color with a NULL TkColor pointer (the pointer will be set later by
+ * either Tk_AllocColorFromObj or Tk_GetColorFromObj).
*
*----------------------------------------------------------------------
*/
static void
-InitColorObj(objPtr)
- Tcl_Obj *objPtr; /* The object to convert. */
+InitColorObj(
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetString(objPtr);
@@ -730,7 +718,7 @@ InitColorObj(objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
objPtr->typePtr = &tkColorObjType;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
/*
@@ -750,14 +738,14 @@ InitColorObj(objPtr)
*/
static void
-ColorInit(dispPtr)
- TkDisplay *dispPtr;
+ColorInit(
+ TkDisplay *dispPtr)
{
if (!dispPtr->colorInit) {
- dispPtr->colorInit = 1;
+ dispPtr->colorInit = 1;
Tcl_InitHashTable(&dispPtr->colorNameTable, TCL_STRING_KEYS);
- Tcl_InitHashTable(&dispPtr->colorValueTable,
- sizeof(ValueKey)/sizeof(int));
+ Tcl_InitHashTable(&dispPtr->colorValueTable,
+ sizeof(ValueKey)/sizeof(int));
}
}
@@ -766,13 +754,13 @@ ColorInit(dispPtr)
*
* TkDebugColor --
*
- * This procedure returns debugging information about a color.
+ * This function returns debugging information about a color.
*
* Results:
* The return value is a list with one sublist for each TkColor
- * corresponding to "name". Each sublist has two elements that
- * contain the resourceRefCount and objRefCount fields from the
- * TkColor structure.
+ * corresponding to "name". Each sublist has two elements that contain
+ * the resourceRefCount and objRefCount fields from the TkColor
+ * structure.
*
* Side effects:
* None.
@@ -781,31 +769,40 @@ ColorInit(dispPtr)
*/
Tcl_Obj *
-TkDebugColor(tkwin, name)
- Tk_Window tkwin; /* The window in which the color will be
- * used (not currently used). */
- char *name; /* Name of the desired color. */
+TkDebugColor(
+ Tk_Window tkwin, /* The window in which the color will be used
+ * (not currently used). */
+ char *name) /* Name of the desired color. */
{
- TkColor *tkColPtr;
Tcl_HashEntry *hashPtr;
- Tcl_Obj *resultPtr, *objPtr;
+ Tcl_Obj *resultPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->colorNameTable, name);
if (hashPtr != NULL) {
- tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr);
+ TkColor *tkColPtr = Tcl_GetHashValue(hashPtr);
+
if (tkColPtr == NULL) {
- panic("TkDebugColor found empty hash table entry");
+ Tcl_Panic("TkDebugColor found empty hash table entry");
}
for ( ; (tkColPtr != NULL); tkColPtr = tkColPtr->nextPtr) {
- objPtr = Tcl_NewObj();
+ Tcl_Obj *objPtr = Tcl_NewObj();
+
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(tkColPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(tkColPtr->objRefCount));
+ Tcl_NewIntObj(tkColPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
return resultPtr;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkColor.h b/generic/tkColor.h
index 2a59e05..d4679cf 100644
--- a/generic/tkColor.h
+++ b/generic/tkColor.h
@@ -1,13 +1,12 @@
/*
* tkColor.h --
*
- * Declarations of data types and functions used by the
- * Tk color module.
+ * Declarations of data types and functions used by the Tk color module.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKCOLOR
@@ -16,14 +15,14 @@
#include <tkInt.h>
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
#endif
/*
- * One of the following data structures is used to keep track of
- * each color that is being used by the application; typically there
- * is a colormap entry allocated for each of these colors.
+ * One of the following data structures is used to keep track of each color
+ * that is being used by the application; typically there is a colormap entry
+ * allocated for each of these colors.
*/
#define TK_COLOR_BY_NAME 1
@@ -34,39 +33,38 @@
typedef struct TkColor {
XColor color; /* Information about this color. */
unsigned int magic; /* Used for quick integrity check on this
- * structure. Must always have the
- * value COLOR_MAGIC. */
+ * structure. Must always have the value
+ * COLOR_MAGIC. */
GC gc; /* Simple gc with this color as foreground
- * color and all other fields defaulted.
- * May be None. */
- Screen *screen; /* Screen where this color is valid. Used
- * to delete it, and to find its display. */
+ * color and all other fields defaulted. May
+ * be None. */
+ Screen *screen; /* Screen where this color is valid. Used to
+ * delete it, and to find its display. */
Colormap colormap; /* Colormap from which this entry was
* allocated. */
- Visual *visual; /* Visual associated with colormap. */
+ Visual *visual; /* Visual associated with colormap. */
int resourceRefCount; /* Number of active uses of this color (each
* active use corresponds to a call to
- * Tk_AllocColorFromObj or Tk_GetColor).
- * If this count is 0, then this TkColor
+ * Tk_AllocColorFromObj or Tk_GetColor). If
+ * this count is 0, then this TkColor
* structure is no longer valid and it isn't
- * present in a hash table: it is being
- * kept around only because there are objects
- * referring to it. The structure is freed
- * when resourceRefCount and objRefCount
- * are both 0. */
+ * present in a hash table: it is being kept
+ * around only because there are objects
+ * referring to it. The structure is freed
+ * when resourceRefCount and objRefCount are
+ * both 0. */
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
- int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE */
+ int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE. */
Tcl_HashEntry *hashPtr; /* Pointer to hash table entry for this
* structure. (for use in deleting entry). */
struct TkColor *nextPtr; /* Points to the next TkColor structure with
- * the same color name. Colors with the
- * same name but different screens or
- * colormaps are chained together off a
- * single entry in nameTable. For colors in
- * valueTable (those allocated by
- * Tk_GetColorByValue) this field is always
- * NULL. */
+ * the same color name. Colors with the same
+ * name but different screens or colormaps are
+ * chained together off a single entry in
+ * nameTable. For colors in valueTable (those
+ * allocated by Tk_GetColorByValue) this field
+ * is always NULL. */
} TkColor;
/*
@@ -74,14 +72,12 @@ typedef struct TkColor {
*/
#ifndef TkpFreeColor
-EXTERN void TkpFreeColor _ANSI_ARGS_((TkColor *tkColPtr));
+MODULE_SCOPE void TkpFreeColor(TkColor *tkColPtr);
#endif
-EXTERN TkColor * TkpGetColor _ANSI_ARGS_((Tk_Window tkwin,
- Tk_Uid name));
-EXTERN TkColor * TkpGetColorByValue _ANSI_ARGS_((Tk_Window tkwin,
- XColor *colorPtr));
+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
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKCOLOR */
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 1e66af0..ed47210 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -1,13 +1,13 @@
-/*
+/*
* tkConfig.c --
*
- * This file contains procedures that manage configuration options
- * for widgets and other things.
+ * This file contains functions that manage configuration options for
+ * widgets and other things.
*
* Copyright (c) 1997-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.
*/
/*
@@ -23,129 +23,123 @@
#define __NO_OLD_CONFIG
#endif
-#include "tk.h"
#include "tkInt.h"
-#include "tkPort.h"
#include "tkFont.h"
/*
- * The following definition is an AssocData key used to keep track of
- * all of the option tables that have been created for an interpreter.
+ * The following definition is an AssocData key used to keep track of all of
+ * the option tables that have been created for an interpreter.
*/
#define OPTION_HASH_KEY "TkOptionTable"
/*
- * The following two structures are used along with Tk_OptionSpec
- * structures to manage configuration options. Tk_OptionSpec is
- * static templates that are compiled into the code of a widget
- * or other object manager. However, to look up options efficiently
- * we need to supplement the static information with additional
- * dynamic information, and this dynamic information may be different
- * for each application. Thus we create structures of the following
- * two types to hold all of the dynamic information; this is done
- * by Tk_CreateOptionTable.
- *
- * One of the following structures corresponds to each Tk_OptionSpec.
- * These structures exist as arrays inside TkOptionTable structures.
+ * The following two structures are used along with Tk_OptionSpec structures
+ * to manage configuration options. Tk_OptionSpec is static templates that are
+ * compiled into the code of a widget or other object manager. However, to
+ * look up options efficiently we need to supplement the static information
+ * with additional dynamic information, and this dynamic information may be
+ * different for each application. Thus we create structures of the following
+ * two types to hold all of the dynamic information; this is done by
+ * Tk_CreateOptionTable.
+ *
+ * One of the following structures corresponds to each Tk_OptionSpec. These
+ * structures exist as arrays inside TkOptionTable structures.
*/
typedef struct TkOption {
- CONST Tk_OptionSpec *specPtr; /* The original spec from the template
- * passed to Tk_CreateOptionTable.*/
- Tk_Uid dbNameUID; /* The Uid form of the option database
- * name. */
- Tk_Uid dbClassUID; /* The Uid form of the option database
- * class name. */
- Tcl_Obj *defaultPtr; /* Default value for this option. */
+ CONST Tk_OptionSpec *specPtr;
+ /* The original spec from the template passed
+ * to Tk_CreateOptionTable.*/
+ Tk_Uid dbNameUID; /* The Uid form of the option database
+ * name. */
+ Tk_Uid dbClassUID; /* The Uid form of the option database class
+ * name. */
+ Tcl_Obj *defaultPtr; /* Default value for this option. */
union {
- Tcl_Obj *monoColorPtr; /* For color and border options, this
- * is an alternate default value to
- * use on monochrome displays. */
- struct TkOption *synonymPtr; /* For synonym options, this points to
- * the master entry. */
- struct Tk_ObjCustomOption *custom; /* For TK_OPTION_CUSTOM. */
+ Tcl_Obj *monoColorPtr; /* For color and border options, this is an
+ * alternate default value to use on
+ * monochrome displays. */
+ struct TkOption *synonymPtr;
+ /* For synonym options, this points to the
+ * master entry. */
+ struct Tk_ObjCustomOption *custom;
+ /* For TK_OPTION_CUSTOM. */
} extra;
- int flags; /* Miscellaneous flag values; see
- * below for definitions. */
+ int flags; /* Miscellaneous flag values; see below for
+ * definitions. */
} Option;
/*
* Flag bits defined for Option structures:
*
- * OPTION_NEEDS_FREEING - 1 means that FreeResources must be
- * invoke to free resources associated with
- * the option when it is no longer needed.
+ * OPTION_NEEDS_FREEING - 1 means that FreeResources must be invoked to
+ * free resources associated with the option when
+ * it is no longer needed.
*/
#define OPTION_NEEDS_FREEING 1
/*
- * One of the following exists for each Tk_OptionSpec array that has
- * been passed to Tk_CreateOptionTable.
+ * One of the following exists for each Tk_OptionSpec array that has been
+ * passed to Tk_CreateOptionTable.
*/
typedef struct OptionTable {
- int refCount; /* Counts the number of uses of this
- * table (the number of times
- * Tk_CreateOptionTable has returned
- * it). This can be greater than 1 if
- * it is shared along several option
- * table chains, or if the same table
- * is used for multiple purposes. */
- Tcl_HashEntry *hashEntryPtr; /* Hash table entry that refers to this
- * table; used to delete the entry. */
- struct OptionTable *nextPtr; /* If templatePtr was part of a chain
- * of templates, this points to the
- * table corresponding to the next
- * template in the chain. */
- int numOptions; /* The number of items in the options
- * array below. */
- 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 will
- * be numOptions, not 1. */
+ int refCount; /* Counts the number of uses of this table
+ * (the number of times Tk_CreateOptionTable
+ * has returned it). This can be greater than
+ * 1 if it is shared along several option
+ * table chains, or if the same table is used
+ * for multiple purposes. */
+ Tcl_HashEntry *hashEntryPtr;/* Hash table entry that refers to this table;
+ * used to delete the entry. */
+ struct OptionTable *nextPtr;/* If templatePtr was part of a chain of
+ * templates, this points to the table
+ * corresponding to the next template in the
+ * chain. */
+ int numOptions; /* The number of items in the options array
+ * below. */
+ 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
+ * will be numOptions, not 1. */
} OptionTable;
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static int DoObjConfig _ANSI_ARGS_((Tcl_Interp *interp,
- char *recordPtr, Option *optionPtr,
- Tcl_Obj *valuePtr, Tk_Window tkwin,
- Tk_SavedOption *savePtr));
-static void DestroyOptionHashTable _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp));
-static void FreeResources _ANSI_ARGS_((Option *optionPtr,
- Tcl_Obj *objPtr, char *internalPtr,
- Tk_Window tkwin));
-static Tcl_Obj * GetConfigList _ANSI_ARGS_((char *recordPtr,
- Option *optionPtr, Tk_Window tkwin));
-static Tcl_Obj * GetObjectForOption _ANSI_ARGS_((char *recordPtr,
- Option *optionPtr, Tk_Window tkwin));
-static Option * GetOption _ANSI_ARGS_((CONST char *name,
- OptionTable *tablePtr));
-static Option * GetOptionFromObj _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr, OptionTable *tablePtr));
-static int ObjectIsEmpty _ANSI_ARGS_((Tcl_Obj *objPtr));
-static int SetOptionFromAny _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr));
+static int DoObjConfig(Tcl_Interp *interp, char *recordPtr,
+ Option *optionPtr, Tcl_Obj *valuePtr,
+ Tk_Window tkwin, Tk_SavedOption *savePtr);
+static void DestroyOptionHashTable(ClientData clientData,
+ Tcl_Interp *interp);
+static void FreeResources(Option *optionPtr, Tcl_Obj *objPtr,
+ char *internalPtr, Tk_Window tkwin);
+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 * GetOptionFromObj(Tcl_Interp *interp,
+ Tcl_Obj *objPtr, OptionTable *tablePtr);
+static int ObjectIsEmpty(Tcl_Obj *objPtr);
+static int SetOptionFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
/*
- * The structure below defines an object type that is used to cache the
- * result of looking up an option name. If an object has this type, then
- * its internalPtr1 field points to the OptionTable in which it was looked up,
- * and the internalPtr2 field points to the entry that matched.
+ * The structure below defines an object type that is used to cache the result
+ * of looking up an option name. If an object has this type, then its
+ * internalPtr1 field points to the OptionTable in which it was looked up, and
+ * the internalPtr2 field points to the entry that matched.
*/
Tcl_ObjType tkOptionObjType = {
- "option", /* name */
- (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
- (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
- (Tcl_UpdateStringProc *) NULL, /* updateStringProc */
- SetOptionFromAny /* setFromAnyProc */
+ "option", /* name */
+ NULL, /* freeIntRepProc */
+ NULL, /* dupIntRepProc */
+ NULL, /* updateStringProc */
+ SetOptionFromAny /* setFromAnyProc */
};
/*
@@ -153,12 +147,12 @@ Tcl_ObjType tkOptionObjType = {
*
* Tk_CreateOptionTable --
*
- * Given a template for configuration options, this procedure
- * creates a table that may be used to look up options efficiently.
+ * Given a template for configuration options, this function creates a
+ * table that may be used to look up options efficiently.
*
* Results:
- * Returns a token to a structure that can be passed to procedures
- * such as Tk_InitOptions, Tk_SetOptions, and Tk_FreeConfigOptions.
+ * Returns a token to a structure that can be passed to functions such as
+ * Tk_InitOptions, Tk_SetOptions, and Tk_FreeConfigOptions.
*
* Side effects:
* Storage is allocated.
@@ -167,12 +161,12 @@ Tcl_ObjType tkOptionObjType = {
*/
Tk_OptionTable
-Tk_CreateOptionTable(interp, templatePtr)
- Tcl_Interp *interp; /* Interpreter associated with the
- * application in which this table
- * will be used. */
- CONST Tk_OptionSpec *templatePtr; /* Static information about the
- * configuration options. */
+Tk_CreateOptionTable(
+ Tcl_Interp *interp, /* Interpreter associated with the application
+ * in which this table will be used. */
+ CONST Tk_OptionSpec *templatePtr)
+ /* Static information about the configuration
+ * options. */
{
Tcl_HashTable *hashTablePtr;
Tcl_HashEntry *hashEntryPtr;
@@ -183,13 +177,13 @@ Tk_CreateOptionTable(interp, templatePtr)
int numOptions, i;
/*
- * We use an AssocData value in the interpreter to keep a hash
- * table of all the option tables we've created for this application.
- * This is used for two purposes. First, it allows us to share the
- * tables (e.g. in several chains) and second, we use the deletion
- * callback for the AssocData to delete all the option tables when
- * the interpreter is deleted. The code below finds the hash table
- * or creates a new one if it doesn't already exist.
+ * We use an AssocData value in the interpreter to keep a hash table of
+ * all the option tables we've created for this application. This is used
+ * for two purposes. First, it allows us to share the tables (e.g. in
+ * several chains) and second, we use the deletion callback for the
+ * AssocData to delete all the option tables when the interpreter is
+ * deleted. The code below finds the hash table or creates a new one if it
+ * doesn't already exist.
*/
hashTablePtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, OPTION_HASH_KEY,
@@ -202,8 +196,8 @@ Tk_CreateOptionTable(interp, templatePtr)
}
/*
- * See if a table has already been created for this template. If
- * so, just reuse the existing table.
+ * See if a table has already been created for this template. If so, just
+ * reuse the existing table.
*/
hashEntryPtr = Tcl_CreateHashEntry(hashTablePtr, (char *) templatePtr,
@@ -215,8 +209,8 @@ Tk_CreateOptionTable(interp, templatePtr)
}
/*
- * Count the number of options in the template, then create the
- * table structure.
+ * Count the number of options in the template, then create the table
+ * structure.
*/
numOptions = 0;
@@ -245,14 +239,13 @@ Tk_CreateOptionTable(interp, templatePtr)
if (specPtr->type == TK_OPTION_SYNONYM) {
/*
- * This is a synonym option; find the master option that it
- * refers to and create a pointer from the synonym to the
- * master.
+ * This is a synonym option; find the master option that it refers
+ * to and create a pointer from the synonym to the master.
*/
for (specPtr2 = templatePtr, i = 0; ; specPtr2++, i++) {
if (specPtr2->type == TK_OPTION_END) {
- panic("Tk_CreateOptionTable couldn't find synonym");
+ Tcl_Panic("Tk_CreateOptionTable couldn't find synonym");
}
if (strcmp(specPtr2->optionName,
(char *) specPtr->clientData) == 0) {
@@ -265,12 +258,10 @@ Tk_CreateOptionTable(interp, templatePtr)
optionPtr->dbNameUID = Tk_GetUid(specPtr->dbName);
}
if (specPtr->dbClass != NULL) {
- optionPtr->dbClassUID =
- Tk_GetUid(specPtr->dbClass);
+ optionPtr->dbClassUID = Tk_GetUid(specPtr->dbClass);
}
if (specPtr->defValue != NULL) {
- optionPtr->defaultPtr =
- Tcl_NewStringObj(specPtr->defValue, -1);
+ optionPtr->defaultPtr = Tcl_NewStringObj(specPtr->defValue,-1);
Tcl_IncrRefCount(optionPtr->defaultPtr);
}
if (((specPtr->type == TK_OPTION_COLOR)
@@ -286,7 +277,7 @@ Tk_CreateOptionTable(interp, templatePtr)
* Get the custom parsing, etc., functions.
*/
optionPtr->extra.custom =
- (Tk_ObjCustomOption *)specPtr->clientData;
+ (Tk_ObjCustomOption *) specPtr->clientData;
}
}
if (((specPtr->type == TK_OPTION_STRING)
@@ -304,9 +295,9 @@ Tk_CreateOptionTable(interp, templatePtr)
Tcl_SetHashValue(hashEntryPtr, tablePtr);
/*
- * Finally, check to see if this template chains to another template
- * with additional options. If so, call ourselves recursively to
- * create the next table(s).
+ * Finally, check to see if this template chains to another template with
+ * additional options. If so, call ourselves recursively to create the
+ * next table(s).
*/
if (specPtr->clientData != NULL) {
@@ -322,22 +313,22 @@ Tk_CreateOptionTable(interp, templatePtr)
*
* Tk_DeleteOptionTable --
*
- * Called to release resources used by an option table when
- * the table is no longer needed.
+ * Called to release resources used by an option table when the table is
+ * no longer needed.
*
* Results:
* None.
*
* Side effects:
- * The option table and associated resources (such as additional
- * option tables chained off it) are destroyed.
+ * The option table and associated resources (such as additional option
+ * tables chained off it) are destroyed.
*
*----------------------------------------------------------------------
*/
void
-Tk_DeleteOptionTable(optionTable)
- Tk_OptionTable optionTable; /* The option table to delete. */
+Tk_DeleteOptionTable(
+ Tk_OptionTable optionTable) /* The option table to delete. */
{
OptionTable *tablePtr = (OptionTable *) optionTable;
Option *optionPtr;
@@ -372,25 +363,25 @@ Tk_DeleteOptionTable(optionTable)
*
* DestroyOptionHashTable --
*
- * This procedure is the deletion callback associated with the
- * AssocData entry created by Tk_CreateOptionTable. It is
- * invoked when an interpreter is deleted, and deletes all of
- * the option tables associated with that interpreter.
+ * This function is the deletion callback associated with the AssocData
+ * entry created by Tk_CreateOptionTable. It is invoked when an
+ * interpreter is deleted, and deletes all of the option tables
+ * associated with that interpreter.
*
* Results:
* None.
*
* Side effects:
- * The option hash table is destroyed along with all of the
- * OptionTable structures that it refers to.
+ * The option hash table is destroyed along with all of the OptionTable
+ * structures that it refers to.
*
*----------------------------------------------------------------------
*/
static void
-DestroyOptionHashTable(clientData, interp)
- ClientData clientData; /* The hash table we are destroying */
- Tcl_Interp *interp; /* The interpreter we are destroying */
+DestroyOptionHashTable(
+ ClientData clientData, /* The hash table we are destroying */
+ Tcl_Interp *interp) /* The interpreter we are destroying */
{
Tcl_HashTable *hashTablePtr = (Tcl_HashTable *) clientData;
Tcl_HashSearch search;
@@ -404,13 +395,12 @@ DestroyOptionHashTable(clientData, interp)
/*
* The following statements do two tricky things:
- * 1. They ensure that the option table is deleted, even if
- * there are outstanding references to it.
- * 2. They ensure that Tk_DeleteOptionTable doesn't delete
- * other tables chained from this one; we'll do it when
- * we come across the hash table entry for the chained
- * table (in fact, the chained table may already have
- * been deleted).
+ * 1. They ensure that the option table is deleted, even if there are
+ * outstanding references to it.
+ * 2. They ensure that Tk_DeleteOptionTable doesn't delete other
+ * tables chained from this one; we'll do it when we come across
+ * the hash table entry for the chained table (in fact, the chained
+ * table may already have been deleted).
*/
tablePtr->refCount = 1;
@@ -426,16 +416,16 @@ DestroyOptionHashTable(clientData, interp)
*
* Tk_InitOptions --
*
- * This procedure is invoked when an object such as a widget
- * is created. It supplies an initial value for each configuration
- * option (the value may come from the option database, a system
- * default, or the default in the option table).
+ * This function is invoked when an object such as a widget is created.
+ * It supplies an initial value for each configuration option (the value
+ * may come from the option database, a system default, or the default in
+ * the option table).
*
* Results:
- * The return value is TCL_OK if the procedure completed
- * successfully, and TCL_ERROR if one of the initial values was
- * bogus. If an error occurs and interp isn't NULL, then an
- * error message will be left in its result.
+ * The return value is TCL_OK if the function completed successfully, and
+ * TCL_ERROR if one of the initial values was bogus. If an error occurs
+ * and interp isn't NULL, then an error message will be left in its
+ * result.
*
* Side effects:
* Fields of recordPtr are filled in with initial values.
@@ -444,21 +434,21 @@ DestroyOptionHashTable(clientData, interp)
*/
int
-Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
- Tcl_Interp *interp; /* Interpreter for error reporting. NULL
- * means don't leave an error message. */
- char *recordPtr; /* Pointer to the record to configure.
- * Note: the caller should have properly
- * initialized the record with NULL
- * pointers for each option value. */
- Tk_OptionTable optionTable; /* The token which matches the config
- * specs for the widget in question. */
- Tk_Window tkwin; /* Certain options types (such as
- * TK_OPTION_COLOR) need fields out
- * of the window they are used in to
- * be able to calculate their values.
- * Not needed unless one of these
- * options is in the configSpecs record. */
+Tk_InitOptions(
+ Tcl_Interp *interp, /* Interpreter for error reporting. NULL means
+ * don't leave an error message. */
+ char *recordPtr, /* Pointer to the record to configure. Note:
+ * the caller should have properly initialized
+ * the record with NULL pointers for each
+ * option value. */
+ Tk_OptionTable optionTable, /* The token which matches the config specs
+ * for the widget in question. */
+ Tk_Window tkwin) /* Certain options types (such as
+ * TK_OPTION_COLOR) need fields out of the
+ * window they are used in to be able to
+ * calculate their values. Not needed unless
+ * one of these options is in the configSpecs
+ * record. */
{
OptionTable *tablePtr = (OptionTable *) optionTable;
Option *optionPtr;
@@ -471,8 +461,8 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
/*
* If this table chains to other tables, handle their initialization
- * first. That way, if both tables refer to the same field of the
- * record, the value in the first table will win.
+ * first. That way, if both tables refer to the same field of the record,
+ * the value in the first table will win.
*/
if (tablePtr->nextPtr != NULL) {
@@ -489,11 +479,11 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
for (optionPtr = tablePtr->options, count = tablePtr->numOptions;
count > 0; optionPtr++, count--) {
-
/*
* If we specify TK_OPTION_DONT_SET_DEFAULT, then the user has
* processed and set a default for this already.
*/
+
if ((optionPtr->specPtr->type == TK_OPTION_SYNONYM) ||
(optionPtr->specPtr->flags & TK_OPTION_DONT_SET_DEFAULT)) {
continue;
@@ -502,12 +492,12 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
/*
* We look in three places for the initial value, using the first
- * non-NULL value that we find. First, check the option database.
+ * non-NULL value that we find. First, check the option database.
*/
valuePtr = NULL;
if (optionPtr->dbNameUID != NULL) {
- value = Tk_GetOption(tkwin, optionPtr->dbNameUID,
+ value = Tk_GetOption(tkwin, optionPtr->dbNameUID,
optionPtr->dbClassUID);
if (value != NULL) {
valuePtr = Tcl_NewStringObj(value, -1);
@@ -518,6 +508,7 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
/*
* Second, check for a system-specific default value.
*/
+
if ((valuePtr == NULL)
&& (optionPtr->dbNameUID != NULL)) {
valuePtr = TkpGetSystemDefault(tkwin, optionPtr->dbNameUID,
@@ -528,16 +519,16 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
}
/*
- * Third and last, use the default value supplied by the option
- * table. In the case of color objects, we pick one of two
- * values depending on whether the screen is mono or color.
+ * Third and last, use the default value supplied by the option table.
+ * In the case of color objects, we pick one of two values depending
+ * on whether the screen is mono or color.
*/
if (valuePtr == NULL) {
- if ((tkwin != NULL)
+ if ((tkwin != NULL)
&& ((optionPtr->specPtr->type == TK_OPTION_COLOR)
|| (optionPtr->specPtr->type == TK_OPTION_BORDER))
- && (Tk_Depth(tkwin) <= 1)
+ && (Tk_Depth(tkwin) <= 1)
&& (optionPtr->extra.monoColorPtr != NULL)) {
valuePtr = optionPtr->extra.monoColorPtr;
} else {
@@ -554,25 +545,26 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
* referenced here, and will be properly free'd when finished,
* regardless of what DoObjConfig does.
*/
+
Tcl_IncrRefCount(valuePtr);
-
+
if (DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin,
- (Tk_SavedOption *) NULL) != TCL_OK) {
+ NULL) != TCL_OK) {
if (interp != NULL) {
char msg[200];
-
+
switch (source) {
- case OPTION_DATABASE:
- sprintf(msg, "\n (database entry for \"%.50s\")",
- optionPtr->specPtr->optionName);
- break;
- case SYSTEM_DEFAULT:
- sprintf(msg, "\n (system default for \"%.50s\")",
- optionPtr->specPtr->optionName);
- break;
- case TABLE_DEFAULT:
- sprintf(msg, "\n (default value for \"%.50s\")",
- optionPtr->specPtr->optionName);
+ case OPTION_DATABASE:
+ sprintf(msg, "\n (database entry for \"%.50s\")",
+ optionPtr->specPtr->optionName);
+ break;
+ case SYSTEM_DEFAULT:
+ sprintf(msg, "\n (system default for \"%.50s\")",
+ optionPtr->specPtr->optionName);
+ break;
+ case TABLE_DEFAULT:
+ sprintf(msg, "\n (default value for \"%.50s\")",
+ optionPtr->specPtr->optionName);
}
if (tkwin != NULL) {
sprintf(msg + strlen(msg) - 1, " in widget \"%.50s\")",
@@ -593,40 +585,38 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
*
* DoObjConfig --
*
- * This procedure applies a new value for a configuration option
- * to the record being configured.
+ * This function applies a new value for a configuration option to the
+ * record being configured.
*
* Results:
- * The return value is TCL_OK if the procedure completed
- * successfully. If an error occurred then TCL_ERROR is
- * returned and an error message is left in interp's result, if
- * interp isn't NULL. In addition, if oldValuePtrPtr isn't
- * NULL then it *oldValuePtrPtr is filled in with a pointer
- * to the option's old value.
+ * The return value is TCL_OK if the function completed successfully. If
+ * an error occurred then TCL_ERROR is returned and an error message is
+ * left in interp's result, if interp isn't NULL. In addition, if
+ * oldValuePtrPtr isn't NULL then it *oldValuePtrPtr is filled in with a
+ * pointer to the option's old value.
*
* Side effects:
- * RecordPtr gets modified to hold the new value in the form of
- * a Tcl_Obj, an internal representation, or both. The old
- * value is freed if oldValuePtrPtr is NULL.
+ * RecordPtr gets modified to hold the new value in the form of a
+ * Tcl_Obj, an internal representation, or both. The old value is freed
+ * if oldValuePtrPtr is NULL.
*
*--------------------------------------------------------------
*/
static int
-DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
- Tcl_Interp *interp; /* Interpreter for error reporting. If
- * NULL, then no message is left if an error
+DoObjConfig(
+ Tcl_Interp *interp, /* Interpreter for error reporting. If NULL,
+ * then no message is left if an error
* occurs. */
- char *recordPtr; /* The record to modify to hold the new
- * option value. */
- Option *optionPtr; /* Pointer to information about the
- * option. */
- Tcl_Obj *valuePtr; /* New value for option. */
- Tk_Window tkwin; /* Window in which option will be used (needed
+ char *recordPtr, /* The record to modify to hold the new option
+ * value. */
+ Option *optionPtr, /* Pointer to information about the option. */
+ Tcl_Obj *valuePtr, /* New value for option. */
+ Tk_Window tkwin, /* Window in which option will be used (needed
* to allocate resources for some options).
- * May be NULL if the option doesn't
- * require window-related resources. */
- Tk_SavedOption *savedOptionPtr;
+ * May be NULL if the option doesn't require
+ * window-related resources. */
+ Tk_SavedOption *savedOptionPtr)
/* If NULL, the old value for the option will
* be freed. If non-NULL, the old value will
* be stored here, and it becomes the property
@@ -634,13 +624,14 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
* free the old value). */
{
Tcl_Obj **slotPtrPtr, *oldPtr;
- char *internalPtr; /* Points to location in record where
- * internal representation of value should
- * be stored, or NULL. */
+ char *internalPtr; /* Points to location in record where internal
+ * representation of value should be stored,
+ * or NULL. */
char *oldInternalPtr; /* Points to location in which to save old
* internal representation of value. */
- Tk_SavedOption internal; /* Used to save the old internal representation
- * of the value if savedOptionPtr is NULL. */
+ Tk_SavedOption internal; /* Used to save the old internal
+ * representation of the value if
+ * savedOptionPtr is NULL. */
CONST Tk_OptionSpec *specPtr;
int nullOK;
@@ -658,8 +649,8 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
/*
- * Apply the new value in a type-specific way. Also remember the
- * old object and internal forms, if they exist.
+ * Apply the new value in a type-specific way. Also remember the old
+ * object and internal forms, if they exist.
*/
if (specPtr->internalOffset >= 0) {
@@ -676,296 +667,293 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
nullOK = (optionPtr->specPtr->flags & TK_OPTION_NULL_OK);
switch (optionPtr->specPtr->type) {
- case TK_OPTION_BOOLEAN: {
- int new;
+ case TK_OPTION_BOOLEAN: {
+ int newBool;
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &new)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (internalPtr != NULL) {
- *((int *) oldInternalPtr) = *((int *) internalPtr);
- *((int *) internalPtr) = new;
- }
- break;
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &newBool) != TCL_OK) {
+ return TCL_ERROR;
}
- case TK_OPTION_INT: {
- int new;
-
- if (Tcl_GetIntFromObj(interp, valuePtr, &new) != TCL_OK) {
- return TCL_ERROR;
- }
- if (internalPtr != NULL) {
- *((int *) oldInternalPtr) = *((int *) internalPtr);
- *((int *) internalPtr) = new;
- }
- break;
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = newBool;
}
- case TK_OPTION_DOUBLE: {
- double new;
-
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = 0;
- } else {
- if (Tcl_GetDoubleFromObj(interp, valuePtr, &new) != TCL_OK) {
- return TCL_ERROR;
- }
- }
+ break;
+ }
+ case TK_OPTION_INT: {
+ int newInt;
- if (internalPtr != NULL) {
- *((double *) oldInternalPtr) = *((double *) internalPtr);
- *((double *) internalPtr) = new;
- }
- break;
+ if (Tcl_GetIntFromObj(interp, valuePtr, &newInt) != TCL_OK) {
+ return TCL_ERROR;
}
- case TK_OPTION_STRING: {
- char *new, *value;
- int length;
-
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- }
- if (internalPtr != NULL) {
- if (valuePtr != NULL) {
- value = Tcl_GetStringFromObj(valuePtr, &length);
- new = ckalloc((unsigned) (length + 1));
- strcpy(new, value);
- } else {
- new = NULL;
- }
- *((char **) oldInternalPtr) = *((char **) internalPtr);
- *((char **) internalPtr) = new;
- }
- break;
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = newInt;
}
- case TK_OPTION_STRING_TABLE: {
- int new;
+ break;
+ }
+ case TK_OPTION_DOUBLE: {
+ double newDbl;
- if (Tcl_GetIndexFromObj(interp, valuePtr,
- (CONST char **) optionPtr->specPtr->clientData,
- optionPtr->specPtr->optionName+1, 0, &new) != TCL_OK) {
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newDbl = 0;
+ } else {
+ if (Tcl_GetDoubleFromObj(interp, valuePtr, &newDbl) != TCL_OK) {
return TCL_ERROR;
}
- if (internalPtr != NULL) {
- *((int *) oldInternalPtr) = *((int *) internalPtr);
- *((int *) internalPtr) = new;
- }
- break;
}
- case TK_OPTION_COLOR: {
- XColor *newPtr;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- newPtr = NULL;
- } else {
- newPtr = Tk_AllocColorFromObj(interp, tkwin, valuePtr);
- if (newPtr == NULL) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((XColor **) oldInternalPtr) = *((XColor **) internalPtr);
- *((XColor **) internalPtr) = newPtr;
- }
- break;
+ if (internalPtr != NULL) {
+ *((double *) oldInternalPtr) = *((double *) internalPtr);
+ *((double *) internalPtr) = newDbl;
}
- case TK_OPTION_FONT: {
- Tk_Font new;
+ break;
+ }
+ case TK_OPTION_STRING: {
+ char *newStr, *value;
+ int length;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = NULL;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ }
+ if (internalPtr != NULL) {
+ if (valuePtr != NULL) {
+ value = Tcl_GetStringFromObj(valuePtr, &length);
+ newStr = ckalloc((unsigned) (length + 1));
+ strcpy(newStr, value);
} else {
- new = Tk_AllocFontFromObj(interp, tkwin, valuePtr);
- if (new == NULL) {
- return TCL_ERROR;
- }
+ newStr = NULL;
}
- if (internalPtr != NULL) {
- *((Tk_Font *) oldInternalPtr) = *((Tk_Font *) internalPtr);
- *((Tk_Font *) internalPtr) = new;
- }
- break;
+ *((char **) oldInternalPtr) = *((char **) internalPtr);
+ *((char **) internalPtr) = newStr;
}
- case TK_OPTION_STYLE: {
- Tk_Style new;
+ break;
+ }
+ case TK_OPTION_STRING_TABLE: {
+ int newValue;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = NULL;
- } else {
- new = Tk_AllocStyleFromObj(interp, valuePtr);
- if (new == NULL) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((Tk_Style *) oldInternalPtr) = *((Tk_Style *) internalPtr);
- *((Tk_Style *) internalPtr) = new;
- }
- break;
+ if (Tcl_GetIndexFromObj(interp, valuePtr,
+ (CONST char **) optionPtr->specPtr->clientData,
+ optionPtr->specPtr->optionName+1, 0, &newValue) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = newValue;
}
- case TK_OPTION_BITMAP: {
- Pixmap new;
+ break;
+ }
+ case TK_OPTION_COLOR: {
+ XColor *newPtr;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = None;
- } else {
- new = Tk_AllocBitmapFromObj(interp, tkwin, valuePtr);
- if (new == None) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((Pixmap *) oldInternalPtr) = *((Pixmap *) internalPtr);
- *((Pixmap *) internalPtr) = new;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newPtr = NULL;
+ } else {
+ newPtr = Tk_AllocColorFromObj(interp, tkwin, valuePtr);
+ if (newPtr == NULL) {
+ return TCL_ERROR;
}
- break;
}
- case TK_OPTION_BORDER: {
- Tk_3DBorder new;
+ if (internalPtr != NULL) {
+ *((XColor **) oldInternalPtr) = *((XColor **) internalPtr);
+ *((XColor **) internalPtr) = newPtr;
+ }
+ break;
+ }
+ case TK_OPTION_FONT: {
+ Tk_Font newFont;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = NULL;
- } else {
- new = Tk_Alloc3DBorderFromObj(interp, tkwin, valuePtr);
- if (new == NULL) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((Tk_3DBorder *) oldInternalPtr) =
- *((Tk_3DBorder *) internalPtr);
- *((Tk_3DBorder *) internalPtr) = new;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newFont = NULL;
+ } else {
+ newFont = Tk_AllocFontFromObj(interp, tkwin, valuePtr);
+ if (newFont == NULL) {
+ return TCL_ERROR;
}
- break;
}
- case TK_OPTION_RELIEF: {
- int new;
+ if (internalPtr != NULL) {
+ *((Tk_Font *) oldInternalPtr) = *((Tk_Font *) internalPtr);
+ *((Tk_Font *) internalPtr) = newFont;
+ }
+ break;
+ }
+ case TK_OPTION_STYLE: {
+ Tk_Style newStyle;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = TK_RELIEF_NULL;
- } else {
- if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((int *) oldInternalPtr) = *((int *) internalPtr);
- *((int *) internalPtr) = new;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newStyle = NULL;
+ } else {
+ newStyle = Tk_AllocStyleFromObj(interp, valuePtr);
+ if (newStyle == NULL) {
+ return TCL_ERROR;
}
- break;
}
- case TK_OPTION_CURSOR: {
- Tk_Cursor new;
+ if (internalPtr != NULL) {
+ *((Tk_Style *) oldInternalPtr) = *((Tk_Style *) internalPtr);
+ *((Tk_Style *) internalPtr) = newStyle;
+ }
+ break;
+ }
+ case TK_OPTION_BITMAP: {
+ Pixmap newBitmap;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- new = None;
- valuePtr = NULL;
- } else {
- new = Tk_AllocCursorFromObj(interp, tkwin, valuePtr);
- if (new == None) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((Tk_Cursor *) oldInternalPtr) = *((Tk_Cursor *) internalPtr);
- *((Tk_Cursor *) internalPtr) = new;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newBitmap = None;
+ } else {
+ newBitmap = Tk_AllocBitmapFromObj(interp, tkwin, valuePtr);
+ if (newBitmap == None) {
+ return TCL_ERROR;
}
- Tk_DefineCursor(tkwin, new);
- break;
}
- case TK_OPTION_JUSTIFY: {
- Tk_Justify new;
+ if (internalPtr != NULL) {
+ *((Pixmap *) oldInternalPtr) = *((Pixmap *) internalPtr);
+ *((Pixmap *) internalPtr) = newBitmap;
+ }
+ break;
+ }
+ case TK_OPTION_BORDER: {
+ Tk_3DBorder newBorder;
- if (Tk_GetJustifyFromObj(interp, valuePtr, &new) != TCL_OK) {
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newBorder = NULL;
+ } else {
+ newBorder = Tk_Alloc3DBorderFromObj(interp, tkwin, valuePtr);
+ if (newBorder == NULL) {
return TCL_ERROR;
}
- if (internalPtr != NULL) {
- *((Tk_Justify *) oldInternalPtr)
- = *((Tk_Justify *) internalPtr);
- *((Tk_Justify *) internalPtr) = new;
- }
- break;
}
- case TK_OPTION_ANCHOR: {
- Tk_Anchor new;
+ if (internalPtr != NULL) {
+ *((Tk_3DBorder *) oldInternalPtr) = *((Tk_3DBorder *) internalPtr);
+ *((Tk_3DBorder *) internalPtr) = newBorder;
+ }
+ break;
+ }
+ case TK_OPTION_RELIEF: {
+ int newRelief;
- if (Tk_GetAnchorFromObj(interp, valuePtr, &new) != TCL_OK) {
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newRelief = TK_RELIEF_NULL;
+ } else {
+ if (Tk_GetReliefFromObj(interp, valuePtr, &newRelief) != TCL_OK) {
return TCL_ERROR;
}
- if (internalPtr != NULL) {
- *((Tk_Anchor *) oldInternalPtr)
- = *((Tk_Anchor *) internalPtr);
- *((Tk_Anchor *) internalPtr) = new;
- }
- break;
}
- case TK_OPTION_PIXELS: {
- int new;
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = newRelief;
+ }
+ break;
+ }
+ case TK_OPTION_CURSOR: {
+ Tk_Cursor newCursor;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = 0;
- } else {
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
- &new) != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((int *) oldInternalPtr) = *((int *) internalPtr);
- *((int *) internalPtr) = new;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ newCursor = None;
+ valuePtr = NULL;
+ } else {
+ newCursor = Tk_AllocCursorFromObj(interp, tkwin, valuePtr);
+ if (newCursor == None) {
+ return TCL_ERROR;
}
- break;
}
- case TK_OPTION_WINDOW: {
- Tk_Window new;
+ if (internalPtr != NULL) {
+ *((Tk_Cursor *) oldInternalPtr) = *((Tk_Cursor *) internalPtr);
+ *((Tk_Cursor *) internalPtr) = newCursor;
+ }
+ Tk_DefineCursor(tkwin, newCursor);
+ break;
+ }
+ case TK_OPTION_JUSTIFY: {
+ Tk_Justify newJustify;
- if (nullOK && ObjectIsEmpty(valuePtr)) {
- valuePtr = NULL;
- new = None;
- } else {
- if (TkGetWindowFromObj(interp, tkwin, valuePtr, &new)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- if (internalPtr != NULL) {
- *((Tk_Window *) oldInternalPtr) = *((Tk_Window *) internalPtr);
- *((Tk_Window *) internalPtr) = new;
+ if (Tk_GetJustifyFromObj(interp, valuePtr, &newJustify) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (internalPtr != NULL) {
+ *((Tk_Justify *) oldInternalPtr) = *((Tk_Justify *) internalPtr);
+ *((Tk_Justify *) internalPtr) = newJustify;
+ }
+ break;
+ }
+ case TK_OPTION_ANCHOR: {
+ Tk_Anchor newAnchor;
+
+ if (Tk_GetAnchorFromObj(interp, valuePtr, &newAnchor) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (internalPtr != NULL) {
+ *((Tk_Anchor *) oldInternalPtr) = *((Tk_Anchor *) internalPtr);
+ *((Tk_Anchor *) internalPtr) = newAnchor;
+ }
+ break;
+ }
+ case TK_OPTION_PIXELS: {
+ int newPixels;
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newPixels = 0;
+ } else {
+ if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
+ &newPixels) != TCL_OK) {
+ return TCL_ERROR;
}
- break;
}
- case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
- if (custom->setProc(custom->clientData, interp, tkwin,
- &valuePtr, recordPtr, optionPtr->specPtr->internalOffset,
- (char *)oldInternalPtr,
- optionPtr->specPtr->flags) != TCL_OK) {
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = newPixels;
+ }
+ break;
+ }
+ case TK_OPTION_WINDOW: {
+ Tk_Window newWin;
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ newWin = None;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, valuePtr,
+ &newWin) != TCL_OK) {
return TCL_ERROR;
}
- break;
}
-
- default: {
- char buf[40+TCL_INTEGER_SPACE];
- sprintf(buf, "bad config table: unknown type %d",
- optionPtr->specPtr->type);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ if (internalPtr != NULL) {
+ *((Tk_Window *) oldInternalPtr) = *((Tk_Window *) internalPtr);
+ *((Tk_Window *) internalPtr) = newWin;
+ }
+ break;
+ }
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+
+ if (custom->setProc(custom->clientData, interp, tkwin,
+ &valuePtr, recordPtr, optionPtr->specPtr->internalOffset,
+ (char *)oldInternalPtr, optionPtr->specPtr->flags) != TCL_OK) {
return TCL_ERROR;
}
+ break;
+ }
+
+ {
+ char buf[40+TCL_INTEGER_SPACE];
+
+ default:
+ sprintf(buf, "bad config table: unknown type %d",
+ optionPtr->specPtr->type);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_ERROR;
+ }
}
/*
- * Release resources associated with the old value, if we're not
- * returning it to the caller, then install the new object value into
- * the record.
+ * Release resources associated with the old value, if we're not returning
+ * it to the caller, then install the new object value into the record.
*/
if (savedOptionPtr == NULL) {
@@ -990,12 +978,11 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
*
* ObjectIsEmpty --
*
- * This procedure tests whether the string value of an object is
- * empty.
+ * This function tests whether the string value of an object is empty.
*
* Results:
- * The return value is 1 if the string value of objPtr has length
- * zero, and 0 otherwise.
+ * The return value is 1 if the string value of objPtr has length zero,
+ * and 0 otherwise.
*
* Side effects:
* None.
@@ -1004,8 +991,8 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
*/
static int
-ObjectIsEmpty(objPtr)
- Tcl_Obj *objPtr; /* Object to test. May be NULL. */
+ObjectIsEmpty(
+ Tcl_Obj *objPtr) /* Object to test. May be NULL. */
{
int length;
@@ -1024,15 +1011,14 @@ ObjectIsEmpty(objPtr)
*
* GetOption --
*
- * This procedure searches through a chained option table to find
- * the entry for a particular option name.
+ * This function searches through a chained option table to find the
+ * entry for a particular option name.
*
* Results:
- * The return value is a pointer to the matching entry, or NULL
- * if no matching entry could be found.
- * Note: if the matching entry is a synonym then this procedure
- * returns a pointer to the synonym entry, *not* the "real" entry
- * that the synonym refers to.
+ * The return value is a pointer to the matching entry, or NULL if no
+ * matching entry could be found. Note: if the matching entry is a
+ * synonym then this function returns a pointer to the synonym entry,
+ * *not* the "real" entry that the synonym refers to.
*
* Side effects:
* None.
@@ -1041,10 +1027,10 @@ ObjectIsEmpty(objPtr)
*/
static Option *
-GetOption(name, tablePtr)
- CONST char *name; /* String balue to be looked up in the
- * option table. */
- OptionTable *tablePtr; /* Table in which to look up name. */
+GetOption(
+ 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;
@@ -1052,14 +1038,13 @@ GetOption(name, tablePtr)
int count;
/*
- * Search through all of the option tables in the chain to find the
- * best match. Some tricky aspects:
+ * Search through all of the option tables in the chain to find the best
+ * match. Some tricky aspects:
*
* 1. We have to accept unique abbreviations.
- * 2. The same name could appear in different tables in the chain.
- * If this happens, we use the entry from the first table. We
- * have to be careful to distinguish this case from an ambiguous
- * abbreviation.
+ * 2. The same name could appear in different tables in the chain. If this
+ * happens, we use the entry from the first table. We have to be
+ * careful to distinguish this case from an ambiguous abbreviation.
*/
bestPtr = NULL;
@@ -1071,40 +1056,38 @@ GetOption(name, tablePtr)
*p1 == *p2; p1++, p2++) {
if (*p1 == 0) {
/*
- * This is an exact match. We're done.
+ * This is an exact match. We're done.
*/
- bestPtr = optionPtr;
- goto done;
+ return optionPtr;
}
}
if (*p1 == 0) {
/*
- * The name is an abbreviation for this option. Keep
- * to make sure that the abbreviation only matches one
- * option name. If we've already found a match in the
- * past, then it is an error unless the full names for
- * the two options are identical; in this case, the first
- * option overrides the second.
+ * The name is an abbreviation for this option. Keep to make
+ * sure that the abbreviation only matches one option name.
+ * If we've already found a match in the past, then it is an
+ * error unless the full names for the two options are
+ * identical; in this case, the first option overrides the
+ * second.
*/
if (bestPtr == NULL) {
bestPtr = optionPtr;
- } else {
- if (strcmp(bestPtr->specPtr->optionName,
- optionPtr->specPtr->optionName) != 0) {
- goto error;
- }
+ } else if (strcmp(bestPtr->specPtr->optionName,
+ optionPtr->specPtr->optionName) != 0) {
+ return NULL;
}
}
}
}
- done:
- return bestPtr;
+ /*
+ * Return whatever we have found, which could be NULL if nothing
+ * matched. The multiple-matching case is handled above.
+ */
- error:
- return NULL;
+ return bestPtr;
}
/*
@@ -1112,32 +1095,30 @@ GetOption(name, tablePtr)
*
* GetOptionFromObj --
*
- * This procedure searches through a chained option table to find
- * the entry for a particular option name.
+ * This function searches through a chained option table to find the
+ * entry for a particular option name.
*
* Results:
- * The return value is a pointer to the matching entry, or NULL
- * if no matching entry could be found. If NULL is returned and
- * interp is not NULL than an error message is left in its result.
- * Note: if the matching entry is a synonym then this procedure
- * returns a pointer to the synonym entry, *not* the "real" entry
- * that the synonym refers to.
+ * The return value is a pointer to the matching entry, or NULL if no
+ * matching entry could be found. If NULL is returned and interp is not
+ * NULL than an error message is left in its result. Note: if the
+ * matching entry is a synonym then this function returns a pointer to
+ * the synonym entry, *not* the "real" entry that the synonym refers to.
*
* Side effects:
- * Information about the matching entry is cached in the object
- * containing the name, so that future lookups can proceed more
- * quickly.
+ * Information about the matching entry is cached in the object
+ * containing the name, so that future lookups can proceed more quickly.
*
*----------------------------------------------------------------------
*/
static Option *
-GetOptionFromObj(interp, objPtr, tablePtr)
- Tcl_Interp *interp; /* Used only for error reporting; if NULL
- * no message is left after an error. */
- Tcl_Obj *objPtr; /* Object whose string value is to be
- * looked up in the option table. */
- OptionTable *tablePtr; /* Table in which to look up objPtr. */
+GetOptionFromObj(
+ Tcl_Interp *interp, /* Used only for error reporting; if NULL no
+ * message is left after an error. */
+ Tcl_Obj *objPtr, /* Object whose string value is to be looked
+ * up in the option table. */
+ OptionTable *tablePtr) /* Table in which to look up objPtr. */
{
Option *bestPtr;
char *name;
@@ -1147,16 +1128,16 @@ GetOptionFromObj(interp, objPtr, tablePtr)
*/
if (objPtr->typePtr == &tkOptionObjType) {
- if (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr) {
- return (Option *) objPtr->internalRep.twoPtrValue.ptr2;
- }
+ if (objPtr->internalRep.twoPtrValue.ptr1 == (void *) tablePtr) {
+ return (Option *) objPtr->internalRep.twoPtrValue.ptr2;
+ }
}
/*
* The answer isn't cached.
*/
- name = Tcl_GetStringFromObj(objPtr, NULL);
+ name = Tcl_GetString(objPtr);
bestPtr = GetOption(name, tablePtr);
if (bestPtr == NULL) {
goto error;
@@ -1166,15 +1147,14 @@ GetOptionFromObj(interp, objPtr, tablePtr)
&& (objPtr->typePtr->freeIntRepProc != NULL)) {
objPtr->typePtr->freeIntRepProc(objPtr);
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tablePtr;
- objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) bestPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) tablePtr;
+ objPtr->internalRep.twoPtrValue.ptr2 = (void *) bestPtr;
objPtr->typePtr = &tkOptionObjType;
return bestPtr;
- error:
+ error:
if (interp != NULL) {
- Tcl_AppendResult(interp, "unknown option \"", name,
- "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "unknown option \"", name, "\"", NULL);
}
return NULL;
}
@@ -1184,29 +1164,28 @@ GetOptionFromObj(interp, objPtr, tablePtr)
*
* TkGetOptionSpec --
*
- * This procedure searches through a chained option table to find
- * the option spec for a particular option name.
+ * This function searches through a chained option table to find the
+ * option spec for a particular option name.
*
* Results:
- * The return value is a pointer to the option spec of the matching
- * entry, or NULL if no matching entry could be found.
- * Note: if the matching entry is a synonym then this procedure
- * returns a pointer to the option spec of the synonym entry, *not*
- * the "real" entry that the synonym refers to.
- * Note: this call is primarily used by the style management code
- * (tkStyle.c) to look up an element's option spec into a widget's
- * option table.
+ * The return value is a pointer to the option spec of the matching
+ * entry, or NULL if no matching entry could be found. Note: if the
+ * matching entry is a synonym then this function returns a pointer to
+ * the option spec of the synonym entry, *not* the "real" entry that the
+ * synonym refers to. Note: this call is primarily used by the style
+ * management code (tkStyle.c) to look up an element's option spec into a
+ * widget's option table.
*
* Side effects:
- * None.
+ * None.
*
*----------------------------------------------------------------------
*/
CONST Tk_OptionSpec *
-TkGetOptionSpec(name, optionTable)
- CONST char *name; /* String value to be looked up. */
- Tk_OptionTable optionTable; /* Table in which to look up name. */
+TkGetOptionSpec(
+ CONST char *name, /* String value to be looked up. */
+ Tk_OptionTable optionTable) /* Table in which to look up name. */
{
Option *optionPtr;
@@ -1222,14 +1201,14 @@ TkGetOptionSpec(name, optionTable)
*
* SetOptionFromAny --
*
- * This procedure is called to convert a Tcl object to option
- * internal form. However, this doesn't make sense (need to have a
- * table of options in order to do the conversion) so the
- * procedure always generates an error.
+ * This function is called to convert a Tcl object to option internal
+ * form. However, this doesn't make sense (need to have a table of
+ * options in order to do the conversion) so the function always
+ * generates an error.
*
* Results:
- * The return value is always TCL_ERROR, and an error message is
- * left in interp's result if interp isn't NULL.
+ * The return value is always TCL_ERROR, and an error message is left in
+ * interp's result if interp isn't NULL.
*
* Side effects:
* None.
@@ -1238,9 +1217,9 @@ TkGetOptionSpec(name, optionTable)
*/
static int
-SetOptionFromAny(interp, objPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr; /* The object to convert. */
+SetOptionFromAny(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ register Tcl_Obj *objPtr) /* The object to convert. */
{
Tcl_AppendToObj(Tcl_GetObjResult(interp),
"can't convert value to option except via GetOptionFromObj API",
@@ -1253,53 +1232,47 @@ SetOptionFromAny(interp, objPtr)
*
* Tk_SetOptions --
*
- * Process one or more name-value pairs for configuration options
- * and fill in fields of a record with new values.
+ * Process one or more name-value pairs for configuration options and
+ * fill in fields of a record with new values.
*
* Results:
- * If all goes well then TCL_OK is returned and the old values of
- * any modified objects are saved in *savePtr, if it isn't NULL (the
- * caller must eventually call Tk_RestoreSavedOptions or
- * Tk_FreeSavedOptions to free the contents of *savePtr). In
- * addition, if maskPtr isn't NULL then *maskPtr is filled in with
- * the OR of the typeMask bits from all modified options. If an
- * error occurs then TCL_ERROR is returned and a message
- * is left in interp's result unless interp is NULL; nothing is
+ * If all goes well then TCL_OK is returned and the old values of any
+ * modified objects are saved in *savePtr, if it isn't NULL (the caller
+ * must eventually call Tk_RestoreSavedOptions or Tk_FreeSavedOptions to
+ * free the contents of *savePtr). In addition, if maskPtr isn't NULL
+ * then *maskPtr is filled in with the OR of the typeMask bits from all
+ * modified options. If an error occurs then TCL_ERROR is returned and a
+ * message is left in interp's result unless interp is NULL; nothing is
* saved in *savePtr or *maskPtr in this case.
*
* Side effects:
- * The fields of recordPtr get filled in with object pointers
- * from objc/objv. Old information in widgRec's fields gets
- * recycled. Information may be left at *savePtr.
+ * The fields of recordPtr get filled in with object pointers from
+ * objc/objv. Old information in widgRec's fields gets recycled.
+ * Information may be left at *savePtr.
*
*--------------------------------------------------------------
*/
int
-Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
- maskPtr)
- Tcl_Interp *interp; /* Interpreter for error reporting.
- * If NULL, then no error message is
- * returned.*/
- 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. */
- Tk_Window tkwin; /* Window associated with the thing
- * being configured; needed for some
- * options (such as colors). */
- Tk_SavedOptions *savePtr; /* If non-NULL, the old values of
- * modified options are saved here
- * so that they can be restored
- * after an error. */
- int *maskPtr; /* It non-NULL, this word is modified
- * on a successful return to hold the
- * bit-wise OR of the typeMask fields
- * of all options that were modified
- * by this call. Used by the caller
- * to figure out which options
- * actually changed. */
+Tk_SetOptions(
+ Tcl_Interp *interp, /* Interpreter for error reporting. If NULL,
+ * then no error message is returned.*/
+ 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. */
+ Tk_Window tkwin, /* Window associated with the thing being
+ * configured; needed for some options (such
+ * as colors). */
+ Tk_SavedOptions *savePtr, /* If non-NULL, the old values of modified
+ * options are saved here so that they can be
+ * restored after an error. */
+ int *maskPtr) /* It non-NULL, this word is modified on a
+ * successful return to hold the bit-wise OR
+ * of the typeMask fields of all options that
+ * were modified by this call. Used by the
+ * caller to figure out which options actually
+ * changed. */
{
OptionTable *tablePtr = (OptionTable *) optionTable;
Option *optionPtr;
@@ -1315,8 +1288,8 @@ Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
lastSavePtr = savePtr;
/*
- * Scan through all of the arguments, processing those
- * that match entries in the option table.
+ * Scan through all of the arguments, processing those that match entries
+ * in the option table.
*/
mask = 0;
@@ -1333,19 +1306,18 @@ Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
if (interp != NULL) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"value for \"", Tcl_GetStringFromObj(*objv, NULL),
- "\" missing", (char *) NULL);
+ "\" missing", NULL);
goto error;
}
}
if ((savePtr != NULL)
&& (lastSavePtr->numItems >= TK_NUM_SAVED_OPTIONS)) {
/*
- * We've run out of space for saving old option values. Allocate
+ * We've run out of space for saving old option values. Allocate
* more space.
*/
- newSavePtr = (Tk_SavedOptions *) ckalloc(sizeof(
- Tk_SavedOptions));
+ newSavePtr = (Tk_SavedOptions *) ckalloc(sizeof(Tk_SavedOptions));
newSavePtr->recordPtr = recordPtr;
newSavePtr->tkwin = tkwin;
newSavePtr->numItems = 0;
@@ -1355,7 +1327,7 @@ Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
}
if (DoObjConfig(interp, recordPtr, optionPtr, objv[1], tkwin,
(savePtr != NULL) ? &lastSavePtr->items[lastSavePtr->numItems]
- : (Tk_SavedOption *) NULL) != TCL_OK) {
+ : NULL) != TCL_OK) {
char msg[100];
sprintf(msg, "\n (processing \"%.40s\" option)",
@@ -1373,7 +1345,7 @@ Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
}
return TCL_OK;
- error:
+ error:
if (savePtr != NULL) {
Tk_RestoreSavedOptions(savePtr);
}
@@ -1385,38 +1357,38 @@ Tk_SetOptions(interp, recordPtr, optionTable, objc, objv, tkwin, savePtr,
*
* Tk_RestoreSavedOptions --
*
- * This procedure undoes the effect of a previous call to
- * Tk_SetOptions by restoring all of the options to their value
- * before the call to Tk_SetOptions.
+ * This function undoes the effect of a previous call to Tk_SetOptions by
+ * restoring all of the options to their value before the call to
+ * Tk_SetOptions.
*
* Results:
* None.
*
* Side effects:
- * The configutation record is restored and all the information
- * stored in savePtr is freed.
+ * The configutation record is restored and all the information stored in
+ * savePtr is freed.
*
*----------------------------------------------------------------------
*/
void
-Tk_RestoreSavedOptions(savePtr)
- Tk_SavedOptions *savePtr; /* Holds saved option information; must
- * have been passed to Tk_SetOptions. */
+Tk_RestoreSavedOptions(
+ Tk_SavedOptions *savePtr) /* Holds saved option information; must have
+ * been passed to Tk_SetOptions. */
{
int i;
Option *optionPtr;
Tcl_Obj *newPtr; /* New object value of option, which we
- * replace with old value and free. Taken
- * from record. */
+ * replace with old value and free. Taken from
+ * record. */
char *internalPtr; /* Points to internal value of option in
* record. */
CONST Tk_OptionSpec *specPtr;
/*
- * Be sure to restore the options in the opposite order they were
- * set. This is important because it's possible that the same
- * option name was used twice in a single call to Tk_SetOptions.
+ * Be sure to restore the options in the opposite order they were set.
+ * This is important because it's possible that the same option name was
+ * used twice in a single call to Tk_SetOptions.
*/
if (savePtr->nextPtr != NULL) {
@@ -1429,8 +1401,8 @@ Tk_RestoreSavedOptions(savePtr)
specPtr = optionPtr->specPtr;
/*
- * First free the new value of the option, which is currently
- * in the record.
+ * First free the new value of the option, which is currently in the
+ * record.
*/
if (specPtr->objOffset >= 0) {
@@ -1459,101 +1431,69 @@ Tk_RestoreSavedOptions(savePtr)
= savePtr->items[i].valuePtr;
}
if (specPtr->internalOffset >= 0) {
+ register char *ptr = (char *) &savePtr->items[i].internalForm;
+
switch (specPtr->type) {
- case TK_OPTION_BOOLEAN: {
- *((int *) internalPtr)
- = *((int *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_INT: {
- *((int *) internalPtr)
- = *((int *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_DOUBLE: {
- *((double *) internalPtr)
- = *((double *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_STRING: {
- *((char **) internalPtr)
- = *((char **) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_STRING_TABLE: {
- *((int *) internalPtr)
- = *((int *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_COLOR: {
- *((XColor **) internalPtr)
- = *((XColor **) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_FONT: {
- *((Tk_Font *) internalPtr)
- = *((Tk_Font *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_STYLE: {
- *((Tk_Style *) internalPtr)
- = *((Tk_Style *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_BITMAP: {
- *((Pixmap *) internalPtr)
- = *((Pixmap *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_BORDER: {
- *((Tk_3DBorder *) internalPtr)
- = *((Tk_3DBorder *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_RELIEF: {
- *((int *) internalPtr)
- = *((int *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_CURSOR: {
- *((Tk_Cursor *) internalPtr)
- = *((Tk_Cursor *) &savePtr->items[i].internalForm);
- Tk_DefineCursor(savePtr->tkwin,
- *((Tk_Cursor *) internalPtr));
- break;
- }
- case TK_OPTION_JUSTIFY: {
- *((Tk_Justify *) internalPtr)
- = *((Tk_Justify *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_ANCHOR: {
- *((Tk_Anchor *) internalPtr)
- = *((Tk_Anchor *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_PIXELS: {
- *((int *) internalPtr)
- = *((int *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_WINDOW: {
- *((Tk_Window *) internalPtr)
- = *((Tk_Window *) &savePtr->items[i].internalForm);
- break;
- }
- case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
- if (custom->restoreProc != NULL) {
- custom->restoreProc(custom->clientData, savePtr->tkwin,
- internalPtr,
- (char *)&savePtr->items[i].internalForm);
- }
- break;
- }
- default: {
- panic("bad option type in Tk_RestoreSavedOptions");
+ case TK_OPTION_BOOLEAN:
+ *((int *) internalPtr) = *((int *) ptr);
+ break;
+ case TK_OPTION_INT:
+ *((int *) internalPtr) = *((int *) ptr);
+ break;
+ case TK_OPTION_DOUBLE:
+ *((double *) internalPtr) = *((double *) ptr);
+ break;
+ case TK_OPTION_STRING:
+ *((char **) internalPtr) = *((char **) ptr);
+ break;
+ case TK_OPTION_STRING_TABLE:
+ *((int *) internalPtr) = *((int *) ptr);
+ break;
+ case TK_OPTION_COLOR:
+ *((XColor **) internalPtr) = *((XColor **) ptr);
+ break;
+ case TK_OPTION_FONT:
+ *((Tk_Font *) internalPtr) = *((Tk_Font *) ptr);
+ break;
+ case TK_OPTION_STYLE:
+ *((Tk_Style *) internalPtr) = *((Tk_Style *) ptr);
+ break;
+ case TK_OPTION_BITMAP:
+ *((Pixmap *) internalPtr) = *((Pixmap *) ptr);
+ break;
+ case TK_OPTION_BORDER:
+ *((Tk_3DBorder *) internalPtr) = *((Tk_3DBorder *) ptr);
+ break;
+ case TK_OPTION_RELIEF:
+ *((int *) internalPtr) = *((int *) ptr);
+ break;
+ case TK_OPTION_CURSOR:
+ *((Tk_Cursor *) internalPtr) = *((Tk_Cursor *) ptr);
+ Tk_DefineCursor(savePtr->tkwin, *((Tk_Cursor *) internalPtr));
+ break;
+ case TK_OPTION_JUSTIFY:
+ *((Tk_Justify *) internalPtr) = *((Tk_Justify *) ptr);
+ break;
+ case TK_OPTION_ANCHOR:
+ *((Tk_Anchor *) internalPtr) = *((Tk_Anchor *) ptr);
+ break;
+ case TK_OPTION_PIXELS:
+ *((int *) internalPtr) = *((int *) ptr);
+ break;
+ case TK_OPTION_WINDOW:
+ *((Tk_Window *) internalPtr) = *((Tk_Window *) ptr);
+ break;
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+
+ if (custom->restoreProc != NULL) {
+ custom->restoreProc(custom->clientData, savePtr->tkwin,
+ internalPtr, ptr);
}
+ break;
+ }
+ default:
+ Tcl_Panic("bad option type in Tk_RestoreSavedOptions");
}
}
}
@@ -1565,8 +1505,8 @@ Tk_RestoreSavedOptions(savePtr)
*
* Tk_FreeSavedOptions --
*
- * Free all of the saved configuration option values from a
- * previous call to Tk_SetOptions.
+ * Free all of the saved configuration option values from a previous call
+ * to Tk_SetOptions.
*
* Results:
* None.
@@ -1578,9 +1518,9 @@ Tk_RestoreSavedOptions(savePtr)
*/
void
-Tk_FreeSavedOptions(savePtr)
- Tk_SavedOptions *savePtr; /* Contains options saved in a previous
- * call to Tk_SetOptions. */
+Tk_FreeSavedOptions(
+ Tk_SavedOptions *savePtr) /* Contains options saved in a previous call
+ * to Tk_SetOptions. */
{
int count;
Tk_SavedOption *savedOptionPtr;
@@ -1613,25 +1553,25 @@ Tk_FreeSavedOptions(savePtr)
* None.
*
* Side effects:
- * All of the Tcl_Obj's in recordPtr that are controlled by
- * configuration options in optionTable are freed.
+ * All of the Tcl_Obj's in recordPtr that are controlled by configuration
+ * options in optionTable are freed.
*
*----------------------------------------------------------------------
*/
/* ARGSUSED */
void
-Tk_FreeConfigOptions(recordPtr, optionTable, tkwin)
- char *recordPtr; /* Record whose fields contain current
- * values for options. */
- Tk_OptionTable optionTable; /* Describes legal options. */
- Tk_Window tkwin; /* Window associated with recordPtr; needed
+Tk_FreeConfigOptions(
+ char *recordPtr, /* Record whose fields contain current values
+ * for options. */
+ Tk_OptionTable optionTable, /* Describes legal options. */
+ Tk_Window tkwin) /* Window associated with recordPtr; needed
* for freeing some options. */
{
OptionTable *tablePtr;
Option *optionPtr;
int count;
- Tcl_Obj **oldPtrPtr, *oldPtr;
+ Tcl_Obj **oldPtrPtr, *oldPtr;
char *oldInternalPtr;
CONST Tk_OptionSpec *specPtr;
@@ -1670,114 +1610,113 @@ Tk_FreeConfigOptions(recordPtr, optionTable, tkwin)
*
* FreeResources --
*
- * Free system resources associated with a configuration option,
- * such as colors or fonts.
+ * Free system resources associated with a configuration option, such as
+ * colors or fonts.
*
* Results:
* None.
*
* Side effects:
- * Any system resources associated with objPtr are released. However,
+ * Any system resources associated with objPtr are released. However,
* objPtr itself is not freed.
*
*----------------------------------------------------------------------
*/
static void
-FreeResources(optionPtr, objPtr, internalPtr, tkwin)
- Option *optionPtr; /* Description of the configuration option. */
- Tcl_Obj *objPtr; /* The current value of the option, specified
+FreeResources(
+ Option *optionPtr, /* Description of the configuration option. */
+ Tcl_Obj *objPtr, /* The current value of the option, specified
* as an object. */
- char *internalPtr; /* A pointer to an internal representation for
+ char *internalPtr, /* A pointer to an internal representation for
* the option's value, such as an int or
- * (XColor *). Only valid if
+ * (XColor *). Only valid if
* optionPtr->specPtr->internalOffset >= 0. */
- Tk_Window tkwin; /* The window in which this option is used. */
+ Tk_Window tkwin) /* The window in which this option is used. */
{
int internalFormExists;
/*
* If there exists an internal form for the value, use it to free
- * resources (also zero out the internal form). If there is no
- * internal form, then use the object form.
+ * resources (also zero out the internal form). If there is no internal
+ * form, then use the object form.
*/
internalFormExists = optionPtr->specPtr->internalOffset >= 0;
switch (optionPtr->specPtr->type) {
- case TK_OPTION_STRING:
- if (internalFormExists) {
- if (*((char **) internalPtr) != NULL) {
- ckfree(*((char **) internalPtr));
- *((char **) internalPtr) = NULL;
- }
- }
- break;
- case TK_OPTION_COLOR:
- if (internalFormExists) {
- if (*((XColor **) internalPtr) != NULL) {
- Tk_FreeColor(*((XColor **) internalPtr));
- *((XColor **) internalPtr) = NULL;
- }
- } else if (objPtr != NULL) {
- Tk_FreeColorFromObj(tkwin, objPtr);
- }
- break;
- case TK_OPTION_FONT:
- if (internalFormExists) {
- Tk_FreeFont(*((Tk_Font *) internalPtr));
- *((Tk_Font *) internalPtr) = NULL;
- } else if (objPtr != NULL) {
- Tk_FreeFontFromObj(tkwin, objPtr);
- }
- break;
- case TK_OPTION_STYLE:
- if (internalFormExists) {
- Tk_FreeStyle(*((Tk_Style *) internalPtr));
- *((Tk_Style *) internalPtr) = NULL;
- } else if (objPtr != NULL) {
- Tk_FreeStyleFromObj(objPtr);
- }
- break;
- case TK_OPTION_BITMAP:
- if (internalFormExists) {
- if (*((Pixmap *) internalPtr) != None) {
- Tk_FreeBitmap(Tk_Display(tkwin), *((Pixmap *) internalPtr));
- *((Pixmap *) internalPtr) = None;
- }
- } else if (objPtr != NULL) {
- Tk_FreeBitmapFromObj(tkwin, objPtr);
- }
- break;
- case TK_OPTION_BORDER:
- if (internalFormExists) {
- if (*((Tk_3DBorder *) internalPtr) != NULL) {
- Tk_Free3DBorder(*((Tk_3DBorder *) internalPtr));
- *((Tk_3DBorder *) internalPtr) = NULL;
- }
- } else if (objPtr != NULL) {
- Tk_Free3DBorderFromObj(tkwin, objPtr);
- }
- break;
- case TK_OPTION_CURSOR:
- if (internalFormExists) {
- if (*((Tk_Cursor *) internalPtr) != None) {
- Tk_FreeCursor(Tk_Display(tkwin),
- *((Tk_Cursor *) internalPtr));
- *((Tk_Cursor *) internalPtr) = None;
- }
- } else if (objPtr != NULL) {
- Tk_FreeCursorFromObj(tkwin, objPtr);
- }
- break;
- case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
- if (internalFormExists && custom->freeProc != NULL) {
- custom->freeProc(custom->clientData, tkwin, internalPtr);
- }
- break;
- }
- default:
- break;
+ case TK_OPTION_STRING:
+ if (internalFormExists) {
+ if (*((char **) internalPtr) != NULL) {
+ ckfree(*((char **) internalPtr));
+ *((char **) internalPtr) = NULL;
+ }
+ }
+ break;
+ case TK_OPTION_COLOR:
+ if (internalFormExists) {
+ if (*((XColor **) internalPtr) != NULL) {
+ Tk_FreeColor(*((XColor **) internalPtr));
+ *((XColor **) internalPtr) = NULL;
+ }
+ } else if (objPtr != NULL) {
+ Tk_FreeColorFromObj(tkwin, objPtr);
+ }
+ break;
+ case TK_OPTION_FONT:
+ if (internalFormExists) {
+ Tk_FreeFont(*((Tk_Font *) internalPtr));
+ *((Tk_Font *) internalPtr) = NULL;
+ } else if (objPtr != NULL) {
+ Tk_FreeFontFromObj(tkwin, objPtr);
+ }
+ break;
+ case TK_OPTION_STYLE:
+ if (internalFormExists) {
+ Tk_FreeStyle(*((Tk_Style *) internalPtr));
+ *((Tk_Style *) internalPtr) = NULL;
+ } else if (objPtr != NULL) {
+ Tk_FreeStyleFromObj(objPtr);
+ }
+ break;
+ case TK_OPTION_BITMAP:
+ if (internalFormExists) {
+ if (*((Pixmap *) internalPtr) != None) {
+ Tk_FreeBitmap(Tk_Display(tkwin), *((Pixmap *) internalPtr));
+ *((Pixmap *) internalPtr) = None;
+ }
+ } else if (objPtr != NULL) {
+ Tk_FreeBitmapFromObj(tkwin, objPtr);
+ }
+ break;
+ case TK_OPTION_BORDER:
+ if (internalFormExists) {
+ if (*((Tk_3DBorder *) internalPtr) != NULL) {
+ Tk_Free3DBorder(*((Tk_3DBorder *) internalPtr));
+ *((Tk_3DBorder *) internalPtr) = NULL;
+ }
+ } else if (objPtr != NULL) {
+ Tk_Free3DBorderFromObj(tkwin, objPtr);
+ }
+ break;
+ case TK_OPTION_CURSOR:
+ if (internalFormExists) {
+ if (*((Tk_Cursor *) internalPtr) != None) {
+ Tk_FreeCursor(Tk_Display(tkwin), *((Tk_Cursor *) internalPtr));
+ *((Tk_Cursor *) internalPtr) = None;
+ }
+ } else if (objPtr != NULL) {
+ Tk_FreeCursorFromObj(tkwin, objPtr);
+ }
+ break;
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ if (internalFormExists && custom->freeProc != NULL) {
+ custom->freeProc(custom->clientData, tkwin, internalPtr);
+ }
+ break;
+ }
+ default:
+ break;
}
}
@@ -1786,23 +1725,21 @@ FreeResources(optionPtr, objPtr, internalPtr, tkwin)
*
* Tk_GetOptionInfo --
*
- * Returns a list object containing complete information about
- * either a single option or all the configuration options in a
- * table.
+ * Returns a list object containing complete information about either a
+ * single option or all the configuration options in a table.
*
* Results:
- * This procedure normally returns a pointer to an object.
- * If namePtr isn't NULL, then the result object is a list with
- * five elements: the option's name, its database name, database
- * class, default value, and current value. If the option is a
- * synonym then the list will contain only two values: the option
- * name and the name of the option it refers to. If namePtr is
- * NULL, then information is returned for every option in the
- * option table: the result will have one sub-list (in the form
- * described above) for each option in the table. If an error
- * occurs (e.g. because namePtr isn't valid) then NULL is returned
- * and an error message will be left in interp's result unless
- * interp is NULL.
+
+ * This function normally returns a pointer to an object. If namePtr
+ * isn't NULL, then the result object is a list with five elements: the
+ * option's name, its database name, database class, default value, and
+ * current value. If the option is a synonym then the list will contain
+ * only two values: the option name and the name of the option it refers
+ * to. If namePtr is NULL, then information is returned for every option
+ * in the option table: the result will have one sub-list (in the form
+ * described above) for each option in the table. If an error occurs
+ * (e.g. because namePtr isn't valid) then NULL is returned and an error
+ * message will be left in interp's result unless interp is NULL.
*
* Side effects:
* None.
@@ -1811,18 +1748,18 @@ FreeResources(optionPtr, objPtr, internalPtr, tkwin)
*/
Tcl_Obj *
-Tk_GetOptionInfo(interp, recordPtr, optionTable, namePtr, tkwin)
- Tcl_Interp *interp; /* Interpreter for error reporting. If
- * NULL, then no error message is created. */
- char *recordPtr; /* Record whose fields contain current
- * values for options. */
- Tk_OptionTable optionTable; /* Describes all the legal options. */
- Tcl_Obj *namePtr; /* If non-NULL, the string value selects
- * a single option whose info is to be
- * returned. Otherwise info is returned for
- * all options in optionTable. */
- Tk_Window tkwin; /* Window associated with recordPtr; needed
- * to compute correct default value for some
+Tk_GetOptionInfo(
+ Tcl_Interp *interp, /* Interpreter for error reporting. If NULL,
+ * then no error message is created. */
+ char *recordPtr, /* Record whose fields contain current values
+ * for options. */
+ Tk_OptionTable optionTable, /* Describes all the legal options. */
+ Tcl_Obj *namePtr, /* If non-NULL, the string value selects a
+ * single option whose info is to be returned.
+ * Otherwise info is returned for all options
+ * in optionTable. */
+ Tk_Window tkwin) /* Window associated with recordPtr; needed to
+ * compute correct default value for some
* options. */
{
Tcl_Obj *resultPtr;
@@ -1831,14 +1768,14 @@ Tk_GetOptionInfo(interp, recordPtr, optionTable, namePtr, tkwin)
int count;
/*
- * If information is only wanted for a single configuration
- * spec, then handle that one spec specially.
+ * If information is only wanted for a single configuration spec, then
+ * handle that one spec specially.
*/
if (namePtr != NULL) {
optionPtr = GetOptionFromObj(interp, namePtr, tablePtr);
if (optionPtr == NULL) {
- return (Tcl_Obj *) NULL;
+ return NULL;
}
if (optionPtr->specPtr->type == TK_OPTION_SYNONYM) {
optionPtr = optionPtr->extra.synonymPtr;
@@ -1847,11 +1784,11 @@ Tk_GetOptionInfo(interp, recordPtr, optionTable, namePtr, tkwin)
}
/*
- * Loop through all the specs, creating a big list with all
- * their information.
+ * Loop through all the specs, creating a big list with all their
+ * information.
*/
- resultPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ resultPtr = Tcl_NewListObj(0, NULL);
for (; tablePtr != NULL; tablePtr = tablePtr->nextPtr) {
for (optionPtr = tablePtr->options, count = tablePtr->numOptions;
count > 0; optionPtr++, count--) {
@@ -1867,12 +1804,12 @@ Tk_GetOptionInfo(interp, recordPtr, optionTable, namePtr, tkwin)
*
* GetConfigList --
*
- * Create a valid Tcl list holding the configuration information
- * for a single configuration option.
+ * Create a valid Tcl list holding the configuration information for a
+ * single configuration option.
*
* Results:
- * A Tcl list, dynamically allocated. The caller is expected to
- * arrange for this list to be freed eventually.
+ * A Tcl list, dynamically allocated. The caller is expected to arrange
+ * for this list to be freed eventually.
*
* Side effects:
* Memory is allocated.
@@ -1881,37 +1818,37 @@ Tk_GetOptionInfo(interp, recordPtr, optionTable, namePtr, tkwin)
*/
static Tcl_Obj *
-GetConfigList(recordPtr, optionPtr, tkwin)
- char *recordPtr; /* Pointer to record holding current
- * values of configuration options. */
- Option *optionPtr; /* Pointer to information describing a
+GetConfigList(
+ char *recordPtr, /* Pointer to record holding current values of
+ * configuration options. */
+ Option *optionPtr, /* Pointer to information describing a
* particular option. */
- Tk_Window tkwin; /* Window corresponding to recordPtr. */
+ Tk_Window tkwin) /* Window corresponding to recordPtr. */
{
Tcl_Obj *listPtr, *elementPtr;
- listPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr,
+ listPtr = Tcl_NewListObj(0, NULL);
+ Tcl_ListObjAppendElement(NULL, listPtr,
Tcl_NewStringObj(optionPtr->specPtr->optionName, -1));
if (optionPtr->specPtr->type == TK_OPTION_SYNONYM) {
elementPtr = Tcl_NewStringObj(
optionPtr->extra.synonymPtr->specPtr->optionName, -1);
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr, elementPtr);
+ Tcl_ListObjAppendElement(NULL, listPtr, elementPtr);
} else {
if (optionPtr->dbNameUID == NULL) {
elementPtr = Tcl_NewObj();
} else {
elementPtr = Tcl_NewStringObj(optionPtr->dbNameUID, -1);
}
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr, elementPtr);
+ Tcl_ListObjAppendElement(NULL, listPtr, elementPtr);
if (optionPtr->dbClassUID == NULL) {
elementPtr = Tcl_NewObj();
} else {
elementPtr = Tcl_NewStringObj(optionPtr->dbClassUID, -1);
}
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr, elementPtr);
+ Tcl_ListObjAppendElement(NULL, listPtr, elementPtr);
if ((tkwin != NULL) && ((optionPtr->specPtr->type == TK_OPTION_COLOR)
|| (optionPtr->specPtr->type == TK_OPTION_BORDER))
@@ -1923,7 +1860,7 @@ GetConfigList(recordPtr, optionPtr, tkwin)
} else {
elementPtr = Tcl_NewObj();
}
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr, elementPtr);
+ Tcl_ListObjAppendElement(NULL, listPtr, elementPtr);
if (optionPtr->specPtr->objOffset >= 0) {
elementPtr = *((Tcl_Obj **) (recordPtr
@@ -1934,7 +1871,7 @@ GetConfigList(recordPtr, optionPtr, tkwin)
} else {
elementPtr = GetObjectForOption(recordPtr, optionPtr, tkwin);
}
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, listPtr, elementPtr);
+ Tcl_ListObjAppendElement(NULL, listPtr, elementPtr);
}
return listPtr;
}
@@ -1944,14 +1881,13 @@ GetConfigList(recordPtr, optionPtr, tkwin)
*
* GetObjectForOption --
*
- * This procedure is called to create an object that contains the
- * value for an option. It is invoked by GetConfigList and
- * Tk_GetOptionValue when only the internal form of an option is
- * stored in the record.
+ * This function is called to create an object that contains the value
+ * for an option. It is invoked by GetConfigList and Tk_GetOptionValue
+ * when only the internal form of an option is stored in the record.
*
* Results:
- * The return value is a pointer to a Tcl object. The caller
- * must call Tcl_IncrRefCount on this object to preserve it.
+ * The return value is a pointer to a Tcl object. The caller must call
+ * Tcl_IncrRefCount on this object to preserve it.
*
* Side effects:
* None.
@@ -1960,13 +1896,13 @@ GetConfigList(recordPtr, optionPtr, tkwin)
*/
static Tcl_Obj *
-GetObjectForOption(recordPtr, optionPtr, tkwin)
- char *recordPtr; /* Pointer to record holding current
- * values of configuration options. */
- Option *optionPtr; /* Pointer to information describing an
- * option whose internal value is stored
- * in *recordPtr. */
- Tk_Window tkwin; /* Window corresponding to recordPtr. */
+GetObjectForOption(
+ char *recordPtr, /* Pointer to record holding current values of
+ * configuration options. */
+ Option *optionPtr, /* Pointer to information describing an option
+ * whose internal value is stored in
+ * *recordPtr. */
+ Tk_Window tkwin) /* Window corresponding to recordPtr. */
{
Tcl_Obj *objPtr;
char *internalPtr; /* Points to internal value of option in
@@ -1975,107 +1911,103 @@ GetObjectForOption(recordPtr, optionPtr, tkwin)
internalPtr = recordPtr + optionPtr->specPtr->internalOffset;
objPtr = NULL;
switch (optionPtr->specPtr->type) {
- case TK_OPTION_BOOLEAN: {
- objPtr = Tcl_NewIntObj(*((int *) internalPtr));
- break;
- }
- case TK_OPTION_INT: {
- objPtr = Tcl_NewIntObj(*((int *) internalPtr));
- break;
- }
- case TK_OPTION_DOUBLE: {
- objPtr = Tcl_NewDoubleObj(*((double *) internalPtr));
- break;
+ case TK_OPTION_BOOLEAN:
+ objPtr = Tcl_NewIntObj(*((int *) internalPtr));
+ break;
+ case TK_OPTION_INT:
+ objPtr = Tcl_NewIntObj(*((int *) internalPtr));
+ break;
+ case TK_OPTION_DOUBLE:
+ objPtr = Tcl_NewDoubleObj(*((double *) internalPtr));
+ break;
+ case TK_OPTION_STRING:
+ objPtr = Tcl_NewStringObj(*((char **) internalPtr), -1);
+ break;
+ case TK_OPTION_STRING_TABLE:
+ objPtr = Tcl_NewStringObj(((char **) optionPtr->specPtr->clientData)[
+ *((int *) internalPtr)], -1);
+ break;
+ case TK_OPTION_COLOR: {
+ XColor *colorPtr = *((XColor **) internalPtr);
+
+ if (colorPtr != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfColor(colorPtr), -1);
+ }
+ break;
+ }
+ case TK_OPTION_FONT: {
+ Tk_Font tkfont = *((Tk_Font *) internalPtr);
+
+ if (tkfont != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfFont(tkfont), -1);
}
- case TK_OPTION_STRING: {
- objPtr = Tcl_NewStringObj(*((char **) internalPtr), -1);
- break;
+ break;
+ }
+ case TK_OPTION_STYLE: {
+ Tk_Style style = *((Tk_Style *) internalPtr);
+
+ if (style != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfStyle(style), -1);
}
- case TK_OPTION_STRING_TABLE: {
+ break;
+ }
+ case TK_OPTION_BITMAP: {
+ Pixmap pixmap = *((Pixmap *) internalPtr);
+
+ if (pixmap != None) {
objPtr = Tcl_NewStringObj(
- ((char **) optionPtr->specPtr->clientData)[
- *((int *) internalPtr)], -1);
- break;
- }
- case TK_OPTION_COLOR: {
- XColor *colorPtr = *((XColor **) internalPtr);
- if (colorPtr != NULL) {
- objPtr = Tcl_NewStringObj(Tk_NameOfColor(colorPtr), -1);
- }
- break;
- }
- case TK_OPTION_FONT: {
- Tk_Font tkfont = *((Tk_Font *) internalPtr);
- if (tkfont != NULL) {
- objPtr = Tcl_NewStringObj(Tk_NameOfFont(tkfont), -1);
- }
- break;
- }
- case TK_OPTION_STYLE: {
- Tk_Style style = *((Tk_Style *) internalPtr);
- if (style != NULL) {
- objPtr = Tcl_NewStringObj(Tk_NameOfStyle(style), -1);
- }
- break;
- }
- case TK_OPTION_BITMAP: {
- Pixmap pixmap = *((Pixmap *) internalPtr);
- if (pixmap != None) {
- objPtr = Tcl_NewStringObj(Tk_NameOfBitmap(Tk_Display(tkwin),
- pixmap), -1);
- }
- break;
- }
- case TK_OPTION_BORDER: {
- Tk_3DBorder border = *((Tk_3DBorder *) internalPtr);
- if (border != NULL) {
- objPtr = Tcl_NewStringObj(Tk_NameOf3DBorder(border), -1);
- }
- break;
- }
- case TK_OPTION_RELIEF: {
- objPtr = Tcl_NewStringObj(Tk_NameOfRelief(
- *((int *) internalPtr)), -1);
- break;
- }
- case TK_OPTION_CURSOR: {
- Tk_Cursor cursor = *((Tk_Cursor *) internalPtr);
- if (cursor != None) {
- objPtr = Tcl_NewStringObj(
- Tk_NameOfCursor(Tk_Display(tkwin), cursor), -1);
- }
- break;
+ Tk_NameOfBitmap(Tk_Display(tkwin), pixmap), -1);
}
- case TK_OPTION_JUSTIFY: {
- objPtr = Tcl_NewStringObj(Tk_NameOfJustify(
- *((Tk_Justify *) internalPtr)), -1);
- break;
- }
- case TK_OPTION_ANCHOR: {
- objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(
- *((Tk_Anchor *) internalPtr)), -1);
- break;
- }
- case TK_OPTION_PIXELS: {
- objPtr = Tcl_NewIntObj(*((int *) internalPtr));
- break;
- }
- case TK_OPTION_WINDOW: {
- Tk_Window tkwin = *((Tk_Window *) internalPtr);
- if (tkwin != NULL) {
- objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1);
- }
- break;
- }
- case TK_OPTION_CUSTOM: {
- Tk_ObjCustomOption *custom = optionPtr->extra.custom;
- objPtr = custom->getProc(custom->clientData, tkwin, recordPtr,
- optionPtr->specPtr->internalOffset);
- break;
+ break;
+ }
+ case TK_OPTION_BORDER: {
+ Tk_3DBorder border = *((Tk_3DBorder *) internalPtr);
+
+ if (border != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOf3DBorder(border), -1);
}
- default: {
- panic("bad option type in GetObjectForOption");
+ break;
+ }
+ case TK_OPTION_RELIEF:
+ objPtr = Tcl_NewStringObj(Tk_NameOfRelief(*((int *) internalPtr)), -1);
+ break;
+ case TK_OPTION_CURSOR: {
+ Tk_Cursor cursor = *((Tk_Cursor *) internalPtr);
+
+ if (cursor != None) {
+ objPtr = Tcl_NewStringObj(
+ Tk_NameOfCursor(Tk_Display(tkwin), cursor), -1);
}
+ break;
+ }
+ case TK_OPTION_JUSTIFY:
+ objPtr = Tcl_NewStringObj(Tk_NameOfJustify(
+ *((Tk_Justify *) internalPtr)), -1);
+ break;
+ case TK_OPTION_ANCHOR:
+ objPtr = Tcl_NewStringObj(Tk_NameOfAnchor(
+ *((Tk_Anchor *) internalPtr)), -1);
+ break;
+ case TK_OPTION_PIXELS:
+ objPtr = Tcl_NewIntObj(*((int *) internalPtr));
+ break;
+ case TK_OPTION_WINDOW: {
+ Tk_Window tkwin = *((Tk_Window *) internalPtr);
+
+ if (tkwin != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1);
+ }
+ break;
+ }
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+
+ objPtr = custom->getProc(custom->clientData, tkwin, recordPtr,
+ optionPtr->specPtr->internalOffset);
+ break;
+ }
+ default:
+ Tcl_Panic("bad option type in GetObjectForOption");
}
if (objPtr == NULL) {
objPtr = Tcl_NewObj();
@@ -2088,14 +2020,13 @@ GetObjectForOption(recordPtr, optionPtr, tkwin)
*
* Tk_GetOptionValue --
*
- * This procedure returns the current value of a configuration
- * option.
+ * This function returns the current value of a configuration option.
*
* Results:
- * The return value is the object holding the current value of
- * the option given by namePtr. If no such option exists, then
- * the return value is NULL and an error message is left in
- * interp's result (if interp isn't NULL).
+ * The return value is the object holding the current value of the option
+ * given by namePtr. If no such option exists, then the return value is
+ * NULL and an error message is left in interp's result (if interp isn't
+ * NULL).
*
* Side effects:
* None.
@@ -2104,16 +2035,16 @@ GetObjectForOption(recordPtr, optionPtr, tkwin)
*/
Tcl_Obj *
-Tk_GetOptionValue(interp, recordPtr, optionTable, namePtr, tkwin)
- Tcl_Interp *interp; /* Interpreter for error reporting. If
- * NULL then no messages are provided for
+Tk_GetOptionValue(
+ Tcl_Interp *interp, /* Interpreter for error reporting. If NULL
+ * then no messages are provided for
* errors. */
- char *recordPtr; /* Record whose fields contain current
- * values for options. */
- Tk_OptionTable optionTable; /* Describes legal options. */
- Tcl_Obj *namePtr; /* Gives the command-line name for the
- * option whose value is to be returned. */
- Tk_Window tkwin; /* Window corresponding to recordPtr. */
+ char *recordPtr, /* Record whose fields contain current values
+ * for options. */
+ Tk_OptionTable optionTable, /* Describes legal options. */
+ Tcl_Obj *namePtr, /* Gives the command-line name for the option
+ * whose value is to be returned. */
+ Tk_Window tkwin) /* Window corresponding to recordPtr. */
{
OptionTable *tablePtr = (OptionTable *) optionTable;
Option *optionPtr;
@@ -2127,16 +2058,16 @@ Tk_GetOptionValue(interp, recordPtr, optionTable, namePtr, tkwin)
optionPtr = optionPtr->extra.synonymPtr;
}
if (optionPtr->specPtr->objOffset >= 0) {
- resultPtr = *((Tcl_Obj **) (recordPtr + optionPtr->specPtr->objOffset));
+ resultPtr = *((Tcl_Obj **) (recordPtr+optionPtr->specPtr->objOffset));
if (resultPtr == NULL) {
/*
* This option has a null value and is represented by a null
- * object pointer. We can't return the null pointer, since that
- * would indicate an error. Instead, return a new empty object.
+ * object pointer. We can't return the null pointer, since that
+ * would indicate an error. Instead, return a new empty object.
*/
-
+
resultPtr = Tcl_NewObj();
- }
+ }
} else {
resultPtr = GetObjectForOption(recordPtr, optionPtr, tkwin);
}
@@ -2148,19 +2079,17 @@ Tk_GetOptionValue(interp, recordPtr, optionTable, namePtr, tkwin)
*
* TkDebugConfig --
*
- * This is a debugging procedure that returns information about
- * one of the configuration tables that currently exists for an
- * interpreter.
+ * This is a debugging function that returns information about one of the
+ * configuration tables that currently exists for an interpreter.
*
* Results:
- * If the specified table exists in the given interpreter, then a
- * list is returned describing the table and any other tables that
- * it chains to: for each table there will be three list elements
- * giving the reference count for the table, the number of elements
- * in the table, and the command-line name for the first option
- * in the table. If the table doesn't exist in the interpreter
- * then an empty object is returned. The reference count for the
- * returned object is 0.
+ * If the specified table exists in the given interpreter, then a list is
+ * returned describing the table and any other tables that it chains to:
+ * for each table there will be three list elements giving the reference
+ * count for the table, the number of elements in the table, and the
+ * command-line name for the first option in the table. If the table
+ * doesn't exist in the interpreter then an empty object is returned.
+ * The reference count for the returned object is 0.
*
* Side effects:
* None.
@@ -2169,12 +2098,12 @@ Tk_GetOptionValue(interp, recordPtr, optionTable, namePtr, tkwin)
*/
Tcl_Obj *
-TkDebugConfig(interp, table)
- Tcl_Interp *interp; /* Interpreter in which the table is
- * defined. */
- Tk_OptionTable table; /* Table about which information is to
- * be returned. May not necessarily
- * exist in the interpreter anymore. */
+TkDebugConfig(
+ Tcl_Interp *interp, /* Interpreter in which the table is
+ * defined. */
+ Tk_OptionTable table) /* Table about which information is to be
+ * returned. May not necessarily exist in the
+ * interpreter anymore. */
{
OptionTable *tablePtr = (OptionTable *) table;
Tcl_HashTable *hashTablePtr;
@@ -2190,8 +2119,8 @@ TkDebugConfig(interp, table)
}
/*
- * Scan all the tables for this interpreter to make sure that the
- * one we want still is valid.
+ * Scan all the tables for this interpreter to make sure that the one we
+ * want still is valid.
*/
for (hashEntryPtr = Tcl_FirstHashEntry(hashTablePtr, &search);
@@ -2199,17 +2128,23 @@ TkDebugConfig(interp, table)
hashEntryPtr = Tcl_NextHashEntry(&search)) {
if (tablePtr == (OptionTable *) Tcl_GetHashValue(hashEntryPtr)) {
for ( ; tablePtr != NULL; tablePtr = tablePtr->nextPtr) {
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr,
+ Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(tablePtr->refCount));
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr,
+ Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(tablePtr->numOptions));
- Tcl_ListObjAppendElement((Tcl_Interp *) NULL, objPtr,
- Tcl_NewStringObj(
- tablePtr->options[0].specPtr->optionName,
- -1));
+ Tcl_ListObjAppendElement(NULL, objPtr, Tcl_NewStringObj(
+ tablePtr->options[0].specPtr->optionName, -1));
}
break;
}
}
return objPtr;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 175f1c5..4091255 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -1,15 +1,14 @@
-/*
+/*
* tkConsole.c --
*
- * This file implements a Tcl console for systems that may not
- * otherwise have access to a console. It uses the Text widget
- * and provides special access via a console command.
+ * This file implements a Tcl console for systems that may not otherwise
+ * have access to a console. It uses the Text widget and provides special
+ * access via a console command.
*
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tk.h"
@@ -23,8 +22,8 @@
*/
typedef struct ConsoleInfo {
- Tcl_Interp *consoleInterp; /* Interpreter displaying the console. */
- Tcl_Interp *interp; /* Interpreter controlled by console. */
+ Tcl_Interp *consoleInterp; /* Interpreter displaying the console. */
+ Tcl_Interp *interp; /* Interpreter controlled by console. */
int refCount;
} ConsoleInfo;
@@ -40,30 +39,26 @@ typedef struct ChannelData {
int type; /* TCL_STDOUT or TCL_STDERR */
} ChannelData;
-/*
+/*
* Prototypes for local procedures defined in this file:
*/
-static int ConsoleClose _ANSI_ARGS_((ClientData instanceData,
- Tcl_Interp *interp));
-static void ConsoleDeleteProc _ANSI_ARGS_((ClientData clientData));
-static void ConsoleEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static int ConsoleHandle _ANSI_ARGS_((ClientData instandeData,
- int direction, ClientData *handlePtr));
-static int ConsoleInput _ANSI_ARGS_((ClientData instanceData,
- char *buf, int toRead, int *errorCode));
-static int ConsoleObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int ConsoleOutput _ANSI_ARGS_((ClientData instanceData,
- CONST char *buf, int toWrite, int *errorCode));
-static void ConsoleWatch _ANSI_ARGS_((ClientData instanceData,
- int mask));
-static void DeleteConsoleInterp _ANSI_ARGS_((ClientData clientData));
-static void InterpDeleteProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp));
-static int InterpreterObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+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 ConsoleObjCmd(ClientData clientData, Tcl_Interp *interp,
+ 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[]);
/*
* This structure describes the channel type structure for file based IO:
@@ -84,13 +79,11 @@ static Tcl_ChannelType consoleChannelType = {
NULL, /* Always non-blocking.*/
NULL, /* flush proc. */
NULL, /* handler proc. */
- NULL, /* wide seek proc */
- NULL, /* thread action proc */
+ NULL, /* wide seek proc */
+ NULL, /* thread action proc */
};
-
#ifdef __WIN32__
-
#include <windows.h>
/*
@@ -98,20 +91,21 @@ static Tcl_ChannelType consoleChannelType = {
*
* ShouldUseConsoleChannel
*
- * Check to see if console window should be used for a given
- * standard channel
+ * Check to see if console window should be used for a given standard
+ * channel.
*
* Results:
* None.
*
* Side effects:
- * Creates the console channel and installs it as the standard
- * channels.
+ * Creates the console channel and installs it as the standard channels.
*
*----------------------------------------------------------------------
*/
-static int ShouldUseConsoleChannel(type)
- int type;
+
+static int
+ShouldUseConsoleChannel(
+ int type)
{
DWORD handleId; /* Standard handle to retrieve. */
DCB dcb;
@@ -122,24 +116,24 @@ static int ShouldUseConsoleChannel(type)
HANDLE handle;
switch (type) {
- case TCL_STDIN:
- handleId = STD_INPUT_HANDLE;
- mode = TCL_READABLE;
- bufMode = "line";
- break;
- case TCL_STDOUT:
- handleId = STD_OUTPUT_HANDLE;
- mode = TCL_WRITABLE;
- bufMode = "line";
- break;
- case TCL_STDERR:
- handleId = STD_ERROR_HANDLE;
- mode = TCL_WRITABLE;
- bufMode = "none";
- break;
- default:
- return 0;
- break;
+ case TCL_STDIN:
+ handleId = STD_INPUT_HANDLE;
+ mode = TCL_READABLE;
+ bufMode = "line";
+ break;
+ case TCL_STDOUT:
+ handleId = STD_OUTPUT_HANDLE;
+ mode = TCL_WRITABLE;
+ bufMode = "line";
+ break;
+ case TCL_STDERR:
+ handleId = STD_ERROR_HANDLE;
+ mode = TCL_WRITABLE;
+ bufMode = "none";
+ break;
+ default:
+ return 0;
+ break;
}
handle = GetStdHandle(handleId);
@@ -147,7 +141,7 @@ static int ShouldUseConsoleChannel(type)
/*
* Note that we need to check for 0 because Windows will return 0 if this
* is not a console mode application, even though this is not a valid
- * handle.
+ * handle.
*/
if ((handle == INVALID_HANDLE_VALUE) || (handle == 0)) {
@@ -155,27 +149,27 @@ static int ShouldUseConsoleChannel(type)
}
/*
- * Win2K BUG: GetStdHandle(STD_OUTPUT_HANDLE) can return what appears
- * to be a valid handle. See TclpGetDefaultStdChannel() for this change
- * implemented. We didn't change it here because GetFileType() [below]
- * will catch this with FILE_TYPE_UNKNOWN and appropriately return a
- * value of 1, anyways.
+ * Win2K BUG: GetStdHandle(STD_OUTPUT_HANDLE) can return what appears to
+ * be a valid handle. See TclpGetDefaultStdChannel() for this change
+ * implemented. We didn't change it here because GetFileType() [below]
+ * will catch this with FILE_TYPE_UNKNOWN and appropriately return a value
+ * of 1, anyways.
*
* char dummyBuff[1];
* DWORD dummyWritten;
*
* if ((type == TCL_STDOUT)
- * && !WriteFile(handle, dummyBuff, 0, &dummyWritten, NULL)) {
- * return 1;
+ * && !WriteFile(handle, dummyBuff, 0, &dummyWritten, NULL)) {
+ * return 1;
* }
*/
fileType = GetFileType(handle);
/*
- * If the file is a character device, we need to try to figure out
- * whether it is a serial port, a console, or something else. We
- * test for the console case first because this is more common.
+ * If the file is a character device, we need to try to figure out whether
+ * it is a serial port, a console, or something else. We test for the
+ * console case first because this is more common.
*/
if (fileType == FILE_TYPE_CHAR) {
@@ -183,10 +177,10 @@ static int ShouldUseConsoleChannel(type)
if (!GetConsoleMode(handle, &consoleParams) &&
!GetCommState(handle, &dcb)) {
/*
- * Don't use a CHAR type channel for stdio, otherwise Tk
- * runs into trouble with the MS DevStudio debugger.
+ * Don't use a CHAR type channel for stdio, otherwise Tk runs into
+ * trouble with the MS DevStudio debugger.
*/
-
+
return 1;
}
} else if (fileType == FILE_TYPE_UNKNOWN) {
@@ -210,23 +204,22 @@ static int ShouldUseConsoleChannel(type)
*
* Tk_InitConsoleChannels --
*
- * Create the console channels and install them as the standard
- * channels. All I/O will be discarded until Tk_CreateConsoleWindow
- * is called to attach the console to a text widget.
+ * Create the console channels and install them as the standard channels.
+ * All I/O will be discarded until Tk_CreateConsoleWindow is called to
+ * attach the console to a text widget.
*
* Results:
* None.
*
* Side effects:
- * Creates the console channel and installs it as the standard
- * channels.
+ * Creates the console channel and installs it as the standard channels.
*
*----------------------------------------------------------------------
*/
void
-Tk_InitConsoleChannels(interp)
- Tcl_Interp *interp;
+Tk_InitConsoleChannels(
+ Tcl_Interp *interp)
{
static Tcl_ThreadDataKey consoleInitKey;
int *consoleInitPtr, doIn, doOut, doErr;
@@ -234,11 +227,11 @@ Tk_InitConsoleChannels(interp)
Tcl_Channel consoleChannel;
/*
- * Ensure that we are getting the matching version of Tcl. This is
- * really only an issue when Tk is loaded dynamically.
+ * Ensure that we are getting the matching version of Tcl. This is really
+ * only an issue when Tk is loaded dynamically.
*/
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return;
}
@@ -334,9 +327,9 @@ Tk_InitConsoleChannels(interp)
*
* Tk_CreateConsoleWindow --
*
- * Initialize the console. This code actually creates a new
- * application and associated interpreter. This effectivly hides
- * the implementation from the main application.
+ * Initialize the console. This code actually creates a new application
+ * and associated interpreter. This effectivly hides the implementation
+ * from the main application.
*
* Results:
* None.
@@ -347,9 +340,9 @@ Tk_InitConsoleChannels(interp)
*----------------------------------------------------------------------
*/
-int
-Tk_CreateConsoleWindow(interp)
- Tcl_Interp *interp; /* Interpreter to use for prompting. */
+int
+Tk_CreateConsoleWindow(
+ Tcl_Interp *interp) /* Interpreter to use for prompting. */
{
Tcl_Channel chan;
ConsoleInfo *info;
@@ -358,32 +351,26 @@ Tk_CreateConsoleWindow(interp)
int result = TCL_OK;
int haveConsoleChannel = 1;
-#ifdef MAC_TCL
- static const char *initCmd = "if {[catch {source $tk_library:console.tcl}]} {source -rsrc console}";
-#else
- static const char *initCmd = "source $tk_library/console.tcl";
-#endif
-
/* Init an interp with Tcl and Tk */
Tcl_Interp *consoleInterp = Tcl_CreateInterp();
if (Tcl_Init(consoleInterp) != TCL_OK) {
- goto error;
+ goto error;
}
if (Tk_Init(consoleInterp) != TCL_OK) {
goto error;
}
-
+
/*
* Fetch the instance data from whatever std channel is a
* console channel. If none, create fresh instance data.
*/
if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDIN))
- == &consoleChannelType) {
+ == &consoleChannelType) {
} else if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDOUT))
- == &consoleChannelType) {
+ == &consoleChannelType) {
} else if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDERR))
- == &consoleChannelType) {
+ == &consoleChannelType) {
} else {
haveConsoleChannel = 0;
}
@@ -430,14 +417,14 @@ Tk_CreateConsoleWindow(interp)
Tcl_CallWhenDeleted(consoleInterp, InterpDeleteProc, (ClientData) info);
info->refCount++;
Tcl_CreateThreadExitHandler(DeleteConsoleInterp,
- (ClientData) consoleInterp);
-
- /*
- * Add console commands to the interp
+ (ClientData) consoleInterp);
+
+ /*
+ * Add console commands to the interp
*/
token = Tcl_CreateObjCommand(interp, "console", ConsoleObjCmd,
- (ClientData) info, ConsoleDeleteProc);
+ (ClientData) info, ConsoleDeleteProc);
info->refCount++;
/*
@@ -456,22 +443,10 @@ Tk_CreateConsoleWindow(interp)
}
Tcl_Preserve((ClientData) consoleInterp);
- result = Tcl_GlobalEval(consoleInterp, initCmd);
+ result = Tcl_GlobalEval(consoleInterp, "source $tk_library/console.tcl");
if (result == TCL_ERROR) {
- Tcl_Obj *objPtr = Tcl_GetVar2Ex(consoleInterp, "errorCode", NULL,
- TCL_GLOBAL_ONLY);
- Tcl_ResetResult(interp);
- if (objPtr) {
- Tcl_SetObjErrorCode(interp, objPtr);
- }
-
- objPtr = Tcl_GetVar2Ex(consoleInterp, "errorInfo", NULL,
- TCL_GLOBAL_ONLY);
- if (objPtr) {
- int numBytes;
- CONST char *message = Tcl_GetStringFromObj(objPtr, &numBytes);
- Tcl_AddObjErrorInfo(interp, message, numBytes);
- }
+ Tcl_SetReturnOptions(interp,
+ Tcl_GetReturnOptions(consoleInterp, result));
Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp));
}
Tcl_Release((ClientData) consoleInterp);
@@ -488,7 +463,7 @@ Tk_CreateConsoleWindow(interp)
goto error;
}
return TCL_OK;
-
+
error:
Tcl_AddErrorInfo(interp, "\n (creating console window)");
if (!Tcl_InterpDeleted(consoleInterp)) {
@@ -502,12 +477,12 @@ Tk_CreateConsoleWindow(interp)
*
* ConsoleOutput--
*
- * Writes the given output on the IO channel. Returns count of how
- * many characters were actually written, and an error indication.
+ * Writes the given output on the IO channel. Returns count of how many
+ * characters were actually written, and an error indication.
*
* Results:
- * A count of how many characters were written is returned and an
- * error indication is returned in an output argument.
+ * A count of how many characters were written is returned and an error
+ * indication is returned in an output argument.
*
* Side effects:
* Writes output on the actual channel.
@@ -516,11 +491,11 @@ Tk_CreateConsoleWindow(interp)
*/
static int
-ConsoleOutput(instanceData, buf, toWrite, errorCode)
- ClientData instanceData; /* Indicates which device to use. */
- CONST char *buf; /* The data buffer. */
- int toWrite; /* How many bytes to write? */
- int *errorCode; /* Where to store error code. */
+ConsoleOutput(
+ ClientData instanceData, /* Indicates which device to use. */
+ CONST char *buf, /* The data buffer. */
+ int toWrite, /* How many bytes to write? */
+ int *errorCode) /* Where to store error code. */
{
ChannelData *data = (ChannelData *)instanceData;
ConsoleInfo *info = data->info;
@@ -572,7 +547,7 @@ ConsoleOutput(instanceData, buf, toWrite, errorCode)
*
* ConsoleInput --
*
- * Read input from the console. Not currently implemented.
+ * Read input from the console. Not currently implemented.
*
* Results:
* Always returns EOF.
@@ -585,12 +560,12 @@ ConsoleOutput(instanceData, buf, toWrite, errorCode)
/* ARGSUSED */
static int
-ConsoleInput(instanceData, buf, bufSize, errorCode)
- ClientData instanceData; /* Unused. */
- char *buf; /* Where to store data read. */
- int bufSize; /* How much space is available
- * in the buffer? */
- int *errorCode; /* Where to store error code. */
+ConsoleInput(
+ ClientData instanceData, /* Unused. */
+ char *buf, /* Where to store data read. */
+ int bufSize, /* How much space is available in the
+ * buffer? */
+ int *errorCode) /* Where to store error code. */
{
return 0; /* Always return EOF. */
}
@@ -613,9 +588,9 @@ ConsoleInput(instanceData, buf, bufSize, errorCode)
/* ARGSUSED */
static int
-ConsoleClose(instanceData, interp)
- ClientData instanceData; /* Unused. */
- Tcl_Interp *interp; /* Unused. */
+ConsoleClose(
+ ClientData instanceData, /* Unused. */
+ Tcl_Interp *interp) /* Unused. */
{
ChannelData *data = (ChannelData *)instanceData;
ConsoleInfo *info = data->info;
@@ -635,9 +610,9 @@ ConsoleClose(instanceData, interp)
*
* ConsoleWatch --
*
- * Called by the notifier to set up the console device so that
- * events will be noticed. Since there are no events on the
- * console, this routine just returns without doing anything.
+ * Called by the notifier to set up the console device so that events
+ * will be noticed. Since there are no events on the console, this
+ * routine just returns without doing anything.
*
* Results:
* None.
@@ -650,12 +625,11 @@ ConsoleClose(instanceData, interp)
/* ARGSUSED */
static void
-ConsoleWatch(instanceData, mask)
- ClientData instanceData; /* Device ID for the channel. */
- int mask; /* OR-ed combination of
- * TCL_READABLE, TCL_WRITABLE and
- * TCL_EXCEPTION, for the events
- * we are interested in. */
+ConsoleWatch(
+ ClientData instanceData, /* Device ID for the channel. */
+ int mask) /* OR-ed combination of TCL_READABLE,
+ * TCL_WRITABLE and TCL_EXCEPTION, for the
+ * events we are interested in. */
{
}
@@ -665,8 +639,7 @@ ConsoleWatch(instanceData, mask)
* ConsoleHandle --
*
* Invoked by the generic IO layer to get a handle from a channel.
- * Because console channels are not devices, this function always
- * fails.
+ * Because console channels are not devices, this function always fails.
*
* Results:
* Always returns TCL_ERROR.
@@ -679,12 +652,12 @@ ConsoleWatch(instanceData, mask)
/* ARGSUSED */
static int
-ConsoleHandle(instanceData, direction, handlePtr)
- ClientData instanceData; /* Device ID for the channel. */
- int direction; /* TCL_READABLE or TCL_WRITABLE to indicate
+ConsoleHandle(
+ ClientData instanceData, /* Device ID for the channel. */
+ int direction, /* TCL_READABLE or TCL_WRITABLE to indicate
* which direction of the channel is being
* requested. */
- ClientData *handlePtr; /* Where to store handle */
+ ClientData *handlePtr) /* Where to store handle */
{
return TCL_ERROR;
}
@@ -707,11 +680,11 @@ ConsoleHandle(instanceData, direction, handlePtr)
*/
static int
-ConsoleObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Access to the console interp */
- Tcl_Interp *interp; /* Current interpreter */
- int objc; /* Number of arguments */
- Tcl_Obj *CONST objv[]; /* Argument objects */
+ConsoleObjCmd(
+ ClientData clientData, /* Access to the console interp */
+ Tcl_Interp *interp, /* Current interpreter */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[]) /* Argument objects */
{
int index, result;
static CONST char *options[] = {"eval", "hide", "show", "title", NULL};
@@ -767,22 +740,8 @@ ConsoleObjCmd(clientData, interp, objc, objv)
if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) {
Tcl_Preserve((ClientData) consoleInterp);
result = Tcl_GlobalEvalObj(consoleInterp, cmd);
- if (result == TCL_ERROR) {
- Tcl_Obj *objPtr = Tcl_GetVar2Ex(consoleInterp, "errorCode",
- NULL, TCL_GLOBAL_ONLY);
- Tcl_ResetResult(interp);
- if (objPtr) {
- Tcl_SetObjErrorCode(interp, objPtr);
- }
-
- objPtr = Tcl_GetVar2Ex(consoleInterp, "errorInfo",
- NULL, TCL_GLOBAL_ONLY);
- if (objPtr) {
- int numBytes;
- CONST char *message = Tcl_GetStringFromObj(objPtr, &numBytes);
- Tcl_AddObjErrorInfo(interp, message, numBytes);
- }
- }
+ Tcl_SetReturnOptions(interp,
+ Tcl_GetReturnOptions(consoleInterp, result));
Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp));
Tcl_Release((ClientData) consoleInterp);
} else {
@@ -798,8 +757,8 @@ ConsoleObjCmd(clientData, interp, objc, objv)
*
* InterpreterObjCmd --
*
- * This command allows the console interp to communicate with the
- * main interpreter.
+ * This command allows the console interp to communicate with the main
+ * interpreter.
*
* Results:
* A standard Tcl result.
@@ -808,11 +767,11 @@ ConsoleObjCmd(clientData, interp, objc, objv)
*/
static int
-InterpreterObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Not used */
- Tcl_Interp *interp; /* Current interpreter */
- int objc; /* Number of arguments */
- Tcl_Obj *CONST objv[]; /* Argument objects */
+InterpreterObjCmd(
+ ClientData clientData, /* */
+ Tcl_Interp *interp, /* Current interpreter */
+ int objc, /* Number of arguments */
+ Tcl_Obj *CONST objv[]) /* Argument objects */
{
int index, result = TCL_OK;
static CONST char *options[] = {"eval", "record", NULL};
@@ -825,7 +784,7 @@ InterpreterObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &index)
- != TCL_OK) {
+ != TCL_OK) {
return TCL_ERROR;
}
@@ -842,30 +801,16 @@ InterpreterObjCmd(clientData, interp, objc, objv)
Tcl_Preserve((ClientData) otherInterp);
switch ((enum option) index) {
case OTHER_EVAL:
- result = Tcl_GlobalEvalObj(otherInterp, objv[2]);
+ result = Tcl_GlobalEvalObj(otherInterp, objv[2]);
/*
* TODO: Should exceptions be filtered here?
*/
- if (result == TCL_ERROR) {
- Tcl_Obj *objPtr = Tcl_GetVar2Ex(otherInterp, "errorCode",
- NULL, TCL_GLOBAL_ONLY);
- Tcl_ResetResult(interp);
- if (objPtr) {
- Tcl_SetObjErrorCode(interp, objPtr);
- }
-
- objPtr = Tcl_GetVar2Ex(otherInterp, "errorInfo",
- NULL, TCL_GLOBAL_ONLY);
- if (objPtr) {
- int numBytes;
- CONST char *message = Tcl_GetStringFromObj(objPtr, &numBytes);
- Tcl_AddObjErrorInfo(interp, message, numBytes);
- }
- }
+ 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);
+ 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
@@ -890,8 +835,8 @@ InterpreterObjCmd(clientData, interp, objc, objv)
*/
static void
-DeleteConsoleInterp(clientData)
- ClientData clientData;
+DeleteConsoleInterp(
+ ClientData clientData)
{
Tcl_Interp *interp = (Tcl_Interp *)clientData;
Tcl_DeleteInterp(interp);
@@ -902,23 +847,28 @@ DeleteConsoleInterp(clientData)
*
* 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.
+ *
+ * Side effects:
+ * A new console it created.
+ *
+ *----------------------------------------------------------------------
*/
static void
-InterpDeleteProc(clientData, interp)
- ClientData clientData;
- Tcl_Interp *interp;
+InterpDeleteProc(
+ ClientData clientData,
+ Tcl_Interp *interp)
{
ConsoleInfo *info = (ConsoleInfo *) clientData;
- if(info->consoleInterp == interp) {
+ if (info->consoleInterp == interp) {
Tcl_DeleteThreadExitHandler(DeleteConsoleInterp,
- (ClientData) info-> consoleInterp);
+ (ClientData) info->consoleInterp);
info->consoleInterp = NULL;
}
if (--info->refCount <= 0) {
@@ -932,20 +882,20 @@ InterpDeleteProc(clientData, interp)
* ConsoleDeleteProc --
*
* If the console command is deleted we destroy the console window and
- * all associated data structures.
-
+ * all associated data structures.
+ *
* Results:
* None.
*
* Side effects:
- * A new console is created.
+ * A new console it created.
*
*----------------------------------------------------------------------
*/
static void
-ConsoleDeleteProc(clientData)
- ClientData clientData;
+ConsoleDeleteProc(
+ ClientData clientData)
{
ConsoleInfo *info = (ConsoleInfo *) clientData;
@@ -962,10 +912,11 @@ ConsoleDeleteProc(clientData)
*
* ConsoleEventProc --
*
- * This event function is registered on the main window of the slave
- * interpreter. If the user or a running script causes the main window to
- * be destroyed, then we need to inform the console interpreter by
+ * This event function is registered on the main window of the slave
+ * interpreter. If the user or a running script causes the main window to
+ * be destroyed, then we need to inform the console interpreter by
* invoking "::tk::ConsoleExit".
+ *
* Results:
* None.
*
@@ -976,9 +927,9 @@ ConsoleDeleteProc(clientData)
*/
static void
-ConsoleEventProc(clientData, eventPtr)
- ClientData clientData;
- XEvent *eventPtr;
+ConsoleEventProc(
+ ClientData clientData,
+ XEvent *eventPtr)
{
if (eventPtr->type == DestroyNotify) {
ConsoleInfo *info = (ConsoleInfo *) clientData;
@@ -993,3 +944,11 @@ ConsoleEventProc(clientData, eventPtr)
}
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index 466d0ef..606a349 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -1,52 +1,50 @@
-/*
+/*
* tkCursor.c --
*
* This file maintains a database of read-only cursors for the Tk
- * toolkit. This allows cursors to be shared between widgets and
- * also avoids round-trips to the X server.
+ * toolkit. This allows cursors to be shared between widgets and also
+ * avoids round-trips to the X server.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
- * A TkCursor structure exists for each cursor that is currently
- * active. Each structure is indexed with two hash tables defined
- * below. One of the tables is cursorIdTable, and the other is either
- * cursorNameTable or cursorDataTable, each of which are stored in the
- * TkDisplay structure for the current thread.
+ * A TkCursor structure exists for each cursor that is currently active. Each
+ * structure is indexed with two hash tables defined below. One of the tables
+ * is cursorIdTable, and the other is either cursorNameTable or
+ * cursorDataTable, each of which are stored in the TkDisplay structure for
+ * the current thread.
*/
typedef struct {
CONST char *source; /* Cursor bits. */
CONST char *mask; /* Mask bits. */
- int width, height; /* Dimensions of cursor (and data
- * and mask). */
+ int width, height; /* Dimensions of cursor (and data and
+ * mask). */
int xHot, yHot; /* Location of cursor hot-spot. */
Tk_Uid fg, bg; /* Colors for cursor. */
Display *display; /* Display on which cursor will be used. */
} DataKey;
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void CursorInit _ANSI_ARGS_((TkDisplay *dispPtr));
-static void DupCursorObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
- Tcl_Obj *dupObjPtr));
-static void FreeCursor _ANSI_ARGS_((TkCursor *cursorPtr));
-static void FreeCursorObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
-static TkCursor * TkcGetCursor _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *name));
-static TkCursor * GetCursorFromObj _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj *objPtr));
-static void InitCursorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void CursorInit(TkDisplay *dispPtr);
+static void DupCursorObjProc(Tcl_Obj *srcObjPtr,
+ Tcl_Obj *dupObjPtr);
+static void FreeCursor(TkCursor *cursorPtr);
+static void FreeCursorObjProc(Tcl_Obj *objPtr);
+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);
/*
* The following structure defines the implementation of the "cursor" Tcl
@@ -69,33 +67,32 @@ Tcl_ObjType tkCursorObjType = {
*
* Tk_AllocCursorFromObj --
*
- * Given a Tcl_Obj *, map the value to a corresponding
- * Tk_Cursor structure based on the tkwin given.
+ * Given a Tcl_Obj *, map the value to a corresponding Tk_Cursor
+ * structure based on the tkwin given.
*
* Results:
- * The return value is the X identifer for the desired cursor,
- * unless objPtr couldn't be parsed correctly. In this case,
- * None is returned and an error message is left in the interp's result.
- * The caller should never modify the cursor that is returned, and
- * should eventually call Tk_FreeCursorFromObj when the cursor is no
- * longer needed.
+ * The return value is the X identifer for the desired cursor, unless
+ * objPtr couldn't be parsed correctly. In this case, None is returned
+ * and an error message is left in the interp's result. The caller should
+ * never modify the cursor that is returned, and should eventually call
+ * Tk_FreeCursorFromObj when the cursor is no longer needed.
*
* Side effects:
* The cursor is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeCursorFromObj, so that the database can be cleaned up
- * when cursors aren't needed anymore.
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeCursorFromObj, so that the database can be cleaned up when
+ * cursors aren't needed anymore.
*
*----------------------------------------------------------------------
*/
Tk_Cursor
-Tk_AllocCursorFromObj(interp, tkwin, objPtr)
- Tcl_Interp *interp; /* Interp for error results. */
- Tk_Window tkwin; /* Window in which the cursor will be used.*/
- Tcl_Obj *objPtr; /* Object describing cursor; see manual
- * entry for description of legal
- * syntax of this obj's string rep. */
+Tk_AllocCursorFromObj(
+ Tcl_Interp *interp, /* Interp for error results. */
+ Tk_Window tkwin, /* Window in which the cursor will be used.*/
+ Tcl_Obj *objPtr) /* Object describing cursor; see manual entry
+ * for description of legal syntax of this
+ * obj's string rep. */
{
TkCursor *cursorPtr;
@@ -105,16 +102,17 @@ Tk_AllocCursorFromObj(interp, tkwin, objPtr)
cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
/*
- * If the object currently points to a TkCursor, see if it's the
- * one we want. If so, increment its reference count and return.
+ * If the object currently points to a TkCursor, see if it's the one we
+ * want. If so, increment its reference count and return.
*/
if (cursorPtr != NULL) {
if (cursorPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a TkCursor that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a TkCursor that's no
+ * longer in use. Clear the reference.
*/
+
FreeCursorObjProc(objPtr);
cursorPtr = NULL;
} else if (Tk_Display(tkwin) == cursorPtr->display) {
@@ -124,38 +122,37 @@ Tk_AllocCursorFromObj(interp, tkwin, objPtr)
}
/*
- * The object didn't point to the TkCursor that we wanted. Search
- * the list of TkCursors with the same name to see if one of the
- * other TkCursors is the right one.
+ * The object didn't point to the TkCursor that we wanted. Search the list
+ * of TkCursors with the same name to see if one of the other TkCursors is
+ * the right one.
*/
if (cursorPtr != NULL) {
- TkCursor *firstCursorPtr =
- (TkCursor *) Tcl_GetHashValue(cursorPtr->hashPtr);
+ TkCursor *firstCursorPtr = (TkCursor *)
+ Tcl_GetHashValue(cursorPtr->hashPtr);
FreeCursorObjProc(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 = (void *) cursorPtr;
return cursorPtr->cursor;
}
}
}
/*
- * Still no luck. Call TkcGetCursor to allocate a new TkCursor object.
+ * Still no luck. Call TkcGetCursor to allocate a new TkCursor object.
*/
cursorPtr = TkcGetCursor(interp, tkwin, Tcl_GetString(objPtr));
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) cursorPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
if (cursorPtr == NULL) {
return None;
- } else {
- cursorPtr->objRefCount++;
- return cursorPtr->cursor;
}
+ cursorPtr->objRefCount++;
+ return cursorPtr->cursor;
}
/*
@@ -163,32 +160,31 @@ Tk_AllocCursorFromObj(interp, tkwin, objPtr)
*
* Tk_GetCursor --
*
- * Given a string describing a cursor, locate (or create if necessary)
- * a cursor that fits the description.
+ * Given a string describing a cursor, locate (or create if necessary) a
+ * cursor that fits the description.
*
* Results:
- * The return value is the X identifer for the desired cursor,
- * unless string couldn't be parsed correctly. In this case,
- * None is returned and an error message is left in the interp's result.
- * The caller should never modify the cursor that is returned, and
- * should eventually call Tk_FreeCursor when the cursor is no longer
- * needed.
+ * The return value is the X identifer for the desired cursor, unless
+ * string couldn't be parsed correctly. In this case, None is returned
+ * and an error message is left in the interp's result. The caller should
+ * never modify the cursor that is returned, and should eventually call
+ * Tk_FreeCursor when the cursor is no longer needed.
*
* Side effects:
* The cursor is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeCursor, so that the database can be cleaned up when cursors
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeCursor, so that the database can be cleaned up when cursors
* aren't needed anymore.
*
*----------------------------------------------------------------------
*/
Tk_Cursor
-Tk_GetCursor(interp, tkwin, string)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- Tk_Window tkwin; /* Window in which cursor will be used. */
- Tk_Uid string; /* Description of cursor. See manual entry
- * for details on legal syntax. */
+Tk_GetCursor(
+ 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. */
{
TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string);
if (cursorPtr == NULL) {
@@ -202,48 +198,47 @@ Tk_GetCursor(interp, tkwin, string)
*
* TkcGetCursor --
*
- * Given a string describing a cursor, locate (or create if necessary)
- * a cursor that fits the description. This routine returns the
- * internal data structure for the cursor, which avoids extra
- * hash table lookups in Tk_AllocCursorFromObj.
+ * Given a string describing a cursor, locate (or create if necessary) a
+ * cursor that fits the description. This routine returns the internal
+ * data structure for the cursor, which avoids extra hash table lookups
+ * in Tk_AllocCursorFromObj.
*
* Results:
- * The return value is a pointer to the TkCursor for the desired
- * cursor, unless string couldn't be parsed correctly. In this
- * case, NULL is returned and an error message is left in the
- * interp's result. The caller should never modify the cursor that
- * is returned, and should eventually call Tk_FreeCursor when the
- * cursor is no longer needed.
+ * The return value is a pointer to the TkCursor for the desired cursor,
+ * unless string couldn't be parsed correctly. In this case, NULL is
+ * returned and an error message is left in the interp's result. The
+ * caller should never modify the cursor that is returned, and should
+ * eventually call Tk_FreeCursor when the cursor is no longer needed.
*
* Side effects:
* The cursor is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeCursor, so that the database can be cleaned up when cursors
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeCursor, so that the database can be cleaned up when cursors
* aren't needed anymore.
*
*----------------------------------------------------------------------
*/
static TkCursor *
-TkcGetCursor(interp, tkwin, string)
- 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 details on legal syntax. */
+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
+ * details on legal syntax. */
{
Tcl_HashEntry *nameHashPtr;
register TkCursor *cursorPtr;
TkCursor *existingCursorPtr = NULL;
- int new;
+ int isNew;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (!dispPtr->cursorInit) {
CursorInit(dispPtr);
}
- nameHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorNameTable,
- string, &new);
- if (!new) {
+ nameHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorNameTable,
+ string, &isNew);
+ if (!isNew) {
existingCursorPtr = (TkCursor *) Tcl_GetHashValue(nameHashPtr);
for (cursorPtr = existingCursorPtr; cursorPtr != NULL;
cursorPtr = cursorPtr->nextPtr) {
@@ -259,7 +254,7 @@ TkcGetCursor(interp, tkwin, string)
cursorPtr = TkGetCursorByName(interp, tkwin, string);
if (cursorPtr == NULL) {
- if (new) {
+ if (isNew) {
Tcl_DeleteHashEntry(nameHashPtr);
}
return NULL;
@@ -275,10 +270,10 @@ TkcGetCursor(interp, tkwin, string)
cursorPtr->otherTable = &dispPtr->cursorNameTable;
cursorPtr->hashPtr = nameHashPtr;
cursorPtr->nextPtr = existingCursorPtr;
- cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
- (char *) cursorPtr->cursor, &new);
- if (!new) {
- panic("cursor already registered in Tk_GetCursor");
+ cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
+ (char *) cursorPtr->cursor, &isNew);
+ if (!isNew) {
+ Tcl_Panic("cursor already registered in Tk_GetCursor");
}
Tcl_SetHashValue(nameHashPtr, cursorPtr);
Tcl_SetHashValue(cursorPtr->idHashPtr, cursorPtr);
@@ -291,46 +286,43 @@ TkcGetCursor(interp, tkwin, string)
*
* Tk_GetCursorFromData --
*
- * Given a description of the bits and colors for a cursor,
- * make a cursor that has the given properties.
+ * Given a description of the bits and colors for a cursor, make a cursor
+ * that has the given properties.
*
* Results:
- * The return value is the X identifer for the desired cursor,
- * unless it couldn't be created properly. In this case, None is
- * returned and an error message is left in the interp's result. The
- * caller should never modify the cursor that is returned, and
- * should eventually call Tk_FreeCursor when the cursor is no
- * longer needed.
+ * The return value is the X identifer for the desired cursor, unless it
+ * couldn't be created properly. In this case, None is returned and an
+ * error message is left in the interp's result. The caller should never
+ * modify the cursor that is returned, and should eventually call
+ * Tk_FreeCursor when the cursor is no longer needed.
*
* Side effects:
* The cursor is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeCursor, so that the database can be cleaned up when cursors
+ * For each call to this function, there should eventually be a call to
+ * Tk_FreeCursor, so that the database can be cleaned up when cursors
* aren't needed anymore.
*
*----------------------------------------------------------------------
*/
Tk_Cursor
-Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
- xHot, yHot, fg, bg)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- Tk_Window tkwin; /* Window in which cursor will be used. */
- CONST char *source; /* Bitmap data for cursor shape. */
- CONST char *mask; /* Bitmap data for cursor mask. */
- int width, height; /* Dimensions of cursor. */
- int xHot, yHot; /* Location of hot-spot in cursor. */
- Tk_Uid fg; /* Foreground color for cursor. */
- Tk_Uid bg; /* Background color for 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. */
+ int width, int height, /* Dimensions of cursor. */
+ int xHot, int yHot, /* Location of hot-spot in cursor. */
+ Tk_Uid fg, /* Foreground color for cursor. */
+ Tk_Uid bg) /* Background color for cursor. */
{
DataKey dataKey;
Tcl_HashEntry *dataHashPtr;
register TkCursor *cursorPtr;
- int new;
+ int isNew;
XColor fgColor, bgColor;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
-
if (!dispPtr->cursorInit) {
CursorInit(dispPtr);
}
@@ -344,27 +336,25 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
dataKey.fg = fg;
dataKey.bg = bg;
dataKey.display = Tk_Display(tkwin);
- dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable,
- (char *) &dataKey, &new);
- if (!new) {
+ dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable,
+ (char *) &dataKey, &isNew);
+ if (!isNew) {
cursorPtr = (TkCursor *) Tcl_GetHashValue(dataHashPtr);
cursorPtr->resourceRefCount++;
return cursorPtr->cursor;
}
/*
- * No suitable cursor exists yet. Make one using the data
- * available and add it to the database.
+ * No suitable cursor exists yet. Make one using the data available and
+ * add it to the database.
*/
if (XParseColor(dataKey.display, Tk_Colormap(tkwin), fg, &fgColor) == 0) {
- Tcl_AppendResult(interp, "invalid color name \"", fg, "\"",
- (char *) NULL);
+ Tcl_AppendResult(interp, "invalid color name \"", fg, "\"", NULL);
goto error;
}
if (XParseColor(dataKey.display, Tk_Colormap(tkwin), bg, &bgColor) == 0) {
- Tcl_AppendResult(interp, "invalid color name \"", bg, "\"",
- (char *) NULL);
+ Tcl_AppendResult(interp, "invalid color name \"", bg, "\"", NULL);
goto error;
}
@@ -379,18 +369,18 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
cursorPtr->otherTable = &dispPtr->cursorDataTable;
cursorPtr->hashPtr = dataHashPtr;
cursorPtr->objRefCount = 0;
- cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
- (char *) cursorPtr->cursor, &new);
+ cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
+ (char *) cursorPtr->cursor, &isNew);
cursorPtr->nextPtr = NULL;
- if (!new) {
- panic("cursor already registered in Tk_GetCursorFromData");
+ if (!isNew) {
+ Tcl_Panic("cursor already registered in Tk_GetCursorFromData");
}
Tcl_SetHashValue(dataHashPtr, cursorPtr);
Tcl_SetHashValue(cursorPtr->idHashPtr, cursorPtr);
return cursorPtr->cursor;
- error:
+ error:
Tcl_DeleteHashEntry(dataHashPtr);
return None;
}
@@ -403,12 +393,11 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
* Given a cursor, return a textual string identifying it.
*
* Results:
- * If cursor was created by Tk_GetCursor, then the return
- * value is the "string" that was used to create it.
- * Otherwise the return value is a string giving the X
- * identifier for the cursor. The storage for the returned
- * string is only guaranteed to persist up until the next
- * call to this procedure.
+ * If cursor was created by Tk_GetCursor, then the return value is the
+ * "string" that was used to create it. Otherwise the return value is a
+ * string giving the X identifier for the cursor. The storage for the
+ * returned string is only guaranteed to persist up until the next call
+ * to this function.
*
* Side effects:
* None.
@@ -417,9 +406,9 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
*/
CONST char *
-Tk_NameOfCursor(display, cursor)
- Display *display; /* Display for which cursor was allocated. */
- Tk_Cursor cursor; /* Identifier for cursor whose name is
+Tk_NameOfCursor(
+ Display *display, /* Display for which cursor was allocated. */
+ Tk_Cursor cursor) /* Identifier for cursor whose name is
* wanted. */
{
Tcl_HashEntry *idHashPtr;
@@ -429,9 +418,8 @@ Tk_NameOfCursor(display, cursor)
dispPtr = TkGetDisplay(display);
if (!dispPtr->cursorInit) {
- printid:
- sprintf(dispPtr->cursorString, "cursor id 0x%x",
- (unsigned int) cursor);
+ printid:
+ sprintf(dispPtr->cursorString, "cursor id %p", cursor);
return dispPtr->cursorString;
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->cursorIdTable, (char *) cursor);
@@ -450,23 +438,22 @@ Tk_NameOfCursor(display, cursor)
*
* FreeCursor --
*
- * This procedure is invoked by both Tk_FreeCursor and
- * Tk_FreeCursorFromObj; it does all the real work of deallocating
- * a cursor.
+ * This function is invoked by both Tk_FreeCursorFromObj and
+ * Tk_FreeCursor; it does all the real work of deallocating a cursor.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with cursor is decremented, and
- * it is officially deallocated if no-one is using it anymore.
+ * The reference count associated with cursor is decremented, and it is
+ * officially deallocated if no-one is using it anymore.
*
*----------------------------------------------------------------------
*/
static void
-FreeCursor(cursorPtr)
- TkCursor *cursorPtr; /* Cursor to be released. */
+FreeCursor(
+ TkCursor *cursorPtr) /* Cursor to be released. */
{
TkCursor *prevPtr;
@@ -500,34 +487,34 @@ FreeCursor(cursorPtr)
*
* Tk_FreeCursor --
*
- * This procedure is called to release a cursor allocated by
- * Tk_GetCursor or TkGetCursorFromData.
+ * This function is called to release a cursor allocated by Tk_GetCursor
+ * or TkGetCursorFromData.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with cursor is decremented, and
- * it is officially deallocated if no-one is using it anymore.
+ * The reference count associated with cursor is decremented, and it is
+ * officially deallocated if no-one is using it anymore.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeCursor(display, cursor)
- Display *display; /* Display for which cursor was allocated. */
- Tk_Cursor cursor; /* Identifier for cursor to be released. */
+Tk_FreeCursor(
+ Display *display, /* Display for which cursor was allocated. */
+ Tk_Cursor cursor) /* Identifier for cursor to be released. */
{
Tcl_HashEntry *idHashPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
if (!dispPtr->cursorInit) {
- panic("Tk_FreeCursor called before Tk_GetCursor");
+ Tcl_Panic("Tk_FreeCursor called before Tk_GetCursor");
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->cursorIdTable, (char *) cursor);
if (idHashPtr == NULL) {
- panic("Tk_FreeCursor received unknown cursor argument");
+ Tcl_Panic("Tk_FreeCursor received unknown cursor argument");
}
FreeCursor((TkCursor *) Tcl_GetHashValue(idHashPtr));
}
@@ -537,27 +524,27 @@ Tk_FreeCursor(display, cursor)
*
* Tk_FreeCursorFromObj --
*
- * This procedure is called to release a cursor allocated by
- * Tk_AllocCursorFromObj. It does not throw away the Tcl_Obj *;
- * it only gets rid of the hash table entry for this cursor
- * and clears the cached value that is normally stored in the object.
+ * This function is called to release a cursor allocated by
+ * Tk_AllocCursorFromObj. It does not throw away the Tcl_Obj *; it only
+ * gets rid of the hash table entry for this cursor and clears the cached
+ * value that is normally stored in the object.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with the cursor represented by
- * objPtr is decremented, and the cursor is released to X if there are
- * no remaining uses for it.
+ * The reference count associated with the cursor represented by objPtr
+ * is decremented, and the cursor is released to X if there are no
+ * remaining uses for it.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeCursorFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window this cursor lives in. Needed
- * for the display value. */
- Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+Tk_FreeCursorFromObj(
+ Tk_Window tkwin, /* The window this cursor lives in. Needed for
+ * the display value. */
+ Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
FreeCursor(GetCursorFromObj(tkwin, objPtr));
FreeCursorObjProc(objPtr);
@@ -566,66 +553,65 @@ Tk_FreeCursorFromObj(tkwin, objPtr)
/*
*---------------------------------------------------------------------------
*
- * FreeCursorFromObjProc --
+ * FreeCursorFromObjProc --
*
* 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 tkColPtr needs to be changed.
+ * Called when the object's internal rep is released or when the cached
+ * tkColPtr needs to be changed.
*
* Results:
* None.
*
* Side effects:
- * The object reference count is decremented. When both it
- * and the hash ref count go to zero, the color's resources
- * are released.
+ * The object reference count is decremented. When both it and the hash
+ * ref count go to zero, the color's resources are released.
*
*---------------------------------------------------------------------------
*/
static void
-FreeCursorObjProc(objPtr)
- Tcl_Obj *objPtr; /* The object we are releasing. */
+FreeCursorObjProc(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
{
TkCursor *cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
if (cursorPtr != NULL) {
cursorPtr->objRefCount--;
- if ((cursorPtr->objRefCount == 0)
+ if ((cursorPtr->objRefCount == 0)
&& (cursorPtr->resourceRefCount == 0)) {
ckfree((char *) cursorPtr);
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
}
/*
*---------------------------------------------------------------------------
*
- * DupCursorObjProc --
+ * DupCursorObjProc --
*
- * When a cached cursor object is duplicated, this is called to
- * update the internal reps.
+ * When a cached cursor object is duplicated, this is called to update
+ * the internal reps.
*
* Results:
* None.
*
* Side effects:
- * The color's objRefCount is incremented and the internal rep
- * of the copy is set to point to it.
+ * The color's objRefCount is incremented and the internal rep of the
+ * copy is set to point to it.
*
*---------------------------------------------------------------------------
*/
static void
-DupCursorObjProc(srcObjPtr, dupObjPtr)
- Tcl_Obj *srcObjPtr; /* The object we are copying from. */
- Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+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;
-
+
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (VOID *) cursorPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
if (cursorPtr != NULL) {
cursorPtr->objRefCount++;
@@ -638,27 +624,31 @@ DupCursorObjProc(srcObjPtr, dupObjPtr)
* Tk_GetCursorFromObj --
*
* Returns the cursor referred to buy a Tcl object. The cursor must
- * already have been allocated via a call to Tk_AllocCursorFromObj or
+ * already have been allocated via a call to Tk_AllocCursorFromObj or
* Tk_GetCursor.
*
* Results:
- * Returns the Tk_Cursor that matches the tkwin and the string rep
- * of the name of the cursor given in objPtr.
+ * Returns the Tk_Cursor that matches the tkwin and the string rep of the
+ * name of the cursor given in objPtr.
*
* Side effects:
- * If the object is not already a cursor, the conversion will free
- * any old internal representation.
+ * If the object is not already a cursor, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
Tk_Cursor
-Tk_GetCursorFromObj(tkwin, objPtr)
- Tk_Window tkwin;
- Tcl_Obj *objPtr; /* The object from which to get pixels. */
+Tk_GetCursorFromObj(
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr) /* The object from which to get pixels. */
{
TkCursor *cursorPtr = GetCursorFromObj(tkwin, objPtr);
- /* GetCursorFromObj should never return NULL */
+
+ /*
+ * GetCursorFromObj should never return NULL
+ */
+
return cursorPtr->cursor;
}
@@ -667,25 +657,25 @@ Tk_GetCursorFromObj(tkwin, objPtr)
*
* GetCursorFromObj --
*
- * Returns the cursor referred to by a Tcl object. The cursor must
- * already have been allocated via a call to Tk_AllocCursorFromObj
- * or Tk_GetCursor.
+ * Returns the cursor referred to by a Tcl object. The cursor must
+ * already have been allocated via a call to Tk_AllocCursorFromObj or
+ * Tk_GetCursor.
*
* Results:
- * Returns the TkCursor * that matches the tkwin and the string rep
- * of the name of the cursor given in objPtr.
+ * Returns the TkCursor * that matches the tkwin and the string rep of
+ * the name of the cursor given in objPtr.
*
* Side effects:
- * If the object is not already a cursor, the conversion will free
- * any old internal representation.
+ * If the object is not already a cursor, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
static TkCursor *
-GetCursorFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* Window in which the cursor will be used. */
- Tcl_Obj *objPtr; /* The object that describes the desired
+GetCursorFromObj(
+ Tk_Window tkwin, /* Window in which the cursor will be used. */
+ Tcl_Obj *objPtr) /* The object that describes the desired
* cursor. */
{
TkCursor *cursorPtr;
@@ -697,11 +687,12 @@ GetCursorFromObj(tkwin, objPtr)
}
/*
- * The internal representation is a cache of the last cursor used
- * with the given name. But there can be lots different cursors
- * for each cursor name; one cursor for each display. Check to
- * see if the cursor we have cached is the one that is needed.
+ * The internal representation is a cache of the last cursor used with the
+ * given name. But there can be lots different cursors for each cursor
+ * name; one cursor for each display. Check to see if the cursor we have
+ * cached is the one that is needed.
*/
+
cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
if ((cursorPtr != NULL) && (Tk_Display(tkwin) == cursorPtr->display)) {
return cursorPtr;
@@ -721,14 +712,14 @@ GetCursorFromObj(tkwin, objPtr)
cursorPtr != NULL; cursorPtr = cursorPtr->nextPtr) {
if (Tk_Display(tkwin) == cursorPtr->display) {
FreeCursorObjProc(objPtr);
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) cursorPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr;
cursorPtr->objRefCount++;
return cursorPtr;
}
}
- error:
- panic("GetCursorFromObj called with non-existent cursor!");
+ error:
+ Tcl_Panic("GetCursorFromObj called with non-existent cursor!");
/*
* The following code isn't reached; it's just there to please compilers.
*/
@@ -740,27 +731,27 @@ GetCursorFromObj(tkwin, objPtr)
*
* InitCursorObj --
*
- * Bookeeping procedure to change an objPtr to a cursor type.
+ * Bookeeping function to change an objPtr to a cursor type.
*
* Results:
* None.
*
* Side effects:
- * The old internal rep of the object is freed. The internal
- * rep is cleared. The final form of the object is set
- * by either Tk_AllocCursorFromObj or GetCursorFromObj.
+ * The old internal rep of the object is freed. The internal rep is
+ * cleared. The final form of the object is set by either
+ * Tk_AllocCursorFromObj or GetCursorFromObj.
*
*----------------------------------------------------------------------
*/
static void
-InitCursorObj(objPtr)
- Tcl_Obj *objPtr; /* The object to convert. */
+InitCursorObj(
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetString(objPtr);
@@ -769,7 +760,7 @@ InitCursorObj(objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
objPtr->typePtr = &tkCursorObjType;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
}
/*
@@ -789,26 +780,26 @@ InitCursorObj(objPtr)
*/
static void
-CursorInit(dispPtr)
- TkDisplay *dispPtr; /* Display used to store thread-specific data. */
+CursorInit(
+ TkDisplay *dispPtr) /* Display used to store thread-specific
+ * data. */
{
Tcl_InitHashTable(&dispPtr->cursorNameTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&dispPtr->cursorDataTable, sizeof(DataKey)/sizeof(int));
/*
- * The call below is tricky: can't use sizeof(IdKey) because it
- * gets padded with extra unpredictable bytes on some 64-bit
- * machines.
+ * The call below is tricky: can't use sizeof(IdKey) because it gets
+ * padded with extra unpredictable bytes on some 64-bit machines.
*/
- /*
- * Old code....
- * Tcl_InitHashTable(&dispPtr->cursorIdTable, sizeof(Display *)
+ /*
+ * Old code....
+ * Tcl_InitHashTable(&dispPtr->cursorIdTable, sizeof(Display *)
* /sizeof(int));
*
- * The comment above doesn't make sense.
- * However, XIDs should only be 32 bits, by the definition of X,
- * so the code above causes Tk to crash. Here is the real code:
+ * The comment above doesn't make sense. However, XIDs should only be 32
+ * bits, by the definition of X, so the code above causes Tk to crash.
+ * Here is the real code:
*/
Tcl_InitHashTable(&dispPtr->cursorIdTable, TCL_ONE_WORD_KEYS);
@@ -821,13 +812,13 @@ CursorInit(dispPtr)
*
* TkDebugCursor --
*
- * This procedure returns debugging information about a cursor.
+ * This function returns debugging information about a cursor.
*
* Results:
* The return value is a list with one sublist for each TkCursor
- * corresponding to "name". Each sublist has two elements that
- * contain the resourceRefCount and objRefCount fields from the
- * TkCursor structure.
+ * corresponding to "name". Each sublist has two elements that contain
+ * the resourceRefCount and objRefCount fields from the TkCursor
+ * structure.
*
* Side effects:
* None.
@@ -836,10 +827,10 @@ CursorInit(dispPtr)
*/
Tcl_Obj *
-TkDebugCursor(tkwin, name)
- Tk_Window tkwin; /* The window in which the cursor will be
- * used (not currently used). */
- char *name; /* Name of the desired color. */
+TkDebugCursor(
+ Tk_Window tkwin, /* The window in which the cursor will be used
+ * (not currently used). */
+ char *name) /* Name of the desired color. */
{
TkCursor *cursorPtr;
Tcl_HashEntry *hashPtr;
@@ -854,16 +845,24 @@ TkDebugCursor(tkwin, name)
if (hashPtr != NULL) {
cursorPtr = (TkCursor *) Tcl_GetHashValue(hashPtr);
if (cursorPtr == NULL) {
- panic("TkDebugCursor found empty hash table entry");
+ Tcl_Panic("TkDebugCursor found empty hash table entry");
}
for ( ; (cursorPtr != NULL); cursorPtr = cursorPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(cursorPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(cursorPtr->objRefCount));
+ Tcl_NewIntObj(cursorPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
return resultPtr;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkDecls.h b/generic/tkDecls.h
index 4584dac..d06df4b 100644
--- a/generic/tkDecls.h
+++ b/generic/tkDecls.h
@@ -29,891 +29,1651 @@
* Exported function declarations:
*/
+#ifndef Tk_MainLoop_TCL_DECLARED
+#define Tk_MainLoop_TCL_DECLARED
/* 0 */
-EXTERN void Tk_MainLoop _ANSI_ARGS_((void));
+EXTERN void Tk_MainLoop(void);
+#endif
+#ifndef Tk_3DBorderColor_TCL_DECLARED
+#define Tk_3DBorderColor_TCL_DECLARED
/* 1 */
-EXTERN XColor * Tk_3DBorderColor _ANSI_ARGS_((Tk_3DBorder border));
+EXTERN XColor * Tk_3DBorderColor(Tk_3DBorder border);
+#endif
+#ifndef Tk_3DBorderGC_TCL_DECLARED
+#define Tk_3DBorderGC_TCL_DECLARED
/* 2 */
-EXTERN GC Tk_3DBorderGC _ANSI_ARGS_((Tk_Window tkwin,
- Tk_3DBorder border, int which));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border, int x,
- int y, int width, int height, int leftIn,
- int rightIn, int topBevel, int relief));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border, int x,
- int y, int width, int height, int leftBevel,
- int relief));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * name, CONST char * value,
- int priority));
+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
/* 6 */
-EXTERN void Tk_BindEvent _ANSI_ARGS_((
- Tk_BindingTable bindingTable,
- XEvent * eventPtr, Tk_Window tkwin,
- int numObjects, ClientData * objectPtr));
+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 _ANSI_ARGS_((
- Tk_Canvas canvas, double x, double y,
- short * drawableXPtr, short * drawableYPtr));
+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 _ANSI_ARGS_((
- Tk_Canvas canvas, int x1, int y1, int x2,
- int y2));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, CONST char * str,
- double * doublePtr));
+EXTERN int Tk_CanvasGetCoord(Tcl_Interp *interp,
+ 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 _ANSI_ARGS_((
- Tk_Canvas canvas));
+EXTERN Tk_CanvasTextInfo * Tk_CanvasGetTextInfo(Tk_Canvas canvas);
+#endif
+#ifndef Tk_CanvasPsBitmap_TCL_DECLARED
+#define Tk_CanvasPsBitmap_TCL_DECLARED
/* 11 */
-EXTERN int Tk_CanvasPsBitmap _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, Pixmap bitmap, int x,
- int y, int width, int height));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, XColor * colorPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, Tk_Font font));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, double * coordPtr,
- int numPoints));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, Pixmap bitmap));
+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 _ANSI_ARGS_((Tk_Canvas canvas, double y));
+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 _ANSI_ARGS_((
- Tk_Canvas canvas, GC gc));
+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 _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * value,
- char * widgRec, int offset));
+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
/* 19 */
-EXTERN char * Tk_CanvasTagsPrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char * widgRec, int offset,
- Tcl_FreeProc ** freeProcPtr));
+EXTERN 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 _ANSI_ARGS_((Tk_Canvas canvas));
+EXTERN Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas);
+#endif
+#ifndef Tk_CanvasWindowCoords_TCL_DECLARED
+#define Tk_CanvasWindowCoords_TCL_DECLARED
/* 21 */
-EXTERN void Tk_CanvasWindowCoords _ANSI_ARGS_((Tk_Canvas canvas,
- double x, double y, short * screenXPtr,
- short * screenYPtr));
+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 _ANSI_ARGS_((
- Tk_Window tkwin, unsigned long valueMask,
- XSetWindowAttributes * attsPtr));
+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 _ANSI_ARGS_((Tk_TextLayout layout,
- int index, int * xPtr, int * yPtr,
- int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Atom selection));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Atom target, Atom format,
- char* buffer));
+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
/* 26 */
-EXTERN int Tk_ClipboardClear _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_ConfigSpec * specs,
- char * widgRec, CONST char * argvName,
- int flags));
+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
/* 28 */
-EXTERN int Tk_ConfigureValue _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_ConfigSpec * specs,
- char * widgRec, CONST char * argvName,
- int flags));
+EXTERN int Tk_ConfigureValue(Tcl_Interp *interp,
+ Tk_Window tkwin, 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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_ConfigSpec * specs,
- int argc, CONST84 char ** argv,
- char * widgRec, int flags));
+EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp,
+ Tk_Window tkwin, 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 _ANSI_ARGS_((Tk_Window tkwin,
- unsigned int valueMask,
- XWindowChanges * valuePtr));
+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 _ANSI_ARGS_((Tk_Font font,
- CONST char * str, int numChars,
- int wrapLength, Tk_Justify justify,
- int flags, int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((int rootX, int rootY,
- Tk_Window tkwin));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_BindingTable bindingTable,
- ClientData object, CONST char * eventStr,
- CONST char * command, int append));
+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
/* 34 */
-EXTERN Tk_BindingTable Tk_CreateBindingTable _ANSI_ARGS_((
- Tcl_Interp * interp));
+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 _ANSI_ARGS_((Display * display,
- int errNum, int request, int minorCode,
- Tk_ErrorProc * errorProc,
- ClientData clientData));
+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 _ANSI_ARGS_((Tk_Window token,
- unsigned long mask, Tk_EventProc * proc,
- ClientData clientData));
+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 _ANSI_ARGS_((
- Tk_GenericProc * proc, ClientData clientData));
+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 _ANSI_ARGS_((
- Tk_ImageType * typePtr));
+EXTERN void Tk_CreateImageType(Tk_ImageType *typePtr);
+#endif
+#ifndef Tk_CreateItemType_TCL_DECLARED
+#define Tk_CreateItemType_TCL_DECLARED
/* 39 */
-EXTERN void Tk_CreateItemType _ANSI_ARGS_((Tk_ItemType * typePtr));
+EXTERN void Tk_CreateItemType(Tk_ItemType *typePtr);
+#endif
+#ifndef Tk_CreatePhotoImageFormat_TCL_DECLARED
+#define Tk_CreatePhotoImageFormat_TCL_DECLARED
/* 40 */
-EXTERN void Tk_CreatePhotoImageFormat _ANSI_ARGS_((
- Tk_PhotoImageFormat * formatPtr));
+EXTERN void Tk_CreatePhotoImageFormat(
+ Tk_PhotoImageFormat *formatPtr);
+#endif
+#ifndef Tk_CreateSelHandler_TCL_DECLARED
+#define Tk_CreateSelHandler_TCL_DECLARED
/* 41 */
-EXTERN void Tk_CreateSelHandler _ANSI_ARGS_((Tk_Window tkwin,
- Atom selection, Atom target,
- Tk_SelectionProc * proc,
- ClientData clientData, Atom format));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window parent, CONST char * name,
- CONST char * screenName));
+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
/* 43 */
-EXTERN Tk_Window Tk_CreateWindowFromPath _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- CONST char * pathName,
- CONST char * screenName));
+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
/* 44 */
-EXTERN int Tk_DefineBitmap _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * name, CONST char * source,
- int width, int height));
+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
/* 45 */
-EXTERN void Tk_DefineCursor _ANSI_ARGS_((Tk_Window window,
- Tk_Cursor cursor));
+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 _ANSI_ARGS_((
- Tk_BindingTable bindingTable,
- ClientData object));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_BindingTable bindingTable,
- ClientData object, CONST char * eventStr));
+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
/* 48 */
-EXTERN void Tk_DeleteBindingTable _ANSI_ARGS_((
- Tk_BindingTable bindingTable));
+EXTERN void Tk_DeleteBindingTable(Tk_BindingTable bindingTable);
+#endif
+#ifndef Tk_DeleteErrorHandler_TCL_DECLARED
+#define Tk_DeleteErrorHandler_TCL_DECLARED
/* 49 */
-EXTERN void Tk_DeleteErrorHandler _ANSI_ARGS_((
- Tk_ErrorHandler handler));
+EXTERN void Tk_DeleteErrorHandler(Tk_ErrorHandler handler);
+#endif
+#ifndef Tk_DeleteEventHandler_TCL_DECLARED
+#define Tk_DeleteEventHandler_TCL_DECLARED
/* 50 */
-EXTERN void Tk_DeleteEventHandler _ANSI_ARGS_((Tk_Window token,
- unsigned long mask, Tk_EventProc * proc,
- ClientData clientData));
+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 _ANSI_ARGS_((
- Tk_GenericProc * proc, ClientData clientData));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * name));
+EXTERN void Tk_DeleteImage(Tcl_Interp *interp, CONST char *name);
+#endif
+#ifndef Tk_DeleteSelHandler_TCL_DECLARED
+#define Tk_DeleteSelHandler_TCL_DECLARED
/* 53 */
-EXTERN void Tk_DeleteSelHandler _ANSI_ARGS_((Tk_Window tkwin,
- Atom selection, Atom target));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+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 _ANSI_ARGS_((
- Tk_TextLayout layout, int x, int y));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border,
- XPoint * pointPtr, int numPoints,
- int borderWidth, int leftRelief));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border, int x,
- int y, int width, int height,
- int borderWidth, int relief));
+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 _ANSI_ARGS_((Display * display,
- Drawable drawable, GC gc, Tk_Font tkfont,
- CONST char * source, int numBytes, int x,
- int y));
+EXTERN void Tk_DrawChars(Display *display, Drawable drawable,
+ 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 _ANSI_ARGS_((Tk_Window tkwin,
- GC gc, int width, Drawable drawable));
+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 _ANSI_ARGS_((Display * display,
- Drawable drawable, GC gc,
- Tk_TextLayout layout, int x, int y,
- int firstChar, int lastChar));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border,
- XPoint * pointPtr, int numPoints,
- int borderWidth, int leftRelief));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Drawable drawable, Tk_3DBorder border, int x,
- int y, int width, int height,
- int borderWidth, int relief));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * imageName));
+EXTERN Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp,
+ CONST char *imageName);
+#endif
+#ifndef Tk_FontId_TCL_DECLARED
+#define Tk_FontId_TCL_DECLARED
/* 65 */
-EXTERN Font Tk_FontId _ANSI_ARGS_((Tk_Font font));
+EXTERN Font Tk_FontId(Tk_Font font);
+#endif
+#ifndef Tk_Free3DBorder_TCL_DECLARED
+#define Tk_Free3DBorder_TCL_DECLARED
/* 66 */
-EXTERN void Tk_Free3DBorder _ANSI_ARGS_((Tk_3DBorder border));
+EXTERN void Tk_Free3DBorder(Tk_3DBorder border);
+#endif
+#ifndef Tk_FreeBitmap_TCL_DECLARED
+#define Tk_FreeBitmap_TCL_DECLARED
/* 67 */
-EXTERN void Tk_FreeBitmap _ANSI_ARGS_((Display * display,
- Pixmap bitmap));
+EXTERN void Tk_FreeBitmap(Display *display, Pixmap bitmap);
+#endif
+#ifndef Tk_FreeColor_TCL_DECLARED
+#define Tk_FreeColor_TCL_DECLARED
/* 68 */
-EXTERN void Tk_FreeColor _ANSI_ARGS_((XColor * colorPtr));
+EXTERN void Tk_FreeColor(XColor *colorPtr);
+#endif
+#ifndef Tk_FreeColormap_TCL_DECLARED
+#define Tk_FreeColormap_TCL_DECLARED
/* 69 */
-EXTERN void Tk_FreeColormap _ANSI_ARGS_((Display * display,
- Colormap colormap));
+EXTERN void Tk_FreeColormap(Display *display, Colormap colormap);
+#endif
+#ifndef Tk_FreeCursor_TCL_DECLARED
+#define Tk_FreeCursor_TCL_DECLARED
/* 70 */
-EXTERN void Tk_FreeCursor _ANSI_ARGS_((Display * display,
- Tk_Cursor cursor));
+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 _ANSI_ARGS_((Tk_Font f));
+EXTERN void Tk_FreeFont(Tk_Font f);
+#endif
+#ifndef Tk_FreeGC_TCL_DECLARED
+#define Tk_FreeGC_TCL_DECLARED
/* 72 */
-EXTERN void Tk_FreeGC _ANSI_ARGS_((Display * display, GC gc));
+EXTERN void Tk_FreeGC(Display *display, GC gc);
+#endif
+#ifndef Tk_FreeImage_TCL_DECLARED
+#define Tk_FreeImage_TCL_DECLARED
/* 73 */
-EXTERN void Tk_FreeImage _ANSI_ARGS_((Tk_Image image));
+EXTERN void Tk_FreeImage(Tk_Image image);
+#endif
+#ifndef Tk_FreeOptions_TCL_DECLARED
+#define Tk_FreeOptions_TCL_DECLARED
/* 74 */
-EXTERN void Tk_FreeOptions _ANSI_ARGS_((Tk_ConfigSpec * specs,
- char * widgRec, Display * display,
- int needFlags));
+EXTERN void Tk_FreeOptions(Tk_ConfigSpec *specs, char *widgRec,
+ Display *display, int needFlags);
+#endif
+#ifndef Tk_FreePixmap_TCL_DECLARED
+#define Tk_FreePixmap_TCL_DECLARED
/* 75 */
-EXTERN void Tk_FreePixmap _ANSI_ARGS_((Display * display,
- Pixmap pixmap));
+EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap);
+#endif
+#ifndef Tk_FreeTextLayout_TCL_DECLARED
+#define Tk_FreeTextLayout_TCL_DECLARED
/* 76 */
-EXTERN void Tk_FreeTextLayout _ANSI_ARGS_((
- Tk_TextLayout textLayout));
+EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout);
+#endif
+#ifndef Tk_FreeXId_TCL_DECLARED
+#define Tk_FreeXId_TCL_DECLARED
/* 77 */
-EXTERN void Tk_FreeXId _ANSI_ARGS_((Display * display, XID xid));
+EXTERN void Tk_FreeXId(Display *display, XID xid);
+#endif
+#ifndef Tk_GCForColor_TCL_DECLARED
+#define Tk_GCForColor_TCL_DECLARED
/* 78 */
-EXTERN GC Tk_GCForColor _ANSI_ARGS_((XColor * colorPtr,
- Drawable drawable));
+EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable);
+#endif
+#ifndef Tk_GeometryRequest_TCL_DECLARED
+#define Tk_GeometryRequest_TCL_DECLARED
/* 79 */
-EXTERN void Tk_GeometryRequest _ANSI_ARGS_((Tk_Window tkwin,
- int reqWidth, int reqHeight));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_Uid colorName));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_BindingTable bindingTable,
- ClientData object));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * str, Tk_Anchor * anchorPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Atom atom));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_BindingTable bindingTable,
- ClientData object, CONST char * eventStr));
+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
/* 85 */
-EXTERN Pixmap Tk_GetBitmap _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str));
+EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *str);
+#endif
+#ifndef Tk_GetBitmapFromData_TCL_DECLARED
+#define Tk_GetBitmapFromData_TCL_DECLARED
/* 86 */
-EXTERN Pixmap Tk_GetBitmapFromData _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- CONST char * source, int width, int height));
+EXTERN Pixmap Tk_GetBitmapFromData(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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * str, int * capPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_Uid name));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- XColor * colorPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str));
+EXTERN Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *str);
+#endif
+#ifndef Tk_GetCursor_TCL_DECLARED
+#define Tk_GetCursor_TCL_DECLARED
/* 91 */
-EXTERN Tk_Cursor Tk_GetCursor _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_Uid str));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- CONST char * source, CONST char * mask,
- int width, int height, int xHot, int yHot,
- Tk_Uid fg, Tk_Uid bg));
+EXTERN 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);
+#endif
+#ifndef Tk_GetFont_TCL_DECLARED
+#define Tk_GetFont_TCL_DECLARED
/* 93 */
-EXTERN Tk_Font Tk_GetFont _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str));
+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
/* 94 */
-EXTERN Tk_Font Tk_GetFontFromObj _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Font font,
- Tk_FontMetrics * fmPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- unsigned long valueMask,
- XGCValues * valuePtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * name,
- Tk_ImageChangedProc * changeProc,
- ClientData clientData));
+EXTERN Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *name,
+ Tk_ImageChangedProc *changeProc,
+ ClientData clientData);
+#endif
+#ifndef Tk_GetImageMasterData_TCL_DECLARED
+#define Tk_GetImageMasterData_TCL_DECLARED
/* 98 */
-EXTERN ClientData Tk_GetImageMasterData _ANSI_ARGS_((
- Tcl_Interp * interp, CONST char * name,
- Tk_ImageType ** typePtrPtr));
+EXTERN ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
+ CONST char *name, Tk_ImageType **typePtrPtr);
+#endif
+#ifndef Tk_GetItemTypes_TCL_DECLARED
+#define Tk_GetItemTypes_TCL_DECLARED
/* 99 */
-EXTERN Tk_ItemType * Tk_GetItemTypes _ANSI_ARGS_((void));
+EXTERN Tk_ItemType * Tk_GetItemTypes(void);
+#endif
+#ifndef Tk_GetJoinStyle_TCL_DECLARED
+#define Tk_GetJoinStyle_TCL_DECLARED
/* 100 */
-EXTERN int Tk_GetJoinStyle _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * str, int * joinPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * str, Tk_Justify * justifyPtr));
+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 _ANSI_ARGS_((void));
+EXTERN int Tk_GetNumMainWindows(void);
+#endif
+#ifndef Tk_GetOption_TCL_DECLARED
+#define Tk_GetOption_TCL_DECLARED
/* 103 */
-EXTERN Tk_Uid Tk_GetOption _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * name, CONST char * className));
+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
/* 104 */
-EXTERN int Tk_GetPixels _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str,
- int * intPtr));
+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
/* 105 */
-EXTERN Pixmap Tk_GetPixmap _ANSI_ARGS_((Display * display,
- Drawable d, int width, int height, int depth));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * name, int * reliefPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int * xPtr, int * yPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- int argc, CONST84 char ** argv,
- double * dblPtr, int * intPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str,
- double * doublePtr));
+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
/* 110 */
-EXTERN int Tk_GetSelection _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Atom selection, Atom target,
- Tk_GetSelProc * proc, ClientData clientData));
+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 _ANSI_ARGS_((CONST char * str));
+EXTERN Tk_Uid Tk_GetUid(CONST char *str);
+#endif
+#ifndef Tk_GetVisual_TCL_DECLARED
+#define Tk_GetVisual_TCL_DECLARED
/* 112 */
-EXTERN Visual * Tk_GetVisual _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * str,
- int * depthPtr, Colormap * colormapPtr));
+EXTERN Visual * Tk_GetVisual(Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *str, int *depthPtr,
+ Colormap *colormapPtr);
+#endif
+#ifndef Tk_GetVRootGeometry_TCL_DECLARED
+#define Tk_GetVRootGeometry_TCL_DECLARED
/* 113 */
-EXTERN void Tk_GetVRootGeometry _ANSI_ARGS_((Tk_Window tkwin,
- int * xPtr, int * yPtr, int * widthPtr,
- int * heightPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, int grabGlobal));
+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 _ANSI_ARGS_((XEvent * eventPtr));
+EXTERN void Tk_HandleEvent(XEvent *eventPtr);
+#endif
+#ifndef Tk_IdToWindow_TCL_DECLARED
+#define Tk_IdToWindow_TCL_DECLARED
/* 116 */
-EXTERN Tk_Window Tk_IdToWindow _ANSI_ARGS_((Display * display,
- Window window));
+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 _ANSI_ARGS_((Tk_ImageMaster master,
- int x, int y, int width, int height,
- int imageWidth, int imageHeight));
+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 _ANSI_ARGS_((Tcl_Interp * interp));
+EXTERN int Tk_Init(Tcl_Interp *interp);
+#endif
+#ifndef Tk_InternAtom_TCL_DECLARED
+#define Tk_InternAtom_TCL_DECLARED
/* 119 */
-EXTERN Atom Tk_InternAtom _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * name));
+EXTERN Atom Tk_InternAtom(Tk_Window tkwin, CONST char *name);
+#endif
+#ifndef Tk_IntersectTextLayout_TCL_DECLARED
+#define Tk_IntersectTextLayout_TCL_DECLARED
/* 120 */
-EXTERN int Tk_IntersectTextLayout _ANSI_ARGS_((
- Tk_TextLayout layout, int x, int y,
- int width, int height));
+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 _ANSI_ARGS_((Tk_Window slave,
- Tk_Window master, int x, int y, int width,
- int height));
+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 _ANSI_ARGS_((Tcl_Interp * interp));
+EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp);
+#endif
+#ifndef Tk_MakeWindowExist_TCL_DECLARED
+#define Tk_MakeWindowExist_TCL_DECLARED
/* 123 */
-EXTERN void Tk_MakeWindowExist _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void Tk_MakeWindowExist(Tk_Window tkwin);
+#endif
+#ifndef Tk_ManageGeometry_TCL_DECLARED
+#define Tk_ManageGeometry_TCL_DECLARED
/* 124 */
-EXTERN void Tk_ManageGeometry _ANSI_ARGS_((Tk_Window tkwin,
- Tk_GeomMgr * mgrPtr, ClientData clientData));
+EXTERN void Tk_ManageGeometry(Tk_Window tkwin,
+ CONST Tk_GeomMgr *mgrPtr,
+ ClientData clientData);
+#endif
+#ifndef Tk_MapWindow_TCL_DECLARED
+#define Tk_MapWindow_TCL_DECLARED
/* 125 */
-EXTERN void Tk_MapWindow _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void Tk_MapWindow(Tk_Window tkwin);
+#endif
+#ifndef Tk_MeasureChars_TCL_DECLARED
+#define Tk_MeasureChars_TCL_DECLARED
/* 126 */
-EXTERN int Tk_MeasureChars _ANSI_ARGS_((Tk_Font tkfont,
- CONST char * source, int numBytes,
- int maxPixels, int flags, int * lengthPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int x, int y, int width, int height));
+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 _ANSI_ARGS_((Tk_Window tkwin, int x,
- int y));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int x, int y));
+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 _ANSI_ARGS_((
- Tk_3DBorder border));
+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 _ANSI_ARGS_((Tk_Anchor anchor));
+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 _ANSI_ARGS_((Display * display,
- Pixmap bitmap));
+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 _ANSI_ARGS_((int cap));
+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 _ANSI_ARGS_((XColor * colorPtr));
+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 _ANSI_ARGS_((Display * display,
- Tk_Cursor cursor));
+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 _ANSI_ARGS_((Tk_Font font));
+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 _ANSI_ARGS_((
- Tk_ImageMaster imageMaster));
+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 _ANSI_ARGS_((int join));
+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 _ANSI_ARGS_((
- Tk_Justify justify));
+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 _ANSI_ARGS_((int relief));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * pathName, Tk_Window tkwin));
+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
/* 142 */
-EXTERN void Tk_OwnSelection _ANSI_ARGS_((Tk_Window tkwin,
- Atom selection, Tk_LostSelProc * proc,
- ClientData clientData));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, int * argcPtr,
- CONST84 char ** argv, Tk_ArgvInfo * argTable,
- int flags));
+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
/* 144 */
-EXTERN void Tk_PhotoPutBlock_NoComposite _ANSI_ARGS_((
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock * blockPtr, int x, int y,
- int width, int height));
+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 _ANSI_ARGS_((
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock * blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- Tk_PhotoImageBlock * blockPtr));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- int width, int height));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- int width, int height));
+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 _ANSI_ARGS_((Tk_TextLayout layout,
- int x, int y));
+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 _ANSI_ARGS_((Tk_Font tkfont,
- Tcl_DString * dsPtr));
+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 _ANSI_ARGS_((Display * display,
- Colormap colormap));
+EXTERN void Tk_PreserveColormap(Display *display,
+ Colormap colormap);
+#endif
+#ifndef Tk_QueueWindowEvent_TCL_DECLARED
+#define Tk_QueueWindowEvent_TCL_DECLARED
/* 154 */
-EXTERN void Tk_QueueWindowEvent _ANSI_ARGS_((XEvent * eventPtr,
- Tcl_QueuePosition position));
+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 _ANSI_ARGS_((Tk_Image image,
- int imageX, int imageY, int width,
- int height, Drawable drawable, int drawableX,
- int drawableY));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int width, int height));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int aboveBelow, Tk_Window other));
+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 _ANSI_ARGS_((
- Tk_RestrictProc * proc, ClientData arg,
- ClientData * prevArgPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp));
+EXTERN int Tk_SafeInit(Tcl_Interp *interp);
+#endif
+#ifndef Tk_SetAppName_TCL_DECLARED
+#define Tk_SetAppName_TCL_DECLARED
/* 160 */
-EXTERN CONST char * Tk_SetAppName _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * name));
+EXTERN CONST char * Tk_SetAppName(Tk_Window tkwin, CONST char *name);
+#endif
+#ifndef Tk_SetBackgroundFromBorder_TCL_DECLARED
+#define Tk_SetBackgroundFromBorder_TCL_DECLARED
/* 161 */
-EXTERN void Tk_SetBackgroundFromBorder _ANSI_ARGS_((
- Tk_Window tkwin, Tk_3DBorder border));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * className));
+EXTERN void Tk_SetClass(Tk_Window tkwin, CONST char *className);
+#endif
+#ifndef Tk_SetGrid_TCL_DECLARED
+#define Tk_SetGrid_TCL_DECLARED
/* 163 */
-EXTERN void Tk_SetGrid _ANSI_ARGS_((Tk_Window tkwin,
- int reqWidth, int reqHeight, int gridWidth,
- int gridHeight));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int width));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- unsigned long pixel));
+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 _ANSI_ARGS_((
- Tk_Window tkwin, Pixmap pixmap));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- unsigned long pixel));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int width));
+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 _ANSI_ARGS_((
- Tk_Window tkwin, Pixmap pixmap));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Colormap colormap));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Visual * visual, int depth,
- Colormap colormap));
+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 _ANSI_ARGS_((Display * display,
- Pixmap bitmap, int * widthPtr,
- int * heightPtr));
+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 _ANSI_ARGS_((Tk_Image image,
- int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN int Tk_StrictMotif(Tk_Window tkwin);
+#endif
+#ifndef Tk_TextLayoutToPostscript_TCL_DECLARED
+#define Tk_TextLayoutToPostscript_TCL_DECLARED
/* 175 */
-EXTERN void Tk_TextLayoutToPostscript _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_TextLayout layout));
+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 _ANSI_ARGS_((Tk_Font font,
- CONST char * str, int numBytes));
+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 _ANSI_ARGS_((Tk_Window window));
+EXTERN void Tk_UndefineCursor(Tk_Window window);
+#endif
+#ifndef Tk_UnderlineChars_TCL_DECLARED
+#define Tk_UnderlineChars_TCL_DECLARED
/* 178 */
-EXTERN void Tk_UnderlineChars _ANSI_ARGS_((Display * display,
- Drawable drawable, GC gc, Tk_Font tkfont,
- CONST char * source, int x, int y,
- int firstByte, int lastByte));
+EXTERN void Tk_UnderlineChars(Display *display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ 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 _ANSI_ARGS_((
- Display * display, Drawable drawable, GC gc,
- Tk_TextLayout layout, int x, int y,
- int underline));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void Tk_Ungrab(Tk_Window tkwin);
+#endif
+#ifndef Tk_UnmaintainGeometry_TCL_DECLARED
+#define Tk_UnmaintainGeometry_TCL_DECLARED
/* 181 */
-EXTERN void Tk_UnmaintainGeometry _ANSI_ARGS_((Tk_Window slave,
- Tk_Window master));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void Tk_UnmapWindow(Tk_Window tkwin);
+#endif
+#ifndef Tk_UnsetGrid_TCL_DECLARED
+#define Tk_UnsetGrid_TCL_DECLARED
/* 183 */
-EXTERN void Tk_UnsetGrid _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void Tk_UnsetGrid(Tk_Window tkwin);
+#endif
+#ifndef Tk_UpdatePointer_TCL_DECLARED
+#define Tk_UpdatePointer_TCL_DECLARED
/* 184 */
-EXTERN void Tk_UpdatePointer _ANSI_ARGS_((Tk_Window tkwin, int x,
- int y, int state));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp,
- CONST Tk_OptionSpec * templatePtr));
+EXTERN Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
+ CONST Tk_OptionSpec *templatePtr);
+#endif
+#ifndef Tk_DeleteOptionTable_TCL_DECLARED
+#define Tk_DeleteOptionTable_TCL_DECLARED
/* 191 */
-EXTERN void Tk_DeleteOptionTable _ANSI_ARGS_((
- Tk_OptionTable optionTable));
+EXTERN void Tk_DeleteOptionTable(Tk_OptionTable optionTable);
+#endif
+#ifndef Tk_Free3DBorderFromObj_TCL_DECLARED
+#define Tk_Free3DBorderFromObj_TCL_DECLARED
/* 192 */
-EXTERN void Tk_Free3DBorderFromObj _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((char * recordPtr,
- Tk_OptionTable optionToken, Tk_Window tkwin));
+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 _ANSI_ARGS_((
- Tk_SavedOptions * savePtr));
+EXTERN void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr);
+#endif
+#ifndef Tk_FreeCursorFromObj_TCL_DECLARED
+#define Tk_FreeCursorFromObj_TCL_DECLARED
/* 197 */
-EXTERN void Tk_FreeCursorFromObj _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tcl_Obj * objPtr, Tk_Anchor * anchorPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- char * recordPtr, Tk_OptionTable optionTable,
- Tcl_Obj * namePtr, Tk_Window tkwin));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- char * recordPtr, Tk_OptionTable optionTable,
- Tcl_Obj * namePtr, Tk_Window tkwin));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tcl_Obj * objPtr,
- Tk_Justify * justifyPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tcl_Obj * objPtr,
- double * doublePtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tcl_Obj * objPtr,
- int * intPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tcl_Obj * objPtr, int * resultPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- int objc, Tcl_Obj *CONST objv[],
- double * dblPtr, int * intPtr));
+EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[], double *dblPtr,
+ int *intPtr);
+#endif
+#ifndef Tk_InitOptions_TCL_DECLARED
+#define Tk_InitOptions_TCL_DECLARED
/* 211 */
-EXTERN int Tk_InitOptions _ANSI_ARGS_((Tcl_Interp * interp,
- char * recordPtr, Tk_OptionTable optionToken,
- Tk_Window tkwin));
+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 _ANSI_ARGS_((int argc, char ** argv,
- Tcl_AppInitProc * appInitProc,
- Tcl_Interp * interp));
+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 _ANSI_ARGS_((
- Tk_SavedOptions * savePtr));
+EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr);
+#endif
+#ifndef Tk_SetOptions_TCL_DECLARED
+#define Tk_SetOptions_TCL_DECLARED
/* 214 */
-EXTERN int Tk_SetOptions _ANSI_ARGS_((Tcl_Interp * interp,
- char * recordPtr, Tk_OptionTable optionTable,
- int objc, Tcl_Obj *CONST objv[],
- Tk_Window tkwin, Tk_SavedOptions * savePtr,
- int * maskPtr));
+EXTERN 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);
+#endif
+#ifndef Tk_InitConsoleChannels_TCL_DECLARED
+#define Tk_InitConsoleChannels_TCL_DECLARED
/* 215 */
-EXTERN void Tk_InitConsoleChannels _ANSI_ARGS_((
- Tcl_Interp * interp));
+EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp);
+#endif
+#ifndef Tk_CreateConsoleWindow_TCL_DECLARED
+#define Tk_CreateConsoleWindow_TCL_DECLARED
/* 216 */
-EXTERN int Tk_CreateConsoleWindow _ANSI_ARGS_((
- Tcl_Interp * interp));
+EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp);
+#endif
+#ifndef Tk_CreateSmoothMethod_TCL_DECLARED
+#define Tk_CreateSmoothMethod_TCL_DECLARED
/* 217 */
-EXTERN void Tk_CreateSmoothMethod _ANSI_ARGS_((
- Tcl_Interp * interp,
- Tk_SmoothMethod * method));
+EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp,
+ Tk_SmoothMethod *method);
+#endif
/* Slot 218 is reserved */
/* Slot 219 is reserved */
+#ifndef Tk_GetDash_TCL_DECLARED
+#define Tk_GetDash_TCL_DECLARED
/* 220 */
-EXTERN int Tk_GetDash _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * value, Tk_Dash * dash));
+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 _ANSI_ARGS_((Tk_Outline * outline));
+EXTERN void Tk_CreateOutline(Tk_Outline *outline);
+#endif
+#ifndef Tk_DeleteOutline_TCL_DECLARED
+#define Tk_DeleteOutline_TCL_DECLARED
/* 222 */
-EXTERN void Tk_DeleteOutline _ANSI_ARGS_((Display * display,
- Tk_Outline * outline));
+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 _ANSI_ARGS_((XGCValues * gcValues,
- Tk_Canvas canvas, Tk_Item * item,
- Tk_Outline * outline));
+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 _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item * item, Tk_Outline * outline));
+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 _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item * item, Tk_Outline * outline));
+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 _ANSI_ARGS_((Tk_Canvas canvas,
- Tk_Item * item, Tk_Outline * outline));
+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 _ANSI_ARGS_((Tk_Window tkwin, GC gc,
- int x, int y));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Canvas canvas,
- Tcl_Obj * obj, double * doublePtr));
+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 _ANSI_ARGS_((Tk_Canvas canvas,
- GC gc, Tk_TSOffset * offset));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- int x, int y, int width, int height));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_PostscriptInfo psInfo,
- Pixmap bitmap, int startX, int startY,
- int width, int height));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_PostscriptInfo psInfo, XColor * colorPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_PostscriptInfo psInfo, Tk_Font font));
+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 _ANSI_ARGS_((Tk_Image image,
- Tcl_Interp * interp, Tk_Window tkwin,
- Tk_PostscriptInfo psinfo, int x, int y,
- int width, int height, int prepass));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_PostscriptInfo psInfo, double * coordPtr,
- int numPoints));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window tkwin,
- Tk_PostscriptInfo psInfo, Pixmap bitmap));
+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 _ANSI_ARGS_((double y,
- Tk_PostscriptInfo psInfo));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_PhotoImageBlock * blockPtr,
- Tk_PostscriptInfo psInfo, int width,
- int height));
+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 _ANSI_ARGS_((
- Tk_ClientMessageProc * proc));
+EXTERN void Tk_CreateClientMessageHandler(
+ Tk_ClientMessageProc *proc);
+#endif
+#ifndef Tk_DeleteClientMessageHandler_TCL_DECLARED
+#define Tk_DeleteClientMessageHandler_TCL_DECLARED
/* 240 */
-EXTERN void Tk_DeleteClientMessageHandler _ANSI_ARGS_((
- Tk_ClientMessageProc * proc));
+EXTERN void Tk_DeleteClientMessageHandler(
+ Tk_ClientMessageProc *proc);
+#endif
+#ifndef Tk_CreateAnonymousWindow_TCL_DECLARED
+#define Tk_CreateAnonymousWindow_TCL_DECLARED
/* 241 */
-EXTERN Tk_Window Tk_CreateAnonymousWindow _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Window parent,
- CONST char * screenName));
+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
/* 242 */
-EXTERN void Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin,
- Tk_ClassProcs * procs,
- ClientData instanceData));
+EXTERN void Tk_SetClassProcs(Tk_Window tkwin,
+ Tk_ClassProcs *procs,
+ ClientData instanceData);
+#endif
+#ifndef Tk_SetInternalBorderEx_TCL_DECLARED
+#define Tk_SetInternalBorderEx_TCL_DECLARED
/* 243 */
-EXTERN void Tk_SetInternalBorderEx _ANSI_ARGS_((Tk_Window tkwin,
- int left, int right, int top, int bottom));
+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 _ANSI_ARGS_((
- Tk_Window tkwin, int minWidth, int minHeight));
+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 _ANSI_ARGS_((Tk_Window tkwin, int x,
- int y, int height));
+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 _ANSI_ARGS_((Tk_PhotoHandle handle,
- Tk_PhotoImageBlock * blockPtr, int x, int y,
- int width, int height, int compRule));
+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 _ANSI_ARGS_((
- Tk_PhotoHandle handle,
- Tk_PhotoImageBlock * blockPtr, int x, int y,
- int width, int height, int zoomX, int zoomY,
- int subsampleX, int subsampleY, int compRule));
+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 _ANSI_ARGS_((
- Display * display, int collapse));
+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 _ANSI_ARGS_((
- CONST char * name, Tk_StyleEngine parent));
+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 _ANSI_ARGS_((CONST char * name));
+EXTERN Tk_StyleEngine Tk_GetStyleEngine(CONST char *name);
+#endif
+#ifndef Tk_RegisterStyledElement_TCL_DECLARED
+#define Tk_RegisterStyledElement_TCL_DECLARED
/* 251 */
-EXTERN int Tk_RegisterStyledElement _ANSI_ARGS_((
- Tk_StyleEngine engine,
- Tk_ElementSpec * templatePtr));
+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 _ANSI_ARGS_((CONST char * name));
+EXTERN int Tk_GetElementId(CONST char *name);
+#endif
+#ifndef Tk_CreateStyle_TCL_DECLARED
+#define Tk_CreateStyle_TCL_DECLARED
/* 253 */
-EXTERN Tk_Style Tk_CreateStyle _ANSI_ARGS_((CONST char * name,
- Tk_StyleEngine engine, ClientData clientData));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * name));
+EXTERN Tk_Style Tk_GetStyle(Tcl_Interp *interp, CONST char *name);
+#endif
+#ifndef Tk_FreeStyle_TCL_DECLARED
+#define Tk_FreeStyle_TCL_DECLARED
/* 255 */
-EXTERN void Tk_FreeStyle _ANSI_ARGS_((Tk_Style style));
+EXTERN void Tk_FreeStyle(Tk_Style style);
+#endif
+#ifndef Tk_NameOfStyle_TCL_DECLARED
+#define Tk_NameOfStyle_TCL_DECLARED
/* 256 */
-EXTERN CONST char * Tk_NameOfStyle _ANSI_ARGS_((Tk_Style style));
+EXTERN CONST char * Tk_NameOfStyle(Tk_Style style);
+#endif
+#ifndef Tk_AllocStyleFromObj_TCL_DECLARED
+#define Tk_AllocStyleFromObj_TCL_DECLARED
/* 257 */
-EXTERN Tk_Style Tk_AllocStyleFromObj _ANSI_ARGS_((
- Tcl_Interp * interp, Tcl_Obj * objPtr));
+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 _ANSI_ARGS_((Tcl_Obj * objPtr));
+EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr);
+#endif
+#ifndef Tk_FreeStyleFromObj_TCL_DECLARED
+#define Tk_FreeStyleFromObj_TCL_DECLARED
/* 259 */
-EXTERN void Tk_FreeStyleFromObj _ANSI_ARGS_((Tcl_Obj * objPtr));
+EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr);
+#endif
+#ifndef Tk_GetStyledElement_TCL_DECLARED
+#define Tk_GetStyledElement_TCL_DECLARED
/* 260 */
-EXTERN Tk_StyledElement Tk_GetStyledElement _ANSI_ARGS_((Tk_Style style,
- int elementId, Tk_OptionTable optionTable));
+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 _ANSI_ARGS_((Tk_Style style,
- Tk_StyledElement element, char * recordPtr,
- Tk_Window tkwin, int width, int height,
- int inner, int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((Tk_Style style,
- Tk_StyledElement element, char * recordPtr,
- Tk_Window tkwin, int x, int y, int width,
- int height, int inner, int * xPtr,
- int * yPtr, int * widthPtr, int * heightPtr));
+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 _ANSI_ARGS_((Tk_Style style,
- Tk_StyledElement element, char * recordPtr,
- Tk_Window tkwin));
+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 _ANSI_ARGS_((Tk_Style style,
- Tk_StyledElement element, char * recordPtr,
- Tk_Window tkwin, Drawable d, int x, int y,
- int width, int height, int state));
+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
+/* 273 */
+EXTERN void Tk_CreateOldPhotoImageFormat(
+ Tk_PhotoImageFormat *formatPtr);
+#endif
typedef struct TkStubHooks {
struct TkPlatStubs *tkPlatStubs;
@@ -926,271 +1686,280 @@ typedef struct TkStubs {
int magic;
struct TkStubHooks *hooks;
- void (*tk_MainLoop) _ANSI_ARGS_((void)); /* 0 */
- XColor * (*tk_3DBorderColor) _ANSI_ARGS_((Tk_3DBorder border)); /* 1 */
- GC (*tk_3DBorderGC) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int which)); /* 2 */
- void (*tk_3DHorizontalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief)); /* 3 */
- void (*tk_3DVerticalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief)); /* 4 */
- void (*tk_AddOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * value, int priority)); /* 5 */
- void (*tk_BindEvent) _ANSI_ARGS_((Tk_BindingTable bindingTable, XEvent * eventPtr, Tk_Window tkwin, int numObjects, ClientData * objectPtr)); /* 6 */
- void (*tk_CanvasDrawableCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * drawableXPtr, short * drawableYPtr)); /* 7 */
- void (*tk_CanvasEventuallyRedraw) _ANSI_ARGS_((Tk_Canvas canvas, int x1, int y1, int x2, int y2)); /* 8 */
- int (*tk_CanvasGetCoord) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, CONST char * str, double * doublePtr)); /* 9 */
- Tk_CanvasTextInfo * (*tk_CanvasGetTextInfo) _ANSI_ARGS_((Tk_Canvas canvas)); /* 10 */
- int (*tk_CanvasPsBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height)); /* 11 */
- int (*tk_CanvasPsColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, XColor * colorPtr)); /* 12 */
- int (*tk_CanvasPsFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Tk_Font font)); /* 13 */
- void (*tk_CanvasPsPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, double * coordPtr, int numPoints)); /* 14 */
- int (*tk_CanvasPsStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap)); /* 15 */
- double (*tk_CanvasPsY) _ANSI_ARGS_((Tk_Canvas canvas, double y)); /* 16 */
- void (*tk_CanvasSetStippleOrigin) _ANSI_ARGS_((Tk_Canvas canvas, GC gc)); /* 17 */
- int (*tk_CanvasTagsParseProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, Tk_Window tkwin, CONST char * value, char * widgRec, int offset)); /* 18 */
- char * (*tk_CanvasTagsPrintProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char * widgRec, int offset, Tcl_FreeProc ** freeProcPtr)); /* 19 */
- Tk_Window (*tk_CanvasTkwin) _ANSI_ARGS_((Tk_Canvas canvas)); /* 20 */
- void (*tk_CanvasWindowCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * screenXPtr, short * screenYPtr)); /* 21 */
- void (*tk_ChangeWindowAttributes) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes * attsPtr)); /* 22 */
- int (*tk_CharBbox) _ANSI_ARGS_((Tk_TextLayout layout, int index, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 23 */
- void (*tk_ClearSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection)); /* 24 */
- int (*tk_ClipboardAppend) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom target, Atom format, char* buffer)); /* 25 */
- int (*tk_ClipboardClear) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin)); /* 26 */
- int (*tk_ConfigureInfo) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 27 */
- int (*tk_ConfigureValue) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 28 */
- int (*tk_ConfigureWidget) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, int argc, CONST84 char ** argv, char * widgRec, int flags)); /* 29 */
- void (*tk_ConfigureWindow) _ANSI_ARGS_((Tk_Window tkwin, unsigned int valueMask, XWindowChanges * valuePtr)); /* 30 */
- Tk_TextLayout (*tk_ComputeTextLayout) _ANSI_ARGS_((Tk_Font font, CONST char * str, int numChars, int wrapLength, Tk_Justify justify, int flags, int * widthPtr, int * heightPtr)); /* 31 */
- Tk_Window (*tk_CoordsToWindow) _ANSI_ARGS_((int rootX, int rootY, Tk_Window tkwin)); /* 32 */
- unsigned long (*tk_CreateBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr, CONST char * command, int append)); /* 33 */
- Tk_BindingTable (*tk_CreateBindingTable) _ANSI_ARGS_((Tcl_Interp * interp)); /* 34 */
- Tk_ErrorHandler (*tk_CreateErrorHandler) _ANSI_ARGS_((Display * display, int errNum, int request, int minorCode, Tk_ErrorProc * errorProc, ClientData clientData)); /* 35 */
- void (*tk_CreateEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 36 */
- void (*tk_CreateGenericHandler) _ANSI_ARGS_((Tk_GenericProc * proc, ClientData clientData)); /* 37 */
- void (*tk_CreateImageType) _ANSI_ARGS_((Tk_ImageType * typePtr)); /* 38 */
- void (*tk_CreateItemType) _ANSI_ARGS_((Tk_ItemType * typePtr)); /* 39 */
- void (*tk_CreatePhotoImageFormat) _ANSI_ARGS_((Tk_PhotoImageFormat * formatPtr)); /* 40 */
- void (*tk_CreateSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc * proc, ClientData clientData, Atom format)); /* 41 */
- Tk_Window (*tk_CreateWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * name, CONST char * screenName)); /* 42 */
- Tk_Window (*tk_CreateWindowFromPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * pathName, CONST char * screenName)); /* 43 */
- int (*tk_DefineBitmap) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * source, int width, int height)); /* 44 */
- void (*tk_DefineCursor) _ANSI_ARGS_((Tk_Window window, Tk_Cursor cursor)); /* 45 */
- void (*tk_DeleteAllBindings) _ANSI_ARGS_((Tk_BindingTable bindingTable, ClientData object)); /* 46 */
- int (*tk_DeleteBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 47 */
- void (*tk_DeleteBindingTable) _ANSI_ARGS_((Tk_BindingTable bindingTable)); /* 48 */
- void (*tk_DeleteErrorHandler) _ANSI_ARGS_((Tk_ErrorHandler handler)); /* 49 */
- void (*tk_DeleteEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 50 */
- void (*tk_DeleteGenericHandler) _ANSI_ARGS_((Tk_GenericProc * proc, ClientData clientData)); /* 51 */
- void (*tk_DeleteImage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 52 */
- void (*tk_DeleteSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target)); /* 53 */
- void (*tk_DestroyWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 54 */
- CONST84_RETURN char * (*tk_DisplayName) _ANSI_ARGS_((Tk_Window tkwin)); /* 55 */
- int (*tk_DistanceToTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 56 */
- void (*tk_Draw3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 57 */
- void (*tk_Draw3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 58 */
- void (*tk_DrawChars) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char * source, int numBytes, int x, int y)); /* 59 */
- void (*tk_DrawFocusHighlight) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int width, Drawable drawable)); /* 60 */
- void (*tk_DrawTextLayout) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar)); /* 61 */
- void (*tk_Fill3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 62 */
- void (*tk_Fill3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 63 */
- Tk_PhotoHandle (*tk_FindPhoto) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * imageName)); /* 64 */
- Font (*tk_FontId) _ANSI_ARGS_((Tk_Font font)); /* 65 */
- void (*tk_Free3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 66 */
- void (*tk_FreeBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 67 */
- void (*tk_FreeColor) _ANSI_ARGS_((XColor * colorPtr)); /* 68 */
- void (*tk_FreeColormap) _ANSI_ARGS_((Display * display, Colormap colormap)); /* 69 */
- void (*tk_FreeCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 70 */
- void (*tk_FreeFont) _ANSI_ARGS_((Tk_Font f)); /* 71 */
- void (*tk_FreeGC) _ANSI_ARGS_((Display * display, GC gc)); /* 72 */
- void (*tk_FreeImage) _ANSI_ARGS_((Tk_Image image)); /* 73 */
- void (*tk_FreeOptions) _ANSI_ARGS_((Tk_ConfigSpec * specs, char * widgRec, Display * display, int needFlags)); /* 74 */
- void (*tk_FreePixmap) _ANSI_ARGS_((Display * display, Pixmap pixmap)); /* 75 */
- void (*tk_FreeTextLayout) _ANSI_ARGS_((Tk_TextLayout textLayout)); /* 76 */
- void (*tk_FreeXId) _ANSI_ARGS_((Display * display, XID xid)); /* 77 */
- GC (*tk_GCForColor) _ANSI_ARGS_((XColor * colorPtr, Drawable drawable)); /* 78 */
- void (*tk_GeometryRequest) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight)); /* 79 */
- Tk_3DBorder (*tk_Get3DBorder) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid colorName)); /* 80 */
- void (*tk_GetAllBindings) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object)); /* 81 */
- int (*tk_GetAnchor) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Anchor * anchorPtr)); /* 82 */
- CONST84_RETURN char * (*tk_GetAtomName) _ANSI_ARGS_((Tk_Window tkwin, Atom atom)); /* 83 */
- CONST84_RETURN char * (*tk_GetBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 84 */
- Pixmap (*tk_GetBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 85 */
- Pixmap (*tk_GetBitmapFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, int width, int height)); /* 86 */
- int (*tk_GetCapStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * capPtr)); /* 87 */
- XColor * (*tk_GetColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid name)); /* 88 */
- XColor * (*tk_GetColorByValue) _ANSI_ARGS_((Tk_Window tkwin, XColor * colorPtr)); /* 89 */
- Colormap (*tk_GetColormap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 90 */
- Tk_Cursor (*tk_GetCursor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid str)); /* 91 */
- Tk_Cursor (*tk_GetCursorFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, CONST char * mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 92 */
- Tk_Font (*tk_GetFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 93 */
- Tk_Font (*tk_GetFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 94 */
- void (*tk_GetFontMetrics) _ANSI_ARGS_((Tk_Font font, Tk_FontMetrics * fmPtr)); /* 95 */
- GC (*tk_GetGC) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XGCValues * valuePtr)); /* 96 */
- Tk_Image (*tk_GetImage) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * name, Tk_ImageChangedProc * changeProc, ClientData clientData)); /* 97 */
- ClientData (*tk_GetImageMasterData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tk_ImageType ** typePtrPtr)); /* 98 */
- Tk_ItemType * (*tk_GetItemTypes) _ANSI_ARGS_((void)); /* 99 */
- int (*tk_GetJoinStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * joinPtr)); /* 100 */
- int (*tk_GetJustify) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Justify * justifyPtr)); /* 101 */
- int (*tk_GetNumMainWindows) _ANSI_ARGS_((void)); /* 102 */
- Tk_Uid (*tk_GetOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * className)); /* 103 */
- int (*tk_GetPixels) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * intPtr)); /* 104 */
- Pixmap (*tk_GetPixmap) _ANSI_ARGS_((Display * display, Drawable d, int width, int height, int depth)); /* 105 */
- int (*tk_GetRelief) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int * reliefPtr)); /* 106 */
- void (*tk_GetRootCoords) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr)); /* 107 */
- int (*tk_GetScrollInfo) _ANSI_ARGS_((Tcl_Interp * interp, int argc, CONST84 char ** argv, double * dblPtr, int * intPtr)); /* 108 */
- int (*tk_GetScreenMM) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, double * doublePtr)); /* 109 */
- int (*tk_GetSelection) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc * proc, ClientData clientData)); /* 110 */
- Tk_Uid (*tk_GetUid) _ANSI_ARGS_((CONST char * str)); /* 111 */
- Visual * (*tk_GetVisual) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * depthPtr, Colormap * colormapPtr)); /* 112 */
- void (*tk_GetVRootGeometry) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 113 */
- int (*tk_Grab) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int grabGlobal)); /* 114 */
- void (*tk_HandleEvent) _ANSI_ARGS_((XEvent * eventPtr)); /* 115 */
- Tk_Window (*tk_IdToWindow) _ANSI_ARGS_((Display * display, Window window)); /* 116 */
- void (*tk_ImageChanged) _ANSI_ARGS_((Tk_ImageMaster master, int x, int y, int width, int height, int imageWidth, int imageHeight)); /* 117 */
- int (*tk_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 118 */
- Atom (*tk_InternAtom) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 119 */
- int (*tk_IntersectTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y, int width, int height)); /* 120 */
- void (*tk_MaintainGeometry) _ANSI_ARGS_((Tk_Window slave, Tk_Window master, int x, int y, int width, int height)); /* 121 */
- Tk_Window (*tk_MainWindow) _ANSI_ARGS_((Tcl_Interp * interp)); /* 122 */
- void (*tk_MakeWindowExist) _ANSI_ARGS_((Tk_Window tkwin)); /* 123 */
- void (*tk_ManageGeometry) _ANSI_ARGS_((Tk_Window tkwin, Tk_GeomMgr * mgrPtr, ClientData clientData)); /* 124 */
- void (*tk_MapWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 125 */
- int (*tk_MeasureChars) _ANSI_ARGS_((Tk_Font tkfont, CONST char * source, int numBytes, int maxPixels, int flags, int * lengthPtr)); /* 126 */
- void (*tk_MoveResizeWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height)); /* 127 */
- void (*tk_MoveWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 128 */
- void (*tk_MoveToplevelWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 129 */
- CONST84_RETURN char * (*tk_NameOf3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 130 */
- CONST84_RETURN char * (*tk_NameOfAnchor) _ANSI_ARGS_((Tk_Anchor anchor)); /* 131 */
- CONST84_RETURN char * (*tk_NameOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 132 */
- CONST84_RETURN char * (*tk_NameOfCapStyle) _ANSI_ARGS_((int cap)); /* 133 */
- CONST84_RETURN char * (*tk_NameOfColor) _ANSI_ARGS_((XColor * colorPtr)); /* 134 */
- CONST84_RETURN char * (*tk_NameOfCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 135 */
- CONST84_RETURN char * (*tk_NameOfFont) _ANSI_ARGS_((Tk_Font font)); /* 136 */
- CONST84_RETURN char * (*tk_NameOfImage) _ANSI_ARGS_((Tk_ImageMaster imageMaster)); /* 137 */
- CONST84_RETURN char * (*tk_NameOfJoinStyle) _ANSI_ARGS_((int join)); /* 138 */
- CONST84_RETURN char * (*tk_NameOfJustify) _ANSI_ARGS_((Tk_Justify justify)); /* 139 */
- CONST84_RETURN char * (*tk_NameOfRelief) _ANSI_ARGS_((int relief)); /* 140 */
- Tk_Window (*tk_NameToWindow) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pathName, Tk_Window tkwin)); /* 141 */
- void (*tk_OwnSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Tk_LostSelProc * proc, ClientData clientData)); /* 142 */
- int (*tk_ParseArgv) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int * argcPtr, CONST84 char ** argv, Tk_ArgvInfo * argTable, int flags)); /* 143 */
- void (*tk_PhotoPutBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height)); /* 144 */
- void (*tk_PhotoPutZoomedBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 145 */
- int (*tk_PhotoGetImage) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr)); /* 146 */
- void (*tk_PhotoBlank) _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 147 */
- void (*tk_PhotoExpand) _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 148 */
- void (*tk_PhotoGetSize) _ANSI_ARGS_((Tk_PhotoHandle handle, int * widthPtr, int * heightPtr)); /* 149 */
- void (*tk_PhotoSetSize) _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 150 */
- int (*tk_PointToChar) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 151 */
- int (*tk_PostscriptFontName) _ANSI_ARGS_((Tk_Font tkfont, Tcl_DString * dsPtr)); /* 152 */
- void (*tk_PreserveColormap) _ANSI_ARGS_((Display * display, Colormap colormap)); /* 153 */
- void (*tk_QueueWindowEvent) _ANSI_ARGS_((XEvent * eventPtr, Tcl_QueuePosition position)); /* 154 */
- void (*tk_RedrawImage) _ANSI_ARGS_((Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY)); /* 155 */
- void (*tk_ResizeWindow) _ANSI_ARGS_((Tk_Window tkwin, int width, int height)); /* 156 */
- int (*tk_RestackWindow) _ANSI_ARGS_((Tk_Window tkwin, int aboveBelow, Tk_Window other)); /* 157 */
- Tk_RestrictProc * (*tk_RestrictEvents) _ANSI_ARGS_((Tk_RestrictProc * proc, ClientData arg, ClientData * prevArgPtr)); /* 158 */
- int (*tk_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 159 */
- CONST char * (*tk_SetAppName) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 160 */
- void (*tk_SetBackgroundFromBorder) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border)); /* 161 */
- void (*tk_SetClass) _ANSI_ARGS_((Tk_Window tkwin, CONST char * className)); /* 162 */
- void (*tk_SetGrid) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight)); /* 163 */
- void (*tk_SetInternalBorder) _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 164 */
- void (*tk_SetWindowBackground) _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 165 */
- void (*tk_SetWindowBackgroundPixmap) _ANSI_ARGS_((Tk_Window tkwin, Pixmap pixmap)); /* 166 */
- void (*tk_SetWindowBorder) _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 167 */
- void (*tk_SetWindowBorderWidth) _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 168 */
- void (*tk_SetWindowBorderPixmap) _ANSI_ARGS_((Tk_Window tkwin, Pixmap pixmap)); /* 169 */
- void (*tk_SetWindowColormap) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 170 */
- int (*tk_SetWindowVisual) _ANSI_ARGS_((Tk_Window tkwin, Visual * visual, int depth, Colormap colormap)); /* 171 */
- void (*tk_SizeOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap, int * widthPtr, int * heightPtr)); /* 172 */
- void (*tk_SizeOfImage) _ANSI_ARGS_((Tk_Image image, int * widthPtr, int * heightPtr)); /* 173 */
- int (*tk_StrictMotif) _ANSI_ARGS_((Tk_Window tkwin)); /* 174 */
- void (*tk_TextLayoutToPostscript) _ANSI_ARGS_((Tcl_Interp * interp, Tk_TextLayout layout)); /* 175 */
- int (*tk_TextWidth) _ANSI_ARGS_((Tk_Font font, CONST char * str, int numBytes)); /* 176 */
- void (*tk_UndefineCursor) _ANSI_ARGS_((Tk_Window window)); /* 177 */
- void (*tk_UnderlineChars) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_Font tkfont, CONST char * source, int x, int y, int firstByte, int lastByte)); /* 178 */
- void (*tk_UnderlineTextLayout) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline)); /* 179 */
- void (*tk_Ungrab) _ANSI_ARGS_((Tk_Window tkwin)); /* 180 */
- void (*tk_UnmaintainGeometry) _ANSI_ARGS_((Tk_Window slave, Tk_Window master)); /* 181 */
- void (*tk_UnmapWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 182 */
- void (*tk_UnsetGrid) _ANSI_ARGS_((Tk_Window tkwin)); /* 183 */
- void (*tk_UpdatePointer) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int state)); /* 184 */
- Pixmap (*tk_AllocBitmapFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 185 */
- Tk_3DBorder (*tk_Alloc3DBorderFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 186 */
- XColor * (*tk_AllocColorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 187 */
- Tk_Cursor (*tk_AllocCursorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 188 */
- Tk_Font (*tk_AllocFontFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr)); /* 189 */
- Tk_OptionTable (*tk_CreateOptionTable) _ANSI_ARGS_((Tcl_Interp * interp, CONST Tk_OptionSpec * templatePtr)); /* 190 */
- void (*tk_DeleteOptionTable) _ANSI_ARGS_((Tk_OptionTable optionTable)); /* 191 */
- void (*tk_Free3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 192 */
- void (*tk_FreeBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 193 */
- void (*tk_FreeColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 194 */
- void (*tk_FreeConfigOptions) _ANSI_ARGS_((char * recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 195 */
- void (*tk_FreeSavedOptions) _ANSI_ARGS_((Tk_SavedOptions * savePtr)); /* 196 */
- void (*tk_FreeCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 197 */
- void (*tk_FreeFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 198 */
- Tk_3DBorder (*tk_Get3DBorderFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 199 */
- int (*tk_GetAnchorFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tk_Anchor * anchorPtr)); /* 200 */
- Pixmap (*tk_GetBitmapFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 201 */
- XColor * (*tk_GetColorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 202 */
- Tk_Cursor (*tk_GetCursorFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 203 */
- Tcl_Obj * (*tk_GetOptionInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, Tcl_Obj * namePtr, Tk_Window tkwin)); /* 204 */
- Tcl_Obj * (*tk_GetOptionValue) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionTable, Tcl_Obj * namePtr, Tk_Window tkwin)); /* 205 */
- int (*tk_GetJustifyFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tk_Justify * justifyPtr)); /* 206 */
- int (*tk_GetMMFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, double * doublePtr)); /* 207 */
- int (*tk_GetPixelsFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, int * intPtr)); /* 208 */
- int (*tk_GetReliefFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, int * resultPtr)); /* 209 */
- int (*tk_GetScrollInfoObj) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], double * dblPtr, int * intPtr)); /* 210 */
- int (*tk_InitOptions) _ANSI_ARGS_((Tcl_Interp * interp, char * recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin)); /* 211 */
- void (*tk_MainEx) _ANSI_ARGS_((int argc, char ** argv, Tcl_AppInitProc * appInitProc, Tcl_Interp * interp)); /* 212 */
- void (*tk_RestoreSavedOptions) _ANSI_ARGS_((Tk_SavedOptions * savePtr)); /* 213 */
- int (*tk_SetOptions) _ANSI_ARGS_((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) _ANSI_ARGS_((Tcl_Interp * interp)); /* 215 */
- int (*tk_CreateConsoleWindow) _ANSI_ARGS_((Tcl_Interp * interp)); /* 216 */
- void (*tk_CreateSmoothMethod) _ANSI_ARGS_((Tcl_Interp * interp, Tk_SmoothMethod * method)); /* 217 */
- void *reserved218;
- void *reserved219;
- int (*tk_GetDash) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * value, Tk_Dash * dash)); /* 220 */
- void (*tk_CreateOutline) _ANSI_ARGS_((Tk_Outline * outline)); /* 221 */
- void (*tk_DeleteOutline) _ANSI_ARGS_((Display * display, Tk_Outline * outline)); /* 222 */
- int (*tk_ConfigOutlineGC) _ANSI_ARGS_((XGCValues * gcValues, Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 223 */
- int (*tk_ChangeOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 224 */
- int (*tk_ResetOutlineGC) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 225 */
- int (*tk_CanvasPsOutline) _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * item, Tk_Outline * outline)); /* 226 */
- void (*tk_SetTSOrigin) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int x, int y)); /* 227 */
- int (*tk_CanvasGetCoordFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Tcl_Obj * obj, double * doublePtr)); /* 228 */
- void (*tk_CanvasSetOffset) _ANSI_ARGS_((Tk_Canvas canvas, GC gc, Tk_TSOffset * offset)); /* 229 */
- void (*tk_DitherPhoto) _ANSI_ARGS_((Tk_PhotoHandle handle, int x, int y, int width, int height)); /* 230 */
- int (*tk_PostscriptBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, int startY, int width, int height)); /* 231 */
- int (*tk_PostscriptColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, XColor * colorPtr)); /* 232 */
- int (*tk_PostscriptFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, Tk_Font font)); /* 233 */
- int (*tk_PostscriptImage) _ANSI_ARGS_((Tk_Image image, Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass)); /* 234 */
- void (*tk_PostscriptPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PostscriptInfo psInfo, double * coordPtr, int numPoints)); /* 235 */
- int (*tk_PostscriptStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap)); /* 236 */
- double (*tk_PostscriptY) _ANSI_ARGS_((double y, Tk_PostscriptInfo psInfo)); /* 237 */
- int (*tk_PostscriptPhoto) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PhotoImageBlock * blockPtr, Tk_PostscriptInfo psInfo, int width, int height)); /* 238 */
- void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 239 */
- void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 240 */
- Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * screenName)); /* 241 */
- void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs * procs, ClientData instanceData)); /* 242 */
- void (*tk_SetInternalBorderEx) _ANSI_ARGS_((Tk_Window tkwin, int left, int right, int top, int bottom)); /* 243 */
- void (*tk_SetMinimumRequestSize) _ANSI_ARGS_((Tk_Window tkwin, int minWidth, int minHeight)); /* 244 */
- void (*tk_SetCaretPos) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int height)); /* 245 */
- void (*tk_PhotoPutBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int compRule)); /* 246 */
- void (*tk_PhotoPutZoomedBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)); /* 247 */
- int (*tk_CollapseMotionEvents) _ANSI_ARGS_((Display * display, int collapse)); /* 248 */
- Tk_StyleEngine (*tk_RegisterStyleEngine) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine parent)); /* 249 */
- Tk_StyleEngine (*tk_GetStyleEngine) _ANSI_ARGS_((CONST char * name)); /* 250 */
- int (*tk_RegisterStyledElement) _ANSI_ARGS_((Tk_StyleEngine engine, Tk_ElementSpec * templatePtr)); /* 251 */
- int (*tk_GetElementId) _ANSI_ARGS_((CONST char * name)); /* 252 */
- Tk_Style (*tk_CreateStyle) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine engine, ClientData clientData)); /* 253 */
- Tk_Style (*tk_GetStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 254 */
- void (*tk_FreeStyle) _ANSI_ARGS_((Tk_Style style)); /* 255 */
- CONST char * (*tk_NameOfStyle) _ANSI_ARGS_((Tk_Style style)); /* 256 */
- Tk_Style (*tk_AllocStyleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 257 */
- Tk_Style (*tk_GetStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 258 */
- void (*tk_FreeStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 259 */
- Tk_StyledElement (*tk_GetStyledElement) _ANSI_ARGS_((Tk_Style style, int elementId, Tk_OptionTable optionTable)); /* 260 */
- void (*tk_GetElementSize) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int width, int height, int inner, int * widthPtr, int * heightPtr)); /* 261 */
- void (*tk_GetElementBox) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 262 */
- int (*tk_GetElementBorderWidth) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin)); /* 263 */
- void (*tk_DrawElement) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); /* 264 */
+ 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_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 */
+ 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 */
+ int (*tk_CanvasPsFont) (Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 13 */
+ void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, int numPoints); /* 14 */
+ 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 */
+ 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_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 */
+ 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_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 */
+ 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_CreateItemType) (Tk_ItemType *typePtr); /* 39 */
+ void (*tk_CreatePhotoImageFormat) (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 */
+ 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 */
+ 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_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_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 */
+ Font (*tk_FontId) (Tk_Font font); /* 65 */
+ void (*tk_Free3DBorder) (Tk_3DBorder border); /* 66 */
+ void (*tk_FreeBitmap) (Display *display, Pixmap bitmap); /* 67 */
+ void (*tk_FreeColor) (XColor *colorPtr); /* 68 */
+ void (*tk_FreeColormap) (Display *display, Colormap colormap); /* 69 */
+ void (*tk_FreeCursor) (Display *display, Tk_Cursor cursor); /* 70 */
+ 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_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */
+ void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */
+ void (*tk_FreeXId) (Display *display, XID xid); /* 77 */
+ GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */
+ 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 */
+ 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 */
+ 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 */
+ 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_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_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_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 */
+ 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 */
+ 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_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 */
+ 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 */
+ 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_MapWindow) (Tk_Window tkwin); /* 125 */
+ 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 */
+ CONST84_RETURN char * (*tk_NameOf3DBorder) (Tk_3DBorder border); /* 130 */
+ CONST84_RETURN char * (*tk_NameOfAnchor) (Tk_Anchor anchor); /* 131 */
+ CONST84_RETURN char * (*tk_NameOfBitmap) (Display *display, Pixmap bitmap); /* 132 */
+ CONST84_RETURN char * (*tk_NameOfCapStyle) (int cap); /* 133 */
+ CONST84_RETURN char * (*tk_NameOfColor) (XColor *colorPtr); /* 134 */
+ CONST84_RETURN char * (*tk_NameOfCursor) (Display *display, Tk_Cursor cursor); /* 135 */
+ CONST84_RETURN char * (*tk_NameOfFont) (Tk_Font font); /* 136 */
+ CONST84_RETURN char * (*tk_NameOfImage) (Tk_ImageMaster imageMaster); /* 137 */
+ 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 */
+ 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 */
+ 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 */
+ void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */
+ void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */
+ void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */
+ void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */
+ int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */
+ int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */
+ void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */
+ void (*tk_QueueWindowEvent) (XEvent *eventPtr, Tcl_QueuePosition position); /* 154 */
+ void (*tk_RedrawImage) (Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY); /* 155 */
+ void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */
+ 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 */
+ void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */
+ 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 */
+ void (*tk_SetWindowBackgroundPixmap) (Tk_Window tkwin, Pixmap pixmap); /* 166 */
+ void (*tk_SetWindowBorder) (Tk_Window tkwin, unsigned long pixel); /* 167 */
+ void (*tk_SetWindowBorderWidth) (Tk_Window tkwin, int width); /* 168 */
+ void (*tk_SetWindowBorderPixmap) (Tk_Window tkwin, Pixmap pixmap); /* 169 */
+ void (*tk_SetWindowColormap) (Tk_Window tkwin, Colormap colormap); /* 170 */
+ int (*tk_SetWindowVisual) (Tk_Window tkwin, Visual *visual, int depth, Colormap colormap); /* 171 */
+ void (*tk_SizeOfBitmap) (Display *display, Pixmap bitmap, int *widthPtr, int *heightPtr); /* 172 */
+ 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 */
+ 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_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 */
+ void (*tk_UnmapWindow) (Tk_Window tkwin); /* 182 */
+ void (*tk_UnsetGrid) (Tk_Window tkwin); /* 183 */
+ void (*tk_UpdatePointer) (Tk_Window tkwin, int x, int y, int state); /* 184 */
+ Pixmap (*tk_AllocBitmapFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 185 */
+ Tk_3DBorder (*tk_Alloc3DBorderFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr); /* 186 */
+ 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 */
+ 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 */
+ void (*tk_FreeColorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 194 */
+ void (*tk_FreeConfigOptions) (char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 195 */
+ void (*tk_FreeSavedOptions) (Tk_SavedOptions *savePtr); /* 196 */
+ void (*tk_FreeCursorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 197 */
+ void (*tk_FreeFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 198 */
+ Tk_3DBorder (*tk_Get3DBorderFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 199 */
+ int (*tk_GetAnchorFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Anchor *anchorPtr); /* 200 */
+ Pixmap (*tk_GetBitmapFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 201 */
+ XColor * (*tk_GetColorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 202 */
+ Tk_Cursor (*tk_GetCursorFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 203 */
+ Tcl_Obj * (*tk_GetOptionInfo) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 204 */
+ Tcl_Obj * (*tk_GetOptionValue) (Tcl_Interp *interp, char *recordPtr, Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin); /* 205 */
+ int (*tk_GetJustifyFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tk_Justify *justifyPtr); /* 206 */
+ 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_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 */
+ 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_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 */
+ int (*tk_ChangeOutlineGC) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 224 */
+ int (*tk_ResetOutlineGC) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 225 */
+ int (*tk_CanvasPsOutline) (Tk_Canvas canvas, Tk_Item *item, Tk_Outline *outline); /* 226 */
+ void (*tk_SetTSOrigin) (Tk_Window tkwin, GC gc, int x, int y); /* 227 */
+ int (*tk_CanvasGetCoordFromObj) (Tcl_Interp *interp, Tk_Canvas canvas, Tcl_Obj *obj, double *doublePtr); /* 228 */
+ void (*tk_CanvasSetOffset) (Tk_Canvas canvas, GC gc, Tk_TSOffset *offset); /* 229 */
+ void (*tk_DitherPhoto) (Tk_PhotoHandle handle, int x, int y, int width, int height); /* 230 */
+ int (*tk_PostscriptBitmap) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, int startY, int width, int height); /* 231 */
+ int (*tk_PostscriptColor) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, XColor *colorPtr); /* 232 */
+ int (*tk_PostscriptFont) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font); /* 233 */
+ 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); /* 234 */
+ void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints); /* 235 */
+ int (*tk_PostscriptStipple) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap); /* 236 */
+ double (*tk_PostscriptY) (double y, Tk_PostscriptInfo psInfo); /* 237 */
+ 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 */
+ 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 */
+ 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 */
+ void (*tk_FreeStyle) (Tk_Style style); /* 255 */
+ 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 */
+ Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, int elementId, Tk_OptionTable optionTable); /* 260 */
+ void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */
+ void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */
+ int (*tk_GetElementBorderWidth) (Tk_Style style, Tk_StyledElement element, char *recordPtr, Tk_Window tkwin); /* 263 */
+ 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); /* 264 */
+ int (*tk_PhotoExpand) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 265 */
+ int (*tk_PhotoPutBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 266 */
+ 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); /* 267 */
+ int (*tk_PhotoSetSize) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 268 */
+ 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 */
} TkStubs;
#ifdef __cplusplus
@@ -1799,17 +2568,17 @@ extern TkStubs *tkStubsPtr;
#define Tk_PhotoBlank \
(tkStubsPtr->tk_PhotoBlank) /* 147 */
#endif
-#ifndef Tk_PhotoExpand
-#define Tk_PhotoExpand \
- (tkStubsPtr->tk_PhotoExpand) /* 148 */
+#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
-#define Tk_PhotoSetSize \
- (tkStubsPtr->tk_PhotoSetSize) /* 150 */
+#ifndef Tk_PhotoSetSize_Panic
+#define Tk_PhotoSetSize_Panic \
+ (tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */
#endif
#ifndef Tk_PointToChar
#define Tk_PointToChar \
@@ -2185,13 +2954,13 @@ extern TkStubs *tkStubsPtr;
#define Tk_SetCaretPos \
(tkStubsPtr->tk_SetCaretPos) /* 245 */
#endif
-#ifndef Tk_PhotoPutBlock
-#define Tk_PhotoPutBlock \
- (tkStubsPtr->tk_PhotoPutBlock) /* 246 */
+#ifndef Tk_PhotoPutBlock_Panic
+#define Tk_PhotoPutBlock_Panic \
+ (tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */
#endif
-#ifndef Tk_PhotoPutZoomedBlock
-#define Tk_PhotoPutZoomedBlock \
- (tkStubsPtr->tk_PhotoPutZoomedBlock) /* 247 */
+#ifndef Tk_PhotoPutZoomedBlock_Panic
+#define Tk_PhotoPutZoomedBlock_Panic \
+ (tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */
#endif
#ifndef Tk_CollapseMotionEvents
#define Tk_CollapseMotionEvents \
@@ -2261,6 +3030,42 @@ extern TkStubs *tkStubsPtr;
#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
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index afd6b15..8f181cd 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1,9 +1,9 @@
-/*
- * Entry.c --
+/*
+ * tkEntry.c --
*
* This module implements entry and spinbox widgets for the Tk toolkit.
- * An entry displays a string and allows the string to be edited.
- * A spinbox expands on the entry by adding up/down buttons that control
+ * An entry displays a string and allows the string to be edited. A
+ * spinbox expands on the entry by adding up/down buttons that control
* the value of the entry widget.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
@@ -11,32 +11,32 @@
* Copyright (c) 2000 Ajuba Solutions.
* Copyright (c) 2002 ActiveState Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "default.h"
#include "tkEntry.h"
-
/*
- * The following macro defines how many extra pixels to leave on each
- * side of the text in the entry.
+ * The following macro defines how many extra pixels to leave on each side of
+ * the text in the entry.
*/
#define XPAD 1
#define YPAD 1
/*
- * A comparison function for double values. For Spinboxes.
+ * A comparison function for double values. For Spinboxes.
*/
+
#define MIN_DBL_VAL 1E-9
#define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL)
static char *stateStrings[] = {
- "disabled", "normal", "readonly", (char *) NULL
+ "disabled", "normal", "readonly", NULL
};
/*
@@ -44,7 +44,7 @@ static char *stateStrings[] = {
*/
static char *validateStrings[] = {
- "all", "key", "focus", "focusin", "focusout", "none", (char *) NULL
+ "all", "key", "focus", "focusin", "focusout", "none", NULL
};
enum validateType {
VALIDATE_ALL, VALIDATE_KEY, VALIDATE_FOCUS,
@@ -61,115 +61,104 @@ enum validateType {
* Information used for Entry objv parsing.
*/
-static Tk_OptionSpec entryOptSpec[] = {
+static const Tk_OptionSpec entryOptSpec[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder),
0, (ClientData) DEF_ENTRY_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth),
- 0, 0, 0},
+ DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
- Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
- (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
+ "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
+ Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
{TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
- Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
+ "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
+ Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
- "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
- Tk_Offset(Entry, exportSelection), 0, 0, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
+ Tk_Offset(Entry, exportSelection), 0, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0,
- 0, 0},
+ DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG,
- -1, Tk_Offset(Entry, highlightBgColorPtr),
- 0, 0, 0},
+ -1, Tk_Offset(Entry, highlightBgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr),
- 0, 0, 0},
+ DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr), 0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1,
+ "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1,
Tk_Offset(Entry, highlightWidth), 0, 0, 0},
{TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground",
- DEF_ENTRY_INSERT_BG,
- -1, Tk_Offset(Entry, insertBorder),
- 0, 0, 0},
- {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth",
- "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1,
- Tk_Offset(Entry, insertBorderWidth), 0,
- (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0},
+ DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth",
+ "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1,
+ Tk_Offset(Entry, insertBorderWidth), 0,
+ (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0},
{TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime",
- DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime),
+ 0, 0, 0},
{TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
- DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime), 0, 0, 0},
{TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
- DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth), 0, 0, 0},
{TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand",
DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_SYNONYM, "-invcmd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
+ {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0},
{TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
- "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
- Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
- (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
+ "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
+ Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief),
- 0, 0, 0},
+ DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0},
{TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
- DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder),
- 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0},
- {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1,
- Tk_Offset(Entry, selBorderWidth),
- 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
+ DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder),
+ 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0},
+ {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
+ "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1,
+ Tk_Offset(Entry, selBorderWidth),
+ 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr),
TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
{TK_OPTION_STRING, "-show", "show", "Show",
- DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar),
- TK_OPTION_NULL_OK, 0, 0},
+ DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
- DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
- 0, (ClientData) stateStrings, 0},
+ DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
+ 0, (ClientData) stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus),
- TK_OPTION_NULL_OK, 0, 0},
+ DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate",
- DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate),
- 0, (ClientData) validateStrings, 0},
- {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand",
- (char *) NULL, -1, Tk_Offset(Entry, validateCmd),
- TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_SYNONYM, "-vcmd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-validatecommand", 0},
+ DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate),
+ 0, (ClientData) validateStrings, 0},
+ {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand",
+ NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-validatecommand", 0},
{TK_OPTION_INT, "-width", "width", "Width",
DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0},
{TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
@@ -189,20 +178,19 @@ static Tk_OptionSpec entryOptSpec[] = {
#define DEF_SPINBOX_VALUES ""
#define DEF_SPINBOX_WRAP "0"
-static Tk_OptionSpec sbOptSpec[] = {
+static const Tk_OptionSpec sbOptSpec[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background",
DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(Spinbox, activeBorder),
0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder),
0, (ClientData) DEF_ENTRY_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth),
- 0, 0, 0},
+ DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0},
{TK_OPTION_BORDER, "-buttonbackground", "Button.background", "Background",
DEF_BUTTON_BG_COLOR, -1, Tk_Offset(Spinbox, buttonBorder),
0, (ClientData) DEF_BUTTON_BG_MONO, 0},
@@ -210,11 +198,9 @@ static Tk_OptionSpec sbOptSpec[] = {
DEF_BUTTON_CURSOR, -1, Tk_Offset(Spinbox, bCursor),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_RELIEF, "-buttondownrelief", "Button.relief", "Relief",
- DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, bdRelief),
- 0, 0, 0},
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, bdRelief), 0, 0, 0},
{TK_OPTION_RELIEF, "-buttonuprelief", "Button.relief", "Relief",
- DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, buRelief),
- 0, 0, 0},
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, buRelief), 0, 0, 0},
{TK_OPTION_STRING, "-command", "command", "Command",
DEF_SPINBOX_CMD, -1, Tk_Offset(Spinbox, command),
TK_OPTION_NULL_OK, 0, 0},
@@ -222,22 +208,21 @@ static Tk_OptionSpec sbOptSpec[] = {
DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
- "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
- Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
- (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
+ "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
+ Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
{TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
- "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
- Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
+ "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
+ Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
- "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
- Tk_Offset(Entry, exportSelection), 0, 0, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
+ Tk_Offset(Entry, exportSelection), 0, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0,
- 0, 0},
+ DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0, 0, 0},
{TK_OPTION_STRING, "-format", "format", "Format",
DEF_SPINBOX_FORMAT, -1, Tk_Offset(Spinbox, reqFormat),
TK_OPTION_NULL_OK, 0, 0},
@@ -245,84 +230,77 @@ static Tk_OptionSpec sbOptSpec[] = {
DEF_SPINBOX_FROM, -1, Tk_Offset(Spinbox, fromValue), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG,
- -1, Tk_Offset(Entry, highlightBgColorPtr),
- 0, 0, 0},
+ -1, Tk_Offset(Entry, highlightBgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr),
- 0, 0, 0},
+ DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr), 0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1,
+ "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1,
Tk_Offset(Entry, highlightWidth), 0, 0, 0},
{TK_OPTION_DOUBLE, "-increment", "increment", "Increment",
DEF_SPINBOX_INCREMENT, -1, Tk_Offset(Spinbox, increment), 0, 0, 0},
{TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground",
- DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder),
- 0, 0, 0},
- {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth",
- "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1,
- Tk_Offset(Entry, insertBorderWidth), 0,
- (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0},
+ DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth",
+ "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1,
+ Tk_Offset(Entry, insertBorderWidth), 0,
+ (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0},
{TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime",
- DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime),
+ 0, 0, 0},
{TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
- DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime), 0, 0, 0},
{TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
- DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth),
- 0, 0, 0},
+ DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth), 0, 0, 0},
{TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand",
DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_SYNONYM, "-invcmd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
+ {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief),
- 0, 0, 0},
+ DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0},
{TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
- "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
- Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
- (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
+ "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
+ Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
{TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
- DEF_SPINBOX_REPEAT_DELAY, -1, Tk_Offset(Spinbox, repeatDelay),
- 0, 0, 0},
+ DEF_SPINBOX_REPEAT_DELAY, -1, Tk_Offset(Spinbox, repeatDelay),
+ 0, 0, 0},
{TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
- DEF_SPINBOX_REPEAT_INTERVAL, -1, Tk_Offset(Spinbox, repeatInterval),
- 0, 0, 0},
+ DEF_SPINBOX_REPEAT_INTERVAL, -1, Tk_Offset(Spinbox, repeatInterval),
+ 0, 0, 0},
{TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
- DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder),
- 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0},
- {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
- "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1,
- Tk_Offset(Entry, selBorderWidth),
- 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
+ DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder),
+ 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0},
+ {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
+ "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1,
+ Tk_Offset(Entry, selBorderWidth),
+ 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr),
TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
- DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
- 0, (ClientData) stateStrings, 0},
+ DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
+ 0, (ClientData) stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus),
- TK_CONFIG_NULL_OK, 0, 0},
+ DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus),
+ TK_CONFIG_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName),
TK_CONFIG_NULL_OK, 0, 0},
{TK_OPTION_DOUBLE, "-to", "to", "To",
DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate",
- DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate),
- 0, (ClientData) validateStrings, 0},
- {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand",
- (char *) NULL, -1, Tk_Offset(Entry, validateCmd),
- TK_CONFIG_NULL_OK, 0, 0},
+ DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate),
+ 0, (ClientData) validateStrings, 0},
+ {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand",
+ NULL, -1, Tk_Offset(Entry, validateCmd), TK_CONFIG_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-values", "values", "Values",
- DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr),
- TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_SYNONYM, "-vcmd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-validatecommand", 0},
+ DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-validatecommand", 0},
{TK_OPTION_INT, "-width", "width", "Width",
DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0},
{TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap",
@@ -330,29 +308,28 @@ static Tk_OptionSpec sbOptSpec[] = {
{TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd),
TK_CONFIG_NULL_OK, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
- * The following tables define the entry widget commands (and sub-
- * commands) and map the indexes into the string tables into
- * enumerated types used to dispatch the entry widget command.
+ * The following tables define the entry widget commands (and sub-commands)
+ * and map the indexes into the string tables into enumerated types used to
+ * dispatch the entry widget command.
*/
static CONST char *entryCmdNames[] = {
- "bbox", "cget", "configure", "delete", "get", "icursor", "index",
- "insert", "scan", "selection", "validate", "xview", (char *) NULL
+ "bbox", "cget", "configure", "delete", "get", "icursor", "index",
+ "insert", "scan", "selection", "validate", "xview", NULL
};
enum entryCmd {
- COMMAND_BBOX, COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DELETE,
- COMMAND_GET, COMMAND_ICURSOR, COMMAND_INDEX, COMMAND_INSERT,
+ COMMAND_BBOX, COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DELETE,
+ COMMAND_GET, COMMAND_ICURSOR, COMMAND_INDEX, COMMAND_INSERT,
COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW
};
static CONST char *selCmdNames[] = {
- "adjust", "clear", "from", "present", "range", "to", (char *) NULL
+ "adjust", "clear", "from", "present", "range", "to", NULL
};
enum selCmd {
@@ -361,31 +338,30 @@ enum selCmd {
};
/*
- * The following tables define the spinbox widget commands (and sub-
- * commands) and map the indexes into the string tables into
- * enumerated types used to dispatch the spinbox widget command.
+ * The following tables define the spinbox widget commands (and sub-commands)
+ * and map the indexes into the string tables into enumerated types used to
+ * dispatch the spinbox widget command.
*/
static CONST char *sbCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "identify",
"index", "insert", "invoke", "scan", "selection", "set",
- "validate", "xview", (char *) NULL
+ "validate", "xview", NULL
};
enum sbCmd {
- SB_CMD_BBOX, SB_CMD_CGET, SB_CMD_CONFIGURE, SB_CMD_DELETE,
+ SB_CMD_BBOX, SB_CMD_CGET, SB_CMD_CONFIGURE, SB_CMD_DELETE,
SB_CMD_GET, SB_CMD_ICURSOR, SB_CMD_IDENTIFY, SB_CMD_INDEX,
SB_CMD_INSERT, SB_CMD_INVOKE, SB_CMD_SCAN, SB_CMD_SELECTION,
SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW
};
static CONST char *sbSelCmdNames[] = {
- "adjust", "clear", "element", "from", "present", "range", "to",
- (char *) NULL
+ "adjust", "clear", "element", "from", "present", "range", "to", NULL
};
enum sbselCmd {
- SB_SEL_ADJUST, SB_SEL_CLEAR, SB_SEL_ELEMENT, SB_SEL_FROM,
+ SB_SEL_ADJUST, SB_SEL_CLEAR, SB_SEL_ELEMENT, SB_SEL_FROM,
SB_SEL_PRESENT, SB_SEL_RANGE, SB_SEL_TO
};
@@ -393,91 +369,80 @@ enum sbselCmd {
* Extra for selection of elements
*/
-/*
- * This is the string array corresponding to the enum in selelement.
- * If you modify them, you must modify the strings here.
+/*
+ * This is the string array corresponding to the enum in selelement. If you
+ * modify them, you must modify the strings here.
*/
-
+
static CONST char *selElementNames[] = {
- "none", "buttondown", "buttonup", (char *) NULL, "entry"
+ "none", "buttondown", "buttonup", NULL, "entry"
};
+
/*
- * Flags for GetEntryIndex procedure:
+ * Flags for GetEntryIndex function:
*/
#define ZERO_OK 1
#define LAST_PLUS_ONE_OK 2
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static int ConfigureEntry _ANSI_ARGS_((Tcl_Interp *interp,
- Entry *entryPtr, int objc,
- Tcl_Obj *CONST objv[], int flags));
-static void DeleteChars _ANSI_ARGS_((Entry *entryPtr, int index,
- int count));
-static void DestroyEntry _ANSI_ARGS_((char *memPtr));
-static void DisplayEntry _ANSI_ARGS_((ClientData clientData));
-static void EntryBlinkProc _ANSI_ARGS_((ClientData clientData));
-static void EntryCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void EntryComputeGeometry _ANSI_ARGS_((Entry *entryPtr));
-static void EntryEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void EntryFocusProc _ANSI_ARGS_ ((Entry *entryPtr,
- int gotFocus));
-static int EntryFetchSelection _ANSI_ARGS_((ClientData clientData,
- int offset, char *buffer, int maxBytes));
-static void EntryLostSelection _ANSI_ARGS_((
- ClientData clientData));
-static void EventuallyRedraw _ANSI_ARGS_((Entry *entryPtr));
-static void EntryScanTo _ANSI_ARGS_((Entry *entryPtr, int y));
-static void EntrySetValue _ANSI_ARGS_((Entry *entryPtr,
- CONST char *value));
-static void EntrySelectTo _ANSI_ARGS_((
- Entry *entryPtr, int index));
-static char * EntryTextVarProc _ANSI_ARGS_((ClientData clientData,
+static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr,
+ 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);
+static void EntryBlinkProc(ClientData clientData);
+static void EntryCmdDeletedProc(ClientData clientData);
+static void EntryComputeGeometry(Entry *entryPtr);
+static void EntryEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void EntryFocusProc(Entry *entryPtr, int gotFocus);
+static int EntryFetchSelection(ClientData clientData, int offset,
+ char *buffer, int maxBytes);
+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 EntrySelectTo(Entry *entryPtr, int index);
+static char * EntryTextVarProc(ClientData clientData,
Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags));
-static void EntryUpdateScrollbar _ANSI_ARGS_((Entry *entryPtr));
-static int EntryValidate _ANSI_ARGS_((Entry *entryPtr,
- char *cmd));
-static int EntryValidateChange _ANSI_ARGS_((Entry *entryPtr,
- char *change, CONST char *new, int index,
- int type));
-static void ExpandPercents _ANSI_ARGS_((Entry *entryPtr,
- CONST char *before, char *change, CONST char *new,
- int index, int type, Tcl_DString *dsPtr));
-static void EntryValueChanged _ANSI_ARGS_((Entry *entryPtr,
- CONST char *newValue));
-static void EntryVisibleRange _ANSI_ARGS_((Entry *entryPtr,
- double *firstPtr, double *lastPtr));
-static int EntryWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static void EntryWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static int GetEntryIndex _ANSI_ARGS_((Tcl_Interp *interp,
- Entry *entryPtr, char *string, int *indexPtr));
-static void InsertChars _ANSI_ARGS_((Entry *entryPtr, int index,
- char *string));
+ 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,
+ int type, Tcl_DString *dsPtr);
+static void EntryValueChanged(Entry *entryPtr,
+ 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[]);
+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);
/*
* These forward declarations are the spinbox specific ones:
*/
-static int SpinboxWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static int GetSpinboxElement _ANSI_ARGS_((Spinbox *sbPtr,
- int x, int y));
-static int SpinboxInvoke _ANSI_ARGS_((Tcl_Interp *interp,
- Spinbox *sbPtr, int element));
-static int ComputeFormat _ANSI_ARGS_((Spinbox *sbPtr));
+static int SpinboxWidgetObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static int GetSpinboxElement(Spinbox *sbPtr, int x, int y);
+static int SpinboxInvoke(Tcl_Interp *interp, Spinbox *sbPtr,
+ int element);
+static int ComputeFormat(Spinbox *sbPtr);
/*
- * The structure below defines widget class behavior by means of procedures
+ * The structure below defines widget class behavior by means of functions
* that can be invoked from generic window code.
*/
@@ -492,9 +457,8 @@ static Tk_ClassProcs entryClass = {
*
* Tk_EntryObjCmd --
*
- * This procedure is invoked to process the "entry" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This function is invoked to process the "entry" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -506,11 +470,11 @@ static Tk_ClassProcs entryClass = {
*/
int
-Tk_EntryObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_EntryObjCmd(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
register Entry *entryPtr;
Tk_OptionTable optionTable;
@@ -523,27 +487,27 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
}
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
/*
- * Create the option table for this widget class. If it has already
- * been created, Tk will return the cached value.
+ * Create the option table for this widget class. If it has already been
+ * created, Tk will return the cached value.
*/
optionTable = Tk_CreateOptionTable(interp, entryOptSpec);
/*
- * Initialize the fields of the structure that won't be initialized
- * by ConfigureEntry, or that ConfigureEntry requires to be
- * initialized already (e.g. resource pointers). Only the non-NULL/0
- * data must be initialized as memset covers the rest.
+ * Initialize the fields of the structure that won't be initialized by
+ * ConfigureEntry, or that ConfigureEntry requires to be initialized
+ * already (e.g. resource pointers). Only the non-NULL/0 data must be
+ * initialized as memset covers the rest.
*/
entryPtr = (Entry *) ckalloc(sizeof(Entry));
- memset((VOID *) entryPtr, 0, sizeof(Entry));
+ memset(entryPtr, 0, sizeof(Entry));
entryPtr->tkwin = tkwin;
entryPtr->display = Tk_Display(tkwin);
@@ -573,7 +537,7 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
entryPtr->validate = VALIDATE_NONE;
/*
- * Keep a hold of the associated tkwin until we destroy the listbox,
+ * Keep a hold of the associated tkwin until we destroy the entry,
* otherwise Tk might free it while we still need it.
*/
@@ -603,9 +567,9 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
*
* EntryWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -617,11 +581,11 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
*/
static int
-EntryWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about entry widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+EntryWidgetObjCmd(
+ ClientData clientData, /* Information about entry widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
Entry *entryPtr = (Entry *) clientData;
int cmdIndex, selIndex, result;
@@ -632,9 +596,9 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
- /*
- * Parse the widget command by looking up the second token in
- * the list of valid command names.
+ /*
+ * Parse the widget command by looking up the second token in the list of
+ * valid command names.
*/
result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames,
@@ -645,398 +609,381 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
Tcl_Preserve((ClientData) entryPtr);
switch ((enum entryCmd) cmdIndex) {
- case COMMAND_BBOX: {
- int index, x, y, width, height;
- char buf[TCL_INTEGER_SPACE * 4];
+ case COMMAND_BBOX: {
+ int index, x, y, width, height;
+ char buf[TCL_INTEGER_SPACE * 4];
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- if ((index == entryPtr->numChars) && (index > 0)) {
- index--;
- }
- Tk_CharBbox(entryPtr->textLayout, index, &x, &y,
- &width, &height);
- sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX,
- y + entryPtr->layoutY, width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- break;
- }
-
- case COMMAND_CGET: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option");
- goto error;
- }
-
- objPtr = Tk_GetOptionValue(interp, (char *) entryPtr,
- entryPtr->optionTable, objv[2], entryPtr->tkwin);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if ((index == entryPtr->numChars) && (index > 0)) {
+ index--;
+ }
+ Tk_CharBbox(entryPtr->textLayout, index, &x, &y, &width, &height);
+ sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX,
+ y + entryPtr->layoutY, width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ break;
+ }
+
+ case COMMAND_CGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ goto error;
+ }
+
+ objPtr = Tk_GetOptionValue(interp, (char *) entryPtr,
+ entryPtr->optionTable, objv[2], entryPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ break;
+
+ case COMMAND_CONFIGURE:
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
+ entryPtr->optionTable,
+ (objc == 3) ? objv[2] : NULL,
+ entryPtr->tkwin);
if (objPtr == NULL) {
- goto error;
+ goto error;
} else {
Tcl_SetObjResult(interp, objPtr);
}
- break;
+ } else {
+ result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
}
+ break;
- case COMMAND_CONFIGURE: {
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
- entryPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- entryPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
- } else {
- result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
- }
- break;
+ case COMMAND_DELETE: {
+ int first, last;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &first) != TCL_OK) {
+ goto error;
+ }
+ if (objc == 3) {
+ last = first + 1;
+ } else if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
+ &last) != TCL_OK) {
+ goto error;
}
+ if ((last >= first) && (entryPtr->state == STATE_NORMAL)) {
+ DeleteChars(entryPtr, first, last - first);
+ }
+ break;
+ }
- case COMMAND_DELETE: {
- int first, last;
+ case COMMAND_GET:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ goto error;
+ }
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ break;
- if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &first) != TCL_OK) {
- goto error;
- }
- if (objc == 3) {
- last = first + 1;
- } else {
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
- &last) != TCL_OK) {
- goto error;
- }
- }
- if ((last >= first) && (entryPtr->state == STATE_NORMAL)) {
- DeleteChars(entryPtr, first, last - first);
- }
- break;
+ case COMMAND_ICURSOR:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pos");
+ goto error;
}
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &entryPtr->insertPos) != TCL_OK) {
+ goto error;
+ }
+ EventuallyRedraw(entryPtr);
+ break;
- case COMMAND_GET: {
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
- goto error;
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
- break;
+ case COMMAND_INDEX: {
+ int index;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "string");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
}
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
+ break;
+ }
- case COMMAND_ICURSOR: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "pos");
+ case COMMAND_INSERT: {
+ int index;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index text");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->state == STATE_NORMAL) {
+ InsertChars(entryPtr, index, Tcl_GetString(objv[3]));
+ }
+ break;
+ }
+
+ case COMMAND_SCAN: {
+ int x;
+ char *minorCmd;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
+ goto error;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
+ goto error;
+ }
+
+ minorCmd = Tcl_GetString(objv[2]);
+ if (minorCmd[0] == 'm'
+ && (strncmp(minorCmd, "mark", strlen(minorCmd)) == 0)) {
+ entryPtr->scanMarkX = x;
+ entryPtr->scanMarkIndex = entryPtr->leftIndex;
+ } else if ((minorCmd[0] == 'd')
+ && (strncmp(minorCmd, "dragto", strlen(minorCmd)) == 0)) {
+ EntryScanTo(entryPtr, x);
+ } else {
+ Tcl_AppendResult(interp, "bad scan option \"",
+ Tcl_GetString(objv[2]), "\": must be mark or dragto",
+ NULL);
+ goto error;
+ }
+ break;
+ }
+
+ case COMMAND_SELECTION: {
+ int index, index2;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ goto error;
+ }
+
+ /*
+ * Parse the selection sub-command, using the command table
+ * "selCmdNames" defined above.
+ */
+
+ result = Tcl_GetIndexFromObj(interp, objv[2], selCmdNames,
+ "selection option", 0, &selIndex);
+ if (result != TCL_OK) {
+ goto error;
+ }
+
+ /*
+ * Disabled entries don't allow the selection to be modified, but
+ * 'selection present' must return a boolean.
+ */
+
+ if ((entryPtr->state == STATE_DISABLED)
+ && (selIndex != SELECTION_PRESENT)) {
+ goto done;
+ }
+
+ switch (selIndex) {
+ case SELECTION_ADJUST:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &entryPtr->insertPos) != TCL_OK) {
- goto error;
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
}
- EventuallyRedraw(entryPtr);
+ if (entryPtr->selectFirst >= 0) {
+ int half1, half2;
+
+ half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2;
+ half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2;
+ if (index < half1) {
+ entryPtr->selectAnchor = entryPtr->selectLast;
+ } else if (index > half2) {
+ entryPtr->selectAnchor = entryPtr->selectFirst;
+ } else {
+ /*
+ * We're at about the halfway point in the selection; just
+ * keep the existing anchor.
+ */
+ }
+ }
+ EntrySelectTo(entryPtr, index);
break;
- }
-
- case COMMAND_INDEX: {
- int index;
+ case SELECTION_CLEAR:
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "string");
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
+ if (entryPtr->selectFirst >= 0) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+ EventuallyRedraw(entryPtr);
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
- break;
- }
-
- case COMMAND_INSERT: {
- int index;
+ goto done;
+ case SELECTION_FROM:
if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "index text");
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- if (entryPtr->state == STATE_NORMAL) {
- InsertChars(entryPtr, index, Tcl_GetString(objv[3]));
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
}
+ entryPtr->selectAnchor = index;
break;
- }
- case COMMAND_SCAN: {
- int x;
- char *minorCmd;
+ case SELECTION_PRESENT:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
+ goto error;
+ }
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj((entryPtr->selectFirst >= 0)));
+ goto done;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
+ case SELECTION_RANGE:
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 3, objv, "start end");
goto error;
}
- if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
- goto error;
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
+ &index) != TCL_OK) {
+ goto error;
}
-
- minorCmd = Tcl_GetString(objv[2]);
- if (minorCmd[0] == 'm'
- && (strncmp(minorCmd, "mark", strlen(minorCmd)) == 0)) {
- entryPtr->scanMarkX = x;
- entryPtr->scanMarkIndex = entryPtr->leftIndex;
- } else if ((minorCmd[0] == 'd')
- && (strncmp(minorCmd, "dragto", strlen(minorCmd)) == 0)) {
- EntryScanTo(entryPtr, x);
- } else {
- Tcl_AppendResult(interp, "bad scan option \"",
- Tcl_GetString(objv[2]), "\": must be mark or dragto",
- (char *) NULL);
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[4]),
+ &index2) != TCL_OK) {
goto error;
}
+ if (index >= index2) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+ } else {
+ entryPtr->selectFirst = index;
+ entryPtr->selectLast = index2;
+ }
+ if (!(entryPtr->flags & GOT_SELECTION)
+ && (entryPtr->exportSelection)) {
+ Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
+ EntryLostSelection, (ClientData) entryPtr);
+ entryPtr->flags |= GOT_SELECTION;
+ }
+ EventuallyRedraw(entryPtr);
break;
- }
-
- case COMMAND_SELECTION: {
- int index, index2;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ case SELECTION_TO:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
-
- /*
- * Parse the selection sub-command, using the command
- * table "selCmdNames" defined above.
- */
-
- result = Tcl_GetIndexFromObj(interp, objv[2], selCmdNames,
- "selection option", 0, &selIndex);
- if (result != TCL_OK) {
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
goto error;
}
+ EntrySelectTo(entryPtr, index);
+ break;
+ }
+ break;
+ }
- /*
- * Disabled entries don't allow the selection to be modified,
- * but 'selection present' must return a boolean.
- */
-
- if ((entryPtr->state == STATE_DISABLED)
- && (selIndex != SELECTION_PRESENT)) {
- goto done;
- }
-
- switch (selIndex) {
- case SELECTION_ADJUST: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- if (entryPtr->selectFirst >= 0) {
- int half1, half2;
-
- half1 = (entryPtr->selectFirst
- + entryPtr->selectLast)/2;
- half2 = (entryPtr->selectFirst
- + entryPtr->selectLast + 1)/2;
- if (index < half1) {
- entryPtr->selectAnchor = entryPtr->selectLast;
- } else if (index > half2) {
- entryPtr->selectAnchor = entryPtr->selectFirst;
- } else {
- /*
- * We're at about the halfway point in the
- * selection; just keep the existing anchor.
- */
- }
- }
- EntrySelectTo(entryPtr, index);
- break;
- }
-
- case SELECTION_CLEAR: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
- goto error;
- }
- if (entryPtr->selectFirst >= 0) {
- entryPtr->selectFirst = -1;
- entryPtr->selectLast = -1;
- EventuallyRedraw(entryPtr);
- }
- goto done;
- }
-
- case SELECTION_FROM: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- entryPtr->selectAnchor = index;
- break;
- }
-
- case SELECTION_PRESENT: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
- goto error;
- }
- Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj((entryPtr->selectFirst >= 0)));
- goto done;
- }
+ case COMMAND_VALIDATE: {
+ int code;
- case SELECTION_RANGE: {
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 3, objv, "start end");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[4]),& index2) != TCL_OK) {
- goto error;
- }
- if (index >= index2) {
- entryPtr->selectFirst = -1;
- entryPtr->selectLast = -1;
- } else {
- entryPtr->selectFirst = index;
- entryPtr->selectLast = index2;
- }
- if (!(entryPtr->flags & GOT_SELECTION)
- && (entryPtr->exportSelection)) {
- Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
- EntryLostSelection, (ClientData) entryPtr);
- entryPtr->flags |= GOT_SELECTION;
- }
- EventuallyRedraw(entryPtr);
- break;
- }
-
- case SELECTION_TO: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- EntrySelectTo(entryPtr, index);
- break;
- }
- }
- break;
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ goto error;
+ }
+ selIndex = entryPtr->validate;
+ entryPtr->validate = VALIDATE_ALL;
+ code = EntryValidateChange(entryPtr, NULL, entryPtr->string,
+ -1, VALIDATE_FORCED);
+ if (entryPtr->validate != VALIDATE_NONE) {
+ entryPtr->validate = selIndex;
}
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
+ break;
+ }
- case COMMAND_VALIDATE: {
- int code;
+ case COMMAND_XVIEW: {
+ int index;
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ if (objc == 2) {
+ double first, last;
+ char buf[TCL_DOUBLE_SPACE];
+
+ EntryVisibleRange(entryPtr, &first, &last);
+ Tcl_PrintDouble(NULL, first, buf);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, last, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
+ goto done;
+ } else if (objc == 3) {
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
goto error;
}
- selIndex = entryPtr->validate;
- entryPtr->validate = VALIDATE_ALL;
- code = EntryValidateChange(entryPtr, (char *) NULL,
- entryPtr->string, -1, VALIDATE_FORCED);
- if (entryPtr->validate != VALIDATE_NONE) {
- entryPtr->validate = selIndex;
- }
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
- break;
- }
+ } else {
+ double fraction;
+ int count;
- case COMMAND_XVIEW: {
- int index;
-
- if (objc == 2) {
- double first, last;
- char buf[TCL_DOUBLE_SPACE * 2];
-
- EntryVisibleRange(entryPtr, &first, &last);
- sprintf(buf, "%g %g", first, last);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- goto done;
- } else if (objc == 3) {
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- } else {
- double fraction;
- int count;
-
- index = entryPtr->leftIndex;
- switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
- &count)) {
- case TK_SCROLL_ERROR: {
- goto error;
- }
- case TK_SCROLL_MOVETO: {
- index = (int) ((fraction * entryPtr->numChars) + 0.5);
- break;
- }
- case TK_SCROLL_PAGES: {
- int charsPerPage;
-
- charsPerPage = ((Tk_Width(entryPtr->tkwin)
- - 2 * entryPtr->inset)
- / entryPtr->avgWidth) - 2;
- if (charsPerPage < 1) {
- charsPerPage = 1;
- }
- index += count * charsPerPage;
- break;
- }
- case TK_SCROLL_UNITS: {
- index += count;
- break;
- }
+ index = entryPtr->leftIndex;
+ switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
+ &count)) {
+ case TK_SCROLL_ERROR:
+ goto error;
+ case TK_SCROLL_MOVETO:
+ index = (int) ((fraction * entryPtr->numChars) + 0.5);
+ break;
+ case TK_SCROLL_PAGES: {
+ int charsPerPage;
+
+ charsPerPage = ((Tk_Width(entryPtr->tkwin)
+ - 2 * entryPtr->inset) / entryPtr->avgWidth) - 2;
+ if (charsPerPage < 1) {
+ charsPerPage = 1;
}
+ index += count * charsPerPage;
+ break;
}
- if (index >= entryPtr->numChars) {
- index = entryPtr->numChars - 1;
- }
- if (index < 0) {
- index = 0;
+ case TK_SCROLL_UNITS:
+ index += count;
+ break;
}
- entryPtr->leftIndex = index;
- entryPtr->flags |= UPDATE_SCROLLBAR;
- EntryComputeGeometry(entryPtr);
- EventuallyRedraw(entryPtr);
- break;
}
+ if (index >= entryPtr->numChars) {
+ index = entryPtr->numChars - 1;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ entryPtr->leftIndex = index;
+ entryPtr->flags |= UPDATE_SCROLLBAR;
+ EntryComputeGeometry(entryPtr);
+ EventuallyRedraw(entryPtr);
+ break;
+ }
}
- done:
+ done:
Tcl_Release((ClientData) entryPtr);
return result;
- error:
+ error:
Tcl_Release((ClientData) entryPtr);
return TCL_ERROR;
}
@@ -1046,9 +993,9 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
*
* DestroyEntry --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of an entry at a safe time
- * (when no-one is using it anymore).
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of an entry at a safe time (when no-one is
+ * using it anymore).
*
* Results:
* None.
@@ -1060,15 +1007,14 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
*/
static void
-DestroyEntry(memPtr)
- char *memPtr; /* Info about entry widget. */
+DestroyEntry(
+ char *memPtr) /* Info about entry widget. */
{
Entry *entryPtr = (Entry *) memPtr;
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeOptions handle all the standard option-related stuff.
*/
ckfree((char *)entryPtr->string);
@@ -1113,43 +1059,43 @@ DestroyEntry(memPtr)
*
* ConfigureEntry --
*
- * This procedure is called to process an argv/argc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * an entry widget.
+ * This function is called to process an argv/argc list, plus the Tk
+ * option database, in order to configure (or reconfigure) an entry
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as colors, border width,
- * etc. get set for entryPtr; old resources get freed,
- * if there were any.
+ * Configuration information, such as colors, border width, etc. get set
+ * for entryPtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureEntry(interp, entryPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Entry *entryPtr; /* Information about widget; may or may not
+ConfigureEntry(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ int objc, /* Number of valid entries in argv. */
+ Tcl_Obj *CONST objv[], /* Argument objects. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
Tk_3DBorder border;
Tcl_Obj *errorResult = NULL;
- Spinbox *sbPtr = (Spinbox *) entryPtr; /* Only used when this widget
- * is of type TK_SPINBOX */
- char *oldValues = NULL; /* lint initialization */
- char *oldFormat = NULL; /* lint initialization */
+ Spinbox *sbPtr = (Spinbox *) entryPtr;
+ /* Only used when this widget is of type
+ * TK_SPINBOX */
+ char *oldValues = NULL; /* lint initialization */
+ char *oldFormat = NULL; /* lint initialization */
int error;
- int oldExport = 0; /* lint initialization */
- int valuesChanged = 0; /* lint initialization */
- double oldFrom = 0.0; /* lint initialization */
- double oldTo = 0.0; /* lint initialization */
+ int oldExport = 0; /* lint initialization */
+ int valuesChanged = 0; /* lint initialization */
+ double oldFrom = 0.0; /* lint initialization */
+ double oldTo = 0.0; /* lint initialization */
/*
* Eliminate any existing trace on a variable monitored by the entry.
@@ -1157,16 +1103,17 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
if ((entryPtr->textVarName != NULL)
&& (entryPtr->flags & ENTRY_VAR_TRACED)) {
- Tcl_UntraceVar(interp, entryPtr->textVarName,
+ Tcl_UntraceVar(interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
EntryTextVarProc, (ClientData) entryPtr);
entryPtr->flags &= ~ENTRY_VAR_TRACED;
}
/*
- * Store old values that we need to effect certain behavior if
- * they change value
+ * Store old values that we need to effect certain behavior if they change
+ * value.
*/
+
oldExport = entryPtr->exportSelection;
if (entryPtr->type == TK_SPINBOX) {
oldValues = sbPtr->valueStr;
@@ -1183,7 +1130,7 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
if (Tk_SetOptions(interp, (char *) entryPtr,
entryPtr->optionTable, objc, objv,
- entryPtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ entryPtr->tkwin, &savedOptions, NULL) != TCL_OK) {
continue;
}
} else {
@@ -1233,6 +1180,7 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
* calculate the minimum space we'll need for the values as
* strings.
*/
+
int min, max;
size_t formatLen, formatSpace = TCL_DOUBLE_SPACE;
char fbuf[4], *fmt = sbPtr->reqFormat;
@@ -1241,7 +1189,7 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
if ((fmt[0] != '%') || (fmt[formatLen-1] != 'f')) {
badFormatOpt:
Tcl_AppendResult(interp, "bad spinbox format specifier \"",
- sbPtr->reqFormat, "\"", (char *) NULL);
+ sbPtr->reqFormat, "\"", NULL);
continue;
}
if ((sscanf(fmt, "%%%d.%d%[f]", &min, &max, fbuf) == 3)
@@ -1259,16 +1207,19 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
formatSpace = TCL_DOUBLE_SPACE;
}
sbPtr->formatBuf = ckrealloc(sbPtr->formatBuf, formatSpace);
+
/*
- * We perturb the value of oldFrom to allow us to go into
- * the branch below that will reformat the displayed value.
+ * We perturb the value of oldFrom to allow us to go into the
+ * branch below that will reformat the displayed value.
*/
+
oldFrom = sbPtr->fromValue - 1;
}
/*
- * See if we have to rearrange our listObj data
+ * See if we have to rearrange our listObj data.
*/
+
if (oldValues != sbPtr->valueStr) {
if (sbPtr->listObj != NULL) {
Tcl_DecrRefCount(sbPtr->listObj);
@@ -1294,13 +1245,14 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
}
/*
- * Restart the cursor timing sequence in case the on-time or
- * off-time just changed. Set validate temporarily to none,
- * so the configure doesn't cause it to be triggered.
+ * Restart the cursor timing sequence in case the on-time or off-time
+ * just changed. Set validate temporarily to none, so the configure
+ * doesn't cause it to be triggered.
*/
if (entryPtr->flags & GOT_FOCUS) {
int validate = entryPtr->validate;
+
entryPtr->validate = VALIDATE_NONE;
EntryFocusProc(entryPtr, 1);
entryPtr->validate = validate;
@@ -1311,8 +1263,8 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
*/
if (entryPtr->exportSelection && (!oldExport)
- && (entryPtr->selectFirst != -1)
- && !(entryPtr->flags & GOT_SELECTION)) {
+ && (entryPtr->selectFirst != -1)
+ && !(entryPtr->flags & GOT_SELECTION)) {
Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection,
(ClientData) entryPtr);
entryPtr->flags |= GOT_SELECTION;
@@ -1324,12 +1276,12 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
*/
Tk_SetInternalBorder(entryPtr->tkwin,
- entryPtr->borderWidth + entryPtr->highlightWidth);
+ entryPtr->borderWidth + entryPtr->highlightWidth);
if (entryPtr->highlightWidth <= 0) {
entryPtr->highlightWidth = 0;
}
- entryPtr->inset = entryPtr->highlightWidth
- + entryPtr->borderWidth + XPAD;
+ entryPtr->inset = entryPtr->highlightWidth
+ + entryPtr->borderWidth + XPAD;
break;
}
if (!error) {
@@ -1359,9 +1311,10 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
Tcl_Obj *objPtr;
/*
- * No check for error return, because there shouldn't be one
- * given the check for valid list above
+ * No check for error return, because there shouldn't be one given
+ * the check for valid list above.
*/
+
Tcl_ListObjIndex(interp, sbPtr->listObj, 0, &objPtr);
EntryValueChanged(entryPtr, Tcl_GetString(objPtr));
} else if ((sbPtr->valueStr == NULL)
@@ -1370,15 +1323,15 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
|| !DOUBLES_EQ(sbPtr->toValue, oldTo))) {
/*
* If the valueStr is empty and -from && -to are specified, check
- * to see if the current string is within the range. If not,
- * it will be constrained to the nearest edge. If the current
- * string isn't a double value, we set it to -from.
+ * to see if the current string is within the range. If not, it
+ * will be constrained to the nearest edge. If the current string
+ * isn't a double value, we set it to -from.
*/
- int code;
+
double dvalue;
- code = Tcl_GetDouble(NULL, entryPtr->string, &dvalue);
- if (code != TCL_OK) {
+ if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) {
+ /* Scan failure */
dvalue = sbPtr->fromValue;
} else {
if (dvalue > sbPtr->toValue) {
@@ -1393,8 +1346,8 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
}
/*
- * Set up a trace on the variable's value after we've possibly
- * constrained the value according to new -from/-to values.
+ * Set up a trace on the variable's value after we've possibly constrained
+ * the value according to new -from/-to values.
*/
if ((entryPtr->textVarName != NULL)
@@ -1407,11 +1360,11 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
EntryWorldChanged((ClientData) entryPtr);
if (error) {
- Tcl_SetObjResult(interp, errorResult);
+ Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
return TCL_ERROR;
} else {
- return TCL_OK;
+ return TCL_OK;
}
}
@@ -1420,22 +1373,22 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
*
* EntryWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Entry will be relayed out and redisplayed.
+ * Entry will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
static void
-EntryWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+EntryWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
GC gc = None;
@@ -1461,27 +1414,27 @@ EntryWorldChanged(instanceData)
}
/*
- * Default background and foreground are from the normal state.
- * In a disabled state, both of those may be overridden; in the readonly
- * state, the background may be overridden.
+ * Default background and foreground are from the normal state. In a
+ * disabled state, both of those may be overridden; in the readonly state,
+ * the background may be overridden.
*/
border = entryPtr->normalBorder;
colorPtr = entryPtr->fgColorPtr;
switch (entryPtr->state) {
- case STATE_DISABLED:
- if (entryPtr->disabledBorder != NULL) {
- border = entryPtr->disabledBorder;
- }
- if (entryPtr->dfgColorPtr != NULL) {
- colorPtr = entryPtr->dfgColorPtr;
- }
- break;
- case STATE_READONLY:
- if (entryPtr->readonlyBorder != NULL) {
- border = entryPtr->readonlyBorder;
- }
- break;
+ case STATE_DISABLED:
+ if (entryPtr->disabledBorder != NULL) {
+ border = entryPtr->disabledBorder;
+ }
+ if (entryPtr->dfgColorPtr != NULL) {
+ colorPtr = entryPtr->dfgColorPtr;
+ }
+ break;
+ case STATE_READONLY:
+ if (entryPtr->readonlyBorder != NULL) {
+ border = entryPtr->readonlyBorder;
+ }
+ break;
}
Tk_SetBackgroundFromBorder(entryPtr->tkwin, border);
@@ -1507,8 +1460,7 @@ EntryWorldChanged(instanceData)
entryPtr->selTextGC = gc;
/*
- * Recompute the window's geometry and arrange for it to be
- * redisplayed.
+ * Recompute the window's geometry and arrange for it to be redisplayed.
*/
EntryComputeGeometry(entryPtr);
@@ -1516,18 +1468,17 @@ EntryWorldChanged(instanceData)
EventuallyRedraw(entryPtr);
}
-#ifndef MAC_OSX_TK
+#ifndef MAC_OSX_TK
/*
*--------------------------------------------------------------
*
* TkpDrawEntryBorderAndFocus --
*
- * This procedure redraws the border of an entry widget.
- * 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 o, so platforms that don't
- * do special native drawing don't have to implement it.
+ * This function redraws the border of an entry widget. 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 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.
@@ -1539,26 +1490,24 @@ EntryWorldChanged(instanceData)
*/
int
-TkpDrawEntryBorderAndFocus(entryPtr, pixmap, isSpinbox)
- Entry *entryPtr;
- Drawable pixmap;
- int isSpinbox;
+TkpDrawEntryBorderAndFocus(
+ Entry *entryPtr,
+ Drawable pixmap,
+ int isSpinbox)
{
return 0;
}
-
-
+
/*
*--------------------------------------------------------------
*
* 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 function 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.
@@ -1570,20 +1519,20 @@ TkpDrawEntryBorderAndFocus(entryPtr, pixmap, isSpinbox)
*/
int
-TkpDrawSpinboxButtons(sbPtr, pixmap)
- Spinbox *sbPtr;
- Pixmap pixmap;
+TkpDrawSpinboxButtons(
+ Spinbox *sbPtr,
+ Pixmap pixmap)
{
return 0;
}
#endif /* Not MAC_OSX_TK */
-
+
/*
*--------------------------------------------------------------
*
* DisplayEntry --
*
- * This procedure redraws the contents of an entry window.
+ * This function redraws the contents of an entry window.
*
* Results:
* None.
@@ -1595,8 +1544,8 @@ TkpDrawSpinboxButtons(sbPtr, pixmap)
*/
static void
-DisplayEntry(clientData)
- ClientData clientData; /* Information about window. */
+DisplayEntry(
+ ClientData clientData) /* Information about window. */
{
Entry *entryPtr = (Entry *) clientData;
Tk_Window tkwin = entryPtr->tkwin;
@@ -1620,9 +1569,9 @@ DisplayEntry(clientData)
if (entryPtr->flags & UPDATE_SCROLLBAR) {
entryPtr->flags &= ~UPDATE_SCROLLBAR;
- /*
- * Preserve/Release because updating the scrollbar can have
- * the side-effect of destroying or unmapping the entry widget.
+ /*
+ * Preserve/Release because updating the scrollbar can have the
+ * side-effect of destroying or unmapping the entry widget.
*/
Tcl_Preserve((ClientData) entryPtr);
@@ -1637,10 +1586,10 @@ DisplayEntry(clientData)
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * In order to avoid screen flashes, this procedure redraws the
- * textual area of the entry into off-screen memory, then copies
- * it back on-screen in a single operation. This means there's
- * no point in time where the on-screen image has been cleared.
+ * In order to avoid screen flashes, this function redraws the textual
+ * area of the entry into off-screen memory, then copies it back on-screen
+ * in a single operation. This means there's no point in time where the
+ * on-screen image has been cleared.
*/
pixmap = Tk_GetPixmap(entryPtr->display, Tk_WindowId(tkwin),
@@ -1650,18 +1599,17 @@ DisplayEntry(clientData)
#endif /* TK_NO_DOUBLE_BUFFERING */
/*
- * Compute x-coordinate of the pixel just after last visible
- * one, plus vertical position of baseline of text.
+ * Compute x-coordinate of the pixel just after last visible one, plus
+ * vertical position of baseline of text.
*/
xBound = Tk_Width(tkwin) - entryPtr->inset - entryPtr->xWidth;
baseY = (Tk_Height(tkwin) + fm.ascent - fm.descent) / 2;
/*
- * On Windows and Mac, we need to hide the selection whenever we
- * don't have the focus.
+ * Hide the selection whenever we don't have the focus, unless we
+ * always want to show selection.
*/
-
if (TkpAlwaysShowSelection(entryPtr->tkwin)) {
showSelection = 1;
} else {
@@ -1669,9 +1617,9 @@ DisplayEntry(clientData)
}
/*
- * Draw the background in three layers. From bottom to top the
- * layers are: normal background, selection background, and
- * insertion cursor background.
+ * Draw the background in three layers. From bottom to top the layers are:
+ * normal background, selection background, and insertion cursor
+ * background.
*/
if ((entryPtr->state == STATE_DISABLED) &&
@@ -1711,16 +1659,16 @@ DisplayEntry(clientData)
MAC_OSX_ENTRY_SELECT_RELIEF
#endif
);
- }
+ }
}
/*
- * Draw a special background for the insertion cursor, overriding
- * even the selection background. As a special hack to keep the
- * cursor visible when the insertion cursor color is the same as
- * the color for selected text (e.g., on mono displays), write
- * background in the cursor area (instead of nothing) when the
- * cursor isn't on. Otherwise the selection would hide the cursor.
+ * Draw a special background for the insertion cursor, overriding even the
+ * selection background. As a special hack to keep the cursor visible when
+ * the insertion cursor color is the same as the color for selected text
+ * (e.g., on mono displays), write background in the cursor area (instead
+ * of nothing) when the cursor isn't on. Otherwise the selection would
+ * hide the cursor.
*/
if ((entryPtr->state == STATE_NORMAL) && (entryPtr->flags & GOT_FOCUS)) {
@@ -1730,25 +1678,22 @@ DisplayEntry(clientData)
cursorX -= (entryPtr->insertWidth)/2;
Tk_SetCaretPos(entryPtr->tkwin, cursorX, baseY - fm.ascent,
fm.ascent + fm.descent);
- if (entryPtr->insertPos >= entryPtr->leftIndex) {
- if (cursorX < xBound) {
- if (entryPtr->flags & CURSOR_ON) {
- Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder,
- cursorX, baseY - fm.ascent, entryPtr->insertWidth,
- fm.ascent + fm.descent,
- entryPtr->insertBorderWidth,
- TK_RELIEF_RAISED);
- } else if (entryPtr->insertBorder == entryPtr->selBorder) {
- Tk_Fill3DRectangle(tkwin, pixmap, border,
- cursorX, baseY - fm.ascent, entryPtr->insertWidth,
- fm.ascent + fm.descent, 0, TK_RELIEF_FLAT);
- }
+ if (entryPtr->insertPos >= entryPtr->leftIndex && cursorX < xBound) {
+ if (entryPtr->flags & CURSOR_ON) {
+ Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder,
+ cursorX, baseY - fm.ascent, entryPtr->insertWidth,
+ fm.ascent + fm.descent, entryPtr->insertBorderWidth,
+ TK_RELIEF_RAISED);
+ } else if (entryPtr->insertBorder == entryPtr->selBorder) {
+ Tk_Fill3DRectangle(tkwin, pixmap, border, cursorX,
+ baseY - fm.ascent, entryPtr->insertWidth,
+ fm.ascent + fm.descent, 0, TK_RELIEF_FLAT);
}
}
}
/*
- * Draw the text in two pieces: first the unselected portion, then the
+ * Draw the text in two pieces: first the unselected portion, then the
* selected portion on top of it.
*/
@@ -1778,17 +1723,18 @@ DisplayEntry(clientData)
/*
* Draw the spin button controls.
*/
- if (TkpDrawSpinboxButtons(sbPtr, pixmap) == 0) {
- xWidth = entryPtr->xWidth;
- pad = XPAD + 1;
- inset = entryPtr->inset - XPAD;
- startx = Tk_Width(tkwin) - (xWidth + inset);
- height = (Tk_Height(tkwin) - 2*inset)/2;
+
+ if (TkpDrawSpinboxButtons(sbPtr, pixmap) == 0) {
+ xWidth = entryPtr->xWidth;
+ pad = XPAD + 1;
+ inset = entryPtr->inset - XPAD;
+ startx = Tk_Width(tkwin) - (xWidth + inset);
+ height = (Tk_Height(tkwin) - 2*inset)/2;
#if 0
- Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
- startx, inset, xWidth, height, 1, sbPtr->buRelief);
- Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
- startx, inset+height, xWidth, height, 1, sbPtr->bdRelief);
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset, xWidth, height, 1, sbPtr->buRelief);
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset+height, xWidth, height, 1, sbPtr->bdRelief);
#else
Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
startx, inset, xWidth, height, 1,
@@ -1799,90 +1745,97 @@ DisplayEntry(clientData)
(sbPtr->selElement == SEL_BUTTONDOWN) ?
TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
#endif
-
- xWidth -= 2*pad;
- /*
- * Only draw the triangles if we have enough display space
- */
- if ((xWidth > 1)) {
- XPoint points[3];
- int starty, space, offset;
-
- space = height - 2*pad;
- /*
- * Ensure width of triangle is odd to guarantee a sharp tip
- */
- if (!(xWidth % 2)) {
- xWidth++;
- }
- tHeight = (xWidth + 1) / 2;
- if (tHeight > space) {
- tHeight = space;
- }
- space = (space - tHeight) / 2;
- startx += pad;
- starty = inset + height - pad - space;
- offset = (sbPtr->selElement == SEL_BUTTONUP);
- /*
- * The points are slightly different for the up and down arrows
- * because (for *.x), we need to account for a bug in the way
- * XFillPolygon draws triangles, and we want to shift
- * the arrows differently when allowing for depressed behavior.
- */
- points[0].x = startx + offset;
- points[0].y = starty + (offset ? 0 : -1);
- points[1].x = startx + xWidth/2 + offset;
- points[1].y = starty - tHeight + (offset ? 0 : -1);
- points[2].x = startx + xWidth + offset;
- points[2].y = points[0].y;
- XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
- points, 3, Convex, CoordModeOrigin);
-
- starty = inset + height + pad + space;
- offset = (sbPtr->selElement == SEL_BUTTONDOWN);
- points[0].x = startx + 1 + offset;
- points[0].y = starty + (offset ? 1 : 0);
- points[1].x = startx + xWidth/2 + offset;
- points[1].y = starty + tHeight + (offset ? 0 : -1);
- points[2].x = startx - 1 + xWidth + offset;
- points[2].y = points[0].y;
- XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
- points, 3, Convex, CoordModeOrigin);
- }
- }
+
+ xWidth -= 2*pad;
+
+ /*
+ * Only draw the triangles if we have enough display space
+ */
+
+ if ((xWidth > 1)) {
+ XPoint points[3];
+ int starty, space, offset;
+
+ space = height - 2*pad;
+
+ /*
+ * Ensure width of triangle is odd to guarantee a sharp tip
+ */
+
+ if (!(xWidth % 2)) {
+ xWidth++;
+ }
+ tHeight = (xWidth + 1) / 2;
+ if (tHeight > space) {
+ tHeight = space;
+ }
+ space = (space - tHeight) / 2;
+ startx += pad;
+ starty = inset + height - pad - space;
+ offset = (sbPtr->selElement == SEL_BUTTONUP);
+
+ /*
+ * The points are slightly different for the up and down
+ * arrows because (for *.x), we need to account for a bug in
+ * the way XFillPolygon draws triangles, and we want to shift
+ * the arrows differently when allowing for depressed
+ * behavior.
+ */
+
+ points[0].x = startx + offset;
+ points[0].y = starty + (offset ? 0 : -1);
+ points[1].x = startx + xWidth/2 + offset;
+ points[1].y = starty - tHeight + (offset ? 0 : -1);
+ points[2].x = startx + xWidth + offset;
+ points[2].y = points[0].y;
+ XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
+ points, 3, Convex, CoordModeOrigin);
+
+ starty = inset + height + pad + space;
+ offset = (sbPtr->selElement == SEL_BUTTONDOWN);
+ points[0].x = startx + 1 + offset;
+ points[0].y = starty + (offset ? 1 : 0);
+ points[1].x = startx + xWidth/2 + offset;
+ points[1].y = starty + tHeight + (offset ? 0 : -1);
+ points[2].x = startx - 1 + xWidth + offset;
+ points[2].y = points[0].y;
+ XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
+ points, 3, Convex, CoordModeOrigin);
+ }
+ }
}
/*
- * Draw the border and focus highlight last, so they will overwrite
- * any text that extends past the viewable part of the window.
+ * Draw the border and focus highlight last, so they will overwrite any
+ * text that extends past the viewable part of the window.
*/
- if (!TkpDrawEntryBorderAndFocus(entryPtr, pixmap,
- (entryPtr->type == TK_SPINBOX))) {
- xBound = entryPtr->highlightWidth;
- if (entryPtr->relief != TK_RELIEF_FLAT) {
+ if (!TkpDrawEntryBorderAndFocus(entryPtr, pixmap,
+ (entryPtr->type == TK_SPINBOX))) {
+ xBound = entryPtr->highlightWidth;
+ if (entryPtr->relief != TK_RELIEF_FLAT) {
Tk_Draw3DRectangle(tkwin, pixmap, border, xBound, xBound,
- Tk_Width(tkwin) - 2 * xBound,
+ Tk_Width(tkwin) - 2 * xBound,
Tk_Height(tkwin) - 2 * xBound,
entryPtr->borderWidth, entryPtr->relief);
- }
- if (xBound > 0) {
+ }
+ if (xBound > 0) {
GC fgGC, bgGC;
bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, pixmap);
if (entryPtr->flags & GOT_FOCUS) {
- fgGC = Tk_GCForColor(entryPtr->highlightColorPtr, pixmap);
- TkpDrawHighlightBorder(tkwin, fgGC, bgGC, xBound, pixmap);
+ fgGC = Tk_GCForColor(entryPtr->highlightColorPtr, pixmap);
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, xBound, pixmap);
} else {
- TkpDrawHighlightBorder(tkwin, bgGC, bgGC, xBound, pixmap);
+ TkpDrawHighlightBorder(tkwin, bgGC, bgGC, xBound, pixmap);
}
- }
+ }
}
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * Everything's been redisplayed; now copy the pixmap onto the screen
- * and free up the pixmap.
+ * Everything's been redisplayed; now copy the pixmap onto the screen and
+ * free up the pixmap.
*/
XCopyArea(entryPtr->display, pixmap, Tk_WindowId(tkwin), entryPtr->textGC,
@@ -1898,24 +1851,24 @@ DisplayEntry(clientData)
*
* EntryComputeGeometry --
*
- * This procedure is invoked to recompute information about where
- * in its window an entry's string will be displayed. It also
- * computes the requested size for the window.
+ * This function is invoked to recompute information about where in its
+ * window an entry's string will be displayed. It also computes the
+ * requested size for the window.
*
* Results:
* None.
*
* Side effects:
- * The leftX and tabOrigin fields are recomputed for entryPtr,
- * and leftIndex may be adjusted. Tk_GeometryRequest is called
- * to register the desired dimensions for the window.
+ * The leftX and tabOrigin fields are recomputed for entryPtr, and
+ * leftIndex may be adjusted. Tk_GeometryRequest is called to register
+ * the desired dimensions for the window.
*
*----------------------------------------------------------------------
*/
static void
-EntryComputeGeometry(entryPtr)
- Entry *entryPtr; /* Widget record for entry. */
+EntryComputeGeometry(
+ Entry *entryPtr) /* Widget record for entry. */
{
int totalLength, overflow, maxOffScreen, rightX;
int height, width, i;
@@ -1929,8 +1882,8 @@ EntryComputeGeometry(entryPtr)
}
/*
- * If we're displaying a special character instead of the value of
- * the entry, recompute the displayString.
+ * If we're displaying a special character instead of the value of the
+ * entry, recompute the displayString.
*/
if (entryPtr->showChar != NULL) {
@@ -1939,10 +1892,10 @@ EntryComputeGeometry(entryPtr)
int size;
/*
- * Normalize the special character so we can safely duplicate it
- * in the display string. If we didn't do this, then two malformed
- * characters might end up looking like one valid UTF character in
- * the resulting string.
+ * Normalize the special character so we can safely duplicate it in
+ * the display string. If we didn't do this, then two malformed
+ * characters might end up looking like one valid UTF character in the
+ * resulting string.
*/
Tcl_UtfToUniChar(entryPtr->showChar, &ch);
@@ -1966,21 +1919,21 @@ EntryComputeGeometry(entryPtr)
entryPtr->layoutY = (Tk_Height(entryPtr->tkwin) - height) / 2;
/*
- * Recompute where the leftmost character on the display will
- * be drawn (entryPtr->leftX) and adjust leftIndex if necessary
- * so that we don't let characters hang off the edge of the
- * window unless the entire window is full.
+ * Recompute where the leftmost character on the display will be drawn
+ * (entryPtr->leftX) and adjust leftIndex if necessary so that we don't
+ * let characters hang off the edge of the window unless the entire window
+ * is full.
*/
overflow = totalLength -
- (Tk_Width(entryPtr->tkwin) - 2*entryPtr->inset - entryPtr->xWidth);
+ (Tk_Width(entryPtr->tkwin) - 2*entryPtr->inset - entryPtr->xWidth);
if (overflow <= 0) {
entryPtr->leftIndex = 0;
if (entryPtr->justify == TK_JUSTIFY_LEFT) {
entryPtr->leftX = entryPtr->inset;
} else if (entryPtr->justify == TK_JUSTIFY_RIGHT) {
entryPtr->leftX = Tk_Width(entryPtr->tkwin) - entryPtr->inset
- - entryPtr->xWidth - totalLength;
+ - entryPtr->xWidth - totalLength;
} else {
entryPtr->leftX = (Tk_Width(entryPtr->tkwin)
- entryPtr->xWidth - totalLength)/2;
@@ -1988,10 +1941,10 @@ EntryComputeGeometry(entryPtr)
entryPtr->layoutX = entryPtr->leftX;
} else {
/*
- * The whole string can't fit in the window. Compute the
- * maximum number of characters that may be off-screen to
- * the left without leaving empty space on the right of the
- * window, then don't let leftIndex be any greater than that.
+ * The whole string can't fit in the window. Compute the maximum
+ * number of characters that may be off-screen to the left without
+ * leaving empty space on the right of the window, then don't let
+ * leftIndex be any greater than that.
*/
maxOffScreen = Tk_PointToChar(entryPtr->textLayout, overflow, 0);
@@ -2040,23 +1993,25 @@ EntryComputeGeometry(entryPtr)
* None.
*
* Side effects:
- * New information gets added to entryPtr; it will be redisplayed
- * soon, but not necessarily immediately.
+ * New information gets added to entryPtr; it will be redisplayed soon,
+ * but not necessarily immediately.
*
*----------------------------------------------------------------------
*/
static void
-InsertChars(entryPtr, index, value)
- 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
+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
* string). */
{
- int byteIndex, byteCount, oldChars, charsAdded, newByteCount;
+ ptrdiff_t byteIndex;
+ size_t byteCount, newByteCount;
+ int oldChars, charsAdded;
CONST char *string;
- char *new;
+ char *newStr;
string = entryPtr->string;
byteIndex = Tcl_UtfAtIndex(string, index) - string;
@@ -2066,48 +2021,47 @@ InsertChars(entryPtr, index, value)
}
newByteCount = entryPtr->numBytes + byteCount + 1;
- new = (char *) ckalloc((unsigned) newByteCount);
- memcpy(new, string, (size_t) byteIndex);
- strcpy(new + byteIndex, value);
- strcpy(new + byteIndex + byteCount, string + byteIndex);
+ newStr = (char *) ckalloc((unsigned) newByteCount);
+ memcpy(newStr, string, byteIndex);
+ strcpy(newStr + byteIndex, value);
+ strcpy(newStr + byteIndex + byteCount, string + byteIndex);
if ((entryPtr->validate == VALIDATE_KEY ||
- entryPtr->validate == VALIDATE_ALL) &&
- EntryValidateChange(entryPtr, value, new, index,
- VALIDATE_INSERT) != TCL_OK) {
- ckfree(new);
+ entryPtr->validate == VALIDATE_ALL) &&
+ EntryValidateChange(entryPtr, value, newStr, index,
+ VALIDATE_INSERT) != TCL_OK) {
+ ckfree(newStr);
return;
}
ckfree((char *)string);
- entryPtr->string = new;
+ entryPtr->string = newStr;
/*
- * The following construction is used because inserting improperly
- * formed UTF-8 sequences between other improperly formed UTF-8
- * sequences could result in actually forming valid UTF-8 sequences;
- * the number of characters added may not be Tcl_NumUtfChars(string, -1),
- * because of context. The actual number of characters added is how
- * many characters are in the string now minus the number that
- * used to be there.
+ * The following construction is used because inserting improperly formed
+ * UTF-8 sequences between other improperly formed UTF-8 sequences could
+ * result in actually forming valid UTF-8 sequences; the number of
+ * characters added may not be Tcl_NumUtfChars(string, -1), because of
+ * context. The actual number of characters added is how many characters
+ * are in the string now minus the number that used to be there.
*/
oldChars = entryPtr->numChars;
- entryPtr->numChars = Tcl_NumUtfChars(new, -1);
+ entryPtr->numChars = Tcl_NumUtfChars(newStr, -1);
charsAdded = entryPtr->numChars - oldChars;
entryPtr->numBytes += byteCount;
if (entryPtr->displayString == string) {
- entryPtr->displayString = new;
+ entryPtr->displayString = newStr;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
/*
- * Inserting characters invalidates all indexes into the string.
- * Touch up the indexes so that they still refer to the same
- * characters (at new positions). When updating the selection
- * end-points, don't include the new text in the selection unless
- * it was completely surrounded by the selection.
+ * Inserting characters invalidates all indexes into the string. Touch up
+ * the indexes so that they still refer to the same characters (at new
+ * positions). When updating the selection end-points, don't include the
+ * new text in the selection unless it was completely surrounded by the
+ * selection.
*/
if (entryPtr->selectFirst >= index) {
@@ -2116,8 +2070,7 @@ InsertChars(entryPtr, index, value)
if (entryPtr->selectLast > index) {
entryPtr->selectLast += charsAdded;
}
- if ((entryPtr->selectAnchor > index)
- || (entryPtr->selectFirst >= index)) {
+ if ((entryPtr->selectAnchor > index) || (entryPtr->selectFirst >= index)) {
entryPtr->selectAnchor += charsAdded;
}
if (entryPtr->leftIndex > index) {
@@ -2147,14 +2100,14 @@ InsertChars(entryPtr, index, value)
*/
static void
-DeleteChars(entryPtr, index, count)
- Entry *entryPtr; /* Entry widget to modify. */
- int index; /* Index of first character to delete. */
- int count; /* How many characters to delete. */
+DeleteChars(
+ Entry *entryPtr, /* Entry widget to modify. */
+ int index, /* Index of first character to delete. */
+ int count) /* How many characters to delete. */
{
int byteIndex, byteCount, newByteCount;
CONST char *string;
- char *new, *todelete;
+ char *newStr, *toDelete;
if ((index + count) > entryPtr->numChars) {
count = entryPtr->numChars - index;
@@ -2165,41 +2118,41 @@ DeleteChars(entryPtr, index, count)
string = entryPtr->string;
byteIndex = Tcl_UtfAtIndex(string, index) - string;
- byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string + byteIndex);
+ byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string+byteIndex);
newByteCount = entryPtr->numBytes + 1 - byteCount;
- new = (char *) ckalloc((unsigned) newByteCount);
- memcpy(new, string, (size_t) byteIndex);
- strcpy(new + byteIndex, string + byteIndex + byteCount);
+ newStr = (char *) ckalloc((unsigned) newByteCount);
+ memcpy(newStr, string, (size_t) byteIndex);
+ strcpy(newStr + byteIndex, string + byteIndex + byteCount);
- todelete = (char *) ckalloc((unsigned) (byteCount + 1));
- memcpy(todelete, string + byteIndex, (size_t) byteCount);
- todelete[byteCount] = '\0';
+ toDelete = (char *) ckalloc((unsigned) (byteCount + 1));
+ memcpy(toDelete, string + byteIndex, (size_t) byteCount);
+ toDelete[byteCount] = '\0';
if ((entryPtr->validate == VALIDATE_KEY ||
- entryPtr->validate == VALIDATE_ALL) &&
- EntryValidateChange(entryPtr, todelete, new, index,
- VALIDATE_DELETE) != TCL_OK) {
- ckfree(new);
- ckfree(todelete);
+ entryPtr->validate == VALIDATE_ALL) &&
+ EntryValidateChange(entryPtr, toDelete, newStr, index,
+ VALIDATE_DELETE) != TCL_OK) {
+ ckfree(newStr);
+ ckfree(toDelete);
return;
}
- ckfree(todelete);
+ ckfree(toDelete);
ckfree((char *)entryPtr->string);
- entryPtr->string = new;
+ entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
if (entryPtr->displayString == string) {
- entryPtr->displayString = new;
+ entryPtr->displayString = newStr;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
/*
* Deleting characters results in the remaining characters being
- * renumbered. Update the various indexes into the string to reflect
- * this change.
+ * renumbered. Update the various indexes into the string to reflect this
+ * change.
*/
if (entryPtr->selectFirst >= index) {
@@ -2249,10 +2202,9 @@ DeleteChars(entryPtr, index, count)
*
* EntryValueChanged --
*
- * This procedure is invoked when characters are inserted into
- * an entry or deleted from it. It updates the entry's associated
- * variable, if there is one, and does other bookkeeping such
- * as arranging for redisplay.
+ * This function is invoked when characters are inserted into an entry or
+ * deleted from it. It updates the entry's associated variable, if there
+ * is one, and does other bookkeeping such as arranging for redisplay.
*
* Results:
* None.
@@ -2264,10 +2216,10 @@ DeleteChars(entryPtr, index, count)
*/
static void
-EntryValueChanged(entryPtr, newValue)
- Entry *entryPtr; /* Entry whose value just changed. */
- CONST char *newValue; /* If this value is not NULL, we first
- * force the value of the entry to this */
+EntryValueChanged(
+ Entry *entryPtr, /* Entry whose value just changed. */
+ CONST char *newValue) /* If this value is not NULL, we first force
+ * the value of the entry to this. */
{
if (newValue != NULL) {
EntrySetValue(entryPtr, newValue);
@@ -2283,10 +2235,10 @@ EntryValueChanged(entryPtr, newValue)
if ((newValue != NULL) && (strcmp(newValue, entryPtr->string) != 0)) {
/*
* The value of the variable is different than what we asked for.
- * This means that a trace on the variable modified it. In this
- * case our trace procedure wasn't invoked since the modification
- * came while a trace was already active on the variable. So,
- * update our value to reflect the variable's latest value.
+ * This means that a trace on the variable modified it. In this case
+ * our trace function wasn't invoked since the modification came while
+ * a trace was already active on the variable. So, update our value to
+ * reflect the variable's latest value.
*/
EntrySetValue(entryPtr, newValue);
@@ -2306,27 +2258,27 @@ EntryValueChanged(entryPtr, newValue)
*
* EntrySetValue --
*
- * Replace the contents of a text entry with a given value. This
- * procedure is invoked when updating the entry from the entry's
- * associated variable.
+ * Replace the contents of a text entry with a given value. This function
+ * is invoked when updating the entry from the entry's associated
+ * variable.
*
* Results:
* None.
*
* Side effects:
- * The string displayed in the entry will change. The selection,
- * insertion point, and view may have to be adjusted to keep them
- * within the bounds of the new string. Note: this procedure does
- * *not* update the entry's associated variable, since that could
- * result in an infinite loop.
+ * The string displayed in the entry will change. The selection,
+ * insertion point, and view may have to be adjusted to keep them within
+ * the bounds of the new string. Note: this function does *not* update
+ * the entry's associated variable, since that could result in an
+ * infinite loop.
*
*----------------------------------------------------------------------
*/
static void
-EntrySetValue(entryPtr, value)
- Entry *entryPtr; /* Entry whose value is to be changed. */
- CONST char *value; /* New text to display in entry. */
+EntrySetValue(
+ Entry *entryPtr, /* Entry whose value is to be changed. */
+ CONST char *value) /* New text to display in entry. */
{
CONST char *oldSource;
int valueLen, malloced = 0;
@@ -2340,23 +2292,27 @@ EntrySetValue(entryPtr, value)
entryPtr->flags |= VALIDATE_ABORT;
} else {
/*
- * If we validate, we create a copy of the value, as it may
- * point to volatile memory, like the value of the -textvar
- * which may get freed during validation
+ * If we validate, we create a copy of the value, as it may point to
+ * volatile memory, like the value of the -textvar which may get freed
+ * during validation
*/
+
char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+
strcpy(tmp, value);
value = tmp;
malloced = 1;
entryPtr->flags |= VALIDATE_VAR;
- (void) EntryValidateChange(entryPtr, (char *) NULL, value, -1,
+ (void) EntryValidateChange(entryPtr, NULL, value, -1,
VALIDATE_FORCED);
entryPtr->flags &= ~VALIDATE_VAR;
+
/*
* If VALIDATE_ABORT has been set, then this operation should be
* aborted because the validatecommand did something else instead
*/
+
if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
ckfree((char *)value);
@@ -2371,6 +2327,7 @@ EntrySetValue(entryPtr, value)
entryPtr->string = value;
} else {
char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+
strcpy(tmp, value);
entryPtr->string = tmp;
}
@@ -2411,23 +2368,23 @@ EntrySetValue(entryPtr, value)
*
* EntryEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on entries.
+ * This function is invoked by the Tk dispatcher for various events on
+ * entries.
*
* 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.
*
*--------------------------------------------------------------
*/
static void
-EntryEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+EntryEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
Entry *entryPtr = (Entry *) clientData;
@@ -2458,34 +2415,33 @@ EntryEventProc(clientData, eventPtr)
}
switch (eventPtr->type) {
- case Expose:
- EventuallyRedraw(entryPtr);
- entryPtr->flags |= BORDER_NEEDED;
- break;
- case DestroyNotify:
- if (!(entryPtr->flags & ENTRY_DELETED)) {
- entryPtr->flags |= (ENTRY_DELETED | VALIDATE_ABORT);
- Tcl_DeleteCommandFromToken(entryPtr->interp,
- entryPtr->widgetCmd);
- if (entryPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayEntry, clientData);
- }
- Tcl_EventuallyFree(clientData, DestroyEntry);
- }
- break;
- case ConfigureNotify:
- Tcl_Preserve((ClientData) entryPtr);
- entryPtr->flags |= UPDATE_SCROLLBAR;
- EntryComputeGeometry(entryPtr);
- EventuallyRedraw(entryPtr);
- Tcl_Release((ClientData) entryPtr);
- break;
- case FocusIn:
- case FocusOut:
- if (eventPtr->xfocus.detail != NotifyInferior) {
- EntryFocusProc(entryPtr, (eventPtr->type == FocusIn));
+ case Expose:
+ EventuallyRedraw(entryPtr);
+ entryPtr->flags |= BORDER_NEEDED;
+ break;
+ case DestroyNotify:
+ if (!(entryPtr->flags & ENTRY_DELETED)) {
+ entryPtr->flags |= (ENTRY_DELETED | VALIDATE_ABORT);
+ Tcl_DeleteCommandFromToken(entryPtr->interp, entryPtr->widgetCmd);
+ if (entryPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayEntry, clientData);
}
- break;
+ Tcl_EventuallyFree(clientData, DestroyEntry);
+ }
+ break;
+ case ConfigureNotify:
+ Tcl_Preserve((ClientData) entryPtr);
+ entryPtr->flags |= UPDATE_SCROLLBAR;
+ EntryComputeGeometry(entryPtr);
+ EventuallyRedraw(entryPtr);
+ Tcl_Release((ClientData) entryPtr);
+ break;
+ case FocusIn:
+ case FocusOut:
+ if (eventPtr->xfocus.detail != NotifyInferior) {
+ EntryFocusProc(entryPtr, (eventPtr->type == FocusIn));
+ }
+ break;
}
}
@@ -2494,9 +2450,9 @@ EntryEventProc(clientData, eventPtr)
*
* EntryCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -2508,20 +2464,20 @@ EntryEventProc(clientData, eventPtr)
*/
static void
-EntryCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+EntryCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
Entry *entryPtr = (Entry *) clientData;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (!(entryPtr->flags & ENTRY_DELETED)) {
- Tk_DestroyWindow(entryPtr->tkwin);
+ Tk_DestroyWindow(entryPtr->tkwin);
}
}
@@ -2530,15 +2486,14 @@ EntryCmdDeletedProc(clientData)
*
* GetEntryIndex --
*
- * Parse an index into an entry and return either its value
- * or an error.
+ * Parse an index into an entry and return either its value or an error.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the character index (into entryPtr) corresponding to
- * string. The index value is guaranteed to lie between 0 and
- * the number of characters in the string, inclusive. If an
- * error occurs then an error message is left in the interp's result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the character index (into entryPtr) corresponding to string. The
+ * index value is guaranteed to lie between 0 and the number of
+ * characters in the string, inclusive. If an error occurs then an error
+ * message is left in the interp's result.
*
* Side effects:
* None.
@@ -2547,13 +2502,12 @@ EntryCmdDeletedProc(clientData)
*/
static int
-GetEntryIndex(interp, entryPtr, string, indexPtr)
- Tcl_Interp *interp; /* For error messages. */
- Entry *entryPtr; /* Entry for which the index is being
+GetEntryIndex(
+ Tcl_Interp *interp, /* For error messages. */
+ Entry *entryPtr, /* Entry for which the index is being
* specified. */
- char *string; /* Specifies character in entryPtr. */
- int *indexPtr; /* Where to store converted character
- * index. */
+ char *string, /* Specifies character in entryPtr. */
+ int *indexPtr) /* Where to store converted character index */
{
size_t length;
@@ -2563,17 +2517,17 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
if (strncmp(string, "anchor", length) == 0) {
*indexPtr = entryPtr->selectAnchor;
} else {
- badIndex:
+ 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, (char *) NULL, TCL_STATIC);
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
Tcl_AppendResult(interp, "bad ",
(entryPtr->type == TK_ENTRY) ? "entry" : "spinbox",
- " index \"", string, "\"", (char *) NULL);
+ " index \"", string, "\"", NULL);
return TCL_ERROR;
}
} else if (string[0] == 'e') {
@@ -2590,9 +2544,9 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
}
} else if (string[0] == 's') {
if (entryPtr->selectFirst < 0) {
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
Tcl_AppendResult(interp, "selection isn't in widget ",
- Tk_PathName(entryPtr->tkwin), (char *) NULL);
+ Tk_PathName(entryPtr->tkwin), NULL);
return TCL_ERROR;
}
if (length < 5) {
@@ -2625,10 +2579,10 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
x - entryPtr->layoutX, 0);
/*
- * Special trick: if the x-position was off-screen to the right,
- * round the index up to refer to the character just after the
- * last visible one on the screen. This is needed to enable the
- * last character to be selected, for example.
+ * Special trick: if the x-position was off-screen to the right, round
+ * the index up to refer to the character just after the last visible
+ * one on the screen. This is needed to enable the last character to
+ * be selected, for example.
*/
if (roundUp && (*indexPtr < entryPtr->numChars)) {
@@ -2642,7 +2596,7 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
*indexPtr = 0;
} else if (*indexPtr > entryPtr->numChars) {
*indexPtr = entryPtr->numChars;
- }
+ }
}
return TCL_OK;
}
@@ -2652,8 +2606,8 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
*
* EntryScanTo --
*
- * Given a y-coordinate (presumably of the curent mouse location)
- * drag the view in the window to implement the scan operation.
+ * Given a y-coordinate (presumably of the curent mouse location) drag
+ * the view in the window to implement the scan operation.
*
* Results:
* None.
@@ -2665,21 +2619,21 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
*/
static void
-EntryScanTo(entryPtr, x)
- Entry *entryPtr; /* Information about widget. */
- int x; /* X-coordinate to use for scan operation. */
+EntryScanTo(
+ Entry *entryPtr, /* Information about widget. */
+ int x) /* X-coordinate to use for scan operation. */
{
int newLeftIndex;
/*
- * Compute new leftIndex for entry by amplifying the difference
- * between the current position and the place where the scan
- * started (the "mark" position). If we run off the left or right
- * side of the entry, then reset the mark point so that the current
- * position continues to correspond to the edge of the window.
- * This means that the picture will start dragging as soon as the
- * mouse reverses direction (without this reset, might have to slide
- * mouse a long ways back before the picture starts moving again).
+ * Compute new leftIndex for entry by amplifying the difference between
+ * the current position and the place where the scan started (the "mark"
+ * position). If we run off the left or right side of the entry, then
+ * reset the mark point so that the current position continues to
+ * correspond to the edge of the window. This means that the picture will
+ * start dragging as soon as the mouse reverses direction (without this
+ * reset, might have to slide mouse a long ways back before the picture
+ * starts moving again).
*/
newLeftIndex = entryPtr->scanMarkIndex
@@ -2691,7 +2645,7 @@ EntryScanTo(entryPtr, x)
if (newLeftIndex < 0) {
newLeftIndex = entryPtr->scanMarkIndex = 0;
entryPtr->scanMarkX = x;
- }
+ }
if (newLeftIndex != entryPtr->leftIndex) {
entryPtr->leftIndex = newLeftIndex;
@@ -2710,8 +2664,8 @@ EntryScanTo(entryPtr, x)
*
* EntrySelectTo --
*
- * Modify the selection by moving its un-anchored end. This could
- * make the selection either larger or smaller.
+ * Modify the selection by moving its un-anchored end. This could make
+ * the selection either larger or smaller.
*
* Results:
* None.
@@ -2723,9 +2677,9 @@ EntryScanTo(entryPtr, x)
*/
static void
-EntrySelectTo(entryPtr, index)
- Entry *entryPtr; /* Information about widget. */
- int index; /* Character index of element that is to
+EntrySelectTo(
+ Entry *entryPtr, /* Information about widget. */
+ int index) /* Character index of element that is to
* become the "other" end of the selection. */
{
int newFirst, newLast;
@@ -2771,15 +2725,15 @@ EntrySelectTo(entryPtr, index)
*
* EntryFetchSelection --
*
- * This procedure is called back by Tk when the selection is
- * requested by someone. It returns part or all of the selection
- * in a buffer provided by the caller.
+ * This function is called back by Tk when the selection is requested by
+ * someone. It returns part or all of the selection in a buffer provided
+ * by the caller.
*
* Results:
- * The return value is the number of non-NULL bytes stored
- * at buffer. Buffer is filled (or partially filled) with a
- * NULL-terminated string containing part or all of the selection,
- * as given by offset and maxBytes.
+ * The return value is the number of non-NULL bytes stored at buffer.
+ * Buffer is filled (or partially filled) with a NULL-terminated string
+ * containing part or all of the selection, as given by offset and
+ * maxBytes.
*
* Side effects:
* None.
@@ -2788,14 +2742,13 @@ EntrySelectTo(entryPtr, index)
*/
static int
-EntryFetchSelection(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Information about entry widget. */
- int offset; /* Byte offset within selection of first
+EntryFetchSelection(
+ ClientData clientData, /* Information about entry widget. */
+ int offset, /* Byte offset within selection of first
* character to be returned. */
- char *buffer; /* Location in which to place selection. */
- int maxBytes; /* Maximum number of bytes to place at
- * buffer, not including terminating NULL
- * character. */
+ char *buffer, /* Location in which to place selection. */
+ int maxBytes) /* Maximum number of bytes to place at buffer,
+ * not including terminating NUL character. */
{
Entry *entryPtr = (Entry *) clientData;
int byteCount;
@@ -2826,32 +2779,32 @@ EntryFetchSelection(clientData, offset, buffer, maxBytes)
*
* EntryLostSelection --
*
- * This procedure is called back by Tk when the selection is
- * grabbed away from an entry widget.
+ * This function is called back by Tk when the selection is grabbed away
+ * from an entry widget.
*
* Results:
* None.
*
* Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
+ * The existing selection is unhighlighted, and the window is marked as
+ * not containing a selection.
*
*----------------------------------------------------------------------
*/
static void
-EntryLostSelection(clientData)
- ClientData clientData; /* Information about entry widget. */
+EntryLostSelection(
+ ClientData clientData) /* Information about entry widget. */
{
Entry *entryPtr = (Entry *) clientData;
entryPtr->flags &= ~GOT_SELECTION;
/*
- * On Windows and Mac systems, we want to remember the selection
- * for the next time the focus enters the window. On Unix, we need
- * to clear the selection since it is always visible. This is
- * controlled by ::tk::AlwaysShowSelection.
+ * On Windows and Mac systems, we want to remember the selection for the
+ * next time the focus enters the window. On Unix, we need to clear the
+ * selection since it is always visible.
+ * This is controlled by ::tk::AlwaysShowSelection.
*/
if (TkpAlwaysShowSelection(entryPtr->tkwin)
@@ -2873,26 +2826,26 @@ EntryLostSelection(clientData)
* None.
*
* Side effects:
- * Information gets redisplayed. Right now we don't do selective
- * redisplays: the whole window will be redrawn. This doesn't
- * seem to hurt performance noticeably, but if it does then this
- * could be changed.
+ * Information gets redisplayed. Right now we don't do selective
+ * redisplays: the whole window will be redrawn. This doesn't seem to
+ * hurt performance noticeably, but if it does then this could be
+ * changed.
*
*----------------------------------------------------------------------
*/
static void
-EventuallyRedraw(entryPtr)
- Entry *entryPtr; /* Information about widget. */
+EventuallyRedraw(
+ Entry *entryPtr) /* Information about widget. */
{
if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(entryPtr->tkwin)) {
return;
}
/*
- * Right now we don't do selective redisplays: the whole window
- * will be redrawn. This doesn't seem to hurt performance noticeably,
- * but if it does then this could be changed.
+ * Right now we don't do selective redisplays: the whole window will be
+ * redrawn. This doesn't seem to hurt performance noticeably, but if it
+ * does then this could be changed.
*/
if (!(entryPtr->flags & REDRAW_PENDING)) {
@@ -2906,13 +2859,12 @@ EventuallyRedraw(entryPtr)
*
* EntryVisibleRange --
*
- * Return information about the range of the entry that is
- * currently visible.
+ * Return information about the range of the entry that is currently
+ * visible.
*
* Results:
- * *firstPtr and *lastPtr are modified to hold fractions between
- * 0 and 1 identifying the range of characters visible in the
- * entry.
+ * *firstPtr and *lastPtr are modified to hold fractions between 0 and 1
+ * identifying the range of characters visible in the entry.
*
* Side effects:
* None.
@@ -2921,11 +2873,11 @@ EventuallyRedraw(entryPtr)
*/
static void
-EntryVisibleRange(entryPtr, firstPtr, lastPtr)
- Entry *entryPtr; /* Information about widget. */
- double *firstPtr; /* Return position of first visible
- * character in widget. */
- double *lastPtr; /* Return position of char just after last
+EntryVisibleRange(
+ Entry *entryPtr, /* Information about widget. */
+ double *firstPtr, /* Return position of first visible character
+ * in widget. */
+ double *lastPtr) /* Return position of char just after last
* visible one. */
{
int charsInWindow;
@@ -2956,10 +2908,10 @@ EntryVisibleRange(entryPtr, firstPtr, lastPtr)
*
* EntryUpdateScrollbar --
*
- * This procedure is invoked whenever information has changed in
- * an entry in a way that would invalidate a scrollbar display.
- * If there is an associated scrollbar, then this procedure updates
- * it by invoking a Tcl command.
+ * This function is invoked whenever information has changed in an entry
+ * in a way that would invalidate a scrollbar display. If there is an
+ * associated scrollbar, then this function updates it by invoking a Tcl
+ * command.
*
* Results:
* None.
@@ -2972,10 +2924,10 @@ EntryVisibleRange(entryPtr, firstPtr, lastPtr)
*/
static void
-EntryUpdateScrollbar(entryPtr)
- Entry *entryPtr; /* Information about widget. */
+EntryUpdateScrollbar(
+ Entry *entryPtr) /* Information about widget. */
{
- char args[TCL_DOUBLE_SPACE * 2];
+ char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE];
int code;
double first, last;
Tcl_Interp *interp;
@@ -2987,8 +2939,10 @@ EntryUpdateScrollbar(entryPtr)
interp = entryPtr->interp;
Tcl_Preserve((ClientData) interp);
EntryVisibleRange(entryPtr, &first, &last);
- sprintf(args, " %g %g", first, last);
- code = Tcl_VarEval(interp, entryPtr->scrollCmd, args, (char *) NULL);
+ Tcl_PrintDouble(NULL, first, firstStr);
+ Tcl_PrintDouble(NULL, last, lastStr);
+ code = Tcl_VarEval(interp, entryPtr->scrollCmd, " ", firstStr, " ",
+ lastStr, NULL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (horizontal scrolling command executed by ");
@@ -2996,7 +2950,7 @@ EntryUpdateScrollbar(entryPtr)
Tcl_AddErrorInfo(interp, ")");
Tcl_BackgroundError(interp);
}
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
Tcl_Release((ClientData) interp);
}
@@ -3005,22 +2959,22 @@ EntryUpdateScrollbar(entryPtr)
*
* EntryBlinkProc --
*
- * This procedure is called as a timer handler to blink the
- * insertion cursor off and on.
+ * This function is called as a timer handler to blink the insertion
+ * cursor off and on.
*
* Results:
* None.
*
* Side effects:
- * The cursor gets turned on or off, redisplay gets invoked,
- * and this procedure reschedules itself.
+ * The cursor gets turned on or off, redisplay gets invoked, and this
+ * function reschedules itself.
*
*----------------------------------------------------------------------
*/
static void
-EntryBlinkProc(clientData)
- ClientData clientData; /* Pointer to record describing entry. */
+EntryBlinkProc(
+ ClientData clientData) /* Pointer to record describing entry. */
{
Entry *entryPtr = (Entry *) clientData;
@@ -3046,9 +3000,9 @@ EntryBlinkProc(clientData)
*
* EntryFocusProc --
*
- * This procedure is called whenever the entry gets or loses the
- * input focus. It's also called whenever the window is reconfigured
- * while it has the focus.
+ * This function is called whenever the entry gets or loses the input
+ * focus. It's also called whenever the window is reconfigured while it
+ * has the focus.
*
* Results:
* None.
@@ -3060,9 +3014,9 @@ EntryBlinkProc(clientData)
*/
static void
-EntryFocusProc(entryPtr, gotFocus)
- Entry *entryPtr; /* Entry that got or lost focus. */
- int gotFocus; /* 1 means window is getting focus, 0 means
+EntryFocusProc(
+ Entry *entryPtr, /* Entry that got or lost focus. */
+ int gotFocus) /* 1 means window is getting focus, 0 means
* it's losing it. */
{
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
@@ -3076,7 +3030,7 @@ EntryFocusProc(entryPtr, gotFocus)
if (entryPtr->validate == VALIDATE_ALL ||
entryPtr->validate == VALIDATE_FOCUS ||
entryPtr->validate == VALIDATE_FOCUSIN) {
- EntryValidateChange(entryPtr, (char *) NULL,
+ EntryValidateChange(entryPtr, NULL,
entryPtr->string, -1, VALIDATE_FOCUSIN);
}
} else {
@@ -3085,7 +3039,7 @@ EntryFocusProc(entryPtr, gotFocus)
if (entryPtr->validate == VALIDATE_ALL ||
entryPtr->validate == VALIDATE_FOCUS ||
entryPtr->validate == VALIDATE_FOCUSOUT) {
- EntryValidateChange(entryPtr, (char *) NULL,
+ EntryValidateChange(entryPtr, NULL,
entryPtr->string, -1, VALIDATE_FOCUSOUT);
}
}
@@ -3097,27 +3051,26 @@ EntryFocusProc(entryPtr, gotFocus)
*
* EntryTextVarProc --
*
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in an entry.
+ * This function is invoked when someone changes the variable whose
+ * contents are to be displayed in an entry.
*
* Results:
* NULL is always returned.
*
* Side effects:
- * The text displayed in the entry will change to match the
- * variable.
+ * The text displayed in the entry will change to match the variable.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static char *
-EntryTextVarProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Information about button. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Not used. */
- CONST char *name2; /* Not used. */
- int flags; /* Information about what happened. */
+EntryTextVarProc(
+ ClientData clientData, /* Information about button. */
+ Tcl_Interp *interp, /* Interpreter containing variable. */
+ CONST char *name1, /* Not used. */
+ CONST char *name2, /* Not used. */
+ int flags) /* Information about what happened. */
{
Entry *entryPtr = (Entry *) clientData;
CONST char *value;
@@ -3126,12 +3079,12 @@ EntryTextVarProc(clientData, interp, name1, name2, flags)
/*
* Just abort early if we entered here while being deleted.
*/
- return (char *) NULL;
+ return NULL;
}
/*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
+ * If the variable is unset, then immediately recreate it unless the whole
+ * interpreter is going away.
*/
if (flags & TCL_TRACE_UNSETS) {
@@ -3143,14 +3096,13 @@ EntryTextVarProc(clientData, interp, name1, name2, flags)
EntryTextVarProc, clientData);
entryPtr->flags |= ENTRY_VAR_TRACED;
}
- return (char *) NULL;
+ return NULL;
}
/*
- * Update the entry's text with the value of the variable, unless
- * the entry already has that value (this happens when the variable
- * changes value because we changed it because someone typed in
- * the entry).
+ * Update the entry's text with the value of the variable, unless the
+ * entry already has that value (this happens when the variable changes
+ * value because we changed it because someone typed in the entry).
*/
value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY);
@@ -3158,7 +3110,7 @@ EntryTextVarProc(clientData, interp, name1, name2, flags)
value = "";
}
EntrySetValue(entryPtr, value);
- return (char *) NULL;
+ return NULL;
}
/*
@@ -3166,25 +3118,25 @@ EntryTextVarProc(clientData, interp, name1, name2, flags)
*
* EntryValidate --
*
- * This procedure is invoked when any character is added or
- * removed from the entry widget, or a focus has trigerred validation.
+ * This function is invoked when any character is added or removed from
+ * the entry widget, or a focus has trigerred validation.
*
* Results:
- * TCL_OK if the validatecommand passes the new string.
- * TCL_BREAK if the vcmd executed OK, but rejects the string.
- * TCL_ERROR if an error occurred while executing the vcmd
- * or a valid Tcl_Bool is not returned.
+
+ * TCL_OK if the validatecommand passes the new string. TCL_BREAK if the
+ * vcmd executed OK, but rejects the string. TCL_ERROR if an error
+ * occurred while executing the vcmd or a valid Tcl_Bool is not returned.
*
* Side effects:
- * An error condition may arise
+ * An error condition may arise
*
*--------------------------------------------------------------
*/
static int
-EntryValidate(entryPtr, cmd)
- register Entry *entryPtr; /* Entry that needs validation. */
- register char *cmd; /* Validation command (NULL-terminated
+EntryValidate(
+ register Entry *entryPtr, /* Entry that needs validation. */
+ register char *cmd) /* Validation command (NULL-terminated
* string). */
{
register Tcl_Interp *interp = entryPtr->interp;
@@ -3193,9 +3145,10 @@ EntryValidate(entryPtr, cmd)
code = Tcl_EvalEx(interp, cmd, -1, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
/*
- * We accept TCL_OK and TCL_RETURN as valid return codes from the
- * command callback.
+ * We accept TCL_OK and TCL_RETURN as valid return codes from the command
+ * callback.
*/
+
if (code != TCL_OK && code != TCL_RETURN) {
Tcl_AddErrorInfo(interp, "\n\t(in validation command executed by ");
Tcl_AddErrorInfo(interp, Tk_PathName(entryPtr->tkwin));
@@ -3207,8 +3160,9 @@ EntryValidate(entryPtr, cmd)
/*
* The command callback should return an acceptable Tcl boolean.
*/
+
if (Tcl_GetBooleanFromObj(interp, Tcl_GetObjResult(interp),
- &bool) != TCL_OK) {
+ &bool) != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\nvalid boolean not returned by validation command");
Tcl_BackgroundError(interp);
@@ -3225,45 +3179,45 @@ EntryValidate(entryPtr, cmd)
*
* EntryValidateChange --
*
- * This procedure is invoked when any character is added or
- * removed from the entry widget, or a focus has trigerred validation.
+ * This function is invoked when any character is added or removed from
+ * the entry widget, or a focus has trigerred validation.
*
* Results:
- * TCL_OK if the validatecommand accepts the new string,
- * TCL_ERROR if any problems occured with validatecommand.
+ * TCL_OK if the validatecommand accepts the new string, TCL_ERROR if any
+ * problems occured with validatecommand.
*
* Side effects:
- * The insertion/deletion may be aborted, and the
- * validatecommand might turn itself off (if an error
- * or loop condition arises).
+ * The insertion/deletion may be aborted, and the validatecommand might
+ * turn itself off (if an error or loop condition arises).
*
*--------------------------------------------------------------
*/
static int
-EntryValidateChange(entryPtr, change, new, index, type)
- register Entry *entryPtr; /* Entry that needs validation. */
- char *change; /* Characters to be added/deleted
- * (NULL-terminated string). */
- CONST char *new; /* Potential new value of entry string */
- int index; /* index of insert/delete, -1 otherwise */
- int type; /* forced, delete, insert,
- * focusin or focusout */
+EntryValidateChange(
+ register Entry *entryPtr, /* Entry that needs validation. */
+ char *change, /* Characters to be added/deleted
+ * (NUL-terminated 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 */
{
int code, varValidate = (entryPtr->flags & VALIDATE_VAR);
char *p;
Tcl_DString script;
-
+
if (entryPtr->validateCmd == NULL ||
entryPtr->validate == VALIDATE_NONE) {
return (varValidate ? TCL_ERROR : TCL_OK);
}
/*
- * If we're already validating, then we're hitting a loop condition
- * Return and set validate to 0 to disallow further validations
- * and prevent current validation from finishing
+ * If we're already validating, then we're hitting a loop condition Return
+ * and set validate to 0 to disallow further validations and prevent
+ * current validation from finishing
*/
+
if (entryPtr->flags & VALIDATING) {
entryPtr->validate = VALIDATE_NONE;
return (varValidate ? TCL_ERROR : TCL_OK);
@@ -3277,7 +3231,7 @@ EntryValidateChange(entryPtr, change, new, index, type)
Tcl_DStringInit(&script);
ExpandPercents(entryPtr, entryPtr->validateCmd,
- change, new, index, type, &script);
+ change, newValue, index, type, &script);
Tcl_DStringAppend(&script, "", 1);
p = Tcl_DStringValue(&script);
@@ -3285,10 +3239,10 @@ EntryValidateChange(entryPtr, change, new, index, type)
Tcl_DStringFree(&script);
/*
- * If e->validate has become VALIDATE_NONE during the validation, or
- * we now have VALIDATE_VAR set (from EntrySetValue) and didn't before,
- * it means that a loop condition almost occured. Do not allow
- * this validation result to finish.
+ * If e->validate has become VALIDATE_NONE during the validation, or we
+ * now have VALIDATE_VAR set (from EntrySetValue) and didn't before, it
+ * means that a loop condition almost occured. Do not allow this
+ * validation result to finish.
*/
if (entryPtr->validate == VALIDATE_NONE
@@ -3297,8 +3251,8 @@ EntryValidateChange(entryPtr, change, new, index, type)
}
/*
- * It's possible that the user deleted the entry during validation.
- * In that case, abort future validation and return an error.
+ * It's possible that the user deleted the entry during validation. In
+ * that case, abort future validation and return an error.
*/
if (entryPtr->flags & ENTRY_DELETED) {
@@ -3307,20 +3261,19 @@ EntryValidateChange(entryPtr, change, new, index, type)
/*
* If validate will return ERROR, then disallow further validations
- * Otherwise, if it didn't accept the new string (returned TCL_BREAK)
- * then eval the invalidCmd (if it's set)
+ * Otherwise, if it didn't accept the new string (returned TCL_BREAK) then
+ * eval the invalidCmd (if it's set)
*/
if (code == TCL_ERROR) {
entryPtr->validate = VALIDATE_NONE;
} else if (code == TCL_BREAK) {
/*
- * If we were doing forced validation (like via a variable
- * trace) and the command returned 0, the we turn off validation
- * because we assume that textvariables have precedence in
- * managing the value. We also don't call the invcmd, as it
- * may want to do entry manipulation which the setting of the
- * var will later wipe anyway.
+ * If we were doing forced validation (like via a variable trace) and
+ * the command returned 0, the we turn off validation because we
+ * assume that textvariables have precedence in managing the value.
+ * We also don't call the invcmd, as it may want to do entry
+ * manipulation which the setting of the var will later wipe anyway.
*/
if (varValidate) {
@@ -3328,13 +3281,13 @@ EntryValidateChange(entryPtr, change, new, index, type)
} else if (entryPtr->invalidCmd != NULL) {
Tcl_DStringInit(&script);
ExpandPercents(entryPtr, entryPtr->invalidCmd,
- change, new, index, type, &script);
+ 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) {
Tcl_AddErrorInfo(entryPtr->interp,
- "\n\t(in invalidcommand executed by entry)");
+ "\n\t(in invalidcommand executed by entry)");
Tcl_BackgroundError(entryPtr->interp);
code = TCL_ERROR;
entryPtr->validate = VALIDATE_NONE;
@@ -3342,8 +3295,9 @@ EntryValidateChange(entryPtr, change, new, index, type)
Tcl_DStringFree(&script);
/*
- * It's possible that the user deleted the entry during validation.
- * In that case, abort future validation and return an error.
+ * It's possible that the user deleted the entry during
+ * validation. In that case, abort future validation and return an
+ * error.
*/
if (entryPtr->flags & ENTRY_DELETED) {
@@ -3362,13 +3316,12 @@ EntryValidateChange(entryPtr, change, new, index, type)
*
* ExpandPercents --
*
- * Given a command and an event, produce a new command
- * by replacing % constructs in the original command
- * with information from the X event.
+ * Given a command and an event, produce a new command by replacing %
+ * constructs in the original command with information from the X event.
*
* Results:
- * The new expanded command is appended to the dynamic string
- * given by dsPtr.
+ * The new expanded command is appended to the dynamic string given by
+ * dsPtr.
*
* Side effects:
* None.
@@ -3377,18 +3330,18 @@ EntryValidateChange(entryPtr, change, new, index, type)
*/
static void
-ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
- register Entry *entryPtr; /* Entry that needs validation. */
- register CONST char *before;
- /* Command containing percent
- * expressions to be replaced. */
- char *change; /* Characters to added/deleted
- * (NULL-terminated string). */
- CONST char *new; /* Potential new value of entry string */
- int index; /* index of insert/delete */
- int type; /* INSERT or DELETE */
- Tcl_DString *dsPtr; /* Dynamic string in which to append
- * new command. */
+ExpandPercents(
+ register Entry *entryPtr, /* Entry that needs validation. */
+ register CONST char *before,
+ /* Command containing percent expressions to
+ * be replaced. */
+ CONST char *change, /* Characters to added/deleted (NUL-terminated
+ * 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
+ * command. */
{
int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl
* list element. */
@@ -3402,14 +3355,18 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
break;
}
/*
- * Find everything up to the next % character and append it
- * to the result string.
+ * Find everything up to the next % character and append it to the
+ * result string.
*/
string = before;
- /* No need to convert '%', as it is in ascii range */
+
+ /*
+ * No need to convert '%', as it is in ascii range.
+ */
+
string = Tcl_UtfFindFirst(before, '%');
- if (string == (char *) NULL) {
+ if (string == NULL) {
Tcl_DStringAppend(dsPtr, before, -1);
break;
} else if (string != before) {
@@ -3418,7 +3375,7 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
}
/*
- * There's a percent sequence here. Process it.
+ * There's a percent sequence here. Process it.
*/
before++; /* skip over % */
@@ -3431,80 +3388,82 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
/*
* -command %-substitution
*/
+
switch (ch) {
- case 's': /* Current string value of spinbox */
- string = entryPtr->string;
- break;
- case 'd': /* direction, up or down */
- string = change;
- break;
- case 'W': /* widget name */
- string = Tk_PathName(entryPtr->tkwin);
- break;
- default:
- length = Tcl_UniCharToUtf(ch, numStorage);
- numStorage[length] = '\0';
- string = numStorage;
- break;
+ case 's': /* Current string value of spinbox */
+ string = entryPtr->string;
+ break;
+ case 'd': /* direction, up or down */
+ string = change;
+ break;
+ case 'W': /* widget name */
+ string = Tk_PathName(entryPtr->tkwin);
+ break;
+ default:
+ length = Tcl_UniCharToUtf(ch, numStorage);
+ numStorage[length] = '\0';
+ string = numStorage;
+ break;
}
} else {
/*
* -validatecommand / -invalidcommand %-substitution
*/
+
switch (ch) {
- case 'd': /* Type of call that caused validation */
- switch (type) {
- case VALIDATE_INSERT:
- number = 1;
- break;
- case VALIDATE_DELETE:
- number = 0;
- break;
- default:
- number = -1;
- break;
- }
- sprintf(numStorage, "%d", number);
- string = numStorage;
- break;
- case 'i': /* index of insert/delete */
- sprintf(numStorage, "%d", index);
- string = numStorage;
+ case 'd': /* Type of call that caused validation */
+ switch (type) {
+ case VALIDATE_INSERT:
+ number = 1;
break;
- case 'P': /* 'Peeked' new value of the string */
- string = new;
+ case VALIDATE_DELETE:
+ number = 0;
break;
- case 's': /* Current string value of spinbox */
- string = entryPtr->string;
- break;
- case 'S': /* string to be inserted/deleted, if any */
- string = change;
- break;
- case 'v': /* type of validation currently set */
- string = validateStrings[entryPtr->validate];
+ default:
+ number = -1;
break;
- case 'V': /* type of validation in effect */
- switch (type) {
- case VALIDATE_INSERT:
- case VALIDATE_DELETE:
- string = validateStrings[VALIDATE_KEY];
- break;
- case VALIDATE_FORCED:
- string = "forced";
- break;
- default:
- string = validateStrings[type];
- break;
- }
+ }
+ sprintf(numStorage, "%d", number);
+ string = numStorage;
+ break;
+ case 'i': /* index of insert/delete */
+ sprintf(numStorage, "%d", index);
+ string = numStorage;
+ break;
+ case 'P': /* 'Peeked' new value of the string */
+ string = newValue;
+ break;
+ case 's': /* Current string value of spinbox */
+ string = entryPtr->string;
+ break;
+ case 'S': /* string to be inserted/deleted, if any */
+ string = change;
+ break;
+ case 'v': /* type of validation currently set */
+ string = validateStrings[entryPtr->validate];
+ break;
+ case 'V': /* type of validation in effect */
+ switch (type) {
+ case VALIDATE_INSERT:
+ case VALIDATE_DELETE:
+ string = validateStrings[VALIDATE_KEY];
break;
- case 'W': /* widget name */
- string = Tk_PathName(entryPtr->tkwin);
+ case VALIDATE_FORCED:
+ string = "forced";
break;
default:
- length = Tcl_UniCharToUtf(ch, numStorage);
- numStorage[length] = '\0';
- string = numStorage;
+ string = validateStrings[type];
break;
+ }
+ break;
+ case 'W': /* widget name */
+ string = Tk_PathName(entryPtr->tkwin);
+ break;
+ default:
+ length = Tcl_UniCharToUtf(ch, numStorage);
+ numStorage[length] = '\0';
+ string = numStorage;
+ break;
}
}
@@ -3523,9 +3482,8 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
*
* Tk_SpinboxObjCmd --
*
- * This procedure is invoked to process the "spinbox" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This function is invoked to process the "spinbox" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -3537,11 +3495,11 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
*/
int
-Tk_SpinboxObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_SpinboxObjCmd(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
register Entry *entryPtr;
register Spinbox *sbPtr;
@@ -3555,28 +3513,28 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv)
}
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
/*
- * Create the option table for this widget class. If it has already
- * been created, Tk will return the cached value.
+ * Create the option table for this widget class. If it has already been
+ * created, Tk will return the cached value.
*/
optionTable = Tk_CreateOptionTable(interp, sbOptSpec);
/*
- * Initialize the fields of the structure that won't be initialized
- * by ConfigureEntry, or that ConfigureEntry requires to be
- * initialized already (e.g. resource pointers). Only the non-NULL/0
- * data must be initialized as memset covers the rest.
+ * Initialize the fields of the structure that won't be initialized by
+ * ConfigureEntry, or that ConfigureEntry requires to be initialized
+ * already (e.g. resource pointers). Only the non-NULL/0 data must be
+ * initialized as memset covers the rest.
*/
sbPtr = (Spinbox *) ckalloc(sizeof(Spinbox));
entryPtr = (Entry *) sbPtr;
- memset((VOID *) sbPtr, 0, sizeof(Spinbox));
+ memset(sbPtr, 0, sizeof(Spinbox));
entryPtr->tkwin = tkwin;
entryPtr->display = Tk_Display(tkwin);
@@ -3618,7 +3576,7 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv)
sbPtr->buRelief = TK_RELIEF_FLAT;
/*
- * Keep a hold of the associated tkwin until we destroy the listbox,
+ * Keep a hold of the associated tkwin until we destroy the spinbox,
* otherwise Tk might free it while we still need it.
*/
@@ -3640,7 +3598,7 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv)
if (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK) {
goto error;
}
-
+
Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC);
return TCL_OK;
@@ -3654,9 +3612,9 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv)
*
* SpinboxWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -3668,11 +3626,11 @@ Tk_SpinboxObjCmd(clientData, interp, objc, objv)
*/
static int
-SpinboxWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about spinbox widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+SpinboxWidgetObjCmd(
+ ClientData clientData, /* Information about spinbox widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
Entry *entryPtr = (Entry *) clientData;
Spinbox *sbPtr = (Spinbox *) clientData;
@@ -3685,8 +3643,8 @@ SpinboxWidgetObjCmd(clientData, interp, objc, objv)
}
/*
- * Parse the widget command by looking up the second token in
- * the list of valid command names.
+ * Parse the widget command by looking up the second token in the list of
+ * valid command names.
*/
result = Tcl_GetIndexFromObj(interp, objv[1], sbCmdNames,
@@ -3697,471 +3655,454 @@ SpinboxWidgetObjCmd(clientData, interp, objc, objv)
Tcl_Preserve((ClientData) entryPtr);
switch ((enum sbCmd) cmdIndex) {
- case SB_CMD_BBOX: {
- int index, x, y, width, height;
- char buf[TCL_INTEGER_SPACE * 4];
+ case SB_CMD_BBOX: {
+ int index, x, y, width, height;
+ char buf[TCL_INTEGER_SPACE * 4];
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- if ((index == entryPtr->numChars) && (index > 0)) {
- index--;
- }
- Tk_CharBbox(entryPtr->textLayout, index, &x, &y,
- &width, &height);
- sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX,
- y + entryPtr->layoutY, width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- break;
- }
-
- case SB_CMD_CGET: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option");
- goto error;
- }
-
- objPtr = Tk_GetOptionValue(interp, (char *) entryPtr,
- entryPtr->optionTable, objv[2], entryPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
- break;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if ((index == entryPtr->numChars) && (index > 0)) {
+ index--;
}
+ Tk_CharBbox(entryPtr->textLayout, index, &x, &y,
+ &width, &height);
+ sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX,
+ y + entryPtr->layoutY, width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ break;
+ }
- case SB_CMD_CONFIGURE: {
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
- entryPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- entryPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
- } else {
- result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
- }
- break;
+ case SB_CMD_CGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ goto error;
}
- case SB_CMD_DELETE: {
- int first, last;
+ objPtr = Tk_GetOptionValue(interp, (char *) entryPtr,
+ entryPtr->optionTable, objv[2], entryPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ break;
- if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ case SB_CMD_CONFIGURE:
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
+ entryPtr->optionTable,
+ (objc == 3) ? objv[2] : NULL,
+ entryPtr->tkwin);
+ if (objPtr == NULL) {
goto error;
- }
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &first) != TCL_OK) {
- goto error;
- }
- if (objc == 3) {
- last = first + 1;
} else {
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
- &last) != TCL_OK) {
- goto error;
- }
- }
- if ((last >= first) && (entryPtr->state == STATE_NORMAL)) {
- DeleteChars(entryPtr, first, last - first);
+ Tcl_SetObjResult(interp, objPtr);
}
- break;
+ } else {
+ result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
}
+ break;
+
+ case SB_CMD_DELETE: {
+ int first, last;
- case SB_CMD_GET: {
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &first) != TCL_OK) {
+ goto error;
+ }
+ if (objc == 3) {
+ last = first + 1;
+ } else {
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
+ &last) != TCL_OK) {
goto error;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
- break;
}
+ if ((last >= first) && (entryPtr->state == STATE_NORMAL)) {
+ DeleteChars(entryPtr, first, last - first);
+ }
+ break;
+ }
- case SB_CMD_ICURSOR: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "pos");
+ case SB_CMD_GET:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ goto error;
+ }
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ break;
+
+ case SB_CMD_ICURSOR:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pos");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &entryPtr->insertPos) != TCL_OK) {
+ goto error;
+ }
+ EventuallyRedraw(entryPtr);
+ break;
+
+ case SB_CMD_IDENTIFY: {
+ int x, y, elem;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "x y");
+ goto error;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
+ (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
+ goto error;
+ }
+ elem = GetSpinboxElement(sbPtr, x, y);
+ if (elem != SEL_NONE) {
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[elem], -1);
+ }
+ break;
+ }
+
+ case SB_CMD_INDEX: {
+ int index;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "string");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
+ break;
+ }
+
+ case SB_CMD_INSERT: {
+ int index;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index text");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->state == STATE_NORMAL) {
+ InsertChars(entryPtr, index, Tcl_GetString(objv[3]));
+ }
+ break;
+ }
+
+ case SB_CMD_INVOKE:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "elemName");
+ goto error;
+ }
+ result = Tcl_GetIndexFromObj(interp, objv[2],
+ selElementNames, "element", 0, &cmdIndex);
+ if (result != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->state != STATE_DISABLED) {
+ if (SpinboxInvoke(interp, sbPtr, cmdIndex) != TCL_OK) {
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &entryPtr->insertPos) != TCL_OK) {
- goto error;
- }
- EventuallyRedraw(entryPtr);
- break;
}
-
- case SB_CMD_IDENTIFY: {
- int x, y, elem;
+ break;
+ case SB_CMD_SCAN: {
+ int x;
+ char *minorCmd;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
+ goto error;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
+ goto error;
+ }
+
+ minorCmd = Tcl_GetString(objv[2]);
+ if (minorCmd[0] == 'm'
+ && (strncmp(minorCmd, "mark", strlen(minorCmd)) == 0)) {
+ entryPtr->scanMarkX = x;
+ entryPtr->scanMarkIndex = entryPtr->leftIndex;
+ } else if ((minorCmd[0] == 'd')
+ && (strncmp(minorCmd, "dragto", strlen(minorCmd)) == 0)) {
+ EntryScanTo(entryPtr, x);
+ } else {
+ Tcl_AppendResult(interp, "bad scan option \"",
+ Tcl_GetString(objv[2]), "\": must be mark or dragto",
+ NULL);
+ goto error;
+ }
+ break;
+ }
+
+ case SB_CMD_SELECTION: {
+ int index, index2;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ goto error;
+ }
+
+ /*
+ * Parse the selection sub-command, using the command table
+ * "sbSelCmdNames" defined above.
+ */
+
+ result = Tcl_GetIndexFromObj(interp, objv[2], sbSelCmdNames,
+ "selection option", 0, &selIndex);
+ if (result != TCL_OK) {
+ goto error;
+ }
+
+ /*
+ * Disabled entries don't allow the selection to be modified, but
+ * 'selection present' must return a boolean.
+ */
+
+ if ((entryPtr->state == STATE_DISABLED)
+ && (selIndex != SB_SEL_PRESENT)) {
+ goto done;
+ }
+
+ switch (selIndex) {
+ case SB_SEL_ADJUST:
if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "x y");
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
- (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
goto error;
}
- elem = GetSpinboxElement(sbPtr, x, y);
- if (elem != SEL_NONE) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- selElementNames[elem], -1);
+ if (entryPtr->selectFirst >= 0) {
+ int half1, half2;
+
+ half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2;
+ half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2;
+ if (index < half1) {
+ entryPtr->selectAnchor = entryPtr->selectLast;
+ } else if (index > half2) {
+ entryPtr->selectAnchor = entryPtr->selectFirst;
+ } else {
+ /*
+ * We're at about the halfway point in the selection; just
+ * keep the existing anchor.
+ */
+ }
}
+ EntrySelectTo(entryPtr, index);
break;
- }
-
- case SB_CMD_INDEX: {
- int index;
+ case SB_SEL_CLEAR:
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "string");
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
+ if (entryPtr->selectFirst >= 0) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+ EventuallyRedraw(entryPtr);
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
- break;
- }
-
- case SB_CMD_INSERT: {
- int index;
+ goto done;
+ case SB_SEL_FROM:
if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "index text");
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- if (entryPtr->state == STATE_NORMAL) {
- InsertChars(entryPtr, index, Tcl_GetString(objv[3]));
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
}
+ entryPtr->selectAnchor = index;
break;
- }
- case SB_CMD_INVOKE: {
+ case SB_SEL_PRESENT:
if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "elemName");
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
goto error;
}
- result = Tcl_GetIndexFromObj(interp, objv[2],
- selElementNames, "element", 0, &cmdIndex);
- if (result != TCL_OK) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj((entryPtr->selectFirst >= 0)));
+ goto done;
+
+ case SB_SEL_RANGE:
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 3, objv, "start end");
goto error;
}
- if (entryPtr->state != STATE_DISABLED) {
- if (SpinboxInvoke(interp, sbPtr, cmdIndex) != TCL_OK) {
- goto error;
- }
- }
- break;
- }
-
- case SB_CMD_SCAN: {
- int x;
- char *minorCmd;
-
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
goto error;
}
- if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
- goto error;
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[4]),& index2) != TCL_OK) {
+ goto error;
}
-
- minorCmd = Tcl_GetString(objv[2]);
- if (minorCmd[0] == 'm'
- && (strncmp(minorCmd, "mark", strlen(minorCmd)) == 0)) {
- entryPtr->scanMarkX = x;
- entryPtr->scanMarkIndex = entryPtr->leftIndex;
- } else if ((minorCmd[0] == 'd')
- && (strncmp(minorCmd, "dragto", strlen(minorCmd)) == 0)) {
- EntryScanTo(entryPtr, x);
+ if (index >= index2) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
} else {
- Tcl_AppendResult(interp, "bad scan option \"",
- Tcl_GetString(objv[2]), "\": must be mark or dragto",
- (char *) NULL);
- goto error;
+ entryPtr->selectFirst = index;
+ entryPtr->selectLast = index2;
+ }
+ if (!(entryPtr->flags & GOT_SELECTION)
+ && (entryPtr->exportSelection)) {
+ Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
+ EntryLostSelection, (ClientData) entryPtr);
+ entryPtr->flags |= GOT_SELECTION;
}
+ EventuallyRedraw(entryPtr);
break;
- }
-
- case SB_CMD_SELECTION: {
- int index, index2;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ case SB_SEL_TO:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
goto error;
}
-
- /*
- * Parse the selection sub-command, using the command
- * table "sbSelCmdNames" defined above.
- */
-
- result = Tcl_GetIndexFromObj(interp, objv[2], sbSelCmdNames,
- "selection option", 0, &selIndex);
- if (result != TCL_OK) {
- goto error;
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
}
+ EntrySelectTo(entryPtr, index);
+ break;
- /*
- * Disabled entries don't allow the selection to be modified,
- * but 'selection present' must return a boolean.
- */
-
- if ((entryPtr->state == STATE_DISABLED)
- && (selIndex != SB_SEL_PRESENT)) {
- goto done;
+ case SB_SEL_ELEMENT:
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 3, objv, "?elemName?");
+ goto error;
}
+ if (objc == 3) {
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[sbPtr->selElement], -1);
+ } else {
+ int lastElement = sbPtr->selElement;
- switch (selIndex) {
- case SB_SEL_ADJUST: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- if (entryPtr->selectFirst >= 0) {
- int half1, half2;
-
- half1 = (entryPtr->selectFirst
- + entryPtr->selectLast)/2;
- half2 = (entryPtr->selectFirst
- + entryPtr->selectLast + 1)/2;
- if (index < half1) {
- entryPtr->selectAnchor = entryPtr->selectLast;
- } else if (index > half2) {
- entryPtr->selectAnchor = entryPtr->selectFirst;
- } else {
- /*
- * We're at about the halfway point in the
- * selection; just keep the existing anchor.
- */
- }
- }
- EntrySelectTo(entryPtr, index);
- break;
- }
-
- case SB_SEL_CLEAR: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
- goto error;
- }
- if (entryPtr->selectFirst >= 0) {
- entryPtr->selectFirst = -1;
- entryPtr->selectLast = -1;
- EventuallyRedraw(entryPtr);
- }
- goto done;
- }
-
- case SB_SEL_FROM: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- entryPtr->selectAnchor = index;
- break;
- }
-
- case SB_SEL_PRESENT: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
- goto error;
- }
- Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj((entryPtr->selectFirst >= 0)));
- goto done;
+ result = Tcl_GetIndexFromObj(interp, objv[3], selElementNames,
+ "selection element", 0, &(sbPtr->selElement));
+ if (result != TCL_OK) {
+ goto error;
}
-
- case SB_SEL_RANGE: {
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 3, objv, "start end");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[4]),& index2) != TCL_OK) {
- goto error;
- }
- if (index >= index2) {
- entryPtr->selectFirst = -1;
- entryPtr->selectLast = -1;
- } else {
- entryPtr->selectFirst = index;
- entryPtr->selectLast = index2;
- }
- if (!(entryPtr->flags & GOT_SELECTION)
- && (entryPtr->exportSelection)) {
- Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
- EntryLostSelection, (ClientData) entryPtr);
- entryPtr->flags |= GOT_SELECTION;
- }
+ if (lastElement != sbPtr->selElement) {
EventuallyRedraw(entryPtr);
- break;
- }
-
- case SB_SEL_TO: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- goto error;
- }
- if (GetEntryIndex(interp, entryPtr,
- Tcl_GetString(objv[3]), &index) != TCL_OK) {
- goto error;
- }
- EntrySelectTo(entryPtr, index);
- break;
- }
-
- case SB_SEL_ELEMENT: {
- if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 3, objv, "?elemName?");
- goto error;
- }
- if (objc == 3) {
- Tcl_SetStringObj(Tcl_GetObjResult(interp),
- selElementNames[sbPtr->selElement], -1);
- } else {
- int lastElement = sbPtr->selElement;
-
- result = Tcl_GetIndexFromObj(interp, objv[3],
- selElementNames, "selection element", 0,
- &(sbPtr->selElement));
- if (result != TCL_OK) {
- goto error;
- }
- if (lastElement != sbPtr->selElement) {
- EventuallyRedraw(entryPtr);
- }
- }
- break;
}
}
break;
}
+ break;
+ }
+
+ case SB_CMD_SET:
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?string?");
+ goto error;
+ }
+ if (objc == 3) {
+ EntryValueChanged(entryPtr, Tcl_GetString(objv[2]));
+ }
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ break;
- case SB_CMD_SET: {
- if (objc > 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "?string?");
- goto error;
- }
- if (objc == 3) {
- EntryValueChanged(entryPtr, Tcl_GetString(objv[2]));
- }
- Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
- break;
+ case SB_CMD_VALIDATE: {
+ int code;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ goto error;
}
+ selIndex = entryPtr->validate;
+ entryPtr->validate = VALIDATE_ALL;
+ code = EntryValidateChange(entryPtr, NULL, entryPtr->string,
+ -1, VALIDATE_FORCED);
+ if (entryPtr->validate != VALIDATE_NONE) {
+ entryPtr->validate = selIndex;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
+ break;
+ }
- case SB_CMD_VALIDATE: {
- int code;
+ case SB_CMD_XVIEW: {
+ int index;
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ if (objc == 2) {
+ double first, last;
+ char buf[TCL_DOUBLE_SPACE];
+
+ EntryVisibleRange(entryPtr, &first, &last);
+ Tcl_PrintDouble(NULL, first, buf);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, last, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
+ goto done;
+ } else if (objc == 3) {
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
goto error;
}
- selIndex = entryPtr->validate;
- entryPtr->validate = VALIDATE_ALL;
- code = EntryValidateChange(entryPtr, (char *) NULL,
- entryPtr->string, -1, VALIDATE_FORCED);
- if (entryPtr->validate != VALIDATE_NONE) {
- entryPtr->validate = selIndex;
- }
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
- break;
- }
+ } else {
+ double fraction;
+ int count;
- case SB_CMD_XVIEW: {
- int index;
-
- if (objc == 2) {
- double first, last;
- char buf[TCL_DOUBLE_SPACE * 2];
-
- EntryVisibleRange(entryPtr, &first, &last);
- sprintf(buf, "%g %g", first, last);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- goto done;
- } else if (objc == 3) {
- if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
- &index) != TCL_OK) {
- goto error;
- }
- } else {
- double fraction;
- int count;
-
- index = entryPtr->leftIndex;
- switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
- &count)) {
- case TK_SCROLL_ERROR: {
- goto error;
- }
- case TK_SCROLL_MOVETO: {
- index = (int) ((fraction * entryPtr->numChars) + 0.5);
- break;
- }
- case TK_SCROLL_PAGES: {
- int charsPerPage;
-
- charsPerPage = ((Tk_Width(entryPtr->tkwin)
- - 2 * entryPtr->inset - entryPtr->xWidth)
- / entryPtr->avgWidth) - 2;
- if (charsPerPage < 1) {
- charsPerPage = 1;
- }
- index += count * charsPerPage;
- break;
- }
- case TK_SCROLL_UNITS: {
- index += count;
- break;
- }
+ index = entryPtr->leftIndex;
+ switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
+ &count)) {
+ case TK_SCROLL_ERROR:
+ goto error;
+ case TK_SCROLL_MOVETO:
+ index = (int) ((fraction * entryPtr->numChars) + 0.5);
+ break;
+ case TK_SCROLL_PAGES: {
+ int charsPerPage;
+
+ charsPerPage = ((Tk_Width(entryPtr->tkwin)
+ - 2 * entryPtr->inset - entryPtr->xWidth)
+ / entryPtr->avgWidth) - 2;
+ if (charsPerPage < 1) {
+ charsPerPage = 1;
}
+ index += count * charsPerPage;
+ break;
}
- if (index >= entryPtr->numChars) {
- index = entryPtr->numChars - 1;
+ case TK_SCROLL_UNITS:
+ index += count;
+ break;
}
- if (index < 0) {
- index = 0;
- }
- entryPtr->leftIndex = index;
- entryPtr->flags |= UPDATE_SCROLLBAR;
- EntryComputeGeometry(entryPtr);
- EventuallyRedraw(entryPtr);
- break;
}
+ if (index >= entryPtr->numChars) {
+ index = entryPtr->numChars - 1;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ entryPtr->leftIndex = index;
+ entryPtr->flags |= UPDATE_SCROLLBAR;
+ EntryComputeGeometry(entryPtr);
+ EventuallyRedraw(entryPtr);
+ break;
+ }
}
- done:
+ done:
Tcl_Release((ClientData) entryPtr);
return result;
- error:
+ error:
Tcl_Release((ClientData) entryPtr);
return TCL_ERROR;
}
@@ -4183,11 +4124,10 @@ SpinboxWidgetObjCmd(clientData, interp, objc, objv)
*/
static int
-GetSpinboxElement(sbPtr, x, y)
- Spinbox *sbPtr; /* Spinbox for which the index is being
+GetSpinboxElement(
+ Spinbox *sbPtr, /* Spinbox for which the index is being
* specified. */
- int x; /* x coord */
- int y; /* y coord */
+ int x, int y) /* Widget-relative coordinates. */
{
Entry *entryPtr = (Entry *) sbPtr;
@@ -4211,25 +4151,25 @@ GetSpinboxElement(sbPtr, x, y)
*
* SpinboxInvoke --
*
- * This procedure is invoked when the invoke method for the
- * widget is called.
+ * This function is invoked when the invoke method for the widget is
+ * called.
*
* Results:
* TCL_OK.
*
* Side effects:
- * An background error condition may arise when invoking the
- * callback. The widget value may change.
+ * An background error condition may arise when invoking the callback.
+ * The widget value may change.
*
*--------------------------------------------------------------
*/
static int
-SpinboxInvoke(interp, sbPtr, element)
- register Tcl_Interp *interp; /* Current interpreter. */
- register Spinbox *sbPtr; /* Spinbox to invoke. */
- int element; /* element to invoke, either the "up"
- * or "down" button. */
+SpinboxInvoke(
+ register Tcl_Interp *interp,/* Current interpreter. */
+ register Spinbox *sbPtr, /* Spinbox to invoke. */
+ int element) /* Element to invoke, either the "up" or
+ * "down" button. */
{
Entry *entryPtr = (Entry *) sbPtr;
char *type;
@@ -4237,16 +4177,16 @@ SpinboxInvoke(interp, sbPtr, element)
Tcl_DString script;
switch (element) {
- case SEL_BUTTONUP:
- type = "up";
- up = 1;
- break;
- case SEL_BUTTONDOWN:
- type = "down";
- up = 0;
- break;
- default:
- return TCL_OK;
+ case SEL_BUTTONUP:
+ type = "up";
+ up = 1;
+ break;
+ case SEL_BUTTONDOWN:
+ type = "down";
+ up = 0;
+ break;
+ default:
+ return TCL_OK;
}
if (fabs(sbPtr->increment) > MIN_DBL_VAL) {
@@ -4256,11 +4196,11 @@ SpinboxInvoke(interp, sbPtr, element)
Tcl_ListObjIndex(interp, sbPtr->listObj, sbPtr->eIndex, &objPtr);
if (strcmp(Tcl_GetString(objPtr), entryPtr->string)) {
/*
- * Somehow the string changed from what we expected,
- * so let's do a search on the list to see if the current
- * value is there. If not, move to the first element of
- * the list.
+ * Somehow the string changed from what we expected, so let's
+ * do a search on the list to see if the current value is
+ * there. If not, move to the first element of the list.
*/
+
int i, listc, elemLen, length = entryPtr->numChars;
char *bytes;
Tcl_Obj **listv;
@@ -4298,45 +4238,46 @@ SpinboxInvoke(interp, sbPtr, element)
} else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) {
double dvalue;
- if (Tcl_GetDouble(NULL, entryPtr->string, &dvalue) != TCL_OK) {
+ if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) {
/*
- * If the string is empty, or isn't a valid double value,
- * just use the -from value
+ * If the string doesn't scan as a double value, just
+ * use the -from value
*/
+
dvalue = sbPtr->fromValue;
- } else {
- if (up) {
- dvalue += sbPtr->increment;
- if (dvalue > sbPtr->toValue) {
- if (sbPtr->wrap) {
- dvalue = sbPtr->fromValue;
- } else {
- dvalue = sbPtr->toValue;
- }
- } else if (dvalue < sbPtr->fromValue) {
- /*
- * It's possible that when pressing up, we are
- * still less than the fromValue, because the
- * user may have manipulated the value by hand.
- */
+ } else if (up) {
+ dvalue += sbPtr->increment;
+ if (dvalue > sbPtr->toValue) {
+ if (sbPtr->wrap) {
dvalue = sbPtr->fromValue;
+ } else {
+ dvalue = sbPtr->toValue;
}
- } else {
- dvalue -= sbPtr->increment;
- if (dvalue < sbPtr->fromValue) {
- if (sbPtr->wrap) {
- dvalue = sbPtr->toValue;
- } else {
- dvalue = sbPtr->fromValue;
- }
- } else if (dvalue > sbPtr->toValue) {
- /*
- * It's possible that when pressing down, we are
- * still greater than the toValue, because the
- * user may have manipulated the value by hand.
- */
+ } else if (dvalue < sbPtr->fromValue) {
+ /*
+ * It's possible that when pressing up, we are still less
+ * than the fromValue, because the user may have
+ * manipulated the value by hand.
+ */
+
+ dvalue = sbPtr->fromValue;
+ }
+ } else {
+ dvalue -= sbPtr->increment;
+ if (dvalue < sbPtr->fromValue) {
+ if (sbPtr->wrap) {
dvalue = sbPtr->toValue;
+ } else {
+ dvalue = sbPtr->fromValue;
}
+ } else if (dvalue > sbPtr->toValue) {
+ /*
+ * It's possible that when pressing down, we are still
+ * greater than the toValue, because the user may have
+ * manipulated the value by hand.
+ */
+
+ dvalue = sbPtr->toValue;
}
}
sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue);
@@ -4357,9 +4298,11 @@ SpinboxInvoke(interp, sbPtr, element)
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp, "\n\t(in command executed by spinbox)");
Tcl_BackgroundError(interp);
+
/*
* Yes, it's an error, but a bg one, so we return OK
*/
+
return TCL_OK;
}
@@ -4374,9 +4317,9 @@ SpinboxInvoke(interp, sbPtr, element)
*
* ComputeFormat --
*
- * This procedure is invoked to recompute the "format" fields
- * of a spinbox's widget record, which determines how the value
- * of the dial is converted to a string.
+ * This function is invoked to recompute the "format" fields of a
+ * spinbox's widget record, which determines how the value of the dial is
+ * converted to a string.
*
* Results:
* Tcl result code.
@@ -4386,17 +4329,18 @@ SpinboxInvoke(interp, sbPtr, element)
*
*----------------------------------------------------------------------
*/
+
static int
-ComputeFormat(sbPtr)
- Spinbox *sbPtr; /* Information about dial widget. */
+ComputeFormat(
+ Spinbox *sbPtr) /* Information about dial widget. */
{
double maxValue, x;
int mostSigDigit, numDigits, leastSigDigit, afterDecimal;
int eDigits, fDigits;
/*
- * Compute the displacement from the decimal of the most significant
- * digit required for any number in the dial's range.
+ * Compute the displacement from the decimal of the most significant digit
+ * required for any number in the dial's range.
*/
if (sbPtr->reqFormat) {
@@ -4418,6 +4362,7 @@ ComputeFormat(sbPtr)
/*
* A increment was specified, so use it.
*/
+
leastSigDigit = (int) floor(log10(sbPtr->increment));
} else {
leastSigDigit = 0;
@@ -4428,13 +4373,13 @@ ComputeFormat(sbPtr)
}
/*
- * Compute the number of characters required using "e" format and
- * "f" format, and then choose whichever one takes fewer characters.
+ * Compute the number of characters required using "e" format and "f"
+ * format, and then choose whichever one takes fewer characters.
*/
eDigits = numDigits + 4;
if (numDigits > 1) {
- eDigits++; /* Decimal point. */
+ eDigits++; /* Decimal point. */
}
afterDecimal = numDigits - mostSigDigit - 1;
if (afterDecimal < 0) {
@@ -4442,10 +4387,10 @@ ComputeFormat(sbPtr)
}
fDigits = (mostSigDigit >= 0) ? mostSigDigit + afterDecimal : afterDecimal;
if (afterDecimal > 0) {
- fDigits++; /* Decimal point. */
+ fDigits++; /* Decimal point. */
}
if (mostSigDigit < 0) {
- fDigits++; /* Zero to left of decimal point. */
+ fDigits++; /* Zero to left of decimal point. */
}
if (fDigits <= eDigits) {
sprintf(sbPtr->digitFormat, "%%.%df", afterDecimal);
@@ -4455,3 +4400,11 @@ ComputeFormat(sbPtr)
sbPtr->valueFormat = sbPtr->digitFormat;
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index 3bb2f1d..7f8aa1f 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -1,13 +1,12 @@
/*
* tkEntry.h --
- *
- * This module defined the structures for the Entry & SpinBox widgets.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * This module defined the structures for the Entry & SpinBox widgets.
*
- * Copyright (c) 2002 Apple Computer, Inc.
+ * 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.
*/
#ifndef _TKENTRY
@@ -18,8 +17,8 @@
#endif
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
#endif
enum EntryType {
@@ -27,16 +26,16 @@ enum EntryType {
};
/*
- * A data structure of the following type is kept for each Entry
- * widget managed by this file:
+ * A data structure of the following type is kept for each Entry widget
+ * managed by this file:
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the entry. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Used, among
+ Tk_Window tkwin; /* Window that embodies the entry. NULL means
+ * that the window has been destroyed but the
+ * data structures haven't yet been cleaned
+ * up.*/
+ Display *display; /* Display containing widget. Used, among
* other things, so that resources can be
* freed even after tkwin has gone away. */
Tcl_Interp *interp; /* Interpreter associated with entry. */
@@ -48,9 +47,9 @@ typedef struct {
/*
* Fields that are set by widget commands other than "configure".
*/
-
+
CONST char *string; /* Pointer to storage for string;
- * NULL-terminated; malloc-ed. */
+ * NULL-terminated; malloc-ed. */
int insertPos; /* Character index before which next typed
* character will be inserted. */
@@ -58,8 +57,8 @@ typedef struct {
* Information about what's selected, if any.
*/
- int selectFirst; /* Character index of first selected
- * character (-1 means nothing selected. */
+ int selectFirst; /* Character index of first selected character
+ * (-1 means nothing selected. */
int selectLast; /* Character index just after last selected
* character (-1 means nothing selected. */
int selectAnchor; /* Fixed end of selection (i.e. "select to"
@@ -81,11 +80,11 @@ typedef struct {
Tk_3DBorder normalBorder; /* Used for drawing border around whole
* window, plus used for background. */
- Tk_3DBorder disabledBorder; /* Used for drawing border around whole
- * window in disabled state, plus used for
+ Tk_3DBorder disabledBorder; /* Used for drawing border around whole window
+ * in disabled state, plus used for
* background. */
- Tk_3DBorder readonlyBorder; /* Used for drawing border around whole
- * window in readonly state, plus used for
+ Tk_3DBorder readonlyBorder; /* Used for drawing border around whole window
+ * in readonly state, plus used for
* background. */
int borderWidth; /* Width of 3-D border around window. */
Tk_Cursor cursor; /* Current cursor for window, or None. */
@@ -94,12 +93,12 @@ typedef struct {
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *fgColorPtr; /* Text color in normal mode. */
XColor *dfgColorPtr; /* Text color in disabled mode. */
- XColor *highlightBgColorPtr;/* Color for drawing traversal highlight
- * area when highlight is off. */
+ XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
+ * when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
+ int highlightWidth; /* Width in pixels of highlight to draw around
+ * widget when it has the focus. <= 0 means
+ * don't draw a highlight. */
Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
* cursor. */
int insertBorderWidth; /* Width of 3-D border around insert cursor. */
@@ -115,44 +114,46 @@ typedef struct {
* characters. */
int selBorderWidth; /* Width of border around selection. */
XColor *selFgColorPtr; /* Foreground color for selected text. */
- int state; /* Normal or disabled. Entry is read-only
- * when disabled. */
- char *textVarName; /* Name of variable (malloc'ed) or NULL.
- * If non-NULL, entry's string tracks the
- * contents of this variable and vice versa. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ int state; /* Normal or disabled. Entry is read-only when
+ * disabled. */
+ char *textVarName; /* Name of variable (malloc'ed) or NULL. If
+ * non-NULL, entry's string tracks the
+ * contents of this variable and vice
+ * versa. */
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
int prefWidth; /* Desired width of window, measured in
* average characters. */
char *scrollCmd; /* Command prefix for communicating with
- * scrollbar(s). Malloc'ed. NULL means
- * no command to issue. */
- char *showChar; /* Value of -show option. If non-NULL, first
+ * scrollbar(s). Malloc'ed. NULL means no
+ * command to issue. */
+ char *showChar; /* Value of -show option. If non-NULL, first
* character is used for displaying all
- * characters in entry. Malloc'ed.
- * This is only used by the Entry widget. */
+ * characters in entry. Malloc'ed. This is
+ * only used by the Entry widget. */
/*
* Fields whose values are derived from the current values of the
* configuration settings above.
*/
- CONST char *displayString; /* String to use when displaying. This may
- * be a pointer to string, or a pointer to
+ CONST char *displayString; /* String to use when displaying. This may be
+ * a pointer to string, or a pointer to
* malloced memory with the same character
- * length as string but whose characters
- * are all equal to showChar. */
+ * length as string but whose characters are
+ * all equal to showChar. */
int numBytes; /* Length of string in bytes. */
- int numChars; /* Length of string in characters. Both
- * string and displayString have the same
- * character length, but may have different
- * byte lengths due to being made from
- * different UTF-8 characters. */
+ int numChars; /* Length of string in characters. Both string
+ * and displayString have the same character
+ * length, but may have different byte lengths
+ * due to being made from different UTF-8
+ * characters. */
int numDisplayBytes; /* Length of displayString in bytes. */
int inset; /* Number of pixels on the left and right
- * sides that are taken up by XPAD, borderWidth
- * (if any), and highlightWidth (if any). */
+ * sides that are taken up by XPAD,
+ * borderWidth (if any), and highlightWidth
+ * (if any). */
Tk_TextLayout textLayout; /* Cached text layout information. */
int layoutX, layoutY; /* Origin for layout. */
int leftX; /* X position at which character at leftIndex
@@ -166,23 +167,22 @@ typedef struct {
GC selTextGC; /* For drawing selected text. */
GC highlightGC; /* For drawing traversal highlight. */
int avgWidth; /* Width of average character. */
- int xWidth; /* Extra width to reserve for widget.
- * Used by spinboxes for button space. */
- int flags; /* Miscellaneous flags; see below for
+ int xWidth; /* Extra width to reserve for widget. Used by
+ * spinboxes for button space. */
+ int flags; /* Miscellaneous flags; see below for
* definitions. */
- int validate; /* Non-zero means try to validate */
- char *validateCmd; /* Command prefix to use when invoking
- * validate command. NULL means don't
- * invoke commands. Malloc'ed. */
+ int validate; /* Non-zero means try to validate */
+ char *validateCmd; /* Command prefix to use when invoking
+ * validate command. NULL means don't invoke
+ * commands. Malloc'ed. */
char *invalidCmd; /* Command called when a validation returns 0
* (successfully fails), defaults to {}. */
-
} Entry;
/*
- * A data structure of the following type is kept for each spinbox
- * widget managed by this file:
+ * A data structure of the following type is kept for each spinbox widget
+ * managed by this file:
*/
typedef struct {
@@ -200,8 +200,8 @@ typedef struct {
Tk_Cursor bCursor; /* cursor for buttons, or None. */
int bdRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
int buRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
- char *command; /* Command to invoke for spin buttons.
- * NULL means no command to issue. */
+ char *command; /* Command to invoke for spin buttons. NULL
+ * means no command to issue. */
/*
* Spinbox specific fields for use with configuration settings above.
@@ -216,38 +216,37 @@ typedef struct {
int repeatInterval; /* repeat interval */
double fromValue; /* Value corresponding to left/top of dial */
- double toValue; /* Value corresponding to right/bottom
- * of dial */
- double increment; /* If > 0, all values are rounded to an
- * even multiple of this value. */
+ double toValue; /* Value corresponding to right/bottom of
+ * dial */
+ double increment; /* If > 0, all values are rounded to an even
+ * multiple of this value. */
char *formatBuf; /* string into which to format value.
* Malloc'ed. */
char *reqFormat; /* Sprintf conversion specifier used for the
- * value that the users requests. Malloc'ed. */
- char *valueFormat; /* Sprintf conversion specifier used for
- * the value. */
+ * value that the users requests. Malloc'ed */
+ char *valueFormat; /* Sprintf conversion specifier used for the
+ * value. */
char digitFormat[10]; /* Sprintf conversion specifier computed from
- * digits and other information; used for
- * the value. */
+ * digits and other information; used for the
+ * value. */
char *valueStr; /* Values List. Malloc'ed. */
Tcl_Obj *listObj; /* Pointer to the list object being used */
int eIndex; /* Holds the current index into elements */
int nElements; /* Holds the current count of elements */
-
} Spinbox;
/*
- * Assigned bits of "flags" fields of Entry structures, and what those
- * bits mean:
+ * Assigned bits of "flags" fields of Entry structures, and what those bits
+ * mean:
*
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
* already been queued to redisplay the entry.
* BORDER_NEEDED: Non-zero means 3-D border must be redrawn
- * around window during redisplay. Normally
- * only text portion needs to be redrawn.
+ * around window during redisplay. Normally only
+ * text portion needs to be redrawn.
* CURSOR_ON: Non-zero means insert cursor is displayed at
- * present. 0 means it isn't displayed.
+ * present. 0 means it isn't displayed.
* GOT_FOCUS: Non-zero means this window has the input
* focus.
* UPDATE_SCROLLBAR: Non-zero means scrollbar should be updated
@@ -268,40 +267,40 @@ typedef struct {
#define GOT_FOCUS 8
#define UPDATE_SCROLLBAR 0x10
#define GOT_SELECTION 0x20
-#define ENTRY_DELETED 0x40
-#define VALIDATING 0x80
-#define VALIDATE_VAR 0x100
-#define VALIDATE_ABORT 0x200
-#define ENTRY_VAR_TRACED 0x400
+#define ENTRY_DELETED 0x40
+#define VALIDATING 0x80
+#define VALIDATE_VAR 0x100
+#define VALIDATE_ABORT 0x200
+#define ENTRY_VAR_TRACED 0x400
/*
- * The following enum is used to define a type for the -state option
- * of the Entry widget. These values are used as indices into the
- * string table below.
+ * The following enum is used to define a type for the -state option of the
+ * Entry widget. These values are used as indices into the string table below.
*/
enum state {
STATE_DISABLED, STATE_NORMAL, STATE_READONLY
};
-/*
+/*
* This is the element index corresponding to the strings in selElementNames.
* If you modify them, you must modify the numbers here.
*/
-
+
enum selelement {
SEL_NONE, SEL_BUTTONDOWN, SEL_BUTTONUP, SEL_NULL, SEL_ENTRY
};
/*
- * Declaration of procedures used in the implementation of the native side
- * of the Entry widget.
+ * Declaration of functions used in the implementation of the native side of
+ * the Entry widget.
*/
-int TkpDrawEntryBorderAndFocus(Entry *entryPtr, Drawable d, int isSpinbox);
-int TkpDrawSpinboxButtons(Spinbox *sbPtr, Drawable d);
+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
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLIMPORT
-#endif /* _TKBUTTON */
+#endif /* _TKENTRY */
diff --git a/generic/tkError.c b/generic/tkError.c
index dabf898..6617c37 100644
--- a/generic/tkError.c
+++ b/generic/tkError.c
@@ -1,109 +1,98 @@
-/*
+/*
* tkError.c --
*
- * This file provides a high-performance mechanism for
- * selectively dealing with errors that occur in talking
- * to the X server. This is useful, for example, when
- * communicating with a window that may not exist.
+ * This file provides a high-performance mechanism for selectively
+ * dealing with errors that occur in talking to the X server. This is
+ * useful, for example, when communicating with a window that may not
+ * exist.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
- * The default X error handler gets saved here, so that it can
- * be invoked if an error occurs that we can't handle.
+ * The default X error handler gets saved here, so that it can be invoked if
+ * an error occurs that we can't handle.
*/
-static int (*defaultHandler) _ANSI_ARGS_((Display *display,
- XErrorEvent *eventPtr)) = NULL;
-
+typedef int (*TkXErrorHandler)(Display *display, XErrorEvent *eventPtr);
+static TkXErrorHandler defaultHandler = NULL;
/*
* Forward references to procedures declared later in this file:
*/
-static int ErrorProc _ANSI_ARGS_((Display *display,
- XErrorEvent *errEventPtr));
+static int ErrorProc(Display *display, XErrorEvent *errEventPtr);
/*
*--------------------------------------------------------------
*
* Tk_CreateErrorHandler --
*
- * Arrange for all a given procedure to be invoked whenever
- * certain errors occur.
+ * Arrange for all a given procedure to be invoked whenever certain
+ * errors occur.
*
* Results:
- * The return value is a token identifying the handler;
- * it must be passed to Tk_DeleteErrorHandler to delete the
- * handler.
+ * The return value is a token identifying the handler; it must be passed
+ * to Tk_DeleteErrorHandler to delete the handler.
*
* Side effects:
- * If an X error occurs that matches the error, request,
- * and minor arguments, then errorProc will be invoked.
- * ErrorProc should have the following structure:
+ * If an X error occurs that matches the error, request, and minor
+ * arguments, then errorProc will be invoked. ErrorProc should have the
+ * following structure:
*
* int
- * errorProc(clientData, errorEventPtr)
- * caddr_t clientData;
- * XErrorEvent *errorEventPtr;
- * {
+ * errorProc(caddr_t clientData, XErrorEvent *errorEventPtr) {
* }
*
- * The clientData argument will be the same as the clientData
- * argument to this procedure, and errorEvent will describe
- * the error. If errorProc returns 0, it means that it
- * completely "handled" the error: no further processing
- * should be done. If errorProc returns 1, it means that it
- * didn't know how to deal with the error, so we should look
- * for other error handlers, or invoke the default error
- * handler if no other handler returns zero. Handlers are
- * invoked in order of age: youngest handler first.
+ * The clientData argument will be the same as the clientData argument to
+ * this procedure, and errorEvent will describe the error. If errorProc
+ * returns 0, it means that it completely "handled" the error: no further
+ * processing should be done. If errorProc returns 1, it means that it
+ * didn't know how to deal with the error, so we should look for other
+ * error handlers, or invoke the default error handler if no other
+ * handler returns zero. Handlers are invoked in order of age: youngest
+ * handler first.
*
- * Note: errorProc will only be called for errors associated
- * with X requests made AFTER this call, but BEFORE the handler
- * is deleted by calling Tk_DeleteErrorHandler.
+ * Note: errorProc will only be called for errors associated with X
+ * requests made AFTER this call, but BEFORE the handler is deleted by
+ * calling Tk_DeleteErrorHandler.
*
*--------------------------------------------------------------
*/
Tk_ErrorHandler
-Tk_CreateErrorHandler(display, error, request, minorCode, errorProc, clientData)
- Display *display; /* Display for which to handle
+Tk_CreateErrorHandler(
+ Display *display, /* Display for which to handle errors. */
+ int error, /* Consider only errors with this error_code
+ * (-1 means consider all errors). */
+ int request, /* Consider only errors with this major
+ * request code (-1 means consider all major
+ * codes). */
+ int minorCode, /* Consider only errors with this minor
+ * request code (-1 means consider all minor
+ * codes). */
+ Tk_ErrorProc *errorProc, /* Procedure to invoke when a matching error
+ * occurs. NULL means just ignore matching
* errors. */
- int error; /* Consider only errors with this
- * error_code (-1 means consider
- * all errors). */
- int request; /* Consider only errors with this
- * major request code (-1 means
- * consider all major codes). */
- int minorCode; /* Consider only errors with this
- * minor request code (-1 means
- * consider all minor codes). */
- Tk_ErrorProc *errorProc; /* Procedure to invoke when a
- * matching error occurs. NULL means
- * just ignore matching errors. */
- ClientData clientData; /* Arbitrary value to pass to
- * errorProc. */
+ ClientData clientData) /* Arbitrary value to pass to errorProc. */
{
register TkErrorHandler *errorPtr;
register TkDisplay *dispPtr;
/*
- * Find the display. If Tk doesn't know about this display then
- * it's an error: panic.
+ * Find the display. If Tk doesn't know about this display then it's an
+ * error: panic.
*/
dispPtr = TkGetDisplay(display);
if (dispPtr == NULL) {
- panic("Unknown display passed to Tk_CreateErrorHandler");
+ Tcl_Panic("Unknown display passed to Tk_CreateErrorHandler");
}
/*
@@ -144,22 +133,19 @@ Tk_CreateErrorHandler(display, error, request, minorCode, errorProc, clientData)
* None.
*
* Side effects:
- * The handler denoted by the "handler" argument will not
- * be invoked for any X errors associated with requests
- * made after this call. However, if errors arrive later
- * for requests made BEFORE this call, then the handler
- * will still be invoked. Call XSync if you want to be
- * sure that all outstanding errors have been received
- * and processed.
+ * The handler denoted by the "handler" argument will not be invoked for
+ * any X errors associated with requests made after this call. However,
+ * if errors arrive later for requests made BEFORE this call, then the
+ * handler will still be invoked. Call XSync if you want to be sure that
+ * all outstanding errors have been received and processed.
*
*--------------------------------------------------------------
*/
void
-Tk_DeleteErrorHandler(handler)
- Tk_ErrorHandler handler; /* Token for handler to delete;
- * was previous return value from
- * Tk_CreateErrorHandler. */
+Tk_DeleteErrorHandler(
+ Tk_ErrorHandler handler) /* Token for handler to delete; was previous
+ * return value from Tk_CreateErrorHandler. */
{
register TkErrorHandler *errorPtr = (TkErrorHandler *) handler;
register TkDisplay *dispPtr = errorPtr->dispPtr;
@@ -167,17 +153,15 @@ Tk_DeleteErrorHandler(handler)
errorPtr->lastRequest = NextRequest(dispPtr->display) - 1;
/*
- * Every once-in-a-while, cleanup handlers that are no longer
- * active. We probably won't be able to free the handler that
- * was just deleted (need to wait for any outstanding requests to
- * be processed by server), but there may be previously-deleted
- * handlers that are now ready for garbage collection. To reduce
- * the cost of the cleanup, let a few dead handlers pile up, then
- * clean them all at once. This adds a bit of overhead to errors
- * that might occur while the dead handlers are hanging around,
- * but reduces the overhead of scanning the list to clean up
- * (particularly if there are many handlers that stay around
- * forever).
+ * Every once-in-a-while, cleanup handlers that are no longer active. We
+ * probably won't be able to free the handler that was just deleted (need
+ * to wait for any outstanding requests to be processed by server), but
+ * there may be previously-deleted handlers that are now ready for garbage
+ * collection. To reduce the cost of the cleanup, let a few dead handlers
+ * pile up, then clean them all at once. This adds a bit of overhead to
+ * errors that might occur while the dead handlers are hanging around, but
+ * reduces the overhead of scanning the list to clean up (particularly if
+ * there are many handlers that stay around forever).
*/
dispPtr->deleteCount += 1;
@@ -211,35 +195,33 @@ Tk_DeleteErrorHandler(handler)
*
* ErrorProc --
*
- * This procedure is invoked by the X system when error
- * events arrive.
+ * This procedure is invoked by the X system when error events arrive.
*
* Results:
- * If it returns, the return value is zero. However,
- * it is possible that one of the error handlers may
- * just exit.
+ * If it returns, the return value is zero. However, it is possible that
+ * one of the error handlers may just exit.
*
* Side effects:
- * This procedure does two things. First, it uses the
- * serial # in the error event to eliminate handlers whose
- * expiration serials are now in the past. Second, it
- * invokes any handlers that want to deal with the error.
+ * This procedure does two things. First, it uses the serial # in the
+ * error event to eliminate handlers whose expiration serials are now in
+ * the past. Second, it invokes any handlers that want to deal with the
+ * error.
*
*--------------------------------------------------------------
*/
static int
-ErrorProc(display, errEventPtr)
- Display *display; /* Display for which error
- * occurred. */
- register XErrorEvent *errEventPtr; /* Information about error. */
+ErrorProc(
+ Display *display, /* Display for which error occurred. */
+ register XErrorEvent *errEventPtr)
+ /* Information about error. */
{
register TkDisplay *dispPtr;
register TkErrorHandler *errorPtr;
/*
- * See if we know anything about the display. If not, then
- * invoke the default error handler.
+ * See if we know anything about the display. If not, then invoke the
+ * default error handler.
*/
dispPtr = TkGetDisplay(display);
@@ -264,42 +246,47 @@ ErrorProc(display, errEventPtr)
&& (errorPtr->lastRequest < errEventPtr->serial))) {
continue;
}
- if (errorPtr->errorProc == NULL) {
+ if (errorPtr->errorProc == NULL || (*errorPtr->errorProc)(
+ errorPtr->clientData, errEventPtr) == 0) {
return 0;
- } else {
- if ((*errorPtr->errorProc)(errorPtr->clientData,
- errEventPtr) == 0) {
- return 0;
- }
}
}
/*
- * See if the error is a BadWindow error. If so, and it refers
- * to a window that still exists in our window table, then ignore
- * the error. Errors like this can occur if a window owned by us
- * is deleted by someone externally, like a window manager. We'll
- * ignore the errors at least long enough to clean up internally and
- * remove the entry from the window table.
+ * See if the error is a BadWindow error. If so, and it refers to a window
+ * that still exists in our window table, then ignore the error. Errors
+ * like this can occur if a window owned by us is deleted by someone
+ * externally, like a window manager. We'll ignore the errors at least
+ * long enough to clean up internally and remove the entry from the window
+ * table.
*
- * NOTE: For embedding, we must also check whether the window was
- * recently deleted. If so, it may be that Tk generated operations on
- * windows that were deleted by the container. Now we are getting
- * the errors (BadWindow) after Tk already deleted the window itself.
+ * NOTE: For embedding, we must also check whether the window was recently
+ * deleted. If so, it may be that Tk generated operations on windows that
+ * were deleted by the container. Now we are getting the errors
+ * (BadWindow) after Tk already deleted the window itself.
*/
- if ((errEventPtr->error_code == BadWindow) &&
- ((Tk_IdToWindow(display, (Window) errEventPtr->resourceid) !=
- NULL) ||
- (TkpWindowWasRecentlyDeleted((Window) errEventPtr->resourceid,
- dispPtr)))) {
- return 0;
+ if (errEventPtr->error_code == BadWindow) {
+ Window w = (Window) errEventPtr->resourceid;
+
+ if (Tk_IdToWindow(display, w) != NULL
+ || TkpWindowWasRecentlyDeleted(w, dispPtr)) {
+ return 0;
+ }
}
/*
- * We couldn't handle the error. Use the default handler.
+ * We couldn't handle the error. Use the default handler.
*/
- couldntHandle:
+ couldntHandle:
return (*defaultHandler)(display, errEventPtr);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 2b4943f..7c41c22 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -1,69 +1,67 @@
-/*
+/*
* tkEvent.c --
*
- * This file provides basic low-level facilities for managing
- * X events in Tk.
+ * This file provides basic low-level facilities for managing X events in
+ * Tk.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 Ajuba Solutions.
+ * Copyright (c) 2004 George Peter Staplin
*
- * 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 "tkPort.h"
#include "tkInt.h"
-#include <signal.h>
/*
- * There's a potential problem if a handler is deleted while it's
- * current (i.e. its procedure is executing), since Tk_HandleEvent
- * will need to read the handler's "nextPtr" field when the procedure
- * returns. To handle this problem, structures of the type below
- * indicate the next handler to be processed for any (recursively
- * nested) dispatches in progress. The nextHandler fields get
- * updated if the handlers pointed to are deleted. Tk_HandleEvent
- * also needs to know if the entire window gets deleted; the winPtr
- * field is set to zero if that particular window gets deleted.
+ * There's a potential problem if a handler is deleted while it's current
+ * (i.e. its function is executing), since Tk_HandleEvent will need to read
+ * the handler's "nextPtr" field when the function returns. To handle this
+ * problem, structures of the type below indicate the next handler to be
+ * processed for any (recursively nested) dispatches in progress. The
+ * nextHandler fields get updated if the handlers pointed to are deleted.
+ * Tk_HandleEvent also needs to know if the entire window gets deleted; the
+ * winPtr field is set to zero if that particular window gets deleted.
*/
typedef struct InProgress {
- XEvent *eventPtr; /* Event currently being handled. */
- TkWindow *winPtr; /* Window for event. Gets set to None if
- * window is deleted while event is being
- * handled. */
- TkEventHandler *nextHandler; /* Next handler in search. */
- struct InProgress *nextPtr; /* Next higher nested search. */
+ XEvent *eventPtr; /* Event currently being handled. */
+ TkWindow *winPtr; /* Window for event. Gets set to None if
+ * window is deleted while event is being
+ * handled. */
+ TkEventHandler *nextHandler;/* Next handler in search. */
+ struct InProgress *nextPtr; /* Next higher nested search. */
} InProgress;
/*
- * For each call to Tk_CreateGenericHandler, an instance of the following
- * structure will be created. All of the active handlers are linked into a
- * list.
+ * For each call to Tk_CreateGenericHandler or Tk_CreateClientMessageHandler,
+ * an instance of the following structure will be created. All of the active
+ * handlers are linked into a list.
*/
typedef struct GenericHandler {
- Tk_GenericProc *proc; /* Procedure to dispatch on all X events. */
- ClientData clientData; /* Client data to pass to procedure. */
- int deleteFlag; /* Flag to set when this handler is deleted. */
+ Tk_GenericProc *proc; /* Function to dispatch on all X events. */
+ ClientData clientData; /* Client data to pass to function. */
+ int deleteFlag; /* Flag to set when this handler is
+ * deleted. */
struct GenericHandler *nextPtr;
/* Next handler in list of all generic
* handlers, or NULL for end of list. */
} GenericHandler;
/*
- * There's a potential problem if Tk_HandleEvent is entered recursively.
- * A handler cannot be deleted physically until we have returned from
- * calling it. Otherwise, we're looking at unallocated memory in advancing to
- * its `next' entry. We deal with the problem by using the `delete flag' and
+ * There's a potential problem if Tk_HandleEvent is entered recursively. A
+ * handler cannot be deleted physically until we have returned from calling
+ * it. Otherwise, we're looking at unallocated memory in advancing to its
+ * `next' entry. We deal with the problem by using the `delete flag' and
* deleting handlers only when it's known that there's no handler active.
- *
*/
/*
- * The following structure is used for queueing X-style events on the
- * Tcl event queue.
+ * The following structure is used for queueing X-style events on the Tcl
+ * event queue.
*/
typedef struct TkWindowEvent {
@@ -75,7 +73,7 @@ typedef struct TkWindowEvent {
* Array of event masks corresponding to each X event:
*/
-static unsigned long eventMasks[TK_LASTEVENT] = {
+static unsigned long realEventMasks[MappingNotify+1] = {
0,
0,
KeyPressMask, /* KeyPress */
@@ -113,106 +111,694 @@ static unsigned long eventMasks[TK_LASTEVENT] = {
0, /* SelectionNotify */
ColormapChangeMask, /* ColormapNotify */
0, /* ClientMessage */
- 0, /* Mapping Notify */
+ 0 /* Mapping Notify */
+};
+
+static unsigned long virtualEventMasks[TK_LASTEVENT-VirtualEvent] = {
VirtualEventMask, /* VirtualEvents */
ActivateMask, /* ActivateNotify */
ActivateMask, /* DeactivateNotify */
MouseWheelMask /* MouseWheelEvent */
};
+/*
+ * For each exit handler created with a call to TkCreateExitHandler or
+ * TkCreateThreadExitHandler there is a structure of the following type:
+ */
+
+typedef struct ExitHandler {
+ Tcl_ExitProc *proc; /* Function to call when process exits. */
+ ClientData clientData; /* One word of information to pass to proc. */
+ struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this
+ * application, or NULL for end of list. */
+} ExitHandler;
/*
- * The structure below is used to store Data for the Event module that
- * must be kept thread-local. The "dataKey" is used to fetch the
- * thread-specific storage for the current thread.
+ * The structure below is used to store Data for the Event module that must be
+ * kept thread-local. The "dataKey" is used to fetch the thread-specific
+ * storage for the current thread.
*/
typedef struct ThreadSpecificData {
- int handlersActive; /* The following variable has a non-zero
- * value when a handler is active. */
- InProgress *pendingPtr; /* Topmost search in progress, or
- * NULL if none. */
+ int handlersActive; /* The following variable has a non-zero value
+ * when a handler is active. */
+ InProgress *pendingPtr; /* Topmost search in progress, or NULL if
+ * none. */
+
+ /*
+ * List of generic handler records.
+ */
+
+ GenericHandler *genericList;/* First handler in the list, or NULL. */
+ GenericHandler *lastGenericPtr;
+ /* Last handler in list. */
- GenericHandler *genericList; /* First handler in the list, or NULL. */
- GenericHandler *lastGenericPtr; /* Last handler in list. */
+ /*
+ * List of client message handler records.
+ */
- GenericHandler *cmList; /* First handler in the list, or NULL. */
+ GenericHandler *cmList; /* First handler in the list, or NULL. */
GenericHandler *lastCmPtr; /* Last handler in list. */
/*
- * If someone has called Tk_RestrictEvents, the information below
- * keeps track of it.
+ * If someone has called Tk_RestrictEvents, the information below keeps
+ * track of it.
*/
Tk_RestrictProc *restrictProc;
- /* Procedure to call. NULL means no
+ /* Function to call. NULL means no
* restrictProc is currently in effect. */
ClientData restrictArg; /* Argument to pass to restrictProc. */
+ ExitHandler *firstExitPtr; /* First in list of all exit handlers for this
+ * thread. */
+ int inExit; /* True when this thread is exiting. This is
+ * used as a hack to decide to close the
+ * standard channels. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Prototypes for procedures that are only referenced locally within
- * this file.
+ * There are both per-process and per-thread exit handlers. The first list is
+ * controlled by a mutex. The other is in thread local storage.
+ */
+
+static ExitHandler *firstExitPtr = NULL;
+ /* First in list of all exit handlers for
+ * application. */
+TCL_DECLARE_MUTEX(exitMutex)
+
+/*
+ * Prototypes for functions that are only referenced locally within this file.
+ */
+
+static void CleanUpTkEvent(XEvent *eventPtr);
+static void DelayedMotionProc(ClientData clientData);
+static int GetButtonMask(unsigned int Button);
+static unsigned long GetEventMaskFromXEvent(XEvent *eventPtr);
+static TkWindow * GetTkWindowFromXEvent(XEvent *eventPtr);
+static void InvokeClientMessageHandlers(ThreadSpecificData *tsdPtr,
+ Tk_Window tkwin, XEvent *eventPtr);
+static int InvokeFocusHandlers(TkWindow **winPtrPtr,
+ unsigned long mask, XEvent *eventPtr);
+static int InvokeGenericHandlers(ThreadSpecificData *tsdPtr,
+ XEvent *eventPtr);
+static int InvokeMouseHandlers(TkWindow *winPtr,
+ unsigned long mask, XEvent *eventPtr);
+static Window ParentXId(Display *display, Window w);
+static int RefreshKeyboardMappingIfNeeded(XEvent *eventPtr);
+static int TkXErrorHandler(ClientData clientData,
+ XErrorEvent *errEventPtr);
+static void UpdateButtonEventState(XEvent *eventPtr);
+static int WindowEventProc(Tcl_Event *evPtr, int flags);
+#ifdef TK_USE_INPUT_METHODS
+static void CreateXIC(TkWindow *winPtr);
+#endif /* TK_USE_INPUT_METHODS */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InvokeFocusHandlers --
+ *
+ * Call focus-related code to look at FocusIn, FocusOut, Enter, and Leave
+ * events; depending on its return value, ignore the event.
+ *
+ * Results:
+ * 0 further processing can be done on the event.
+ * 1 we are done with the event passed.
+ *
+ * Side effects:
+ * The *winPtrPtr in the caller may be changed to the TkWindow for the
+ * window with focus.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InvokeFocusHandlers(
+ TkWindow **winPtrPtr,
+ unsigned long mask,
+ XEvent *eventPtr)
+{
+ if ((mask & (FocusChangeMask|EnterWindowMask|LeaveWindowMask))
+ && (TkFocusFilterEvent(*winPtrPtr, eventPtr) == 0)) {
+ return 1;
+ }
+
+ /*
+ * MouseWheel events are not focus specific on Mac OS X.
+ */
+
+#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) {
+ (*winPtrPtr)->dispPtr->lastEventTime = eventPtr->xkey.time;
+ *winPtrPtr = TkFocusKeyEvent(*winPtrPtr, eventPtr);
+ if (*winPtrPtr == NULL) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InvokeMouseHandlers --
+ *
+ * Call a grab-related function to do special processing on pointer
+ * events.
+ *
+ * Results:
+ * 0 further processing can be done on the event.
+ * 1 we are done with the event passed.
+ *
+ * Side effects:
+ * New events may be queued from TkPointerEvent and grabs may be added
+ * and/or removed. The eventPtr may be changed by TkPointerEvent in some
+ * cases.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InvokeMouseHandlers(
+ TkWindow *winPtr,
+ unsigned long mask,
+ XEvent *eventPtr)
+{
+ if (mask & (ButtonPressMask|ButtonReleaseMask|PointerMotionMask
+ |EnterWindowMask|LeaveWindowMask)) {
+
+ if (mask & (ButtonPressMask|ButtonReleaseMask)) {
+ winPtr->dispPtr->lastEventTime = eventPtr->xbutton.time;
+ } else if (mask & PointerMotionMask) {
+ winPtr->dispPtr->lastEventTime = eventPtr->xmotion.time;
+ } else {
+ winPtr->dispPtr->lastEventTime = eventPtr->xcrossing.time;
+ }
+
+ if (TkPointerEvent(eventPtr, winPtr) == 0) {
+ /*
+ * The event should be ignored to make grab work correctly (as the
+ * comment for TkPointerEvent states).
+ */
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CreateXIC --
+ *
+ * Create the X input context for our winPtr.
+ * XIM is only ever enabled on Unix.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#if defined(TK_USE_INPUT_METHODS)
+static void
+CreateXIC(
+ TkWindow *winPtr)
+{
+ TkDisplay *dispPtr = winPtr->dispPtr;
+ long im_event_mask = 0L;
+ const char *preedit_attname = NULL;
+ XVaNestedList preedit_attlist = NULL;
+
+ if (dispPtr->inputStyle & XIMPreeditPosition) {
+ XPoint spot = {0, 0};
+
+ preedit_attname = XNPreeditAttributes;
+ preedit_attlist = XVaCreateNestedList(0,
+ XNSpotLocation, &spot,
+ XNFontSet, dispPtr->inputXfs,
+ (void *) NULL);
+ }
+
+ winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
+ XNInputStyle, dispPtr->inputStyle,
+ XNClientWindow, winPtr->window,
+ XNFocusWindow, winPtr->window,
+ preedit_attname, preedit_attlist,
+ (void *) NULL);
+
+ if (preedit_attlist) {
+ XFree(preedit_attlist);
+ }
+
+
+ if (winPtr->inputContext == NULL) {
+ /* XCreateIC failed. */
+ return;
+ }
+
+ /*
+ * Adjust the window's event mask if the IM requires it.
+ */
+ XGetICValues(winPtr->inputContext, XNFilterEvents, &im_event_mask, (void *) NULL);
+ if ((winPtr->atts.event_mask & im_event_mask) != im_event_mask) {
+ winPtr->atts.event_mask |= im_event_mask;
+ XSelectInput(winPtr->display, winPtr->window, winPtr->atts.event_mask);
+ }
+}
+#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetTkWindowFromXEvent --
+ *
+ * Attempt to find which TkWindow is associated with an event. If it
+ * fails we attempt to get the TkWindow from the parent for a property
+ * notification.
+ *
+ * Results:
+ * The TkWindow associated with the event or NULL.
+ *
+ * Side effects:
+ * TkSelPropProc may influence selection on windows not known to Tk.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static TkWindow *
+GetTkWindowFromXEvent(
+ XEvent *eventPtr)
+{
+ TkWindow *winPtr;
+ Window parentXId, handlerWindow = eventPtr->xany.window;
+
+ if ((eventPtr->xany.type == StructureNotifyMask)
+ && (eventPtr->xmap.event != eventPtr->xmap.window)) {
+ handlerWindow = eventPtr->xmap.event;
+ }
+
+ winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, handlerWindow);
+
+ if (winPtr == NULL) {
+ /*
+ * There isn't a TkWindow structure for this window. However, if the
+ * event is a PropertyNotify event then call the selection manager (it
+ * deals beneath-the-table with certain properties). Also, if the
+ * window's parent is a Tk window that has the TK_PROP_PROPCHANGE flag
+ * set, then we must propagate the PropertyNotify event up to the
+ * parent.
+ */
+
+ if (eventPtr->type != PropertyNotify) {
+ return NULL;
+ }
+ TkSelPropProc(eventPtr);
+ parentXId = ParentXId(eventPtr->xany.display, handlerWindow);
+ if (parentXId == None) {
+ return NULL;
+ }
+ winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, parentXId);
+ if (winPtr == NULL) {
+ return NULL;
+ }
+ if (!(winPtr->flags & TK_PROP_PROPCHANGE)) {
+ return NULL;
+ }
+ }
+ return winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetEventMaskFromXEvent --
+ *
+ * The event type is looked up in our eventMasks tables, and may be
+ * changed to a different mask depending on the state of the event and
+ * window members.
+ *
+ * Results:
+ * The mask for the event.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static unsigned long
+GetEventMaskFromXEvent(
+ XEvent *eventPtr)
+{
+ unsigned long mask;
+
+ /*
+ * Get the event mask from the correct table. Note that there are two
+ * tables here because that means we no longer need this code to rely on
+ * the exact value of VirtualEvent, which has caused us problems in the
+ * past when X11 changed the value of LASTEvent. [Bug ???]
+ */
+
+ if (eventPtr->xany.type <= MappingNotify) {
+ mask = realEventMasks[eventPtr->xany.type];
+ } else if (eventPtr->xany.type >= VirtualEvent
+ && eventPtr->xany.type<TK_LASTEVENT) {
+ mask = virtualEventMasks[eventPtr->xany.type - VirtualEvent];
+ } else {
+ mask = 0;
+ }
+
+ /*
+ * Events selected by StructureNotify require special handling. They look
+ * the same as those selected by SubstructureNotify. The only difference
+ * is whether the "event" and "window" fields are the same. Compare the
+ * two fields and convert StructureNotify to SubstructureNotify if
+ * necessary.
+ */
+
+ if (mask == StructureNotifyMask) {
+ if (eventPtr->xmap.event != eventPtr->xmap.window) {
+ mask = SubstructureNotifyMask;
+ }
+ }
+ return mask;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RefreshKeyboardMappingIfNeeded --
+ *
+ * If the event is a MappingNotify event, find its display and refresh
+ * the keyboard mapping information for the display.
+ *
+ * Results:
+ * 0 if the event was not a MappingNotify event
+ * 1 if the event was a MappingNotify event
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+RefreshKeyboardMappingIfNeeded(
+ XEvent *eventPtr)
+{
+ TkDisplay *dispPtr;
+
+ if (eventPtr->type == MappingNotify) {
+ dispPtr = TkGetDisplay(eventPtr->xmapping.display);
+ if (dispPtr != NULL) {
+ XRefreshKeyboardMapping(&eventPtr->xmapping);
+ dispPtr->bindInfoStale = 1;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetButtonMask --
+ *
+ * Return the proper Button${n}Mask for the button.
+ *
+ * Results:
+ * A button mask.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetButtonMask(
+ unsigned int button)
+{
+ switch (button) {
+ case 1:
+ return Button1Mask;
+ case 2:
+ return Button2Mask;
+ case 3:
+ return Button3Mask;
+ case 4:
+ return Button4Mask;
+ case 5:
+ return Button5Mask;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * UpdateButtonEventState --
+ *
+ * Update the button event state in our TkDisplay using the XEvent
+ * passed. We also may modify the the XEvent passed to fit some aspects
+ * of our TkDisplay.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The TkDisplay's private button state may be modified. The eventPtr's
+ * state may be updated to reflect masks stored in our TkDisplay that the
+ * event doesn't contain. The eventPtr may also be modified to not
+ * contain a button state for the window in which it was not pressed in.
+ *
+ *----------------------------------------------------------------------
*/
-static void DelayedMotionProc _ANSI_ARGS_((ClientData clientData));
-static int WindowEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
- int flags));
-static int TkXErrorHandler _ANSI_ARGS_((ClientData clientData,
- XErrorEvent *errEventPtr));
+static void
+UpdateButtonEventState(
+ XEvent *eventPtr)
+{
+ TkDisplay *dispPtr;
+ int allButtonsMask = Button1Mask | Button2Mask | Button3Mask
+ | Button4Mask | Button5Mask;
+ switch (eventPtr->type) {
+ case ButtonPress:
+ dispPtr = TkGetDisplay(eventPtr->xbutton.display);
+ dispPtr->mouseButtonWindow = eventPtr->xbutton.window;
+ eventPtr->xbutton.state |= dispPtr->mouseButtonState;
+
+ dispPtr->mouseButtonState |= GetButtonMask(eventPtr->xbutton.button);
+ break;
+
+ case ButtonRelease:
+ dispPtr = TkGetDisplay(eventPtr->xbutton.display);
+ dispPtr->mouseButtonWindow = None;
+ dispPtr->mouseButtonState &= ~GetButtonMask(eventPtr->xbutton.button);
+ eventPtr->xbutton.state |= dispPtr->mouseButtonState;
+ break;
+
+ case MotionNotify:
+ dispPtr = TkGetDisplay(eventPtr->xmotion.display);
+ if (dispPtr->mouseButtonState & allButtonsMask) {
+ if (eventPtr->xbutton.window != dispPtr->mouseButtonWindow) {
+ /*
+ * This motion event should not be interpreted as a button
+ * press + motion event since this is not the same window the
+ * button was pressed down in.
+ */
+
+ dispPtr->mouseButtonState &= ~allButtonsMask;
+ dispPtr->mouseButtonWindow = None;
+ } else {
+ eventPtr->xmotion.state |= dispPtr->mouseButtonState;
+ }
+ }
+ break;
+ }
+}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
+ *
+ * InvokeClientMessageHandlers --
+ *
+ * Iterate the list of handlers and invoke the function pointer for each.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Handlers may be deleted and events may be sent to handlers.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+InvokeClientMessageHandlers(
+ ThreadSpecificData *tsdPtr,
+ Tk_Window tkwin,
+ XEvent *eventPtr)
+{
+ GenericHandler *prevPtr, *tmpPtr, *curPtr = tsdPtr->cmList;
+
+ for (prevPtr = NULL; curPtr != NULL; ) {
+ if (curPtr->deleteFlag) {
+ if (!tsdPtr->handlersActive) {
+ /*
+ * This handler needs to be deleted and there are no calls
+ * pending through any handlers, so now is a safe time to
+ * delete it.
+ */
+
+ tmpPtr = curPtr->nextPtr;
+ if (prevPtr == NULL) {
+ tsdPtr->cmList = tmpPtr;
+ } else {
+ prevPtr->nextPtr = tmpPtr;
+ }
+ if (tmpPtr == NULL) {
+ tsdPtr->lastCmPtr = prevPtr;
+ }
+ (void) ckfree((char *) curPtr);
+ curPtr = tmpPtr;
+ continue;
+ }
+ } else {
+ int done;
+
+ tsdPtr->handlersActive++;
+ done = (*(Tk_ClientMessageProc *)curPtr->proc)(tkwin, eventPtr);
+ tsdPtr->handlersActive--;
+ if (done) {
+ break;
+ }
+ }
+ prevPtr = curPtr;
+ curPtr = curPtr->nextPtr;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InvokeGenericHandlers --
+ *
+ * Iterate the list of handlers and invoke the function pointer for each.
+ * If the handler invoked returns a non-zero value then we are done.
+ *
+ * Results:
+ * 0 when the event wasn't handled by a handler. Non-zero when it was
+ * processed and handled by a handler.
+ *
+ * Side effects:
+ * Handlers may be deleted and events may be sent to handlers.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InvokeGenericHandlers(
+ ThreadSpecificData *tsdPtr,
+ XEvent *eventPtr)
+{
+ GenericHandler *prevPtr, *tmpPtr, *curPtr = tsdPtr->genericList;
+
+ for (prevPtr = NULL; curPtr != NULL; ) {
+ if (curPtr->deleteFlag) {
+ if (!tsdPtr->handlersActive) {
+ /*
+ * This handler needs to be deleted and there are no calls
+ * pending through the handler, so now is a safe time to
+ * delete it.
+ */
+
+ tmpPtr = curPtr->nextPtr;
+ if (prevPtr == NULL) {
+ tsdPtr->genericList = tmpPtr;
+ } else {
+ prevPtr->nextPtr = tmpPtr;
+ }
+ if (tmpPtr == NULL) {
+ tsdPtr->lastGenericPtr = prevPtr;
+ }
+ (void) ckfree((char *) curPtr);
+ curPtr = tmpPtr;
+ continue;
+ }
+ } else {
+ int done;
+
+ tsdPtr->handlersActive++;
+ done = (*curPtr->proc)(curPtr->clientData, eventPtr);
+ tsdPtr->handlersActive--;
+ if (done) {
+ return done;
+ }
+ }
+ prevPtr = curPtr;
+ curPtr = curPtr->nextPtr;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
*
* Tk_CreateEventHandler --
*
- * Arrange for a given procedure to be invoked whenever
- * events from a given class occur in a given window.
+ * Arrange for a given function to be invoked whenever events from a
+ * given class occur in a given window.
*
* Results:
* None.
*
* Side effects:
- * From now on, whenever an event of the type given by
- * mask occurs for token and is processed by Tk_HandleEvent,
- * proc will be called. See the manual entry for details
- * of the calling sequence and return value for proc.
+ * From now on, whenever an event of the type given by mask occurs for
+ * token and is processed by Tk_HandleEvent, proc will be called. See the
+ * manual entry for details of the calling sequence and return value for
+ * proc.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_CreateEventHandler(token, mask, proc, clientData)
- Tk_Window token; /* Token for window in which to
- * create handler. */
- unsigned long mask; /* Events for which proc should
- * be called. */
- Tk_EventProc *proc; /* Procedure to call for each
- * selected event */
- ClientData clientData; /* Arbitrary data to pass to proc. */
+Tk_CreateEventHandler(
+ Tk_Window token, /* Token for window in which to create
+ * handler. */
+ unsigned long mask, /* Events for which proc should be called. */
+ Tk_EventProc *proc, /* Function to call for each selected event */
+ ClientData clientData) /* Arbitrary data to pass to proc. */
{
register TkEventHandler *handlerPtr;
register TkWindow *winPtr = (TkWindow *) token;
- int found;
/*
- * Skim through the list of existing handlers to (a) compute the
- * overall event mask for the window (so we can pass this new
- * value to the X system) and (b) see if there's already a handler
- * declared with the same callback and clientData (if so, just
- * change the mask). If no existing handler matches, then create
- * a new handler.
+ * Skim through the list of existing handlers to (a) compute the overall
+ * event mask for the window (so we can pass this new value to the X
+ * system) and (b) see if there's already a handler declared with the same
+ * callback and clientData (if so, just change the mask). If no existing
+ * handler matches, then create a new handler.
*/
- found = 0;
if (winPtr->handlerList == NULL) {
- handlerPtr = (TkEventHandler *) ckalloc(
- (unsigned) sizeof(TkEventHandler));
+ /*
+ * No event handlers defined at all, so must create.
+ */
+
+ handlerPtr = (TkEventHandler *) ckalloc(sizeof(TkEventHandler));
winPtr->handlerList = handlerPtr;
- goto initHandler;
} else {
+ int found = 0;
+
for (handlerPtr = winPtr->handlerList; ;
handlerPtr = handlerPtr->nextPtr) {
if ((handlerPtr->proc == proc)
@@ -224,31 +810,43 @@ Tk_CreateEventHandler(token, mask, proc, clientData)
break;
}
}
- }
- /*
- * Create a new handler if no matching old handler was found.
- */
+ /*
+ * If we found anything, we're done because we do not need to use
+ * XSelectInput; Tk always selects on all events anyway in order to
+ * support binding on classes, 'all' and other bind-tags.
+ */
+
+ if (found) {
+ return;
+ }
+
+ /*
+ * No event handler matched, so create a new one.
+ */
- if (!found) {
handlerPtr->nextPtr = (TkEventHandler *)
ckalloc(sizeof(TkEventHandler));
handlerPtr = handlerPtr->nextPtr;
- initHandler:
- handlerPtr->mask = mask;
- handlerPtr->proc = proc;
- handlerPtr->clientData = clientData;
- handlerPtr->nextPtr = NULL;
}
/*
- * No need to call XSelectInput: Tk always selects on all events
- * for all windows (needed to support bindings on classes and "all").
+ * Initialize the new event handler.
+ */
+
+ handlerPtr->mask = mask;
+ handlerPtr->proc = proc;
+ handlerPtr->clientData = clientData;
+ handlerPtr->nextPtr = NULL;
+
+ /*
+ * No need to call XSelectInput: Tk always selects on all events for all
+ * windows (needed to support bindings on classes and "all").
*/
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_DeleteEventHandler --
*
@@ -258,30 +856,29 @@ Tk_CreateEventHandler(token, mask, proc, clientData)
* None.
*
* Side effects:
- * If there existed a handler as described by the
- * parameters, the handler is deleted so that proc
- * will not be invoked again.
+ * If there existed a handler as described by the parameters, the handler
+ * is deleted so that proc will not be invoked again.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_DeleteEventHandler(token, mask, proc, clientData)
- Tk_Window token; /* Same as corresponding arguments passed */
- unsigned long mask; /* previously to Tk_CreateEventHandler. */
- Tk_EventProc *proc;
- ClientData clientData;
+Tk_DeleteEventHandler(
+ Tk_Window token, /* Same as corresponding arguments passed */
+ unsigned long mask, /* previously to Tk_CreateEventHandler. */
+ Tk_EventProc *proc,
+ ClientData clientData)
{
register TkEventHandler *handlerPtr;
register InProgress *ipPtr;
TkEventHandler *prevPtr;
register TkWindow *winPtr = (TkWindow *) token;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
- * Find the event handler to be deleted, or return
- * immediately if it doesn't exist.
+ * Find the event handler to be deleted, or return immediately if it
+ * doesn't exist.
*/
for (handlerPtr = winPtr->handlerList, prevPtr = NULL; ;
@@ -296,8 +893,8 @@ Tk_DeleteEventHandler(token, mask, proc, clientData)
}
/*
- * If Tk_HandleEvent is about to process this handler, tell it to
- * process the next one instead.
+ * If Tk_HandleEvent is about to process this handler, tell it to process
+ * the next one instead.
*/
for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
@@ -317,43 +914,42 @@ Tk_DeleteEventHandler(token, mask, proc, clientData)
}
ckfree((char *) handlerPtr);
-
/*
- * No need to call XSelectInput: Tk always selects on all events
- * for all windows (needed to support bindings on classes and "all").
+ * No need to call XSelectInput: Tk always selects on all events for all
+ * windows (needed to support bindings on classes and "all").
*/
}
-/*--------------------------------------------------------------
+/*----------------------------------------------------------------------
*
* Tk_CreateGenericHandler --
*
- * Register a procedure to be called on each X event, regardless
- * of display or window. Generic handlers are useful for capturing
- * events that aren't associated with windows, or events for windows
- * not managed by Tk.
+ * Register a function to be called on each X event, regardless of
+ * display or window. Generic handlers are useful for capturing events
+ * that aren't associated with windows, or events for windows not managed
+ * by Tk.
*
* Results:
* None.
*
* Side Effects:
- * From now on, whenever an X event is given to Tk_HandleEvent,
- * invoke proc, giving it clientData and the event as arguments.
+ * From now on, whenever an X event is given to Tk_HandleEvent, invoke
+ * proc, giving it clientData and the event as arguments.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_CreateGenericHandler(proc, clientData)
- Tk_GenericProc *proc; /* Procedure to call on every event. */
- ClientData clientData; /* One-word value to pass to proc. */
+Tk_CreateGenericHandler(
+ Tk_GenericProc *proc, /* Function to call on every event. */
+ ClientData clientData) /* One-word value to pass to proc. */
{
GenericHandler *handlerPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- handlerPtr = (GenericHandler *) ckalloc (sizeof (GenericHandler));
-
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler));
+
handlerPtr->proc = proc;
handlerPtr->clientData = clientData;
handlerPtr->deleteFlag = 0;
@@ -367,7 +963,7 @@ Tk_CreateGenericHandler(proc, clientData)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_DeleteGenericHandler --
*
@@ -377,77 +973,76 @@ Tk_CreateGenericHandler(proc, clientData)
* None.
*
* Side Effects:
- * If there existed a handler as described by the parameters,
- * that handler is logically deleted so that proc will not be
- * invoked again. The physical deletion happens in the event
- * loop in Tk_HandleEvent.
+ * If there existed a handler as described by the parameters, that
+ * handler is logically deleted so that proc will not be invoked again.
+ * The physical deletion happens in the event loop in Tk_HandleEvent.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_DeleteGenericHandler(proc, clientData)
- Tk_GenericProc *proc;
- ClientData clientData;
+Tk_DeleteGenericHandler(
+ Tk_GenericProc *proc,
+ ClientData clientData)
{
GenericHandler * handler;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- for (handler = tsdPtr->genericList; handler; handler = handler->nextPtr) {
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ for (handler=tsdPtr->genericList ; handler ; handler=handler->nextPtr) {
if ((handler->proc == proc) && (handler->clientData == clientData)) {
handler->deleteFlag = 1;
}
}
}
-/*--------------------------------------------------------------
+/*----------------------------------------------------------------------
*
* Tk_CreateClientMessageHandler --
*
- * Register a procedure to be called on each ClientMessage event.
+ * Register a function to be called on each ClientMessage event.
* ClientMessage handlers are useful for Drag&Drop extensions.
*
* Results:
* None.
*
* Side Effects:
- * From now on, whenever a ClientMessage event is received that isn't
- * a WM_PROTOCOL event or SelectionEvent, invoke proc, giving it
- * tkwin and the event as arguments.
+ * From now on, whenever a ClientMessage event is received that isn't a
+ * WM_PROTOCOL event or SelectionEvent, invoke proc, giving it tkwin and
+ * the event as arguments.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_CreateClientMessageHandler(proc)
- Tk_ClientMessageProc *proc; /* Procedure to call on event. */
+Tk_CreateClientMessageHandler(
+ Tk_ClientMessageProc *proc) /* Function to call on event. */
{
GenericHandler *handlerPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
- * We use a GenericHandler struct, because it's basically the same,
- * except with an extra clientData field we'll never use.
+ * We use a GenericHandler struct, because it's basically the same, except
+ * with an extra clientData field we'll never use.
*/
- handlerPtr = (GenericHandler *)
- ckalloc (sizeof (GenericHandler));
- handlerPtr->proc = (Tk_GenericProc *) proc;
- handlerPtr->clientData = NULL; /* never used */
- handlerPtr->deleteFlag = 0;
- handlerPtr->nextPtr = NULL;
+ handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler));
+
+ handlerPtr->proc = (Tk_GenericProc *) proc;
+ handlerPtr->clientData = NULL; /* never used */
+ handlerPtr->deleteFlag = 0;
+ handlerPtr->nextPtr = NULL;
if (tsdPtr->cmList == NULL) {
- tsdPtr->cmList = handlerPtr;
+ tsdPtr->cmList = handlerPtr;
} else {
tsdPtr->lastCmPtr->nextPtr = handlerPtr;
}
- tsdPtr->lastCmPtr = handlerPtr;
+ tsdPtr->lastCmPtr = handlerPtr;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_DeleteClientMessageHandler --
*
@@ -457,24 +1052,23 @@ Tk_CreateClientMessageHandler(proc)
* None.
*
* Side Effects:
- * If there existed a handler as described by the parameters,
- * that handler is logically deleted so that proc will not be
- * invoked again. The physical deletion happens in the event
- * loop in TkClientMessageEventProc.
+ * If there existed a handler as described by the parameters, that
+ * handler is logically deleted so that proc will not be invoked again.
+ * The physical deletion happens in the event loop in
+ * TkClientMessageEventProc.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_DeleteClientMessageHandler(proc)
- Tk_ClientMessageProc *proc;
+Tk_DeleteClientMessageHandler(
+ Tk_ClientMessageProc *proc)
{
GenericHandler * handler;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- for (handler = tsdPtr->cmList; handler != NULL;
- handler = handler->nextPtr) {
+ for (handler=tsdPtr->cmList ; handler!=NULL ; handler=handler->nextPtr) {
if (handler->proc == (Tk_GenericProc *) proc) {
handler->deleteFlag = 1;
}
@@ -482,14 +1076,13 @@ Tk_DeleteClientMessageHandler(proc)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TkEventInit --
*
- * This procedures initializes all the event module
- * structures used by the current thread. It must be
- * called before any other procedure in this file is
- * called.
+ * This functions initializes all the event module structures used by the
+ * current thread. It must be called before any other function in this
+ * file is called.
*
* Results:
* None.
@@ -497,14 +1090,14 @@ Tk_DeleteClientMessageHandler(proc)
* Side Effects:
* None.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-TkEventInit _ANSI_ARGS_((void))
+TkEventInit(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->handlersActive = 0;
tsdPtr->pendingPtr = NULL;
@@ -517,28 +1110,26 @@ TkEventInit _ANSI_ARGS_((void))
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TkXErrorHandler --
*
- * TkXErrorHandler is an error handler, to be installed
- * via Tk_CreateErrorHandler, that will set a flag if an
- * X error occurred.
+ * TkXErrorHandler is an error handler, to be installed via
+ * Tk_CreateErrorHandler, that will set a flag if an X error occurred.
*
* Results:
- * Always returns 0, indicating that the X error was
- * handled.
+ * Always returns 0, indicating that the X error was handled.
*
* Side effects:
* None.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static int
-TkXErrorHandler (clientData, errEventPtr)
- ClientData clientData; /* Pointer to flag we set */
- XErrorEvent *errEventPtr; /* X error info */
+TkXErrorHandler(
+ ClientData clientData, /* Pointer to flag we set. */
+ XErrorEvent *errEventPtr) /* X error info. */
{
int *error;
@@ -548,12 +1139,12 @@ TkXErrorHandler (clientData, errEventPtr)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* ParentXId --
*
- * Returns the parent of the given window, or "None"
- * if the window doesn't exist.
+ * Returns the parent of the given window, or "None" if the window
+ * doesn't exist.
*
* Results:
* Returns an X window ID.
@@ -561,13 +1152,13 @@ TkXErrorHandler (clientData, errEventPtr)
* Side effects:
* None.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static Window
-ParentXId(display, w)
- Display *display;
- Window w;
+ParentXId(
+ Display *display,
+ Window w)
{
Tk_ErrorHandler handler;
int gotXError;
@@ -577,17 +1168,23 @@ ParentXId(display, w)
Window *childList;
unsigned int nChildren;
- /* Handle errors ourselves. */
+ /*
+ * Handle errors ourselves.
+ */
gotXError = 0;
handler = Tk_CreateErrorHandler(display, -1, -1, -1,
- TkXErrorHandler, (ClientData) (&gotXError));
+ TkXErrorHandler, (ClientData) (&gotXError));
- /* Get the parent window. */
+ /*
+ * Get the parent window.
+ */
status = XQueryTree(display, w, &root, &parent, &childList, &nChildren);
- /* Do some cleanup; gotta return "None" if we got an error. */
+ /*
+ * Do some cleanup; gotta return "None" if we got an error.
+ */
Tk_DeleteErrorHandler(handler);
XSync(display, False);
@@ -595,19 +1192,19 @@ ParentXId(display, w)
XFree(childList);
}
if (status == 0) {
- parent = None;
+ parent = None;
}
return parent;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_HandleEvent --
*
- * Given an event, invoke all the handlers that have
- * been registered for the event.
+ * Given an event, invoke all the handlers that have been registered for
+ * the event.
*
* Results:
* None.
@@ -615,348 +1212,106 @@ ParentXId(display, w)
* Side effects:
* Depends on the handlers.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_HandleEvent(eventPtr)
- XEvent *eventPtr; /* Event to dispatch. */
+Tk_HandleEvent(
+ XEvent *eventPtr) /* Event to dispatch. */
{
register TkEventHandler *handlerPtr;
- register GenericHandler *genericPtr;
- register GenericHandler *genPrevPtr;
TkWindow *winPtr;
unsigned long mask;
InProgress ip;
- Window handlerWindow;
- Window parentXId;
- TkDisplay *dispPtr;
- Tcl_Interp *interp = (Tcl_Interp *) NULL;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
- /*
- * Hack for simulated X-events: Correct the state field
- * of the event record to match with the ButtonPress
- * and ButtonRelease events.
- */
-
- if (eventPtr->type==ButtonPress) {
- dispPtr = TkGetDisplay(eventPtr->xbutton.display);
- dispPtr->mouseButtonWindow = eventPtr->xbutton.window;
- eventPtr->xbutton.state |= dispPtr->mouseButtonState;
- switch (eventPtr->xbutton.button) {
- case 1: dispPtr->mouseButtonState |= Button1Mask; break;
- case 2: dispPtr->mouseButtonState |= Button2Mask; break;
- case 3: dispPtr->mouseButtonState |= Button3Mask; break;
- }
- } else if (eventPtr->type==ButtonRelease) {
- dispPtr = TkGetDisplay(eventPtr->xbutton.display);
- dispPtr->mouseButtonWindow = 0;
- switch (eventPtr->xbutton.button) {
- case 1: dispPtr->mouseButtonState &= ~Button1Mask; break;
- case 2: dispPtr->mouseButtonState &= ~Button2Mask; break;
- case 3: dispPtr->mouseButtonState &= ~Button3Mask; break;
- }
- eventPtr->xbutton.state |= dispPtr->mouseButtonState;
- } else if (eventPtr->type==MotionNotify) {
- dispPtr = TkGetDisplay(eventPtr->xmotion.display);
- if (dispPtr->mouseButtonState & (Button1Mask|Button2Mask|Button3Mask)) {
- if (eventPtr->xbutton.window != dispPtr->mouseButtonWindow) {
- /*
- * This motion event should not be interpreted as a button
- * press + motion event since this is not the same window
- * the button was pressed down in.
- */
- dispPtr->mouseButtonState &=
- ~(Button1Mask|Button2Mask|Button3Mask);
- dispPtr->mouseButtonWindow = 0;
- } else {
- eventPtr->xmotion.state |= dispPtr->mouseButtonState;
- }
- }
- }
-
- /*
- * Next, invoke all the generic event handlers (those that are
- * invoked for all events). If a generic event handler reports that
- * an event is fully processed, go no further.
- */
+ Tcl_Interp *interp = NULL;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- for (genPrevPtr = NULL, genericPtr = tsdPtr->genericList;
- genericPtr != NULL; ) {
- if (genericPtr->deleteFlag) {
- if (!tsdPtr->handlersActive) {
- GenericHandler *tmpPtr;
-
- /*
- * This handler needs to be deleted and there are no
- * calls pending through the handler, so now is a safe
- * time to delete it.
- */
-
- tmpPtr = genericPtr->nextPtr;
- if (genPrevPtr == NULL) {
- tsdPtr->genericList = tmpPtr;
- } else {
- genPrevPtr->nextPtr = tmpPtr;
- }
- if (tmpPtr == NULL) {
- tsdPtr->lastGenericPtr = genPrevPtr;
- }
- (void) ckfree((char *) genericPtr);
- genericPtr = tmpPtr;
- continue;
- }
- } else {
- int done;
-
- tsdPtr->handlersActive++;
- done = (*genericPtr->proc)(genericPtr->clientData, eventPtr);
- tsdPtr->handlersActive--;
- if (done) {
- return;
- }
- }
- genPrevPtr = genericPtr;
- genericPtr = genPrevPtr->nextPtr;
- }
+ UpdateButtonEventState(eventPtr);
/*
- * If the event is a MappingNotify event, find its display and
- * refresh the keyboard mapping information for the display.
- * After that there's nothing else to do with the event, so just
- * quit.
+ * If the generic handler processed this event we are done and can return.
*/
- if (eventPtr->type == MappingNotify) {
- dispPtr = TkGetDisplay(eventPtr->xmapping.display);
- if (dispPtr != NULL) {
- XRefreshKeyboardMapping(&eventPtr->xmapping);
- dispPtr->bindInfoStale = 1;
- }
- return;
+ if (InvokeGenericHandlers(tsdPtr, eventPtr)) {
+ goto releaseEventResources;
}
- /*
- * Events selected by StructureNotify require special handling.
- * They look the same as those selected by SubstructureNotify.
- * The only difference is whether the "event" and "window" fields
- * are the same. Compare the two fields and convert StructureNotify
- * to SubstructureNotify if necessary.
- */
-
- handlerWindow = eventPtr->xany.window;
- mask = eventMasks[eventPtr->xany.type];
- if (mask == StructureNotifyMask) {
- if (eventPtr->xmap.event != eventPtr->xmap.window) {
- mask = SubstructureNotifyMask;
- handlerWindow = eventPtr->xmap.event;
- }
- }
- winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, handlerWindow);
- if (winPtr == NULL) {
+ if (RefreshKeyboardMappingIfNeeded(eventPtr)) {
/*
- * There isn't a TkWindow structure for this window.
- * However, if the event is a PropertyNotify event then call
- * the selection manager (it deals beneath-the-table with
- * certain properties). Also, if the window's parent is a
- * Tk window that has the TK_PROP_PROPCHANGE flag set, then
- * we must propagate the PropertyNotify event up to the parent.
+ * We are done with a MappingNotify event.
*/
- if (eventPtr->type != PropertyNotify) {
- return;
- }
-
- TkSelPropProc(eventPtr);
-
- /* Get handlerWindow's parent. */
-
- parentXId = ParentXId(eventPtr->xany.display, handlerWindow);
- if (parentXId == None) {
- return;
- }
-
- winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, parentXId);
- if (winPtr == NULL) {
- return;
- }
+ goto releaseEventResources;
+ }
- if (!(winPtr->flags & TK_PROP_PROPCHANGE)) {
- return;
- }
+ mask = GetEventMaskFromXEvent(eventPtr);
+ winPtr = GetTkWindowFromXEvent(eventPtr);
- handlerWindow = parentXId;
+ if (winPtr == NULL) {
+ goto releaseEventResources;
}
/*
* Once a window has started getting deleted, don't process any more
- * events for it except for the DestroyNotify event. This check is
- * needed because a DestroyNotify handler could re-invoke the event
- * loop, causing other pending events to be handled for the window
- * (the window doesn't get totally expunged from our tables until
- * after the DestroyNotify event has been completely handled).
+ * events for it except for the DestroyNotify event. This check is needed
+ * because a DestroyNotify handler could re-invoke the event loop, causing
+ * other pending events to be handled for the window (the window doesn't
+ * get totally expunged from our tables until after the DestroyNotify
+ * event has been completely handled).
*/
if ((winPtr->flags & TK_ALREADY_DEAD)
&& (eventPtr->type != DestroyNotify)) {
- return;
+ goto releaseEventResources;
}
if (winPtr->mainPtr != NULL) {
+ int result;
+
+ interp = winPtr->mainPtr->interp;
- /*
- * Protect interpreter for this window from possible deletion
- * while we are dealing with the event for this window. Thus,
- * widget writers do not have to worry about protecting the
- * interpreter in their own code.
- */
-
- interp = winPtr->mainPtr->interp;
- Tcl_Preserve((ClientData) interp);
-
- /*
- * Call focus-related code to look at FocusIn, FocusOut, Enter,
- * and Leave events; depending on its return value, ignore the
- * event.
- */
-
- if ((mask & (FocusChangeMask|EnterWindowMask|LeaveWindowMask))
- && !TkFocusFilterEvent(winPtr, eventPtr)) {
- Tcl_Release((ClientData) interp);
- return;
- }
-
- /*
- * Redirect KeyPress and KeyRelease events to the focus window,
- * or ignore them entirely if there is no focus window. We also
- * route the MouseWheel event to the focus window. The MouseWheel
- * event is an extension to the X event set. Currently, it is only
- * available on the Windows version of Tk.
- */
-
-#ifdef MAC_OSX_TK
- /* MouseWheel events are not focus specific on Mac OS X */
- if (mask & (KeyPressMask|KeyReleaseMask)) {
-#else
- if (mask & (KeyPressMask|KeyReleaseMask|MouseWheelMask)) {
-#endif
- winPtr->dispPtr->lastEventTime = eventPtr->xkey.time;
- winPtr = TkFocusKeyEvent(winPtr, eventPtr);
- if (winPtr == NULL) {
- Tcl_Release((ClientData) interp);
- return;
- }
- }
-
/*
- * Call a grab-related procedure to do special processing on
- * pointer events.
+ * Protect interpreter for this window from possible deletion while we
+ * are dealing with the event for this window. Thus, widget writers do
+ * not have to worry about protecting the interpreter in their own
+ * code.
*/
-
- if (mask & (ButtonPressMask|ButtonReleaseMask|PointerMotionMask
- |EnterWindowMask|LeaveWindowMask)) {
- if (mask & (ButtonPressMask|ButtonReleaseMask)) {
- winPtr->dispPtr->lastEventTime = eventPtr->xbutton.time;
- } else if (mask & PointerMotionMask) {
- winPtr->dispPtr->lastEventTime = eventPtr->xmotion.time;
- } else {
- winPtr->dispPtr->lastEventTime = eventPtr->xcrossing.time;
- }
- if (TkPointerEvent(eventPtr, winPtr) == 0) {
- goto done;
- }
+
+ Tcl_Preserve((ClientData) interp);
+
+ result = ((InvokeFocusHandlers(&winPtr, mask, eventPtr))
+ || (InvokeMouseHandlers(winPtr, mask, eventPtr)));
+
+ if (result) {
+ goto releaseInterpreter;
}
}
-#ifdef TK_USE_INPUT_METHODS
/*
- * Pass the event to the input method(s), if there are any, and
- * discard the event if the input method(s) insist. Create the
- * input context for the window if it hasn't already been done
- * (XFilterEvent needs this context). XIM is only ever enabled on
- * Unix, but this hasn't been factored out of the generic code yet.
+ * Create the input context for the window if it hasn't already been done
+ * (XFilterEvent needs this context). When the event is a FocusIn event,
+ * set the input context focus to the receiving window. This code is only
+ * ever active for X11.
*/
- dispPtr = winPtr->dispPtr;
- if ((dispPtr->flags & TK_DISPLAY_USE_IM)) {
- long im_event_mask = 0L;
+
+#ifdef TK_USE_INPUT_METHODS
+ if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)) {
if (!(winPtr->flags & (TK_CHECKED_IC|TK_ALREADY_DEAD))) {
winPtr->flags |= TK_CHECKED_IC;
- if (dispPtr->inputMethod != NULL) {
-#if TK_XIM_SPOT
- if (dispPtr->flags & TK_DISPLAY_XIM_SPOT) {
- XVaNestedList preedit_attr;
- XPoint spot = {0, 0};
-
- if (dispPtr->inputXfs == NULL) {
- /*
- * We only need to create one XFontSet
- */
- char **missing_list;
- int missing_count;
- char *def_string;
-
- dispPtr->inputXfs = XCreateFontSet(dispPtr->display,
- "-*-*-*-R-Normal--14-130-75-75-*-*",
- &missing_list, &missing_count, &def_string);
- if (missing_count > 0) {
- XFreeStringList(missing_list);
- }
- }
-
- preedit_attr = XVaCreateNestedList(0, XNSpotLocation,
- &spot, XNFontSet, dispPtr->inputXfs, NULL);
- if (winPtr->inputContext != NULL)
- panic("inputContext not NULL");
- winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
- XNInputStyle, XIMPreeditPosition|XIMStatusNothing,
- XNClientWindow, winPtr->window,
- XNFocusWindow, winPtr->window,
- XNPreeditAttributes, preedit_attr,
- NULL);
- XFree(preedit_attr);
- } else {
- if (winPtr->inputContext != NULL)
- panic("inputContext not NULL");
- winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
- XNInputStyle, XIMPreeditNothing|XIMStatusNothing,
- XNClientWindow, winPtr->window,
- XNFocusWindow, winPtr->window,
- NULL);
- }
-#else
- if (winPtr->inputContext != NULL)
- panic("inputContext not NULL");
- winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
- XNInputStyle, XIMPreeditNothing|XIMStatusNothing,
- XNClientWindow, winPtr->window,
- XNFocusWindow, winPtr->window,
- NULL);
-#endif
- }
- }
- if (winPtr->inputContext != NULL &&
- (eventPtr->xany.type == FocusIn)) {
- XGetICValues(winPtr->inputContext,
- XNFilterEvents, &im_event_mask, NULL);
- if (im_event_mask != 0L) {
- XSelectInput(winPtr->display, winPtr->window,
- winPtr->atts.event_mask | im_event_mask);
- XSetICFocus(winPtr->inputContext);
+ if (winPtr->dispPtr->inputMethod != NULL) {
+ CreateXIC(winPtr);
}
}
- if (eventPtr->type == KeyPress || eventPtr->type == KeyRelease) {
- if (XFilterEvent(eventPtr, None)) {
- goto done;
- }
+ if (eventPtr->type == FocusIn && winPtr->inputContext != NULL) {
+ XSetICFocus(winPtr->inputContext);
}
}
-#endif /* TK_USE_INPUT_METHODS */
+#endif
/*
- * For events where it hasn't already been done, update the current
- * time in the display.
+ * For events where it hasn't already been done, update the current time
+ * in the display.
*/
if (eventPtr->type == PropertyNotify) {
@@ -964,8 +1319,8 @@ Tk_HandleEvent(eventPtr)
}
/*
- * There's a potential interaction here with Tk_DeleteEventHandler.
- * Read the documentation for pendingPtr.
+ * There's a potential interaction here with Tk_DeleteEventHandler. Read
+ * the documentation for pendingPtr.
*/
ip.eventPtr = eventPtr;
@@ -983,49 +1338,8 @@ Tk_HandleEvent(eventPtr)
Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS")) {
TkWmProtocolEventProc(winPtr, eventPtr);
} else {
- /*
- * Finally, invoke any ClientMessage event handlers.
- */
-
- for (genPrevPtr = NULL, genericPtr = tsdPtr->cmList;
- genericPtr != NULL; ) {
- if (genericPtr->deleteFlag) {
- if (!tsdPtr->handlersActive) {
- GenericHandler *tmpPtr;
-
- /*
- * This handler needs to be deleted and there are
- * no calls pending through any handlers, so now
- * is a safe time to delete it.
- */
-
- tmpPtr = genericPtr->nextPtr;
- if (genPrevPtr == NULL) {
- tsdPtr->cmList = tmpPtr;
- } else {
- genPrevPtr->nextPtr = tmpPtr;
- }
- if (tmpPtr == NULL) {
- tsdPtr->lastCmPtr = genPrevPtr;
- }
- (void) ckfree((char *) genericPtr);
- genericPtr = tmpPtr;
- continue;
- }
- } else {
- int done;
-
- tsdPtr->handlersActive++;
- done = (*(Tk_ClientMessageProc *)genericPtr->proc)
- ((Tk_Window) winPtr, eventPtr);
- tsdPtr->handlersActive--;
- if (done) {
- break;
- }
- }
- genPrevPtr = genericPtr;
- genericPtr = genPrevPtr->nextPtr;
- }
+ InvokeClientMessageHandlers(tsdPtr, (Tk_Window)winPtr,
+ eventPtr);
}
}
} else {
@@ -1040,44 +1354,53 @@ Tk_HandleEvent(eventPtr)
}
/*
- * Pass the event to the "bind" command mechanism. But, don't
- * do this for SubstructureNotify events. The "bind" command
- * doesn't support them anyway, and it's easier to filter out
- * these events here than in the lower-level procedures.
+ * Pass the event to the "bind" command mechanism. But, don't do this
+ * for SubstructureNotify events. The "bind" command doesn't support
+ * them anyway, and it's easier to filter out these events here than
+ * in the lower-level functions.
*/
/*
- * ...well, except when we use the tkwm patches, in which case
- * we DO handle CreateNotify events, so we gotta pass 'em through.
+ * ...well, except when we use the tkwm patches, in which case we DO
+ * handle CreateNotify events, so we gotta pass 'em through.
*/
if ((ip.winPtr != None)
&& ((mask != SubstructureNotifyMask)
- || (eventPtr->type == CreateNotify))) {
+ || (eventPtr->type == CreateNotify))) {
TkBindEventProc(winPtr, eventPtr);
}
}
tsdPtr->pendingPtr = ip.nextPtr;
-done:
/*
* Release the interpreter for this window so that it can be potentially
* deleted if requested.
*/
-
- if (interp != (Tcl_Interp *) NULL) {
- Tcl_Release((ClientData) interp);
+
+ releaseInterpreter:
+ if (interp != NULL) {
+ Tcl_Release((ClientData) interp);
}
+
+ /*
+ * Release the user_data from the event (if it is a virtual event and the
+ * field was non-NULL in the first place.) Note that this is done using a
+ * Tcl_Obj interface, and we set the field back to NULL afterwards out of
+ * paranoia. Also clean up any cached %A substitutions from key events.
+ */
+
+ releaseEventResources:
+ CleanUpTkEvent(eventPtr);
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TkEventDeadWindow --
*
- * This procedure is invoked when it is determined that
- * a window is dead. It cleans up event-related information
- * about the window.
+ * This function is invoked when it is determined that a window is dead.
+ * It cleans up event-related information about the window.
*
* Results:
* None.
@@ -1085,31 +1408,30 @@ done:
* Side effects:
* Various things get cleaned up and recycled.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-TkEventDeadWindow(winPtr)
- TkWindow *winPtr; /* Information about the window
- * that is being deleted. */
+TkEventDeadWindow(
+ TkWindow *winPtr) /* Information about the window that is being
+ * deleted. */
{
register TkEventHandler *handlerPtr;
register InProgress *ipPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
- * While deleting all the handlers, be careful to check for
- * Tk_HandleEvent being about to process one of the deleted
- * handlers. If it is, tell it to quit (all of the handlers
- * are being deleted).
+ * While deleting all the handlers, be careful to check for Tk_HandleEvent
+ * being about to process one of the deleted handlers. If it is, tell it
+ * to quit (all of the handlers are being deleted).
*/
while (winPtr->handlerList != NULL) {
handlerPtr = winPtr->handlerList;
winPtr->handlerList = handlerPtr->nextPtr;
- for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL;
- ipPtr = ipPtr->nextPtr) {
+ for (ipPtr = tsdPtr->pendingPtr; ipPtr != NULL;
+ ipPtr = ipPtr->nextPtr) {
if (ipPtr->nextHandler == handlerPtr) {
ipPtr->nextHandler = NULL;
}
@@ -1126,15 +1448,13 @@ TkEventDeadWindow(winPtr)
*
* TkCurrentTime --
*
- * Try to deduce the current time. "Current time" means the time
- * of the event that led to the current code being executed, which
- * means the time in the most recently-nested invocation of
- * Tk_HandleEvent.
+ * Try to deduce the current time. "Current time" means the time of the
+ * event that led to the current code being executed, which means the
+ * time in the most recently-nested invocation of Tk_HandleEvent.
*
* Results:
- * The return value is the time from the current event, or
- * CurrentTime if there is no current event or if the current
- * event contains no time.
+ * The return value is the time from the current event, or CurrentTime if
+ * there is no current event or if the current event contains no time.
*
* Side effects:
* None.
@@ -1143,31 +1463,31 @@ TkEventDeadWindow(winPtr)
*/
Time
-TkCurrentTime(dispPtr)
- TkDisplay *dispPtr; /* Display for which the time is desired. */
+TkCurrentTime(
+ TkDisplay *dispPtr) /* Display for which the time is desired. */
{
register XEvent *eventPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->pendingPtr == NULL) {
return dispPtr->lastEventTime;
}
eventPtr = tsdPtr->pendingPtr->eventPtr;
switch (eventPtr->type) {
- case ButtonPress:
- case ButtonRelease:
- return eventPtr->xbutton.time;
- case KeyPress:
- case KeyRelease:
- return eventPtr->xkey.time;
- case MotionNotify:
- return eventPtr->xmotion.time;
- case EnterNotify:
- case LeaveNotify:
- return eventPtr->xcrossing.time;
- case PropertyNotify:
- return eventPtr->xproperty.time;
+ case ButtonPress:
+ case ButtonRelease:
+ return eventPtr->xbutton.time;
+ case KeyPress:
+ case KeyRelease:
+ return eventPtr->xkey.time;
+ case MotionNotify:
+ return eventPtr->xmotion.time;
+ case EnterNotify:
+ case LeaveNotify:
+ return eventPtr->xcrossing.time;
+ case PropertyNotify:
+ return eventPtr->xproperty.time;
}
return dispPtr->lastEventTime;
}
@@ -1177,15 +1497,14 @@ TkCurrentTime(dispPtr)
*
* Tk_RestrictEvents --
*
- * This procedure is used to globally restrict the set of events
- * that will be dispatched. The restriction is done by filtering
- * all incoming X events through a procedure that determines
- * whether they are to be processed immediately, deferred, or
- * discarded.
+ * This function is used to globally restrict the set of events that will
+ * be dispatched. The restriction is done by filtering all incoming X
+ * events through a function that determines whether they are to be
+ * processed immediately, deferred, or discarded.
*
* Results:
- * The return value is the previous restriction procedure in effect,
- * if there was one, or NULL if there wasn't.
+ * The return value is the previous restriction function in effect, if
+ * there was one, or NULL if there wasn't.
*
* Side effects:
* From now on, proc will be called to determine whether to process,
@@ -1195,16 +1514,15 @@ TkCurrentTime(dispPtr)
*/
Tk_RestrictProc *
-Tk_RestrictEvents(proc, arg, prevArgPtr)
- Tk_RestrictProc *proc; /* Procedure to call for each incoming
- * event. */
- ClientData arg; /* Arbitrary argument to pass to proc. */
- ClientData *prevArgPtr; /* Place to store information about previous
+Tk_RestrictEvents(
+ Tk_RestrictProc *proc, /* Function to call for each incoming event */
+ ClientData arg, /* Arbitrary argument to pass to proc. */
+ ClientData *prevArgPtr) /* Place to store information about previous
* argument. */
{
Tk_RestrictProc *prev;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
prev = tsdPtr->restrictProc;
*prevArgPtr = tsdPtr->restrictArg;
@@ -1218,7 +1536,7 @@ Tk_RestrictEvents(proc, arg, prevArgPtr)
*
* Tk_CollapseMotionEvents --
*
- * This procedure controls whether we collapse motion events in a
+ * This function controls whether we collapse motion events in a
* particular display or not.
*
* Results:
@@ -1231,10 +1549,10 @@ Tk_RestrictEvents(proc, arg, prevArgPtr)
*/
int
-Tk_CollapseMotionEvents(display, collapse)
- Display *display; /* Display handling these events. */
- int collapse; /* boolean value that specifies whether
- * motion events should be collapsed. */
+Tk_CollapseMotionEvents(
+ Display *display, /* Display handling these events. */
+ int collapse) /* Boolean value that specifies whether motion
+ * events should be collapsed. */
{
TkDisplay *dispPtr = (TkDisplay *) display;
int prev = (dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS);
@@ -1252,28 +1570,26 @@ Tk_CollapseMotionEvents(display, collapse)
*
* Tk_QueueWindowEvent --
*
- * Given an X-style window event, this procedure adds it to the
- * Tcl event queue at the given position. This procedure also
- * performs mouse motion event collapsing if possible.
+ * Given an X-style window event, this function adds it to the Tcl event
+ * queue at the given position. This function also performs mouse motion
+ * event collapsing if possible.
*
* Results:
* None.
*
* Side effects:
- * Adds stuff to the event queue, which will eventually be
- * processed.
+ * Adds stuff to the event queue, which will eventually be processed.
*
*----------------------------------------------------------------------
*/
void
-Tk_QueueWindowEvent(eventPtr, position)
- XEvent *eventPtr; /* Event to add to queue. This
- * procedures copies it before adding
- * it to the queue. */
- Tcl_QueuePosition position; /* Where to put it on the queue:
- * TCL_QUEUE_TAIL, TCL_QUEUE_HEAD,
- * or TCL_QUEUE_MARK. */
+Tk_QueueWindowEvent(
+ XEvent *eventPtr, /* Event to add to queue. This function copies
+ * it before adding it to the queue. */
+ Tcl_QueuePosition position) /* Where to put it on the queue:
+ * TCL_QUEUE_TAIL, TCL_QUEUE_HEAD, or
+ * TCL_QUEUE_MARK. */
{
TkWindowEvent *wevPtr;
TkDisplay *dispPtr;
@@ -1292,10 +1608,11 @@ Tk_QueueWindowEvent(eventPtr, position)
}
/*
- * Don't filter motion events if the user
- * defaulting to true (1), which could be set to false (0) when the
- * user wishes to receive all the motion data)
+ * Don't filter motion events if the user defaulting to true (1), which
+ * could be set to false (0) when the user wishes to receive all the
+ * motion data)
*/
+
if (!(dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS)) {
wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent));
wevPtr->header.proc = WindowEventProc;
@@ -1308,9 +1625,8 @@ Tk_QueueWindowEvent(eventPtr, position)
if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window
== dispPtr->delayedMotionPtr->event.xmotion.window)) {
/*
- * The new event is a motion event in the same window as the
- * saved motion event. Just replace the saved event with the
- * new one.
+ * The new event is a motion event in the same window as the saved
+ * motion event. Just replace the saved event with the new one.
*/
dispPtr->delayedMotionPtr->event = *eventPtr;
@@ -1319,7 +1635,7 @@ Tk_QueueWindowEvent(eventPtr, position)
&& (eventPtr->type != NoExpose)
&& (eventPtr->type != Expose)) {
/*
- * The new event may conflict with the saved motion event. Queue
+ * The new event may conflict with the saved motion event. Queue
* the saved motion event now so that it will be processed before
* the new event.
*/
@@ -1335,13 +1651,13 @@ Tk_QueueWindowEvent(eventPtr, position)
wevPtr->event = *eventPtr;
if ((eventPtr->type == MotionNotify) && (position == TCL_QUEUE_TAIL)) {
/*
- * The new event is a motion event so don't queue it immediately;
- * save it around in case another motion event arrives that it can
- * be collapsed with.
+ * The new event is a motion event so don't queue it immediately; save
+ * it around in case another motion event arrives that it can be
+ * collapsed with.
*/
if (dispPtr->delayedMotionPtr != NULL) {
- panic("Tk_QueueWindowEvent found unexpected delayed motion event");
+ Tcl_Panic("Tk_QueueWindowEvent found unexpected delayed motion event");
}
dispPtr->delayedMotionPtr = wevPtr;
Tcl_DoWhenIdle(DelayedMotionProc, (ClientData) dispPtr);
@@ -1351,12 +1667,12 @@ Tk_QueueWindowEvent(eventPtr, position)
}
/*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* TkQueueEventForAllChildren --
*
- * Given an XEvent, recursively queue the event for this window and
- * all non-toplevel children of the given window.
+ * Given an XEvent, recursively queue the event for this window and all
+ * non-toplevel children of the given window.
*
* Results:
* None.
@@ -1364,23 +1680,23 @@ Tk_QueueWindowEvent(eventPtr, position)
* Side effects:
* Events queued.
*
- *---------------------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-TkQueueEventForAllChildren(winPtr, eventPtr)
- TkWindow *winPtr; /* Window to which event is sent. */
- XEvent *eventPtr; /* The event to be sent. */
+TkQueueEventForAllChildren(
+ TkWindow *winPtr, /* Window to which event is sent. */
+ XEvent *eventPtr) /* The event to be sent. */
{
TkWindow *childPtr;
if (!Tk_IsMapped(winPtr)) {
- return;
+ return;
}
-
+
eventPtr->xany.window = winPtr->window;
Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL);
-
+
childPtr = winPtr->childList;
while (childPtr != NULL) {
if (!Tk_TopWinHierarchy(childPtr)) {
@@ -1395,16 +1711,16 @@ TkQueueEventForAllChildren(winPtr, eventPtr)
*
* WindowEventProc --
*
- * This procedure is called by Tcl_DoOneEvent when a window event
- * reaches the front of the event queue. This procedure is responsible
- * for actually handling the event.
+ * This function is called by Tcl_DoOneEvent when a window event reaches
+ * the front of the event queue. This function is responsible for
+ * actually handling the event.
*
* Results:
- * Returns 1 if the event was handled, meaning it should be removed
- * from the queue. Returns 0 if the event was not handled, meaning
- * it should stay on the queue. The event isn't handled if the
- * TCL_WINDOW_EVENTS bit isn't set in flags, if a restrict proc
- * prevents the event from being handled.
+ * Returns 1 if the event was handled, meaning it should be removed from
+ * the queue. Returns 0 if the event was not handled, meaning it should
+ * stay on the queue. The event isn't handled if the TCL_WINDOW_EVENTS
+ * bit isn't set in flags, if a restrict proc prevents the event from
+ * being handled.
*
* Side effects:
* Whatever the event handlers for the event do.
@@ -1413,15 +1729,15 @@ TkQueueEventForAllChildren(winPtr, eventPtr)
*/
static int
-WindowEventProc(evPtr, flags)
- Tcl_Event *evPtr; /* Event to service. */
- int flags; /* Flags that indicate what events to
- * handle, such as TCL_WINDOW_EVENTS. */
+WindowEventProc(
+ Tcl_Event *evPtr, /* Event to service. */
+ int flags) /* Flags that indicate what events to handle,
+ * such as TCL_WINDOW_EVENTS. */
{
TkWindowEvent *wevPtr = (TkWindowEvent *) evPtr;
Tk_RestrictAction result;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!(flags & TCL_WINDOW_EVENTS)) {
return 0;
@@ -1436,68 +1752,398 @@ WindowEventProc(evPtr, flags)
* TK_DELETE_EVENT: return and say we processed the event,
* even though we didn't do anything at all.
*/
+
+ CleanUpTkEvent(&wevPtr->event);
return 1;
}
}
}
Tk_HandleEvent(&wevPtr->event);
+ CleanUpTkEvent(&wevPtr->event);
return 1;
}
/*
*----------------------------------------------------------------------
*
+ * CleanUpTkEvent --
+ *
+ * This function is called to remove and deallocate any information in
+ * the event which is not directly in the event structure itself. It may
+ * be called multiple times per event, so it takes care to set the
+ * cleared pointer fields to NULL afterwards.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Makes the event no longer have any external resources.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+CleanUpTkEvent(
+ XEvent *eventPtr)
+{
+ switch (eventPtr->type) {
+ case KeyPress:
+ case KeyRelease: {
+ TkKeyEvent *kePtr = (TkKeyEvent *) eventPtr;
+
+ if (kePtr->charValuePtr != NULL) {
+ ckfree(kePtr->charValuePtr);
+ kePtr->charValuePtr = NULL;
+ kePtr->charValueLen = 0;
+ }
+ break;
+ }
+
+ case VirtualEvent: {
+ XVirtualEvent *vePtr = (XVirtualEvent *) eventPtr;
+
+ if (vePtr->user_data != NULL) {
+ Tcl_DecrRefCount(vePtr->user_data);
+ vePtr->user_data = NULL;
+ }
+ break;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* DelayedMotionProc --
*
- * This procedure is invoked as an idle handler when a mouse motion
- * event has been delayed. It queues the delayed event so that it
- * will finally be serviced.
+ * This function is invoked as an idle handler when a mouse motion event
+ * has been delayed. It queues the delayed event so that it will finally
+ * be serviced.
*
* Results:
* None.
*
* Side effects:
- * The delayed mouse motion event gets added to the Tcl event
- * queue for servicing.
+ * The delayed mouse motion event gets added to the Tcl event queue for
+ * servicing.
*
*----------------------------------------------------------------------
*/
static void
-DelayedMotionProc(clientData)
- ClientData clientData; /* Pointer to display containing a delayed
+DelayedMotionProc(
+ ClientData clientData) /* Pointer to display containing a delayed
* motion event to be serviced. */
{
TkDisplay *dispPtr = (TkDisplay *) clientData;
if (dispPtr->delayedMotionPtr == NULL) {
- panic("DelayedMotionProc found no delayed mouse motion event");
+ Tcl_Panic("DelayedMotionProc found no delayed mouse motion event");
}
Tcl_QueueEvent(&dispPtr->delayedMotionPtr->header, TCL_QUEUE_TAIL);
dispPtr->delayedMotionPtr = NULL;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
+ *
+ * TkCreateExitHandler --
+ *
+ * Same as Tcl_CreateExitHandler, but private to Tk.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects.
+ * Sets a handler with Tcl_CreateExitHandler if this is the first call.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkCreateExitHandler(
+ Tcl_ExitProc *proc, /* Function to invoke. */
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr;
+
+ exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler));
+ exitPtr->proc = proc;
+ exitPtr->clientData = clientData;
+ Tcl_MutexLock(&exitMutex);
+
+ /*
+ * The call to TclInExit() is disabled here. That's a private Tcl routine,
+ * and calling it is causing some trouble with portability of building Tk.
+ * We should avoid private Tcl routines generally.
+ *
+ * In this case, the TclInExit() call is being used only to prevent a
+ * Tcl_CreateExitHandler() call when Tcl finalization is in progress.
+ * That's a situation that shouldn't happen anyway. Recent changes within
+ * Tcl_Finalize now cause a Tcl_Panic() to happen if exit handlers get
+ * added after exit handling is complete. By disabling the guard here,
+ * that panic will serve to help us find the buggy conditions and correct
+ * them.
+ *
+ * We can restore this guard if we find we must (hopefully getting public
+ * access to TclInExit() if we discover extensions really do need this),
+ * but during alpha development, this is a good time to dig in and find
+ * the root causes of finalization bugs.
+ */
+
+ if (firstExitPtr == NULL/* && !TclInExit()*/) {
+ Tcl_CreateExitHandler(TkFinalize, NULL);
+ }
+ exitPtr->nextPtr = firstExitPtr;
+ firstExitPtr = exitPtr;
+ Tcl_MutexUnlock(&exitMutex);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkDeleteExitHandler --
+ *
+ * Same as Tcl_DeleteExitHandler, but private to Tk.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects.
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkDeleteExitHandler(
+ Tcl_ExitProc *proc, /* Function that was previously registered. */
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr, *prevPtr;
+
+ Tcl_MutexLock(&exitMutex);
+ for (prevPtr = NULL, exitPtr = firstExitPtr; exitPtr != NULL;
+ prevPtr = exitPtr, exitPtr = exitPtr->nextPtr) {
+ if ((exitPtr->proc == proc)
+ && (exitPtr->clientData == clientData)) {
+ if (prevPtr == NULL) {
+ firstExitPtr = exitPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = exitPtr->nextPtr;
+ }
+ ckfree((char *) exitPtr);
+ break;
+ }
+ }
+ Tcl_MutexUnlock(&exitMutex);
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkCreateThreadExitHandler --
+ *
+ * Same as Tcl_CreateThreadExitHandler, but private to Tk.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Proc will be invoked with clientData as argument when the application
+ * exits.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkCreateThreadExitHandler(
+ Tcl_ExitProc *proc, /* Function to invoke. */
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler));
+ exitPtr->proc = proc;
+ exitPtr->clientData = clientData;
+
+ /*
+ * See comments in TkCreateExitHandler().
+ */
+
+ if (tsdPtr->firstExitPtr == NULL/* && !TclInExit()*/) {
+ Tcl_CreateThreadExitHandler(TkFinalizeThread, NULL);
+ }
+ exitPtr->nextPtr = tsdPtr->firstExitPtr;
+ tsdPtr->firstExitPtr = exitPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkDeleteThreadExitHandler --
+ *
+ * Same as Tcl_DeleteThreadExitHandler, but private to Tk.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If there is an exit handler corresponding to proc and clientData then
+ * it is cancelled; if no such handler exists then nothing happens.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkDeleteThreadExitHandler(
+ Tcl_ExitProc *proc, /* Function that was previously registered. */
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr, *prevPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ for (prevPtr = NULL, exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL;
+ prevPtr = exitPtr, exitPtr = exitPtr->nextPtr) {
+ if ((exitPtr->proc == proc)
+ && (exitPtr->clientData == clientData)) {
+ if (prevPtr == NULL) {
+ tsdPtr->firstExitPtr = exitPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = exitPtr->nextPtr;
+ }
+ ckfree((char *) exitPtr);
+ return;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFinalize --
+ *
+ * Runs our private exit handlers and removes itself from Tcl. This is
+ * benificial should we want to protect from dangling pointers should the
+ * Tk shared library be unloaded prior to Tcl which can happen on windows
+ * should the process be forcefully exiting from an exception handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects.
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFinalize(
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr;
+
+ Tcl_DeleteExitHandler(TkFinalize, NULL);
+
+ Tcl_MutexLock(&exitMutex);
+ for (exitPtr = firstExitPtr; exitPtr != NULL; exitPtr = firstExitPtr) {
+ /*
+ * Be careful to remove the handler from the list before invoking its
+ * callback. This protects us against double-freeing if the callback
+ * should call TkDeleteExitHandler on itself.
+ */
+
+ firstExitPtr = exitPtr->nextPtr;
+ Tcl_MutexUnlock(&exitMutex);
+ (*exitPtr->proc)(exitPtr->clientData);
+ ckfree((char *) exitPtr);
+ Tcl_MutexLock(&exitMutex);
+ }
+ firstExitPtr = NULL;
+ Tcl_MutexUnlock(&exitMutex);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFinalizeThread --
+ *
+ * Runs our private thread exit handlers and removes itself from Tcl.
+ * This is benificial should we want to protect from dangling pointers
+ * should the Tk shared library be unloaded prior to Tcl which can happen
+ * on Windows should the process be forcefully exiting from an exception
+ * handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects.
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFinalizeThread(
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ ExitHandler *exitPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ Tcl_DeleteThreadExitHandler(TkFinalizeThread, NULL);
+
+ if (tsdPtr != NULL) {
+ tsdPtr->inExit = 1;
+
+ for (exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL;
+ exitPtr = tsdPtr->firstExitPtr) {
+ /*
+ * Be careful to remove the handler from the list before invoking
+ * its callback. This protects us against double-freeing if the
+ * callback should call TkDeleteThreadExitHandler on itself.
+ */
+
+ tsdPtr->firstExitPtr = exitPtr->nextPtr;
+ (*exitPtr->proc)(exitPtr->clientData);
+ ckfree((char *) exitPtr);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
*
* Tk_MainLoop --
*
- * Call Tcl_DoOneEvent over and over again in an infinite
- * loop as long as there exist any main windows.
+ * Call Tcl_DoOneEvent over and over again in an infinite loop as long as
+ * there exist any main windows.
*
* Results:
* None.
*
* Side effects:
- * Arbitrary; depends on handlers for events.
+ * Arbitrary; depends on handlers for events.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
void
-Tk_MainLoop()
+Tk_MainLoop(void)
{
while (Tk_GetNumMainWindows() > 0) {
Tcl_DoOneEvent(0);
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c
index 3fa8303..547dd9b 100644
--- a/generic/tkFileFilter.c
+++ b/generic/tkFileFilter.c
@@ -6,33 +6,29 @@
*
* Copyright (c) 1996 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkFileFilter.h"
-static int AddClause _ANSI_ARGS_((
- Tcl_Interp * interp, FileFilter * filterPtr,
- CONST char * patternsStr, CONST char * ostypesStr,
- int isWindows));
-static void FreeClauses _ANSI_ARGS_((FileFilter * filterPtr));
-static void FreeGlobPatterns _ANSI_ARGS_((
- FileFilterClause * clausePtr));
-static void FreeMacFileTypes _ANSI_ARGS_((
- FileFilterClause * clausePtr));
-static FileFilter * GetFilter _ANSI_ARGS_((FileFilterList * flistPtr,
- CONST char * name));
+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);
/*
*----------------------------------------------------------------------
*
* TkInitFileFilters --
*
- * Initializes a FileFilterList data structure. A FileFilterList
- * must be initialized EXACTLY ONCE before any calls to
- * TkGetFileFilters() is made. The usual flow of control is:
+ * Initializes a FileFilterList data structure. A FileFilterList must be
+ * initialized EXACTLY ONCE before any calls to TkGetFileFilters() is
+ * made. The usual flow of control is:
* TkInitFileFilters(&flist);
* TkGetFileFilters(&flist, ...);
* TkGetFileFilters(&flist, ...);
@@ -44,12 +40,13 @@ static FileFilter * GetFilter _ANSI_ARGS_((FileFilterList * flistPtr,
*
* Side effects:
* The fields in flistPtr are initialized.
+ *
*----------------------------------------------------------------------
*/
void
-TkInitFileFilters(flistPtr)
- FileFilterList * flistPtr; /* The structure to be initialized. */
+TkInitFileFilters(
+ FileFilterList *flistPtr) /* The structure to be initialized. */
{
flistPtr->filters = NULL;
flistPtr->filtersTail = NULL;
@@ -61,11 +58,11 @@ TkInitFileFilters(flistPtr)
*
* TkGetFileFilters --
*
- * This function is called by the Mac and Windows implementation
- * of tk_getOpenFile and tk_getSaveFile to translate the string
- * value of the -filetypes option of into an easy-to-parse C
- * structure (flistPtr). The caller of this function will then use
- * flistPtr to perform filetype matching in a platform specific way.
+ * This function is called by the Mac and Windows implementation of
+ * tk_getOpenFile and tk_getSaveFile to translate the string value of the
+ * -filetypes option into an easy-to-parse C structure (flistPtr). The
+ * caller of this function will then use flistPtr to perform filetype
+ * matching in a platform specific way.
*
* flistPtr must be initialized (See comments in TkInitFileFilters).
*
@@ -73,85 +70,74 @@ TkInitFileFilters(flistPtr)
* A standard TCL return value.
*
* Side effects:
- * The fields in flistPtr are changed according to string.
+ * The fields in flistPtr are changed according to 'types'.
+ *
*----------------------------------------------------------------------
*/
+
int
-TkGetFileFilters(interp, flistPtr, string, isWindows)
- Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- FileFilterList * flistPtr; /* Stores the list of file filters. */
- char * string; /* Value of the -filetypes option. */
- int isWindows; /* True if we are running on Windows. */
+TkGetFileFilters(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ FileFilterList *flistPtr, /* Stores the list of file filters. */
+ Tcl_Obj *types, /* Value of the -filetypes option. */
+ int isWindows) /* True if we are running on Windows. */
{
- int listArgc;
- CONST char ** listArgv = NULL;
- CONST char ** typeInfo = NULL;
- int code = TCL_OK;
+ int listObjc;
+ Tcl_Obj ** listObjv = NULL;
int i;
- if (Tcl_SplitList(interp, string, &listArgc, &listArgv) != TCL_OK) {
+ if (types == NULL) {
+ return TCL_OK;
+ }
+
+ if (Tcl_ListObjGetElements(interp, types, &listObjc,
+ &listObjv) != TCL_OK) {
return TCL_ERROR;
}
- if (listArgc == 0) {
- goto done;
+ if (listObjc == 0) {
+ return TCL_OK;
}
/*
- * Free the filter information that have been allocated the previous
- * time -- the -filefilters option may have been used more than once in
- * the command line.
+ * Free the filter information that have been allocated the previous time;
+ * the -filefilters option may have been used more than once in the
+ * command line.
*/
TkFreeFileFilters(flistPtr);
- for (i = 0; i<listArgc; i++) {
+ for (i = 0; i<listObjc; i++) {
/*
- * Each file type should have two or three elements: the first one
- * is the name of the type and the second is the filter of the type.
- * The third is the Mac OSType ID, but we don't care about them here.
+ * Each file type should have two or three elements: the first one is
+ * the name of the type and the second is the filter of the type. The
+ * third is the Mac OSType ID, but we don't care about them here.
*/
+
int count;
- FileFilter * filterPtr;
+ FileFilter *filterPtr;
+ Tcl_Obj **typeInfo;
- if (Tcl_SplitList(interp, listArgv[i], &count, &typeInfo) != TCL_OK) {
- code = TCL_ERROR;
- goto done;
+ if (Tcl_ListObjGetElements(interp, listObjv[i], &count,
+ &typeInfo) != TCL_OK) {
+ return TCL_ERROR;
}
-
+
if (count != 2 && count != 3) {
- Tcl_AppendResult(interp, "bad file type \"", listArgv[i], "\", ",
- "should be \"typeName {extension ?extensions ...?} ",
- "?{macType ?macTypes ...?}?\"", NULL);
- code = TCL_ERROR;
- goto done;
+ Tcl_AppendResult(interp, "bad file type \"",
+ Tcl_GetString(listObjv[i]), "\", ",
+ "should be \"typeName {extension ?extensions ...?} ",
+ "?{macType ?macTypes ...?}?\"", NULL);
+ return TCL_ERROR;
}
- filterPtr = GetFilter(flistPtr, typeInfo[0]);
-
- if (count == 2) {
- code = AddClause(interp, filterPtr, typeInfo[1], NULL,
- isWindows);
- } else {
- code = AddClause(interp, filterPtr, typeInfo[1], typeInfo[2],
- isWindows);
- }
- if (code != TCL_OK) {
- goto done;
- }
+ filterPtr = GetFilter(flistPtr, Tcl_GetString(typeInfo[0]));
- if (typeInfo) {
- ckfree((char*)typeInfo);
+ if (AddClause(interp, filterPtr, typeInfo[1],
+ (count==2 ? NULL : typeInfo[2]), isWindows) != TCL_OK) {
+ return TCL_ERROR;
}
- typeInfo = NULL;
}
- done:
- if (typeInfo) {
- ckfree((char*)typeInfo);
- }
- if (listArgv) {
- ckfree((char*)listArgv);
- }
- return code;
+ return TCL_OK;
}
/*
@@ -166,19 +152,20 @@ TkGetFileFilters(interp, flistPtr, string, isWindows)
*
* Side effects:
* The fields allocated by TkGetFileFilters() are freed.
+ *
*----------------------------------------------------------------------
*/
void
-TkFreeFileFilters(flistPtr)
- FileFilterList * flistPtr; /* List of file filters to free */
+TkFreeFileFilters(
+ FileFilterList *flistPtr) /* List of file filters to free */
{
- FileFilter * filterPtr, *toFree;
+ FileFilter *filterPtr, *toFree;
filterPtr=flistPtr->filters;
- while (filterPtr) {
+ while (filterPtr != NULL) {
toFree = filterPtr;
- filterPtr=filterPtr->next;
+ filterPtr = filterPtr->next;
FreeClauses(toFree);
ckfree((char*)toFree->name);
ckfree((char*)toFree);
@@ -198,41 +185,82 @@ TkFreeFileFilters(flistPtr)
*
* Side effects:
* The list of filter clauses are updated in filterPtr.
+ *
*----------------------------------------------------------------------
*/
-static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
- Tcl_Interp * interp; /* Interpreter to use for error reporting. */
- FileFilter * filterPtr; /* Stores the new filter clause */
- CONST char * patternsStr; /* A TCL list of glob patterns. */
- CONST char * ostypesStr; /* A TCL list of Mac OSType strings. */
- int isWindows; /* True if we are running on Windows; False
- * if we are running on the Mac; Glob
- * patterns need to be processed differently
- * on these two platforms */
+static int
+AddClause(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ FileFilter *filterPtr, /* Stores the new filter clause */
+ Tcl_Obj *patternsObj, /* A Tcl list of glob patterns. */
+ Tcl_Obj *ostypesObj, /* A Tcl list of Mac OSType strings. */
+ int isWindows) /* True if we are running on Windows; False if
+ * we are running on the Mac; Glob patterns
+ * need to be processed differently on these
+ * two platforms */
{
- CONST char ** globList = NULL;
- int globCount;
- CONST char ** ostypeList = NULL;
- int ostypeCount;
- FileFilterClause * clausePtr;
- int i;
- int code = TCL_OK;
+ Tcl_Obj **globList = NULL, **ostypeList = NULL;
+ int globCount, ostypeCount, i, code = TCL_OK;
+ FileFilterClause *clausePtr;
+ Tcl_Encoding macRoman = NULL;
- if (Tcl_SplitList(interp, patternsStr, &globCount, &globList)!= TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, patternsObj,
+ &globCount, &globList) != TCL_OK) {
code = TCL_ERROR;
goto done;
}
- if (ostypesStr != NULL) {
- if (Tcl_SplitList(interp, ostypesStr, &ostypeCount, &ostypeList)
- != TCL_OK) {
+ if (ostypesObj != NULL) {
+ if (Tcl_ListObjGetElements(interp, ostypesObj,
+ &ostypeCount, &ostypeList) != TCL_OK) {
code = TCL_ERROR;
goto done;
}
+
+ /*
+ * We probably need this encoding now...
+ */
+
+ macRoman = Tcl_GetEncoding(NULL, "macRoman");
+
+ /*
+ * Might be cleaner to use 'Tcl_GetOSTypeFromObj' but that is actually
+ * static to the MacOS X/Darwin version of Tcl, and would therefore
+ * require further code refactoring.
+ */
+
for (i=0; i<ostypeCount; i++) {
- if (strlen(ostypeList[i]) != 4) {
+ int len;
+ CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
+
+ /*
+ * If len is < 4, it is definitely an error. If equal or longer,
+ * we need to use the macRoman encoding to determine the correct
+ * length (assuming there may be non-ascii characters, e.g.,
+ * embedded nulls or accented characters in the string, the
+ * macRoman length will be different).
+ *
+ * If we couldn't load the encoding, then we can't actually check
+ * the correct length. But here we assume we're probably operating
+ * on unix/windows with a minimal set of encodings and so don't
+ * care about MacOS types. So we won't signal an error.
+ */
+
+ if (len >= 4 && macRoman != NULL) {
+ Tcl_DString osTypeDS;
+
+ /*
+ * Convert utf to macRoman, since MacOS types are defined to
+ * be 4 macRoman characters long
+ */
+
+ Tcl_UtfToExternalDString(macRoman, strType, len, &osTypeDS);
+ len = Tcl_DStringLength(&osTypeDS);
+ Tcl_DStringFree(&osTypeDS);
+ }
+ if (len != 4) {
Tcl_AppendResult(interp, "bad Macintosh file type \"",
- ostypeList[i], "\"", NULL);
+ Tcl_GetString(ostypeList[i]), "\"", NULL);
code = TCL_ERROR;
goto done;
}
@@ -240,7 +268,7 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
}
/*
- * Add the clause into the list of clauses
+ * Add the clause into the list of clauses
*/
clausePtr = (FileFilterClause*)ckalloc(sizeof(FileFilterClause));
@@ -259,40 +287,40 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
if (globCount > 0 && globList != NULL) {
for (i=0; i<globCount; i++) {
- GlobPattern * globPtr = (GlobPattern*)ckalloc(sizeof(GlobPattern));
+ GlobPattern *globPtr = (GlobPattern*)ckalloc(sizeof(GlobPattern));
int len;
-
- len = (strlen(globList[i]) + 1) * sizeof(char);
- if (globList[i][0] && globList[i][0] != '*') {
+ 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[0] = '*';
- strcpy(globPtr->pattern+1, globList[i]);
- }
- else if (isWindows) {
- if (strcmp(globList[i], "*") == 0) {
- globPtr->pattern = (char*)ckalloc(4*sizeof(char));
+ strcpy(globPtr->pattern+1, str);
+ } else if (isWindows) {
+ if (strcmp(str, "*") == 0) {
+ globPtr->pattern = (char*)ckalloc(4 * sizeof(char));
strcpy(globPtr->pattern, "*.*");
- }
- else if (strcmp(globList[i], "") == 0) {
+ } else if (strcmp(str, "") == 0) {
/*
* An empty string means "match all files with no
* extensions"
* BUG: "*." actually matches with all files on Win95
*/
- globPtr->pattern = (char*)ckalloc(3*sizeof(char));
+
+ globPtr->pattern = (char *) ckalloc(3 * sizeof(char));
strcpy(globPtr->pattern, "*.");
- }
- else {
- globPtr->pattern = (char*)ckalloc((unsigned int) len);
- strcpy(globPtr->pattern, globList[i]);
+ } else {
+ globPtr->pattern = (char *) ckalloc((unsigned int) len);
+ strcpy(globPtr->pattern, str);
}
} else {
- globPtr->pattern = (char*)ckalloc((unsigned int) len);
- strcpy(globPtr->pattern, globList[i]);
+ globPtr->pattern = (char *) ckalloc((unsigned int) len);
+ strcpy(globPtr->pattern, str);
}
/*
@@ -308,13 +336,27 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
globPtr->next = NULL;
}
}
- if (ostypeCount > 0 && ostypeList != NULL) {
+ if (ostypeList != NULL && ostypeCount > 0) {
+ if (macRoman == NULL) {
+ macRoman = Tcl_GetEncoding(NULL, "macRoman");
+ }
for (i=0; i<ostypeCount; i++) {
- MacFileType * mfPtr = (MacFileType*)ckalloc(sizeof(MacFileType));
- CONST char *string = ostypeList[i];
+ Tcl_DString osTypeDS;
+ int len;
+ MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType));
+ CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
+ char *string;
+ /*
+ * Convert utf to macRoman, since MacOS types are defined to be 4
+ * macRoman characters long
+ */
+
+ Tcl_UtfToExternalDString(macRoman, strType, len, &osTypeDS);
+ string = Tcl_DStringValue(&osTypeDS);
mfPtr->type = (OSType) string[0] << 24 | (OSType) string[1] << 16 |
(OSType) string[2] << 8 | (OSType) string[3];
+ Tcl_DStringFree(&osTypeDS);
/*
* Add the Mac type pattern into the list of Mac types
@@ -331,15 +373,11 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
}
done:
- if (globList) {
- ckfree((char*)globList);
+ if (macRoman != NULL) {
+ Tcl_FreeEncoding(macRoman);
}
- if (ostypeList) {
- ckfree((char*)ostypeList);
- }
-
return code;
-}
+}
/*
*----------------------------------------------------------------------
@@ -353,28 +391,30 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
*
* Side effects:
* The list of filters are updated in flistPtr.
+ *
*----------------------------------------------------------------------
*/
-static FileFilter * GetFilter(flistPtr, name)
- FileFilterList * flistPtr; /* The FileFilterList that contains the
- * newly created filter */
- CONST char * name; /* Name of the filter. It is usually displayed
+static FileFilter *
+GetFilter(
+ FileFilterList *flistPtr, /* The FileFilterList that contains the newly
+ * created filter */
+ CONST char *name) /* Name of the filter. It is usually displayed
* in the "File Types" listbox in the file
* dialogs. */
{
- FileFilter * filterPtr;
+ FileFilter *filterPtr = flistPtr->filters;
- for (filterPtr=flistPtr->filters; filterPtr; filterPtr=filterPtr->next) {
- if (strcmp(filterPtr->name, name)==0) {
+ for (; filterPtr; filterPtr=filterPtr->next) {
+ if (strcmp(filterPtr->name, name) == 0) {
return filterPtr;
}
}
- filterPtr = (FileFilter*)ckalloc(sizeof(FileFilter));
+ filterPtr = (FileFilter *) ckalloc(sizeof(FileFilter));
filterPtr->clauses = NULL;
filterPtr->clausesTail = NULL;
- filterPtr->name = (char*)ckalloc((strlen(name)+1) * sizeof(char));
+ filterPtr->name = (char *) ckalloc((strlen(name)+1) * sizeof(char));
strcpy(filterPtr->name, name);
if (flistPtr->filters == NULL) {
@@ -401,22 +441,23 @@ static FileFilter * GetFilter(flistPtr, name)
*
* Side effects:
* The list of clauses in filterPtr->clauses are freed.
+ *
*----------------------------------------------------------------------
*/
static void
-FreeClauses(filterPtr)
- FileFilter * filterPtr; /* FileFilter whose clauses are to be freed */
+FreeClauses(
+ FileFilter *filterPtr) /* FileFilter whose clauses are to be freed */
{
- FileFilterClause * clausePtr, * toFree;
+ FileFilterClause *clausePtr = filterPtr->clauses;
+
+ while (clausePtr != NULL) {
+ FileFilterClause *toFree = clausePtr;
+ clausePtr = clausePtr->next;
- clausePtr = filterPtr->clauses;
- while (clausePtr) {
- toFree = clausePtr;
- clausePtr=clausePtr->next;
FreeGlobPatterns(toFree);
FreeMacFileTypes(toFree);
- ckfree((char*)toFree);
+ ckfree((char *) toFree);
}
filterPtr->clauses = NULL;
filterPtr->clausesTail = NULL;
@@ -434,22 +475,22 @@ FreeClauses(filterPtr)
*
* Side effects:
* The list of glob patterns in clausePtr->patterns are freed.
+ *
*----------------------------------------------------------------------
*/
static void
-FreeGlobPatterns(clausePtr)
- FileFilterClause * clausePtr;/* The clause whose patterns are to be freed*/
+FreeGlobPatterns(
+ FileFilterClause *clausePtr)/* The clause whose patterns are to be freed*/
{
- GlobPattern * globPtr, * toFree;
+ GlobPattern *globPtr = clausePtr->patterns;
- globPtr = clausePtr->patterns;
- while (globPtr) {
- toFree = globPtr;
- globPtr=globPtr->next;
+ while (globPtr != NULL) {
+ GlobPattern *toFree = globPtr;
+ globPtr = globPtr->next;
- ckfree((char*)toFree->pattern);
- ckfree((char*)toFree);
+ ckfree((char *) toFree->pattern);
+ ckfree((char *) toFree);
}
clausePtr->patterns = NULL;
}
@@ -466,21 +507,29 @@ FreeGlobPatterns(clausePtr)
*
* Side effects:
* The list of Mac file types in clausePtr->macTypes are freed.
+ *
*----------------------------------------------------------------------
*/
static void
-FreeMacFileTypes(clausePtr)
- FileFilterClause * clausePtr; /* The clause whose mac types are to be
- * freed */
+FreeMacFileTypes(
+ FileFilterClause *clausePtr)/* The clause whose mac types are to be
+ * freed */
{
- MacFileType * mfPtr, * toFree;
+ MacFileType *mfPtr = clausePtr->macTypes;
- mfPtr = clausePtr->macTypes;
- while (mfPtr) {
- toFree = mfPtr;
- mfPtr=mfPtr->next;
- ckfree((char*)toFree);
+ while (mfPtr != NULL) {
+ MacFileType *toFree = mfPtr;
+ mfPtr = mfPtr->next;
+ ckfree((char *) toFree);
}
clausePtr->macTypes = NULL;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkFileFilter.h b/generic/tkFileFilter.h
index 8d7021e..24002df 100644
--- a/generic/tkFileFilter.h
+++ b/generic/tkFileFilter.h
@@ -1,23 +1,19 @@
/*
* tkFileFilter.h --
*
- * Declarations for the file filter processing routines needed by
- * the file selection dialogs.
+ * Declarations for the file filter processing routines needed by the
+ * file selection dialogs.
*
* Copyright (c) 1996 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TK_FILE_FILTER
#define _TK_FILE_FILTER
-#ifdef MAC_TCL
-#include <StandardFile.h>
-#else
#define OSType long
-#endif
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
@@ -25,65 +21,65 @@
#endif
typedef struct GlobPattern {
- struct GlobPattern * next; /* Chains to the next glob pattern
- * in a glob pattern list */
- char * pattern; /* String value of the pattern, such
- * as "*.txt" or "*.*"
- */
+ struct GlobPattern *next; /* Chains to the next glob pattern in a glob
+ * pattern list */
+ char *pattern; /* String value of the pattern, such as
+ * "*.txt" or "*.*" */
} GlobPattern;
typedef struct MacFileType {
- struct MacFileType * next; /* Chains to the next mac file type
- * in a mac file type list */
- OSType type; /* Mac file type, such as 'TEXT' or
- * 'GIFF' */
+ struct MacFileType *next; /* Chains to the next mac file type in a mac
+ * file type list */
+ OSType type; /* Mac file type, such as 'TEXT' or 'GIFF' */
} MacFileType;
typedef struct FileFilterClause {
- struct FileFilterClause * next; /* Chains to the next clause in
- * a clause list */
- GlobPattern * patterns; /* Head of glob pattern type list */
- GlobPattern * patternsTail; /* Tail of glob pattern type list */
- MacFileType * macTypes; /* Head of mac file type list */
- MacFileType * macTypesTail; /* Tail of mac file type list */
+ struct FileFilterClause *next;
+ /* Chains to the next clause in a clause
+ * list */
+ GlobPattern *patterns; /* Head of glob pattern type list */
+ GlobPattern *patternsTail; /* Tail of glob pattern type list */
+ MacFileType *macTypes; /* Head of mac file type list */
+ MacFileType *macTypesTail; /* Tail of mac file type list */
} FileFilterClause;
typedef struct FileFilter {
- struct FileFilter * next; /* Chains to the next filter
- * in a filter list */
- char * name; /* Name of the file filter,
- * such as "Text Documents" */
- FileFilterClause * clauses; /* Head of the clauses list */
- FileFilterClause * clausesTail; /* Tail of the clauses list */
+ struct FileFilter *next; /* Chains to the next filter in a filter
+ * list */
+ char *name; /* Name of the file filter, such as "Text
+ * Documents" */
+ FileFilterClause *clauses; /* Head of the clauses list */
+ FileFilterClause *clausesTail;
+ /* Tail of the clauses list */
} FileFilter;
-/*----------------------------------------------------------------------
+/*
+ *----------------------------------------------------------------------
+ *
* FileFilterList --
*
- * The routine TkGetFileFilters() translates the string value of the
- * -filefilters option into a FileFilterList structure, which consists
- * of a list of file filters.
+ * The routine TkGetFileFilters() translates the string value of the
+ * -filefilters option into a FileFilterList structure, which consists of
+ * a list of file filters.
+ *
+ * Each file filter consists of one or more clauses. Each clause has one
+ * or more glob patterns and/or one or more Mac file types
*
- * Each file filter consists of one or more clauses. Each clause has
- * one or more glob patterns and/or one or more Mac file types
*----------------------------------------------------------------------
*/
typedef struct FileFilterList {
- FileFilter * filters; /* Head of the filter list */
- FileFilter * filtersTail; /* Tail of the filter list */
- int numFilters; /* number of filters in the list */
+ FileFilter *filters; /* Head of the filter list */
+ FileFilter *filtersTail; /* Tail of the filter list */
+ int numFilters; /* number of filters in the list */
} FileFilterList;
-EXTERN void TkFreeFileFilters _ANSI_ARGS_((
- FileFilterList * flistPtr));
-EXTERN void TkInitFileFilters _ANSI_ARGS_((
- FileFilterList * flistPtr));
-EXTERN int TkGetFileFilters _ANSI_ARGS_ ((Tcl_Interp *interp,
- FileFilterList * flistPtr, char * string,
- int isWindows));
+MODULE_SCOPE void TkFreeFileFilters(FileFilterList *flistPtr);
+MODULE_SCOPE void TkInitFileFilters(FileFilterList *flistPtr);
+MODULE_SCOPE int TkGetFileFilters(Tcl_Interp *interp,
+ FileFilterList *flistPtr, Tcl_Obj *valuePtr,
+ int isWindows);
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
-
#endif
diff --git a/generic/tkFocus.c b/generic/tkFocus.c
index aad1305..42d8be3 100644
--- a/generic/tkFocus.c
+++ b/generic/tkFocus.c
@@ -1,23 +1,20 @@
-/*
+/*
* tkFocus.c --
*
- * This file contains procedures that manage the input
- * focus for Tk.
+ * This file contains functions that manage the input focus for Tk.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkPort.h"
-
/*
- * For each top-level window that has ever received the focus, there
- * is a record of the following type:
+ * For each top-level window that has ever received the focus, there is a
+ * record of the following type:
*/
typedef struct TkToplevelFocusInfo {
@@ -31,19 +28,17 @@ typedef struct TkToplevelFocusInfo {
} ToplevelFocusInfo;
/*
- * One of the following structures exists for each display used by
- * each application. These are linked together from the TkMainInfo
- * structure. These structures are needed because it isn't
- * sufficient to store a single piece of focus information in each
- * display or in each application: we need the cross-product.
- * There needs to be separate information for each display, because
- * it's possible to have multiple focus windows active simultaneously
- * on different displays. There also needs to be separate information
- * for each application, because of embedding: if an embedded
- * application has the focus, its container application also has
- * the focus. Thus we keep a list of structures for each application:
- * the same display can appear in structures for several applications
- * at once.
+ * One of the following structures exists for each display used by each
+ * application. These are linked together from the TkMainInfo structure.
+ * These structures are needed because it isn't sufficient to store a single
+ * piece of focus information in each display or in each application: we need
+ * the cross-product. There needs to be separate information for each display,
+ * because it's possible to have multiple focus windows active simultaneously
+ * on different displays. There also needs to be separate information for each
+ * application, because of embedding: if an embedded application has the
+ * focus, its container application also has the focus. Thus we keep a list of
+ * structures for each application: the same display can appear in structures
+ * for several applications at once.
*/
typedef struct TkDisplayFocusInfo {
@@ -58,49 +53,54 @@ typedef struct TkDisplayFocusInfo {
* supposed to receive the X input focus as
* soon as it is mapped (needed to handle the
* fact that X won't allow the focus on an
- * unmapped window). NULL means no delayed
+ * unmapped window). NULL means no delayed
* focus op in progress for this display. */
- int forceFocus; /* Associated with focusOnMapPtr: non-zero
+ int forceFocus; /* Associated with focusOnMapPtr: non-zero
* means claim the focus even if some other
* application currently has it. */
unsigned long focusSerial; /* Serial number of last request this
* application made to change the focus on
- * this display. Used to identify stale
- * focus notifications coming from the
- * X server. */
+ * this display. Used to identify stale focus
+ * notifications coming from the X server. */
struct TkDisplayFocusInfo *nextPtr;
- /* Next in list of all display focus
- * records for a given application. */
+ /* Next in list of all display focus records
+ * for a given application. */
} 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.
+ * 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)
+#define GENERATED_EVENT_MAGIC ((Bool) 0x547321ac)
/*
- * Forward declarations for procedures defined in this file:
+ * Debugging support...
*/
+#define DEBUG(dispPtr, arguments) \
+ if ((dispPtr)->focusDebug) { \
+ printf arguments; \
+ }
-static DisplayFocusInfo *FindDisplayFocusInfo _ANSI_ARGS_((TkMainInfo *mainPtr,
- TkDisplay *dispPtr));
-static void FocusMapProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void GenerateFocusEvents _ANSI_ARGS_((TkWindow *sourcePtr,
- TkWindow *destPtr));
+/*
+ * Forward declarations for functions defined in this file:
+ */
+
+static DisplayFocusInfo*FindDisplayFocusInfo(TkMainInfo *mainPtr,
+ TkDisplay *dispPtr);
+static void FocusMapProc(ClientData clientData, XEvent *eventPtr);
+static void GenerateFocusEvents(TkWindow *sourcePtr,
+ TkWindow *destPtr);
/*
*--------------------------------------------------------------
*
* Tk_FocusObjCmd --
*
- * This procedure is invoked to process the "focus" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "focus" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -112,15 +112,14 @@ static void GenerateFocusEvents _ANSI_ARGS_((TkWindow *sourcePtr,
*/
int
-Tk_FocusObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
static CONST char *focusOptions[] = {
- "-displayof", "-force", "-lastfor", (char *) NULL
+ "-displayof", "-force", "-lastfor", NULL
};
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr = (TkWindow *) clientData;
@@ -142,17 +141,17 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
}
/*
- * If invoked with a single argument beginning with "." then focus
- * on that window.
+ * If invoked with a single argument beginning with "." then focus on that
+ * window.
*/
if (objc == 2) {
- windowName = Tcl_GetStringFromObj(objv[1], NULL);
+ windowName = Tcl_GetString(objv[1]);
/*
* The empty string case exists for backwards compatibility.
*/
-
+
if (windowName[0] == '\0') {
return TCL_OK;
}
@@ -168,6 +167,10 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
}
}
+ /*
+ * We have a subcommand to parse and act upon.
+ */
+
if (Tcl_GetIndexFromObj(interp, objv[1], focusOptions, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
@@ -177,63 +180,58 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
switch (index) {
- case 0: { /* -displayof */
- windowName = Tcl_GetStringFromObj(objv[2], NULL);
- newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
- if (newPtr == NULL) {
- return TCL_ERROR;
- }
- newPtr = TkGetFocusWin(newPtr);
- if (newPtr != NULL) {
- Tcl_SetResult(interp, newPtr->pathName, TCL_STATIC);
- }
- break;
+ case 0: /* -displayof */
+ windowName = Tcl_GetString(objv[2]);
+ newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
+ if (newPtr == NULL) {
+ return TCL_ERROR;
+ }
+ newPtr = TkGetFocusWin(newPtr);
+ if (newPtr != NULL) {
+ Tcl_SetResult(interp, newPtr->pathName, TCL_STATIC);
}
- case 1: { /* -force */
- windowName = Tcl_GetStringFromObj(objv[2], NULL);
+ break;
+ case 1: /* -force */
+ windowName = Tcl_GetString(objv[2]);
- /*
- * The empty string case exists for backwards compatibility.
- */
-
- if (windowName[0] == '\0') {
- return TCL_OK;
- }
- newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
- if (newPtr == NULL) {
- return TCL_ERROR;
- }
- TkSetFocusWin(newPtr, 1);
- break;
+ /*
+ * The empty string case exists for backwards compatibility.
+ */
+
+ if (windowName[0] == '\0') {
+ return TCL_OK;
}
- case 2: { /* -lastfor */
- windowName = Tcl_GetStringFromObj(objv[2], NULL);
- newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
- if (newPtr == NULL) {
- return TCL_ERROR;
+ newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
+ if (newPtr == NULL) {
+ return TCL_ERROR;
+ }
+ TkSetFocusWin(newPtr, 1);
+ break;
+ case 2: /* -lastfor */
+ windowName = Tcl_GetString(objv[2]);
+ newPtr = (TkWindow *) Tk_NameToWindow(interp, windowName, tkwin);
+ if (newPtr == NULL) {
+ return TCL_ERROR;
+ }
+ for (topLevelPtr = newPtr; topLevelPtr != NULL;
+ topLevelPtr = topLevelPtr->parentPtr) {
+ if (!(topLevelPtr->flags & TK_TOP_HIERARCHY)) {
+ continue;
}
- for (topLevelPtr = newPtr; topLevelPtr != NULL;
- topLevelPtr = topLevelPtr->parentPtr) {
- if (topLevelPtr->flags & TK_TOP_HIERARCHY) {
- for (tlFocusPtr = newPtr->mainPtr->tlFocusPtr;
- tlFocusPtr != NULL;
- tlFocusPtr = tlFocusPtr->nextPtr) {
- if (tlFocusPtr->topLevelPtr == topLevelPtr) {
- Tcl_SetResult(interp,
- tlFocusPtr->focusWinPtr->pathName,
- TCL_STATIC);
- return TCL_OK;
- }
- }
- Tcl_SetResult(interp, topLevelPtr->pathName, TCL_STATIC);
+ for (tlFocusPtr = newPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL;
+ tlFocusPtr = tlFocusPtr->nextPtr) {
+ if (tlFocusPtr->topLevelPtr == topLevelPtr) {
+ Tcl_SetResult(interp,
+ tlFocusPtr->focusWinPtr->pathName, TCL_STATIC);
return TCL_OK;
}
}
- break;
- }
- default: {
- panic("bad const entries to focusOptions in focus command");
+ Tcl_SetResult(interp, topLevelPtr->pathName, TCL_STATIC);
+ return TCL_OK;
}
+ break;
+ default:
+ Tcl_Panic("bad const entries to focusOptions in focus command");
}
return TCL_OK;
}
@@ -243,13 +241,13 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
*
* TkFocusFilterEvent --
*
- * This procedure is invoked by Tk_HandleEvent when it encounters
- * a FocusIn, FocusOut, Enter, or Leave event.
+ * This function is invoked by Tk_HandleEvent when it encounters a
+ * FocusIn, FocusOut, Enter, or Leave event.
*
* Results:
- * A return value of 1 means that Tk_HandleEvent should process
- * the event normally (i.e. event handlers should be invoked).
- * A return value of 0 means that this event should be ignored.
+ * A return value of 1 means that Tk_HandleEvent should process the event
+ * normally (i.e. event handlers should be invoked). A return value of 0
+ * means that this event should be ignored.
*
* Side effects:
* Additional events may be generated, and the focus may switch.
@@ -258,27 +256,25 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
*/
int
-TkFocusFilterEvent(winPtr, eventPtr)
- TkWindow *winPtr; /* Window that focus event is directed to. */
- XEvent *eventPtr; /* FocusIn, FocusOut, Enter, or Leave
+TkFocusFilterEvent(
+ TkWindow *winPtr, /* Window that focus event is directed to. */
+ XEvent *eventPtr) /* FocusIn, FocusOut, Enter, or Leave
* event. */
{
/*
- * Design notes: the window manager and X server work together to
- * transfer the focus among top-level windows. This procedure takes
- * care of transferring the focus from a top-level or wrapper window
- * to the actual window within that top-level that has the focus.
- * We do this by synthesizing X events to move the focus around.
- * None of the FocusIn and FocusOut events generated by X are ever
- * used outside of this procedure; only the synthesized events get
- * through to the rest of the application. At one point (e.g.
- * Tk4.0b1) Tk used to call X to move the focus from a top-level to
- * one of its descendants, then just pass through the events
- * generated by X. This approach didn't work very well, for a
- * variety of reasons. For example, if X generates the events they
- * go at the back of the event queue, which could cause problems if
- * other things have already happened, such as moving the focus to
- * yet another window.
+ * Design notes: the window manager and X server work together to transfer
+ * the focus among top-level windows. This function takes care of
+ * transferring the focus from a top-level or wrapper window to the actual
+ * window within that top-level that has the focus. We do this by
+ * synthesizing X events to move the focus around. None of the FocusIn and
+ * FocusOut events generated by X are ever used outside of this function;
+ * only the synthesized events get through to the rest of the application.
+ * At one point (e.g. Tk4.0b1) Tk used to call X to move the focus from a
+ * top-level to one of its descendants, then just pass through the events
+ * generated by X. This approach didn't work very well, for a variety of
+ * reasons. For example, if X generates the events they go at the back of
+ * the event queue, which could cause problems if other things have
+ * already happened, such as moving the focus to yet another window.
*/
ToplevelFocusInfo *tlFocusPtr;
@@ -288,8 +284,8 @@ TkFocusFilterEvent(winPtr, eventPtr)
int retValue, delta;
/*
- * If this was a generated event, just turn off the generated
- * flag and pass the event through to Tk bindings.
+ * If this was a generated event, just turn off the generated flag and
+ * pass the event through to Tk bindings.
*/
if (eventPtr->xfocus.send_event == GENERATED_EVENT_MAGIC) {
@@ -298,11 +294,11 @@ TkFocusFilterEvent(winPtr, eventPtr)
}
/*
- * Check for special events generated by embedded applications to
- * request the input focus. If this is one of those events, make
- * the change in focus and return without any additional processing
- * of the event (note: the "detail" field of the event indicates
- * whether to claim the focus even if we don't already have it).
+ * Check for special events generated by embedded applications to request
+ * the input focus. If this is one of those events, make the change in
+ * focus and return without any additional processing of the event (note:
+ * the "detail" field of the event indicates whether to claim the focus
+ * even if we don't already have it).
*/
if ((eventPtr->xfocus.mode == EMBEDDED_APP_WANTS_FOCUS)
@@ -312,10 +308,9 @@ TkFocusFilterEvent(winPtr, eventPtr)
}
/*
- * This was not a generated event. We'll return 1 (so that the
- * event will be processed) if it's an Enter or Leave event, and
- * 0 (so that the event won't be processed) if it's a FocusIn or
- * FocusOut event.
+ * This was not a generated event. We'll return 1 (so that the event will
+ * be processed) if it's an Enter or Leave event, and 0 (so that the event
+ * won't be processed) if it's a FocusIn or FocusOut event.
*/
retValue = 0;
@@ -323,26 +318,26 @@ TkFocusFilterEvent(winPtr, eventPtr)
if (eventPtr->type == FocusIn) {
/*
* Skip FocusIn events that cause confusion
- * NotifyVirtual and NotifyNonlinearVirtual - Virtual events occur
- * on windows in between the origin and destination of the
- * focus change. For FocusIn we may see this when focus
- * goes into an embedded child. We don't care about this,
- * although we may end up getting a NotifyPointer later.
- * NotifyInferior - focus is coming to us from an embedded child.
- * When focus is on an embeded focus, we still think we have
- * the focus, too, so this message doesn't change our state.
- * NotifyPointerRoot - should never happen because this is sent
- * to the root window.
+ * NotifyVirtual and NotifyNonlinearVirtual - Virtual events occur on
+ * windows in between the origin and destination of the focus
+ * change. For FocusIn we may see this when focus goes into an
+ * embedded child. We don't care about this, although we may end
+ * up getting a NotifyPointer later.
+ * NotifyInferior - focus is coming to us from an embedded child. When
+ * focus is on an embeded focus, we still think we have the
+ * focus, too, so this message doesn't change our state.
+ * NotifyPointerRoot - should never happen because this is sent to the
+ * root window.
*
* Interesting FocusIn events are
* NotifyAncestor - focus is coming from our parent, probably the root.
* NotifyNonlinear - focus is coming from a different branch, probably
* another toplevel.
- * NotifyPointer - implicit focus because of the mouse position.
- * This is only interesting on toplevels, when it means that the
- * focus has been set to the root window but the mouse is over
- * this toplevel. We take the focus implicitly (probably no
- * window manager)
+ * NotifyPointer - implicit focus because of the mouse position. This
+ * is only interesting on toplevels, when it means that the focus
+ * has been set to the root window but the mouse is over this
+ * toplevel. We take the focus implicitly (probably no window
+ * manager)
*/
if ((eventPtr->xfocus.detail == NotifyVirtual)
@@ -355,12 +350,12 @@ TkFocusFilterEvent(winPtr, eventPtr)
/*
* Skip FocusOut events that cause confusion.
* NotifyPointer - the pointer is in us or a child, and we are losing
- * focus because of an XSetInputFocus. Other focus events
- * will set our state properly.
- * NotifyPointerRoot - should never happen because this is sent
- * to the root window.
- * NotifyInferior - focus leaving us for an embedded child. We
- * retain a notion of focus when an embedded child has focus.
+ * focus because of an XSetInputFocus. Other focus events will
+ * set our state properly.
+ * NotifyPointerRoot - should never happen because this is sent to the
+ * root window.
+ * NotifyInferior - focus leaving us for an embedded child. We retain
+ * a notion of focus when an embedded child has focus.
*
* Interesting events are:
* NotifyAncestor - focus is going to root.
@@ -392,8 +387,8 @@ TkFocusFilterEvent(winPtr, eventPtr)
}
/*
- * If there is a grab in effect and this window is outside the
- * grabbed tree, then ignore the event.
+ * If there is a grab in effect and this window is outside the grabbed
+ * tree, then ignore the event.
*/
if (TkGrabState(winPtr) == TK_GRAB_EXCLUDED) {
@@ -401,16 +396,15 @@ TkFocusFilterEvent(winPtr, eventPtr)
}
/*
- * It is possible that there were outstanding FocusIn and FocusOut
- * events on their way to us at the time the focus was changed
- * internally with the "focus" command. If so, these events could
- * potentially cause us to lose the focus (switch it to the window
- * of the last FocusIn event) even though the focus change occurred
- * after those events. The following code detects this and ignores
- * the stale events.
+ * It is possible that there were outstanding FocusIn and FocusOut events
+ * on their way to us at the time the focus was changed internally with
+ * the "focus" command. If so, these events could potentially cause us to
+ * lose the focus (switch it to the window of the last FocusIn event) even
+ * though the focus change occurred after those events. The following code
+ * detects this and ignores the stale events.
*
- * Note: the focusSerial is only generated by TkpChangeFocus,
- * whereas in Tk 4.2 there was always a nop marker generated.
+ * Note: the focusSerial is only generated by TkpChangeFocus, whereas in
+ * Tk 4.2 there was always a nop marker generated.
*/
delta = eventPtr->xfocus.serial - displayFocusPtr->focusSerial;
@@ -440,6 +434,7 @@ TkFocusFilterEvent(winPtr, eventPtr)
/*
* Ignore event if newFocus window is already dead!
*/
+
if (newFocusPtr->flags & TK_ALREADY_DEAD) {
return retValue;
}
@@ -451,7 +446,7 @@ TkFocusFilterEvent(winPtr, eventPtr)
/*
* NotifyPointer gets set when the focus has been set to the root
- * window but we have the pointer. We'll treat this like an implicit
+ * window but we have the pointer. We'll treat this like an implicit
* focus in event so that upon Leave events we release focus.
*/
@@ -463,12 +458,12 @@ TkFocusFilterEvent(winPtr, eventPtr)
}
}
} else if (eventPtr->type == FocusOut) {
- GenerateFocusEvents(displayFocusPtr->focusWinPtr, (TkWindow *) NULL);
+ GenerateFocusEvents(displayFocusPtr->focusWinPtr, NULL);
/*
- * Reset dispPtr->focusPtr, but only if it currently is the same
- * as this application's focusWinPtr: this check is needed to
- * handle embedded applications in the same process.
+ * Reset dispPtr->focusPtr, but only if it currently is the same as
+ * this application's focusWinPtr: this check is needed to handle
+ * embedded applications in the same process.
*/
if (dispPtr->focusPtr == displayFocusPtr->focusWinPtr) {
@@ -478,25 +473,22 @@ TkFocusFilterEvent(winPtr, eventPtr)
} else if (eventPtr->type == EnterNotify) {
/*
* If there is no window manager, or if the window manager isn't
- * moving the focus around (e.g. the disgusting "NoTitleFocus"
- * option has been selected in twm), then we won't get FocusIn
- * or FocusOut events. Instead, the "focus" field will be set
- * in an Enter event to indicate that we've already got the focus
- * when the mouse enters the window (even though we didn't get
- * a FocusIn event). Watch for this and grab the focus when it
- * happens. Note: if this is an embedded application then don't
- * accept the focus implicitly like this; the container
- * application will give us the focus explicitly if it wants us
- * to have it.
+ * moving the focus around (e.g. the disgusting "NoTitleFocus" option
+ * has been selected in twm), then we won't get FocusIn or FocusOut
+ * events. Instead, the "focus" field will be set in an Enter event to
+ * indicate that we've already got the focus when the mouse enters the
+ * window (even though we didn't get a FocusIn event). Watch for this
+ * and grab the focus when it happens. Note: if this is an embedded
+ * application then don't accept the focus implicitly like this; the
+ * container application will give us the focus explicitly if it wants
+ * us to have it.
*/
if (eventPtr->xcrossing.focus &&
- (displayFocusPtr->focusWinPtr == NULL)
+ (displayFocusPtr->focusWinPtr == NULL)
&& !(winPtr->flags & TK_EMBEDDED)) {
- if (dispPtr->focusDebug) {
- printf("Focussed implicitly on %s\n",
- newFocusPtr->pathName);
- }
+ DEBUG(dispPtr,
+ ("Focussed implicitly on %s\n", newFocusPtr->pathName));
GenerateFocusEvents(displayFocusPtr->focusWinPtr, newFocusPtr);
displayFocusPtr->focusWinPtr = newFocusPtr;
@@ -507,22 +499,19 @@ TkFocusFilterEvent(winPtr, eventPtr)
/*
* 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:
+ * 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
+ * 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.
+ * we focus on the root.
*/
if ((dispPtr->implicitWinPtr != NULL)
&& !(winPtr->flags & TK_EMBEDDED)) {
- if (dispPtr->focusDebug) {
- printf("Defocussed implicit Async\n");
- }
- GenerateFocusEvents(displayFocusPtr->focusWinPtr,
- (TkWindow *) NULL);
+ DEBUG(dispPtr, ("Defocussed implicit Async\n"));
+ GenerateFocusEvents(displayFocusPtr->focusWinPtr, NULL);
XSetInputFocus(dispPtr->display, PointerRoot, RevertToPointerRoot,
CurrentTime);
displayFocusPtr->focusWinPtr = NULL;
@@ -537,8 +526,8 @@ TkFocusFilterEvent(winPtr, eventPtr)
*
* TkSetFocusWin --
*
- * This procedure is invoked to change the focus window for a
- * given display in a given application.
+ * This function is invoked to change the focus window for a given
+ * display in a given application.
*
* Results:
* None.
@@ -551,12 +540,12 @@ TkFocusFilterEvent(winPtr, eventPtr)
*/
void
-TkSetFocusWin(winPtr, force)
- TkWindow *winPtr; /* Window that is to be the new focus for
- * its display and application. */
- int force; /* If non-zero, set the X focus to this
- * window even if the application doesn't
- * currently have the X focus. */
+TkSetFocusWin(
+ TkWindow *winPtr, /* Window that is to be the new focus for its
+ * display and application. */
+ int force) /* If non-zero, set the X focus to this window
+ * even if the application doesn't currently
+ * have the X focus. */
{
ToplevelFocusInfo *tlFocusPtr;
DisplayFocusInfo *displayFocusPtr;
@@ -566,9 +555,9 @@ TkSetFocusWin(winPtr, force)
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
/*
- * If force is set, we should make sure we grab the focus regardless
- * of the current focus window since under Windows, we may need to
- * take control away from another application.
+ * If force is set, we should make sure we grab the focus regardless of
+ * the current focus window since under Windows, we may need to take
+ * control away from another application.
*/
if (winPtr == displayFocusPtr->focusWinPtr && !force) {
@@ -576,18 +565,19 @@ TkSetFocusWin(winPtr, force)
}
/*
- * 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.
*/
allMapped = 1;
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_MAPPED)) {
@@ -599,11 +589,11 @@ TkSetFocusWin(winPtr, force)
}
/*
- * If the new focus window isn't mapped, then we can't focus on it
- * (X will generate an error, for example). Instead, create an
- * event handler that will set the focus to this window once it gets
- * mapped. At the same time, delete any old handler that might be
- * around; it's no longer relevant.
+ * If the new focus window isn't mapped, then we can't focus on it (X will
+ * generate an error, for example). Instead, create an event handler that
+ * will set the focus to this window once it gets mapped. At the same
+ * time, delete any old handler that might be around; it's no longer
+ * relevant.
*/
if (displayFocusPtr->focusOnMapPtr != NULL) {
@@ -637,16 +627,15 @@ TkSetFocusWin(winPtr, force)
tlFocusPtr->focusWinPtr = winPtr;
/*
- * Reset the window system's focus window and generate focus events,
- * with two special cases:
+ * Reset the window system's focus window and generate focus events, with
+ * two special cases:
*
- * 1. If the application is embedded and doesn't currently have the
- * focus, don't set the focus directly. Instead, see if the
- * embedding code can claim the focus from the enclosing
- * container.
- * 2. Otherwise, if the application doesn't currently have the
- * focus, don't change the window system's focus unless it was
- * already in this application or "force" was specified.
+ * 1. If the application is embedded and doesn't currently have the focus,
+ * don't set the focus directly. Instead, see if the embedding code can
+ * claim the focus from the enclosing container.
+ * 2. Otherwise, if the application doesn't currently have the focus,
+ * don't change the window system's focus unless it was already in this
+ * application or "force" was specified.
*/
if ((topLevelPtr->flags & TK_EMBEDDED)
@@ -654,12 +643,11 @@ TkSetFocusWin(winPtr, force)
TkpClaimFocus(topLevelPtr, force);
} else if ((displayFocusPtr->focusWinPtr != NULL) || force) {
/*
- * Generate events to shift focus between Tk windows.
- * We do this regardless of what TkpChangeFocus does with
- * the real X focus so that Tk widgets track focus commands
- * when there is no window manager. GenerateFocusEvents will
- * set up a serial number marker so we discard focus events
- * that are triggered by the ChangeFocus.
+ * Generate events to shift focus between Tk windows. We do this
+ * regardless of what TkpChangeFocus does with the real X focus so
+ * that Tk widgets track focus commands when there is no window
+ * manager. GenerateFocusEvents will set up a serial number marker so
+ * we discard focus events that are triggered by the ChangeFocus.
*/
serial = TkpChangeFocus(TkpGetWrapperWindow(topLevelPtr), force);
@@ -677,13 +665,13 @@ TkSetFocusWin(winPtr, force)
*
* TkGetFocusWin --
*
- * Given a window, this procedure returns the current focus
- * window for its application and display.
+ * Given a window, this function returns the current focus window for its
+ * application and display.
*
* Results:
- * The return value is a pointer to the window that currently
- * has the input focus for the specified application and
- * display, or NULL if none.
+ * The return value is a pointer to the window that currently has the
+ * input focus for the specified application and display, or NULL if
+ * none.
*
* Side effects:
* None.
@@ -692,14 +680,14 @@ TkSetFocusWin(winPtr, force)
*/
TkWindow *
-TkGetFocusWin(winPtr)
- TkWindow *winPtr; /* Window that selects an application
- * and a display. */
+TkGetFocusWin(
+ TkWindow *winPtr) /* Window that selects an application and a
+ * display. */
{
DisplayFocusInfo *displayFocusPtr;
if (winPtr == NULL) {
- return (TkWindow *) NULL;
+ return NULL;
}
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
@@ -711,16 +699,16 @@ TkGetFocusWin(winPtr)
*
* TkFocusKeyEvent --
*
- * Given a window and a key press or release event that arrived for
- * the window, use information about the keyboard focus to compute
- * which window should really get the event. In addition, update
- * the event to refer to its new window.
+ * Given a window and a key press or release event that arrived for the
+ * window, use information about the keyboard focus to compute which
+ * window should really get the event. In addition, update the event to
+ * refer to its new window.
*
* Results:
- * The return value is a pointer to the window that has the input
- * focus in winPtr's application, or NULL if winPtr's application
- * doesn't have the input focus. If a non-NULL value is returned,
- * eventPtr will be updated to refer properly to the focus window.
+ * The return value is a pointer to the window that has the input focus
+ * in winPtr's application, or NULL if winPtr's application doesn't have
+ * the input focus. If a non-NULL value is returned, eventPtr will be
+ * updated to refer properly to the focus window.
*
* Side effects:
* None.
@@ -729,11 +717,11 @@ TkGetFocusWin(winPtr)
*/
TkWindow *
-TkFocusKeyEvent(winPtr, eventPtr)
- TkWindow *winPtr; /* Window that selects an application
- * and a display. */
- XEvent *eventPtr; /* X event to redirect (should be KeyPress
- * or KeyRelease). */
+TkFocusKeyEvent(
+ TkWindow *winPtr, /* Window that selects an application and a
+ * display. */
+ XEvent *eventPtr) /* X event to redirect (should be KeyPress or
+ * KeyRelease). */
{
DisplayFocusInfo *displayFocusPtr;
TkWindow *focusWinPtr;
@@ -760,9 +748,9 @@ TkFocusKeyEvent(winPtr, eventPtr)
if ((focusWinPtr != NULL) && (focusWinPtr->mainPtr == winPtr->mainPtr)) {
/*
- * Map the x and y coordinates to make sense in the context of
- * the focus window, if possible (make both -1 if the map-from
- * and map-to windows don't share the same screen).
+ * Map the x and y coordinates to make sense in the context of the
+ * focus window, if possible (make both -1 if the map-from and map-to
+ * windows don't share the same screen).
*/
if ((focusWinPtr->display != winPtr->display)
@@ -781,13 +769,13 @@ TkFocusKeyEvent(winPtr, eventPtr)
}
/*
- * The event doesn't belong to us. Perhaps, due to embedding, it
- * really belongs to someone else. Give the embedding code a chance
- * to redirect the event.
+ * The event doesn't belong to us. Perhaps, due to embedding, it really
+ * belongs to someone else. Give the embedding code a chance to redirect
+ * the event.
*/
TkpRedirectKeyEvent(winPtr, eventPtr);
- return (TkWindow *) NULL;
+ return NULL;
}
/*
@@ -795,9 +783,8 @@ TkFocusKeyEvent(winPtr, eventPtr)
*
* TkFocusDeadWindow --
*
- * This procedure is invoked when it is determined that
- * a window is dead. It cleans up focus-related information
- * about the window.
+ * This function is invoked when it is determined that a window is dead.
+ * It cleans up focus-related information about the window.
*
* Results:
* None.
@@ -809,25 +796,26 @@ TkFocusKeyEvent(winPtr, eventPtr)
*/
void
-TkFocusDeadWindow(winPtr)
- register TkWindow *winPtr; /* Information about the window
- * that is being deleted. */
+TkFocusDeadWindow(
+ register TkWindow *winPtr) /* Information about the window that is being
+ * deleted. */
{
ToplevelFocusInfo *tlFocusPtr, *prevPtr;
DisplayFocusInfo *displayFocusPtr;
TkDisplay *dispPtr = winPtr->dispPtr;
/*
- * Certain special windows like those used for send and clipboard
- * have no mainPtr.
+ * Certain special windows like those used for send and clipboard have no
+ * mainPtr.
*/
- if (winPtr->mainPtr == NULL)
- return;
+ if (winPtr->mainPtr == NULL) {
+ return;
+ }
/*
- * Search for focus records that refer to this window either as
- * the top-level window or the current focus window.
+ * Search for focus records that refer to this window either as the
+ * top-level window or the current focus window.
*/
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
@@ -836,16 +824,14 @@ TkFocusDeadWindow(winPtr)
prevPtr = tlFocusPtr, tlFocusPtr = tlFocusPtr->nextPtr) {
if (winPtr == tlFocusPtr->topLevelPtr) {
/*
- * The top-level window is the one being deleted: free
- * the focus record and release the focus back to PointerRoot
- * if we acquired it implicitly.
+ * The top-level window is the one being deleted: free the focus
+ * record and release the focus back to PointerRoot if we acquired
+ * it implicitly.
*/
if (dispPtr->implicitWinPtr == winPtr) {
- if (dispPtr->focusDebug) {
- printf("releasing focus to root after %s died\n",
- tlFocusPtr->topLevelPtr->pathName);
- }
+ DEBUG(dispPtr, ("releasing focus to root after %s died\n",
+ tlFocusPtr->topLevelPtr->pathName));
dispPtr->implicitWinPtr = NULL;
displayFocusPtr->focusWinPtr = NULL;
dispPtr->focusPtr = NULL;
@@ -863,18 +849,15 @@ TkFocusDeadWindow(winPtr)
break;
} else if (winPtr == tlFocusPtr->focusWinPtr) {
/*
- * The deleted window had the focus for its top-level:
- * move the focus to the top-level itself.
+ * The deleted window had the focus for its top-level: move the
+ * focus to the top-level itself.
*/
tlFocusPtr->focusWinPtr = tlFocusPtr->topLevelPtr;
if ((displayFocusPtr->focusWinPtr == winPtr)
&& !(tlFocusPtr->topLevelPtr->flags & TK_ALREADY_DEAD)) {
- if (dispPtr->focusDebug) {
- printf("forwarding focus to %s after %s died\n",
- tlFocusPtr->topLevelPtr->pathName,
- winPtr->pathName);
- }
+ DEBUG(dispPtr, ("forwarding focus to %s after %s died\n",
+ tlFocusPtr->topLevelPtr->pathName, winPtr->pathName));
GenerateFocusEvents(displayFocusPtr->focusWinPtr,
tlFocusPtr->topLevelPtr);
displayFocusPtr->focusWinPtr = tlFocusPtr->topLevelPtr;
@@ -890,9 +873,7 @@ TkFocusDeadWindow(winPtr)
*/
if (displayFocusPtr->focusWinPtr == winPtr) {
- if (dispPtr->focusDebug) {
- printf("focus cleared after %s died\n", winPtr->pathName);
- }
+ DEBUG(dispPtr, ("focus cleared after %s died\n", winPtr->pathName));
displayFocusPtr->focusWinPtr = NULL;
}
@@ -906,8 +887,8 @@ TkFocusDeadWindow(winPtr)
*
* GenerateFocusEvents --
*
- * This procedure is called to create FocusIn and FocusOut events to
- * move the input focus from one window to another.
+ * This function is called to create FocusIn and FocusOut events to move
+ * the input focus from one window to another.
*
* Results:
* None.
@@ -919,12 +900,11 @@ TkFocusDeadWindow(winPtr)
*/
static void
-GenerateFocusEvents(sourcePtr, destPtr)
- TkWindow *sourcePtr; /* Window that used to have the focus (may
- * be NULL). */
- TkWindow *destPtr; /* New window to have the focus (may be
+GenerateFocusEvents(
+ TkWindow *sourcePtr, /* Window that used to have the focus (may be
+ * NULL). */
+ TkWindow *destPtr) /* New window to have the focus (may be
* NULL). */
-
{
XEvent event;
TkWindow *winPtr;
@@ -950,26 +930,26 @@ GenerateFocusEvents(sourcePtr, destPtr)
*
* FocusMapProc --
*
- * This procedure is called as an event handler for VisibilityNotify
- * events, if a window receives the focus at a time when its
- * toplevel isn't mapped. The procedure is needed because X
- * won't allow the focus to be set to an unmapped window; we
- * detect when the toplevel is mapped and set the focus to it then.
+ * This function is called as an event handler for VisibilityNotify
+ * events, if a window receives the focus at a time when its toplevel
+ * isn't mapped. The function is needed because X won't allow the focus
+ * to be set to an unmapped window; we detect when the toplevel is mapped
+ * and set the focus to it then.
*
* Results:
* None.
*
* Side effects:
- * If this is a map event, the focus gets set to the toplevel
- * given by clientData.
+ * If this is a map event, the focus gets set to the toplevel given by
+ * clientData.
*
*----------------------------------------------------------------------
*/
static void
-FocusMapProc(clientData, eventPtr)
- ClientData clientData; /* Toplevel window. */
- XEvent *eventPtr; /* Information about event. */
+FocusMapProc(
+ ClientData clientData, /* Toplevel window. */
+ XEvent *eventPtr) /* Information about event. */
{
TkWindow *winPtr = (TkWindow *) clientData;
DisplayFocusInfo *displayFocusPtr;
@@ -977,10 +957,8 @@ FocusMapProc(clientData, eventPtr)
if (eventPtr->type == VisibilityNotify) {
displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr,
winPtr->dispPtr);
- if (winPtr->dispPtr->focusDebug) {
- printf("auto-focussing on %s, force %d\n", winPtr->pathName,
- displayFocusPtr->forceFocus);
- }
+ DEBUG(winPtr->dispPtr, ("auto-focussing on %s, force %d\n",
+ winPtr->pathName, displayFocusPtr->forceFocus));
Tk_DeleteEventHandler((Tk_Window) winPtr, VisibilityChangeMask,
FocusMapProc, clientData);
displayFocusPtr->focusOnMapPtr = NULL;
@@ -993,9 +971,9 @@ FocusMapProc(clientData, eventPtr)
*
* FindDisplayFocusInfo --
*
- * Given an application and a display, this procedure locate the
- * focus record for that combination. If no such record exists,
- * it creates a new record and initializes it.
+ * Given an application and a display, this function locate the focus
+ * record for that combination. If no such record exists, it creates a
+ * new record and initializes it.
*
* Results:
* The return value is a pointer to the record.
@@ -1007,10 +985,10 @@ FocusMapProc(clientData, eventPtr)
*/
static DisplayFocusInfo *
-FindDisplayFocusInfo(mainPtr, dispPtr)
- TkMainInfo *mainPtr; /* Record that identifies a particular
+FindDisplayFocusInfo(
+ TkMainInfo *mainPtr, /* Record that identifies a particular
* application. */
- TkDisplay *dispPtr; /* Display whose focus information is
+ TkDisplay *dispPtr) /* Display whose focus information is
* needed. */
{
DisplayFocusInfo *displayFocusPtr;
@@ -1024,7 +1002,7 @@ FindDisplayFocusInfo(mainPtr, dispPtr)
}
/*
- * The record doesn't exist yet. Make a new one.
+ * The record doesn't exist yet. Make a new one.
*/
displayFocusPtr = (DisplayFocusInfo *) ckalloc(sizeof(DisplayFocusInfo));
@@ -1055,21 +1033,154 @@ FindDisplayFocusInfo(mainPtr, dispPtr)
*/
void
-TkFocusFree(mainPtr)
- TkMainInfo *mainPtr; /* Record that identifies a particular
+TkFocusFree(
+ TkMainInfo *mainPtr) /* Record that identifies a particular
* application. */
{
- DisplayFocusInfo *displayFocusPtr;
- ToplevelFocusInfo *tlFocusPtr;
-
while (mainPtr->displayFocusPtr != NULL) {
- displayFocusPtr = mainPtr->displayFocusPtr;
+ DisplayFocusInfo *displayFocusPtr = mainPtr->displayFocusPtr;
+
mainPtr->displayFocusPtr = mainPtr->displayFocusPtr->nextPtr;
ckfree((char *) displayFocusPtr);
}
while (mainPtr->tlFocusPtr != NULL) {
- tlFocusPtr = mainPtr->tlFocusPtr;
+ ToplevelFocusInfo *tlFocusPtr = mainPtr->tlFocusPtr;
+
mainPtr->tlFocusPtr = mainPtr->tlFocusPtr->nextPtr;
ckfree((char *) tlFocusPtr);
}
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFocusSplit --
+ *
+ * Adjust focus window for a newly managed toplevel, thus splitting
+ * the toplevel into two toplevels.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A new record is allocated for the new toplevel window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFocusSplit(winPtr)
+ 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;
+
+ 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.
+ */
+
+ for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) {
+ if (topLevelPtr == NULL) {
+ /*
+ * The window is being deleted. No point in worrying about
+ * giving it the focus.
+ */
+ return;
+ }
+ if (topLevelPtr->flags & TK_TOP_HIERARCHY) {
+ break;
+ }
+ }
+
+ /* Search all focus records to find child windows of winPtr */
+ for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL;
+ tlFocusPtr = tlFocusPtr->nextPtr) {
+ if (tlFocusPtr->topLevelPtr == topLevelPtr) {
+ break;
+ }
+ }
+
+ if (tlFocusPtr == NULL) {
+ /* 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) {}
+
+ if (subWinPtr == winPtr) {
+ /* Move focus to new toplevel */
+ ToplevelFocusInfo *newTlFocusPtr;
+
+ 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 */
+ tlFocusPtr->focusWinPtr = topLevelPtr;
+ }
+ /* If it's not, then let focus progress naturally */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFocusJoin --
+ *
+ * Remove the focus record for this window that is nolonger managed
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A tlFocusPtr record is removed
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFocusJoin(winPtr)
+ TkWindow *winPtr; /* Window is no longer a toplevel */
+{
+ ToplevelFocusInfo *tlFocusPtr;
+ ToplevelFocusInfo *tmpPtr;
+
+ /*
+ * Remove old toplevel record
+ */
+ if (winPtr && winPtr->mainPtr && winPtr->mainPtr->tlFocusPtr
+ && winPtr->mainPtr->tlFocusPtr->topLevelPtr == winPtr) {
+ tmpPtr = winPtr->mainPtr->tlFocusPtr;
+ winPtr->mainPtr->tlFocusPtr = tmpPtr->nextPtr;
+ ckfree((char *)tmpPtr);
+ } else {
+ for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL;
+ tlFocusPtr = tlFocusPtr->nextPtr) {
+ if (tlFocusPtr->nextPtr &&
+ tlFocusPtr->nextPtr->topLevelPtr == winPtr) {
+ tmpPtr = tlFocusPtr->nextPtr;
+ tlFocusPtr->nextPtr = tmpPtr->nextPtr;
+ ckfree((char *)tmpPtr);
+ break;
+ }
+ }
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 95feec3..1a6474f 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -1,44 +1,42 @@
-/*
+/*
* tkFont.c --
*
- * This file maintains a database of fonts for the Tk toolkit.
- * It also provides several utility procedures for measuring and
- * displaying text.
+ * This file maintains a database of fonts for the Tk toolkit. It also
+ * provides several utility functions for measuring and displaying text.
*
* Copyright (c) 1990-1994 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.
*/
-#include "tkPort.h"
#include "tkInt.h"
#include "tkFont.h"
/*
- * The following structure is used to keep track of all the fonts that
- * exist in the current application. It must be stored in the
- * TkMainInfo for the application.
+ * The following structure is used to keep track of all the fonts that exist
+ * in the current application. It must be stored in the TkMainInfo for the
+ * application.
*/
-
+
typedef struct TkFontInfo {
- Tcl_HashTable fontCache; /* Map a string to an existing Tk_Font.
- * Keys are string font names, values are
- * TkFont pointers. */
+ Tcl_HashTable fontCache; /* Map a string to an existing Tk_Font. Keys
+ * are string font names, values are TkFont
+ * pointers. */
Tcl_HashTable namedTable; /* Map a name to a set of attributes for a
* font, used when constructing a Tk_Font from
- * a named font description. Keys are
- * strings, values are NamedFont pointers. */
+ * a named font description. Keys are strings,
+ * values are NamedFont pointers. */
TkMainInfo *mainPtr; /* Application that owns this structure. */
int updatePending; /* Non-zero when a World Changed event has
- * already been queued to handle a change to
- * a named font. */
+ * already been queued to handle a change to a
+ * named font. */
} TkFontInfo;
/*
* The following data structure is used to keep track of the font attributes
- * for each named font that has been defined. The named font is only deleted
+ * for each named font that has been defined. The named font is only deleted
* when the last reference to it goes away.
*/
@@ -48,84 +46,83 @@ typedef struct NamedFont {
* last reference goes away. */
TkFontAttributes fa; /* Desired attributes for named font. */
} NamedFont;
-
+
/*
- * The following two structures are used to keep track of string
- * measurement information when using the text layout facilities.
+ * The following two structures are used to keep track of string measurement
+ * information when using the text layout facilities.
*
* A LayoutChunk represents a contiguous range of text that can be measured
- * and displayed by low-level text calls. In general, chunks will be
- * delimited by newlines and tabs. Low-level, platform-specific things
- * like kerning and non-integer character widths may occur between the
- * characters in a single chunk, but not between characters in different
- * chunks.
- *
- * A TextLayout is a collection of LayoutChunks. It can be displayed with
- * respect to any origin. It is the implementation of the Tk_TextLayout
- * opaque token.
+ * and displayed by low-level text calls. In general, chunks will be delimited
+ * by newlines and tabs. Low-level, platform-specific things like kerning and
+ * non-integer character widths may occur between the characters in a single
+ * chunk, but not between characters in different chunks.
+ *
+ * A TextLayout is a collection of LayoutChunks. It can be displayed with
+ * respect to any origin. It is the implementation of the Tk_TextLayout opaque
+ * token.
*/
typedef struct LayoutChunk {
- CONST char *start; /* Pointer to simple string to be displayed.
+ const char *start; /* Pointer to simple string to be displayed.
* This is a pointer into the TkTextLayout's
* string. */
int numBytes; /* The number of bytes in this chunk. */
int numChars; /* The number of characters in this chunk. */
int numDisplayChars; /* The number of characters to display when
- * this chunk is displayed. Can be less than
+ * this chunk is displayed. Can be less than
* numChars if extra space characters were
- * absorbed by the end of the chunk. This
- * will be < 0 if this is a chunk that is
- * holding a tab or newline. */
+ * absorbed by the end of the chunk. This will
+ * be < 0 if this is a chunk that is holding a
+ * tab or newline. */
int x, y; /* The origin of the first character in this
* chunk with respect to the upper-left hand
* corner of the TextLayout. */
- int totalWidth; /* Width in pixels of this chunk. Used
- * when hit testing the invisible spaces at
- * the end of a chunk. */
+ int totalWidth; /* Width in pixels of this chunk. Used when
+ * hit testing the invisible spaces at the end
+ * of a chunk. */
int displayWidth; /* Width in pixels of the displayable
- * characters in this chunk. Can be less than
+ * characters in this chunk. Can be less than
* width if extra space characters were
* absorbed by the end of the chunk. */
} LayoutChunk;
typedef struct TextLayout {
Tk_Font tkfont; /* The font used when laying out the text. */
- CONST char *string; /* The string that was layed out. */
- int width; /* The maximum width of all lines in the
- * text layout. */
- int numChunks; /* Number of chunks actually used in
- * following array. */
- LayoutChunk chunks[1]; /* Array of chunks. The actual size will
- * be maxChunks. THIS FIELD MUST BE THE LAST
- * IN THE STRUCTURE. */
+ const char *string; /* The string that was layed out. */
+ int width; /* The maximum width of all lines in the text
+ * layout. */
+ int numChunks; /* Number of chunks actually used in following
+ * array. */
+ LayoutChunk chunks[1]; /* Array of chunks. The actual size will be
+ * maxChunks. THIS FIELD MUST BE THE LAST IN
+ * THE STRUCTURE. */
} TextLayout;
/*
* The following structures are used as two-way maps between the values for
- * the fields in the TkFontAttributes structure and the strings used in
- * Tcl, when parsing both option-value format and style-list format font
- * name strings.
+ * the fields in the TkFontAttributes structure and the strings used in Tcl,
+ * when parsing both option-value format and style-list format font name
+ * strings.
*/
-static TkStateMap weightMap[] = {
+static const TkStateMap weightMap[] = {
{TK_FW_NORMAL, "normal"},
{TK_FW_BOLD, "bold"},
{TK_FW_UNKNOWN, NULL}
};
-static TkStateMap slantMap[] = {
+static const TkStateMap slantMap[] = {
{TK_FS_ROMAN, "roman"},
{TK_FS_ITALIC, "italic"},
{TK_FS_UNKNOWN, NULL}
};
-static TkStateMap underlineMap[] = {
+static const TkStateMap underlineMap[] = {
{1, "underline"},
{0, NULL}
};
-static TkStateMap overstrikeMap[] = {
+static const TkStateMap overstrikeMap[] = {
{1, "overstrike"},
{0, NULL}
};
@@ -135,7 +132,7 @@ static TkStateMap overstrikeMap[] = {
* TkFontAttributes.
*/
-static TkStateMap xlfdWeightMap[] = {
+static const TkStateMap xlfdWeightMap[] = {
{TK_FW_NORMAL, "normal"},
{TK_FW_NORMAL, "medium"},
{TK_FW_NORMAL, "book"},
@@ -144,16 +141,16 @@ static TkStateMap xlfdWeightMap[] = {
{TK_FW_BOLD, "demi"},
{TK_FW_BOLD, "demibold"},
{TK_FW_NORMAL, NULL} /* Assume anything else is "normal". */
-};
+};
-static TkStateMap xlfdSlantMap[] = {
+static const TkStateMap xlfdSlantMap[] = {
{TK_FS_ROMAN, "r"},
{TK_FS_ITALIC, "i"},
{TK_FS_OBLIQUE, "o"},
{TK_FS_ROMAN, NULL} /* Assume anything else is "roman". */
};
-static TkStateMap xlfdSetwidthMap[] = {
+static const TkStateMap xlfdSetwidthMap[] = {
{TK_SW_NORMAL, "normal"},
{TK_SW_CONDENSE, "narrow"},
{TK_SW_CONDENSE, "semicondensed"},
@@ -162,11 +159,11 @@ static TkStateMap xlfdSetwidthMap[] = {
};
/*
- * The following structure and defines specify the valid builtin options
- * when configuring a set of font attributes.
+ * The following structure and defines specify the valid builtin options when
+ * configuring a set of font attributes.
*/
-static CONST char *fontOpt[] = {
+static const char *fontOpt[] = {
"-family",
"-size",
"-weight",
@@ -185,10 +182,10 @@ static CONST char *fontOpt[] = {
#define FONT_NUMFIELDS 6
/*
- * Hardcoded font aliases. These are used to describe (mostly) identical
- * fonts whose names differ from platform to platform. If the
- * user-supplied font name matches any of the names in one of the alias
- * lists, the other names in the alias list are also automatically tried.
+ * Hardcoded font aliases. These are used to describe (mostly) identical fonts
+ * whose names differ from platform to platform. If the user-supplied font
+ * name matches any of the names in one of the alias lists, the other names in
+ * the alias list are also automatically tried.
*/
static char *timesAliases[] = {
@@ -226,7 +223,7 @@ static char *gothicAliases[] = {
/* Windows (MS goshikku). */
"\344\270\270\343\202\264\343\202\267\343\203\203\343\202\257\342\210\222\357\274\255",
/* Mac (goshikku-M). */
- NULL
+ NULL
};
static char *dingbatsAliases[] = {
@@ -245,43 +242,46 @@ static char **fontAliases[] = {
gothicAliases,
dingbatsAliases,
NULL
-};
+};
/*
- * Hardcoded font classes. If the character cannot be found in the base
- * font, the classes are examined in order to see if some other similar
- * font should be examined also.
+ * Hardcoded font classes. If the character cannot be found in the base font,
+ * the classes are examined in order to see if some other similar font should
+ * be examined also.
*/
static char *systemClass[] = {
- "fixed", /* Unix. */
- /* Windows. */
- "chicago", "osaka", "sistemny", /* Mac. */
+ "fixed", /* Unix. */
+ /* Windows. */
+ "chicago", "osaka", "sistemny",
+ /* Mac. */
NULL
};
static char *serifClass[] = {
- "times", "palatino", "mincho", /* All platforms. */
- "song ti", /* Unix. */
- "ms serif", "simplified arabic", /* Windows. */
- "latinski", /* Mac. */
+ "times", "palatino", "mincho",
+ /* All platforms. */
+ "song ti", /* Unix. */
+ "ms serif", "simplified arabic",
+ /* Windows. */
+ "latinski", /* Mac. */
NULL
};
static char *sansClass[] = {
- "helvetica", "gothic", /* All platforms. */
- /* Unix. */
+ "helvetica", "gothic", /* All platforms. */
+ /* Unix. */
"ms sans serif", "traditional arabic",
- /* Windows. */
- "bastion", /* Mac. */
+ /* Windows. */
+ "bastion", /* Mac. */
NULL
};
static char *monoClass[] = {
- "courier", "gothic", /* All platforms. */
- "fangsong ti", /* Unix. */
- "simplified arabic fixed", /* Windows. */
- "monaco", "pryamoy", /* Mac. */
+ "courier", "gothic", /* All platforms. */
+ "fangsong ti", /* Unix. */
+ "simplified arabic fixed", /* Windows. */
+ "monaco", "pryamoy", /* Mac. */
NULL
};
@@ -299,9 +299,9 @@ static char **fontFallbacks[] = {
};
/*
- * Global fallbacks. If the character could not be found in the preferred
- * fallback list, this list is examined. If the character still cannot be
- * found, all font families in the system are examined.
+ * Global fallbacks. If the character could not be found in the preferred
+ * fallback list, this list is examined. If the character still cannot be
+ * found, all font families in the system are examined.
*/
static char *globalFontClass[] = {
@@ -314,43 +314,35 @@ static char *globalFontClass[] = {
};
#define GetFontAttributes(tkfont) \
- ((CONST TkFontAttributes *) &((TkFont *) (tkfont))->fa)
+ ((const TkFontAttributes *) &((TkFont *) (tkfont))->fa)
#define GetFontMetrics(tkfont) \
- ((CONST TkFontMetrics *) &((TkFont *) (tkfont))->fm)
-
-
-static int ConfigAttributesObj _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, int objc, Tcl_Obj *CONST objv[],
- TkFontAttributes *faPtr));
-static int CreateNamedFont _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *name,
- TkFontAttributes *faPtr));
-static void DupFontObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
- Tcl_Obj *dupObjPtr));
-static int FieldSpecified _ANSI_ARGS_((CONST char *field));
-static void FreeFontObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
-static int GetAttributeInfoObj _ANSI_ARGS_((Tcl_Interp *interp,
- CONST TkFontAttributes *faPtr, Tcl_Obj *objPtr));
-static LayoutChunk * NewChunk _ANSI_ARGS_((TextLayout **layoutPtrPtr,
- int *maxPtr, CONST char *start, int numChars,
- int curX, int newX, int y));
-static int ParseFontNameObj _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, Tcl_Obj *objPtr,
- TkFontAttributes *faPtr));
-static void RecomputeWidgets _ANSI_ARGS_((TkWindow *winPtr));
-static int SetFontFromAny _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr));
-static void TheWorldHasChanged _ANSI_ARGS_((
- ClientData clientData));
-static void UpdateDependentFonts _ANSI_ARGS_((TkFontInfo *fiPtr,
- Tk_Window tkwin, Tcl_HashEntry *namedHashPtr));
+ ((const TkFontMetrics *) &((TkFont *) (tkfont))->fm)
+
+
+static int ConfigAttributesObj(Tcl_Interp *interp,
+ Tk_Window tkwin, int objc, Tcl_Obj *const objv[],
+ TkFontAttributes *faPtr);
+static void DupFontObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr);
+static int FieldSpecified(const char *field);
+static void FreeFontObjProc(Tcl_Obj *objPtr);
+static int GetAttributeInfoObj(Tcl_Interp *interp,
+ const TkFontAttributes *faPtr, Tcl_Obj *objPtr);
+static LayoutChunk * NewChunk(TextLayout **layoutPtrPtr, int *maxPtr,
+ const char *start, int numChars, int curX,
+ int newX, int y);
+static int ParseFontNameObj(Tcl_Interp *interp, Tk_Window tkwin,
+ Tcl_Obj *objPtr, TkFontAttributes *faPtr);
+static void RecomputeWidgets(TkWindow *winPtr);
+static int SetFontFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
+static void TheWorldHasChanged(ClientData clientData);
+static void UpdateDependentFonts(TkFontInfo *fiPtr,
+ Tk_Window tkwin, Tcl_HashEntry *namedHashPtr);
/*
* The following structure defines the implementation of the "font" Tcl
- * object, used for drawing. The internalRep.twoPtrValue.ptr1 field of
- * each font object points to the TkFont structure for the font, or
- * NULL.
+ * object, used for drawing. The internalRep.twoPtrValue.ptr1 field of each
+ * font object points to the TkFont structure for the font, or NULL.
*/
Tcl_ObjType tkFontObjType = {
@@ -360,29 +352,29 @@ Tcl_ObjType tkFontObjType = {
NULL, /* updateStringProc */
SetFontFromAny /* setFromAnyProc */
};
-
/*
*---------------------------------------------------------------------------
*
* TkFontPkgInit --
*
- * This procedure is called when an application is created. It
- * initializes all the structures that are used by the font
- * package on a per application basis.
+ * This function is called when an application is created. It initializes
+ * all the structures that are used by the font package on a per
+ * application basis.
*
* Results:
- * Stores a token in the mainPtr to hold information needed by this
- * package on a per application basis.
+ * Stores a token in the mainPtr to hold information needed by this
+ * package on a per application basis.
*
* Side effects:
* Memory allocated.
*
*---------------------------------------------------------------------------
*/
+
void
-TkFontPkgInit(mainPtr)
- TkMainInfo *mainPtr; /* The application being created. */
+TkFontPkgInit(
+ TkMainInfo *mainPtr) /* The application being created. */
{
TkFontInfo *fiPtr;
@@ -401,9 +393,9 @@ TkFontPkgInit(mainPtr)
*
* TkFontPkgFree --
*
- * This procedure is called when an application is deleted. It
- * deletes all the structures that were used by the font package
- * for this application.
+ * This function is called when an application is deleted. It deletes all
+ * the structures that were used by the font package for this
+ * application.
*
* Results:
* None.
@@ -415,8 +407,8 @@ TkFontPkgInit(mainPtr)
*/
void
-TkFontPkgFree(mainPtr)
- TkMainInfo *mainPtr; /* The application being deleted. */
+TkFontPkgFree(
+ TkMainInfo *mainPtr) /* The application being deleted. */
{
TkFontInfo *fiPtr;
Tcl_HashEntry *hPtr, *searchPtr;
@@ -431,15 +423,17 @@ TkFontPkgFree(mainPtr)
searchPtr = Tcl_NextHashEntry(&search)) {
fontsLeft++;
#ifdef DEBUG_FONTS
- fprintf(stderr, "Font %s still in cache.\n",
+ fprintf(stderr, "Font %s still in cache.\n",
Tcl_GetHashKey(&fiPtr->fontCache, searchPtr));
#endif
}
+
#ifdef PURIFY
if (fontsLeft) {
- panic("TkFontPkgFree: all fonts should have been freed already");
+ Tcl_Panic("TkFontPkgFree: all fonts should have been freed already");
}
#endif
+
Tcl_DeleteHashTable(&fiPtr->fontCache);
hPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
@@ -457,10 +451,10 @@ TkFontPkgFree(mainPtr)
/*
*---------------------------------------------------------------------------
*
- * Tk_FontObjCmd --
+ * Tk_FontObjCmd --
*
- * This procedure is implemented to process the "font" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is implemented to process the "font" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -472,16 +466,16 @@ TkFontPkgFree(mainPtr)
*/
int
-Tk_FontObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_FontObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
int index;
Tk_Window tkwin;
TkFontInfo *fiPtr;
- static CONST char *optionStrings[] = {
+ static const char *optionStrings[] = {
"actual", "configure", "create", "delete",
"families", "measure", "metrics", "names",
NULL
@@ -504,259 +498,320 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
}
switch ((enum options) index) {
- case FONT_ACTUAL: {
- int skip, result;
- Tk_Font tkfont;
- Tcl_Obj *objPtr;
- CONST TkFontAttributes *faPtr;
+ case FONT_ACTUAL: {
+ int skip, result, n;
+ const char *s;
+ Tk_Font tkfont;
+ Tcl_Obj *optPtr, *charPtr, *resultPtr;
+ Tcl_UniChar uniChar = 0;
+ const TkFontAttributes *faPtr;
+ TkFontAttributes fa;
- skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if ((objc < 3) || (objc - skip > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "font ?-displayof window? ?option?");
- return TCL_ERROR;
- }
- tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
- if (tkfont == NULL) {
- return TCL_ERROR;
- }
- objc -= skip;
- objv += skip;
- faPtr = GetFontAttributes(tkfont);
- objPtr = NULL;
- if (objc > 3) {
- objPtr = objv[3];
- }
- result = GetAttributeInfoObj(interp, faPtr, objPtr);
- Tk_FreeFont(tkfont);
- return result;
+ /*
+ * Params 0 and 1 are 'font actual'. Param 2 is the font name. 3-4 may
+ * be '-displayof $window'
+ */
+
+ skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case FONT_CONFIGURE: {
- int result;
- char *string;
- Tcl_Obj *objPtr;
- NamedFont *nfPtr;
- Tcl_HashEntry *namedHashPtr;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "fontname ?options?");
- 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);
- }
- if ((namedHashPtr == NULL) || (nfPtr->deletePending != 0)) {
- Tcl_AppendResult(interp, "named font \"", string,
- "\" doesn't exist", NULL);
- return TCL_ERROR;
- }
- if (objc == 3) {
- objPtr = NULL;
- } else if (objc == 4) {
- objPtr = objv[3];
+ /*
+ * Next parameter may be an option.
+ */
+
+ n = skip + 3;
+ optPtr = NULL;
+ charPtr = NULL;
+ if (n < objc) {
+ s = Tcl_GetString(objv[n]);
+ if (s[0] == '-' && s[1] != '-') {
+ optPtr = objv[n];
+ ++n;
} else {
- result = ConfigAttributesObj(interp, tkwin, objc - 3,
- objv + 3, &nfPtr->fa);
- UpdateDependentFonts(fiPtr, tkwin, namedHashPtr);
- return result;
+ optPtr = NULL;
}
- return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr);
}
- case FONT_CREATE: {
- int skip, i;
- char *name;
- char buf[16 + TCL_INTEGER_SPACE];
- TkFontAttributes fa;
- Tcl_HashEntry *namedHashPtr;
- skip = 3;
- if (objc < 3) {
- name = NULL;
- } else {
- name = Tcl_GetString(objv[2]);
- if (name[0] == '-') {
- name = NULL;
- }
- }
- if (name == NULL) {
- /*
- * No font name specified. Generate one of the form "fontX".
- */
+ /*
+ * Next parameter may be '--' to mark end of options.
+ */
- for (i = 1; ; i++) {
- sprintf(buf, "font%d", i);
- namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, buf);
- if (namedHashPtr == NULL) {
- break;
- }
- }
- name = buf;
- skip = 2;
+ if (n < objc) {
+ if (!strcmp(Tcl_GetString(objv[n]), "--")) {
+ ++n;
}
- TkInitFontAttributes(&fa);
- if (ConfigAttributesObj(interp, tkwin, objc - skip, objv + skip,
- &fa) != TCL_OK) {
- return TCL_ERROR;
- }
- if (CreateNamedFont(interp, tkwin, name, &fa) != TCL_OK) {
+ }
+
+ /*
+ * Next parameter is the character to get font information for.
+ */
+
+ if (n < objc) {
+ charPtr = objv[n];
+ ++n;
+ }
+
+ /*
+ * If there were fewer than 3 args, or args remain, that's an error.
+ */
+
+ if (objc < 3 || n < objc) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "font ?-displayof window? ?option? ?--? ?char?");
+ return TCL_ERROR;
+ }
+
+ /*
+ * The 'charPtr' arg must be a single Unicode.
+ */
+
+ if (charPtr != NULL) {
+ if (Tcl_GetCharLength(charPtr) != 1) {
+ resultPtr = Tcl_NewStringObj(
+ "expected a single character but got \"", -1);
+ Tcl_AppendLimitedToObj(resultPtr, Tcl_GetString(charPtr),
+ -1, 40, "...");
+ Tcl_AppendToObj(resultPtr, "\"", -1);
+ Tcl_SetObjResult(interp, resultPtr);
return TCL_ERROR;
}
- Tcl_AppendResult(interp, name, NULL);
- break;
+ uniChar = Tcl_GetUniChar(charPtr, 0);
+ }
+
+ /*
+ * Find the font.
+ */
+
+ tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
+ if (tkfont == NULL) {
+ return TCL_ERROR;
}
- case FONT_DELETE: {
- int i;
- char *string;
- NamedFont *nfPtr;
- Tcl_HashEntry *namedHashPtr;
+ /*
+ * Determine the font attributes.
+ */
+
+ if (charPtr == NULL) {
+ faPtr = GetFontAttributes(tkfont);
+ } else {
+ TkpGetFontAttrsForChar(tkwin, tkfont, uniChar, &fa);
+ faPtr = &fa;
+ }
+ result = GetAttributeInfoObj(interp, faPtr, optPtr);
+
+ Tk_FreeFont(tkfont);
+ return result;
+ }
+ case FONT_CONFIGURE: {
+ int result;
+ char *string;
+ Tcl_Obj *objPtr;
+ NamedFont *nfPtr;
+ Tcl_HashEntry *namedHashPtr;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "fontname ?options?");
+ 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);
+ }
+ if ((namedHashPtr == NULL) || (nfPtr->deletePending != 0)) {
+ Tcl_AppendResult(interp, "named font \"", string,
+ "\" doesn't exist", NULL);
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ objPtr = NULL;
+ } else if (objc == 4) {
+ objPtr = objv[3];
+ } else {
+ result = ConfigAttributesObj(interp, tkwin, objc - 3, objv + 3,
+ &nfPtr->fa);
+ UpdateDependentFonts(fiPtr, tkwin, namedHashPtr);
+ return result;
+ }
+ return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr);
+ }
+ case FONT_CREATE: {
+ int skip, i;
+ char *name;
+ char buf[16 + TCL_INTEGER_SPACE];
+ TkFontAttributes fa;
+ Tcl_HashEntry *namedHashPtr;
+
+ skip = 3;
+ if (objc < 3) {
+ name = NULL;
+ } else {
+ name = Tcl_GetString(objv[2]);
+ if (name[0] == '-') {
+ name = NULL;
+ }
+ }
+ if (name == NULL) {
/*
- * Delete the named font. If there are still widgets using this
- * font, then it isn't deleted right away.
+ * No font name specified. Generate one of the form "fontX".
*/
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "fontname ?fontname ...?");
- return TCL_ERROR;
- }
- for (i = 2; i < objc; i++) {
- string = Tcl_GetString(objv[i]);
- namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, string);
+ for (i = 1; ; i++) {
+ sprintf(buf, "font%d", i);
+ namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, buf);
if (namedHashPtr == NULL) {
- Tcl_AppendResult(interp, "named font \"", string,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
- if (nfPtr->refCount != 0) {
- nfPtr->deletePending = 1;
- } else {
- Tcl_DeleteHashEntry(namedHashPtr);
- ckfree((char *) nfPtr);
+ break;
}
}
- break;
+ name = buf;
+ skip = 2;
+ }
+ TkInitFontAttributes(&fa);
+ if (ConfigAttributesObj(interp, tkwin, objc - skip, objv + skip,
+ &fa) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (TkCreateNamedFont(interp, tkwin, name, &fa) != TCL_OK) {
+ return TCL_ERROR;
}
- case FONT_FAMILIES: {
- int skip;
+ Tcl_AppendResult(interp, name, NULL);
+ break;
+ }
+ case FONT_DELETE: {
+ int i, result = TCL_OK;
+ char *string;
- skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
- return TCL_ERROR;
- }
- TkpGetFontFamilies(interp, tkwin);
- break;
+ /*
+ * Delete the named font. If there are still widgets using this font,
+ * then it isn't deleted right away.
+ */
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "fontname ?fontname ...?");
+ return TCL_ERROR;
}
- case FONT_MEASURE: {
- char *string;
- Tk_Font tkfont;
- int length, skip;
- Tcl_Obj *resultPtr;
-
- skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
- if (skip < 0) {
- return TCL_ERROR;
- }
- if (objc - skip != 4) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "font ?-displayof window? text");
- return TCL_ERROR;
- }
- tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
- if (tkfont == NULL) {
- return TCL_ERROR;
- }
- string = Tcl_GetStringFromObj(objv[3 + skip], &length);
- resultPtr = Tcl_GetObjResult(interp);
- Tcl_SetIntObj(resultPtr, Tk_TextWidth(tkfont, string, length));
- Tk_FreeFont(tkfont);
- break;
+ for (i = 2; i < objc && result == TCL_OK; i++) {
+ string = Tcl_GetString(objv[i]);
+ result = TkDeleteNamedFont(interp, tkwin, string);
+ }
+ return result;
+ }
+ case FONT_FAMILIES: {
+ int skip;
+
+ skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
}
- case FONT_METRICS: {
- Tk_Font tkfont;
- int skip, index, i;
- CONST TkFontMetrics *fmPtr;
- static CONST char *switches[] = {
- "-ascent", "-descent", "-linespace", "-fixed", NULL
- };
+ if (objc - skip != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
+ return TCL_ERROR;
+ }
+ TkpGetFontFamilies(interp, tkwin);
+ break;
+ }
+ case FONT_MEASURE: {
+ char *string;
+ Tk_Font tkfont;
+ int length = 0, skip = 0;
+ Tcl_Obj *resultPtr;
+ if (objc > 4) {
skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
if (skip < 0) {
return TCL_ERROR;
}
- if ((objc < 3) || ((objc - skip) > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "font ?-displayof window? ?option?");
- return TCL_ERROR;
- }
- tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
- if (tkfont == NULL) {
+ }
+ if (objc - skip != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "font ?-displayof window? text");
+ return TCL_ERROR;
+ }
+ tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
+ if (tkfont == NULL) {
+ return TCL_ERROR;
+ }
+ string = Tcl_GetStringFromObj(objv[3 + skip], &length);
+ resultPtr = Tcl_GetObjResult(interp);
+ Tcl_SetIntObj(resultPtr, Tk_TextWidth(tkfont, string, length));
+ Tk_FreeFont(tkfont);
+ break;
+ }
+ case FONT_METRICS: {
+ Tk_Font tkfont;
+ int skip, index, i;
+ const TkFontMetrics *fmPtr;
+ static const char *switches[] = {
+ "-ascent", "-descent", "-linespace", "-fixed", NULL
+ };
+
+ skip = TkGetDisplayOf(interp, objc - 3, objv + 3, &tkwin);
+ if (skip < 0) {
+ return TCL_ERROR;
+ }
+ if ((objc < 3) || ((objc - skip) > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "font ?-displayof window? ?option?");
+ return TCL_ERROR;
+ }
+ tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
+ if (tkfont == NULL) {
+ return TCL_ERROR;
+ }
+ objc -= skip;
+ 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",
+ fmPtr->ascent, fmPtr->descent,
+ fmPtr->ascent + fmPtr->descent, fmPtr->fixed);
+ Tcl_AppendResult(interp, buf, NULL);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], switches, "metric", 0,
+ &index) != TCL_OK) {
+ Tk_FreeFont(tkfont);
return TCL_ERROR;
}
- objc -= skip;
- 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",
- fmPtr->ascent, fmPtr->descent,
- fmPtr->ascent + fmPtr->descent,
- fmPtr->fixed);
- Tcl_AppendResult(interp, buf, NULL);
- } else {
- if (Tcl_GetIndexFromObj(interp, objv[3], switches,
- "metric", 0, &index) != TCL_OK) {
- Tk_FreeFont(tkfont);
- return TCL_ERROR;
- }
- i = 0; /* Needed only to prevent compiler
- * warning. */
- switch (index) {
- case 0: i = fmPtr->ascent; break;
- case 1: i = fmPtr->descent; break;
- case 2: i = fmPtr->ascent + fmPtr->descent; break;
- case 3: i = fmPtr->fixed; break;
- }
- Tcl_SetIntObj(Tcl_GetObjResult(interp), i);
+ i = 0; /* Needed only to prevent compiler warning. */
+ switch (index) {
+ case 0: i = fmPtr->ascent; break;
+ case 1: i = fmPtr->descent; break;
+ case 2: i = fmPtr->ascent + fmPtr->descent; break;
+ case 3: i = fmPtr->fixed; break;
}
- Tk_FreeFont(tkfont);
- break;
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), i);
}
- case FONT_NAMES: {
- char *string;
- NamedFont *nfPtr;
- Tcl_HashSearch search;
- Tcl_HashEntry *namedHashPtr;
- Tcl_Obj *strPtr, *resultPtr;
-
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "names");
- return TCL_ERROR;
- }
- resultPtr = Tcl_GetObjResult(interp);
- namedHashPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
- while (namedHashPtr != NULL) {
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
- if (nfPtr->deletePending == 0) {
- string = Tcl_GetHashKey(&fiPtr->namedTable, namedHashPtr);
- strPtr = Tcl_NewStringObj(string, -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
- }
- namedHashPtr = Tcl_NextHashEntry(&search);
+ Tk_FreeFont(tkfont);
+ break;
+ }
+ case FONT_NAMES: {
+ char *string;
+ NamedFont *nfPtr;
+ Tcl_HashSearch search;
+ Tcl_HashEntry *namedHashPtr;
+ Tcl_Obj *strPtr, *resultPtr;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "names");
+ return TCL_ERROR;
+ }
+ resultPtr = Tcl_GetObjResult(interp);
+ namedHashPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
+ while (namedHashPtr != NULL) {
+ nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ if (nfPtr->deletePending == 0) {
+ string = Tcl_GetHashKey(&fiPtr->namedTable, namedHashPtr);
+ strPtr = Tcl_NewStringObj(string, -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
- break;
+ namedHashPtr = Tcl_NextHashEntry(&search);
}
+ break;
+ }
}
return TCL_OK;
}
@@ -766,10 +821,10 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
*
* UpdateDependentFonts, TheWorldHasChanged, RecomputeWidgets --
*
- * Called when the attributes of a named font changes. Updates all
- * the instantiated fonts that depend on that named font and then
- * uses the brute force approach and prepares every widget to
- * recompute its geometry.
+ * Called when the attributes of a named font changes. Updates all the
+ * instantiated fonts that depend on that named font and then uses the
+ * brute force approach and prepares every widget to recompute its
+ * geometry.
*
* Results:
* None.
@@ -781,10 +836,10 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
*/
static void
-UpdateDependentFonts(fiPtr, tkwin, namedHashPtr)
- TkFontInfo *fiPtr; /* Info about application's fonts. */
- Tk_Window tkwin; /* A window in the application. */
- Tcl_HashEntry *namedHashPtr;/* The named font that is changing. */
+UpdateDependentFonts(
+ TkFontInfo *fiPtr, /* Info about application's fonts. */
+ Tk_Window tkwin, /* A window in the application. */
+ Tcl_HashEntry *namedHashPtr)/* The named font that is changing. */
{
Tcl_HashEntry *cacheHashPtr;
Tcl_HashSearch search;
@@ -794,8 +849,8 @@ UpdateDependentFonts(fiPtr, tkwin, namedHashPtr)
nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
if (nfPtr->refCount == 0) {
/*
- * Well nobody's using this named font, so don't have to tell
- * any widgets to recompute themselves.
+ * Well nobody's using this named font, so don't have to tell any
+ * widgets to recompute themselves.
*/
return;
@@ -818,8 +873,8 @@ UpdateDependentFonts(fiPtr, tkwin, namedHashPtr)
}
static void
-TheWorldHasChanged(clientData)
- ClientData clientData; /* Info about application's fonts. */
+TheWorldHasChanged(
+ ClientData clientData) /* Info about application's fonts. */
{
TkFontInfo *fiPtr;
@@ -830,8 +885,8 @@ TheWorldHasChanged(clientData)
}
static void
-RecomputeWidgets(winPtr)
- TkWindow *winPtr; /* Window to which command is sent. */
+RecomputeWidgets(
+ TkWindow *winPtr) /* Window to which command is sent. */
{
Tk_ClassWorldChangedProc *proc;
proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
@@ -842,22 +897,23 @@ RecomputeWidgets(winPtr)
/*
* Notify all the descendants of this window that the world has changed.
*
- * This could be done recursively or iteratively. The recursive version
- * is easier to implement and understand, and typically, windows with a
- * -font option will be leaf nodes in the widget heirarchy (buttons,
- * labels, etc.), so the recursion depth will be shallow.
+ * This could be done recursively or iteratively. The recursive version is
+ * easier to implement and understand, and typically, windows with a -font
+ * option will be leaf nodes in the widget heirarchy (buttons, labels,
+ * etc.), so the recursion depth will be shallow.
*
- * However, the additional overhead of the recursive calls may become
- * a performance problem if typical usage alters such that -font'ed widgets
- * appear high in the heirarchy, causing deep recursion. This could happen
+ * However, the additional overhead of the recursive calls may become a
+ * performance problem if typical usage alters such that -font'ed widgets
+ * appear high in the heirarchy, causing deep recursion. This could happen
* with text widgets, or more likely with the (not yet existant) labeled
- * frame widget. With these widgets it is possible, even likely, that a
+ * frame widget. With these widgets it is possible, even likely, that a
* -font'ed widget (text or labeled frame) will not be a leaf node, but
- * will instead have many descendants. If this is ever found to cause
- * a performance problem, it may be worth investigating an iterative
- * version of the code below.
+ * will instead have many descendants. If this is ever found to cause a
+ * performance problem, it may be worth investigating an iterative version
+ * of the code below.
*/
- for (winPtr = winPtr->childList; winPtr != NULL; winPtr = winPtr->nextPtr) {
+
+ for (winPtr=winPtr->childList ; winPtr!=NULL ; winPtr=winPtr->nextPtr) {
RecomputeWidgets(winPtr);
}
}
@@ -865,56 +921,57 @@ RecomputeWidgets(winPtr)
/*
*---------------------------------------------------------------------------
*
- * CreateNamedFont --
+ * TkCreateNamedFont --
*
- * Create the specified named font with the given attributes in the
- * named font table associated with the interp.
+ * Create the specified named font with the given attributes in the named
+ * font table associated with the interp.
*
* Results:
- * Returns TCL_OK if the font was successfully created, or TCL_ERROR
- * if the named font already existed. If TCL_ERROR is returned, an
- * error message is left in the interp's result.
+ * Returns TCL_OK if the font was successfully created, or TCL_ERROR if
+ * the named font already existed. If TCL_ERROR is returned, an error
+ * message is left in the interp's result.
*
* Side effects:
* Assume there used to exist a named font by the specified name, and
* that the named font had been deleted, but there were still some
- * widgets using the named font at the time it was deleted. If a
- * new named font is created with the same name, all those widgets
- * that were using the old named font will be redisplayed using
- * the new named font's attributes.
+ * widgets using the named font at the time it was deleted. If a new
+ * named font is created with the same name, all those widgets that were
+ * using the old named font will be redisplayed using the new named
+ * font's attributes.
*
*---------------------------------------------------------------------------
*/
-static int
-CreateNamedFont(interp, tkwin, name, faPtr)
- Tcl_Interp *interp; /* Interp for error return. */
- Tk_Window tkwin; /* A window associated with interp. */
- CONST char *name; /* Name for the new named font. */
- TkFontAttributes *faPtr; /* Attributes for the new named font. */
+int
+TkCreateNamedFont(
+ 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. */
+ TkFontAttributes *faPtr) /* Attributes for the new named font. */
{
TkFontInfo *fiPtr;
Tcl_HashEntry *namedHashPtr;
- int new;
- NamedFont *nfPtr;
+ int isNew;
+ NamedFont *nfPtr;
fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
- namedHashPtr = Tcl_CreateHashEntry(&fiPtr->namedTable, name, &new);
-
- if (new == 0) {
+ namedHashPtr = Tcl_CreateHashEntry(&fiPtr->namedTable, name, &isNew);
+
+ if (!isNew) {
nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
if (nfPtr->deletePending == 0) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "named font \"", name,
- "\" already exists", (char *) NULL);
+ if (interp) {
+ Tcl_AppendResult(interp, "named font \"", name,
+ "\" already exists", NULL);
+ }
return TCL_ERROR;
}
/*
- * Recreating a named font with the same name as a previous
- * named font. Some widgets were still using that named
- * font, so they need to get redisplayed.
+ * Recreating a named font with the same name as a previous named
+ * font. Some widgets were still using that named font, so they need
+ * to get redisplayed.
*/
nfPtr->fa = *faPtr;
@@ -927,7 +984,7 @@ CreateNamedFont(interp, tkwin, name, faPtr)
nfPtr->deletePending = 0;
Tcl_SetHashValue(namedHashPtr, nfPtr);
nfPtr->fa = *faPtr;
- nfPtr->refCount = 0;
+ nfPtr->refCount = 0;
nfPtr->deletePending = 0;
return TCL_OK;
}
@@ -935,76 +992,116 @@ CreateNamedFont(interp, tkwin, name, faPtr)
/*
*---------------------------------------------------------------------------
*
- * Tk_GetFont --
+ * TkDeleteNamedFont --
+ *
+ * Delete the named font. If there are still widgets using this font,
+ * then it isn't deleted right away.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+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. */
+{
+ TkFontInfo *fiPtr;
+ NamedFont *nfPtr;
+ Tcl_HashEntry *namedHashPtr;
+
+ fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
+
+ namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, name);
+ if (namedHashPtr == NULL) {
+ if (interp) {
+ Tcl_AppendResult(interp, "named font \"", name,
+ "\" doesn't exist", NULL);
+ }
+ return TCL_ERROR;
+ }
+ nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
+ if (nfPtr->refCount != 0) {
+ nfPtr->deletePending = 1;
+ } else {
+ Tcl_DeleteHashEntry(namedHashPtr);
+ ckfree((char *) nfPtr);
+ }
+ return TCL_OK;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetFont --
*
* Given a string description of a font, map the description to a
* corresponding Tk_Font that represents the font.
*
* Results:
- * The return value is token for the font, or NULL if an error
- * prevented the font from being created. If NULL is returned, an
- * error message will be left in the interp's result.
+ * The return value is token for the font, or NULL if an error prevented
+ * the font from being created. If NULL is returned, an error message
+ * will be left in the interp's result.
*
* Side effects:
- * The font is added to an internal database with a reference
- * count. For each call to this procedure, there should eventually
- * be a call to Tk_FreeFont() or Tk_FreeFontFromObj() so that the
- * database is cleaned up when fonts aren't in use anymore.
+ * The font is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeFont() or Tk_FreeFontFromObj() so that the database is cleaned
+ * up when fonts aren't in use anymore.
*
*---------------------------------------------------------------------------
*/
Tk_Font
-Tk_GetFont(interp, tkwin, string)
- Tcl_Interp *interp; /* Interp for database and error return, or
- * NULL for no error messages. */
- Tk_Window tkwin; /* For display on which font will be used. */
- CONST char *string; /* String describing font, as: named font,
+Tk_GetFont(
+ Tcl_Interp *interp, /* Interp for database and error return. */
+ Tk_Window tkwin, /* For display on which font will be used. */
+ const char *string) /* String describing font, as: named font,
* native format, or parseable string. */
{
- Tk_Font tkfont;
+ Tk_Font tkfont;
Tcl_Obj *strPtr;
strPtr = Tcl_NewStringObj((char *) string, -1);
Tcl_IncrRefCount(strPtr);
tkfont = Tk_AllocFontFromObj(interp, tkwin, strPtr);
- Tcl_DecrRefCount(strPtr);
+ Tcl_DecrRefCount(strPtr);
return tkfont;
}
/*
*---------------------------------------------------------------------------
*
- * Tk_AllocFontFromObj --
+ * Tk_AllocFontFromObj --
*
* Given a string description of a font, map the description to a
* corresponding Tk_Font that represents the font.
*
* Results:
- * The return value is token for the font, or NULL if an error
- * prevented the font from being created. If NULL is returned, an
- * error message will be left in interp's result object (if non-NULL).
+ * The return value is token for the font, or NULL if an error prevented
+ * the font from being created. If NULL is returned, an error message
+ * will be left in interp's result object.
*
* Side effects:
- * The font is added to an internal database with a reference
- * count. For each call to this procedure, there should eventually
- * be a call to Tk_FreeFont() or Tk_FreeFontFromObj() so that the
- * database is cleaned up when fonts aren't in use anymore.
+ * The font is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeFont() or Tk_FreeFontFromObj() so that the database is cleaned
+ * up when fonts aren't in use anymore.
*
*---------------------------------------------------------------------------
*/
Tk_Font
-Tk_AllocFontFromObj(interp, tkwin, objPtr)
- Tcl_Interp *interp; /* Interp for database and error return. */
- Tk_Window tkwin; /* For screen on which font will be used. */
- Tcl_Obj *objPtr; /* Object describing font, as: named font,
+Tk_AllocFontFromObj(
+ Tcl_Interp *interp, /* Interp for database and error return. */
+ Tk_Window tkwin, /* For screen on which font will be used. */
+ Tcl_Obj *objPtr) /* Object describing font, as: named font,
* native format, or parseable string. */
{
TkFontInfo *fiPtr;
Tcl_HashEntry *cacheHashPtr, *namedHashPtr;
TkFont *fontPtr, *firstFontPtr, *oldFontPtr;
- int new, descent;
+ int isNew, descent;
NamedFont *nfPtr;
fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
@@ -1017,8 +1114,8 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
if (oldFontPtr != NULL) {
if (oldFontPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a TkFont that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a TkFont that's no
+ * longer in use. Clear the reference.
*/
FreeFontObjProc(objPtr);
@@ -1030,17 +1127,17 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
}
/*
- * Next, search the list of fonts that have the name we want, to see
- * if one of them is for the right screen.
+ * Next, search the list of fonts that have the name we want, to see if
+ * one of them is for the right screen.
*/
- new = 0;
+ isNew = 0;
if (oldFontPtr != NULL) {
cacheHashPtr = oldFontPtr->cacheHashPtr;
FreeFontObjProc(objPtr);
} else {
cacheHashPtr = Tcl_CreateHashEntry(&fiPtr->fontCache,
- Tcl_GetString(objPtr), &new);
+ Tcl_GetString(objPtr), &isNew);
}
firstFontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr);
for (fontPtr = firstFontPtr; (fontPtr != NULL);
@@ -1048,13 +1145,13 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
if (Tk_Screen(tkwin) == fontPtr->screen) {
fontPtr->resourceRefCount++;
fontPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) fontPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
return (Tk_Font) fontPtr;
}
}
/*
- * The desired font isn't in the table. Make a new one.
+ * The desired font isn't in the table. Make a new one.
*/
namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable,
@@ -1079,7 +1176,7 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
Tcl_Obj *dupObjPtr = Tcl_DuplicateObj(objPtr);
if (ParseFontNameObj(interp, tkwin, dupObjPtr, &fa) != TCL_OK) {
- if (new) {
+ if (isNew) {
Tcl_DeleteHashEntry(cacheHashPtr);
}
Tcl_DecrRefCount(dupObjPtr);
@@ -1095,6 +1192,19 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
}
}
+ /*
+ * Detect the system font engine going wrong and fail more gracefully.
+ */
+
+ if (fontPtr == NULL) {
+ if (isNew) {
+ Tcl_DeleteHashEntry(cacheHashPtr);
+ }
+ Tcl_AppendResult(interp, "failed to allocate font due to ",
+ "internal system font engine problem", NULL);
+ return NULL;
+ }
+
fontPtr->resourceRefCount = 1;
fontPtr->objRefCount = 1;
fontPtr->cacheHashPtr = cacheHashPtr;
@@ -1122,7 +1232,7 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
* Get information used for drawing underlines in generic code on a
* non-underlined font.
*/
-
+
descent = fontPtr->fm.descent;
fontPtr->underlinePos = descent / 2;
fontPtr->underlineHeight = TkFontGetPixels(tkwin, fontPtr->fa.size) / 10;
@@ -1131,9 +1241,9 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
}
if (fontPtr->underlinePos + fontPtr->underlineHeight > descent) {
/*
- * If this set of values would cause the bottom of the underline
- * bar to stick below the descent of the font, jack the underline
- * up a bit higher.
+ * If this set of values would cause the bottom of the underline bar
+ * to stick below the descent of the font, jack the underline up a bit
+ * higher.
*/
fontPtr->underlineHeight = descent - fontPtr->underlinePos;
@@ -1142,8 +1252,8 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
fontPtr->underlineHeight = 1;
}
}
-
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) fontPtr;
+
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
return (Tk_Font) fontPtr;
}
@@ -1152,31 +1262,31 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
*
* Tk_GetFontFromObj --
*
- * Find the font that corresponds to a given object. The font must
- * have already been created by Tk_GetFont or Tk_AllocFontFromObj.
+ * Find the font that corresponds to a given object. The font must have
+ * already been created by Tk_GetFont or Tk_AllocFontFromObj.
*
* Results:
- * The return value is a token for the font that matches objPtr
- * and is suitable for use in tkwin.
+ * The return value is a token for the font that matches objPtr and is
+ * suitable for use in tkwin.
*
* Side effects:
- * If the object is not already a font ref, the conversion will free
- * any old internal representation.
+ * If the object is not already a font ref, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
Tk_Font
-Tk_GetFontFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window that the font will be used in. */
- Tcl_Obj *objPtr; /* The object from which to get the font. */
+Tk_GetFontFromObj(
+ 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;
TkFont *fontPtr;
Tcl_HashEntry *hashPtr;
-
+
if (objPtr->typePtr != &tkFontObjType) {
- SetFontFromAny((Tcl_Interp *) NULL, objPtr);
+ SetFontFromAny(NULL, objPtr);
}
fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -1184,8 +1294,8 @@ Tk_GetFontFromObj(tkwin, objPtr)
if (fontPtr != NULL) {
if (fontPtr->resourceRefCount == 0) {
/*
- * This is a stale reference: it refers to a TkFont that's
- * no longer in use. Clear the reference.
+ * This is a stale reference: it refers to a TkFont that's no
+ * longer in use. Clear the reference.
*/
FreeFontObjProc(objPtr);
@@ -1196,8 +1306,8 @@ Tk_GetFontFromObj(tkwin, objPtr)
}
/*
- * Next, search the list of fonts that have the name we want, to see
- * if one of them is for the right screen.
+ * Next, search the list of fonts that have the name we want, to see if
+ * one of them is for the right screen.
*/
if (fontPtr != NULL) {
@@ -1211,13 +1321,13 @@ Tk_GetFontFromObj(tkwin, objPtr)
fontPtr = fontPtr->nextPtr) {
if (Tk_Screen(tkwin) == fontPtr->screen) {
fontPtr->objRefCount++;
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) fontPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
return (Tk_Font) fontPtr;
}
}
}
- panic("Tk_GetFontFromObj called with non-existent font!");
+ Tcl_Panic("Tk_GetFontFromObj called with non-existent font!");
return NULL;
}
@@ -1226,28 +1336,28 @@ Tk_GetFontFromObj(tkwin, objPtr)
*
* SetFontFromAny --
*
- * Convert the internal representation of a Tcl object to the
- * font internal form.
+ * Convert the internal representation of a Tcl object to the font
+ * internal form.
*
* Results:
* Always returns TCL_OK.
*
* Side effects:
- * The object is left with its typePtr pointing to tkFontObjType.
- * The TkFont pointer is NULL.
+ * The object is left with its typePtr pointing to tkFontObjType. The
+ * TkFont pointer is NULL.
*
*----------------------------------------------------------------------
*/
static int
-SetFontFromAny(interp, objPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tcl_Obj *objPtr; /* The object to convert. */
+SetFontFromAny(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetString(objPtr);
@@ -1269,10 +1379,10 @@ SetFontFromAny(interp, objPtr)
* Given a font, return a textual string identifying it.
*
* Results:
- * The return value is the description that was passed to
- * Tk_GetFont() to create the font. The storage for the returned
- * string is only guaranteed to persist until the font is deleted.
- * The caller should not modify this string.
+ * The return value is the description that was passed to Tk_GetFont() to
+ * create the font. The storage for the returned string is only
+ * guaranteed to persist until the font is deleted. The caller should not
+ * modify this string.
*
* Side effects:
* None.
@@ -1280,9 +1390,9 @@ SetFontFromAny(interp, objPtr)
*---------------------------------------------------------------------------
*/
-CONST char *
-Tk_NameOfFont(tkfont)
- Tk_Font tkfont; /* Font whose name is desired. */
+const char *
+Tk_NameOfFont(
+ Tk_Font tkfont) /* Font whose name is desired. */
{
TkFont *fontPtr;
@@ -1293,7 +1403,7 @@ Tk_NameOfFont(tkfont)
/*
*---------------------------------------------------------------------------
*
- * Tk_FreeFont --
+ * Tk_FreeFont --
*
* Called to release a font allocated by Tk_GetFont().
*
@@ -1301,15 +1411,15 @@ Tk_NameOfFont(tkfont)
* None.
*
* Side effects:
- * The reference count associated with font is decremented, and
- * only deallocated when no one is using it.
+ * The reference count associated with font is decremented, and only
+ * deallocated when no one is using it.
*
*---------------------------------------------------------------------------
*/
void
-Tk_FreeFont(tkfont)
- Tk_Font tkfont; /* Font to be released. */
+Tk_FreeFont(
+ Tk_Font tkfont) /* Font to be released. */
{
TkFont *fontPtr, *prevPtr;
NamedFont *nfPtr;
@@ -1324,9 +1434,8 @@ Tk_FreeFont(tkfont)
}
if (fontPtr->namedHashPtr != NULL) {
/*
- * This font derived from a named font. Reduce the reference
- * count on the named font and free it if no-one else is
- * using it.
+ * This font derived from a named font. Reduce the reference count on
+ * the named font and free it if no-one else is using it.
*/
nfPtr = (NamedFont *) Tcl_GetHashValue(fontPtr->namedHashPtr);
@@ -1341,7 +1450,7 @@ Tk_FreeFont(tkfont)
if (prevPtr == fontPtr) {
if (fontPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(fontPtr->cacheHashPtr);
- } else {
+ } else {
Tcl_SetHashValue(fontPtr->cacheHashPtr, fontPtr->nextPtr);
}
} else {
@@ -1360,7 +1469,7 @@ Tk_FreeFont(tkfont)
/*
*---------------------------------------------------------------------------
*
- * Tk_FreeFontFromObj --
+ * Tk_FreeFontFromObj --
*
* Called to release a font inside a Tcl_Obj *. Decrements the refCount
* of the font and removes it from the hash tables if necessary.
@@ -1369,17 +1478,17 @@ Tk_FreeFont(tkfont)
* None.
*
* Side effects:
- * The reference count associated with font is decremented, and
- * only deallocated when no one is using it.
+ * The reference count associated with font is decremented, and only
+ * deallocated when no one is using it.
*
*---------------------------------------------------------------------------
*/
void
-Tk_FreeFontFromObj(tkwin, objPtr)
- Tk_Window tkwin; /* The window this font lives in. Needed
- * for the screen value. */
- Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+Tk_FreeFontFromObj(
+ Tk_Window tkwin, /* The window this font lives in. Needed for
+ * the screen value. */
+ Tcl_Obj *objPtr) /* The Tcl_Obj * to be freed. */
{
Tk_FreeFont(Tk_GetFontFromObj(tkwin, objPtr));
}
@@ -1387,26 +1496,25 @@ Tk_FreeFontFromObj(tkwin, objPtr)
/*
*---------------------------------------------------------------------------
*
- * FreeFontObjProc --
+ * FreeFontObjProc --
*
- * 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 needs to be changed.
+ * 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
+ * needs to be changed.
*
* Results:
* None.
*
* Side effects:
- * The object reference count is decremented. When both it
- * and the hash ref count go to zero, the font's resources
- * are released.
+ * The object reference count is decremented. When both it and the hash
+ * ref count go to zero, the font's resources are released.
*
*---------------------------------------------------------------------------
*/
static void
-FreeFontObjProc(objPtr)
- Tcl_Obj *objPtr; /* The object we are releasing. */
+FreeFontObjProc(
+ Tcl_Obj *objPtr) /* The object we are releasing. */
{
TkFont *fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -1422,30 +1530,30 @@ FreeFontObjProc(objPtr)
/*
*---------------------------------------------------------------------------
*
- * DupFontObjProc --
+ * DupFontObjProc --
*
- * When a cached font object is duplicated, this is called to
- * update the internal reps.
+ * When a cached font object is duplicated, this is called to update the
+ * internal reps.
*
* Results:
* None.
*
* Side effects:
- * The font's objRefCount is incremented and the internal rep
- * of the copy is set to point to it.
+ * The font's objRefCount is incremented and the internal rep of the copy
+ * is set to point to it.
*
*---------------------------------------------------------------------------
*/
static void
-DupFontObjProc(srcObjPtr, dupObjPtr)
- Tcl_Obj *srcObjPtr; /* The object we are copying from. */
- Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+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;
-
+
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.twoPtrValue.ptr1 = (VOID *) fontPtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr;
if (fontPtr != NULL) {
fontPtr->objRefCount++;
@@ -1457,10 +1565,10 @@ DupFontObjProc(srcObjPtr, dupObjPtr)
*
* Tk_FontId --
*
- * Given a font, return an opaque handle that should be selected
- * into the XGCValues structure in order to get the constructed
- * gc to use this font. This procedure would go away if the
- * XGCValues structure were replaced with a TkGCValues structure.
+ * Given a font, return an opaque handle that should be selected into the
+ * XGCValues structure in order to get the constructed gc to use this
+ * font. This function would go away if the XGCValues structure were
+ * replaced with a TkGCValues structure.
*
* Results:
* As above.
@@ -1472,8 +1580,9 @@ DupFontObjProc(srcObjPtr, dupObjPtr)
*/
Font
-Tk_FontId(tkfont)
- Tk_Font tkfont; /* Font that is going to be selected into GC. */
+Tk_FontId(
+ Tk_Font tkfont) /* Font that is going to be selected into
+ * GC. */
{
TkFont *fontPtr;
@@ -1486,26 +1595,27 @@ Tk_FontId(tkfont)
*
* Tk_GetFontMetrics --
*
- * Returns overall ascent and descent metrics for the given font.
- * These values can be used to space multiple lines of text and
- * to align the baselines of text in different fonts.
+ * Returns overall ascent and descent metrics for the given font. These
+ * values can be used to space multiple lines of text and to align the
+ * baselines of text in different fonts.
*
* Results:
- * If *heightPtr is non-NULL, it is filled with the overall height
- * of the font, which is the sum of the ascent and descent.
- * If *ascentPtr or *descentPtr is non-NULL, they are filled with
- * the ascent and/or descent information for the font.
+ * If *heightPtr is non-NULL, it is filled with the overall height of the
+ * font, which is the sum of the ascent and descent. If *ascentPtr or
+ * *descentPtr is non-NULL, they are filled with the ascent and/or
+ * descent information for the font.
*
* Side effects:
* None.
*
*---------------------------------------------------------------------------
*/
+
void
-Tk_GetFontMetrics(tkfont, fmPtr)
- Tk_Font tkfont; /* Font in which metrics are calculated. */
- Tk_FontMetrics *fmPtr; /* Pointer to structure in which font
- * metrics for tkfont will be stored. */
+Tk_GetFontMetrics(
+ Tk_Font tkfont, /* Font in which metrics are calculated. */
+ Tk_FontMetrics *fmPtr) /* Pointer to structure in which font metrics
+ * for tkfont will be stored. */
{
TkFont *fontPtr;
@@ -1520,33 +1630,32 @@ Tk_GetFontMetrics(tkfont, fmPtr)
*
* Tk_PostscriptFontName --
*
- * Given a Tk_Font, return the name of the corresponding Postscript
- * font.
+ * Given a Tk_Font, return the name of the corresponding Postscript font.
*
* Results:
- * The return value is the pointsize of the given Tk_Font.
- * The name of the Postscript font is appended to dsPtr.
+ * The return value is the pointsize of the given Tk_Font. The name of
+ * the Postscript font is appended to dsPtr.
*
* Side effects:
- * If the font does not exist on the printer, the print job will
- * fail at print time. Given a "reasonable" Postscript printer,
- * the following Tk_Font font families should print correctly:
+ * If the font does not exist on the printer, the print job will fail at
+ * print time. Given a "reasonable" Postscript printer, the following
+ * Tk_Font font families should print correctly:
*
* Avant Garde, Arial, Bookman, Courier, Courier New, Geneva,
* Helvetica, Monaco, New Century Schoolbook, New York,
* Palatino, Symbol, Times, Times New Roman, Zapf Chancery,
* and Zapf Dingbats.
*
- * Any other Tk_Font font families may not print correctly
- * because the computed Postscript font name may be incorrect.
+ * Any other Tk_Font font families may not print correctly because the
+ * computed Postscript font name may be incorrect.
*
*---------------------------------------------------------------------------
*/
int
-Tk_PostscriptFontName(tkfont, dsPtr)
- Tk_Font tkfont; /* Font in which text will be printed. */
- Tcl_DString *dsPtr; /* Pointer to an initialized Tcl_DString to
+Tk_PostscriptFontName(
+ Tk_Font tkfont, /* Font in which text will be printed. */
+ Tcl_DString *dsPtr) /* Pointer to an initialized Tcl_DString to
* which the name of the Postscript font that
* corresponds to tkfont will be appended. */
{
@@ -1559,9 +1668,9 @@ Tk_PostscriptFontName(tkfont, dsPtr)
fontPtr = (TkFont *) tkfont;
/*
- * Convert the case-insensitive Tk_Font family name to the
- * case-sensitive Postscript family name. Take out any spaces and
- * capitalize the first letter of each word.
+ * Convert the case-insensitive Tk_Font family name to the case-sensitive
+ * Postscript family name. Take out any spaces and capitalize the first
+ * letter of each word.
*/
family = fontPtr->fa.family;
@@ -1589,8 +1698,8 @@ Tk_PostscriptFontName(tkfont, dsPtr)
/*
* Inline, capitalize the first letter of each word, lowercase the
* rest of the letters in each word, and then take out the spaces
- * between the words. This may make the DString shorter, which is
- * safe to do.
+ * between the words. This may make the DString shorter, which is safe
+ * to do.
*/
Tcl_DStringAppend(dsPtr, family, -1);
@@ -1607,7 +1716,7 @@ Tk_PostscriptFontName(tkfont, dsPtr)
ch = Tcl_UniCharToUpper(ch);
upper = 0;
} else {
- ch = Tcl_UniCharToLower(ch);
+ ch = Tcl_UniCharToLower(ch);
}
dest += Tcl_UniCharToUtf(ch, dest);
}
@@ -1655,14 +1764,12 @@ Tk_PostscriptFontName(tkfont, dsPtr)
slantString = NULL;
if (fontPtr->fa.slant == TK_FS_ROMAN) {
;
+ } else if ((strcmp(family, "Helvetica") == 0)
+ || (strcmp(family, "Courier") == 0)
+ || (strcmp(family, "AvantGarde") == 0)) {
+ slantString = "Oblique";
} else {
- if ((strcmp(family, "Helvetica") == 0)
- || (strcmp(family, "Courier") == 0)
- || (strcmp(family, "AvantGarde") == 0)) {
- slantString = "Oblique";
- } else {
- slantString = "Italic";
- }
+ slantString = "Italic";
}
/*
@@ -1671,7 +1778,7 @@ Tk_PostscriptFontName(tkfont, dsPtr)
*/
if ((slantString == NULL) && (weightString == NULL)) {
- if ((strcmp(family, "Times") == 0)
+ if ((strcmp(family, "Times") == 0)
|| (strcmp(family, "NewCenturySchlbk") == 0)
|| (strcmp(family, "Palatino") == 0)) {
Tcl_DStringAppend(dsPtr, "-Roman", -1);
@@ -1695,8 +1802,8 @@ Tk_PostscriptFontName(tkfont, dsPtr)
* Tk_TextWidth --
*
* A wrapper function for the more complicated interface of
- * Tk_MeasureChars. Computes how much space the given
- * simple string needs.
+ * Tk_MeasureChars. Computes how much space the given simple string
+ * needs.
*
* Results:
* The return value is the width (in pixels) of the given string.
@@ -1708,11 +1815,11 @@ Tk_PostscriptFontName(tkfont, dsPtr)
*/
int
-Tk_TextWidth(tkfont, string, numBytes)
- Tk_Font tkfont; /* Font in which text will be measured. */
- CONST char *string; /* String whose width will be computed. */
- int numBytes; /* Number of bytes to consider from
- * string, or < 0 for strlen(). */
+Tk_TextWidth(
+ Tk_Font tkfont, /* Font in which text will be measured. */
+ const char *string, /* String whose width will be computed. */
+ int numBytes) /* Number of bytes to consider from string, or
+ * < 0 for strlen(). */
{
int width;
@@ -1726,15 +1833,15 @@ Tk_TextWidth(tkfont, string, numBytes)
/*
*---------------------------------------------------------------------------
*
- * Tk_UnderlineChars --
+ * Tk_UnderlineChars, TkUnderlineCharsInContext --
*
- * This procedure draws an underline for a given range of characters
- * in a given string. It doesn't draw the characters (which are
- * assumed to have been displayed previously); it just draws the
- * underline. This procedure would mainly be used to quickly
- * underline a few characters without having to construct an
- * underlined font. To produce properly underlined text, the
- * appropriate underlined font should be constructed and used.
+ * These procedures draw an underline for a given range of characters in
+ * a given string. They don't draw the characters (which are assumed to
+ * have been displayed previously); they just draw the underline. These
+ * procedures would mainly be used to quickly underline a few characters
+ * without having to construct an underlined font. To produce properly
+ * underlined text, the appropriate underlined font should be constructed
+ * and used.
*
* Results:
* None.
@@ -1746,30 +1853,53 @@ Tk_TextWidth(tkfont, string, numBytes)
*/
void
-Tk_UnderlineChars(display, drawable, gc, tkfont, string, x, y, firstByte,
- lastByte)
- Display *display; /* Display on which to draw. */
- Drawable drawable; /* Window or pixmap in which to draw. */
- GC gc; /* Graphics context for actually drawing
+Tk_UnderlineChars(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context for actually drawing
* line. */
- Tk_Font tkfont; /* Font used in GC; must have been allocated
- * by Tk_GetFont(). Used for character
+ Tk_Font tkfont, /* Font used in GC; must have been allocated
+ * by Tk_GetFont(). Used for character
* dimensions, etc. */
- CONST char *string; /* String containing characters to be
+ const char *string, /* String containing characters to be
* underlined or overstruck. */
- int x, y; /* Coordinates at which first character of
+ int x, int y, /* Coordinates at which first character of
* string is drawn. */
- int firstByte; /* Index of first byte of first character. */
- int lastByte; /* Index of first byte after the last
+ int firstByte, /* Index of first byte of first character. */
+ int lastByte) /* Index of first byte after the last
+ * character. */
+{
+ TkUnderlineCharsInContext(display, drawable, gc, tkfont, string,
+ lastByte, x, y, firstByte, lastByte);
+}
+
+void
+TkUnderlineCharsInContext(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context for actually drawing
+ * line. */
+ Tk_Font tkfont, /* Font used in GC; must have been allocated
+ * by Tk_GetFont(). Used for character
+ * dimensions, etc. */
+ const char *string, /* String containing characters to be
+ * underlined or overstruck. */
+ int numBytes, /* Number of bytes in string. */
+ int x, int y, /* Coordinates at which the first character of
+ * the whole string would be drawn. */
+ int firstByte, /* Index of first byte of first character. */
+ int lastByte) /* Index of first byte after the last
* character. */
{
TkFont *fontPtr;
int startX, endX;
fontPtr = (TkFont *) tkfont;
-
- Tk_MeasureChars(tkfont, string, firstByte, -1, 0, &startX);
- Tk_MeasureChars(tkfont, string, lastByte, -1, 0, &endX);
+
+ 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),
@@ -1781,66 +1911,60 @@ Tk_UnderlineChars(display, drawable, gc, tkfont, string, x, y, firstByte,
*
* Tk_ComputeTextLayout --
*
- * Computes the amount of screen space needed to display a
- * multi-line, justified string of text. Records all the
- * measurements that were done to determine to size and
- * positioning of the individual lines of text; this information
- * can be used by the Tk_DrawTextLayout() procedure to
+ * Computes the amount of screen space needed to display a multi-line,
+ * justified string of text. Records all the measurements that were done
+ * to determine to size and positioning of the individual lines of text;
+ * this information can be used by the Tk_DrawTextLayout() function to
* display the text quickly (without remeasuring it).
*
- * This procedure is useful for simple widgets that want to
- * display single-font, multi-line text and want Tk to handle the
- * details.
+ * This function is useful for simple widgets that want to display
+ * single-font, multi-line text and want Tk to handle the details.
*
* Results:
- * The return value is a Tk_TextLayout token that holds the
- * measurement information for the given string. The token is
- * only valid for the given string. If the string is freed,
- * the token is no longer valid and must also be freed. To free
- * the token, call Tk_FreeTextLayout().
+ * The return value is a Tk_TextLayout token that holds the measurement
+ * information for the given string. The token is only valid for the
+ * given string. If the string is freed, the token is no longer valid and
+ * must also be freed. To free the token, call Tk_FreeTextLayout().
*
- * The dimensions of the screen area needed to display the text
- * are stored in *widthPtr and *heightPtr.
+ * The dimensions of the screen area needed to display the text are
+ * stored in *widthPtr and *heightPtr.
*
* Side effects:
- * Memory is allocated to hold the measurement information.
+ * Memory is allocated to hold the measurement information.
*
*---------------------------------------------------------------------------
*/
Tk_TextLayout
-Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
- widthPtr, heightPtr)
- Tk_Font tkfont; /* Font that will be used to display text. */
- CONST char *string; /* String whose dimensions are to be
+Tk_ComputeTextLayout(
+ Tk_Font tkfont, /* Font that will be used to display text. */
+ const char *string, /* String whose dimensions are to be
* computed. */
- int numChars; /* Number of characters to consider from
+ int numChars, /* Number of characters to consider from
* string, or < 0 for strlen(). */
- int wrapLength; /* Longest permissible line length, in
- * pixels. <= 0 means no automatic wrapping:
- * just let lines get as long as needed. */
- Tk_Justify justify; /* How to justify lines. */
- int flags; /* Flag bits OR-ed together.
- * TK_IGNORE_TABS means that tab characters
- * should not be expanded. TK_IGNORE_NEWLINES
- * means that newline characters should not
- * cause a line break. */
- int *widthPtr; /* Filled with width of string. */
- int *heightPtr; /* Filled with height of string. */
+ int wrapLength, /* Longest permissible line length, in pixels.
+ * <= 0 means no automatic wrapping: just let
+ * lines get as long as needed. */
+ Tk_Justify justify, /* How to justify lines. */
+ int flags, /* Flag bits OR-ed together. TK_IGNORE_TABS
+ * means that tab characters should not be
+ * expanded. TK_IGNORE_NEWLINES means that
+ * newline characters should not cause a line
+ * break. */
+ int *widthPtr, /* Filled with width of string. */
+ int *heightPtr) /* Filled with height of string. */
{
TkFont *fontPtr;
- CONST char *start, *end, *special;
- int n, y, bytesThisChunk, maxChunks;
- int baseline, height, curX, newX, maxWidth;
+ const char *start, *end, *special;
+ int n, y, bytesThisChunk, maxChunks, curLine, layoutHeight;
+ int baseline, height, curX, newX, maxWidth, *lineLengths;
TextLayout *layoutPtr;
LayoutChunk *chunkPtr;
- CONST TkFontMetrics *fmPtr;
+ const TkFontMetrics *fmPtr;
Tcl_DString lineBuffer;
- int *lineLengths;
- int curLine, layoutHeight;
Tcl_DStringInit(&lineBuffer);
-
+
fontPtr = (TkFont *) tkfont;
if ((fontPtr == NULL) || (string == NULL)) {
if (widthPtr != NULL) {
@@ -1865,11 +1989,11 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
maxChunks = 1;
- layoutPtr = (TextLayout *) ckalloc(sizeof(TextLayout)
- + (maxChunks - 1) * sizeof(LayoutChunk));
- layoutPtr->tkfont = tkfont;
- layoutPtr->string = string;
- layoutPtr->numChunks = 0;
+ layoutPtr = (TextLayout *)
+ ckalloc(sizeof(TextLayout) + (maxChunks-1) * sizeof(LayoutChunk));
+ layoutPtr->tkfont = tkfont;
+ layoutPtr->string = string;
+ layoutPtr->numChunks = 0;
baseline = fmPtr->ascent;
maxWidth = 0;
@@ -1884,7 +2008,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
special = string;
flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES;
- flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE;
+ flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE;
for (start = string; start < end; ) {
if (start >= special) {
/*
@@ -1892,7 +2016,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
*
* INTL: Note that it is safe to increment by byte, because we are
* looking for 7-bit characters that will appear unchanged in
- * UTF-8. At some point we may need to support the full Unicode
+ * UTF-8. At some point we may need to support the full Unicode
* whitespace set.
*/
@@ -1912,7 +2036,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
/*
* Special points at the next special character (or the end of the
- * string). Process characters between start and special.
+ * string). Process characters between start and special.
*/
chunkPtr = NULL;
@@ -1924,7 +2048,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
if (bytesThisChunk > 0) {
chunkPtr = NewChunk(&layoutPtr, &maxChunks, start,
bytesThisChunk, curX, newX, baseline);
-
+
start += bytesThisChunk;
curX = newX;
}
@@ -1934,8 +2058,8 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
/*
* Handle the special character.
*
- * INTL: Special will be pointing at a 7-bit character so we
- * can safely treat it as a single byte.
+ * INTL: Special will be pointing at a 7-bit character so we can
+ * safely treat it as a single byte.
*/
chunkPtr = NULL;
@@ -1955,7 +2079,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
flags &= ~TK_AT_LEAST_ONE;
continue;
}
- } else {
+ } else {
NewChunk(&layoutPtr, &maxChunks, start, 1, curX, curX,
baseline)->numDisplayChars = -1;
start++;
@@ -1964,9 +2088,9 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
}
/*
- * No more characters are going to go on this line, either because
- * no more characters can fit or there are no more characters left.
- * Consume all extra spaces at end of line.
+ * No more characters are going to go on this line, either because no
+ * more characters can fit or there are no more characters left.
+ * Consume all extra spaces at end of line.
*/
while ((start < end) && isspace(UCHAR(*start))) { /* INTL: ISO space */
@@ -1983,12 +2107,12 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
start++;
}
if (chunkPtr != NULL) {
- CONST char *end;
+ const char *end;
/*
- * Append all the extra spaces on this line to the end of the
- * last text chunk. This is a little tricky because we are
- * switching back and forth between characters and bytes.
+ * Append all the extra spaces on this line to the end of the last
+ * text chunk. This is a little tricky because we are switching
+ * back and forth between characters and bytes.
*/
end = chunkPtr->start + chunkPtr->numBytes;
@@ -2002,7 +2126,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
}
}
- wrapLine:
+ wrapLine:
flags |= TK_AT_LEAST_ONE;
/*
@@ -2015,8 +2139,8 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
}
/*
- * Remember width of this line, so that all chunks on this line
- * can be centered or right justified, if necessary.
+ * Remember width of this line, so that all chunks on this line can be
+ * centered or right justified, if necessary.
*/
Tcl_DStringAppend(&lineBuffer, (char *) &curX, sizeof(curX));
@@ -2026,9 +2150,8 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
}
/*
- * If last line ends with a newline, then we need to make a 0 width
- * chunk on the next line. Otherwise "Hello" and "Hello\n" are the
- * same height.
+ * If last line ends with a newline, then we need to make a 0 width chunk
+ * on the next line. Otherwise "Hello" and "Hello\n" are the same height.
*/
if ((layoutPtr->numChunks > 0) && ((flags & TK_IGNORE_NEWLINES) == 0)) {
@@ -2039,7 +2162,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
Tcl_DStringAppend(&lineBuffer, (char *) &curX, sizeof(curX));
baseline += height;
}
- }
+ }
layoutPtr->width = maxWidth;
layoutHeight = baseline - fmPtr->ascent;
@@ -2047,9 +2170,9 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
layoutHeight = height;
/*
- * This fake chunk is used by the other procedures so that they can
- * pretend that there is a chunk with no chars in it, which makes
- * the coding simpler.
+ * This fake chunk is used by the other functions so that they can
+ * pretend that there is a chunk with no chars in it, which makes the
+ * coding simpler.
*/
layoutPtr->numChunks = 1;
@@ -2066,7 +2189,7 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
* Using maximum line length, shift all the chunks so that the lines
* are all justified correctly.
*/
-
+
curLine = 0;
chunkPtr = layoutPtr->chunks;
y = chunkPtr->y;
@@ -2104,8 +2227,8 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
*
* Tk_FreeTextLayout --
*
- * This procedure is called to release the storage associated with
- * a Tk_TextLayout when it is no longer needed.
+ * This function is called to release the storage associated with a
+ * Tk_TextLayout when it is no longer needed.
*
* Results:
* None.
@@ -2117,8 +2240,8 @@ Tk_ComputeTextLayout(tkfont, string, numChars, wrapLength, justify, flags,
*/
void
-Tk_FreeTextLayout(textLayout)
- Tk_TextLayout textLayout; /* The text layout to be released. */
+Tk_FreeTextLayout(
+ Tk_TextLayout textLayout) /* The text layout to be released. */
{
TextLayout *layoutPtr;
@@ -2136,9 +2259,8 @@ Tk_FreeTextLayout(textLayout)
* Use the information in the Tk_TextLayout token to display a
* multi-line, justified string of text.
*
- * This procedure is useful for simple widgets that need to
- * display single-font, multi-line text and want Tk to handle
- * the details.
+ * This function is useful for simple widgets that need to display
+ * single-font, multi-line text and want Tk to handle the details.
*
* Results:
* None.
@@ -2150,25 +2272,25 @@ Tk_FreeTextLayout(textLayout)
*/
void
-Tk_DrawTextLayout(display, drawable, gc, layout, x, y, firstChar, lastChar)
- 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, y; /* Upper-left hand corner of rectangle in
+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. */
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y, /* Upper-left hand corner of rectangle in
* which to draw (pixels). */
- int firstChar; /* The index of the first character to draw
- * from the given text item. 0 specfies the
+ 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. */
+ 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;
int i, numDisplayChars, drawX;
- CONST char *firstByte;
- CONST char *lastByte;
+ const char *firstByte;
+ const char *lastByte;
LayoutChunk *chunkPtr;
layoutPtr = (TextLayout *) layout;
@@ -2214,15 +2336,14 @@ Tk_DrawTextLayout(display, drawable, gc, layout, x, y, firstChar, lastChar)
*
* Tk_UnderlineTextLayout --
*
- * Use the information in the Tk_TextLayout token to display an
- * underline below an individual character. This procedure does
- * not draw the text, just the underline.
+ * Use the information in the Tk_TextLayout token to display an underline
+ * below an individual character. This function does not draw the text,
+ * just the underline.
*
- * This procedure is useful for simple widgets that need to
- * display single-font, multi-line text with an individual
- * character underlined and want Tk to handle the details.
- * To display larger amounts of underlined text, construct
- * and use an underlined font.
+ * This function is useful for simple widgets that need to display
+ * single-font, multi-line text with an individual character underlined
+ * and want Tk to handle the details. To display larger amounts of
+ * underlined text, construct and use an underlined font.
*
* Results:
* None.
@@ -2234,16 +2355,16 @@ Tk_DrawTextLayout(display, drawable, gc, layout, x, y, firstChar, lastChar)
*/
void
-Tk_UnderlineTextLayout(display, drawable, gc, layout, x, y, underline)
- 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, y; /* Upper-left hand corner of rectangle in
+Tk_UnderlineTextLayout(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context to use for drawing text. */
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y, /* Upper-left hand corner of rectangle in
* which to draw (pixels). */
- int underline; /* Index of the single character to
- * underline, or -1 for no underline. */
+ int underline) /* Index of the single character to underline,
+ * or -1 for no underline. */
{
TextLayout *layoutPtr;
TkFont *fontPtr;
@@ -2254,7 +2375,7 @@ Tk_UnderlineTextLayout(display, drawable, gc, layout, x, y, underline)
layoutPtr = (TextLayout *) layout;
fontPtr = (TkFont *) layoutPtr->tkfont;
- XFillRectangle(display, drawable, gc, x + xx,
+ XFillRectangle(display, drawable, gc, x + xx,
y + yy + fontPtr->fm.ascent + fontPtr->underlinePos,
(unsigned int) width, (unsigned int) fontPtr->underlineHeight);
}
@@ -2266,25 +2387,25 @@ Tk_UnderlineTextLayout(display, drawable, gc, layout, x, y, underline)
* Tk_PointToChar --
*
* Use the information in the Tk_TextLayout token to determine the
- * character closest to the given point. The point must be
- * specified with respect to the upper-left hand corner of the
- * text layout, which is considered to be located at (0, 0).
+ * character closest to the given point. The point must be specified with
+ * respect to the upper-left hand corner of the text layout, which is
+ * considered to be located at (0, 0).
*
- * Any point whose y-value is less that 0 will be considered closest
- * to the first character in the text layout; any point whose y-value
- * is greater than the height of the text layout will be considered
- * closest to the last character in the text layout.
+ * Any point whose y-value is less that 0 will be considered closest to
+ * the first character in the text layout; any point whose y-value is
+ * greater than the height of the text layout will be considered closest
+ * to the last character in the text layout.
*
- * Any point whose x-value is less than 0 will be considered closest
- * to the first character on that line; any point whose x-value is
- * greater than the width of the text layout will be considered
- * closest to the last character on that line.
+ * Any point whose x-value is less than 0 will be considered closest to
+ * the first character on that line; any point whose x-value is greater
+ * than the width of the text layout will be considered closest to the
+ * last character on that line.
*
* Results:
- * The return value is the index of the character that was
- * closest to the point. Given a text layout with no characters,
- * the value 0 will always be returned, referring to a hypothetical
- * zero-width placeholder character.
+ * The return value is the index of the character that was closest to the
+ * point. Given a text layout with no characters, the value 0 will always
+ * be returned, referring to a hypothetical zero-width placeholder
+ * character.
*
* Side effects:
* None.
@@ -2293,12 +2414,12 @@ Tk_UnderlineTextLayout(display, drawable, gc, layout, x, y, underline)
*/
int
-Tk_PointToChar(layout, x, y)
- Tk_TextLayout layout; /* Layout information, from a previous call
- * to Tk_ComputeTextLayout(). */
- int x, y; /* Coordinates of point to check, with
- * respect to the upper-left corner of the
- * text layout. */
+Tk_PointToChar(
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int x, int y) /* Coordinates of point to check, with respect
+ * to the upper-left corner of the text
+ * layout. */
{
TextLayout *layoutPtr;
LayoutChunk *chunkPtr, *lastPtr;
@@ -2307,8 +2428,8 @@ Tk_PointToChar(layout, x, y)
if (y < 0) {
/*
- * Point lies above any line in this layout. Return the index of
- * the first char.
+ * Point lies above any line in this layout. Return the index of the
+ * first char.
*/
return 0;
@@ -2327,30 +2448,30 @@ Tk_PointToChar(layout, x, y)
if (y < baseline + fontPtr->fm.descent) {
if (x < chunkPtr->x) {
/*
- * Point is to the left of all chunks on this line. Return
- * the index of the first character on this line.
+ * Point is to the left of all chunks on this line. Return the
+ * index of the first character on this line.
*/
return numChars;
}
if (x >= layoutPtr->width) {
/*
- * If point lies off right side of the text layout, return
- * the last char in the last chunk on this line. Without
- * this, it might return the index of the first char that
- * was located outside of the text layout.
+ * If point lies off right side of the text layout, return the
+ * last char in the last chunk on this line. Without this, it
+ * might return the index of the first char that was located
+ * outside of the text layout.
*/
x = INT_MAX;
}
/*
- * Examine all chunks on this line to see which one contains
- * the specified point.
+ * Examine all chunks on this line to see which one contains the
+ * specified point.
*/
lastPtr = chunkPtr;
- while ((i < layoutPtr->numChunks) && (chunkPtr->y == baseline)) {
+ while ((i < layoutPtr->numChunks) && (chunkPtr->y == baseline)) {
if (x < chunkPtr->x + chunkPtr->totalWidth) {
/*
* Point falls on one of the characters in this chunk.
@@ -2377,7 +2498,7 @@ Tk_PointToChar(layout, x, y)
/*
* Point is to the right of all chars in all the chunks on this
- * line. Return the index just past the last char in the last
+ * line. Return the index just past the last char in the last
* chunk on this line.
*/
@@ -2393,8 +2514,8 @@ Tk_PointToChar(layout, x, y)
}
/*
- * Point lies below any line in this text layout. Return the index
- * just past the last char.
+ * Point lies below any line in this text layout. Return the index just
+ * past the last char.
*/
return (lastPtr->start + lastPtr->numChars) - layoutPtr->string;
@@ -2405,29 +2526,28 @@ Tk_PointToChar(layout, x, y)
*
* Tk_CharBbox --
*
- * Use the information in the Tk_TextLayout token to return the
- * bounding box for the character specified by index.
+ * Use the information in the Tk_TextLayout token to return the bounding
+ * box for the character specified by index.
*
- * The width of the bounding box is the advance width of the
- * character, and does not include and left- or right-bearing.
- * Any character that extends partially outside of the
- * text layout is considered to be truncated at the edge. Any
- * character which is located completely outside of the text
- * layout is considered to be zero-width and pegged against
- * the edge.
+ * The width of the bounding box is the advance width of the character,
+ * and does not include and left- or right-bearing. Any character that
+ * extends partially outside of the text layout is considered to be
+ * truncated at the edge. Any character which is located completely
+ * outside of the text layout is considered to be zero-width and pegged
+ * against the edge.
*
* The height of the bounding box is the line height for this font,
- * extending from the top of the ascent to the bottom of the
- * descent. Information about the actual height of the individual
- * letter is not available.
+ * extending from the top of the ascent to the bottom of the descent.
+ * Information about the actual height of the individual letter is not
+ * available.
+ *
+ * A text layout that contains no characters is considered to contain a
+ * single zero-width placeholder character.
*
- * A text layout that contains no characters is considered to
- * contain a single zero-width placeholder character.
- *
* Results:
- * The return value is 0 if the index did not specify a character
- * in the text layout, or non-zero otherwise. In that case,
- * *bbox is filled with the bounding box of the character.
+ * The return value is 0 if the index did not specify a character in the
+ * text layout, or non-zero otherwise. In that case, *bbox is filled with
+ * the bounding box of the character.
*
* Side effects:
* None.
@@ -2436,25 +2556,26 @@ Tk_PointToChar(layout, x, y)
*/
int
-Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
- Tk_TextLayout layout; /* Layout information, from a previous call to
- * Tk_ComputeTextLayout(). */
- int index; /* The index of the character whose bbox is
- * desired. */
- int *xPtr, *yPtr; /* Filled with the upper-left hand corner, in
- * pixels, of the bounding box for the character
- * specified by index, if non-NULL. */
- int *widthPtr, *heightPtr;
- /* Filled with the width and height of the
- * bounding box for the character specified by
- * index, if non-NULL. */
+Tk_CharBbox(
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ int index, /* The index of the character whose bbox is
+ * desired. */
+ int *xPtr, int *yPtr, /* Filled with the upper-left hand corner, in
+ * pixels, of the bounding box for the
+ * character specified by index, if
+ * non-NULL. */
+ int *widthPtr, int *heightPtr)
+ /* Filled with the width and height of the
+ * bounding box for the character specified by
+ * index, if non-NULL. */
{
TextLayout *layoutPtr;
LayoutChunk *chunkPtr;
- int i, x, w;
+ int i, x = 0, w;
Tk_Font tkfont;
TkFont *fontPtr;
- CONST char *end;
+ const char *end;
if (index < 0) {
return 0;
@@ -2476,7 +2597,7 @@ Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
end = Tcl_UtfAtIndex(chunkPtr->start, index);
if (xPtr != NULL) {
Tk_MeasureChars(tkfont, chunkPtr->start,
- end - chunkPtr->start, -1, 0, &x);
+ end - chunkPtr->start, -1, 0, &x);
x += chunkPtr->x;
}
if (widthPtr != NULL) {
@@ -2488,25 +2609,26 @@ Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
index -= chunkPtr->numChars;
chunkPtr++;
}
- if (index == 0) {
- /*
- * Special case to get location just past last char in layout.
- */
-
- chunkPtr--;
- x = chunkPtr->x + chunkPtr->totalWidth;
- w = 0;
- } else {
+ if (index != 0) {
return 0;
}
/*
- * Ensure that the bbox lies within the text layout. This forces all
- * chars that extend off the right edge of the text layout to have
- * truncated widths, and all chars that are completely off the right
- * edge of the text layout to peg to the edge and have 0 width.
+ * Special case to get location just past last char in layout.
+ */
+
+ chunkPtr--;
+ x = chunkPtr->x + chunkPtr->totalWidth;
+ w = 0;
+
+ /*
+ * Ensure that the bbox lies within the text layout. This forces all chars
+ * that extend off the right edge of the text layout to have truncated
+ * widths, and all chars that are completely off the right edge of the
+ * text layout to peg to the edge and have 0 width.
*/
- check:
+
+ check:
if (yPtr != NULL) {
*yPtr = chunkPtr->y - fontPtr->fm.ascent;
}
@@ -2535,16 +2657,15 @@ Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
*
* Tk_DistanceToTextLayout --
*
- * Computes the distance in pixels from the given point to the
- * given text layout. Non-displaying space characters that occur
- * at the end of individual lines in the text layout are ignored
- * for hit detection purposes.
+ * Computes the distance in pixels from the given point to the given text
+ * layout. Non-displaying space characters that occur at the end of
+ * individual lines in the text layout are ignored for hit detection
+ * purposes.
*
* Results:
- * The return value is 0 if the point (x, y) is inside the text
- * layout. If the point isn't inside the text layout then the
- * return value is the distance in pixels from the point to the
- * text item.
+ * The return value is 0 if the point (x, y) is inside the text layout.
+ * If the point isn't inside the text layout then the return value is the
+ * distance in pixels from the point to the text item.
*
* Side effects:
* None.
@@ -2553,12 +2674,12 @@ Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
*/
int
-Tk_DistanceToTextLayout(layout, x, y)
- Tk_TextLayout layout; /* Layout information, from a previous call
+Tk_DistanceToTextLayout(
+ Tk_TextLayout layout, /* Layout information, from a previous call
* to Tk_ComputeTextLayout(). */
- int x, y; /* Coordinates of point to check, with
- * respect to the upper-left corner of the
- * text layout (in pixels). */
+ int x, int y) /* Coordinates of point to check, with respect
+ * to the upper-left corner of the text layout
+ * (in pixels). */
{
int i, x1, x2, y1, y2, xDiff, yDiff, dist, minDist, ascent, descent;
LayoutChunk *chunkPtr;
@@ -2569,14 +2690,14 @@ Tk_DistanceToTextLayout(layout, x, y)
fontPtr = (TkFont *) layoutPtr->tkfont;
ascent = fontPtr->fm.ascent;
descent = fontPtr->fm.descent;
-
+
minDist = 0;
chunkPtr = layoutPtr->chunks;
for (i = 0; i < layoutPtr->numChunks; i++) {
if (chunkPtr->start[0] == '\n') {
/*
- * Newline characters are not counted when computing distance
- * (but tab characters would still be considered).
+ * Newline characters are not counted when computing distance (but
+ * tab characters would still be considered).
*/
chunkPtr++;
@@ -2620,15 +2741,15 @@ Tk_DistanceToTextLayout(layout, x, y)
*
* Tk_IntersectTextLayout --
*
- * Determines whether a text layout 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.
+ * Determines whether a text layout 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.
+ * 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.
@@ -2637,15 +2758,15 @@ Tk_DistanceToTextLayout(layout, x, y)
*/
int
-Tk_IntersectTextLayout(layout, x, y, width, height)
- Tk_TextLayout layout; /* Layout information, from a previous call
- * to Tk_ComputeTextLayout(). */
- int x, y; /* Upper-left hand corner, in pixels, of
+Tk_IntersectTextLayout(
+ 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, height; /* The width and height of the above
+ * 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. */
{
int result, i, x1, y1, x2, y2;
@@ -2656,19 +2777,19 @@ Tk_IntersectTextLayout(layout, x, y, width, height)
/*
* Scan the chunks one at a time, seeing whether each is entirely in,
- * entirely out, or overlapping the rectangle. If an overlap is
- * detected, return immediately; otherwise wait until all chunks have
- * been processed and see if they were all inside or all outside.
+ * entirely out, or overlapping the rectangle. If an overlap is detected,
+ * return immediately; otherwise wait until all chunks have been processed
+ * and see if they were all inside or all outside.
*/
-
+
layoutPtr = (TextLayout *) layout;
chunkPtr = layoutPtr->chunks;
fontPtr = (TkFont *) layoutPtr->tkfont;
- left = x;
- top = y;
- right = x + width;
- bottom = y + height;
+ left = x;
+ top = y;
+ right = x + width;
+ bottom = y + height;
result = 0;
for (i = 0; i < layoutPtr->numChunks; i++) {
@@ -2711,34 +2832,32 @@ Tk_IntersectTextLayout(layout, x, y, width, height)
*
* Tk_TextLayoutToPostscript --
*
- * Outputs the contents of a text layout in Postscript format.
- * The set of lines in the text layout will be rendered by the user
- * supplied Postscript function. The function should be of the form:
+ * Outputs the contents of a text layout in Postscript format. The set of
+ * lines in the text layout will be rendered by the user supplied
+ * Postscript function. The function should be of the form:
*
- * justify x y string function --
+ * justify x y string function --
*
* Justify is -1, 0, or 1, depending on whether the following string
- * should be left, center, or right justified, x and y is the
- * location for the origin of the string, string is the sequence
- * of characters to be printed, and function is the name of the
- * caller-provided function; the function should leave nothing
- * on the stack.
- *
- * The meaning of the origin of the string (x and y) depends on
- * the justification. For left justification, x is where the
- * left edge of the string should appear. For center justification,
- * x is where the center of the string should appear. And for right
- * justification, x is where the right edge of the string should
- * appear. This behavior is necessary because, for example, right
- * justified text on the screen is justified with screen metrics.
- * The same string needs to be justified with printer metrics on
- * the printer to appear in the correct place with respect to other
- * similarly justified strings. In all circumstances, y is the
- * location of the baseline for the string.
+ * should be left, center, or right justified, x and y is the location
+ * for the origin of the string, string is the sequence of characters to
+ * be printed, and function is the name of the caller-provided function;
+ * the function should leave nothing on the stack.
+ *
+ * The meaning of the origin of the string (x and y) depends on the
+ * justification. For left justification, x is where the left edge of the
+ * string should appear. For center justification, x is where the center
+ * of the string should appear. And for right justification, x is where
+ * the right edge of the string should appear. This behavior is necessary
+ * because, for example, right justified text on the screen is justified
+ * with screen metrics. The same string needs to be justified with
+ * printer metrics on the printer to appear in the correct place with
+ * respect to other similarly justified strings. In all circumstances, y
+ * is the location of the baseline for the string.
*
* Results:
- * The interp's result is modified to hold the Postscript code that
- * will render the text layout.
+ * The interp's result is modified to hold the Postscript code that will
+ * render the text layout.
*
* Side effects:
* None.
@@ -2747,20 +2866,17 @@ Tk_IntersectTextLayout(layout, x, y, width, height)
*/
void
-Tk_TextLayoutToPostscript(interp, layout)
- Tcl_Interp *interp; /* Filled with Postscript code. */
- Tk_TextLayout layout; /* The layout to be rendered. */
+Tk_TextLayoutToPostscript(
+ Tcl_Interp *interp, /* Filled with Postscript code. */
+ Tk_TextLayout layout) /* The layout to be rendered. */
{
#define MAXUSE 128
- char buf[MAXUSE+30];
+ char buf[MAXUSE+30], uindex[5] = "\0\0\0\0", one_char[5];
LayoutChunk *chunkPtr;
- int i, j, used, c, baseline;
+ int i, j, used, c, baseline, charsize;
Tcl_UniChar ch;
- CONST char *p, *last_p,*glyphname;
+ const char *p, *last_p, *glyphname;
TextLayout *layoutPtr;
- char uindex[5]="\0\0\0\0";
- char one_char[5];
- int charsize;
int bytecount=0;
layoutPtr = (TextLayout *) layout;
@@ -2787,23 +2903,24 @@ Tk_TextLayoutToPostscript(interp, layout)
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: 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.
*/
- 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) {
+
+ 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
+ * 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
+ * always generated. Without the "03", a number
* following this sequence could be interpreted by
* Postscript as part of this sequence.
*/
@@ -2814,36 +2931,42 @@ Tk_TextLayoutToPostscript(interp, layout)
buf[used++] = c;
}
} else {
- /* This character doesn't belong to system character set.
- * So, we must use full glyph name */
- sprintf(uindex,"%04X",ch); /* endianness? */
- if ((glyphname = Tcl_GetVar2( interp , "::tk::psglyphs",uindex,0))) {
- if (used > 0 && buf [used-1] == '(')
+ /*
+ * This character doesn't belong to system character set.
+ * So, we must use full glyph name.
+ */
+
+ sprintf(uindex, "%04X", ch); /* endianness? */
+ glyphname = Tcl_GetVar2(interp,"::tk::psglyphs",uindex,0);
+ if (glyphname) {
+ if (used > 0 && buf [used-1] == '(') {
--used;
- else
+ } else {
buf[used++] = ')';
+ }
buf[used++] = '/';
- while( (*glyphname) && (used < (MAXUSE+27)))
+ while ((*glyphname) && (used < (MAXUSE+27))) {
buf[used++] = *glyphname++ ;
+ }
buf[used++] = '(';
}
-
+
}
if (used >= MAXUSE) {
buf[used] = '\0';
- Tcl_AppendResult(interp, buf, (char *) NULL);
+ Tcl_AppendResult(interp, buf, NULL);
used = 0;
}
}
}
if (used >= MAXUSE) {
/*
- * If there are a whole bunch of returns or tabs in a row,
- * then buf[] could get filled up.
+ * If there are a whole bunch of returns or tabs in a row, then
+ * buf[] could get filled up.
*/
-
+
buf[used] = '\0';
- Tcl_AppendResult(interp, buf, (char *) NULL);
+ Tcl_AppendResult(interp, buf, NULL);
used = 0;
}
chunkPtr++;
@@ -2852,7 +2975,7 @@ Tk_TextLayoutToPostscript(interp, layout)
buf[used++] = ']';
buf[used++] = '\n';
buf[used] = '\0';
- Tcl_AppendResult(interp, buf, (char *) NULL);
+ Tcl_AppendResult(interp, buf, NULL);
}
/*
@@ -2864,33 +2987,32 @@ Tk_TextLayoutToPostscript(interp, layout)
* initialized font attributes structure.
*
* Results:
- * A standard Tcl return value. If TCL_ERROR is returned, an
- * error message will be left in interp's result object (if non-NULL).
+ * A standard Tcl return value. If TCL_ERROR is returned, an error
+ * message will be left in interp's result object.
*
* Side effects:
* The fields of the font attributes structure get filled in with
- * information from argc/argv. If an error occurs while parsing,
- * the font attributes structure will contain all modifications
- * specified in the command line options up to the point of the
- * error.
+ * information from argc/argv. If an error occurs while parsing, the font
+ * attributes structure will contain all modifications specified in the
+ * command line options up to the point of the error.
*
*---------------------------------------------------------------------------
*/
static int
-ConfigAttributesObj(interp, tkwin, objc, objv, faPtr)
- Tcl_Interp *interp; /* Interp for error return, or NULL. */
- Tk_Window tkwin; /* For display on which font will be used. */
- int objc; /* Number of elements in argv. */
- Tcl_Obj *CONST objv[]; /* Command line options. */
- TkFontAttributes *faPtr; /* Font attributes structure whose fields
- * are to be modified. Structure must already
- * be properly initialized. */
+ConfigAttributesObj(
+ Tcl_Interp *interp, /* Interp for error return. */
+ Tk_Window tkwin, /* For display on which font will be used. */
+ int objc, /* Number of elements in argv. */
+ Tcl_Obj *const objv[], /* Command line options. */
+ TkFontAttributes *faPtr) /* Font attributes structure whose fields are
+ * to be modified. Structure must already be
+ * properly initialized. */
{
int i, n, index;
Tcl_Obj *optionPtr, *valuePtr;
char *value;
-
+
for (i = 0; i < objc; i += 2) {
optionPtr = objv[i];
valuePtr = objv[i + 1];
@@ -2901,63 +3023,55 @@ ConfigAttributesObj(interp, tkwin, objc, objv, faPtr)
}
if ((i+2 >= objc) && (objc & 1)) {
/*
- * This test occurs after Tcl_GetIndexFromObj() so that
- * "font create xyz -xyz" will return the error message
- * that "-xyz" is a bad option, rather than that the value
- * for "-xyz" is missing.
+ * This test occurs after Tcl_GetIndexFromObj() so that "font
+ * create xyz -xyz" will return the error message that "-xyz" is a
+ * bad option, rather than that the value for "-xyz" is missing.
*/
if (interp != NULL) {
Tcl_AppendResult(interp, "value for \"",
- Tcl_GetString(optionPtr), "\" option missing",
- (char *) NULL);
+ Tcl_GetString(optionPtr), "\" option missing", NULL);
}
return TCL_ERROR;
}
switch (index) {
- case FONT_FAMILY: {
- value = Tcl_GetString(valuePtr);
- faPtr->family = Tk_GetUid(value);
- break;
- }
- case FONT_SIZE: {
- if (Tcl_GetIntFromObj(interp, valuePtr, &n) != TCL_OK) {
- return TCL_ERROR;
- }
- faPtr->size = n;
- break;
+ case FONT_FAMILY:
+ value = Tcl_GetString(valuePtr);
+ faPtr->family = Tk_GetUid(value);
+ break;
+ case FONT_SIZE:
+ if (Tcl_GetIntFromObj(interp, valuePtr, &n) != TCL_OK) {
+ return TCL_ERROR;
}
- case FONT_WEIGHT: {
- n = TkFindStateNumObj(interp, optionPtr, weightMap, valuePtr);
- if (n == TK_FW_UNKNOWN) {
- return TCL_ERROR;
- }
- faPtr->weight = n;
- break;
+ faPtr->size = n;
+ break;
+ case FONT_WEIGHT:
+ n = TkFindStateNumObj(interp, optionPtr, weightMap, valuePtr);
+ if (n == TK_FW_UNKNOWN) {
+ return TCL_ERROR;
}
- case FONT_SLANT: {
- n = TkFindStateNumObj(interp, optionPtr, slantMap, valuePtr);
- if (n == TK_FS_UNKNOWN) {
- return TCL_ERROR;
- }
- faPtr->slant = n;
- break;
+ faPtr->weight = n;
+ break;
+ case FONT_SLANT:
+ n = TkFindStateNumObj(interp, optionPtr, slantMap, valuePtr);
+ if (n == TK_FS_UNKNOWN) {
+ return TCL_ERROR;
}
- case FONT_UNDERLINE: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &n) != TCL_OK) {
- return TCL_ERROR;
- }
- faPtr->underline = n;
- break;
+ faPtr->slant = n;
+ break;
+ case FONT_UNDERLINE:
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &n) != TCL_OK) {
+ return TCL_ERROR;
}
- case FONT_OVERSTRIKE: {
- if (Tcl_GetBooleanFromObj(interp, valuePtr, &n) != TCL_OK) {
- return TCL_ERROR;
- }
- faPtr->overstrike = n;
- break;
+ faPtr->underline = n;
+ break;
+ case FONT_OVERSTRIKE:
+ if (Tcl_GetBooleanFromObj(interp, valuePtr, &n) != TCL_OK) {
+ return TCL_ERROR;
}
+ faPtr->overstrike = n;
+ break;
}
}
return TCL_OK;
@@ -2971,14 +3085,13 @@ ConfigAttributesObj(interp, tkwin, objc, objv, faPtr)
* Return information about the font attributes as a Tcl list.
*
* Results:
- * The return value is TCL_OK if the objPtr was non-NULL and
- * specified a valid font attribute, TCL_ERROR otherwise. If TCL_OK
- * is returned, the interp's result object is modified to hold a
- * description of either the current value of a single option, or a
- * list of all options and their current values for the given font
- * attributes. If TCL_ERROR is returned, the interp's result is
- * set to an error message describing that the objPtr did not refer
- * to a valid option.
+ * The return value is TCL_OK if the objPtr was non-NULL and specified a
+ * valid font attribute, TCL_ERROR otherwise. If TCL_OK is returned, the
+ * interp's result object is modified to hold a description of either the
+ * current value of a single option, or a list of all options and their
+ * current values for the given font attributes. If TCL_ERROR is
+ * returned, the interp's result is set to an error message describing
+ * that the objPtr did not refer to a valid option.
*
* Side effects:
* None.
@@ -2987,16 +3100,16 @@ ConfigAttributesObj(interp, tkwin, objc, objv, faPtr)
*/
static int
-GetAttributeInfoObj(interp, faPtr, objPtr)
- Tcl_Interp *interp; /* Interp to hold result. */
- CONST TkFontAttributes *faPtr; /* The font attributes to inspect. */
- Tcl_Obj *objPtr; /* If non-NULL, indicates the single
- * option whose value is to be
- * returned. Otherwise information is
- * returned for all options. */
+GetAttributeInfoObj(
+ Tcl_Interp *interp, /* Interp to hold result. */
+ const TkFontAttributes *faPtr,
+ /* The font attributes to inspect. */
+ Tcl_Obj *objPtr) /* If non-NULL, indicates the single option
+ * whose value is to be returned. Otherwise
+ * information is returned for all options. */
{
int i, index, start, end;
- CONST char *str;
+ const char *str;
Tcl_Obj *optionPtr, *valuePtr, *resultPtr;
resultPtr = Tcl_GetObjResult(interp);
@@ -3015,32 +3128,32 @@ GetAttributeInfoObj(interp, faPtr, objPtr)
valuePtr = NULL;
for (i = start; i < end; i++) {
switch (i) {
- case FONT_FAMILY:
- str = faPtr->family;
- valuePtr = Tcl_NewStringObj(str, ((str == NULL) ? 0 : -1));
- break;
+ case FONT_FAMILY:
+ str = faPtr->family;
+ valuePtr = Tcl_NewStringObj(str, ((str == NULL) ? 0 : -1));
+ break;
- case FONT_SIZE:
- valuePtr = Tcl_NewIntObj(faPtr->size);
- break;
+ case FONT_SIZE:
+ valuePtr = Tcl_NewIntObj(faPtr->size);
+ break;
- case FONT_WEIGHT:
- str = TkFindStateString(weightMap, faPtr->weight);
- valuePtr = Tcl_NewStringObj(str, -1);
- break;
-
- case FONT_SLANT:
- str = TkFindStateString(slantMap, faPtr->slant);
- valuePtr = Tcl_NewStringObj(str, -1);
- break;
+ case FONT_WEIGHT:
+ str = TkFindStateString(weightMap, faPtr->weight);
+ valuePtr = Tcl_NewStringObj(str, -1);
+ break;
- case FONT_UNDERLINE:
- valuePtr = Tcl_NewBooleanObj(faPtr->underline);
- break;
+ case FONT_SLANT:
+ str = TkFindStateString(slantMap, faPtr->slant);
+ valuePtr = Tcl_NewStringObj(str, -1);
+ break;
- case FONT_OVERSTRIKE:
- valuePtr = Tcl_NewBooleanObj(faPtr->overstrike);
- break;
+ case FONT_UNDERLINE:
+ valuePtr = Tcl_NewBooleanObj(faPtr->underline);
+ break;
+
+ case FONT_OVERSTRIKE:
+ valuePtr = Tcl_NewBooleanObj(faPtr->overstrike);
+ break;
}
if (objPtr != NULL) {
Tcl_SetObjResult(interp, valuePtr);
@@ -3058,8 +3171,8 @@ GetAttributeInfoObj(interp, faPtr, objPtr)
*
* ParseFontNameObj --
*
- * Converts a object into a set of font attributes that can be used
- * to construct a font.
+ * Converts a object into a set of font attributes that can be used to
+ * construct a font.
*
* The string rep of the object can be one of the following forms:
* XLFD (see X documentation)
@@ -3067,10 +3180,10 @@ GetAttributeInfoObj(interp, faPtr, objPtr)
* "-option value [-option value ...]"
*
* Results:
- * The return value is TCL_ERROR if the object was syntactically
- * invalid. In that case an error message is left in interp's
- * result object. Otherwise, fills the font attribute buffer with
- * the values parsed from the string and returns TCL_OK;
+ * The return value is TCL_ERROR if the object was syntactically invalid.
+ * In that case an error message is left in interp's result object.
+ * Otherwise, fills the font attribute buffer with the values parsed from
+ * the string and returns TCL_OK;
*
* Side effects:
* None.
@@ -3079,13 +3192,12 @@ GetAttributeInfoObj(interp, faPtr, objPtr)
*/
static int
-ParseFontNameObj(interp, tkwin, objPtr, faPtr)
- Tcl_Interp *interp; /* Interp for error return, or NULL if no
- * error messages are to be generated. */
- Tk_Window tkwin; /* For display on which font is used. */
- Tcl_Obj *objPtr; /* Parseable font description object. */
- TkFontAttributes *faPtr; /* Filled with attributes parsed from font
- * name. Any attributes that were not
+ParseFontNameObj(
+ Tcl_Interp *interp, /* Interp for error return. */
+ Tk_Window tkwin, /* For display on which font is used. */
+ Tcl_Obj *objPtr, /* Parseable font description object. */
+ TkFontAttributes *faPtr) /* Filled with attributes parsed from font
+ * name. Any attributes that were not
* specified in font name are filled with
* default values. */
{
@@ -3093,7 +3205,7 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
int objc, result, i, n;
Tcl_Obj **objv;
char *string;
-
+
TkInitFontAttributes(faPtr);
string = Tcl_GetString(objPtr);
@@ -3102,7 +3214,7 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
* This may be an XLFD or an "-option value" string.
*
* If the string begins with "-*" or a "-foundry-family-*" pattern,
- * then consider it an XLFD.
+ * then consider it an XLFD.
*/
if (string[1] == '*') {
@@ -3120,13 +3232,13 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
return ConfigAttributesObj(interp, tkwin, objc, objv, faPtr);
}
-
+
if (*string == '*') {
/*
- * This is appears to be an XLFD. Under Unix, all valid XLFDs were
- * already handled by TkpGetNativeFont. If we are here, either we
- * have something that initially looks like an XLFD but isn't or we
- * have encountered an XLFD on Windows or Mac.
+ * This is appears to be an XLFD. Under Unix, all valid XLFDs were
+ * already handled by TkpGetNativeFont. If we are here, either we have
+ * something that initially looks like an XLFD but isn't or we have
+ * encountered an XLFD on Windows or Mac.
*/
xlfd:
@@ -3134,18 +3246,32 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
if (result == TCL_OK) {
return TCL_OK;
}
+
+ /*
+ * If the string failed to parse but was considered to be a XLFD
+ * then it may be a "-option value" string with a hyphenated family
+ * name as per bug 2791352
+ */
+
+ if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (ConfigAttributesObj(interp, tkwin, objc, objv, faPtr) == TCL_OK) {
+ return TCL_OK;
+ }
}
/*
- * Wasn't an XLFD or "-option value" string. Try it as a
- * "font size style" list.
+ * Wasn't an XLFD or "-option value" string. Try it as a "font size style"
+ * list.
*/
if ((Tcl_ListObjGetElements(NULL, objPtr, &objc, &objv) != TCL_OK)
|| (objc < 1)) {
if (interp != NULL) {
Tcl_AppendResult(interp, "font \"", string, "\" doesn't exist",
- (char *) NULL);
+ NULL);
}
return TCL_ERROR;
}
@@ -3193,7 +3319,7 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
if (interp != NULL) {
Tcl_AppendResult(interp, "unknown font style \"",
- Tcl_GetString(objv[i]), "\"", (char *) NULL);
+ Tcl_GetString(objv[i]), "\"", NULL);
}
return TCL_ERROR;
}
@@ -3205,9 +3331,8 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
*
* NewChunk --
*
- * Helper function for Tk_ComputeTextLayout(). Encapsulates a
- * measured set of characters in a chunk that can be quickly
- * drawn.
+ * Helper function for Tk_ComputeTextLayout(). Encapsulates a measured
+ * set of characters in a chunk that can be quickly drawn.
*
* Results:
* A pointer to the new chunk in the text layout.
@@ -3215,28 +3340,28 @@ ParseFontNameObj(interp, tkwin, objPtr, faPtr)
* Side effects:
* The text layout is reallocated to hold more chunks as necessary.
*
- * Currently, Tk_ComputeTextLayout() stores contiguous ranges of
- * "normal" characters in a chunk, along with individual tab
- * and newline chars in their own chunks. All characters in the
- * text layout are accounted for.
+ * Currently, Tk_ComputeTextLayout() stores contiguous ranges of "normal"
+ * characters in a chunk, along with individual tab and newline chars in
+ * their own chunks. All characters in the text layout are accounted for.
*
*---------------------------------------------------------------------------
*/
+
static LayoutChunk *
-NewChunk(layoutPtrPtr, maxPtr, start, numBytes, curX, newX, y)
- TextLayout **layoutPtrPtr;
- int *maxPtr;
- CONST char *start;
- int numBytes;
- int curX;
- int newX;
- int y;
+NewChunk(
+ TextLayout **layoutPtrPtr,
+ int *maxPtr,
+ const char *start,
+ int numBytes,
+ int curX,
+ int newX,
+ int y)
{
TextLayout *layoutPtr;
LayoutChunk *chunkPtr;
int maxChunks, numChars;
size_t s;
-
+
layoutPtr = *layoutPtrPtr;
maxChunks = *maxPtr;
if (layoutPtr->numChunks == maxChunks) {
@@ -3271,8 +3396,8 @@ NewChunk(layoutPtrPtr, maxPtr, start, numBytes, curX, newX, y)
*
* Results:
* Return value is TCL_ERROR if string was not a fully specified XLFD.
- * Otherwise, fills font attribute buffer with the values parsed
- * from the XLFD and returns TCL_OK.
+ * Otherwise, fills font attribute buffer with the values parsed from the
+ * XLFD and returns TCL_OK.
*
* Side effects:
* None.
@@ -3281,25 +3406,25 @@ NewChunk(layoutPtrPtr, maxPtr, start, numBytes, curX, newX, y)
*/
int
-TkFontParseXLFD(string, faPtr, xaPtr)
- CONST char *string; /* Parseable font description string. */
- TkFontAttributes *faPtr; /* Filled with attributes parsed from font
- * name. Any attributes that were not
+TkFontParseXLFD(
+ const char *string, /* Parseable font description string. */
+ TkFontAttributes *faPtr, /* Filled with attributes parsed from font
+ * name. Any attributes that were not
* specified in font name are filled with
* default values. */
- TkXLFDAttributes *xaPtr; /* Filled with X-specific attributes parsed
- * from font name. Any attributes that were
+ TkXLFDAttributes *xaPtr) /* Filled with X-specific attributes parsed
+ * from font name. Any attributes that were
* not specified in font name are filled with
- * default values. May be NULL if such
+ * default values. May be NULL if such
* information is not desired. */
{
char *src;
- CONST char *str;
+ const char *str;
int i, j;
char *field[XLFD_NUMFIELDS + 2];
Tcl_DString ds;
TkXLFDAttributes xa;
-
+
if (xaPtr == NULL) {
xaPtr = &xa;
}
@@ -3338,13 +3463,13 @@ TkFontParseXLFD(string, faPtr, xaPtr)
/*
* An XLFD of the form -adobe-times-medium-r-*-12-*-* is pretty common,
- * but it is (strictly) malformed, because the first * is eliding both
- * the Setwidth and the Addstyle fields. If the Addstyle field is a
- * number, then assume the above incorrect form was used and shift all
- * the rest of the fields right by one, so the number gets interpreted
- * as a pixelsize. This fix is so that we don't get a million reports
- * that "it works under X (as a native font name), but gives a syntax
- * error under Windows (as a parsed set of attributes)".
+ * but it is (strictly) malformed, because the first * is eliding both the
+ * Setwidth and the Addstyle fields. If the Addstyle field is a number,
+ * then assume the above incorrect form was used and shift all the rest of
+ * the fields right by one, so the number gets interpreted as a pixelsize.
+ * This fix is so that we don't get a million reports that "it works under
+ * X (as a native font name), but gives a syntax error under Windows (as a
+ * parsed set of attributes)".
*/
if ((i > XLFD_ADD_STYLE) && (FieldSpecified(field[XLFD_ADD_STYLE]))) {
@@ -3394,8 +3519,8 @@ TkFontParseXLFD(string, faPtr, xaPtr)
/* XLFD_ADD_STYLE ignored. */
/*
- * Pointsize in tenths of a point, but treat it as tenths of a pixel
- * for historical compatibility.
+ * Pointsize in tenths of a point, but treat it as tenths of a pixel for
+ * historical compatibility.
*/
faPtr->size = 12;
@@ -3422,7 +3547,7 @@ TkFontParseXLFD(string, faPtr, xaPtr)
}
/*
- * Pixel height of font. If specified, overrides pointsize.
+ * Pixel height of font. If specified, overrides pointsize.
*/
if (FieldSpecified(field[XLFD_PIXEL_SIZE])) {
@@ -3432,9 +3557,9 @@ TkFontParseXLFD(string, faPtr, xaPtr)
*
* [ N1 N2 N3 N4 ]
*
- * where N1 is the pixel size, and where N2, N3, and N4
- * are some additional numbers that I don't know
- * the purpose of, so I ignore them.
+ * where N1 is the pixel size, and where N2, N3, and N4 are some
+ * additional numbers that I don't know the purpose of, so I
+ * ignore them.
*/
faPtr->size = atoi(field[XLFD_PIXEL_SIZE] + 1);
@@ -3468,12 +3593,12 @@ TkFontParseXLFD(string, faPtr, xaPtr)
*
* FieldSpecified --
*
- * Helper function for TkParseXLFD(). Determines if a field in the
- * XLFD was set to a non-null, non-don't-care value.
+ * Helper function for TkParseXLFD(). Determines if a field in the XLFD
+ * was set to a non-null, non-don't-care value.
*
* Results:
- * The return value is 0 if the field in the XLFD was not set and
- * should be ignored, non-zero otherwise.
+ * The return value is 0 if the field in the XLFD was not set and should
+ * be ignored, non-zero otherwise.
*
* Side effects:
* None.
@@ -3482,11 +3607,12 @@ TkFontParseXLFD(string, faPtr, xaPtr)
*/
static int
-FieldSpecified(field)
- CONST char *field; /* The field of the XLFD to check. Strictly
- * speaking, only when the string is "*" does it mean
- * don't-care. However, an unspecified or question
- * mark is also interpreted as don't-care. */
+FieldSpecified(
+ const char *field) /* The field of the XLFD to check. Strictly
+ * speaking, only when the string is "*" does
+ * it mean don't-care. However, an unspecified
+ * or question mark is also interpreted as
+ * don't-care. */
{
char ch;
@@ -3513,11 +3639,11 @@ FieldSpecified(field)
*
*---------------------------------------------------------------------------
*/
-
+
int
-TkFontGetPixels(tkwin, size)
- Tk_Window tkwin; /* For point->pixel conversion factor. */
- int size; /* Font size. */
+TkFontGetPixels(
+ Tk_Window tkwin, /* For point->pixel conversion factor. */
+ int size) /* Font size. */
{
double d;
@@ -3547,11 +3673,11 @@ TkFontGetPixels(tkwin, size)
*
*---------------------------------------------------------------------------
*/
-
+
int
-TkFontGetPoints(tkwin, size)
- Tk_Window tkwin; /* For pixel->point conversion factor. */
- int size; /* Font size. */
+TkFontGetPoints(
+ Tk_Window tkwin, /* For pixel->point conversion factor. */
+ int size) /* Font size. */
{
double d;
@@ -3570,24 +3696,24 @@ TkFontGetPoints(tkwin, size)
*
* TkFontGetAliasList --
*
- * Given a font name, find the list of all aliases for that font
- * name. One of the names in this list will probably be the name
- * that this platform expects when asking for the font.
+ * Given a font name, find the list of all aliases for that font name.
+ * One of the names in this list will probably be the name that this
+ * platform expects when asking for the font.
*
* Results:
- * As above. The return value is NULL if the font name has no
- * aliases.
+
+ * As above. The return value is NULL if the font name has no aliases.
*
* Side effects:
* None.
*
*-------------------------------------------------------------------------
*/
-
+
char **
-TkFontGetAliasList(faceName)
- CONST char *faceName; /* Font name to test for aliases. */
-{
+TkFontGetAliasList(
+ const char *faceName) /* Font name to test for aliases. */
+{
int i, j;
for (i = 0; fontAliases[i] != NULL; i++) {
@@ -3605,9 +3731,8 @@ TkFontGetAliasList(faceName)
*
* TkFontGetFallbacks --
*
- * Get the list of font fallbacks that the platform-specific code
- * can use to try to find the closest matching font the name
- * requested.
+ * Get the list of font fallbacks that the platform-specific code can use
+ * to try to find the closest matching font the name requested.
*
* Results:
* As above.
@@ -3617,9 +3742,9 @@ TkFontGetAliasList(faceName)
*
*-------------------------------------------------------------------------
*/
-
+
char ***
-TkFontGetFallbacks()
+TkFontGetFallbacks(void)
{
return fontFallbacks;
}
@@ -3642,9 +3767,9 @@ TkFontGetFallbacks()
*
*-------------------------------------------------------------------------
*/
-
+
char **
-TkFontGetGlobalClass()
+TkFontGetGlobalClass(void)
{
return globalFontClass;
}
@@ -3654,8 +3779,8 @@ TkFontGetGlobalClass()
*
* TkFontGetSymbolClass --
*
- * Get the list of fonts that are symbolic; used if the operating
- * system cannot apriori identify symbolic fonts on its own.
+ * Get the list of fonts that are symbolic; used if the operating system
+ * cannot apriori identify symbolic fonts on its own.
*
* Results:
* As above.
@@ -3665,9 +3790,9 @@ TkFontGetGlobalClass()
*
*-------------------------------------------------------------------------
*/
-
+
char **
-TkFontGetSymbolClass()
+TkFontGetSymbolClass(void)
{
return symbolClass;
}
@@ -3677,13 +3802,12 @@ TkFontGetSymbolClass()
*
* TkDebugFont --
*
- * This procedure returns debugging information about a font.
+ * This function returns debugging information about a font.
*
* Results:
* The return value is a list with one sublist for each TkFont
- * corresponding to "name". Each sublist has two elements that
- * contain the resourceRefCount and objRefCount fields from the
- * TkFont structure.
+ * corresponding to "name". Each sublist has two elements that contain
+ * the resourceRefCount and objRefCount fields from the TkFont structure.
*
* Side effects:
* None.
@@ -3692,10 +3816,10 @@ TkFontGetSymbolClass()
*/
Tcl_Obj *
-TkDebugFont(tkwin, name)
- Tk_Window tkwin; /* The window in which the font will be
- * used (not currently used). */
- char *name; /* Name of the desired color. */
+TkDebugFont(
+ Tk_Window tkwin, /* The window in which the font will be used
+ * (not currently used). */
+ char *name) /* Name of the desired color. */
{
TkFont *fontPtr;
Tcl_HashEntry *hashPtr;
@@ -3707,14 +3831,14 @@ TkDebugFont(tkwin, name)
if (hashPtr != NULL) {
fontPtr = (TkFont *) Tcl_GetHashValue(hashPtr);
if (fontPtr == NULL) {
- panic("TkDebugFont found empty hash table entry");
+ Tcl_Panic("TkDebugFont found empty hash table entry");
}
for ( ; (fontPtr != NULL); fontPtr = fontPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewIntObj(fontPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewIntObj(fontPtr->objRefCount));
+ Tcl_NewIntObj(fontPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
@@ -3726,13 +3850,13 @@ TkDebugFont(tkwin, name)
*
* TkFontGetFirstTextLayout --
*
- * This procedure returns the first chunk of a Tk_TextLayout,
- * i.e. until the first font change on the first line (or the
- * whole first line if there is no such font change).
+ * This function returns the first chunk of a Tk_TextLayout, i.e. until
+ * the first font change on the first line (or the whole first line if
+ * there is no such font change).
*
* Results:
- * The return value is the byte length of the chunk, the chunk
- * itself is copied into dst and its Tk_Font into font.
+ * The return value is the byte length of the chunk, the chunk itself is
+ * copied into dst and its Tk_Font into font.
*
* Side effects:
* None.
@@ -3742,21 +3866,20 @@ TkDebugFont(tkwin, name)
int
TkFontGetFirstTextLayout(
- Tk_TextLayout layout, /* Layout information, from a previous call
- * to Tk_ComputeTextLayout(). */
- Tk_Font * font,
- char * dst)
+ Tk_TextLayout layout, /* Layout information, from a previous call to
+ * Tk_ComputeTextLayout(). */
+ Tk_Font *font,
+ char *dst)
{
- TextLayout *layoutPtr;
+ TextLayout *layoutPtr;
LayoutChunk *chunkPtr;
int numBytesInChunk;
layoutPtr = (TextLayout *)layout;
- if ((layoutPtr==NULL)
- || (layoutPtr->numChunks==0)
- || (layoutPtr->chunks->numDisplayChars <= 0)) {
- dst[0] = '\0';
- return 0;
+ if ((layoutPtr==NULL) || (layoutPtr->numChunks==0)
+ || (layoutPtr->chunks->numDisplayChars <= 0)) {
+ dst[0] = '\0';
+ return 0;
}
chunkPtr = layoutPtr->chunks;
numBytesInChunk = chunkPtr->numBytes;
@@ -3764,3 +3887,11 @@ TkFontGetFirstTextLayout(
*font = layoutPtr->tkfont;
return numBytesInChunk;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkFont.h b/generic/tkFont.h
index 71c598c..ef6336c 100644
--- a/generic/tkFont.h
+++ b/generic/tkFont.h
@@ -1,40 +1,40 @@
/*
* tkFont.h --
*
- * Declarations for interfaces between the generic and platform-
- * specific parts of the font package. This information is not
- * visible outside of the font package.
+ * Declarations for interfaces between the generic and platform-specific
+ * parts of the font package. This information is not visible outside of
+ * the font package.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKFONT
#define _TKFONT
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#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
+ * 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
* attributes gotten when the font was instantiated.
*/
-typedef struct TkFontAttributes {
- Tk_Uid family; /* Font family, or NULL to represent
- * plaform-specific default system font. */
+struct TkFontAttributes {
+ Tk_Uid family; /* Font family, or NULL to represent plaform-
+ * specific default system font. */
int size; /* Pointsize of font, 0 for default size, or
* negative number meaning pixel size. */
int weight; /* Weight flag; see below for def'n. */
int slant; /* Slant flag; see below for def'n. */
int underline; /* Non-zero for underline font. */
int overstrike; /* Non-zero for overstrike font. */
-} TkFontAttributes;
+};
/*
* Possible values for the "weight" field in a TkFontAttributes structure.
@@ -45,7 +45,7 @@ typedef struct TkFontAttributes {
#define TK_FW_NORMAL 0
#define TK_FW_BOLD 1
-#define TK_FW_UNKNOWN -1 /* Unknown weight. This value is used for
+#define TK_FW_UNKNOWN -1 /* Unknown weight. This value is used for
* error checking and is never actually stored
* in the weight field. */
@@ -53,21 +53,21 @@ typedef struct TkFontAttributes {
* Possible values for the "slant" field in a TkFontAttributes structure.
*/
-#define TK_FS_ROMAN 0
+#define TK_FS_ROMAN 0
#define TK_FS_ITALIC 1
-#define TK_FS_OBLIQUE 2 /* This value is only used when parsing X
- * font names to determine the closest
- * match. It is only stored in the
- * XLFDAttributes structure, never in the
- * slant field of the TkFontAttributes. */
+#define TK_FS_OBLIQUE 2 /* This value is only used when parsing X font
+ * names to determine the closest match. It is
+ * only stored in the XLFDAttributes
+ * structure, never in the slant field of the
+ * TkFontAttributes. */
-#define TK_FS_UNKNOWN -1 /* Unknown slant. This value is used for
- * error checking and is never actually stored
- * in the slant field. */
+#define TK_FS_UNKNOWN -1 /* Unknown slant. This value is used for error
+ * checking and is never actually stored in
+ * the slant field. */
/*
* The following structure keeps track of the metrics for an instantiated
- * font. The metrics are the physical properties of the font itself.
+ * font. The metrics are the physical properties of the font itself.
*/
typedef struct TkFontMetrics {
@@ -80,9 +80,9 @@ typedef struct TkFontMetrics {
/*
* The following structure is used to keep track of the generic information
- * about a font. Each platform-specific font is represented by a structure
- * with the following structure at its beginning, plus any platform-
- * specific stuff after that.
+ * about a font. Each platform-specific font is represented by a structure
+ * with the following structure at its beginning, plus any platform-specific
+ * stuff after that.
*/
typedef struct TkFont {
@@ -92,14 +92,14 @@ typedef struct TkFont {
int resourceRefCount; /* Number of active uses of this font (each
* active use corresponds to a call to
- * Tk_AllocFontFromTable or Tk_GetFont).
- * If this count is 0, then this TkFont
- * structure is no longer valid and it isn't
- * present in a hash table: it is being
- * kept around only because there are objects
- * referring to it. The structure is freed
- * when resourceRefCount and objRefCount
- * are both 0. */
+ * Tk_AllocFontFromTable or Tk_GetFont). If
+ * this count is 0, then this TkFont structure
+ * is no longer valid and it isn't present in
+ * a hash table: it is being kept around only
+ * because there are objects referring to it.
+ * The structure is freed when
+ * resourceRefCount and objRefCount are both
+ * 0. */
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure,
@@ -110,9 +110,9 @@ typedef struct TkFont {
* was not based on a named font. */
Screen *screen; /* The screen where this font is valid. */
int tabWidth; /* Width of tabs in this font (pixels). */
- int underlinePos; /* Offset from baseline to origin of
- * underline bar (used for drawing underlines
- * on a non-underlined font). */
+ int underlinePos; /* Offset from baseline to origin of underline
+ * bar (used for drawing underlines on a
+ * non-underlined font). */
int underlineHeight; /* Height of underline bar (used for drawing
* underlines on a non-underlined font). */
@@ -122,33 +122,33 @@ typedef struct TkFont {
*/
Font fid; /* For backwards compatibility with XGCValues
- * structures. Remove when TkGCValues is
- * implemented. */
+ * structures. Remove when TkGCValues is
+ * implemented. */
TkFontAttributes fa; /* Actual font attributes obtained when the
* the font was created, as opposed to the
* desired attributes passed in to
- * TkpGetFontFromAttributes(). The desired
+ * TkpGetFontFromAttributes(). The desired
* metrics can be determined from the string
* that was used to create this font. */
TkFontMetrics fm; /* Font metrics determined when font was
* created. */
struct TkFont *nextPtr; /* Points to the next TkFont structure with
- * the same name. All fonts with the
- * same name (but different displays) are
- * chained together off a single entry in
- * a hash table. */
+ * the same name. All fonts with the same name
+ * (but different displays) are chained
+ * together off a single entry in a hash
+ * table. */
} TkFont;
/*
- * The following structure is used to return attributes when parsing an
- * XLFD. The extra information is of interest to the Unix-specific code
- * when attempting to find the closest matching font.
+ * The following structure is used to return attributes when parsing an XLFD.
+ * The extra information is of interest to the Unix-specific code when
+ * attempting to find the closest matching font.
*/
typedef struct TkXLFDAttributes {
Tk_Uid foundry; /* The foundry of the font. */
- int slant; /* The tristate value for the slant, which
- * is significant under X. */
+ int slant; /* The tristate value for the slant, which is
+ * significant under X. */
int setwidth; /* The proportionate width, see below for
* definition. */
Tk_Uid charset; /* The actual charset string. */
@@ -163,8 +163,8 @@ typedef struct TkXLFDAttributes {
#define TK_SW_NORMAL 0
#define TK_SW_CONDENSE 1
#define TK_SW_EXPAND 2
-#define TK_SW_UNKNOWN 3 /* Unknown setwidth. This value may be
- * stored in the setwidth field. */
+#define TK_SW_UNKNOWN 3 /* Unknown setwidth. This value may be stored
+ * in the setwidth field. */
/*
* The following defines specify the meaning of the fields in a fully
@@ -193,34 +193,34 @@ typedef struct TkXLFDAttributes {
#define TkInitFontAttributes(fa) memset((fa), 0, sizeof(TkFontAttributes));
#define TkInitXLFDAttributes(xa) memset((xa), 0, sizeof(TkXLFDAttributes));
-EXTERN int TkFontParseXLFD _ANSI_ARGS_((CONST char *string,
- TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr));
-EXTERN char ** TkFontGetAliasList _ANSI_ARGS_((CONST char *faceName));
-EXTERN char *** TkFontGetFallbacks _ANSI_ARGS_((void));
-EXTERN int TkFontGetPixels _ANSI_ARGS_((Tk_Window tkwin,
- int size));
-EXTERN int TkFontGetPoints _ANSI_ARGS_((Tk_Window tkwin,
- int size));
-EXTERN char ** TkFontGetGlobalClass _ANSI_ARGS_((void));
-EXTERN char ** TkFontGetSymbolClass _ANSI_ARGS_((void));
-EXTERN int TkFontGetFirstTextLayout _ANSI_ARGS_((
- Tk_TextLayout layout, Tk_Font *font, char *dst));
+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 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 int TkCreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *name, TkFontAttributes *faPtr);
+MODULE_SCOPE int TkDeleteNamedFont(Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *name);
+MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout,
+ Tk_Font *font, char *dst);
/*
- * Low-level API exported by platform-specific code to generic code.
+ * Low-level API exported by platform-specific code to generic code.
*/
-EXTERN void TkpDeleteFont _ANSI_ARGS_((TkFont *tkFontPtr));
-EXTERN void TkpFontPkgInit _ANSI_ARGS_((TkMainInfo *mainPtr));
-EXTERN TkFont * TkpGetFontFromAttributes _ANSI_ARGS_((
- TkFont *tkFontPtr, Tk_Window tkwin,
- CONST TkFontAttributes *faPtr));
-EXTERN void TkpGetFontFamilies _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin));
-EXTERN TkFont * TkpGetNativeFont _ANSI_ARGS_((Tk_Window tkwin,
- CONST char *name));
-
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
+MODULE_SCOPE void TkpDeleteFont(TkFont *tkFontPtr);
+MODULE_SCOPE void TkpFontPkgInit(TkMainInfo *mainPtr);
+MODULE_SCOPE TkFont * TkpGetFontFromAttributes(TkFont *tkFontPtr,
+ 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
#endif /* _TKFONT */
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 453ad73..8662dd3 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -1,20 +1,18 @@
-/*
+/*
* tkFrame.c --
*
* This module implements "frame", "labelframe" and "toplevel" widgets
- * for the Tk toolkit. Frames are windows with a background color
- * and possibly a 3-D effect, but not much else in the way of
- * attributes.
+ * for the Tk toolkit. Frames are windows with a background color and
+ * possibly a 3-D effect, but not much else in the way of attributes.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "default.h"
-#include "tkPort.h"
#include "tkInt.h"
/*
@@ -31,29 +29,29 @@ enum FrameType {
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the frame. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up. */
- Display *display; /* Display containing widget. Used, among
+ Tk_Window tkwin; /* Window that embodies the frame. NULL means
+ * that the window has been destroyed but the
+ * data structures haven't yet been cleaned
+ * up. */
+ Display *display; /* Display containing widget. Used, among
* other things, so that resources can be
* freed even after tkwin has gone away. */
- Tcl_Interp *interp; /* Interpreter associated with widget. Used
- * to delete widget command. */
+ Tcl_Interp *interp; /* Interpreter associated with widget. Used to
+ * delete widget command. */
Tcl_Command widgetCmd; /* Token for frame's widget command. */
Tk_OptionTable optionTable; /* Table that defines configuration options
* available for this widget. */
char *className; /* Class name for widget (from configuration
- * option). Malloc-ed. */
+ * option). Malloc-ed. */
enum FrameType type; /* Type of widget, such as TYPE_FRAME. */
- char *screenName; /* Screen on which widget is created. Non-null
- * only for top-levels. Malloc-ed, may be
+ char *screenName; /* Screen on which widget is created. Non-null
+ * only for top-levels. Malloc-ed, may be
* NULL. */
char *visualName; /* Textual description of visual for window,
- * from -visual option. Malloc-ed, may be
+ * from -visual option. Malloc-ed, may be
* NULL. */
char *colormapName; /* Textual description of colormap for window,
- * from -colormap option. Malloc-ed, may be
+ * from -colormap option. Malloc-ed, may be
* NULL. */
char *menuName; /* Textual description of menu to use for
* menubar. Malloc-ed, may be NULL. */
@@ -61,32 +59,32 @@ typedef struct {
* allocated for this window, which must be
* freed when the window is deleted. */
Tk_3DBorder border; /* Structure used to draw 3-D border and
- * background. NULL means no background
- * or border. */
+ * background. NULL means no background or
+ * border. */
int borderWidth; /* Width of 3-D border (if any). */
int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * 0 means don't draw a highlight. */
+ int highlightWidth; /* Width in pixels of highlight to draw around
+ * widget when it has the focus. 0 means don't
+ * draw a highlight. */
XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
+ /* Color for drawing traversal highlight area
+ * when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
- int width; /* Width to request for window. <= 0 means
+ int width; /* Width to request for window. <= 0 means
* don't request any size. */
- int height; /* Height to request for window. <= 0 means
+ int height; /* Height to request for window. <= 0 means
* don't request any size. */
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
int isContainer; /* 1 means this window is a container, 0 means
* that it isn't. */
char *useThis; /* If the window is embedded, this points to
* the name of the window in which it is
- * embedded (malloc'ed). For non-embedded
+ * embedded (malloc'ed). For non-embedded
* windows this is NULL. */
- int flags; /* Various flags; see below for
+ int flags; /* Various flags; see below for
* definitions. */
Tcl_Obj *padXPtr; /* Value of -padx option: specifies how many
* pixels of extra space to leave on left and
@@ -99,46 +97,41 @@ typedef struct {
} Frame;
/*
- * A data structure of the following type is kept for each labelframe
- * widget managed by this file:
+ * A data structure of the following type is kept for each labelframe widget
+ * managed by this file:
*/
typedef struct {
Frame frame; /* A pointer to the generic frame structure.
* This must be the first element of the
* Labelframe. */
-
/*
* Labelframe specific configuration settings.
*/
-
Tcl_Obj *textPtr; /* Value of -text option: specifies text to
* display in button. */
- Tk_Font tkfont; /* Value of -font option: specifies font
- * to use for display text. */
+ Tk_Font tkfont; /* Value of -font option: specifies font to
+ * use for display text. */
XColor *textColorPtr; /* Value of -fg option: specifies foreground
* color in normal mode. */
int labelAnchor; /* Value of -labelanchor option: specifies
* where to place the label. */
- Tk_Window labelWin; /* Value of -labelwidget option: Window to
- * use as label for the frame. */
-
+ Tk_Window labelWin; /* Value of -labelwidget option: Window to use
+ * as label for the frame. */
/*
* Labelframe specific fields for use with configuration settings above.
*/
-
GC textGC; /* GC for drawing text in normal mode. */
Tk_TextLayout textLayout; /* Stored text layout information. */
XRectangle labelBox; /* The label's actual size and position. */
int labelReqWidth; /* The label's requested width. */
int labelReqHeight; /* The label's requested height. */
int labelTextX, labelTextY; /* Position of the text to be drawn. */
-
} Labelframe;
/*
- * The following macros define how many extra pixels to leave
- * around a label's text.
+ * The following macros define how many extra pixels to leave around a label's
+ * text.
*/
#define LABELSPACING 1
@@ -147,20 +140,19 @@ typedef struct {
/*
* Flag bits for frames:
*
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * GOT_FOCUS: Non-zero means this widget currently
- * has the input focus.
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * already been queued to redraw this window.
+ * GOT_FOCUS: Non-zero means this widget currently has the
+ * input focus.
*/
#define REDRAW_PENDING 1
#define GOT_FOCUS 4
/*
- * The following enum is used to define a type for the -labelanchor option
- * of the Labelframe widget. These values are used as indices into the
- * string table below.
+ * The following enum is used to define a type for the -labelanchor option of
+ * the Labelframe widget. These values are used as indices into the string
+ * table below.
*/
enum labelanchor {
@@ -172,32 +164,34 @@ enum labelanchor {
static char *labelAnchorStrings[] = {
"e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws",
- (char *) NULL
+ NULL
};
/*
- * Information used for parsing configuration options. There are
- * one common table used by all and one table for each widget class.
+ * Information used for parsing configuration options. There are one common
+ * table used by all and one table for each widget class.
*/
-static Tk_OptionSpec commonOptSpec[] = {
+static const Tk_OptionSpec commonOptSpec[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_FRAME_BG_COLOR, -1, Tk_Offset(Frame, border),
TK_OPTION_NULL_OK, (ClientData) DEF_FRAME_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_STRING, "-colormap", "colormap", "Colormap",
DEF_FRAME_COLORMAP, -1, Tk_Offset(Frame, colormapName),
TK_OPTION_NULL_OK, 0, 0},
+ /*
+ * Having -container is useless in a labelframe since a container has
+ * no border. It should be deprecated.
+ */
{TK_OPTION_BOOLEAN, "-container", "container", "Container",
- DEF_FRAME_CONTAINER, -1, Tk_Offset(Frame, isContainer),
- 0, 0, 0},
+ DEF_FRAME_CONTAINER, -1, Tk_Offset(Frame, isContainer), 0, 0, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_FRAME_CURSOR, -1, Tk_Offset(Frame, cursor),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-height", "height", "Height",
- DEF_FRAME_HEIGHT, -1, Tk_Offset(Frame, height),
- 0, 0, 0},
+ DEF_FRAME_HEIGHT, -1, Tk_Offset(Frame, height), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, -1,
Tk_Offset(Frame, highlightBgColorPtr), 0, 0, 0},
@@ -220,82 +214,71 @@ static Tk_OptionSpec commonOptSpec[] = {
DEF_FRAME_VISUAL, -1, Tk_Offset(Frame, visualName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-width", "width", "Width",
- DEF_FRAME_WIDTH, -1, Tk_Offset(Frame, width),
- 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, 0, 0}
+ DEF_FRAME_WIDTH, -1, Tk_Offset(Frame, width), 0, 0, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
-static Tk_OptionSpec frameOptSpec[] = {
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+static const Tk_OptionSpec frameOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
- 0, 0, 0},
+ DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0},
{TK_OPTION_STRING, "-class", "class", "Class",
- DEF_FRAME_CLASS, -1, Tk_Offset(Frame, className),
- 0, 0, 0},
+ DEF_FRAME_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief),
- 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+ DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0},
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
};
-static Tk_OptionSpec toplevelOptSpec[] = {
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+static const Tk_OptionSpec toplevelOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
- 0, 0, 0},
+ DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0},
{TK_OPTION_STRING, "-class", "class", "Class",
- DEF_TOPLEVEL_CLASS, -1, Tk_Offset(Frame, className),
- 0, 0, 0},
+ DEF_TOPLEVEL_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0},
{TK_OPTION_STRING, "-menu", "menu", "Menu",
DEF_TOPLEVEL_MENU, -1, Tk_Offset(Frame, menuName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief),
- 0, 0, 0},
+ DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0},
{TK_OPTION_STRING, "-screen", "screen", "Screen",
DEF_TOPLEVEL_SCREEN, -1, Tk_Offset(Frame, screenName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-use", "use", "Use",
DEF_TOPLEVEL_USE, -1, Tk_Offset(Frame, useThis),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
};
-static Tk_OptionSpec labelframeOptSpec[] = {
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+static const Tk_OptionSpec labelframeOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_LABELFRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
- 0, 0, 0},
- {TK_OPTION_STRING, "-class", "class", "Class",
- DEF_LABELFRAME_CLASS, -1, Tk_Offset(Frame, className),
0, 0, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_STRING, "-class", "class", "Class",
+ DEF_LABELFRAME_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_LABELFRAME_FONT, -1, Tk_Offset(Labelframe, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
DEF_LABELFRAME_FG, -1, Tk_Offset(Labelframe, textColorPtr), 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor",
DEF_LABELFRAME_LABELANCHOR, -1, Tk_Offset(Labelframe, labelAnchor),
- 0, (ClientData) labelAnchorStrings, 0},
+ 0, (ClientData) labelAnchorStrings, 0},
{TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget",
- (char *) NULL, -1, Tk_Offset(Labelframe, labelWin),
- TK_OPTION_NULL_OK, 0, 0},
+ NULL, -1, Tk_Offset(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_LABELFRAME_RELIEF, -1, Tk_Offset(Frame, relief),
- 0, 0, 0},
+ DEF_LABELFRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_LABELFRAME_TEXT, Tk_Offset(Labelframe, textPtr), -1,
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
};
/*
@@ -305,48 +288,47 @@ static Tk_OptionSpec labelframeOptSpec[] = {
static char *classNames[] = {"Frame", "Toplevel", "Labelframe"};
/*
- * The following table maps from FrameType to the option template for
- * that class of widgets.
+ * The following table maps from FrameType to the option template for that
+ * class of widgets.
*/
-static Tk_OptionSpec *optionSpecs[] = {
+static const Tk_OptionSpec * const optionSpecs[] = {
frameOptSpec,
toplevelOptSpec,
labelframeOptSpec,
};
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static void ComputeFrameGeometry _ANSI_ARGS_((Frame *framePtr));
-static int ConfigureFrame _ANSI_ARGS_((Tcl_Interp *interp,
- Frame *framePtr, int objc, Tcl_Obj *CONST objv[]));
-static int CreateFrame _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST argv[],
- enum FrameType type, char *appName));
-static void DestroyFrame _ANSI_ARGS_((char *memPtr));
-static void DestroyFramePartly _ANSI_ARGS_((Frame *framePtr));
-static void DisplayFrame _ANSI_ARGS_((ClientData clientData));
-static void FrameCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void FrameEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void FrameLostSlaveProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin));
-static void FrameRequestProc _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
-static void FrameStructureProc _ANSI_ARGS_((
- ClientData clientData, XEvent *eventPtr));
-static int FrameWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static void FrameWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static void MapFrame _ANSI_ARGS_((ClientData clientData));
+static void ComputeFrameGeometry(Frame *framePtr);
+static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr,
+ 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);
+static void DestroyFrame(char *memPtr);
+static void DestroyFramePartly(Frame *framePtr);
+static void DisplayFrame(ClientData clientData);
+static void FrameCmdDeletedProc(ClientData clientData);
+static void FrameEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void FrameLostSlaveProc(ClientData clientData,
+ Tk_Window tkwin);
+static void FrameRequestProc(ClientData clientData,
+ Tk_Window tkwin);
+static void FrameStructureProc(ClientData clientData,
+ XEvent *eventPtr);
+static int FrameWidgetObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static void FrameWorldChanged(ClientData instanceData);
+static void MapFrame(ClientData clientData);
/*
- * The structure below defines frame class behavior by means of procedures
- * that can be invoked from generic window code.
+ * The structure below defines frame class behavior by means of functions that
+ * can be invoked from generic window code.
*/
static Tk_ClassProcs frameClass = {
@@ -355,67 +337,63 @@ static Tk_ClassProcs frameClass = {
};
/*
- * The structure below defines the official type record for the
- * labelframe's geometry manager:
+ * The structure below defines the official type record for the labelframe's
+ * geometry manager:
*/
-static Tk_GeomMgr frameGeomType = {
- "labelframe", /* name */
- FrameRequestProc, /* requestProc */
- FrameLostSlaveProc /* lostSlaveProc */
+static const Tk_GeomMgr frameGeomType = {
+ "labelframe", /* name */
+ FrameRequestProc, /* requestProc */
+ FrameLostSlaveProc /* lostSlaveProc */
};
-
/*
*--------------------------------------------------------------
*
* Tk_FrameObjCmd, Tk_ToplevelObjCmd, Tk_LabelframeObjCmd --
*
- * These procedures are invoked to process the "frame",
- * "toplevel" and "labelframe" Tcl commands. See the user
- * documentation for details on what they do.
+ * These functions are invoked to process the "frame", "toplevel" and
+ * "labelframe" Tcl commands. See the user documentation for details on
+ * what they do.
*
* Results:
* A standard Tcl result.
*
* Side effects:
- * See the user documentation. These procedures are just wrappers;
- * they call CreateFrame to do all of the real work.
+ * See the user documentation. These functions are just wrappers; they
+ * call CreateFrame to do all of the real work.
*
*--------------------------------------------------------------
*/
int
-Tk_FrameObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME,
- (char *) NULL);
+ return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL);
}
int
-Tk_ToplevelObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL,
- (char *) NULL);
+ return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL);
}
int
-Tk_LabelframeObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
- return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME,
- (char *) NULL);
+ return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL);
}
/*
@@ -423,10 +401,10 @@ Tk_LabelframeObjCmd(clientData, interp, objc, objv)
*
* TkCreateFrame --
*
- * This procedure is the old command procedure for the "frame"
- * and "toplevel" commands. Now it is used directly by Tk_Init to
- * create a new main window. See the user documentation for the
- * "frame" and "toplevel" commands for details on what it does.
+ * This function is the old command function for the "frame" and
+ * "toplevel" commands. Now it is used directly by Tk_Init to create a
+ * new main window. See the user documentation for the "frame" and
+ * "toplevel" commands for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -438,20 +416,21 @@ Tk_LabelframeObjCmd(clientData, interp, objc, objv)
*/
int
-TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
- ClientData clientData; /* Either NULL or pointer to option table. */
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
- int toplevel; /* Non-zero means create a toplevel window,
+TkCreateFrame(
+ ClientData clientData, /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ char **argv, /* Argument strings. */
+ int toplevel, /* Non-zero means create a toplevel window,
* zero means create a frame. */
- char *appName; /* Should only be non-NULL if there is no main
+ 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. */
+ * Gives the base name to use for the new
+ * application. */
{
int result, i;
Tcl_Obj **objv = (Tcl_Obj **) ckalloc((argc+1) * sizeof(Tcl_Obj **));
+
for (i=0; i<argc; i++) {
objv[i] = Tcl_NewStringObj(argv[i], -1);
Tcl_IncrRefCount(objv[i]);
@@ -467,23 +446,23 @@ TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
}
static int
-CreateFrame(clientData, interp, objc, objv, type, appName)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
- enum FrameType type; /* What widget type to create. */
- char *appName; /* Should only be non-NULL if there are no
- * Main window associated with the interpreter.
- * Gives the base name to use for the
- * new application. */
+CreateFrame(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ 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
+ * Main window associated with the
+ * interpreter. Gives the base name to use for
+ * the new application. */
{
Tk_Window tkwin;
Frame *framePtr;
Tk_OptionTable optionTable;
- Tk_Window new;
+ Tk_Window newWin;
CONST char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
- int i, c, depth, length;
+ int i, c, length, depth;
unsigned int mask;
Colormap colormap;
Visual *visual;
@@ -494,17 +473,17 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
}
/*
- * Create the option table for this widget class. If it has already
- * been created, the cached pointer will be returned.
+ * Create the option table for this widget class. If it has already been
+ * created, the cached pointer will be returned.
*/
optionTable = Tk_CreateOptionTable(interp, optionSpecs[type]);
/*
- * Pre-process the argument list. Scan through it to find any
- * "-class", "-screen", "-visual", and "-colormap" options. These
- * arguments need to be processed specially, before the window
- * is configured using the usual Tk mechanisms.
+ * Pre-process the argument list. Scan through it to find any "-class",
+ * "-screen", "-visual", and "-colormap" options. These arguments need to
+ * be processed specially, before the window is configured using the usual
+ * Tk mechanisms.
*/
className = colormapName = screenName = visualName = useOption = NULL;
@@ -515,8 +494,8 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
continue;
}
c = arg[1];
- if ((c == 'c') && (strncmp(arg, "-class", (unsigned) length) == 0)
- && (length >= 3)) {
+ if ((c == 'c') && (length >= 3)
+ && (strncmp(arg, "-class", (unsigned) length) == 0)) {
className = Tcl_GetString(objv[i+1]);
} else if ((c == 'c')
&& (strncmp(arg, "-colormap", (unsigned) length) == 0)) {
@@ -534,18 +513,17 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
}
/*
- * Create the window, and deal with the special options -use,
- * -classname, -colormap, -screenname, and -visual. These options
- * must be handle before calling ConfigureFrame below, and they must
- * also be processed in a particular order, for the following
- * reasons:
- * 1. Must set the window's class before calling ConfigureFrame,
- * so that unspecified options are looked up in the option
- * database using the correct class.
- * 2. Must set visual information before calling ConfigureFrame
- * so that colors are allocated in a proper colormap.
+ * Create the window, and deal with the special options -use, -classname,
+ * -colormap, -screenname, and -visual. These options must be handle
+ * before calling ConfigureFrame below, and they must also be processed in
+ * a particular order, for the following reasons:
+ * 1. Must set the window's class before calling ConfigureFrame, so that
+ * unspecified options are looked up in the option database using the
+ * correct class.
+ * 2. Must set visual information before calling ConfigureFrame so that
+ * colors are allocated in a proper colormap.
* 3. Must call TkpUseWindow before setting non-default visual
- * information, since TkpUseWindow changes the defaults.
+ * information, since TkpUseWindow changes the defaults.
*/
if (screenName == NULL) {
@@ -553,88 +531,93 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
}
/*
- * Main window associated with interpreter.
- * If we're called by Tk_Init to create a
- * new application, then this is NULL.
+ * Main window associated with interpreter. If we're called by Tk_Init to
+ * create a new application, then this is NULL.
*/
tkwin = Tk_MainWindow(interp);
if (tkwin != NULL) {
- new = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]),
+ newWin = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]),
screenName);
} else if (appName == NULL) {
/*
- * This occurs when someone tried to create a frame/toplevel
- * while we are being destroyed. Let an error be thrown.
+ * This occurs when someone tried to create a frame/toplevel while we
+ * are being destroyed. Let an error be thrown.
*/
Tcl_AppendResult(interp, "unable to create widget \"",
- Tcl_GetString(objv[1]), "\"", (char *) NULL);
- new = NULL;
+ Tcl_GetString(objv[1]), "\"", NULL);
+ newWin = NULL;
} else {
/*
- * We were called from Tk_Init; create a new application.
+ * We were called from Tk_Init; create a new application.
*/
- new = TkCreateMainWindow(interp, screenName, appName);
+ newWin = TkCreateMainWindow(interp, screenName, appName);
}
- if (new == NULL) {
+ if (newWin == NULL) {
goto error;
+ } else {
+ /*
+ * Mark Tk frames as suitable candidates for [wm manage]
+ */
+ TkWindow *winPtr = (TkWindow *)newWin;
+ winPtr->flags |= TK_WM_MANAGEABLE;
}
if (className == NULL) {
- className = Tk_GetOption(new, "class", "Class");
+ className = Tk_GetOption(newWin, "class", "Class");
if (className == NULL) {
className = classNames[type];
}
}
- Tk_SetClass(new, className);
+ Tk_SetClass(newWin, className);
if (useOption == NULL) {
- useOption = Tk_GetOption(new, "use", "Use");
+ useOption = Tk_GetOption(newWin, "use", "Use");
}
if ((useOption != NULL) && (*useOption != 0)) {
- if (TkpUseWindow(interp, new, useOption) != TCL_OK) {
+ if (TkpUseWindow(interp, newWin, useOption) != TCL_OK) {
goto error;
}
}
if (visualName == NULL) {
- visualName = Tk_GetOption(new, "visual", "Visual");
+ visualName = Tk_GetOption(newWin, "visual", "Visual");
}
if (colormapName == NULL) {
- colormapName = Tk_GetOption(new, "colormap", "Colormap");
+ colormapName = Tk_GetOption(newWin, "colormap", "Colormap");
}
if ((colormapName != NULL) && (*colormapName == 0)) {
colormapName = NULL;
}
if (visualName != NULL) {
- visual = Tk_GetVisual(interp, new, visualName, &depth,
- (colormapName == NULL) ? &colormap : (Colormap *) NULL);
+ visual = Tk_GetVisual(interp, newWin, visualName, &depth,
+ (colormapName == NULL) ? &colormap : NULL);
if (visual == NULL) {
goto error;
}
- Tk_SetWindowVisual(new, visual, depth, colormap);
+ Tk_SetWindowVisual(newWin, visual, depth, colormap);
}
if (colormapName != NULL) {
- colormap = Tk_GetColormap(interp, new, colormapName);
+ colormap = Tk_GetColormap(interp, newWin, colormapName);
if (colormap == None) {
goto error;
}
- Tk_SetWindowColormap(new, colormap);
+ Tk_SetWindowColormap(newWin, colormap);
}
/*
- * For top-level windows, provide an initial geometry request of
- * 200x200, just so the window looks nicer on the screen if it
- * doesn't request a size for itself.
+ * For top-level windows, provide an initial geometry request of 200x200,
+ * just so the window looks nicer on the screen if it doesn't request a
+ * size for itself.
*/
if (type == TYPE_TOPLEVEL) {
- Tk_GeometryRequest(new, 200, 200);
+ Tk_GeometryRequest(newWin, 200, 200);
}
/*
- * Create the widget record, process configuration options, and
- * create event handlers. Then fill in a few additional fields
- * in the widget record from the special options.
+ * Create the widget record, process configuration options, and create
+ * event handlers. Then fill in a few additional fields in the widget
+ * record from the special options.
*/
if (type == TYPE_LABELFRAME) {
@@ -644,11 +627,11 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
framePtr = (Frame *) ckalloc(sizeof(Frame));
memset((void *) framePtr, 0, (sizeof(Frame)));
}
- framePtr->tkwin = new;
- framePtr->display = Tk_Display(new);
+ framePtr->tkwin = newWin;
+ framePtr->display = Tk_Display(newWin);
framePtr->interp = interp;
framePtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(new), FrameWidgetObjCmd,
+ Tk_PathName(newWin), FrameWidgetObjCmd,
(ClientData) framePtr, FrameCmdDeletedProc);
framePtr->optionTable = optionTable;
framePtr->type = type;
@@ -665,14 +648,15 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
/*
* Store backreference to frame widget in window structure.
*/
- Tk_SetClassProcs(new, &frameClass, (ClientData) framePtr);
+
+ Tk_SetClassProcs(newWin, &frameClass, (ClientData) framePtr);
mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
if (type == TYPE_TOPLEVEL) {
- mask |= ActivateMask;
+ mask |= ActivateMask;
}
- Tk_CreateEventHandler(new, mask, FrameEventProc, (ClientData) framePtr);
- if ((Tk_InitOptions(interp, (char *) framePtr, optionTable, new)
+ Tk_CreateEventHandler(newWin, mask, FrameEventProc, (ClientData) framePtr);
+ if ((Tk_InitOptions(interp, (char *) framePtr, optionTable, newWin)
!= TCL_OK) ||
(ConfigureFrame(interp, framePtr, objc-2, objv+2) != TCL_OK)) {
goto error;
@@ -682,19 +666,19 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
TkpMakeContainer(framePtr->tkwin);
} else {
Tcl_AppendResult(interp, "A window cannot have both the -use ",
- "and the -container option set.", (char *) NULL);
+ "and the -container option set.", NULL);
goto error;
}
}
if (type == TYPE_TOPLEVEL) {
Tcl_DoWhenIdle(MapFrame, (ClientData) framePtr);
}
- Tcl_SetResult(interp, Tk_PathName(new), TCL_STATIC);
+ Tcl_SetResult(interp, Tk_PathName(newWin), TCL_STATIC);
return TCL_OK;
- error:
- if (new != NULL) {
- Tk_DestroyWindow(new);
+ error:
+ if (newWin != NULL) {
+ Tk_DestroyWindow(newWin);
}
return TCL_ERROR;
}
@@ -704,9 +688,9 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
*
* FrameWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a frame widget. See the user
- * documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a frame widget. See the user documentation for details on what it
+ * does.
*
* Results:
* A standard Tcl result.
@@ -718,14 +702,14 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
*/
static int
-FrameWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about frame widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+FrameWidgetObjCmd(
+ ClientData clientData, /* Information about frame widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
static CONST char *frameOptions[] = {
- "cget", "configure", (char *) NULL
+ "cget", "configure", NULL
};
enum options {
FRAME_CGET, FRAME_CONFIGURE
@@ -745,27 +729,26 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
}
Tcl_Preserve((ClientData) framePtr);
switch ((enum options) index) {
- case FRAME_CGET: {
+ case FRAME_CGET:
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "option");
result = TCL_ERROR;
goto done;
}
- objPtr = Tk_GetOptionValue(interp, (char *) framePtr,
+ objPtr = Tk_GetOptionValue(interp, (char *) framePtr,
framePtr->optionTable, objv[2], framePtr->tkwin);
- if (objPtr == NULL) {
+ if (objPtr == NULL) {
result = TCL_ERROR;
goto done;
- } else {
+ } else {
Tcl_SetObjResult(interp, objPtr);
- }
+ }
break;
- }
- case FRAME_CONFIGURE: {
+ case FRAME_CONFIGURE:
if (objc <= 3) {
objPtr = Tk_GetOptionInfo(interp, (char *) framePtr,
framePtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
+ (objc == 3) ? objv[2] : NULL,
framePtr->tkwin);
if (objPtr == NULL) {
result = TCL_ERROR;
@@ -775,8 +758,8 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
}
} else {
/*
- * Don't allow the options -class, -colormap, -container,
- * -newcmap, -screen, -use, or -visual to be changed.
+ * Don't allow the options -class, -colormap, -container, -screen,
+ * -use, or -visual to be changed.
*/
for (i = 2; i < objc; i++) {
@@ -785,34 +768,47 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
continue;
}
c = arg[1];
- if (((c == 'c')
- && (strncmp(arg, "-class", (unsigned) length) == 0)
- && (length >= 2))
- || ((c == 'c')
- && (strncmp(arg, "-colormap", (unsigned) length) == 0)
- && (length >= 3))
- || ((c == 'c')
- && (strncmp(arg, "-container", (unsigned) length) == 0)
- && (length >= 3))
- || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL)
- && (strncmp(arg, "-screen", (unsigned) length) == 0))
- || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL)
- && (strncmp(arg, "-use", (unsigned) length) == 0))
- || ((c == 'v')
- && (strncmp(arg, "-visual", (unsigned) length) ==0))) {
- Tcl_AppendResult(interp, "can't modify ", arg,
- " option after widget is created", (char *) NULL);
- result = TCL_ERROR;
- goto done;
+ if (((c == 'c') && (length >= 2)
+ && (strncmp(arg, "-class", (unsigned)length) == 0))
+ || ((c == 'c') && (length >= 3)
+ && (strncmp(arg, "-colormap", (unsigned)length) == 0))
+ || ((c == 'c') && (length >= 3)
+ && (strncmp(arg, "-container", (unsigned)length) == 0))
+ || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL)
+ && (strncmp(arg, "-screen", (unsigned)length) == 0))
+ || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL)
+ && (strncmp(arg, "-use", (unsigned)length) == 0))
+ || ((c == 'v')
+ && (strncmp(arg, "-visual", (unsigned)length) == 0))) {
+
+ #ifdef SUPPORT_CONFIG_EMBEDDED
+ if (c == 'u') {
+ CONST char *string = Tcl_GetString(objv[i+1]);
+ if (TkpUseWindow(interp, framePtr->tkwin,
+ string) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+ } else {
+ Tcl_AppendResult(interp, "can't modify ", arg,
+ " option after widget is created", NULL);
+ result = TCL_ERROR;
+ goto done;
+ }
+ #else
+ Tcl_AppendResult(interp, "can't modify ", arg,
+ " option after widget is created", NULL);
+ result = TCL_ERROR;
+ goto done;
+ #endif
}
}
result = ConfigureFrame(interp, framePtr, objc-2, objv+2);
}
break;
- }
}
- done:
+ done:
Tcl_Release((ClientData) framePtr);
return result;
}
@@ -822,9 +818,9 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
*
* DestroyFrame --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a frame at a safe time
- * (when no-one is using it anymore).
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of a frame at a safe time (when no-one is
+ * using it anymore).
*
* Results:
* None.
@@ -836,8 +832,8 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
*/
static void
-DestroyFrame(memPtr)
- char *memPtr; /* Info about frame widget. */
+DestroyFrame(
+ char *memPtr) /* Info about frame widget. */
{
register Frame *framePtr = (Frame *) memPtr;
register Labelframe *labelframePtr = (Labelframe *) memPtr;
@@ -859,10 +855,9 @@ DestroyFrame(memPtr)
*
* DestroyFramePartly --
*
- * This procedure is invoked to clean up everything that needs
- * tkwin to be defined when deleted. During the destruction
- * process tkwin is always set to NULL and this procedure must
- * be called before that happens.
+ * This function is invoked to clean up everything that needs tkwin to be
+ * defined when deleted. During the destruction process tkwin is always
+ * set to NULL and this function must be called before that happens.
*
* Results:
* None.
@@ -874,16 +869,15 @@ DestroyFrame(memPtr)
*/
static void
-DestroyFramePartly(framePtr)
- Frame *framePtr; /* Info about frame widget. */
+DestroyFramePartly(
+ Frame *framePtr) /* Info about frame widget. */
{
register Labelframe *labelframePtr = (Labelframe *) framePtr;
if (framePtr->type == TYPE_LABELFRAME && labelframePtr->labelWin != NULL) {
Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
FrameStructureProc, (ClientData) framePtr);
- Tk_ManageGeometry(labelframePtr->labelWin, (Tk_GeomMgr *) NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(labelframePtr->labelWin, NULL, (ClientData) NULL);
if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) {
Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin);
}
@@ -892,7 +886,7 @@ DestroyFramePartly(framePtr)
}
Tk_FreeConfigOptions((char *) framePtr, framePtr->optionTable,
- framePtr->tkwin);
+ framePtr->tkwin);
}
/*
@@ -900,29 +894,28 @@ DestroyFramePartly(framePtr)
*
* ConfigureFrame --
*
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a frame widget.
+ * This function is called to process an objv/objc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a frame
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for framePtr; old resources get freed, if there
- * were any.
+ * Configuration information, such as text string, colors, font, etc. get
+ * set for framePtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureFrame(interp, framePtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- register Frame *framePtr; /* Information about widget; may or may
- * not already have values for some fields. */
- int objc; /* Number of valid entries in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments. */
+ConfigureFrame(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register Frame *framePtr, /* Information about widget; may or may not
+ * already have values for some fields. */
+ int objc, /* Number of valid entries in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments. */
{
Tk_SavedOptions savedOptions;
char *oldMenuName;
@@ -932,7 +925,7 @@ ConfigureFrame(interp, framePtr, objc, objv)
/*
* Need the old menubar name for the menu code to delete it.
*/
-
+
if (framePtr->menuName == NULL) {
oldMenuName = NULL;
} else {
@@ -945,7 +938,7 @@ ConfigureFrame(interp, framePtr, objc, objv)
}
if (Tk_SetOptions(interp, (char *) framePtr,
framePtr->optionTable, objc, objv,
- framePtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ framePtr->tkwin, &savedOptions, NULL) != TCL_OK) {
if (oldMenuName != NULL) {
ckfree(oldMenuName);
}
@@ -958,10 +951,11 @@ ConfigureFrame(interp, framePtr, objc, objv)
* A few of the options require additional processing.
*/
- if (((oldMenuName == NULL) && (framePtr->menuName != NULL))
+ if ((((oldMenuName == NULL) && (framePtr->menuName != NULL))
|| ((oldMenuName != NULL) && (framePtr->menuName == NULL))
|| ((oldMenuName != NULL) && (framePtr->menuName != NULL)
- && strcmp(oldMenuName, framePtr->menuName) != 0)) {
+ && strcmp(oldMenuName, framePtr->menuName) != 0))
+ && framePtr->type == TYPE_TOPLEVEL) {
TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName,
framePtr->menuName);
}
@@ -987,8 +981,8 @@ ConfigureFrame(interp, framePtr, objc, objv)
}
/*
- * If a -labelwidget is specified, check that it is valid and set
- * up geometry management for it.
+ * If a -labelwidget is specified, check that it is valid and set up
+ * geometry management for it.
*/
if (framePtr->type == TYPE_LABELFRAME) {
@@ -996,8 +990,7 @@ ConfigureFrame(interp, framePtr, objc, objv)
if (oldWindow != NULL) {
Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
FrameStructureProc, (ClientData) framePtr);
- Tk_ManageGeometry(oldWindow, (Tk_GeomMgr *) NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL);
Tk_UnmaintainGeometry(oldWindow, framePtr->tkwin);
Tk_UnmapWindow(oldWindow);
}
@@ -1005,10 +998,9 @@ ConfigureFrame(interp, framePtr, objc, objv)
Tk_Window ancestor, parent, sibling = NULL;
/*
- * Make sure that the frame is either the parent of the
- * window used as label or a descendant of that
- * parent. Also, don't allow a top-level window to be
- * managed inside the frame.
+ * Make sure that the frame is either the parent of the window
+ * used as label or a descendant of that parent. Also, don't
+ * allow a top-level window to be managed inside the frame.
*/
parent = Tk_Parent(labelframePtr->labelWin);
@@ -1022,7 +1014,7 @@ ConfigureFrame(interp, framePtr, objc, objv)
badWindow:
Tcl_AppendResult(interp, "can't use ",
Tk_PathName(labelframePtr->labelWin),
- " as label in this frame", (char *) NULL);
+ " as label in this frame", NULL);
labelframePtr->labelWin = NULL;
return TCL_ERROR;
}
@@ -1040,9 +1032,8 @@ ConfigureFrame(interp, framePtr, objc, objv)
(ClientData) framePtr);
/*
- * If the frame is not parent to the label, make
- * sure the label is above its sibling in the stacking
- * order.
+ * If the frame is not parent to the label, make sure the
+ * label is above its sibling in the stacking order.
*/
if (sibling != NULL) {
@@ -1062,22 +1053,22 @@ ConfigureFrame(interp, framePtr, objc, objv)
*
* FrameWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Frame will be relayed out and redisplayed.
+ * Frame will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
static void
-FrameWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+FrameWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
Frame *framePtr = (Frame *) instanceData;
Labelframe *labelframePtr = (Labelframe *) framePtr;
@@ -1096,8 +1087,8 @@ FrameWorldChanged(instanceData)
if (framePtr->type == TYPE_LABELFRAME) {
/*
- * The textGC is needed even in the labelWin case, so it's
- * always created for a labelframe.
+ * The textGC is needed even in the labelWin case, so it's always
+ * created for a labelframe.
*/
gcValues.font = Tk_FontId(labelframePtr->tkfont);
@@ -1113,7 +1104,7 @@ FrameWorldChanged(instanceData)
/*
* Calculate label size.
*/
-
+
labelframePtr->labelReqWidth = labelframePtr->labelReqHeight = 0;
if (anyTextLabel) {
@@ -1129,13 +1120,13 @@ FrameWorldChanged(instanceData)
labelframePtr->labelReqHeight = Tk_ReqHeight(labelframePtr->labelWin);
}
- /*
- * Make sure label size is at least as big as the border.
- * This simplifies later calculations and gives a better
- * appearance with thick borders.
+ /*
+ * Make sure label size is at least as big as the border. This
+ * simplifies later calculations and gives a better appearance with
+ * thick borders.
*/
-
- if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
(labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
if (labelframePtr->labelReqHeight < framePtr->borderWidth) {
labelframePtr->labelReqHeight = framePtr->borderWidth;
@@ -1151,34 +1142,34 @@ FrameWorldChanged(instanceData)
* Calculate individual border widths.
*/
- bWidthBottom = bWidthTop = bWidthRight = bWidthLeft =
- framePtr->borderWidth + framePtr->highlightWidth;
+ bWidthBottom = bWidthTop = bWidthRight = bWidthLeft =
+ framePtr->borderWidth + framePtr->highlightWidth;
bWidthLeft += framePtr->padX;
bWidthRight += framePtr->padX;
bWidthTop += framePtr->padY;
bWidthBottom += framePtr->padY;
-
+
if (anyTextLabel || anyWindowLabel) {
switch (labelframePtr->labelAnchor) {
- case LABELANCHOR_E:
- case LABELANCHOR_EN:
- case LABELANCHOR_ES:
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
bWidthRight += labelframePtr->labelReqWidth -
framePtr->borderWidth;
break;
- case LABELANCHOR_N:
- case LABELANCHOR_NE:
- case LABELANCHOR_NW:
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
bWidthTop += labelframePtr->labelReqHeight - framePtr->borderWidth;
break;
- case LABELANCHOR_S:
- case LABELANCHOR_SE:
- case LABELANCHOR_SW:
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
bWidthBottom += labelframePtr->labelReqHeight -
framePtr->borderWidth;
break;
- default:
+ default:
bWidthLeft += labelframePtr->labelReqWidth - framePtr->borderWidth;
break;
}
@@ -1197,11 +1188,12 @@ FrameWorldChanged(instanceData)
int minwidth = labelframePtr->labelReqWidth;
int minheight = labelframePtr->labelReqHeight;
int padding = framePtr->highlightWidth;
+
if (framePtr->borderWidth > 0) {
padding += framePtr->borderWidth + LABELMARGIN;
}
padding *= 2;
- if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
(labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
minwidth += padding;
minheight += framePtr->borderWidth + framePtr->highlightWidth;
@@ -1229,9 +1221,9 @@ FrameWorldChanged(instanceData)
*
* ComputeFrameGeometry --
*
- * This procedure is called to compute various geometrical
- * information for a frame, such as where various things get
- * displayed. It's called when the window is reconfigured.
+ * This function is called to compute various geometrical information for
+ * a frame, such as where various things get displayed. It's called when
+ * the window is reconfigured.
*
* Results:
* None.
@@ -1243,8 +1235,8 @@ FrameWorldChanged(instanceData)
*/
static void
-ComputeFrameGeometry(framePtr)
- register Frame *framePtr; /* Information about widget. */
+ComputeFrameGeometry(
+ register Frame *framePtr) /* Information about widget. */
{
int otherWidth, otherHeight, otherWidthT, otherHeightT, padding;
int maxWidth, maxHeight;
@@ -1256,12 +1248,13 @@ ComputeFrameGeometry(framePtr)
*/
if (framePtr->type != TYPE_LABELFRAME) return;
- if ((labelframePtr->textPtr == NULL) &&
- (labelframePtr->labelWin == NULL)) return;
+ if (labelframePtr->textPtr == NULL && labelframePtr->labelWin == NULL) {
+ return;
+ }
tkwin = framePtr->tkwin;
- /*
+ /*
* Calculate the available size for the label
*/
@@ -1270,15 +1263,15 @@ ComputeFrameGeometry(framePtr)
padding = framePtr->highlightWidth;
if (framePtr->borderWidth > 0) {
- padding += framePtr->borderWidth + LABELMARGIN;
+ padding += framePtr->borderWidth + LABELMARGIN;
}
padding *= 2;
maxHeight = Tk_Height(tkwin);
maxWidth = Tk_Width(tkwin);
- if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
- (labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+ (labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
maxWidth -= padding;
if (maxWidth < 1) maxWidth = 1;
} else {
@@ -1293,9 +1286,9 @@ ComputeFrameGeometry(framePtr)
}
/*
- * Calculate label and text position.
- * The text's position is based on the requested size (= the text's
- * real size) to get proper alignment if the text does not fit.
+ * Calculate label and text position. The text's position is based on the
+ * requested size (= the text's real size) to get proper alignment if the
+ * text does not fit.
*/
otherWidth = Tk_Width(tkwin) - labelframePtr->labelBox.width;
@@ -1305,64 +1298,64 @@ ComputeFrameGeometry(framePtr)
padding = framePtr->highlightWidth;
switch (labelframePtr->labelAnchor) {
- case LABELANCHOR_E:
- case LABELANCHOR_EN:
- case LABELANCHOR_ES:
- labelframePtr->labelTextX = otherWidthT - padding;
- labelframePtr->labelBox.x = otherWidth - padding;
- break;
- case LABELANCHOR_N:
- case LABELANCHOR_NE:
- case LABELANCHOR_NW:
- labelframePtr->labelTextY = padding;
- labelframePtr->labelBox.y = padding;
- break;
- case LABELANCHOR_S:
- case LABELANCHOR_SE:
- case LABELANCHOR_SW:
- labelframePtr->labelTextY = otherHeightT - padding;
- labelframePtr->labelBox.y = otherHeight - padding;
- break;
- default:
- labelframePtr->labelTextX = padding;
- labelframePtr->labelBox.x = padding;
- break;
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
+ labelframePtr->labelTextX = otherWidthT - padding;
+ labelframePtr->labelBox.x = otherWidth - padding;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
+ labelframePtr->labelTextY = padding;
+ labelframePtr->labelBox.y = padding;
+ break;
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
+ labelframePtr->labelTextY = otherHeightT - padding;
+ labelframePtr->labelBox.y = otherHeight - padding;
+ break;
+ default:
+ labelframePtr->labelTextX = padding;
+ labelframePtr->labelBox.x = padding;
+ break;
}
if (framePtr->borderWidth > 0) {
- padding += framePtr->borderWidth + LABELMARGIN;
+ padding += framePtr->borderWidth + LABELMARGIN;
}
switch (labelframePtr->labelAnchor) {
- case LABELANCHOR_NW:
- case LABELANCHOR_SW:
- labelframePtr->labelTextX = padding;
- labelframePtr->labelBox.x = padding;
- break;
- case LABELANCHOR_N:
- case LABELANCHOR_S:
- labelframePtr->labelTextX = otherWidthT / 2;
- labelframePtr->labelBox.x = otherWidth / 2;
- break;
- case LABELANCHOR_NE:
- case LABELANCHOR_SE:
- labelframePtr->labelTextX = otherWidthT - padding;
- labelframePtr->labelBox.x = otherWidth - padding;
- break;
- case LABELANCHOR_EN:
- case LABELANCHOR_WN:
- labelframePtr->labelTextY = padding;
- labelframePtr->labelBox.y = padding;
- break;
- case LABELANCHOR_E:
- case LABELANCHOR_W:
- labelframePtr->labelTextY = otherHeightT / 2;
- labelframePtr->labelBox.y = otherHeight / 2;
- break;
- default:
+ case LABELANCHOR_NW:
+ case LABELANCHOR_SW:
+ labelframePtr->labelTextX = padding;
+ labelframePtr->labelBox.x = padding;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_S:
+ labelframePtr->labelTextX = otherWidthT / 2;
+ labelframePtr->labelBox.x = otherWidth / 2;
+ break;
+ case LABELANCHOR_NE:
+ case LABELANCHOR_SE:
+ labelframePtr->labelTextX = otherWidthT - padding;
+ labelframePtr->labelBox.x = otherWidth - padding;
+ break;
+ case LABELANCHOR_EN:
+ case LABELANCHOR_WN:
+ labelframePtr->labelTextY = padding;
+ labelframePtr->labelBox.y = padding;
+ break;
+ case LABELANCHOR_E:
+ case LABELANCHOR_W:
+ labelframePtr->labelTextY = otherHeightT / 2;
+ labelframePtr->labelBox.y = otherHeight / 2;
+ break;
+ default:
labelframePtr->labelTextY = otherHeightT - padding;
labelframePtr->labelBox.y = otherHeight - padding;
- break;
+ break;
}
}
@@ -1371,21 +1364,20 @@ ComputeFrameGeometry(framePtr)
*
* DisplayFrame --
*
- * This procedure is invoked to display a frame widget.
+ * This function is invoked to display a frame widget.
*
* Results:
* None.
*
* Side effects:
- * Commands are output to X to display the frame in its
- * current mode.
+ * Commands are output to X to display the frame in its current mode.
*
*----------------------------------------------------------------------
*/
static void
-DisplayFrame(clientData)
- ClientData clientData; /* Information about widget. */
+DisplayFrame(
+ ClientData clientData) /* Information about widget. */
{
register Frame *framePtr = (Frame *) clientData;
register Tk_Window tkwin = framePtr->tkwin;
@@ -1394,8 +1386,7 @@ DisplayFrame(clientData)
TkRegion clipRegion = NULL;
framePtr->flags &= ~REDRAW_PENDING;
- if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)
- || framePtr->isContainer) {
+ if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
return;
}
@@ -1406,7 +1397,7 @@ DisplayFrame(clientData)
hlWidth = framePtr->highlightWidth;
if (hlWidth != 0) {
- GC fgGC, bgGC;
+ GC fgGC, bgGC;
bgGC = Tk_GCForColor(framePtr->highlightBgColorPtr,
Tk_WindowId(tkwin));
@@ -1429,11 +1420,11 @@ DisplayFrame(clientData)
if (framePtr->type != TYPE_LABELFRAME) {
/*
- * Pass to platform specific draw function. In general, it just
- * draws a simple rectangle, but it may "theme" the background.
+ * Pass to platform specific draw function. In general, it just draws
+ * a simple rectangle, but it may "theme" the background.
*/
- noLabel:
+ noLabel:
TkpDrawFrame(tkwin, framePtr->border, hlWidth,
framePtr->borderWidth, framePtr->relief);
} else {
@@ -1446,10 +1437,10 @@ DisplayFrame(clientData)
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * In order to avoid screen flashes, this procedure redraws the
- * frame into off-screen memory, then copies it back on-screen
- * in a single operation. This means there's no point in time
- * where the on-screen image has been cleared.
+ * In order to avoid screen flashes, this function redraws the frame
+ * into off-screen memory, then copies it back on-screen in a single
+ * operation. This means there's no point in time where the on-screen
+ * image has been cleared.
*/
pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin),
@@ -1458,7 +1449,7 @@ DisplayFrame(clientData)
pixmap = Tk_WindowId(tkwin);
#endif /* TK_NO_DOUBLE_BUFFERING */
- /*
+ /*
* Clear the pixmap.
*/
@@ -1474,61 +1465,56 @@ DisplayFrame(clientData)
bdY2 = Tk_Height(tkwin) - hlWidth;
switch (labelframePtr->labelAnchor) {
- case LABELANCHOR_E:
- case LABELANCHOR_EN:
- case LABELANCHOR_ES:
- bdX2 -= (labelframePtr->labelBox.width - framePtr->borderWidth)
- / 2;
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
+ bdX2 -= (labelframePtr->labelBox.width-framePtr->borderWidth) / 2;
break;
- case LABELANCHOR_N:
- case LABELANCHOR_NE:
- case LABELANCHOR_NW:
- /*
- * Since the glyphs of the text tend to be in the lower part
- * we favor a lower border position by rounding up.
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
+ /*
+ * Since the glyphs of the text tend to be in the lower part we
+ * favor a lower border position by rounding up.
*/
- bdY1 += (labelframePtr->labelBox.height - framePtr->borderWidth +1)
- / 2;
+ bdY1 += (labelframePtr->labelBox.height-framePtr->borderWidth+1)/2;
break;
- case LABELANCHOR_S:
- case LABELANCHOR_SE:
- case LABELANCHOR_SW:
- bdY2 -= (labelframePtr->labelBox.height - framePtr->borderWidth)
- / 2;
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
+ bdY2 -= (labelframePtr->labelBox.height-framePtr->borderWidth) / 2;
break;
- default:
- bdX1 += (labelframePtr->labelBox.width - framePtr->borderWidth)
- / 2;
+ default:
+ bdX1 += (labelframePtr->labelBox.width-framePtr->borderWidth) / 2;
break;
}
- /*
- * Draw border
- */
+ /*
+ * Draw border
+ */
Tk_Draw3DRectangle(tkwin, pixmap, framePtr->border, bdX1, bdY1,
bdX2 - bdX1, bdY2 - bdY1, framePtr->borderWidth,
framePtr->relief);
- if (labelframePtr->labelWin == NULL) {
- /*
- * Clear behind the label
- */
-
- Tk_Fill3DRectangle(tkwin, pixmap,
- framePtr->border, labelframePtr->labelBox.x,
- labelframePtr->labelBox.y, labelframePtr->labelBox.width,
- labelframePtr->labelBox.height, 0, TK_RELIEF_FLAT);
-
- /*
- * Draw label.
- * If there is not room for the entire label, use clipping to
- * get a nice appearance.
- */
-
+ if (labelframePtr->labelWin == NULL) {
+ /*
+ * Clear behind the label
+ */
+
+ Tk_Fill3DRectangle(tkwin, pixmap,
+ framePtr->border, labelframePtr->labelBox.x,
+ labelframePtr->labelBox.y, labelframePtr->labelBox.width,
+ labelframePtr->labelBox.height, 0, TK_RELIEF_FLAT);
+
+ /*
+ * Draw label. If there is not room for the entire label, use
+ * clipping to get a nice appearance.
+ */
+
if ((labelframePtr->labelBox.width < labelframePtr->labelReqWidth)
- || (labelframePtr->labelBox.height <
+ || (labelframePtr->labelBox.height <
labelframePtr->labelReqHeight)) {
clipRegion = TkCreateRegion();
TkUnionRectWithRegion(&labelframePtr->labelBox, clipRegion,
@@ -1537,37 +1523,37 @@ DisplayFrame(clientData)
clipRegion);
}
- Tk_DrawTextLayout(framePtr->display, pixmap,
- labelframePtr->textGC, labelframePtr->textLayout,
- labelframePtr->labelTextX + LABELSPACING,
- labelframePtr->labelTextY + LABELSPACING, 0, -1);
+ Tk_DrawTextLayout(framePtr->display, pixmap,
+ labelframePtr->textGC, labelframePtr->textLayout,
+ labelframePtr->labelTextX + LABELSPACING,
+ labelframePtr->labelTextY + LABELSPACING, 0, -1);
if (clipRegion != NULL) {
XSetClipMask(framePtr->display, labelframePtr->textGC, None);
TkDestroyRegion(clipRegion);
}
- } else {
+ } else {
/*
* Reposition and map the window (but in different ways depending
* on whether the frame is the window's parent).
*/
-
+
if (framePtr->tkwin == Tk_Parent(labelframePtr->labelWin)) {
if ((labelframePtr->labelBox.x != Tk_X(labelframePtr->labelWin))
|| (labelframePtr->labelBox.y !=
Tk_Y(labelframePtr->labelWin))
- || (labelframePtr->labelBox.width !=
+ || (labelframePtr->labelBox.width !=
Tk_Width(labelframePtr->labelWin))
- || (labelframePtr->labelBox.height !=
+ || (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);
}
Tk_MapWindow(labelframePtr->labelWin);
} else {
- Tk_MaintainGeometry(labelframePtr->labelWin, framePtr->tkwin,
+ Tk_MaintainGeometry(labelframePtr->labelWin, framePtr->tkwin,
labelframePtr->labelBox.x, labelframePtr->labelBox.y,
labelframePtr->labelBox.width,
labelframePtr->labelBox.height);
@@ -1577,7 +1563,7 @@ DisplayFrame(clientData)
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * Everything's been redisplayed; now copy the pixmap onto the screen
+ * Everything's been redisplayed; now copy the pixmap onto the screen
* and free up the pixmap.
*/
@@ -1597,24 +1583,24 @@ DisplayFrame(clientData)
*
* FrameEventProc --
*
- * This procedure is invoked by the Tk dispatcher on
- * structure changes to a frame. For frames with 3D
- * borders, this procedure is also invoked for exposures.
+ * This function is invoked by the Tk dispatcher on structure changes to
+ * a frame. For frames with 3D borders, this function is also invoked for
+ * exposures.
*
* Results:
* None.
*
* Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
+ * When the window gets deleted, internal structures get cleaned up.
+ * When it gets exposed, it is redisplayed.
*
*--------------------------------------------------------------
*/
static void
-FrameEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- register XEvent *eventPtr; /* Information about event. */
+FrameEventProc(
+ ClientData clientData, /* Information about window. */
+ register XEvent *eventPtr) /* Information about event. */
{
register Frame *framePtr = (Frame *) clientData;
@@ -1631,15 +1617,14 @@ FrameEventProc(clientData, eventPtr)
framePtr->menuName = NULL;
}
if (framePtr->tkwin != NULL) {
-
/*
- * If this window is a container, then this event could be
- * coming from the embedded application, in which case
- * Tk_DestroyWindow hasn't been called yet. When Tk_DestroyWindow
- * is called later, then another destroy event will be generated.
- * We need to be sure we ignore the second event, since the frame
- * could be gone by then. To do so, delete the event handler
- * explicitly (normally it's done implicitly by Tk_DestroyWindow).
+ * If this window is a container, then this event could be coming
+ * from the embedded application, in which case Tk_DestroyWindow
+ * hasn't been called yet. When Tk_DestroyWindow is called later,
+ * then another destroy event will be generated. We need to be
+ * sure we ignore the second event, since the frame could be gone
+ * by then. To do so, delete the event handler explicitly
+ * (normally it's done implicitly by Tk_DestroyWindow).
*/
/*
@@ -1647,13 +1632,13 @@ FrameEventProc(clientData, eventPtr)
* DestroyFrame, we must free all options now.
*/
- DestroyFramePartly(framePtr);
+ DestroyFramePartly(framePtr);
Tk_DeleteEventHandler(framePtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
FrameEventProc, (ClientData) framePtr);
framePtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(framePtr->interp, framePtr->widgetCmd);
+ Tcl_DeleteCommandFromToken(framePtr->interp, framePtr->widgetCmd);
}
if (framePtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(DisplayFrame, (ClientData) framePtr);
@@ -1680,7 +1665,7 @@ FrameEventProc(clientData, eventPtr)
}
return;
- redraw:
+ redraw:
if ((framePtr->tkwin != NULL) && !(framePtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr);
framePtr->flags |= REDRAW_PENDING;
@@ -1692,9 +1677,9 @@ FrameEventProc(clientData, eventPtr)
*
* FrameCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -1706,8 +1691,8 @@ FrameEventProc(clientData, eventPtr)
*/
static void
-FrameCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+FrameCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
Frame *framePtr = (Frame *) clientData;
Tk_Window tkwin = framePtr->tkwin;
@@ -1720,19 +1705,19 @@ FrameCmdDeletedProc(clientData)
}
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (tkwin != NULL) {
- /*
- * Some options need tkwin to be freed, so we free them here,
- * before setting tkwin to NULL.
+ /*
+ * Some options need tkwin to be freed, so we free them here, before
+ * setting tkwin to NULL.
*/
- DestroyFramePartly(framePtr);
+ DestroyFramePartly(framePtr);
framePtr->tkwin = NULL;
Tk_DestroyWindow(tkwin);
@@ -1744,8 +1729,8 @@ FrameCmdDeletedProc(clientData)
*
* MapFrame --
*
- * This procedure is invoked as a when-idle handler to map a
- * newly-created top-level frame.
+ * This function is invoked as a when-idle handler to map a newly-created
+ * top-level frame.
*
* Results:
* None.
@@ -1757,16 +1742,16 @@ FrameCmdDeletedProc(clientData)
*/
static void
-MapFrame(clientData)
- ClientData clientData; /* Pointer to frame structure. */
+MapFrame(
+ ClientData clientData) /* Pointer to frame structure. */
{
Frame *framePtr = (Frame *) clientData;
/*
- * Wait for all other background events to be processed before
- * mapping window. This ensures that the window's correct geometry
- * will have been determined before it is first mapped, so that the
- * window manager doesn't get a false idea of its desired geometry.
+ * Wait for all other background events to be processed before mapping
+ * window. This ensures that the window's correct geometry will have been
+ * determined before it is first mapped, so that the window manager
+ * doesn't get a false idea of its desired geometry.
*/
Tcl_Preserve((ClientData) framePtr);
@@ -1776,8 +1761,8 @@ MapFrame(clientData)
}
/*
- * After each event, make sure that the window still exists
- * and quit if the window has been destroyed.
+ * After each event, make sure that the window still exists and quit
+ * if the window has been destroyed.
*/
if (framePtr->tkwin == NULL) {
@@ -1794,24 +1779,23 @@ MapFrame(clientData)
*
* TkInstallFrameMenu --
*
- * This function is needed when a Windows HWND is created
- * and a menubar has been set to the window with a system
- * menu. It notifies the menu package so that the system
- * menu can be rebuilt.
+ * This function is needed when a Windows HWND is created and a menubar
+ * has been set to the window with a system menu. It notifies the menu
+ * package so that the system menu can be rebuilt.
*
* Results:
* None.
*
* Side effects:
- * The system menu (if any) is created for the menubar
- * associated with this frame.
+ * The system menu (if any) is created for the menubar associated with
+ * this frame.
*
*--------------------------------------------------------------
*/
void
-TkInstallFrameMenu(tkwin)
- Tk_Window tkwin; /* The window that was just created. */
+TkInstallFrameMenu(
+ Tk_Window tkwin) /* The window that was just created. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -1819,9 +1803,9 @@ TkInstallFrameMenu(tkwin)
Frame *framePtr;
framePtr = (Frame*) winPtr->instanceData;
if (framePtr == NULL) {
- panic("TkInstallFrameMenu couldn't get frame pointer");
+ Tcl_Panic("TkInstallFrameMenu couldn't get frame pointer");
}
- TkpMenuNotifyToplevelCreate(winPtr->mainPtr->interp,
+ TkpMenuNotifyToplevelCreate(winPtr->mainPtr->interp,
framePtr->menuName);
}
}
@@ -1831,32 +1815,30 @@ TkInstallFrameMenu(tkwin)
*
* FrameStructureProc --
*
- * This procedure is invoked whenever StructureNotify events
- * occur for a window that's managed as label for the frame.
- * This procudure's only purpose is to clean up when windows
- * are deleted.
+ * This function is invoked whenever StructureNotify events occur for a
+ * window that's managed as label for the frame. This procudure's only
+ * purpose is to clean up when windows are deleted.
*
* Results:
* None.
*
* Side effects:
- * The window is disassociated from the frame when it is
- * deleted.
+ * The window is disassociated from the frame when it is deleted.
*
*--------------------------------------------------------------
*/
static void
-FrameStructureProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to record describing frame. */
- XEvent *eventPtr; /* Describes what just happened. */
+FrameStructureProc(
+ ClientData clientData, /* Pointer to record describing frame. */
+ XEvent *eventPtr) /* Describes what just happened. */
{
Labelframe *labelframePtr = (Labelframe *) clientData;
if (eventPtr->type == DestroyNotify) {
/*
- * This should only happen in a labelframe but it doesn't
- * hurt to be careful.
+ * This should only happen in a labelframe but it doesn't hurt to be
+ * careful.
*/
if (labelframePtr->frame.type == TYPE_LABELFRAME) {
@@ -1871,24 +1853,23 @@ FrameStructureProc(clientData, eventPtr)
*
* FrameRequestProc --
*
- * This procedure is invoked whenever a window that's associated
- * with a frame changes its requested dimensions.
+ * This function is invoked whenever a window that's associated with a
+ * frame changes its requested dimensions.
*
* Results:
* None.
*
* Side effects:
- * The size and location on the screen of the window may change.
- * depending on the options specified for the frame.
+ * The size and location on the screen of the window may change depending
+ * on the options specified for the frame.
*
*--------------------------------------------------------------
*/
static void
-FrameRequestProc(clientData, tkwin)
- ClientData clientData; /* Pointer to record for frame. */
- Tk_Window tkwin; /* Window that changed its desired
- * size. */
+FrameRequestProc(
+ ClientData clientData, /* Pointer to record for frame. */
+ Tk_Window tkwin) /* Window that changed its desired size. */
{
Frame *framePtr = (Frame *) clientData;
@@ -1900,8 +1881,8 @@ FrameRequestProc(clientData, tkwin)
*
* FrameLostSlaveProc --
*
- * This procedure is invoked by Tk whenever some other geometry
- * claims control over a slave that used to be managed by us.
+ * This function is invoked by Tk whenever some other geometry claims
+ * control over a slave that used to be managed by us.
*
* Results:
* None.
@@ -1913,19 +1894,19 @@ FrameRequestProc(clientData, tkwin)
*/
static void
-FrameLostSlaveProc(clientData, tkwin)
- ClientData clientData; /* Frame structure for slave window that
- * was stolen away. */
- Tk_Window tkwin; /* Tk's handle for the slave window. */
+FrameLostSlaveProc(
+ ClientData clientData, /* Frame structure for slave window that was
+ * stolen away. */
+ Tk_Window tkwin) /* Tk's handle for the slave window. */
{
Frame *framePtr = (Frame *) clientData;
Labelframe *labelframePtr = (Labelframe *) clientData;
/*
- * This should only happen in a labelframe but it doesn't
- * hurt to be careful.
+ * This should only happen in a labelframe but it doesn't hurt to be
+ * careful.
*/
-
+
if (labelframePtr->frame.type == TYPE_LABELFRAME) {
Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
FrameStructureProc, (ClientData) labelframePtr);
@@ -1938,20 +1919,46 @@ FrameLostSlaveProc(clientData, tkwin)
FrameWorldChanged((ClientData) framePtr);
}
+void
+TkMapTopFrame (tkwin)
+ Tk_Window tkwin;
+{
+ 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);
+ if (framePtr->menuName != NULL) {
+ TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL,
+ framePtr->menuName);
+ }
+ } else if (!Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_TOPLEVEL) {
+ framePtr->type = TYPE_FRAME;
+ } else {
+ /* Not a frame or toplevel, skip it */
+ return;
+ }
+ /*
+ * The option table has already been created so
+ * the cached pointer will be returned.
+ */
+ optionTable = Tk_CreateOptionTable(framePtr->interp, optionSpecs[framePtr->type]);
+ framePtr->optionTable = optionTable;
+}
+
/*
*--------------------------------------------------------------
*
* TkToplevelWindowFromCommandToken --
*
- * If the given command name to the command for a toplevel window
- * in the given interpreter, return the tkwin for that toplevel
- * window. Note that this lookup can't be done using the
- * standard tkwin internal table because the command might have
- * been renamed.
+ * If the given command name to the command for a toplevel window in the
+ * given interpreter, return the tkwin for that toplevel window. Note
+ * that this lookup can't be done using the standard tkwin internal table
+ * because the command might have been renamed.
*
* Results:
- * A Tk_Window token, or NULL if the name does not refer to a
- * toplevel window.
+ * A Tk_Window token, or NULL if the name does not refer to a toplevel
+ * window.
*
* Side effects:
* None.
@@ -1960,9 +1967,9 @@ FrameLostSlaveProc(clientData, tkwin)
*/
Tk_Window
-TkToplevelWindowForCommand(interp, cmdName)
- Tcl_Interp *interp;
- CONST char *cmdName;
+TkToplevelWindowForCommand(
+ Tcl_Interp *interp,
+ CONST char *cmdName)
{
Tcl_CmdInfo cmdInfo;
Frame *framePtr;
@@ -1979,3 +1986,11 @@ TkToplevelWindowForCommand(interp, cmdName)
}
return framePtr->tkwin;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkGC.c b/generic/tkGC.c
index 46a3a56..800e4d3 100644
--- a/generic/tkGC.c
+++ b/generic/tkGC.c
@@ -1,24 +1,23 @@
-/*
+/*
* tkGC.c --
*
- * This file maintains a database of read-only graphics contexts
- * for the Tk toolkit, in order to allow GC's to be shared.
+ * This file maintains a database of read-only graphics contexts for the
+ * Tk toolkit, in order to allow GC's to be shared.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
- * One of the following data structures exists for each GC that is
- * currently active. The structure is indexed with two hash tables,
- * one based on the values in the graphics context and the other
- * based on the display and GC identifier.
+ * One of the following data structures exists for each GC that is currently
+ * active. The structure is indexed with two hash tables, one based on the
+ * values in the graphics context and the other based on the display and GC
+ * identifier.
*/
typedef struct {
@@ -37,48 +36,48 @@ typedef struct {
} ValueKey;
/*
- * Forward declarations for procedures defined in this file:
+ * Forward declarations for functions defined in this file:
*/
-static void GCInit _ANSI_ARGS_((TkDisplay *dispPtr));
+static void GCInit(TkDisplay *dispPtr);
/*
*----------------------------------------------------------------------
*
* Tk_GetGC --
*
- * Given a desired set of values for a graphics context, find
- * a read-only graphics context with the desired values.
+ * Given a desired set of values for a graphics context, find a read-only
+ * graphics context with the desired values.
*
* Results:
- * The return value is the X identifer for the desired graphics
- * context. The caller should never modify this GC, and should
- * call Tk_FreeGC when the GC is no longer needed.
+ * The return value is the X identifer for the desired graphics context.
+ * The caller should never modify this GC, and should call Tk_FreeGC when
+ * the GC is no longer needed.
*
* Side effects:
- * The GC is added to an internal database with a reference count.
- * For each call to this procedure, there should eventually be a call
- * to Tk_FreeGC, so that the database can be cleaned up when GC's
- * aren't needed anymore.
+ * The GC is added to an internal database with a reference count. For
+ * each call to this function, there should eventually be a call to
+ * Tk_FreeGC, so that the database can be cleaned up when GC's aren't
+ * needed anymore.
*
*----------------------------------------------------------------------
*/
GC
-Tk_GetGC(tkwin, valueMask, valuePtr)
- Tk_Window tkwin; /* Window in which GC will be used. */
- register unsigned long valueMask;
- /* 1 bits correspond to values specified
- * in *valuesPtr; other values are set
- * from defaults. */
- register XGCValues *valuePtr;
- /* Values are specified here for bits set
- * in valueMask. */
+Tk_GetGC(
+ Tk_Window tkwin, /* Window in which GC will be used. */
+ register unsigned long valueMask,
+ /* 1 bits correspond to values specified in
+ * *valuesPtr; other values are set from
+ * defaults. */
+ register XGCValues *valuePtr)
+ /* Values are specified here for bits set in
+ * valueMask. */
{
ValueKey valueKey;
Tcl_HashEntry *valueHashPtr, *idHashPtr;
register TkGC *gcPtr;
- int new;
+ int isNew;
Drawable d, freeDrawable;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -87,15 +86,15 @@ Tk_GetGC(tkwin, valueMask, valuePtr)
}
/*
- * Must zero valueKey at start to clear out pad bytes that may be
- * part of structure on some systems.
+ * Must zero valueKey at start to clear out pad bytes that may be part of
+ * structure on some systems.
*/
- memset((VOID *) &valueKey, 0, sizeof(valueKey));
+ memset(&valueKey, 0, sizeof(valueKey));
/*
- * First, check to see if there's already a GC that will work
- * for this request (exact matches only, sorry).
+ * First, check to see if there's already a GC that will work for this
+ * request (exact matches only, sorry).
*/
if (valueMask & GCFunction) {
@@ -216,24 +215,24 @@ Tk_GetGC(tkwin, valueMask, valuePtr)
valueKey.display = Tk_Display(tkwin);
valueKey.screenNum = Tk_ScreenNumber(tkwin);
valueKey.depth = Tk_Depth(tkwin);
- valueHashPtr = Tcl_CreateHashEntry(&dispPtr->gcValueTable,
- (char *) &valueKey, &new);
- if (!new) {
+ valueHashPtr = Tcl_CreateHashEntry(&dispPtr->gcValueTable,
+ (char *) &valueKey, &isNew);
+ if (!isNew) {
gcPtr = (TkGC *) Tcl_GetHashValue(valueHashPtr);
gcPtr->refCount++;
return gcPtr->gc;
}
/*
- * No GC is currently available for this set of values. Allocate a
- * new GC and add a new structure to the database.
+ * No GC is currently available for this set of values. Allocate a new GC
+ * and add a new structure to the database.
*/
gcPtr = (TkGC *) ckalloc(sizeof(TkGC));
/*
- * Find or make a drawable to use to specify the screen and depth
- * of the GC. We may have to make a small pixmap, to avoid doing
+ * Find or make a drawable to use to specify the screen and depth of the
+ * GC. We may have to make a small pixmap, to avoid doing
* Tk_MakeWindowExist on the window.
*/
@@ -254,10 +253,10 @@ Tk_GetGC(tkwin, valueMask, valuePtr)
gcPtr->display = valueKey.display;
gcPtr->refCount = 1;
gcPtr->valueHashPtr = valueHashPtr;
- idHashPtr = Tcl_CreateHashEntry(&dispPtr->gcIdTable,
- (char *) gcPtr->gc, &new);
- if (!new) {
- panic("GC already registered in Tk_GetGC");
+ idHashPtr = Tcl_CreateHashEntry(&dispPtr->gcIdTable,
+ (char *) gcPtr->gc, &isNew);
+ if (!isNew) {
+ Tcl_Panic("GC already registered in Tk_GetGC");
}
Tcl_SetHashValue(valueHashPtr, gcPtr);
Tcl_SetHashValue(idHashPtr, gcPtr);
@@ -273,43 +272,44 @@ Tk_GetGC(tkwin, valueMask, valuePtr)
*
* Tk_FreeGC --
*
- * This procedure is called to release a graphics context allocated by
+ * This function is called to release a graphics context allocated by
* Tk_GetGC.
*
* Results:
* None.
*
* Side effects:
- * The reference count associated with gc is decremented, and
- * gc is officially deallocated if no-one is using it anymore.
+ * The reference count associated with gc is decremented, and gc is
+ * officially deallocated if no-one is using it anymore.
*
*----------------------------------------------------------------------
*/
void
-Tk_FreeGC(display, gc)
- Display *display; /* Display for which gc was allocated. */
- GC gc; /* Graphics context to be released. */
+Tk_FreeGC(
+ Display *display, /* Display for which gc was allocated. */
+ GC gc) /* Graphics context to be released. */
{
Tcl_HashEntry *idHashPtr;
register TkGC *gcPtr;
TkDisplay *dispPtr = TkGetDisplay(display);
if (!dispPtr->gcInit) {
- panic("Tk_FreeGC called before Tk_GetGC");
+ Tcl_Panic("Tk_FreeGC called before Tk_GetGC");
}
if (dispPtr->gcInit < 0) {
/*
- * The GCCleanup has been called, and remaining GCs have been
- * freed. This may still get called by other things shutting
- * down, but the GCs should no longer be in use.
+ * The GCCleanup has been called, and remaining GCs have been freed.
+ * This may still get called by other things shutting down, but the
+ * GCs should no longer be in use.
*/
+
return;
}
idHashPtr = Tcl_FindHashEntry(&dispPtr->gcIdTable, (char *) gc);
if (idHashPtr == NULL) {
- panic("Tk_FreeGC received unknown gc argument");
+ Tcl_Panic("Tk_FreeGC received unknown gc argument");
}
gcPtr = (TkGC *) Tcl_GetHashValue(idHashPtr);
gcPtr->refCount--;
@@ -327,9 +327,8 @@ Tk_FreeGC(display, gc)
*
* TkGCCleanup --
*
- * Frees the structures used for GC management.
- * We need to have it called near the end, when other cleanup that
- * calls Tk_FreeGC is all done.
+ * Frees the structures used for GC management. We need to have it called
+ * near the end, when other cleanup that calls Tk_FreeGC is all done.
*
* Results:
* None.
@@ -341,22 +340,23 @@ Tk_FreeGC(display, gc)
*/
void
-TkGCCleanup(dispPtr)
- TkDisplay *dispPtr; /* display to clean up resources in */
+TkGCCleanup(
+ TkDisplay *dispPtr) /* display to clean up resources in */
{
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
TkGC *gcPtr;
for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search);
- entryPtr != NULL;
- entryPtr = Tcl_NextHashEntry(&search)) {
+ entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
gcPtr = (TkGC *) Tcl_GetHashValue(entryPtr);
+
/*
- * This call is not needed, as it is only used on Unix to restore
- * the Id to the stack pool, and we don't want to use them anymore.
+ * This call is not needed, as it is only used on Unix to restore the
+ * Id to the stack pool, and we don't want to use them anymore.
* Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
*/
+
XFreeGC(gcPtr->display, gcPtr->gc);
Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
Tcl_DeleteHashEntry(entryPtr);
@@ -384,13 +384,21 @@ TkGCCleanup(dispPtr)
*/
static void
-GCInit(dispPtr)
- TkDisplay *dispPtr;
+GCInit(
+ TkDisplay *dispPtr)
{
if (dispPtr->gcInit < 0) {
- panic("called GCInit after GCCleanup");
+ Tcl_Panic("called GCInit after GCCleanup");
}
dispPtr->gcInit = 1;
Tcl_InitHashTable(&dispPtr->gcValueTable, sizeof(ValueKey)/sizeof(int));
Tcl_InitHashTable(&dispPtr->gcIdTable, TCL_ONE_WORD_KEYS);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkGeometry.c b/generic/tkGeometry.c
index d53b6dd..4c8e4f8 100644
--- a/generic/tkGeometry.c
+++ b/generic/tkGeometry.c
@@ -1,23 +1,22 @@
-/*
+/*
* tkGeometry.c --
*
- * This file contains generic Tk code for geometry management
- * (stuff that's used by all geometry managers).
+ * This file contains generic Tk code for geometry management (stuff
+ * that's used by all geometry managers).
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
/*
- * Data structures of the following type are used by Tk_MaintainGeometry.
- * For each slave managed by Tk_MaintainGeometry, there is one of these
- * structures associated with its master.
+ * Data structures of the following type are used by Tk_MaintainGeometry. For
+ * each slave managed by Tk_MaintainGeometry, there is one of these structures
+ * associated with its master.
*/
typedef struct MaintainSlave {
@@ -29,68 +28,67 @@ typedef struct MaintainSlave {
* master. */
int width, height; /* Desired dimensions of slave. */
struct MaintainSlave *nextPtr;
- /* Next in list of Maintains associated
- * with master. */
+ /* Next in list of Maintains associated with
+ * master. */
} MaintainSlave;
/*
- * For each window that has been specified as a master to
- * Tk_MaintainGeometry, there is a structure of the following type:
+ * For each window that has been specified as a master to Tk_MaintainGeometry,
+ * there is a structure of the following type:
*/
typedef struct MaintainMaster {
- Tk_Window ancestor; /* The lowest ancestor of this window
- * for which we have *not* created a
- * StructureNotify handler. May be the
- * same as the window itself. */
- int checkScheduled; /* Non-zero means that there is already a
- * call to MaintainCheckProc scheduled as
- * an idle handler. */
- MaintainSlave *slavePtr; /* First in list of all slaves associated
- * with this master. */
+ Tk_Window ancestor; /* The lowest ancestor of this window for
+ * which we have *not* created a
+ * StructureNotify handler. May be the same as
+ * the window itself. */
+ int checkScheduled; /* Non-zero means that there is already a call
+ * to MaintainCheckProc scheduled as an idle
+ * handler. */
+ MaintainSlave *slavePtr; /* First in list of all slaves associated with
+ * this master. */
} MaintainMaster;
/*
* Prototypes for static procedures in this file:
*/
-static void MaintainCheckProc _ANSI_ARGS_((ClientData clientData));
-static void MaintainMasterProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void MaintainSlaveProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
+static void MaintainCheckProc(ClientData clientData);
+static void MaintainMasterProc(ClientData clientData,
+ XEvent *eventPtr);
+static void MaintainSlaveProc(ClientData clientData,
+ XEvent *eventPtr);
/*
*--------------------------------------------------------------
*
* Tk_ManageGeometry --
*
- * Arrange for a particular procedure to manage the geometry
- * of a given slave window.
+ * Arrange for a particular procedure to manage the geometry of a given
+ * slave window.
*
* Results:
* None.
*
* Side effects:
- * Proc becomes the new geometry manager for tkwin, replacing
- * any previous geometry manager. The geometry manager will
- * be notified (by calling procedures in *mgrPtr) when interesting
- * things happen in the future. If there was an existing geometry
- * manager for tkwin different from the new one, it is notified
- * by calling its lostSlaveProc.
+ * Proc becomes the new geometry manager for tkwin, replacing any
+ * previous geometry manager. The geometry manager will be notified (by
+ * calling procedures in *mgrPtr) when interesting things happen in the
+ * future. If there was an existing geometry manager for tkwin different
+ * from the new one, it is notified by calling its lostSlaveProc.
*
*--------------------------------------------------------------
*/
void
-Tk_ManageGeometry(tkwin, mgrPtr, clientData)
- Tk_Window tkwin; /* Window whose geometry is to
- * be managed by proc. */
- Tk_GeomMgr *mgrPtr; /* Static structure describing the
- * geometry manager. This structure
- * must never go away. */
- ClientData clientData; /* Arbitrary one-word argument to
- * pass to geometry manager procedures. */
+Tk_ManageGeometry(
+ Tk_Window tkwin, /* Window whose geometry is to be managed by
+ * proc. */
+ 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
+ * geometry manager procedures. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -110,37 +108,35 @@ Tk_ManageGeometry(tkwin, mgrPtr, clientData)
*
* Tk_GeometryRequest --
*
- * This procedure is invoked by widget code to indicate
- * its preferences about the size of a window it manages.
- * In general, widget code should call this procedure
- * rather than Tk_ResizeWindow.
+ * This procedure is invoked by widget code to indicate its preferences
+ * about the size of a window it manages. In general, widget code should
+ * call this procedure rather than Tk_ResizeWindow.
*
* Results:
* None.
*
* Side effects:
- * The geometry manager for tkwin (if any) is invoked to
- * handle the request. If possible, it will reconfigure
- * tkwin and/or other windows to satisfy the request. The
- * caller gets no indication of success or failure, but it
- * will get X events if the window size was actually
+ * The geometry manager for tkwin (if any) is invoked to handle the
+ * request. If possible, it will reconfigure tkwin and/or other windows
+ * to satisfy the request. The caller gets no indication of success or
+ * failure, but it will get X events if the window size was actually
* changed.
*
*--------------------------------------------------------------
*/
void
-Tk_GeometryRequest(tkwin, reqWidth, reqHeight)
- Tk_Window tkwin; /* Window that geometry information
- * pertains to. */
- int reqWidth, reqHeight; /* Minimum desired dimensions for
- * window, in pixels. */
+Tk_GeometryRequest(
+ Tk_Window tkwin, /* Window that geometry information pertains
+ * to. */
+ int reqWidth, int reqHeight)/* Minimum desired dimensions for window, in
+ * pixels. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
/*
- * X gets very upset if a window requests a width or height of
- * zero, so rounds requested sizes up to at least 1.
+ * X gets very upset if a window requests a width or height of zero, so
+ * rounds requested sizes up to at least 1.
*/
if (reqWidth <= 0) {
@@ -165,9 +161,9 @@ Tk_GeometryRequest(tkwin, reqWidth, reqHeight)
*
* Tk_SetInternalBorderEx --
*
- * Notify relevant geometry managers that a window has an internal
- * border of a given width and that child windows should not be
- * placed on that border.
+ * Notify relevant geometry managers that a window has an internal border
+ * of a given width and that child windows should not be placed on that
+ * border.
*
* Results:
* None.
@@ -181,10 +177,10 @@ Tk_GeometryRequest(tkwin, reqWidth, reqHeight)
*/
void
-Tk_SetInternalBorderEx(tkwin, left, right, top, bottom)
- Tk_Window tkwin; /* Window that will have internal border. */
- int left, right; /* Width of internal border, in pixels. */
- int top, bottom;
+Tk_SetInternalBorderEx(
+ Tk_Window tkwin, /* Window that will have internal border. */
+ int left, int right, /* Width of internal border, in pixels. */
+ int top, int bottom)
{
register TkWindow *winPtr = (TkWindow *) tkwin;
register int changed = 0;
@@ -223,40 +219,40 @@ Tk_SetInternalBorderEx(tkwin, left, right, top, bottom)
/*
* All the slaves for which this is the master window must now be
- * repositioned to take account of the new internal border width.
- * To signal all the geometry managers to do this, just resize the
- * window to its current size. The ConfigureNotify event will
- * cause geometry managers to recompute everything.
+ * repositioned to take account of the new internal border width. To
+ * signal all the geometry managers to do this, just resize the window to
+ * its current size. The ConfigureNotify event will cause geometry
+ * managers to recompute everything.
*/
if (changed) {
Tk_ResizeWindow(tkwin, Tk_Width(tkwin), Tk_Height(tkwin));
}
}
+
/*
*----------------------------------------------------------------------
*
* Tk_SetInternalBorder --
*
- * Notify relevant geometry managers that a window has an internal
- * border of a given width and that child windows should not be
- * placed on that border.
+ * Notify relevant geometry managers that a window has an internal border
+ * of a given width and that child windows should not be placed on that
+ * border.
*
* Results:
* None.
*
* Side effects:
- * The border width is recorded for the window, and all geometry
- * managers of all children are notified so that can re-layout, if
- * necessary.
+ * The border width is recorded for the window, and all geometry managers
+ * of all children are notified so that can re-layout, if necessary.
*
*----------------------------------------------------------------------
*/
void
-Tk_SetInternalBorder(tkwin, width)
- Tk_Window tkwin; /* Window that will have internal border. */
- int width; /* Width of internal border, in pixels. */
+Tk_SetInternalBorder(
+ Tk_Window tkwin, /* Window that will have internal border. */
+ int width) /* Width of internal border, in pixels. */
{
Tk_SetInternalBorderEx(tkwin, width, width, width, width);
}
@@ -266,23 +262,23 @@ Tk_SetInternalBorder(tkwin, width)
*
* Tk_SetMinimumRequestSize --
*
- * Notify relevant geometry managers that a window has a minimum
- * request size.
+ * Notify relevant geometry managers that a window has a minimum request
+ * size.
*
* Results:
* None.
*
* Side effects:
- * The minimum request size is recorded for the window, and
- * a new size is requested for the window, if necessary.
+ * The minimum request size is recorded for the window, and a new size is
+ * requested for the window, if necessary.
*
*----------------------------------------------------------------------
*/
void
-Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight)
- Tk_Window tkwin; /* Window that will have internal border. */
- int minWidth, minHeight; /* Minimum requested size, in pixels. */
+Tk_SetMinimumRequestSize(
+ Tk_Window tkwin, /* Window that will have internal border. */
+ int minWidth, int minHeight)/* Minimum requested size, in pixels. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -295,11 +291,11 @@ Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight)
winPtr->minReqHeight = minHeight;
/*
- * The changed min size may cause geometry managers to get a
- * different result, so make them recompute.
- * To signal all the geometry managers to do this, just resize the
- * window to its current size. The ConfigureNotify event will
- * cause geometry managers to recompute everything.
+ * The changed min size may cause geometry managers to get a different
+ * result, so make them recompute. To signal all the geometry managers to
+ * do this, just resize the window to its current size. The
+ * ConfigureNotify event will cause geometry managers to recompute
+ * everything.
*/
Tk_ResizeWindow(tkwin, Tk_Width(tkwin), Tk_Height(tkwin));
@@ -310,40 +306,40 @@ Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight)
*
* Tk_MaintainGeometry --
*
- * This procedure is invoked by geometry managers to handle slaves
- * whose master's are not their parents. It translates the desired
- * geometry for the slave into the coordinate system of the parent
- * and respositions the slave if it isn't already at the right place.
- * Furthermore, it sets up event handlers so that if the master (or
- * any of its ancestors up to the slave's parent) is mapped, unmapped,
- * or moved, then the slave will be adjusted to match.
+ * This procedure is invoked by geometry managers to handle slaves whose
+ * master's are not their parents. It translates the desired geometry for
+ * the slave into the coordinate system of the parent and respositions
+ * the slave if it isn't already at the right place. Furthermore, it sets
+ * up event handlers so that if the master (or any of its ancestors up to
+ * the slave's parent) is mapped, unmapped, or moved, then the slave will
+ * be adjusted to match.
*
* Results:
* None.
*
* Side effects:
- * Event handlers are created and state is allocated to keep track
- * of slave. Note: if slave was already managed for master by
- * Tk_MaintainGeometry, then the previous information is replaced
- * with the new information. The caller must eventually call
- * Tk_UnmaintainGeometry to eliminate the correspondence (or, the
- * state is automatically freed when either window is destroyed).
+ * Event handlers are created and state is allocated to keep track of
+ * slave. Note: if slave was already managed for master by
+ * Tk_MaintainGeometry, then the previous information is replaced with
+ * the new information. The caller must eventually call
+ * Tk_UnmaintainGeometry to eliminate the correspondence (or, the state
+ * is automatically freed when either window is destroyed).
*
*----------------------------------------------------------------------
*/
void
-Tk_MaintainGeometry(slave, master, x, y, width, height)
- Tk_Window slave; /* Slave for geometry management. */
- Tk_Window master; /* Master for slave; must be a descendant
- * of slave's parent. */
- int x, y; /* Desired position of slave within master. */
- int width, height; /* Desired dimensions for slave. */
+Tk_MaintainGeometry(
+ Tk_Window slave, /* Slave for geometry management. */
+ Tk_Window master, /* Master for slave; must be a descendant of
+ * slave's parent. */
+ int x, int y, /* Desired position of slave within master. */
+ int width, int height) /* Desired dimensions for slave. */
{
Tcl_HashEntry *hPtr;
MaintainMaster *masterPtr;
register MaintainSlave *slavePtr;
- int new, map;
+ int isNew, map;
Tk_Window ancestor, parent;
TkDisplay *dispPtr = ((TkWindow *) master)->dispPtr;
@@ -354,6 +350,7 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
* call to Tk_MoveResizeWindow; the parent/child relationship will
* take care of the rest.
*/
+
Tk_MoveResizeWindow(slave, x, y, width, height);
/*
@@ -361,6 +358,7 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
* until the master is mapped later (in which case mapping the slave
* is taken care of elsewhere).
*/
+
if (Tk_IsMapped(master)) {
Tk_MapWindow(slave);
}
@@ -373,14 +371,14 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
}
/*
- * See if there is already a MaintainMaster structure for the master;
- * if not, then create one.
+ * See if there is already a MaintainMaster structure for the master; if
+ * not, then create one.
*/
parent = Tk_Parent(slave);
- hPtr = Tcl_CreateHashEntry(&dispPtr->maintainHashTable,
- (char *) master, &new);
- if (!new) {
+ hPtr = Tcl_CreateHashEntry(&dispPtr->maintainHashTable,
+ (char *) master, &isNew);
+ if (!isNew) {
masterPtr = (MaintainMaster *) Tcl_GetHashValue(hPtr);
} else {
masterPtr = (MaintainMaster *) ckalloc(sizeof(MaintainMaster));
@@ -391,8 +389,8 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
}
/*
- * Create a MaintainSlave structure for the slave if there isn't
- * already one.
+ * Create a MaintainSlave structure for the slave if there isn't already
+ * one.
*/
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
@@ -410,10 +408,10 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
(ClientData) slavePtr);
/*
- * Make sure that there are event handlers registered for all
- * the windows between master and slave's parent (including master
- * but not slave's parent). There may already be handlers for master
- * and some of its ancestors (masterPtr->ancestor tells how many).
+ * Make sure that there are event handlers registered for all the windows
+ * between master and slave's parent (including master but not slave's
+ * parent). There may already be handlers for master and some of its
+ * ancestors (masterPtr->ancestor tells how many).
*/
for (ancestor = master; ancestor != parent;
@@ -426,11 +424,11 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
}
/*
- * Fill in up-to-date information in the structure, then update the
- * window if it's not currently in the right place or state.
+ * Fill in up-to-date information in the structure, then update the window
+ * if it's not currently in the right place or state.
*/
- gotSlave:
+ gotSlave:
slavePtr->x = x;
slavePtr->y = y;
slavePtr->width = width;
@@ -464,26 +462,25 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
*
* Tk_UnmaintainGeometry --
*
- * This procedure cancels a previous Tk_MaintainGeometry call,
- * so that the relationship between slave and master is no longer
- * maintained.
+ * This procedure cancels a previous Tk_MaintainGeometry call, so that
+ * the relationship between slave and master is no longer maintained.
*
* Results:
* None.
*
* Side effects:
- * The slave is unmapped and state is released, so that slave won't
- * track master any more. If we weren't previously managing slave
- * relative to master, then this procedure has no effect.
+ * The slave is unmapped and state is released, so that slave won't track
+ * master any more. If we weren't previously managing slave relative to
+ * master, then this procedure has no effect.
*
*----------------------------------------------------------------------
*/
void
-Tk_UnmaintainGeometry(slave, master)
- Tk_Window slave; /* Slave for geometry management. */
- Tk_Window master; /* Master for slave; must be a descendant
- * of slave's parent. */
+Tk_UnmaintainGeometry(
+ Tk_Window slave, /* Slave for geometry management. */
+ Tk_Window master) /* Master for slave; must be a descendant of
+ * slave's parent. */
{
Tcl_HashEntry *hPtr;
MaintainMaster *masterPtr;
@@ -495,11 +492,11 @@ Tk_UnmaintainGeometry(slave, master)
/*
* If the slave is a direct descendant of the master,
* Tk_MaintainGeometry will not have set up any of the extra
- * infrastructure. Don't even bother to look for it, just return.
+ * infrastructure. Don't even bother to look for it, just return.
*/
return;
}
-
+
if (!dispPtr->geomInit) {
dispPtr->geomInit = 1;
Tcl_InitHashTable(&dispPtr->maintainHashTable, TCL_ONE_WORD_KEYS);
@@ -554,27 +551,27 @@ Tk_UnmaintainGeometry(slave, master)
*
* MaintainMasterProc --
*
- * This procedure is invoked by the Tk event dispatcher in
- * response to StructureNotify events on the master or one
- * of its ancestors, on behalf of Tk_MaintainGeometry.
+ * This procedure is invoked by the Tk event dispatcher in response to
+ * StructureNotify events on the master or one of its ancestors, on
+ * behalf of Tk_MaintainGeometry.
*
* Results:
* None.
*
* Side effects:
- * It schedules a call to MaintainCheckProc, which will eventually
- * caused the postions and mapped states to be recalculated for all
- * the maintained slaves of the master. Or, if the master window is
- * being deleted then state is cleaned up.
+ * It schedules a call to MaintainCheckProc, which will eventually caused
+ * the postions and mapped states to be recalculated for all the
+ * maintained slaves of the master. Or, if the master window is being
+ * deleted then state is cleaned up.
*
*----------------------------------------------------------------------
*/
static void
-MaintainMasterProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to MaintainMaster structure
- * for the master window. */
- XEvent *eventPtr; /* Describes what just happened. */
+MaintainMasterProc(
+ ClientData clientData, /* Pointer to MaintainMaster structure for the
+ * master window. */
+ XEvent *eventPtr) /* Describes what just happened. */
{
MaintainMaster *masterPtr = (MaintainMaster *) clientData;
MaintainSlave *slavePtr;
@@ -589,9 +586,9 @@ MaintainMasterProc(clientData, eventPtr)
}
} else if (eventPtr->type == DestroyNotify) {
/*
- * Delete all of the state associated with this master, but
- * be careful not to use masterPtr after the last slave is
- * deleted, since its memory will have been freed.
+ * Delete all of the state associated with this master, but be careful
+ * not to use masterPtr after the last slave is deleted, since its
+ * memory will have been freed.
*/
done = 0;
@@ -610,25 +607,25 @@ MaintainMasterProc(clientData, eventPtr)
*
* MaintainSlaveProc --
*
- * This procedure is invoked by the Tk event dispatcher in
- * response to StructureNotify events on a slave being managed
- * by Tk_MaintainGeometry.
+ * This procedure is invoked by the Tk event dispatcher in response to
+ * StructureNotify events on a slave being managed by
+ * Tk_MaintainGeometry.
*
* Results:
* None.
*
* Side effects:
- * If the event is a DestroyNotify event then the Maintain state
- * and event handlers for this slave are deleted.
+ * If the event is a DestroyNotify event then the Maintain state and
+ * event handlers for this slave are deleted.
*
*----------------------------------------------------------------------
*/
static void
-MaintainSlaveProc(clientData, eventPtr)
- ClientData clientData; /* Pointer to MaintainSlave structure
- * for master-slave pair. */
- XEvent *eventPtr; /* Describes what just happened. */
+MaintainSlaveProc(
+ ClientData clientData, /* Pointer to MaintainSlave structure for
+ * master-slave pair. */
+ XEvent *eventPtr) /* Describes what just happened. */
{
MaintainSlave *slavePtr = (MaintainSlave *) clientData;
@@ -642,12 +639,11 @@ MaintainSlaveProc(clientData, eventPtr)
*
* MaintainCheckProc --
*
- * This procedure is invoked by the Tk event dispatcher as an
- * idle handler, when a master or one of its ancestors has been
- * reconfigured, mapped, or unmapped. Its job is to scan all of
- * the slaves for the master and reposition them, map them, or
- * unmap them as needed to maintain their geometry relative to
- * the master.
+ * This procedure is invoked by the Tk event dispatcher as an idle
+ * handler, when a master or one of its ancestors has been reconfigured,
+ * mapped, or unmapped. Its job is to scan all of the slaves for the
+ * master and reposition them, map them, or unmap them as needed to
+ * maintain their geometry relative to the master.
*
* Results:
* None.
@@ -659,9 +655,9 @@ MaintainSlaveProc(clientData, eventPtr)
*/
static void
-MaintainCheckProc(clientData)
- ClientData clientData; /* Pointer to MaintainMaster structure
- * for the master window. */
+MaintainCheckProc(
+ ClientData clientData) /* Pointer to MaintainMaster structure for the
+ * master window. */
{
MaintainMaster *masterPtr = (MaintainMaster *) clientData;
MaintainSlave *slavePtr;
@@ -696,3 +692,11 @@ MaintainCheckProc(clientData)
}
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkGet.c b/generic/tkGet.c
index 10643ea..9fc0d50 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.c
@@ -1,27 +1,25 @@
-/*
+/*
* tkGet.c --
*
- * This file contains a number of "Tk_GetXXX" procedures, which
- * parse text strings into useful forms for Tk. This file has
- * the simpler procedures, like Tk_GetDirection and Tk_GetUid.
- * The more complex procedures like Tk_GetColor are in separate
- * files.
+ * This file contains a number of "Tk_GetXXX" procedures, which parse
+ * text strings into useful forms for Tk. This file has the simpler
+ * functions, like Tk_GetDirection and Tk_GetUid. The more complex
+ * functions like Tk_GetColor are in separate files.
*
* Copyright (c) 1991-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkPort.h"
/*
- * One of these structures is created per thread to store
- * thread-specific data. In this case, it is used to house the
- * Tk_Uid structs used by each thread. The "dataKey" below is
- * used to locate the ThreadSpecificData for the current thread.
+ * One of these structures is created per thread to store thread-specific
+ * data. In this case, it is used to house the Tk_Uid structs used by each
+ * thread. The "dataKey" below is used to locate the ThreadSpecificData for
+ * the current thread.
*/
typedef struct ThreadSpecificData {
@@ -30,7 +28,7 @@ typedef struct ThreadSpecificData {
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
-static void FreeUidThreadExitProc _ANSI_ARGS_((ClientData clientData));
+static void FreeUidThreadExitProc(ClientData clientData);
/*
* The following tables defines the string values for reliefs, which are
@@ -38,12 +36,11 @@ static void FreeUidThreadExitProc _ANSI_ARGS_((ClientData clientData));
*/
static CONST char *anchorStrings[] = {
- "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", (char *) NULL
+ "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL
};
static CONST char *justifyStrings[] = {
- "left", "right", "center", (char *) NULL
+ "left", "right", "center", NULL
};
-
/*
*----------------------------------------------------------------------
@@ -64,17 +61,17 @@ static CONST char *justifyStrings[] = {
*/
int
-Tk_GetAnchorFromObj(interp, objPtr, anchorPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tcl_Obj *objPtr; /* The object we are trying to get the
- * value from. */
- Tk_Anchor *anchorPtr; /* Where to place the Tk_Anchor that
+Tk_GetAnchorFromObj(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Obj *objPtr, /* The object we are trying to get the value
+ * from. */
+ Tk_Anchor *anchorPtr) /* Where to place the Tk_Anchor that
* corresponds to the string value of
* objPtr. */
{
int index, code;
- code = Tcl_GetIndexFromObj(interp, objPtr, anchorStrings, "anchor", 0,
+ code = Tcl_GetIndexFromObj(interp, objPtr, anchorStrings, "anchor", 0,
&index);
if (code == TCL_OK) {
*anchorPtr = (Tk_Anchor) index;
@@ -90,11 +87,10 @@ Tk_GetAnchorFromObj(interp, objPtr, anchorPtr)
* Given a string, return the corresponding Tk_Anchor.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * position is stored at *anchorPtr; otherwise TCL_ERROR
- * is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the position is stored at
+ * *anchorPtr; otherwise TCL_ERROR is returned and an error message is
+ * left in the interp's result.
*
* Side effects:
* None.
@@ -103,62 +99,61 @@ Tk_GetAnchorFromObj(interp, objPtr, anchorPtr)
*/
int
-Tk_GetAnchor(interp, string, anchorPtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- CONST char *string; /* String describing a direction. */
- Tk_Anchor *anchorPtr; /* Where to store Tk_Anchor corresponding
- * to string. */
+Tk_GetAnchor(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ CONST char *string, /* String describing a direction. */
+ Tk_Anchor *anchorPtr) /* Where to store Tk_Anchor corresponding to
+ * string. */
{
switch (string[0]) {
- case 'n':
- if (string[1] == 0) {
- *anchorPtr = TK_ANCHOR_N;
- return TCL_OK;
- } else if ((string[1] == 'e') && (string[2] == 0)) {
- *anchorPtr = TK_ANCHOR_NE;
- return TCL_OK;
- } else if ((string[1] == 'w') && (string[2] == 0)) {
- *anchorPtr = TK_ANCHOR_NW;
- return TCL_OK;
- }
- goto error;
- case 's':
- if (string[1] == 0) {
- *anchorPtr = TK_ANCHOR_S;
- return TCL_OK;
- } else if ((string[1] == 'e') && (string[2] == 0)) {
- *anchorPtr = TK_ANCHOR_SE;
- return TCL_OK;
- } else if ((string[1] == 'w') && (string[2] == 0)) {
- *anchorPtr = TK_ANCHOR_SW;
- return TCL_OK;
- } else {
- goto error;
- }
- case 'e':
- if (string[1] == 0) {
- *anchorPtr = TK_ANCHOR_E;
- return TCL_OK;
- }
- goto error;
- case 'w':
- if (string[1] == 0) {
- *anchorPtr = TK_ANCHOR_W;
- return TCL_OK;
- }
- goto error;
- case 'c':
- if (strncmp(string, "center", strlen(string)) == 0) {
- *anchorPtr = TK_ANCHOR_CENTER;
- return TCL_OK;
- }
+ case 'n':
+ if (string[1] == 0) {
+ *anchorPtr = TK_ANCHOR_N;
+ return TCL_OK;
+ } else if ((string[1] == 'e') && (string[2] == 0)) {
+ *anchorPtr = TK_ANCHOR_NE;
+ return TCL_OK;
+ } else if ((string[1] == 'w') && (string[2] == 0)) {
+ *anchorPtr = TK_ANCHOR_NW;
+ return TCL_OK;
+ }
+ goto error;
+ case 's':
+ if (string[1] == 0) {
+ *anchorPtr = TK_ANCHOR_S;
+ return TCL_OK;
+ } else if ((string[1] == 'e') && (string[2] == 0)) {
+ *anchorPtr = TK_ANCHOR_SE;
+ return TCL_OK;
+ } else if ((string[1] == 'w') && (string[2] == 0)) {
+ *anchorPtr = TK_ANCHOR_SW;
+ return TCL_OK;
+ } else {
goto error;
+ }
+ case 'e':
+ if (string[1] == 0) {
+ *anchorPtr = TK_ANCHOR_E;
+ return TCL_OK;
+ }
+ goto error;
+ case 'w':
+ if (string[1] == 0) {
+ *anchorPtr = TK_ANCHOR_W;
+ return TCL_OK;
+ }
+ goto error;
+ case 'c':
+ if (strncmp(string, "center", strlen(string)) == 0) {
+ *anchorPtr = TK_ANCHOR_CENTER;
+ return TCL_OK;
+ }
+ goto error;
}
- error:
+ error:
Tcl_AppendResult(interp, "bad anchor position \"", string,
- "\": must be n, ne, e, se, s, sw, w, nw, or center",
- (char *) NULL);
+ "\": must be n, ne, e, se, s, sw, w, nw, or center", NULL);
return TCL_ERROR;
}
@@ -167,8 +162,7 @@ Tk_GetAnchor(interp, string, anchorPtr)
*
* Tk_NameOfAnchor --
*
- * Given a Tk_Anchor, return the string that corresponds
- * to it.
+ * Given a Tk_Anchor, return the string that corresponds to it.
*
* Results:
* None.
@@ -180,20 +174,20 @@ Tk_GetAnchor(interp, string, anchorPtr)
*/
CONST char *
-Tk_NameOfAnchor(anchor)
- Tk_Anchor anchor; /* Anchor for which identifying string
- * is desired. */
+Tk_NameOfAnchor(
+ Tk_Anchor anchor) /* Anchor for which identifying string is
+ * desired. */
{
switch (anchor) {
- case TK_ANCHOR_N: return "n";
- case TK_ANCHOR_NE: return "ne";
- case TK_ANCHOR_E: return "e";
- case TK_ANCHOR_SE: return "se";
- case TK_ANCHOR_S: return "s";
- case TK_ANCHOR_SW: return "sw";
- case TK_ANCHOR_W: return "w";
- case TK_ANCHOR_NW: return "nw";
- case TK_ANCHOR_CENTER: return "center";
+ case TK_ANCHOR_N: return "n";
+ case TK_ANCHOR_NE: return "ne";
+ case TK_ANCHOR_E: return "e";
+ case TK_ANCHOR_SE: return "se";
+ case TK_ANCHOR_S: return "s";
+ case TK_ANCHOR_SW: return "sw";
+ case TK_ANCHOR_W: return "w";
+ case TK_ANCHOR_NW: return "nw";
+ case TK_ANCHOR_CENTER: return "center";
}
return "unknown anchor position";
}
@@ -206,11 +200,10 @@ Tk_NameOfAnchor(anchor)
* Given a string, return the corresponding Tk JoinStyle.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * justification is stored at *joinPtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the justification is stored at
+ * *joinPtr; otherwise TCL_ERROR is returned and an error message is left
+ * in the interp's result.
*
* Side effects:
* None.
@@ -219,11 +212,11 @@ Tk_NameOfAnchor(anchor)
*/
int
-Tk_GetJoinStyle(interp, string, joinPtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- CONST char *string; /* String describing a justification style. */
- int *joinPtr; /* Where to store join style corresponding
- * to string. */
+Tk_GetJoinStyle(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ CONST char *string, /* String describing a justification style. */
+ int *joinPtr) /* Where to store join style corresponding to
+ * string. */
{
int c;
size_t length;
@@ -245,8 +238,7 @@ Tk_GetJoinStyle(interp, string, joinPtr)
}
Tcl_AppendResult(interp, "bad join style \"", string,
- "\": must be bevel, miter, or round",
- (char *) NULL);
+ "\": must be bevel, miter, or round", NULL);
return TCL_ERROR;
}
@@ -255,8 +247,7 @@ Tk_GetJoinStyle(interp, string, joinPtr)
*
* Tk_NameOfJoinStyle --
*
- * Given a Tk JoinStyle, return the string that corresponds
- * to it.
+ * Given a Tk JoinStyle, return the string that corresponds to it.
*
* Results:
* None.
@@ -268,14 +259,14 @@ Tk_GetJoinStyle(interp, string, joinPtr)
*/
CONST char *
-Tk_NameOfJoinStyle(join)
- int join; /* Join style for which identifying string
- * is desired. */
+Tk_NameOfJoinStyle(
+ int join) /* Join style for which identifying string is
+ * desired. */
{
switch (join) {
- case JoinBevel: return "bevel";
- case JoinMiter: return "miter";
- case JoinRound: return "round";
+ case JoinBevel: return "bevel";
+ case JoinMiter: return "miter";
+ case JoinRound: return "round";
}
return "unknown join style";
}
@@ -288,11 +279,10 @@ Tk_NameOfJoinStyle(join)
* Given a string, return the corresponding Tk CapStyle.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * justification is stored at *capPtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the justification is stored at
+ * *capPtr; otherwise TCL_ERROR is returned and an error message is left
+ * in the interp's result.
*
* Side effects:
* None.
@@ -301,11 +291,11 @@ Tk_NameOfJoinStyle(join)
*/
int
-Tk_GetCapStyle(interp, string, capPtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- CONST char *string; /* String describing a justification style. */
- int *capPtr; /* Where to store cap style corresponding
- * to string. */
+Tk_GetCapStyle(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ CONST char *string, /* String describing a justification style. */
+ int *capPtr) /* Where to store cap style corresponding to
+ * string. */
{
int c;
size_t length;
@@ -327,8 +317,7 @@ Tk_GetCapStyle(interp, string, capPtr)
}
Tcl_AppendResult(interp, "bad cap style \"", string,
- "\": must be butt, projecting, or round",
- (char *) NULL);
+ "\": must be butt, projecting, or round", NULL);
return TCL_ERROR;
}
@@ -337,8 +326,7 @@ Tk_GetCapStyle(interp, string, capPtr)
*
* Tk_NameOfCapStyle --
*
- * Given a Tk CapStyle, return the string that corresponds
- * to it.
+ * Given a Tk CapStyle, return the string that corresponds to it.
*
* Results:
* None.
@@ -350,14 +338,14 @@ Tk_GetCapStyle(interp, string, capPtr)
*/
CONST char *
-Tk_NameOfCapStyle(cap)
- int cap; /* Cap style for which identifying string
- * is desired. */
+Tk_NameOfCapStyle(
+ int cap) /* Cap style for which identifying string is
+ * desired. */
{
switch (cap) {
- case CapButt: return "butt";
- case CapProjecting: return "projecting";
- case CapRound: return "round";
+ case CapButt: return "butt";
+ case CapProjecting: return "projecting";
+ case CapRound: return "round";
}
return "unknown cap style";
}
@@ -381,11 +369,11 @@ Tk_NameOfCapStyle(cap)
*/
int
-Tk_GetJustifyFromObj(interp, objPtr, justifyPtr)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tcl_Obj *objPtr; /* The object we are trying to get the
- * value from. */
- Tk_Justify *justifyPtr; /* Where to place the Tk_Justify that
+Tk_GetJustifyFromObj(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tcl_Obj *objPtr, /* The object we are trying to get the value
+ * from. */
+ Tk_Justify *justifyPtr) /* Where to place the Tk_Justify that
* corresponds to the string value of
* objPtr. */
{
@@ -407,11 +395,10 @@ Tk_GetJustifyFromObj(interp, objPtr, justifyPtr)
* Given a string, return the corresponding Tk_Justify.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * justification is stored at *justifyPtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the justification is stored at
+ * *justifyPtr; otherwise TCL_ERROR is returned and an error message is
+ * left in the interp's result.
*
* Side effects:
* None.
@@ -420,11 +407,11 @@ Tk_GetJustifyFromObj(interp, objPtr, justifyPtr)
*/
int
-Tk_GetJustify(interp, string, justifyPtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- CONST char *string; /* String describing a justification style. */
- Tk_Justify *justifyPtr; /* Where to store Tk_Justify corresponding
- * to string. */
+Tk_GetJustify(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ CONST char *string, /* String describing a justification style. */
+ Tk_Justify *justifyPtr) /* Where to store Tk_Justify corresponding to
+ * string. */
{
int c;
size_t length;
@@ -446,8 +433,7 @@ Tk_GetJustify(interp, string, justifyPtr)
}
Tcl_AppendResult(interp, "bad justification \"", string,
- "\": must be left, right, or center",
- (char *) NULL);
+ "\": must be left, right, or center", NULL);
return TCL_ERROR;
}
@@ -469,14 +455,14 @@ Tk_GetJustify(interp, string, justifyPtr)
*/
CONST char *
-Tk_NameOfJustify(justify)
- Tk_Justify justify; /* Justification style for which
- * identifying string is desired. */
+Tk_NameOfJustify(
+ Tk_Justify justify) /* Justification style for which identifying
+ * string is desired. */
{
switch (justify) {
- case TK_JUSTIFY_LEFT: return "left";
- case TK_JUSTIFY_RIGHT: return "right";
- case TK_JUSTIFY_CENTER: return "center";
+ case TK_JUSTIFY_LEFT: return "left";
+ case TK_JUSTIFY_RIGHT: return "right";
+ case TK_JUSTIFY_CENTER: return "center";
}
return "unknown justification style";
}
@@ -498,10 +484,10 @@ Tk_NameOfJustify(justify)
*/
static void
-FreeUidThreadExitProc(clientData)
- ClientData clientData; /* Not used. */
+FreeUidThreadExitProc(
+ ClientData clientData) /* Not used. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DeleteHashTable(&tsdPtr->uidTable);
tsdPtr->initialized = 0;
@@ -512,17 +498,16 @@ FreeUidThreadExitProc(clientData)
*
* Tk_GetUid --
*
- * Given a string, this procedure returns a unique identifier
- * for the string.
+ * Given a string, this function returns a unique identifier for the
+ * string.
*
* Results:
- * This procedure returns a Tk_Uid corresponding to the "string"
- * argument. The Tk_Uid has a string value identical to string
- * (strcmp will return 0), but it's guaranteed that any other
- * calls to this procedure with a string equal to "string" will
- * return exactly the same result (i.e. can compare Tk_Uid
- * *values* directly, without having to call strcmp on what they
- * point to).
+ * This function returns a Tk_Uid corresponding to the "string" argument.
+ * The Tk_Uid has a string value identical to string (strcmp will return
+ * 0), but it's guaranteed that any other calls to this function with a
+ * string equal to "string" will return exactly the same result (i.e. can
+ * compare Tk_Uid *values* directly, without having to call strcmp on
+ * what they point to).
*
* Side effects:
* New information may be entered into the identifier table.
@@ -531,11 +516,11 @@ FreeUidThreadExitProc(clientData)
*/
Tk_Uid
-Tk_GetUid(string)
- CONST char *string; /* String to convert. */
+Tk_GetUid(
+ CONST char *string) /* String to convert. */
{
int dummy;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_HashTable *tablePtr = &tsdPtr->uidTable;
@@ -553,15 +538,14 @@ Tk_GetUid(string)
*
* Tk_GetScreenMM --
*
- * Given a string, returns the number of screen millimeters
- * corresponding to that string.
+ * Given a string, returns the number of screen millimeters corresponding
+ * to that string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * screen distance is stored at *doublePtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the screen distance is stored
+ * at *doublePtr; otherwise TCL_ERROR is returned and an error message is
+ * left in the interp's result.
*
* Side effects:
* None.
@@ -570,13 +554,13 @@ Tk_GetUid(string)
*/
int
-Tk_GetScreenMM(interp, tkwin, string, doublePtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- Tk_Window tkwin; /* Window whose screen determines conversion
+Tk_GetScreenMM(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST char *string; /* String describing a screen distance. */
- double *doublePtr; /* Place to store converted result. */
+ CONST char *string, /* String describing a screen distance. */
+ double *doublePtr) /* Place to store converted result. */
{
char *end;
double d;
@@ -584,35 +568,34 @@ Tk_GetScreenMM(interp, tkwin, string, doublePtr)
d = strtod(string, &end);
if (end == string) {
error:
- Tcl_AppendResult(interp, "bad screen distance \"", string,
- "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "bad screen distance \"", string, "\"", NULL);
return TCL_ERROR;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
}
switch (*end) {
- case 0:
- d /= WidthOfScreen(Tk_Screen(tkwin));
- d *= WidthMMOfScreen(Tk_Screen(tkwin));
- break;
- case 'c':
- d *= 10;
- end++;
- break;
- case 'i':
- d *= 25.4;
- end++;
- break;
- case 'm':
- end++;
- break;
- case 'p':
- d *= 25.4/72.0;
- end++;
- break;
- default:
- goto error;
+ case 0:
+ d /= WidthOfScreen(Tk_Screen(tkwin));
+ d *= WidthMMOfScreen(Tk_Screen(tkwin));
+ break;
+ case 'c':
+ d *= 10;
+ end++;
+ break;
+ case 'i':
+ d *= 25.4;
+ end++;
+ break;
+ case 'm':
+ end++;
+ break;
+ case 'p':
+ d *= 25.4/72.0;
+ end++;
+ break;
+ default:
+ goto error;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
@@ -629,15 +612,14 @@ Tk_GetScreenMM(interp, tkwin, string, doublePtr)
*
* Tk_GetPixels --
*
- * Given a string, returns the number of pixels corresponding
- * to that string.
+ * Given a string, returns the number of pixels corresponding to that
+ * string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * rounded pixel distance is stored at *intPtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * the interp's result.
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the rounded pixel distance is
+ * stored at *intPtr; otherwise TCL_ERROR is returned and an error
+ * message is left in the interp's result.
*
* Side effects:
* None.
@@ -646,13 +628,13 @@ Tk_GetScreenMM(interp, tkwin, string, doublePtr)
*/
int
-Tk_GetPixels(interp, tkwin, string, intPtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- Tk_Window tkwin; /* Window whose screen determines conversion
+Tk_GetPixels(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST char *string; /* String describing a number of pixels. */
- int *intPtr; /* Place to store converted result. */
+ CONST char *string, /* String describing a number of pixels. */
+ int *intPtr) /* Place to store converted result. */
{
double d;
@@ -672,15 +654,15 @@ Tk_GetPixels(interp, tkwin, string, intPtr)
*
* TkGetDoublePixels --
*
- * Given a string, returns the number of pixels corresponding
- * to that string.
+ * Given a string, returns the number of pixels corresponding to that
+ * string.
*
* Results:
- * The return value is a standard Tcl return result. If
- * TCL_OK is returned, then everything went well and the
- * pixel distance is stored at *doublePtr; otherwise
- * TCL_ERROR is returned and an error message is left in
- * interp->result.
+
+ * The return value is a standard Tcl return result. If TCL_OK is
+ * returned, then everything went well and the pixel distance is stored
+ * at *doublePtr; otherwise TCL_ERROR is returned and an error message is
+ * left in interp->result.
*
* Side effects:
* None.
@@ -689,52 +671,51 @@ Tk_GetPixels(interp, tkwin, string, intPtr)
*/
int
-TkGetDoublePixels(interp, tkwin, string, doublePtr)
- Tcl_Interp *interp; /* Use this for error reporting. */
- Tk_Window tkwin; /* Window whose screen determines conversion
+TkGetDoublePixels(
+ Tcl_Interp *interp, /* Use this for error reporting. */
+ Tk_Window tkwin, /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- CONST char *string; /* String describing a number of pixels. */
- double *doublePtr; /* Place to store converted result. */
+ CONST char *string, /* String describing a number of pixels. */
+ double *doublePtr) /* Place to store converted result. */
{
char *end;
double d;
d = strtod((char *) string, &end);
if (end == string) {
- error:
- Tcl_AppendResult(interp, "bad screen distance \"", string,
- "\"", (char *) NULL);
+ error:
+ Tcl_AppendResult(interp, "bad screen distance \"", string, "\"", NULL);
return TCL_ERROR;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
}
switch (*end) {
- case 0:
- break;
- case 'c':
- d *= 10*WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- end++;
- break;
- case 'i':
- d *= 25.4*WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- end++;
- break;
- case 'm':
- d *= WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- end++;
- break;
- case 'p':
- d *= (25.4/72.0)*WidthOfScreen(Tk_Screen(tkwin));
- d /= WidthMMOfScreen(Tk_Screen(tkwin));
- end++;
- break;
- default:
- goto error;
+ case 0:
+ break;
+ case 'c':
+ d *= 10*WidthOfScreen(Tk_Screen(tkwin));
+ d /= WidthMMOfScreen(Tk_Screen(tkwin));
+ end++;
+ break;
+ case 'i':
+ d *= 25.4*WidthOfScreen(Tk_Screen(tkwin));
+ d /= WidthMMOfScreen(Tk_Screen(tkwin));
+ end++;
+ break;
+ case 'm':
+ d *= WidthOfScreen(Tk_Screen(tkwin));
+ d /= WidthMMOfScreen(Tk_Screen(tkwin));
+ end++;
+ break;
+ case 'p':
+ d *= (25.4/72.0)*WidthOfScreen(Tk_Screen(tkwin));
+ d /= WidthMMOfScreen(Tk_Screen(tkwin));
+ end++;
+ break;
+ default:
+ goto error;
}
while ((*end != '\0') && isspace(UCHAR(*end))) {
end++;
@@ -745,5 +726,11 @@ TkGetDoublePixels(interp, tkwin, string, doublePtr)
*doublePtr = d;
return TCL_OK;
}
-
-
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkGrab.c b/generic/tkGrab.c
index 3f4748c..57f8614 100644
--- a/generic/tkGrab.c
+++ b/generic/tkGrab.c
@@ -1,45 +1,42 @@
-/*
+/*
* tkGrab.c --
*
- * This file provides procedures that implement grabs for Tk.
+ * This file provides functions that implement grabs for Tk.
*
* Copyright (c) 1992-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "tkInt.h"
-#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif
/*
- * The grab state machine has four states: ungrabbed, button pressed,
- * grabbed, and button pressed while grabbed. In addition, there are
- * three pieces of grab state information: the current grab window,
- * the current restrict window, and whether the mouse is captured.
- *
- * The current grab window specifies the point in the Tk window
- * heirarchy above which pointer events will not be reported. Any
- * window within the subtree below the grab window will continue to
- * receive events as normal. Events outside of the grab tree will be
- * reported to the grab window.
- *
- * If the current restrict window is set, then all pointer events will
- * be reported only to the restrict window. The restrict window is
- * normally set during an automatic button grab.
- *
- * The mouse capture state specifies whether the window system will
- * report mouse events outside of any Tk toplevels. This is set
- * during a global grab or an automatic button grab.
- *
- * The transitions between different states is given in the following
- * table:
- *
+ * The grab state machine has four states: ungrabbed, button pressed, grabbed,
+ * and button pressed while grabbed. In addition, there are three pieces of
+ * grab state information: the current grab window, the current restrict
+ * window, and whether the mouse is captured.
+ *
+ * The current grab window specifies the point in the Tk window heirarchy
+ * above which pointer events will not be reported. Any window within the
+ * subtree below the grab window will continue to receive events as normal.
+ * Events outside of the grab tree will be reported to the grab window.
+ *
+ * If the current restrict window is set, then all pointer events will be
+ * reported only to the restrict window. The restrict window is normally set
+ * during an automatic button grab.
+ *
+ * The mouse capture state specifies whether the window system will report
+ * mouse events outside of any Tk toplevels. This is set during a global grab
+ * or an automatic button grab.
+ *
+ * The transitions between different states is given in the following table:
+ *
* Event\State U B G GB
* ----------- -- -- -- --
* FirstPress B B GB GB
@@ -60,15 +57,14 @@
* Grabbed 1 0 b/g
* Grab and Button 1 1 1
*
- * Note: 0 means variable is set to NULL, 1 means variable is set to
- * some window, b/g means the variable is set to a window if a button
- * is currently down or a global grab is in effect.
+ * Note: 0 means variable is set to NULL, 1 means variable is set to some
+ * window, b/g means the variable is set to a window if a button is currently
+ * down or a global grab is in effect.
*
- * The final complication to all of this is enter and leave events.
- * In order to correctly handle all of the various cases, Tk cannot
- * rely on X enter/leave events in all situations. The following
- * describes the correct sequence of enter and leave events that
- * should be observed by Tk scripts:
+ * The final complication to all of this is enter and leave events. In order
+ * to correctly handle all of the various cases, Tk cannot rely on X
+ * enter/leave events in all situations. The following describes the correct
+ * sequence of enter and leave events that should be observed by Tk scripts:
*
* Event(state) Enter/Leave From -> To
* ------------ ----------------------
@@ -80,13 +76,13 @@
* Ungrab(G): anc(grab window, event window) -> event window
* Ungrab(GB): restrict window -> event window
*
- * Note: anc(x,y) returns the least ancestor of y that is in the tree
- * of x, terminating at toplevels.
+ * Note: anc(x,y) returns the least ancestor of y that is in the tree of x,
+ * terminating at toplevels.
*/
/*
- * The following structure is used to pass information to
- * GrabRestrictProc from EatGrabEvents.
+ * The following structure is used to pass information to GrabRestrictProc
+ * from EatGrabEvents.
*/
typedef struct {
@@ -99,47 +95,46 @@ typedef struct {
*
* GRAB_GLOBAL 1 means this is a global grab (we grabbed via
* the server so all applications are locked out).
- * 0 means this is a local grab that affects
- * only this application.
+ * 0 means this is a local grab that affects only
+ * this application.
* GRAB_TEMP_GLOBAL 1 means we've temporarily grabbed via the
- * server because a button is down and we want
- * to make sure that we get the button-up
- * event. The grab will be released when the
- * last mouse button goes up.
+ * server because a button is down and we want to
+ * make sure that we get the button-up event. The
+ * grab will be released when the last mouse
+ * button goes up.
*/
#define GRAB_GLOBAL 1
#define GRAB_TEMP_GLOBAL 4
/*
- * The following structure is a Tcl_Event that triggers a change in
- * the grabWinPtr field of a display. This event guarantees that
- * the change occurs in the proper order relative to enter and leave
- * events.
+ * The following structure is a Tcl_Event that triggers a change in the
+ * grabWinPtr field of a display. This event guarantees that the change occurs
+ * in the proper order relative to enter and leave events.
*/
typedef struct NewGrabWinEvent {
Tcl_Event header; /* Standard information for all Tcl events. */
TkDisplay *dispPtr; /* Display whose grab window is to change. */
- Window grabWindow; /* New grab window for display. This is
+ Window grabWindow; /* New grab window for display. This is
* recorded instead of a (TkWindow *) because
- * it will allow us to detect cases where
- * the window is destroyed before this event
- * is processed. */
+ * it will allow us to detect cases where the
+ * window is destroyed before this event is
+ * processed. */
} NewGrabWinEvent;
/*
* The following magic value is stored in the "send_event" field of
- * EnterNotify and LeaveNotify events that are generated in this
- * file. This allows us to separate "real" events coming from the
- * server from those that we generated.
+ * EnterNotify and LeaveNotify 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) 0x147321ac)
/*
- * Mask that selects any of the state bits corresponding to buttons,
- * plus masks that select individual buttons' bits:
+ * Mask that selects any of the state bits corresponding to buttons, plus
+ * masks that select individual buttons' bits:
*/
#define ALL_BUTTONS \
@@ -149,32 +144,27 @@ static unsigned int buttonStates[] = {
};
/*
- * Forward declarations for procedures declared later in this file:
+ * Forward declarations for functions declared later in this file:
*/
-static void EatGrabEvents _ANSI_ARGS_((TkDisplay *dispPtr,
- unsigned int serial));
-static TkWindow * FindCommonAncestor _ANSI_ARGS_((TkWindow *winPtr1,
- TkWindow *winPtr2, int *countPtr1,
- int *countPtr2));
-static Tk_RestrictAction GrabRestrictProc _ANSI_ARGS_((ClientData arg,
- XEvent *eventPtr));
-static int GrabWinEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
- int flags));
-static void MovePointer2 _ANSI_ARGS_((TkWindow *sourcePtr,
- TkWindow *destPtr, int mode, int leaveEvents,
- int EnterEvents));
-static void QueueGrabWindowChange _ANSI_ARGS_((TkDisplay *dispPtr,
- TkWindow *grabWinPtr));
-static void ReleaseButtonGrab _ANSI_ARGS_((TkDisplay *dispPtr));
+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 int GrabWinEventProc(Tcl_Event *evPtr, int flags);
+static void MovePointer2(TkWindow *sourcePtr, TkWindow *destPtr,
+ int mode, int leaveEvents, int EnterEvents);
+static void QueueGrabWindowChange(TkDisplay *dispPtr,
+ TkWindow *grabWinPtr);
+static void ReleaseButtonGrab(TkDisplay *dispPtr);
/*
*----------------------------------------------------------------------
*
* Tk_GrabObjCmd --
*
- * This procedure is invoked to process the "grab" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "grab" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -187,12 +177,11 @@ static void ReleaseButtonGrab _ANSI_ARGS_((TkDisplay *dispPtr));
/* ARGSUSED */
int
-Tk_GrabObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
int globalGrab;
Tk_Window tkwin;
@@ -200,14 +189,16 @@ Tk_GrabObjCmd(clientData, interp, objc, objv)
char *arg;
int index;
int len;
- static CONST char *optionStrings[] = { "current", "release",
- "set", "status", (char *) NULL };
-
- static CONST char *flagStrings[] = { "-global", (char *) NULL };
-
- enum options { GRABCMD_CURRENT, GRABCMD_RELEASE,
- GRABCMD_SET, GRABCMD_STATUS };
-
+ static CONST char *optionStrings[] = {
+ "current", "release", "set", "status", NULL
+ };
+ static CONST char *flagStrings[] = {
+ "-global", NULL
+ };
+ enum options {
+ GRABCMD_CURRENT, GRABCMD_RELEASE, GRABCMD_SET, GRABCMD_STATUS
+ };
+
if (objc < 2) {
/*
* Can't use Tcl_WrongNumArgs here because we want the message to
@@ -221,8 +212,7 @@ Tk_GrabObjCmd(clientData, interp, objc, objv)
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tcl_GetString(objv[0]), " ?-global? window\" or \"",
- Tcl_GetString(objv[0]), " option ?arg arg ...?\"",
- (char *) NULL);
+ Tcl_GetString(objv[0]), " option ?arg arg ...?\"", NULL);
return TCL_ERROR;
}
@@ -262,115 +252,114 @@ Tk_GrabObjCmd(clientData, interp, objc, objv)
}
/*
- * First argument is not a window name and not "-global", find out
- * which option it is.
+ * First argument is not a window name and not "-global", find out which
+ * option it is.
*/
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
-
+
switch ((enum options) index) {
- case GRABCMD_CURRENT: {
- /* [grab current ?window?] */
- if (objc > 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "current ?window?");
+ case GRABCMD_CURRENT:
+ /* [grab current ?window?] */
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "current ?window?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ (Tk_Window) clientData);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
- if (objc == 3) {
- tkwin = Tk_NameToWindow(interp,
- Tcl_GetString(objv[2]), (Tk_Window) clientData);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ if (dispPtr->eventualGrabWinPtr != NULL) {
+ Tcl_SetResult(interp, dispPtr->eventualGrabWinPtr->pathName,
+ TCL_STATIC);
+ }
+ } else {
+ for (dispPtr = TkGetDisplayList(); dispPtr != NULL;
+ dispPtr = dispPtr->nextPtr) {
if (dispPtr->eventualGrabWinPtr != NULL) {
- Tcl_SetResult(interp,
- dispPtr->eventualGrabWinPtr->pathName, TCL_STATIC);
- }
- } else {
- for (dispPtr = TkGetDisplayList(); dispPtr != NULL;
- dispPtr = dispPtr->nextPtr) {
- if (dispPtr->eventualGrabWinPtr != NULL) {
- Tcl_AppendElement(interp,
- dispPtr->eventualGrabWinPtr->pathName);
- }
+ Tcl_AppendElement(interp,
+ dispPtr->eventualGrabWinPtr->pathName);
}
}
- return TCL_OK;
}
+ return TCL_OK;
- case GRABCMD_RELEASE: {
- /* [grab release window] */
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "release window");
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp,
- Tcl_GetString(objv[2]), (Tk_Window) clientData);
- if (tkwin == NULL) {
- Tcl_ResetResult(interp);
- } else {
- Tk_Ungrab(tkwin);
- }
- break;
+ case GRABCMD_RELEASE:
+ /* [grab release window] */
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "release window");
+ return TCL_ERROR;
}
-
- case GRABCMD_SET: {
- /* [grab set ?-global? window] */
- if ((objc != 3) && (objc != 4)) {
- Tcl_WrongNumArgs(interp, 1, objv, "set ?-global? window");
- return TCL_ERROR;
- }
- if (objc == 3) {
- globalGrab = 0;
- tkwin = Tk_NameToWindow(interp,
- Tcl_GetString(objv[2]), (Tk_Window) clientData);
- } else {
- globalGrab = 1;
- /*
- * We could just test the argument by hand instead of using
- * Tcl_GetIndexFromObj; the benefit of using the function is
- * that it sets up the error message for us, so we are
- * certain to be consistant with the rest of Tcl.
- */
- if (Tcl_GetIndexFromObj(interp, objv[2], flagStrings, "option",
- 0, &index) != TCL_OK) {
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp,
- Tcl_GetString(objv[3]), (Tk_Window) clientData);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- return Tk_Grab(interp, tkwin, globalGrab);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ (Tk_Window) clientData);
+ if (tkwin == NULL) {
+ Tcl_ResetResult(interp);
+ } else {
+ Tk_Ungrab(tkwin);
}
+ break;
- case GRABCMD_STATUS: {
- /* [grab status window] */
- TkWindow *winPtr;
+ case GRABCMD_SET:
+ /* [grab set ?-global? window] */
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "set ?-global? window");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ globalGrab = 0;
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ (Tk_Window) clientData);
+ } else {
+ globalGrab = 1;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "status window");
- return TCL_ERROR;
- }
- winPtr = (TkWindow *) Tk_NameToWindow(interp,
- Tcl_GetString(objv[2]), (Tk_Window) clientData);
- if (winPtr == NULL) {
+ /*
+ * We could just test the argument by hand instead of using
+ * Tcl_GetIndexFromObj; the benefit of using the function is that
+ * it sets up the error message for us, so we are certain to be
+ * consistant with the rest of Tcl.
+ */
+
+ if (Tcl_GetIndexFromObj(interp, objv[2], flagStrings, "option",
+ 0, &index) != TCL_OK) {
return TCL_ERROR;
}
- dispPtr = winPtr->dispPtr;
- if (dispPtr->eventualGrabWinPtr != winPtr) {
- Tcl_SetResult(interp, "none", TCL_STATIC);
- } else if (dispPtr->grabFlags & GRAB_GLOBAL) {
- Tcl_SetResult(interp, "global", TCL_STATIC);
- } else {
- Tcl_SetResult(interp, "local", TCL_STATIC);
- }
- break;
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[3]),
+ (Tk_Window) clientData);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ return Tk_Grab(interp, tkwin, globalGrab);
+
+ case GRABCMD_STATUS: {
+ /* [grab status window] */
+ TkWindow *winPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "status window");
+ return TCL_ERROR;
+ }
+ winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ (Tk_Window) clientData);
+ if (winPtr == NULL) {
+ return TCL_ERROR;
+ }
+ dispPtr = winPtr->dispPtr;
+ if (dispPtr->eventualGrabWinPtr != winPtr) {
+ Tcl_SetResult(interp, "none", TCL_STATIC);
+ } else if (dispPtr->grabFlags & GRAB_GLOBAL) {
+ Tcl_SetResult(interp, "global", TCL_STATIC);
+ } else {
+ Tcl_SetResult(interp, "local", TCL_STATIC);
}
+ break;
+ }
}
return TCL_OK;
@@ -381,34 +370,32 @@ Tk_GrabObjCmd(clientData, interp, objc, objv)
*
* Tk_Grab --
*
- * Grabs the pointer and keyboard, so that mouse-related events are
- * only reported relative to a given window and its descendants.
+ * Grabs the pointer and keyboard, so that mouse-related events are only
+ * reported relative to a given window and its descendants.
*
* Results:
- * A standard Tcl result is returned. TCL_OK is the normal return
- * value; if the grab could not be set then TCL_ERROR is returned
- * and the interp's result will hold an error message.
+ * A standard Tcl result is returned. TCL_OK is the normal return value;
+ * if the grab could not be set then TCL_ERROR is returned and the
+ * interp's result will hold an error message.
*
* Side effects:
- * Once this call completes successfully, no window outside the
- * tree rooted at tkwin will receive pointer- or keyboard-related
- * events until the next call to Tk_Ungrab. If a previous grab was
- * in effect within this application, then it is replaced with a new
- * one.
+ * Once this call completes successfully, no window outside the tree
+ * rooted at tkwin will receive pointer- or keyboard-related events until
+ * the next call to Tk_Ungrab. If a previous grab was in effect within
+ * this application, then it is replaced with a new one.
*
*----------------------------------------------------------------------
*/
int
-Tk_Grab(interp, tkwin, grabGlobal)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Window tkwin; /* Window on whose behalf the pointer
- * is to be grabbed. */
- int grabGlobal; /* Non-zero means issue a grab to the
- * server so that no other application
- * gets mouse or keyboard events.
- * Zero means the grab only applies
- * within this application. */
+Tk_Grab(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ Tk_Window tkwin, /* Window on whose behalf the pointer is to be
+ * grabbed. */
+ int grabGlobal) /* Non-zero means issue a grab to the server
+ * so that no other application gets mouse or
+ * keyboard events. Zero means the grab only
+ * applies within this application. */
{
int grabResult, numTries;
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -423,7 +410,7 @@ Tk_Grab(interp, tkwin, grabGlobal)
return TCL_OK;
}
if (dispPtr->eventualGrabWinPtr->mainPtr != winPtr->mainPtr) {
- alreadyGrabbed:
+ alreadyGrabbed:
Tcl_SetResult(interp, "grab failed: another application has grab",
TCL_STATIC);
return TCL_ERROR;
@@ -438,11 +425,11 @@ Tk_Grab(interp, tkwin, grabGlobal)
unsigned int state;
/*
- * Local grab. However, if any mouse buttons are down, turn
- * it into a global grab temporarily, until the last button
- * goes up. This does two things: (a) it makes sure that we
- * see the button-up event; and (b) it allows us to track mouse
- * motion among all of the windows of this application.
+ * Local grab. However, if any mouse buttons are down, turn it into a
+ * global grab temporarily, until the last button goes up. This does
+ * two things: (a) it makes sure that we see the button-up event; and
+ * (b) it allows us to track mouse motion among all of the windows of
+ * this application.
*/
dispPtr->grabFlags &= ~(GRAB_GLOBAL|GRAB_TEMP_GLOBAL);
@@ -454,30 +441,28 @@ Tk_Grab(interp, tkwin, grabGlobal)
}
} else {
dispPtr->grabFlags |= GRAB_GLOBAL;
- setGlobalGrab:
+ setGlobalGrab:
/*
- * Tricky point: must ungrab before grabbing. This is needed
- * in case there is a button auto-grab already in effect. If
- * there is, and the mouse has moved to a different window, X
- * won't generate enter and leave events to move the mouse if
- * we grab without ungrabbing.
+ * Tricky point: must ungrab before grabbing. This is needed in case
+ * there is a button auto-grab already in effect. If there is, and the
+ * mouse has moved to a different window, X won't generate enter and
+ * leave events to move the mouse if we grab without ungrabbing.
*/
XUngrabPointer(dispPtr->display, CurrentTime);
serial = NextRequest(dispPtr->display);
/*
- * Another tricky point: there are races with some window
- * managers that can cause grabs to fail because the window
- * manager hasn't released its grab quickly enough. To work
- * around this problem, retry a few times after AlreadyGrabbed
- * errors to give the grab release enough time to register with
- * the server.
+ * Another tricky point: there are races with some window managers
+ * that can cause grabs to fail because the window manager hasn't
+ * released its grab quickly enough. To work around this problem,
+ * retry a few times after AlreadyGrabbed errors to give the grab
+ * release enough time to register with the server.
*/
- grabResult = 0; /* Needed only to prevent gcc
- * compiler warnings. */
+ grabResult = 0; /* Needed only to prevent gcc compiler
+ * warnings. */
for (numTries = 0; numTries < 10; numTries++) {
grabResult = XGrabPointer(dispPtr->display, winPtr->window,
True, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask
@@ -489,7 +474,7 @@ Tk_Grab(interp, tkwin, grabGlobal)
Tcl_Sleep(100);
}
if (grabResult != 0) {
- grabError:
+ grabError:
if (grabResult == GrabNotViewable) {
Tcl_SetResult(interp, "grab failed: window not viewable",
TCL_STATIC);
@@ -503,10 +488,10 @@ Tk_Grab(interp, tkwin, grabGlobal)
TCL_STATIC);
} else {
char msg[64 + TCL_INTEGER_SPACE];
-
+
sprintf(msg, "grab failed for unknown reason (code %d)",
grabResult);
- Tcl_AppendResult(interp, msg, (char *) NULL);
+ Tcl_AppendResult(interp, msg, NULL);
}
return TCL_ERROR;
}
@@ -519,13 +504,13 @@ Tk_Grab(interp, tkwin, grabGlobal)
/*
* Eat up any grab-related events generated by the server for the
- * grab. There are several reasons for doing this:
+ * grab. There are several reasons for doing this:
*
* 1. We have to synthesize the events for local grabs anyway, since
* the server doesn't participate in them.
* 2. The server doesn't always generate the right events for global
- * grabs (e.g. it generates events even if the current window is
- * in the grab tree, which we don't want).
+ * grabs (e.g. it generates events even if the current window is in
+ * the grab tree, which we don't want).
* 3. We want all the grab-related events to be processed immediately
* (before other events that are already queued); events coming
* from the server will be in the wrong place, but events we
@@ -536,8 +521,8 @@ Tk_Grab(interp, tkwin, grabGlobal)
}
/*
- * Synthesize leave events to move the pointer from its current window
- * up to the lowest ancestor that it has in common with the grab window.
+ * Synthesize leave events to move the pointer from its current window up
+ * to the lowest ancestor that it has in common with the grab window.
* However, only do this if the pointer is outside the grab window's
* subtree but inside the grab window's application.
*/
@@ -563,8 +548,8 @@ Tk_Grab(interp, tkwin, grabGlobal)
*
* Tk_Ungrab --
*
- * Releases a grab on the mouse pointer and keyboard, if there
- * is one set on the specified window.
+ * Releases a grab on the mouse pointer and keyboard, if there is one set
+ * on the specified window.
*
* Results:
* None.
@@ -577,9 +562,8 @@ Tk_Grab(interp, tkwin, grabGlobal)
*/
void
-Tk_Ungrab(tkwin)
- Tk_Window tkwin; /* Window whose grab should be
- * released. */
+Tk_Ungrab(
+ Tk_Window tkwin) /* Window whose grab should be released. */
{
TkDisplay *dispPtr;
TkWindow *grabWinPtr, *winPtr;
@@ -591,7 +575,7 @@ Tk_Ungrab(tkwin)
return;
}
ReleaseButtonGrab(dispPtr);
- QueueGrabWindowChange(dispPtr, (TkWindow *) NULL);
+ QueueGrabWindowChange(dispPtr, NULL);
if (dispPtr->grabFlags & (GRAB_GLOBAL|GRAB_TEMP_GLOBAL)) {
dispPtr->grabFlags &= ~(GRAB_GLOBAL|GRAB_TEMP_GLOBAL);
serial = NextRequest(dispPtr->display);
@@ -601,17 +585,17 @@ Tk_Ungrab(tkwin)
}
/*
- * Generate events to move the pointer back to the window where it
- * really is. Some notes:
- * 1. As with grabs, only do this if the "real" window is not a
- * descendant of the grab window, since in this case the pointer
- * is already where it's supposed to be.
+ * Generate events to move the pointer back to the window where it really
+ * is. Some notes:
+ * 1. As with grabs, only do this if the "real" window is not a descendant
+ * of the grab window, since in this case the pointer is already where
+ * it's supposed to be.
* 2. If the "real" window is in some other application then don't
- * generate any events at all, since everything's already been
- * reported correctly.
- * 3. Only generate enter events. Don't generate leave events,
- * because we never told the lower-level windows that they
- * had the pointer in the first place.
+ * generate any events at all, since everything's already been reported
+ * correctly.
+ * 3. Only generate enter events. Don't generate leave events, because we
+ * never told the lower-level windows that they had the pointer in the
+ * first place.
*/
for (winPtr = dispPtr->serverWinPtr; ; winPtr = winPtr->parentPtr) {
@@ -634,26 +618,26 @@ Tk_Ungrab(tkwin)
*
* ReleaseButtonGrab --
*
- * This procedure is called to release a simulated button grab, if
- * there is one in effect. A button grab is present whenever
- * dispPtr->buttonWinPtr is non-NULL or when the GRAB_TEMP_GLOBAL
- * flag is set.
+ * This function is called to release a simulated button grab, if there
+ * is one in effect. A button grab is present whenever
+ * dispPtr->buttonWinPtr is non-NULL or when the GRAB_TEMP_GLOBAL flag is
+ * set.
*
* Results:
* None.
*
* Side effects:
- * DispPtr->buttonWinPtr is reset to NULL, and enter and leave
- * events are generated if necessary to move the pointer from
- * the button grab window to its current window.
+ * DispPtr->buttonWinPtr is reset to NULL, and enter and leave events are
+ * generated if necessary to move the pointer from the button grab window
+ * to its current window.
*
*----------------------------------------------------------------------
*/
static void
-ReleaseButtonGrab(dispPtr)
- register TkDisplay *dispPtr; /* Display whose button grab is to be
- * released. */
+ReleaseButtonGrab(
+ register TkDisplay *dispPtr)/* Display whose button grab is to be
+ * released. */
{
unsigned int serial;
@@ -678,64 +662,64 @@ ReleaseButtonGrab(dispPtr)
*
* TkPointerEvent --
*
- * This procedure is called for each pointer-related event, before
- * the event has been processed. It does various things to make
- * grabs work correctly.
+ * This function is called for each pointer-related event, before the
+ * event has been processed. It does various things to make grabs work
+ * correctly.
*
* Results:
- * If the return value is 1 it means the event should be processed
- * (event handlers should be invoked). If the return value is 0
- * it means the event should be ignored in order to make grabs
- * work correctly. In some cases this procedure modifies the event.
+ * If the return value is 1 it means the event should be processed (event
+ * handlers should be invoked). If the return value is 0 it means the
+ * event should be ignored in order to make grabs work correctly. In some
+ * cases this function modifies the event.
*
* Side effects:
- * Grab state information may be updated. New events may also be
- * pushed back onto the event queue to replace or augment the
- * one passed in here.
+ * Grab state information may be updated. New events may also be pushed
+ * back onto the event queue to replace or augment the one passed in
+ * here.
*
*----------------------------------------------------------------------
*/
int
-TkPointerEvent(eventPtr, winPtr)
- register XEvent *eventPtr; /* Pointer to the event. */
- TkWindow *winPtr; /* Tk's information for window
- * where event was reported. */
+TkPointerEvent(
+ register XEvent *eventPtr, /* Pointer to the event. */
+ TkWindow *winPtr) /* Tk's information for window where event was
+ * reported. */
{
register TkWindow *winPtr2;
TkDisplay *dispPtr = winPtr->dispPtr;
unsigned int serial;
int outsideGrabTree = 0;
int ancestorOfGrab = 0;
- int appGrabbed = 0; /* Non-zero means event is being
- * reported to an application that is
- * affected by the grab. */
+ int appGrabbed = 0; /* Non-zero means event is being reported to
+ * an application that is affected by the
+ * grab. */
/*
* Collect information about the grab (if any).
*/
switch (TkGrabState(winPtr)) {
- case TK_GRAB_IN_TREE:
- appGrabbed = 1;
- break;
- case TK_GRAB_ANCESTOR:
- appGrabbed = 1;
- outsideGrabTree = 1;
- ancestorOfGrab = 1;
- break;
- case TK_GRAB_EXCLUDED:
- appGrabbed = 1;
- outsideGrabTree = 1;
- break;
+ case TK_GRAB_IN_TREE:
+ appGrabbed = 1;
+ break;
+ case TK_GRAB_ANCESTOR:
+ appGrabbed = 1;
+ outsideGrabTree = 1;
+ ancestorOfGrab = 1;
+ break;
+ case TK_GRAB_EXCLUDED:
+ appGrabbed = 1;
+ outsideGrabTree = 1;
+ break;
}
if ((eventPtr->type == EnterNotify) || (eventPtr->type == LeaveNotify)) {
/*
- * Keep track of what window the mouse is *really* over.
- * Any events that we generate have a special send_event value,
- * which is detected below and used to ignore the event for
- * purposes of setting serverWinPtr.
+ * Keep track of what window the mouse is *really* over. Any events
+ * that we generate have a special send_event value, which is detected
+ * below and used to ignore the event for purposes of setting
+ * serverWinPtr.
*/
if (eventPtr->xcrossing.send_event != GENERATED_EVENT_MAGIC) {
@@ -748,13 +732,13 @@ TkPointerEvent(eventPtr, winPtr)
}
/*
- * When a grab is active, X continues to report enter and leave
- * events for windows outside the tree of the grab window:
- * 1. Detect these events and ignore them except for
- * windows above the grab window.
- * 2. Allow Enter and Leave events to pass through the
- * windows above the grab window, but never let them
- * end up with the pointer *in* one of those windows.
+ * When a grab is active, X continues to report enter and leave events
+ * for windows outside the tree of the grab window:
+ * 1. Detect these events and ignore them except for windows above the
+ * grab window.
+ * 2. Allow Enter and Leave events to pass through the windows above
+ * the grab window, but never let them end up with the pointer *in*
+ * one of those windows.
*/
if (dispPtr->grabWinPtr != NULL) {
@@ -763,22 +747,21 @@ TkPointerEvent(eventPtr, winPtr)
return 0;
}
switch (eventPtr->xcrossing.detail) {
- case NotifyInferior:
- return 0;
- case NotifyAncestor:
- eventPtr->xcrossing.detail = NotifyVirtual;
- break;
- case NotifyNonlinear:
- eventPtr->xcrossing.detail = NotifyNonlinearVirtual;
- break;
+ case NotifyInferior:
+ return 0;
+ case NotifyAncestor:
+ eventPtr->xcrossing.detail = NotifyVirtual;
+ break;
+ case NotifyNonlinear:
+ eventPtr->xcrossing.detail = NotifyNonlinearVirtual;
+ break;
}
}
/*
- * Make buttons have the same grab-like behavior inside a grab
- * as they do outside a grab: do this by ignoring enter and
- * leave events except for the window in which the button was
- * pressed.
+ * Make buttons have the same grab-like behavior inside a grab as
+ * they do outside a grab: do this by ignoring enter and leave
+ * events except for the window in which the button was pressed.
*/
if ((dispPtr->buttonWinPtr != NULL)
@@ -796,12 +779,12 @@ TkPointerEvent(eventPtr, winPtr)
if (eventPtr->type == MotionNotify) {
/*
* When grabs are active, X reports motion events relative to the
- * window under the pointer. Instead, it should report the events
+ * window under the pointer. Instead, it should report the events
* relative to the window the button went down in, if there is a
- * button down. Otherwise, if the pointer window is outside the
- * subtree of the grab window, the events should be reported
- * relative to the grab window. Otherwise, the event should be
- * reported to the pointer window.
+ * button down. Otherwise, if the pointer window is outside the
+ * subtree of the grab window, the events should be reported relative
+ * to the grab window. Otherwise, the event should be reported to the
+ * pointer window.
*/
winPtr2 = winPtr;
@@ -820,32 +803,32 @@ TkPointerEvent(eventPtr, winPtr)
/*
* Process ButtonPress and ButtonRelease events:
- * 1. Keep track of whether a button is down and what window it
- * went down in.
- * 2. If the first button goes down outside the grab tree, pretend
- * it went down in the grab window. Note: it's important to
- * redirect events to the grab window like this in order to make
- * things like menus work, where button presses outside the
- * grabbed menu need to be seen. An application can always
- * ignore the events if they occur outside its window.
- * 3. If a button press or release occurs outside the window where
- * the first button was pressed, retarget the event so it's reported
- * to the window where the first button was pressed.
- * 4. If the last button is released in a window different than where
- * the first button was pressed, generate Enter/Leave events to
- * move the mouse from the button window to its current window.
- * 5. If the grab is set at a time when a button is already down, or
- * if the window where the button was pressed was deleted, then
- * dispPtr->buttonWinPtr will stay NULL. Just forget about the
- * auto-grab for the button press; events will go to whatever
- * window contains the pointer. If this window isn't in the grab
- * tree then redirect events to the grab window.
- * 6. When a button is pressed during a local grab, the X server sets
- * a grab of its own, since it doesn't even know about our local
- * grab. This causes enter and leave events no longer to be
- * generated in the same way as for global grabs. To eliminate this
- * problem, set a temporary global grab when the first button goes
- * down and release it when the last button comes up.
+ * 1. Keep track of whether a button is down and what window it went down
+ * in.
+ * 2. If the first button goes down outside the grab tree, pretend it went
+ * down in the grab window. Note: it's important to redirect events to
+ * the grab window like this in order to make things like menus work,
+ * where button presses outside the grabbed menu need to be seen. An
+ * application can always ignore the events if they occur outside its
+ * window.
+ * 3. If a button press or release occurs outside the window where the
+ * first button was pressed, retarget the event so it's reported to the
+ * window where the first button was pressed.
+ * 4. If the last button is released in a window different than where the
+ * first button was pressed, generate Enter/Leave events to move the
+ * mouse from the button window to its current window.
+ * 5. If the grab is set at a time when a button is already down, or if
+ * the window where the button was pressed was deleted, then
+ * dispPtr->buttonWinPtr will stay NULL. Just forget about the
+ * auto-grab for the button press; events will go to whatever window
+ * contains the pointer. If this window isn't in the grab tree then
+ * redirect events to the grab window.
+ * 6. When a button is pressed during a local grab, the X server sets a
+ * grab of its own, since it doesn't even know about our local grab.
+ * This causes enter and leave events no longer to be generated in the
+ * same way as for global grabs. To eliminate this problem, set a
+ * temporary global grab when the first button goes down and release it
+ * when the last button comes up.
*/
if ((eventPtr->type == ButtonPress) || (eventPtr->type == ButtonRelease)) {
@@ -906,12 +889,12 @@ TkPointerEvent(eventPtr, winPtr)
* TkChangeEventWindow --
*
* Given an event and a new window to which the event should be
- * retargeted, modify fields of the event so that the event is
- * properly retargeted to the new window.
+ * retargeted, modify fields of the event so that the event is properly
+ * retargeted to the new window.
*
* Results:
- * The following fields of eventPtr are modified: window,
- * subwindow, x, y, same_screen.
+ * The following fields of eventPtr are modified: window, subwindow, x,
+ * y, same_screen.
*
* Side effects:
* None.
@@ -920,12 +903,12 @@ TkPointerEvent(eventPtr, winPtr)
*/
void
-TkChangeEventWindow(eventPtr, winPtr)
- register XEvent *eventPtr; /* Event to retarget. Must have
- * type ButtonPress, ButtonRelease, KeyPress,
- * KeyRelease, MotionNotify, EnterNotify,
- * or LeaveNotify. */
- TkWindow *winPtr; /* New target window for event. */
+TkChangeEventWindow(
+ register XEvent *eventPtr, /* Event to retarget. Must have type
+ * ButtonPress, ButtonRelease, KeyPress,
+ * KeyRelease, MotionNotify, EnterNotify, or
+ * LeaveNotify. */
+ TkWindow *winPtr) /* New target window for event. */
{
int x, y, sameScreen, bd;
register TkWindow *childPtr;
@@ -970,44 +953,44 @@ TkChangeEventWindow(eventPtr, winPtr)
*
* TkInOutEvents --
*
- * This procedure synthesizes EnterNotify and LeaveNotify events
- * to correctly transfer the pointer from one window to another.
- * It can also be used to generate FocusIn and FocusOut events
- * to move the input focus.
+ * This function synthesizes EnterNotify and LeaveNotify events to
+ * correctly transfer the pointer from one window to another. It can also
+ * be used to generate FocusIn and FocusOut events to move the input
+ * focus.
*
* Results:
* None.
*
* Side effects:
- * Synthesized events may be pushed back onto the event queue.
- * The event pointed to by eventPtr is modified.
+ * Synthesized events may be pushed back onto the event queue. The event
+ * pointed to by eventPtr is modified.
*
*----------------------------------------------------------------------
*/
void
-TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
- XEvent *eventPtr; /* A template X event. Must have all fields
+TkInOutEvents(
+ XEvent *eventPtr, /* A template X event. Must have all fields
* properly set except for type, window,
- * subwindow, x, y, detail, and same_screen
+ * subwindow, x, y, detail, and same_screen.
* (Not all of these fields are valid for
- * FocusIn/FocusOut events; x_root and y_root
+ * FocusIn/FocusOut events; x_root and y_root
* must be valid for Enter/Leave events, even
* though x and y needn't be valid). */
- TkWindow *sourcePtr; /* Window that used to have the pointer or
+ TkWindow *sourcePtr, /* Window that used to have the pointer or
* focus (NULL means it was not in a window
* managed by this process). */
- TkWindow *destPtr; /* Window that is to end up with the pointer
+ TkWindow *destPtr, /* Window that is to end up with the pointer
* or focus (NULL means it's not one managed
* by this process). */
- int leaveType; /* Type of events to generate for windows
- * being left (LeaveNotify or FocusOut). 0
+ int leaveType, /* Type of events to generate for windows
+ * being left (LeaveNotify or FocusOut). 0
* means don't generate leave events. */
- int enterType; /* Type of events to generate for windows
- * being entered (EnterNotify or FocusIn). 0
+ int enterType, /* Type of events to generate for windows
+ * being entered (EnterNotify or FocusIn). 0
* means don't generate enter events. */
- Tcl_QueuePosition position; /* Position at which events are added to
- * the system event queue. */
+ Tcl_QueuePosition position) /* Position at which events are added to the
+ * system event queue. */
{
register TkWindow *winPtr;
int upLevels, downLevels, i, j, focus;
@@ -1015,17 +998,15 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
/*
* There are four possible cases to deal with:
*
- * 1. SourcePtr and destPtr are the same. There's nothing to do in
- * this case.
- * 2. SourcePtr is an ancestor of destPtr in the same top-level
- * window. Must generate events down the window tree from source
- * to dest.
- * 3. DestPtr is an ancestor of sourcePtr in the same top-level
- * window. Must generate events up the window tree from sourcePtr
- * to destPtr.
- * 4. All other cases. Must first generate events up the window tree
- * from sourcePtr to its top-level, then down from destPtr's
- * top-level to destPtr. This form is called "non-linear."
+ * 1. SourcePtr and destPtr are the same. There's nothing to do in this
+ * case.
+ * 2. SourcePtr is an ancestor of destPtr in the same top-level window.
+ * Must generate events down the window tree from source to dest.
+ * 3. DestPtr is an ancestor of sourcePtr in the same top-level window.
+ * Must generate events up the window tree from sourcePtr to destPtr.
+ * 4. All other cases. Must first generate events up the window tree from
+ * sourcePtr to its top-level, then down from destPtr's top-level to
+ * destPtr. This form is called "non-linear."
*
* The call to FindCommonAncestor separates these four cases and decides
* how many levels up and down events have to be generated for.
@@ -1045,7 +1026,6 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
* Generate enter/leave events and add them to the grab event queue.
*/
-
#define QUEUE(w, t, d) \
if (w->window != None) { \
eventPtr->type = t; \
@@ -1060,7 +1040,6 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
}
if (downLevels == 0) {
-
/*
* SourcePtr is an inferior of destPtr.
*/
@@ -1076,7 +1055,6 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
QUEUE(destPtr, enterType, NotifyInferior);
}
} else if (upLevels == 0) {
-
/*
* DestPtr is an inferior of sourcePtr.
*/
@@ -1088,6 +1066,7 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
for (i = downLevels-1; i > 0; i--) {
for (winPtr = destPtr->parentPtr, j = 1; j < i;
winPtr = winPtr->parentPtr, j++) {
+ /* empty */
}
QUEUE(winPtr, enterType, NotifyVirtual);
}
@@ -1096,9 +1075,8 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
}
}
} else {
-
/*
- * Non-linear: neither window is an inferior of the other.
+ * Non-linear: neither window is an inferior of the other.
*/
if (leaveType != 0) {
@@ -1127,11 +1105,11 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
*
* MovePointer2 --
*
- * This procedure synthesizes EnterNotify and LeaveNotify events
- * to correctly transfer the pointer from one window to another.
- * It is different from TkInOutEvents in that no template X event
- * needs to be supplied; this procedure generates the template
- * event and calls TkInOutEvents.
+ * This function synthesizes EnterNotify and LeaveNotify events to
+ * correctly transfer the pointer from one window to another. It is
+ * different from TkInOutEvents in that no template X event needs to be
+ * supplied; this function generates the template event and calls
+ * TkInOutEvents.
*
* Results:
* None.
@@ -1143,20 +1121,20 @@ TkInOutEvents(eventPtr, sourcePtr, destPtr, leaveType, enterType, position)
*/
static void
-MovePointer2(sourcePtr, destPtr, mode, leaveEvents, enterEvents)
- TkWindow *sourcePtr; /* Window currently containing pointer (NULL
+MovePointer2(
+ TkWindow *sourcePtr, /* Window currently containing pointer (NULL
* means it's not one managed by this
* process). */
- TkWindow *destPtr; /* Window that is to end up containing the
- * pointer (NULL means it's not one managed
- * by this process). */
- int mode; /* Mode for enter/leave events, such as
+ TkWindow *destPtr, /* Window that is to end up containing the
+ * pointer (NULL means it's not one managed by
+ * this process). */
+ int mode, /* Mode for enter/leave events, such as
* NotifyNormal or NotifyUngrab. */
- int leaveEvents; /* Non-zero means generate leave events for the
- * windows being left. Zero means don't
+ int leaveEvents, /* Non-zero means generate leave events for
+ * the windows being left. Zero means don't
* generate leave events. */
- int enterEvents; /* Non-zero means generate enter events for the
- * windows being entered. Zero means don't
+ int enterEvents) /* Non-zero means generate enter events for
+ * the windows being entered. Zero means don't
* generate enter events. */
{
XEvent event;
@@ -1172,12 +1150,10 @@ MovePointer2(sourcePtr, destPtr, mode, leaveEvents, enterEvents)
}
}
- event.xcrossing.serial = LastKnownRequestProcessed(
- winPtr->display);
+ event.xcrossing.serial = LastKnownRequestProcessed(winPtr->display);
event.xcrossing.send_event = GENERATED_EVENT_MAGIC;
event.xcrossing.display = winPtr->display;
- event.xcrossing.root = RootWindow(winPtr->display,
- winPtr->screenNum);
+ event.xcrossing.root = RootWindow(winPtr->display, winPtr->screenNum);
event.xcrossing.time = TkCurrentTime(winPtr->dispPtr);
XQueryPointer(winPtr->display, winPtr->window, &dummy1, &dummy2,
&event.xcrossing.x_root, &event.xcrossing.y_root,
@@ -1193,30 +1169,30 @@ MovePointer2(sourcePtr, destPtr, mode, leaveEvents, enterEvents)
*
* TkGrabDeadWindow --
*
- * This procedure is invoked whenever a window is deleted, so that
+ * This function is invoked whenever a window is deleted, so that
* grab-related cleanup can be performed.
*
* Results:
* None.
*
* Side effects:
- * Various cleanups happen, such as generating events to move the
- * pointer back to its "natural" window as if an ungrab had been
- * done. See the code.
+ * Various cleanups happen, such as generating events to move the pointer
+ * back to its "natural" window as if an ungrab had been done. See the
+ * code.
*
*----------------------------------------------------------------------
*/
void
-TkGrabDeadWindow(winPtr)
- register TkWindow *winPtr; /* Window that is in the process
- * of being deleted. */
+TkGrabDeadWindow(
+ register TkWindow *winPtr) /* Window that is in the process of being
+ * deleted. */
{
TkDisplay *dispPtr = winPtr->dispPtr;
if (dispPtr->eventualGrabWinPtr == winPtr) {
/*
- * Grab window was deleted. Release the grab.
+ * Grab window was deleted. Release the grab.
*/
Tk_Ungrab((Tk_Window) dispPtr->eventualGrabWinPtr);
@@ -1240,26 +1216,25 @@ TkGrabDeadWindow(winPtr)
*
* EatGrabEvents --
*
- * This procedure is called to eliminate any Enter, Leave,
- * FocusIn, or FocusOut events in the event queue for a
- * display that have mode NotifyGrab or NotifyUngrab and
- * have a serial number no less than a given value and are not
- * generated by the grab module.
+ * This function is called to eliminate any Enter, Leave, FocusIn, or
+ * FocusOut events in the event queue for a display that have mode
+ * NotifyGrab or NotifyUngrab and have a serial number no less than a
+ * given value and are not generated by the grab module.
*
* Results:
* None.
*
* Side effects:
- * DispPtr's display gets sync-ed, and some of the events get
- * removed from the Tk event queue.
+ * DispPtr's display gets sync-ed, and some of the events get removed
+ * from the Tk event queue.
*
*----------------------------------------------------------------------
*/
static void
-EatGrabEvents(dispPtr, serial)
- TkDisplay *dispPtr; /* Display from which to consume events. */
- unsigned int serial; /* Only discard events that have a serial
+EatGrabEvents(
+ TkDisplay *dispPtr, /* Display from which to consume events. */
+ unsigned int serial) /* Only discard events that have a serial
* number at least this great. */
{
Tk_RestrictProc *oldProc;
@@ -1280,10 +1255,10 @@ EatGrabEvents(dispPtr, serial)
*
* GrabRestrictProc --
*
- * A Tk_RestrictProc used by EatGrabEvents to eliminate any
- * Enter, Leave, FocusIn, or FocusOut events in the event queue
- * for a display that has mode NotifyGrab or NotifyUngrab and
- * have a serial number no less than a given value.
+ * A Tk_RestrictProc used by EatGrabEvents to eliminate any Enter, Leave,
+ * FocusIn, or FocusOut events in the event queue for a display that has
+ * mode NotifyGrab or NotifyUngrab and have a serial number no less than
+ * a given value.
*
* Results:
* Returns either TK_DISCARD_EVENT or TK_DEFER_EVENT.
@@ -1295,17 +1270,17 @@ EatGrabEvents(dispPtr, serial)
*/
static Tk_RestrictAction
-GrabRestrictProc(arg, eventPtr)
- ClientData arg;
- XEvent *eventPtr;
+GrabRestrictProc(
+ ClientData arg,
+ XEvent *eventPtr)
{
GrabInfo *info = (GrabInfo *) arg;
int mode, diff;
/*
- * The diff caculation is trickier than it may seem. Don't forget
- * that serial numbers can wrap around, so can't compare the two
- * serial numbers directly.
+ * The diff caculation is trickier than it may seem. Don't forget that
+ * serial numbers can wrap around, so can't compare the two serial numbers
+ * directly.
*/
diff = eventPtr->xany.serial - info->serial;
@@ -1331,29 +1306,28 @@ GrabRestrictProc(arg, eventPtr)
*
* QueueGrabWindowChange --
*
- * This procedure queues a special event in the Tcl event queue,
- * which will cause the "grabWinPtr" field for the display to get
- * modified when the event is processed. This is needed to make
- * sure that the grab window changes at the proper time relative
- * to grab-related enter and leave events that are also in the
- * queue. In particular, this approach works even when multiple
- * grabs and ungrabs happen back-to-back.
+ * This function queues a special event in the Tcl event queue, which
+ * will cause the "grabWinPtr" field for the display to get modified when
+ * the event is processed. This is needed to make sure that the grab
+ * window changes at the proper time relative to grab-related enter and
+ * leave events that are also in the queue. In particular, this approach
+ * works even when multiple grabs and ungrabs happen back-to-back.
*
* Results:
* None.
*
* Side effects:
- * DispPtr->grabWinPtr will be modified later (by GrabWinEventProc)
- * when the event is removed from the grab event queue.
+ * DispPtr->grabWinPtr will be modified later (by GrabWinEventProc) when
+ * the event is removed from the grab event queue.
*
*----------------------------------------------------------------------
*/
static void
-QueueGrabWindowChange(dispPtr, grabWinPtr)
- TkDisplay *dispPtr; /* Display on which to change the grab
+QueueGrabWindowChange(
+ TkDisplay *dispPtr, /* Display on which to change the grab
* window. */
- TkWindow *grabWinPtr; /* Window that is to become the new grab
+ TkWindow *grabWinPtr) /* Window that is to become the new grab
* window (may be NULL). */
{
NewGrabWinEvent *grabEvPtr;
@@ -1375,25 +1349,25 @@ QueueGrabWindowChange(dispPtr, grabWinPtr)
*
* GrabWinEventProc --
*
- * This procedure is invoked as a handler for Tcl_Events of type
- * NewGrabWinEvent. It updates the current grab window field in
- * a display.
+ * This function is invoked as a handler for Tcl_Events of type
+ * NewGrabWinEvent. It updates the current grab window field in a
+ * display.
*
* Results:
- * Returns 1 if the event was processed, 0 if it should be deferred
- * for processing later.
+ * Returns 1 if the event was processed, 0 if it should be deferred for
+ * processing later.
*
* Side effects:
- * The grabWinPtr field is modified in the display associated with
- * the event.
+ * The grabWinPtr field is modified in the display associated with the
+ * event.
*
*----------------------------------------------------------------------
*/
static int
-GrabWinEventProc(evPtr, flags)
- Tcl_Event *evPtr; /* Event of type NewGrabWinEvent. */
- int flags; /* Flags argument to Tk_DoOneEvent: indicates
+GrabWinEventProc(
+ Tcl_Event *evPtr, /* Event of type NewGrabWinEvent. */
+ int flags) /* Flags argument to Tk_DoOneEvent: indicates
* what kinds of events are being processed
* right now. */
{
@@ -1409,19 +1383,19 @@ GrabWinEventProc(evPtr, flags)
*
* FindCommonAncestor --
*
- * Given two windows, this procedure finds their least common
- * ancestor and also computes how many levels up this ancestor
- * is from each of the original windows.
+ * Given two windows, this function finds their least common ancestor and
+ * also computes how many levels up this ancestor is from each of the
+ * original windows.
*
* Results:
- * If the windows are in different applications or top-level
- * windows, then NULL is returned and *countPtr1 and *countPtr2
- * are set to the depths of the two windows in their respective
- * top-level windows (1 means the window is a top-level, 2 means
- * its parent is a top-level, and so on). Otherwise, the return
- * value is a pointer to the common ancestor and the counts are
- * set to the distance of winPtr1 and winPtr2 from this ancestor
- * (1 means they're children, 2 means grand-children, etc.).
+ * If the windows are in different applications or top-level windows,
+ * then NULL is returned and *countPtr1 and *countPtr2 are set to the
+ * depths of the two windows in their respective top-level windows (1
+ * means the window is a top-level, 2 means its parent is a top-level,
+ * and so on). Otherwise, the return value is a pointer to the common
+ * ancestor and the counts are set to the distance of winPtr1 and winPtr2
+ * from this ancestor (1 means they're children, 2 means grand-children,
+ * etc.).
*
* Side effects:
* None.
@@ -1430,12 +1404,12 @@ GrabWinEventProc(evPtr, flags)
*/
static TkWindow *
-FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
- TkWindow *winPtr1; /* First window. May be NULL. */
- TkWindow *winPtr2; /* Second window. May be NULL. */
- int *countPtr1; /* Store nesting level of winPtr1 within
+FindCommonAncestor(
+ TkWindow *winPtr1, /* First window. May be NULL. */
+ TkWindow *winPtr2, /* Second window. May be NULL. */
+ int *countPtr1, /* Store nesting level of winPtr1 within
* common ancestor here. */
- int *countPtr2; /* Store nesting level of winPtr2 within
+ int *countPtr2) /* Store nesting level of winPtr2 within
* common ancestor here. */
{
register TkWindow *winPtr;
@@ -1456,8 +1430,8 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
}
/*
- * Search upwards from winPtr2 until an ancestor of winPtr1 is
- * found or a top-level window is reached.
+ * Search upwards from winPtr2 until an ancestor of winPtr1 is found or a
+ * top-level window is reached.
*/
winPtr = winPtr2;
@@ -1510,15 +1484,13 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
*
* TkPositionInTree --
*
- * Compute where the given window is relative to a particular
- * subtree of the window hierarchy.
+ * Compute where the given window is relative to a particular subtree of
+ * the window hierarchy.
*
* Results:
- *
- * Returns TK_GRAB_IN_TREE if the window is contained in the
- * subtree. Returns TK_GRAB_ANCESTOR if the window is an
- * ancestor of the subtree, in the same toplevel. Otherwise
- * it returns TK_GRAB_EXCLUDED.
+ * Returns TK_GRAB_IN_TREE if the window is contained in the subtree.
+ * Returns TK_GRAB_ANCESTOR if the window is an ancestor of the subtree,
+ * in the same toplevel. Otherwise it returns TK_GRAB_EXCLUDED.
*
* Side effects:
* None.
@@ -1527,9 +1499,9 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
*/
int
-TkPositionInTree(winPtr, treePtr)
- TkWindow *winPtr; /* Window to be checked. */
- TkWindow *treePtr; /* Root of tree to compare against. */
+TkPositionInTree(
+ TkWindow *winPtr, /* Window to be checked. */
+ TkWindow *treePtr) /* Root of tree to compare against. */
{
TkWindow *winPtr2;
@@ -1556,21 +1528,20 @@ TkPositionInTree(winPtr, treePtr)
*
* TkGrabState --
*
- * Given a window, this procedure returns a value that indicates
- * the grab state of the application relative to the window.
+ * Given a window, this function returns a value that indicates the grab
+ * state of the application relative to the window.
*
* Results:
* The return value is one of three things:
* TK_GRAB_NONE - no grab is in effect.
- * TK_GRAB_IN_TREE - there is a grab in effect, and winPtr
- * is in the grabbed subtree.
- * TK_GRAB_ANCESTOR - there is a grab in effect; winPtr is
- * an ancestor of the grabbed window, in
- * the same toplevel.
- * TK_GRAB_EXCLUDED - there is a grab in effect; winPtr is
- * outside the tree of the grab and is not
- * an ancestor of the grabbed window in the
- * same toplevel.
+ * TK_GRAB_IN_TREE - there is a grab in effect, and winPtr is in
+ * the grabbed subtree.
+ * TK_GRAB_ANCESTOR - there is a grab in effect; winPtr is an
+ * ancestor of the grabbed window, in the same
+ * toplevel.
+ * TK_GRAB_EXCLUDED - there is a grab in effect; winPtr is outside
+ * the tree of the grab and is not an ancestor of
+ * the grabbed window in the same toplevel.
*
* Side effects:
* None.
@@ -1579,8 +1550,8 @@ TkPositionInTree(winPtr, treePtr)
*/
int
-TkGrabState(winPtr)
- TkWindow *winPtr; /* Window for which grab information is
+TkGrabState(
+ TkWindow *winPtr) /* Window for which grab information is
* needed. */
{
TkWindow *grabWinPtr = winPtr->dispPtr->grabWinPtr;
@@ -1595,3 +1566,11 @@ TkGrabState(winPtr)
return TkPositionInTree(winPtr, grabWinPtr);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index 008e321..c6a00d5 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -5,8 +5,8 @@
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkInt.h"
@@ -19,26 +19,22 @@
# undef MAX
#endif
#define MAX(x,y) ((x) > (y) ? (x) : (y))
-#ifdef MIN
-# undef MIN
-#endif
-#define MIN(x,y) ((x) > (y) ? (y) : (x))
-#define COLUMN (1) /* working on column offsets */
-#define ROW (2) /* working on row offsets */
+#define COLUMN (1) /* Working on column offsets. */
+#define ROW (2) /* Working on row offsets. */
-#define CHECK_ONLY (1) /* check max slot constraint */
-#define CHECK_SPACE (2) /* alloc more space, don't change max */
+#define CHECK_ONLY (1) /* Check max slot constraint. */
+#define CHECK_SPACE (2) /* Alloc more space, don't change max. */
/*
- * Pre-allocate enough row and column slots for "typical" sized tables
- * this value should be chosen so by the time the extra malloc's are
- * required, the layout calculations overwehlm them. [A "slot" contains
- * information for either a row or column, depending upon the context.]
+ * Pre-allocate enough row and column slots for "typical" sized tables this
+ * value should be chosen so by the time the extra malloc's are required, the
+ * layout calculations overwehlm them. [A "slot" contains information for
+ * either a row or column, depending upon the context.]
*/
-#define TYPICAL_SIZE 25 /* (arbitrary guess) */
-#define PREALLOC 10 /* extra slots to allocate */
+#define TYPICAL_SIZE 25 /* (Arbitrary guess) */
+#define PREALLOC 10 /* Extra slots to allocate. */
/*
* Pre-allocate room for uniform groups during layout.
@@ -46,10 +42,10 @@
#define UNIFORM_PREALLOC 10
-/*
- * Data structures are allocated dynamically to support arbitrary sized tables.
- * However, the space is proportional to the highest numbered slot with
- * some non-default property. This limit is used to head off mistakes and
+/*
+ * Data structures are allocated dynamically to support arbitrary sized
+ * tables. However, the space is proportional to the highest numbered slot
+ * with some non-default property. This limit is used to head off mistakes and
* denial of service attacks by limiting the amount of storage required.
*/
@@ -64,63 +60,67 @@
#define REL_VERT '^' /* Extend widget from row above. */
/*
- * Structure to hold information for grid masters. A slot is either
- * a row or column.
+ * Default value for 'grid anchor'.
+ */
+
+#define GRID_DEFAULT_ANCHOR TK_ANCHOR_NW
+
+/*
+ * Structure to hold information for grid masters. A slot is either a row or
+ * column.
*/
typedef struct SlotInfo {
- int minSize; /* The minimum size of this slot (in pixels).
+ int minSize; /* The minimum size of this slot (in pixels).
* It is set via the rowconfigure or
* columnconfigure commands. */
- int weight; /* The resize weight of this slot. (0) means
+ int weight; /* The resize weight of this slot. (0) means
* this slot doesn't resize. Extra space in
* the layout is given distributed among slots
* inproportion to their weights. */
- int pad; /* Extra padding, in pixels, required for
- * this slot. This amount is "added" to the
- * largest slave in the slot. */
- Tk_Uid uniform; /* Value of -uniform option. It is used to
+ int pad; /* Extra padding, in pixels, required for this
+ * slot. This amount is "added" to the largest
+ * slave in the slot. */
+ Tk_Uid uniform; /* Value of -uniform option. It is used to
* group slots that should have the same
* size. */
- int offset; /* This is a cached value used for
- * introspection. It is the pixel
- * offset of the right or bottom edge
- * of this slot from the beginning of the
- * layout. */
- int temp; /* This is a temporary value used for
- * calculating adjusted weights when
- * shrinking the layout below its
- * nominal size. */
+ int offset; /* This is a cached value used for
+ * introspection. It is the pixel offset of
+ * the right or bottom edge of this slot from
+ * the beginning of the layout. */
+ int temp; /* This is a temporary value used for
+ * calculating adjusted weights when shrinking
+ * the layout below its nominal size. */
} SlotInfo;
/*
- * Structure to hold information during layout calculations. There
- * is one of these for each slot, an array for each of the rows or columns.
+ * Structure to hold information during layout calculations. There is one of
+ * these for each slot, an array for each of the rows or columns.
*/
typedef struct GridLayout {
- struct Gridder *binNextPtr; /* The next slave window in this bin.
- * Each bin contains a list of all
- * slaves whose spans are >1 and whose
- * right edges fall in this slot. */
- int minSize; /* Minimum size needed for this slot,
- * in pixels. This is the space required
- * to hold any slaves contained entirely
- * in this slot, adjusted for any slot
- * constrants, such as size or padding. */
+ struct Gridder *binNextPtr; /* The next slave window in this bin. Each bin
+ * contains a list of all slaves whose spans
+ * are >1 and whose right edges fall in this
+ * slot. */
+ int minSize; /* Minimum size needed for this slot, in
+ * pixels. This is the space required to hold
+ * any slaves contained entirely in this slot,
+ * adjusted for any slot constrants, such as
+ * size or padding. */
int pad; /* Padding needed for this slot */
int weight; /* Slot weight, controls resizing. */
- Tk_Uid uniform; /* Value of -uniform option. It is used to
+ Tk_Uid uniform; /* Value of -uniform option. It is used to
* group slots that should have the same
* size. */
- int minOffset; /* The minimum offset, in pixels, from
- * the beginning of the layout to the
- * right/bottom edge of the slot calculated
- * from top/left to bottom/right. */
- int maxOffset; /* The maximum offset, in pixels, from
- * the beginning of the layout to the
- * right-or-bottom edge of the slot calculated
- * from bottom-or-right to top-or-left. */
+ int minOffset; /* The minimum offset, in pixels, from the
+ * beginning of the layout to the bottom/right
+ * edge of the slot calculated from top/left
+ * to bottom/right. */
+ int maxOffset; /* The maximum offset, in pixels, from the
+ * beginning of the layout to the bottom/right
+ * edge of the slot calculated from
+ * bottom/right to top/left. */
} GridLayout;
/*
@@ -136,81 +136,84 @@ typedef struct {
* column constraints. */
int rowEnd; /* The last row occupied by any slave. */
int rowMax; /* The number of rows with constraints. */
- int rowSpace; /* The number of slots currently allocated
- * for row constraints. */
+ int rowSpace; /* The number of slots currently allocated for
+ * row constraints. */
int startX; /* Pixel offset of this layout within its
- * parent. */
+ * master. */
int startY; /* Pixel offset of this layout within its
- * parent. */
+ * master. */
+ Tk_Anchor anchor; /* Value of anchor option: specifies where a
+ * grid without weight should be placed. */
} GridMaster;
/*
- * For each window that the grid cares about (either because
- * the window is managed by the grid or because the window
- * has slaves that are managed by the grid), there is a
- * structure of the following type:
+ * For each window that the grid cares about (either because the window is
+ * managed by the grid or because the window has slaves that are managed by
+ * the grid), there is a structure of the following type:
*/
typedef struct Gridder {
- Tk_Window tkwin; /* Tk token for window. NULL means that
- * the window has been deleted, but the
- * gridder hasn't had a chance to clean up
- * yet because the structure is still in
- * use. */
- struct Gridder *masterPtr; /* Master window within which this window
- * is managed (NULL means this window
- * isn't managed by the gridder). */
- struct Gridder *nextPtr; /* Next window managed within same
- * parent. List order doesn't matter. */
- struct Gridder *slavePtr; /* First in list of slaves managed
- * inside this window (NULL means
- * no grid slaves). */
+ Tk_Window tkwin; /* Tk token for window. NULL means that the
+ * window has been deleted, but the gridder
+ * hasn't had a chance to clean up yet because
+ * the structure is still in use. */
+ struct Gridder *masterPtr; /* Master window within which this window is
+ * managed (NULL means this window isn't
+ * managed by the gridder). */
+ struct Gridder *nextPtr; /* Next window managed within same master.
+ * List order doesn't matter. */
+ struct Gridder *slavePtr; /* First in list of slaves managed inside this
+ * window (NULL means no grid slaves). */
GridMaster *masterDataPtr; /* Additional data for geometry master. */
- int column, row; /* Location in the grid (starting
- * from zero). */
+ Tcl_Obj *in; /* Store master name when removed. */
+ int column, row; /* Location in the grid (starting from
+ * zero). */
int numCols, numRows; /* Number of columns or rows this slave spans.
* Should be at least 1. */
int padX, padY; /* Total additional pixels to leave around the
- * window. Some is of this space is on each
- * side. This is space *outside* the window:
+ * window. Some is of this space is on each
+ * side. This is space *outside* the window:
* we'll allocate extra space in frame but
* won't enlarge window). */
- int padLeft, padTop; /* The part of padX or padY to use on the
- * left or top of the widget, respectively.
- * By default, this is half of padX or padY. */
+ int padLeft, padTop; /* The part of padX or padY to use on the left
+ * or top of the widget, respectively. By
+ * default, this is half of padX or padY. */
int iPadX, iPadY; /* Total extra pixels to allocate inside the
* window (half this amount will appear on
* each side). */
int sticky; /* which sides of its cavity this window
* sticks to. See below for definitions */
- int doubleBw; /* Twice the window's last known border
- * width. If this changes, the window
- * must be re-arranged within its parent. */
- int *abortPtr; /* If non-NULL, it means that there is a nested
- * call to ArrangeGrid already working on
- * this window. *abortPtr may be set to 1 to
- * abort that nested call. This happens, for
- * example, if tkwin or any of its slaves
+ int doubleBw; /* Twice the window's last known border width.
+ * If this changes, the window must be
+ * re-arranged within its master. */
+ int *abortPtr; /* If non-NULL, it means that there is a
+ * nested call to ArrangeGrid already working
+ * on this window. *abortPtr may be set to 1
+ * to abort that nested call. This happens,
+ * for example, if tkwin or any of its slaves
* is deleted. */
- int flags; /* Miscellaneous flags; see below
- * for definitions. */
+ int flags; /* Miscellaneous flags; see below for
+ * definitions. */
/*
* These fields are used temporarily for layout calculations only.
*/
struct Gridder *binNextPtr; /* Link to next span>1 slave in this bin. */
- int size; /* Nominal size (width or height) in pixels
- * of the slave. This includes the padding. */
+ int size; /* Nominal size (width or height) in pixels of
+ * the slave. This includes the padding. */
} Gridder;
-/* Flag values for "sticky"ness The 16 combinations subsume the packer's
+/*
+ * Flag values for "sticky"ness. The 16 combinations subsume the packer's
* notion of anchor and fill.
*
- * STICK_NORTH This window sticks to the top of its cavity.
- * STICK_EAST This window sticks to the right edge of its cavity.
- * STICK_SOUTH This window sticks to the bottom of its cavity.
- * STICK_WEST This window sticks to the left edge of its cavity.
+ * STICK_NORTH This window sticks to the top of its cavity.
+ * STICK_EAST This window sticks to the right edge of its
+ * cavity.
+ * STICK_SOUTH This window sticks to the bottom of its cavity.
+ * STICK_WEST This window sticks to the left edge of its
+ * cavity.
*/
#define STICK_NORTH 1
@@ -231,14 +234,13 @@ typedef struct UniformGroup {
/*
* Flag values for Grid structures:
*
- * REQUESTED_RELAYOUT: 1 means a Tcl_DoWhenIdle request
- * has already been made to re-arrange
- * all the slaves of this window.
- *
- * DONT_PROPAGATE: 1 means don't set this window's requested
- * size. 0 means if this window is a master
- * then Tk will set its requested size to fit
- * the needs of its slaves.
+ * REQUESTED_RELAYOUT 1 means a Tcl_DoWhenIdle request has already
+ * been made to re-arrange all the slaves of this
+ * window.
+ * DONT_PROPAGATE 1 means don't set this window's requested
+ * size. 0 means if this window is a master then
+ * Tk will set its requested size to fit the
+ * needs of its slaves.
*/
#define REQUESTED_RELAYOUT 1
@@ -248,66 +250,71 @@ typedef struct UniformGroup {
* Prototypes for procedures used only in this file:
*/
-static void AdjustForSticky _ANSI_ARGS_((Gridder *slavePtr, int *xPtr,
- int *yPtr, int *widthPtr, int *heightPtr));
-static int AdjustOffsets _ANSI_ARGS_((int width,
- int elements, SlotInfo *slotPtr));
-static void ArrangeGrid _ANSI_ARGS_((ClientData clientData));
-static int CheckSlotData _ANSI_ARGS_((Gridder *masterPtr, int slot,
- int slotType, int checkOnly));
-static int ConfigureSlaves _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, int objc, Tcl_Obj *CONST objv[]));
-static void DestroyGrid _ANSI_ARGS_((char *memPtr));
-static Gridder *GetGrid _ANSI_ARGS_((Tk_Window tkwin));
-static int GridBboxCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridForgetRemoveCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridInfoCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridLocationCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridPropagateCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridRowColumnConfigureCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridSizeCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int GridSlavesCommand _ANSI_ARGS_((Tk_Window tkwin,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static void GridStructureProc _ANSI_ARGS_((
- ClientData clientData, XEvent *eventPtr));
-static void GridLostSlaveProc _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
-static void GridReqProc _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin));
-static void InitMasterData _ANSI_ARGS_((Gridder *masterPtr));
-static Tcl_Obj *NewPairObj _ANSI_ARGS_((Tcl_Interp*, int, int));
-static Tcl_Obj *NewQuadObj _ANSI_ARGS_((Tcl_Interp*, int, int, int, int));
-static int ResolveConstraints _ANSI_ARGS_((Gridder *gridPtr,
- int rowOrColumn, int maxOffset));
-static void SetGridSize _ANSI_ARGS_((Gridder *gridPtr));
-static int SetSlaveColumn _ANSI_ARGS_((Tcl_Interp *interp,
- Gridder *slavePtr, int column, int numCols));
-static int SetSlaveRow _ANSI_ARGS_((Tcl_Interp *interp,
- Gridder *slavePtr, int row, int numRows));
-static void StickyToString _ANSI_ARGS_((int flags, char *result));
-static int StringToSticky _ANSI_ARGS_((char *string));
-static void Unlink _ANSI_ARGS_((Gridder *gridPtr));
-
-static Tk_GeomMgr gridMgrType = {
+static void AdjustForSticky(Gridder *slavePtr, int *xPtr,
+ int *yPtr, int *widthPtr, int *heightPtr);
+static int AdjustOffsets(int width, int elements,
+ SlotInfo *slotPtr);
+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[]);
+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[]);
+static int GridBboxCommand(Tk_Window tkwin, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]);
+static int GridForgetRemoveCommand(Tk_Window tkwin,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static int GridInfoCommand(Tk_Window tkwin, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]);
+static int GridLocationCommand(Tk_Window tkwin,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static int GridPropagateCommand(Tk_Window tkwin,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static int GridRowColumnConfigureCommand(Tk_Window tkwin,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static int GridSizeCommand(Tk_Window tkwin, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]);
+static int GridSlavesCommand(Tk_Window tkwin, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]);
+static void GridStructureProc(ClientData clientData,
+ XEvent *eventPtr);
+static void GridLostSlaveProc(ClientData clientData,
+ Tk_Window tkwin);
+static void GridReqProc(ClientData clientData, Tk_Window tkwin);
+static void InitMasterData(Gridder *masterPtr);
+static Tcl_Obj * NewPairObj(int, int);
+static Tcl_Obj * NewQuadObj(int, int, int, int);
+static int ResolveConstraints(Gridder *gridPtr, int rowOrColumn,
+ int maxOffset);
+static void SetGridSize(Gridder *gridPtr);
+static int SetSlaveColumn(Tcl_Interp *interp, Gridder *slavePtr,
+ int column, int numCols);
+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 void Unlink(Gridder *gridPtr);
+
+static const Tk_GeomMgr gridMgrType = {
"grid", /* name */
GridReqProc, /* requestProc */
GridLostSlaveProc, /* lostSlaveProc */
};
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* Tk_GridCmd --
*
- * This procedure is invoked to process the "grid" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "grid" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -315,31 +322,32 @@ static Tk_GeomMgr gridMgrType = {
* Side effects:
* See the user documentation.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
int
-Tk_GridObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window tkwin = (Tk_Window) clientData;
static CONST char *optionStrings[] = {
- "bbox", "columnconfigure", "configure", "forget",
- "info", "location", "propagate", "remove",
- "rowconfigure", "size", "slaves", (char *) NULL };
+ "anchor", "bbox", "columnconfigure", "configure",
+ "forget", "info", "location", "propagate", "remove",
+ "rowconfigure", "size", "slaves", NULL
+ };
enum options {
- GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE, GRID_FORGET,
- GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, GRID_REMOVE,
- GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES };
+ GRID_ANCHOR, GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE,
+ GRID_FORGET, GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, GRID_REMOVE,
+ GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES
+ };
int index;
-
-
+
if (objc >= 2) {
char *argv1 = Tcl_GetString(objv[1]);
+
if ((argv1[0] == '.') || (argv1[0] == REL_SKIP) ||
(argv1[0] == REL_VERT)) {
return ConfigureSlaves(interp, tkwin, objc-1, objv+1);
@@ -356,22 +364,24 @@ Tk_GridObjCmd(clientData, interp, objc, objv)
}
switch ((enum options) index) {
- case GRID_BBOX:
+ case GRID_ANCHOR:
+ return GridAnchorCommand(tkwin, interp, objc, objv);
+ case GRID_BBOX:
return GridBboxCommand(tkwin, interp, objc, objv);
- case GRID_CONFIGURE:
+ case GRID_CONFIGURE:
return ConfigureSlaves(interp, tkwin, objc-2, objv+2);
- case GRID_FORGET:
- case GRID_REMOVE:
+ case GRID_FORGET:
+ case GRID_REMOVE:
return GridForgetRemoveCommand(tkwin, interp, objc, objv);
- case GRID_INFO:
+ case GRID_INFO:
return GridInfoCommand(tkwin, interp, objc, objv);
- case GRID_LOCATION:
+ case GRID_LOCATION:
return GridLocationCommand(tkwin, interp, objc, objv);
- case GRID_PROPAGATE:
+ case GRID_PROPAGATE:
return GridPropagateCommand(tkwin, interp, objc, objv);
- case GRID_SIZE:
+ case GRID_SIZE:
return GridSizeCommand(tkwin, interp, objc, objv);
- case GRID_SLAVES:
+ case GRID_SLAVES:
return GridSlavesCommand(tkwin, interp, objc, objv);
/*
@@ -383,8 +393,8 @@ Tk_GridObjCmd(clientData, interp, objc, objv)
* grid rowconfigure <master> <index> -option value -option value.
*/
- case GRID_COLUMNCONFIGURE:
- case GRID_ROWCONFIGURE:
+ case GRID_COLUMNCONFIGURE:
+ case GRID_ROWCONFIGURE:
return GridRowColumnConfigureCommand(tkwin, interp, objc, objv);
}
@@ -396,6 +406,75 @@ Tk_GridObjCmd(clientData, interp, objc, objv)
/*
*----------------------------------------------------------------------
*
+ * GridAnchorCommand --
+ *
+ * Implementation of the [grid anchor] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * May recompute grid geometry.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+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. */
+{
+ Tk_Window master;
+ Gridder *masterPtr;
+ GridMaster *gridPtr;
+ Tk_Anchor old;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?anchor?");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(master);
+
+ if (objc == 3) {
+ gridPtr = masterPtr->masterDataPtr;
+ Tcl_SetResult(interp, (char *) Tk_NameOfAnchor(gridPtr == NULL ?
+ GRID_DEFAULT_ANCHOR : gridPtr->anchor), TCL_VOLATILE);
+ return TCL_OK;
+ }
+
+ InitMasterData(masterPtr);
+ gridPtr = masterPtr->masterDataPtr;
+ old = gridPtr->anchor;
+ if (Tk_GetAnchorFromObj(interp, objv[3], &gridPtr->anchor) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Only request a relayout if the anchor changes.
+ */
+
+ if (old != gridPtr->anchor) {
+ if (masterPtr->abortPtr != NULL) {
+ *masterPtr->abortPtr = 1;
+ }
+ if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
+ masterPtr->flags |= REQUESTED_RELAYOUT;
+ Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* GridBboxCommand --
*
* Implementation of the [grid bbox] subcommand.
@@ -410,11 +489,11 @@ Tk_GridObjCmd(clientData, interp, objc, objv)
*/
static int
-GridBboxCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window master;
Gridder *masterPtr; /* master grid record */
@@ -424,17 +503,17 @@ GridBboxCommand(tkwin, interp, objc, objv)
int endX, endY; /* last column/row in the layout */
int x=0, y=0; /* starting pixels for this bounding box */
int width, height; /* size of the bounding box */
-
+
if (objc!=3 && objc != 5 && objc != 7) {
Tcl_WrongNumArgs(interp, 2, objv, "master ?column row ?column row??");
return TCL_ERROR;
}
-
+
if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
return TCL_ERROR;
}
masterPtr = GetGrid(master);
-
+
if (objc >= 5) {
if (Tcl_GetIntFromObj(interp, objv[3], &column) != TCL_OK) {
return TCL_ERROR;
@@ -445,7 +524,7 @@ GridBboxCommand(tkwin, interp, objc, objv)
column2 = column;
row2 = row;
}
-
+
if (objc == 7) {
if (Tcl_GetIntFromObj(interp, objv[5], &column2) != TCL_OK) {
return TCL_ERROR;
@@ -454,65 +533,70 @@ GridBboxCommand(tkwin, interp, objc, objv)
return TCL_ERROR;
}
}
-
+
gridPtr = masterPtr->masterDataPtr;
if (gridPtr == NULL) {
- Tcl_SetObjResult(interp, NewQuadObj(interp, 0, 0, 0, 0));
+ Tcl_SetObjResult(interp, NewQuadObj(0, 0, 0, 0));
return TCL_OK;
}
-
+
SetGridSize(masterPtr);
endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
-
+
if ((endX == 0) || (endY == 0)) {
- Tcl_SetObjResult(interp, NewQuadObj(interp, 0, 0, 0, 0));
+ Tcl_SetObjResult(interp, NewQuadObj(0, 0, 0, 0));
return TCL_OK;
}
if (objc == 3) {
- row = column = 0;
+ row = 0;
+ column = 0;
row2 = endY;
column2 = endX;
}
-
+
if (column > column2) {
int temp = column;
- column = column2, column2 = temp;
+
+ column = column2;
+ column2 = temp;
}
if (row > row2) {
int temp = row;
- row = row2, row2 = temp;
+
+ row = row2;
+ row2 = temp;
}
-
+
if (column > 0 && column < endX) {
x = gridPtr->columnPtr[column-1].offset;
- } else if (column > 0) {
+ } else if (column > 0) {
x = gridPtr->columnPtr[endX-1].offset;
}
-
+
if (row > 0 && row < endY) {
y = gridPtr->rowPtr[row-1].offset;
} else if (row > 0) {
y = gridPtr->rowPtr[endY-1].offset;
}
-
+
if (column2 < 0) {
width = 0;
} else if (column2 >= endX) {
width = gridPtr->columnPtr[endX-1].offset - x;
} else {
width = gridPtr->columnPtr[column2].offset - x;
- }
-
+ }
+
if (row2 < 0) {
height = 0;
} else if (row2 >= endY) {
height = gridPtr->rowPtr[endY-1].offset - y;
} else {
height = gridPtr->rowPtr[row2].offset - y;
- }
-
- Tcl_SetObjResult(interp, NewQuadObj(interp,
+ }
+
+ Tcl_SetObjResult(interp, NewQuadObj(
x + gridPtr->startX, y + gridPtr->startY, width, height));
return TCL_OK;
}
@@ -522,8 +606,8 @@ GridBboxCommand(tkwin, interp, objc, objv)
*
* GridForgetRemoveCommand --
*
- * Implementation of the [grid forget]/[grid remove] subcommands.
- * See the user documentation for details on what these do.
+ * Implementation of the [grid forget]/[grid remove] subcommands. See the
+ * user documentation for details on what these do.
*
* Results:
* Standard Tcl result.
@@ -535,18 +619,18 @@ GridBboxCommand(tkwin, interp, objc, objv)
*/
static int
-GridForgetRemoveCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window slave;
Gridder *slavePtr;
int i;
char *string = Tcl_GetString(objv[1]);
char c = string[0];
-
+
for (i = 2; i < objc; i++) {
if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
return TCL_ERROR;
@@ -554,27 +638,48 @@ GridForgetRemoveCommand(tkwin, interp, objc, objv)
slavePtr = GetGrid(slave);
if (slavePtr->masterPtr != NULL) {
-
/*
* For "forget", reset all the settings to their defaults
*/
-
+
if (c == 'f') {
- slavePtr->column = slavePtr->row = -1;
+ slavePtr->column = -1;
+ slavePtr->row = -1;
slavePtr->numCols = 1;
slavePtr->numRows = 1;
- slavePtr->padX = slavePtr->padY = 0;
- slavePtr->padLeft = slavePtr->padTop = 0;
- slavePtr->iPadX = slavePtr->iPadY = 0;
+ slavePtr->padX = 0;
+ slavePtr->padY = 0;
+ slavePtr->padLeft = 0;
+ slavePtr->padTop = 0;
+ slavePtr->iPadX = 0;
+ slavePtr->iPadY = 0;
+ if (slavePtr->in != NULL) {
+ Tcl_DecrRefCount(slavePtr->in);
+ slavePtr->in = NULL;
+ }
slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
if (slavePtr->flags & REQUESTED_RELAYOUT) {
Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);
}
slavePtr->flags = 0;
slavePtr->sticky = 0;
+ } else {
+ /*
+ * When removing, store name of master to be able to
+ * restore it later, even if the master is recreated.
+ */
+
+ if (slavePtr->in != NULL) {
+ Tcl_DecrRefCount(slavePtr->in);
+ slavePtr->in = NULL;
+ }
+ if (slavePtr->masterPtr != NULL) {
+ slavePtr->in = Tcl_NewStringObj(
+ Tk_PathName(slavePtr->masterPtr->tkwin), -1);
+ Tcl_IncrRefCount(slavePtr->in);
+ }
}
- Tk_ManageGeometry(slave, (Tk_GeomMgr *) NULL,
- (ClientData) NULL);
+ Tk_ManageGeometry(slave, NULL, (ClientData) NULL);
if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
Tk_UnmaintainGeometry(slavePtr->tkwin,
slavePtr->masterPtr->tkwin);
@@ -591,7 +696,7 @@ GridForgetRemoveCommand(tkwin, interp, objc, objv)
*
* GridInfoCommand --
*
- * Implementation of the [grid info] subcommand. See the user
+ * Implementation of the [grid info] subcommand. See the user
* documentation for details on what it does.
*
* Results:
@@ -604,16 +709,16 @@ GridForgetRemoveCommand(tkwin, interp, objc, objv)
*/
static int
-GridInfoCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
register Gridder *slavePtr;
Tk_Window slave;
char buffer[64 + TCL_INTEGER_SPACE * 4];
-
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
@@ -626,19 +731,19 @@ GridInfoCommand(tkwin, interp, objc, objv)
Tcl_ResetResult(interp);
return TCL_OK;
}
-
+
Tcl_AppendElement(interp, "-in");
Tcl_AppendElement(interp, Tk_PathName(slavePtr->masterPtr->tkwin));
sprintf(buffer, " -column %d -row %d -columnspan %d -rowspan %d",
slavePtr->column, slavePtr->row,
slavePtr->numCols, slavePtr->numRows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
+ Tcl_AppendResult(interp, buffer, NULL);
TkPrintPadAmount(interp, "ipadx", slavePtr->iPadX/2, slavePtr->iPadX);
TkPrintPadAmount(interp, "ipady", slavePtr->iPadY/2, slavePtr->iPadY);
TkPrintPadAmount(interp, "padx", slavePtr->padLeft, slavePtr->padX);
TkPrintPadAmount(interp, "pady", slavePtr->padTop, slavePtr->padY);
StickyToString(slavePtr->sticky, buffer);
- Tcl_AppendResult(interp, " -sticky ", buffer, (char *) NULL);
+ Tcl_AppendResult(interp, " -sticky ", buffer, NULL);
return TCL_OK;
}
@@ -647,7 +752,7 @@ GridInfoCommand(tkwin, interp, objc, objv)
*
* GridLocationCommand --
*
- * Implementation of the [grid location] subcommand. See the user
+ * Implementation of the [grid location] subcommand. See the user
* documentation for details on what it does.
*
* Results:
@@ -660,58 +765,58 @@ GridInfoCommand(tkwin, interp, objc, objv)
*/
static int
-GridLocationCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window master;
- Gridder *masterPtr; /* master grid record */
- GridMaster *gridPtr; /* pointer to grid data */
+ Gridder *masterPtr; /* Master grid record. */
+ GridMaster *gridPtr; /* Pointer to grid data. */
register SlotInfo *slotPtr;
- int x, y; /* Offset in pixels, from edge of parent. */
- int i, j; /* Corresponding column and row indeces. */
- int endX, endY; /* end of grid */
-
+ int x, y; /* Offset in pixels, from edge of master. */
+ int i, j; /* Corresponding column and row indeces. */
+ int endX, endY; /* End of grid. */
+
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "master x y");
return TCL_ERROR;
}
-
+
if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
return TCL_ERROR;
}
-
+
if (Tk_GetPixelsFromObj(interp, master, objv[3], &x) != TCL_OK) {
return TCL_ERROR;
}
if (Tk_GetPixelsFromObj(interp, master, objv[4], &y) != TCL_OK) {
return TCL_ERROR;
}
-
+
masterPtr = GetGrid(master);
if (masterPtr->masterDataPtr == NULL) {
- Tcl_SetObjResult(interp, NewPairObj(interp, -1, -1));
+ Tcl_SetObjResult(interp, NewPairObj(-1, -1));
return TCL_OK;
}
gridPtr = masterPtr->masterDataPtr;
-
- /*
- * Update any pending requests. This is not always the
- * steady state value, as more configure events could be in
- * the pipeline, but its as close as its easy to get.
+
+ /*
+ * Update any pending requests. This is not always the steady state value,
+ * as more configure events could be in the pipeline, but its as close as
+ * its easy to get.
*/
-
+
while (masterPtr->flags & REQUESTED_RELAYOUT) {
Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);
- ArrangeGrid ((ClientData) masterPtr);
+ ArrangeGrid((ClientData) masterPtr);
}
SetGridSize(masterPtr);
endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
-
- slotPtr = masterPtr->masterDataPtr->columnPtr;
+
+ slotPtr = masterPtr->masterDataPtr->columnPtr;
if (x < masterPtr->masterDataPtr->startX) {
i = -1;
} else {
@@ -720,8 +825,8 @@ GridLocationCommand(tkwin, interp, objc, objv)
/* null body */
}
}
-
- slotPtr = masterPtr->masterDataPtr->rowPtr;
+
+ slotPtr = masterPtr->masterDataPtr->rowPtr;
if (y < masterPtr->masterDataPtr->startY) {
j = -1;
} else {
@@ -730,8 +835,8 @@ GridLocationCommand(tkwin, interp, objc, objv)
/* null body */
}
}
-
- Tcl_SetObjResult(interp, NewPairObj(interp, i, j));
+
+ Tcl_SetObjResult(interp, NewPairObj(i, j));
return TCL_OK;
}
@@ -740,7 +845,7 @@ GridLocationCommand(tkwin, interp, objc, objv)
*
* GridPropagateCommand --
*
- * Implementation of the [grid propagate] subcommand. See the user
+ * Implementation of the [grid propagate] subcommand. See the user
* documentation for details on what it does.
*
* Results:
@@ -753,16 +858,16 @@ GridLocationCommand(tkwin, interp, objc, objv)
*/
static int
-GridPropagateCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window master;
Gridder *masterPtr;
int propagate, old;
-
+
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
return TCL_ERROR;
@@ -780,9 +885,11 @@ GridPropagateCommand(tkwin, interp, objc, objv)
if (Tcl_GetBooleanFromObj(interp, objv[3], &propagate) != TCL_OK) {
return TCL_ERROR;
}
-
- /* Only request a relayout if the propagation bit changes */
-
+
+ /*
+ * Only request a relayout if the propagation bit changes.
+ */
+
old = !(masterPtr->flags & DONT_PROPAGATE);
if (propagate != old) {
if (propagate) {
@@ -790,12 +897,12 @@ GridPropagateCommand(tkwin, interp, objc, objv)
} else {
masterPtr->flags |= DONT_PROPAGATE;
}
-
+
/*
* Re-arrange the master to allow new geometry information to
* propagate upwards to the master's master.
*/
-
+
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
}
@@ -813,8 +920,7 @@ GridPropagateCommand(tkwin, interp, objc, objv)
* GridRowColumnConfigureCommand --
*
* Implementation of the [grid rowconfigure] and [grid columnconfigure]
- * subcommands. See the user documentation for details on what these
- * do.
+ * subcommands. See the user documentation for details on what these do.
*
* Results:
* Standard Tcl result.
@@ -826,27 +932,29 @@ GridPropagateCommand(tkwin, interp, objc, objv)
*/
static int
-GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
- Tk_Window master;
- Gridder *masterPtr;
+ Tk_Window master, slave;
+ Gridder *masterPtr, *slavePtr;
SlotInfo *slotPtr = NULL;
int slot; /* the column or row number */
int slotType; /* COLUMN or ROW */
int size; /* the configuration value */
- int checkOnly; /* check the size only */
int lObjc; /* Number of items in index list */
Tcl_Obj **lObjv; /* array of indices */
int ok; /* temporary TCL result code */
- int i, j;
+ int i, j, first, last;
char *string;
static CONST char *optionStrings[] = {
- "-minsize", "-pad", "-uniform", "-weight", (char *) NULL };
- enum options { ROWCOL_MINSIZE, ROWCOL_PAD, ROWCOL_UNIFORM, ROWCOL_WEIGHT };
+ "-minsize", "-pad", "-uniform", "-weight", NULL
+ };
+ enum options {
+ ROWCOL_MINSIZE, ROWCOL_PAD, ROWCOL_UNIFORM, ROWCOL_WEIGHT
+ };
int index;
Tcl_Obj *listCopy;
@@ -871,41 +979,40 @@ GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
if (lObjc == 0) {
Tcl_AppendResult(interp, "no ",
(slotType == COLUMN) ? "column" : "row",
- " indices specified", (char *) NULL);
+ " indices specified", NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
- checkOnly = ((objc == 4) || (objc == 5));
masterPtr = GetGrid(master);
- if (checkOnly && (lObjc > 1)) {
- Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
- Tcl_GetString(objv[1]),
- ": must specify a single element on retrieval", (char *) NULL);
- Tcl_DecrRefCount(listCopy);
- return TCL_ERROR;
- }
- for (j = 0; j < lObjc; j++) {
- if (Tcl_GetIntFromObj(interp, lObjv[j], &slot) != TCL_OK) {
+ first = 0; /* lint */
+ last = 0; /* lint */
+
+ if ((objc == 4) || (objc == 5)) {
+ if (lObjc != 1) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
+ Tcl_GetString(objv[1]),
+ ": must specify a single element on retrieval", NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
- ok = CheckSlotData(masterPtr, slot, slotType, checkOnly);
- if ((ok != TCL_OK) && ((objc < 4) || (objc > 5))) {
- Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
- Tcl_GetString(objv[1]), ": \"", Tcl_GetString(lObjv[j]),
- "\" is out of range", (char *) NULL);
+ if (Tcl_GetIntFromObj(interp, lObjv[0], &slot) != TCL_OK) {
+ Tcl_AppendResult(interp,
+ " (when retreiving options only integer indices are "
+ "allowed)", NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
- } else if (ok == TCL_OK) {
+ }
+ ok = CheckSlotData(masterPtr, slot, slotType, /* checkOnly */ 1);
+ if (ok == TCL_OK) {
slotPtr = (slotType == COLUMN) ?
masterPtr->masterDataPtr->columnPtr :
masterPtr->masterDataPtr->rowPtr;
}
/*
- * Return all of the options for this row or column. If the
- * request is out of range, return all 0's.
+ * Return all of the options for this row or column. If the request is
+ * out of range, return all 0's.
*/
if (objc == 4) {
@@ -939,116 +1046,200 @@ GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
}
/*
- * Loop through each option value pair, setting the values as
- * required. If only one option is given, with no value, the
- * current value is returned.
+ * If only one option is given, with no value, the current value is
+ * returned.
*/
- for (i = 4; i < objc; i += 2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[4], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ Tcl_DecrRefCount(listCopy);
+ return TCL_ERROR;
+ }
+ if (index == ROWCOL_MINSIZE) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj((ok == TCL_OK) ? slotPtr[slot].minSize : 0));
+ } else if (index == ROWCOL_WEIGHT) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj((ok == TCL_OK) ? slotPtr[slot].weight : 0));
+ } else if (index == ROWCOL_UNIFORM) {
+ Tk_Uid value = (ok == TCL_OK) ? slotPtr[slot].uniform : "";
+
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(value == NULL ? "" : value, -1));
+ } else if (index == ROWCOL_PAD) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewIntObj((ok == TCL_OK) ? slotPtr[slot].pad : 0));
+ }
+ Tcl_DecrRefCount(listCopy);
+ return TCL_OK;
+ }
+
+ for (j = 0; j < lObjc; j++) {
+ int allSlaves = 0;
+
+ if (Tcl_GetIntFromObj(NULL, lObjv[j], &slot) == TCL_OK) {
+ first = slot;
+ last = slot;
+ slavePtr = NULL;
+ } else if (strcmp(Tcl_GetString(lObjv[j]), "all") == 0) {
+ /*
+ * Make sure master is initialised.
+ */
+
+ InitMasterData(masterPtr);
+
+ slavePtr = masterPtr->slavePtr;
+ if (slavePtr == NULL) {
+ continue;
+ }
+ allSlaves = 1;
+ } else if (TkGetWindowFromObj(NULL, tkwin, lObjv[j], &slave)
+ == TCL_OK) {
+ /*
+ * Is it gridded in this master?
+ */
+
+ slavePtr = GetGrid(slave);
+ if (slavePtr->masterPtr != masterPtr) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
+ Tcl_GetString(objv[1]), ": the window \"",
+ Tcl_GetString(lObjv[j]), "\" is not managed by \"",
+ Tcl_GetString(objv[2]), "\"", NULL);
Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
}
- if (index == ROWCOL_MINSIZE) {
- if (objc == 5) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(
- (ok == TCL_OK) ? slotPtr[slot].minSize : 0));
- } else if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size)
- != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
- return TCL_ERROR;
- } else {
- slotPtr[slot].minSize = size;
- }
- } else if (index == ROWCOL_WEIGHT) {
- int wt;
- if (objc == 5) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(
- (ok == TCL_OK) ? slotPtr[slot].weight : 0));
- } else if (Tcl_GetIntFromObj(interp, objv[i+1], &wt)
- != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
- return TCL_ERROR;
- } else if (wt < 0) {
- Tcl_AppendResult(interp, "invalid arg \"",
- Tcl_GetString(objv[i]),
- "\": should be non-negative", (char *) NULL);
- Tcl_DecrRefCount(listCopy);
+ } else {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
+ Tcl_GetString(objv[1]), ": illegal index \"",
+ Tcl_GetString(lObjv[j]), "\"", NULL);
+ Tcl_DecrRefCount(listCopy);
+ return TCL_ERROR;
+ }
+
+ /*
+ * The outer loop is only to handle "all".
+ */
+
+ do {
+ if (slavePtr != NULL) {
+ first = (slotType == COLUMN) ?
+ slavePtr->column : slavePtr->row;
+ last = first - 1 + ((slotType == COLUMN) ?
+ slavePtr->numCols : slavePtr->numRows);
+ }
+
+ for (slot = first; slot <= last; slot++) {
+ ok = CheckSlotData(masterPtr, slot, slotType, /*checkOnly*/ 0);
+ if (ok != TCL_OK) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
+ Tcl_GetString(objv[1]), ": \"",
+ Tcl_GetString(lObjv[j]),
+ "\" is out of range", NULL);
+ Tcl_DecrRefCount(listCopy);
return TCL_ERROR;
- } else {
- slotPtr[slot].weight = wt;
}
- } else if (index == ROWCOL_UNIFORM) {
- if (objc == 5) {
- Tk_Uid value;
- value = (ok == TCL_OK) ? slotPtr[slot].uniform : "";
- if (value == NULL) {
- value = "";
+ slotPtr = (slotType == COLUMN) ?
+ masterPtr->masterDataPtr->columnPtr :
+ masterPtr->masterDataPtr->rowPtr;
+
+ /*
+ * Loop through each option value pair, setting the values as
+ * required.
+ */
+
+ for (i = 4; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
+ "option", 0, &index) != TCL_OK) {
+ Tcl_DecrRefCount(listCopy);
+ return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewStringObj(value, -1));
- } else {
- slotPtr[slot].uniform = Tk_GetUid(Tcl_GetString(objv[i+1]));
- if (slotPtr[slot].uniform != NULL &&
- slotPtr[slot].uniform[0] == 0) {
- slotPtr[slot].uniform = NULL;
+ if (index == ROWCOL_MINSIZE) {
+ if (Tk_GetPixelsFromObj(interp, master, objv[i+1],
+ &size) != TCL_OK) {
+ Tcl_DecrRefCount(listCopy);
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].minSize = size;
+ }
+ } else if (index == ROWCOL_WEIGHT) {
+ int wt;
+
+ if (Tcl_GetIntFromObj(interp,objv[i+1],&wt)!=TCL_OK) {
+ 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);
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].weight = wt;
+ }
+ } else if (index == ROWCOL_UNIFORM) {
+ slotPtr[slot].uniform =
+ Tk_GetUid(Tcl_GetString(objv[i+1]));
+ if (slotPtr[slot].uniform != NULL &&
+ slotPtr[slot].uniform[0] == 0) {
+ slotPtr[slot].uniform = NULL;
+ }
+ } else if (index == ROWCOL_PAD) {
+ if (Tk_GetPixelsFromObj(interp, master, objv[i+1],
+ &size) != TCL_OK) {
+ 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);
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].pad = size;
+ }
}
}
- } else if (index == ROWCOL_PAD) {
- if (objc == 5) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(
- (ok == TCL_OK) ? slotPtr[slot].pad : 0));
- } else if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size)
- != TCL_OK) {
- Tcl_DecrRefCount(listCopy);
- return TCL_ERROR;
- } else if (size < 0) {
- Tcl_AppendResult(interp, "invalid arg \"",
- Tcl_GetString(objv[i]),
- "\": should be non-negative", (char *) NULL);
- Tcl_DecrRefCount(listCopy);
- return TCL_ERROR;
- } else {
- slotPtr[slot].pad = size;
- }
}
- }
+ if (slavePtr != NULL) {
+ slavePtr = slavePtr->nextPtr;
+ }
+ } while ((allSlaves == 1) && (slavePtr != NULL));
}
Tcl_DecrRefCount(listCopy);
/*
- * If we changed a property, re-arrange the table,
- * and check for constraint shrinkage.
+ * We changed a property, re-arrange the table, and check for constraint
+ * shrinkage. A null slotPtr will occur for 'all' checks.
*/
- if (objc != 5) {
+ if (slotPtr != NULL) {
if (slotType == ROW) {
int last = masterPtr->masterDataPtr->rowMax - 1;
+
while ((last >= 0) && (slotPtr[last].weight == 0)
- && (slotPtr[last].pad == 0)
- && (slotPtr[last].minSize == 0)
+ && (slotPtr[last].pad == 0) && (slotPtr[last].minSize == 0)
&& (slotPtr[last].uniform == NULL)) {
last--;
}
masterPtr->masterDataPtr->rowMax = last+1;
} else {
int last = masterPtr->masterDataPtr->columnMax - 1;
+
while ((last >= 0) && (slotPtr[last].weight == 0)
- && (slotPtr[last].pad == 0)
- && (slotPtr[last].minSize == 0)
+ && (slotPtr[last].pad == 0) && (slotPtr[last].minSize == 0)
&& (slotPtr[last].uniform == NULL)) {
last--;
}
masterPtr->masterDataPtr->columnMax = last + 1;
}
+ }
- if (masterPtr->abortPtr != NULL) {
- *masterPtr->abortPtr = 1;
- }
- if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
- masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
- }
+ if (masterPtr->abortPtr != NULL) {
+ *masterPtr->abortPtr = 1;
+ }
+ if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
+ masterPtr->flags |= REQUESTED_RELAYOUT;
+ Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
}
return TCL_OK;
}
@@ -1058,7 +1249,7 @@ GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
*
* GridSizeCommand --
*
- * Implementation of the [grid size] subcommand. See the user
+ * Implementation of the [grid size] subcommand. See the user
* documentation for details on what it does.
*
* Results:
@@ -1071,16 +1262,16 @@ GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
*/
static int
-GridSizeCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window master;
Gridder *masterPtr;
GridMaster *gridPtr; /* pointer to grid data */
-
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
@@ -1090,15 +1281,15 @@ GridSizeCommand(tkwin, interp, objc, objv)
return TCL_ERROR;
}
masterPtr = GetGrid(master);
-
+
if (masterPtr->masterDataPtr != NULL) {
SetGridSize(masterPtr);
gridPtr = masterPtr->masterDataPtr;
- Tcl_SetObjResult(interp, NewPairObj(interp,
+ Tcl_SetObjResult(interp, NewPairObj(
MAX(gridPtr->columnEnd, gridPtr->columnMax),
MAX(gridPtr->rowEnd, gridPtr->rowMax)));
} else {
- Tcl_SetObjResult(interp, NewPairObj(interp, 0, 0));
+ Tcl_SetObjResult(interp, NewPairObj(0, 0));
}
return TCL_OK;
}
@@ -1108,42 +1299,42 @@ GridSizeCommand(tkwin, interp, objc, objv)
*
* GridSlavesCommand --
*
- * Implementation of the [grid slaves] subcommand. See the user
+ * Implementation of the [grid slaves] subcommand. See the user
* documentation for details on what it does.
*
* Results:
* Standard Tcl result.
*
* Side effects:
- * Places a list of slaves of the specified window in the
- * interpreter's result field.
+ * Places a list of slaves of the specified window in the interpreter's
+ * result field.
*
*----------------------------------------------------------------------
*/
static int
-GridSlavesCommand(tkwin, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+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. */
{
Tk_Window master;
Gridder *masterPtr; /* master grid record */
Gridder *slavePtr;
- int i, value;
+ int i, value, index;
int row = -1, column = -1;
static CONST char *optionStrings[] = {
- "-column", "-row", (char *) NULL };
+ "-column", "-row", NULL
+ };
enum options { SLAVES_COLUMN, SLAVES_ROW };
- int index;
Tcl_Obj *res;
-
+
if ((objc < 3) || ((objc % 2) == 0)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value...?");
return TCL_ERROR;
}
-
+
for (i = 3; i < objc; i += 2) {
if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
&index) != TCL_OK) {
@@ -1154,8 +1345,7 @@ GridSlavesCommand(tkwin, interp, objc, objv)
}
if (value < 0) {
Tcl_AppendResult(interp, Tcl_GetString(objv[i]),
- " is an invalid value: should NOT be < 0",
- (char *) NULL);
+ " is an invalid value: should NOT be < 0", NULL);
return TCL_ERROR;
}
if (index == SLAVES_COLUMN) {
@@ -1172,7 +1362,7 @@ GridSlavesCommand(tkwin, interp, objc, objv)
res = Tcl_NewListObj(0, NULL);
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
+ slavePtr = slavePtr->nextPtr) {
if (column>=0 && (slavePtr->column > column
|| slavePtr->column+slavePtr->numCols-1 < column)) {
continue;
@@ -1189,30 +1379,29 @@ GridSlavesCommand(tkwin, interp, objc, objv)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* GridReqProc --
*
- * This procedure is invoked by Tk_GeometryRequest for
- * windows managed by the grid.
+ * This procedure is invoked by Tk_GeometryRequest for windows managed by
+ * the grid.
*
* Results:
* None.
*
* Side effects:
- * Arranges for tkwin, and all its managed siblings, to
- * be re-arranged at the next idle point.
+ * Arranges for tkwin, and all its managed siblings, to be re-arranged at
+ * the next idle point.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-GridReqProc(clientData, tkwin)
- ClientData clientData; /* Grid's information about
- * window that got new preferred
- * geometry. */
- Tk_Window tkwin; /* Other Tk-related information
- * about the window. */
+GridReqProc(
+ ClientData clientData, /* Grid's information about window that got
+ * new preferred geometry. */
+ Tk_Window tkwin) /* Other Tk-related information about the
+ * window. */
{
register Gridder *gridPtr = (Gridder *) clientData;
@@ -1224,12 +1413,12 @@ GridReqProc(clientData, tkwin)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* GridLostSlaveProc --
*
- * This procedure is invoked by Tk whenever some other geometry
- * claims control over a slave that used to be managed by us.
+ * This procedure is invoked by Tk whenever some other geometry claims
+ * control over a slave that used to be managed by us.
*
* Results:
* None.
@@ -1237,14 +1426,14 @@ GridReqProc(clientData, tkwin)
* Side effects:
* Forgets all grid-related information about the slave.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-GridLostSlaveProc(clientData, tkwin)
- ClientData clientData; /* Grid structure for slave window that
- * was stolen away. */
- Tk_Window tkwin; /* Tk's handle for the slave window. */
+GridLostSlaveProc(
+ ClientData clientData, /* Grid structure for slave window that was
+ * stolen away. */
+ Tk_Window tkwin) /* Tk's handle for the slave window. */
{
register Gridder *slavePtr = (Gridder *) clientData;
@@ -1256,39 +1445,38 @@ GridLostSlaveProc(clientData, tkwin)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* AdjustOffsets --
*
- * This procedure adjusts the size of the layout to fit in the
- * space provided. If it needs more space, the extra is added
- * according to the weights. If it needs less, the space is removed
- * according to the weights, but at no time does the size drop below
- * the minsize specified for that slot.
+ * This procedure adjusts the size of the layout to fit in the space
+ * provided. If it needs more space, the extra is added according to the
+ * weights. If it needs less, the space is removed according to the
+ * weights, but at no time does the size drop below the minsize specified
+ * for that slot.
*
* Results:
- * The initial offset of the layout,
- * if all the weights are zero, else 0.
+ * The size used by the layout.
*
* Side effects:
* The slot offsets are modified to shrink the layout.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static int
-AdjustOffsets(size, slots, slotPtr)
- int size; /* The total layout size (in pixels). */
- int slots; /* Number of slots. */
- register SlotInfo *slotPtr; /* Pointer to slot array. */
+AdjustOffsets(
+ int size, /* The total layout size (in pixels). */
+ int slots, /* Number of slots. */
+ register SlotInfo *slotPtr) /* Pointer to slot array. */
{
register int slot; /* Current slot. */
int diff; /* Extra pixels needed to add to the layout. */
- int totalWeight = 0; /* Sum of the weights for all the slots. */
- int weight = 0; /* Sum of the weights so far. */
+ int totalWeight; /* Sum of the weights for all the slots. */
+ int weight; /* Sum of the weights so far. */
int minSize; /* Minimum possible layout size. */
- int newDiff; /* The most pixels that can be added on
- * the current pass. */
+ int newDiff; /* The most pixels that can be added on the
+ * current pass. */
diff = size - slotPtr[slots-1].offset;
@@ -1297,24 +1485,24 @@ AdjustOffsets(size, slots, slotPtr)
*/
if (diff == 0) {
- return(0);
+ return size;
}
/*
- * If all the weights are zero, center the layout in its parent if
- * there is extra space, else clip on the bottom/right.
+ * If all the weights are zero, there is nothing more to do.
*/
+ totalWeight = 0;
for (slot = 0; slot < slots; slot++) {
totalWeight += slotPtr[slot].weight;
}
- if (totalWeight == 0 ) {
- return(diff > 0 ? diff/2 : 0);
+ if (totalWeight == 0) {
+ return slotPtr[slots-1].offset;
}
/*
- * Add extra space according to the slot weights. This is done
+ * Add extra space according to the slot weights. This is done
* cumulatively to prevent round-off error accumulation.
*/
@@ -1324,13 +1512,13 @@ AdjustOffsets(size, slots, slotPtr)
weight += slotPtr[slot].weight;
slotPtr[slot].offset += diff * weight / totalWeight;
}
- return(0);
+ return size;
}
/*
- * The layout must shrink below its requested size. Compute the
- * minimum possible size by looking at the slot minSizes.
- * Store each slot's minimum size in temp.
+ * The layout must shrink below its requested size. Compute the minimum
+ * possible size by looking at the slot minSizes. Store each slot's
+ * minimum size in temp.
*/
minSize = 0;
@@ -1346,34 +1534,35 @@ AdjustOffsets(size, slots, slotPtr)
}
/*
- * If the requested size is less than the minimum required size,
- * set the slot sizes to their minimum values, then clip on the
- * bottom/right.
+ * If the requested size is less than the minimum required size, set the
+ * slot sizes to their minimum values.
*/
if (size <= minSize) {
int offset = 0;
+
for (slot = 0; slot < slots; slot++) {
offset += slotPtr[slot].temp;
slotPtr[slot].offset = offset;
}
- return(0);
+ return minSize;
}
/*
- * Remove space from slots according to their weights. The weights
- * get renormalized anytime a slot shrinks to its minimum size.
+ * Remove space from slots according to their weights. The weights get
+ * renormalized anytime a slot shrinks to its minimum size.
*/
while (diff < 0) {
-
/*
* Find the total weight for the shrinkable slots.
*/
- for (totalWeight=slot=0; slot < slots; slot++) {
+ totalWeight = 0;
+ for (slot = 0; slot < slots; slot++) {
int current = (slot == 0) ? slotPtr[slot].offset :
slotPtr[slot].offset - slotPtr[slot-1].offset;
+
if (current > slotPtr[slot].minSize) {
totalWeight += slotPtr[slot].weight;
slotPtr[slot].temp = slotPtr[slot].weight;
@@ -1391,9 +1580,10 @@ AdjustOffsets(size, slots, slotPtr)
newDiff = diff;
for (slot = 0; slot < slots; slot++) {
- int current; /* current size of this slot */
- int maxDiff; /* max diff that would cause
- * this slot to equal its minsize */
+ int current; /* Current size of this slot. */
+ int maxDiff; /* Maximum diff that would cause this slot to
+ * equal its minsize. */
+
if (slotPtr[slot].temp == 0) {
continue;
}
@@ -1410,43 +1600,44 @@ AdjustOffsets(size, slots, slotPtr)
* Now distribute the space.
*/
- for (weight=slot=0; slot < slots; slot++) {
+ weight = 0;
+ for (slot = 0; slot < slots; slot++) {
weight += slotPtr[slot].temp;
slotPtr[slot].offset += newDiff * weight / totalWeight;
}
diff -= newDiff;
}
- return(0);
+ return size;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* AdjustForSticky --
*
- * This procedure adjusts the size of a slave in its cavity based
- * on its "sticky" flags.
+ * This procedure adjusts the size of a slave in its cavity based on its
+ * "sticky" flags.
*
* Results:
- * The input x, y, width, and height are changed to represent the
- * desired coordinates of the slave.
+ * The input x, y, width, and height are changed to represent the desired
+ * coordinates of the slave.
*
* Side effects:
* None.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-AdjustForSticky(slavePtr, xPtr, yPtr, widthPtr, heightPtr)
- Gridder *slavePtr; /* Slave window to arrange in its cavity. */
- int *xPtr; /* Pixel location of the left edge of the cavity. */
- int *yPtr; /* Pixel location of the top edge of the cavity. */
- int *widthPtr; /* Width of the cavity (in pixels). */
- int *heightPtr; /* Height of the cavity (in pixels). */
+AdjustForSticky(
+ Gridder *slavePtr, /* Slave window to arrange in its cavity. */
+ int *xPtr, /* Pixel location of the left edge of the cavity. */
+ int *yPtr, /* Pixel location of the top edge of the cavity. */
+ int *widthPtr, /* Width of the cavity (in pixels). */
+ int *heightPtr) /* Height of the cavity (in pixels). */
{
- int diffx=0; /* Cavity width - slave width. */
- int diffy=0; /* Cavity hight - slave height. */
+ int diffx = 0; /* Cavity width - slave width. */
+ int diffy = 0; /* Cavity hight - slave height. */
int sticky = slavePtr->sticky;
*xPtr += slavePtr->padLeft;
@@ -1479,14 +1670,13 @@ AdjustForSticky(slavePtr, xPtr, yPtr, widthPtr, heightPtr)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* ArrangeGrid --
*
- * This procedure is invoked (using the Tcl_DoWhenIdle
- * mechanism) to re-layout a set of windows managed by
- * the grid. It is invoked at idle time so that a
- * series of grid requests can be merged into a single
+ * This procedure is invoked (using the Tcl_DoWhenIdle mechanism) to
+ * re-layout a set of windows managed by the grid. It is invoked at idle
+ * time so that a series of grid requests can be merged into a single
* layout operation.
*
* Results:
@@ -1495,28 +1685,29 @@ AdjustForSticky(slavePtr, xPtr, yPtr, widthPtr, heightPtr)
* Side effects:
* The slaves of masterPtr may get resized or moved.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-ArrangeGrid(clientData)
- ClientData clientData; /* Structure describing parent whose slaves
+ArrangeGrid(
+ ClientData clientData) /* Structure describing master whose slaves
* are to be re-layed out. */
{
register Gridder *masterPtr = (Gridder *) clientData;
- register Gridder *slavePtr;
+ register Gridder *slavePtr;
GridMaster *slotPtr = masterPtr->masterDataPtr;
int abort;
- int width, height; /* requested size of layout, in pixels */
- int realWidth, realHeight; /* actual size layout should take-up */
+ int width, height; /* Requested size of layout, in pixels. */
+ int realWidth, realHeight; /* Actual size layout should take-up. */
+ int usedX, usedY;
masterPtr->flags &= ~REQUESTED_RELAYOUT;
/*
- * If the parent has no slaves anymore, then don't do anything
- * at all: just leave the parent's size as-is. Otherwise there is
- * no way to "relinquish" control over the parent so another geometry
- * manager can take over.
+ * If the master has no slaves anymore, then don't do anything at all:
+ * just leave the master's size as-is. Otherwise there is no way to
+ * "relinquish" control over the master so another geometry manager can
+ * take over.
*/
if (masterPtr->slavePtr == NULL) {
@@ -1528,9 +1719,9 @@ ArrangeGrid(clientData)
}
/*
- * Abort any nested call to ArrangeGrid for this window, since
- * we'll do everything necessary here, and set up so this call
- * can be aborted if necessary.
+ * Abort any nested call to ArrangeGrid for this window, since we'll do
+ * everything necessary here, and set up so this call can be aborted if
+ * necessary.
*/
if (masterPtr->abortPtr != NULL) {
@@ -1545,13 +1736,13 @@ ArrangeGrid(clientData)
*/
SetGridSize(masterPtr);
- width = ResolveConstraints(masterPtr, COLUMN, 0);
+ width = ResolveConstraints(masterPtr, COLUMN, 0);
height = ResolveConstraints(masterPtr, ROW, 0);
width += Tk_InternalBorderLeft(masterPtr->tkwin) +
Tk_InternalBorderRight(masterPtr->tkwin);
height += Tk_InternalBorderTop(masterPtr->tkwin) +
Tk_InternalBorderBottom(masterPtr->tkwin);
-
+
if (width < Tk_MinReqWidth(masterPtr->tkwin)) {
width = Tk_MinReqWidth(masterPtr->tkwin);
}
@@ -1569,15 +1760,14 @@ ArrangeGrid(clientData)
}
masterPtr->abortPtr = NULL;
Tcl_Release((ClientData) masterPtr);
- return;
+ return;
}
/*
- * If the currently requested layout size doesn't match the parent's
- * window size, then adjust the slot offsets according to the
- * weights. If all of the weights are zero, center the layout in
- * its parent. I haven't decided what to do if the parent is smaller
- * than the requested size.
+ * If the currently requested layout size doesn't match the master's
+ * window size, then adjust the slot offsets according to the weights. If
+ * all of the weights are zero, place the layout according to the anchor
+ * value.
*/
realWidth = Tk_Width(masterPtr->tkwin) -
@@ -1586,23 +1776,22 @@ ArrangeGrid(clientData)
realHeight = Tk_Height(masterPtr->tkwin) -
Tk_InternalBorderTop(masterPtr->tkwin) -
Tk_InternalBorderBottom(masterPtr->tkwin);
- slotPtr->startX = AdjustOffsets(realWidth,
- MAX(slotPtr->columnEnd,slotPtr->columnMax), slotPtr->columnPtr);
- slotPtr->startY = AdjustOffsets(realHeight,
- MAX(slotPtr->rowEnd,slotPtr->rowMax), slotPtr->rowPtr);
- slotPtr->startX += Tk_InternalBorderLeft(masterPtr->tkwin);
- slotPtr->startY += Tk_InternalBorderTop(masterPtr->tkwin);
+ usedX = AdjustOffsets(realWidth,
+ MAX(slotPtr->columnEnd, slotPtr->columnMax), slotPtr->columnPtr);
+ usedY = AdjustOffsets(realHeight, MAX(slotPtr->rowEnd, slotPtr->rowMax),
+ slotPtr->rowPtr);
+ TkComputeAnchor(masterPtr->masterDataPtr->anchor, masterPtr->tkwin,
+ 0, 0, usedX, usedY, &slotPtr->startX, &slotPtr->startY);
/*
- * Now adjust the actual size of the slave to its cavity by
- * computing the cavity size, and adjusting the widget according
- * to its stickyness.
+ * Now adjust the actual size of the slave to its cavity by computing the
+ * cavity size, and adjusting the widget according to its stickyness.
*/
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL && !abort;
slavePtr = slavePtr->nextPtr) {
- int x, y; /* top left coordinate */
- int width, height; /* slot or slave size */
+ int x, y; /* Top left coordinate */
+ int width, height; /* Slot or slave size */
int col = slavePtr->column;
int row = slavePtr->row;
@@ -1612,49 +1801,47 @@ ArrangeGrid(clientData)
width = slotPtr->columnPtr[slavePtr->numCols+col-1].offset - x;
height = slotPtr->rowPtr[slavePtr->numRows+row-1].offset - y;
- x += slotPtr->startX;
- y += slotPtr->startY;
+ x += slotPtr->startX;
+ y += slotPtr->startY;
AdjustForSticky(slavePtr, &x, &y, &width, &height);
/*
- * Now put the window in the proper spot. (This was taken directly
- * from tkPack.c.) If the slave is a child of the master, then
- * do this here. Otherwise let Tk_MaintainGeometry do the work.
- */
-
- if (masterPtr->tkwin == Tk_Parent(slavePtr->tkwin)) {
- if ((width <= 0) || (height <= 0)) {
- Tk_UnmapWindow(slavePtr->tkwin);
- } else {
- if ((x != Tk_X(slavePtr->tkwin))
- || (y != Tk_Y(slavePtr->tkwin))
- || (width != Tk_Width(slavePtr->tkwin))
- || (height != Tk_Height(slavePtr->tkwin))) {
- Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
- }
- if (abort) {
- break;
- }
-
- /*
- * Don't map the slave if the master isn't mapped: wait
- * until the master gets mapped later.
- */
-
- if (Tk_IsMapped(masterPtr->tkwin)) {
- Tk_MapWindow(slavePtr->tkwin);
- }
- }
- } else {
- if ((width <= 0) || (height <= 0)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin, masterPtr->tkwin);
- Tk_UnmapWindow(slavePtr->tkwin);
- } else {
- Tk_MaintainGeometry(slavePtr->tkwin, masterPtr->tkwin,
- x, y, width, height);
- }
- }
+ * Now put the window in the proper spot. (This was taken directly
+ * from tkPack.c.) If the slave is a child of the master, then do this
+ * here. Otherwise let Tk_MaintainGeometry do the work.
+ */
+
+ if (masterPtr->tkwin == Tk_Parent(slavePtr->tkwin)) {
+ if ((width <= 0) || (height <= 0)) {
+ Tk_UnmapWindow(slavePtr->tkwin);
+ } else {
+ if ((x != Tk_X(slavePtr->tkwin))
+ || (y != Tk_Y(slavePtr->tkwin))
+ || (width != Tk_Width(slavePtr->tkwin))
+ || (height != Tk_Height(slavePtr->tkwin))) {
+ Tk_MoveResizeWindow(slavePtr->tkwin, x, y, width, height);
+ }
+ if (abort) {
+ break;
+ }
+
+ /*
+ * Don't map the slave if the master isn't mapped: wait until
+ * the master gets mapped later.
+ */
+
+ if (Tk_IsMapped(masterPtr->tkwin)) {
+ Tk_MapWindow(slavePtr->tkwin);
+ }
+ }
+ } else if ((width <= 0) || (height <= 0)) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin, masterPtr->tkwin);
+ Tk_UnmapWindow(slavePtr->tkwin);
+ } else {
+ Tk_MaintainGeometry(slavePtr->tkwin, masterPtr->tkwin, x, y,
+ width, height);
+ }
}
masterPtr->abortPtr = NULL;
@@ -1662,13 +1849,13 @@ ArrangeGrid(clientData)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* ResolveConstraints --
*
- * Resolve all of the column and row boundaries. Most of
- * the calculations are identical for rows and columns, so this procedure
- * is called twice, once for rows, and again for columns.
+ * Resolve all of the column and row boundaries. Most of the calculations
+ * are identical for rows and columns, so this procedure is called twice,
+ * once for rows, and again for columns.
*
* Results:
* The offset (in pixels) from the left/top edge of this layout is
@@ -1678,34 +1865,34 @@ ArrangeGrid(clientData)
* The slot offsets are copied into the SlotInfo structure for the
* geometry master.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static int
-ResolveConstraints(masterPtr, slotType, maxOffset)
- Gridder *masterPtr; /* The geometry master for this grid. */
- int slotType; /* Either ROW or COLUMN. */
- int maxOffset; /* The actual maximum size of this layout
- * in pixels, or 0 (not currently used). */
+ResolveConstraints(
+ Gridder *masterPtr, /* The geometry master for this grid. */
+ int slotType, /* Either ROW or COLUMN. */
+ int maxOffset) /* The actual maximum size of this layout in
+ * pixels, or 0 (not currently used). */
{
register SlotInfo *slotPtr; /* Pointer to row/col constraints. */
register Gridder *slavePtr; /* List of slave windows in this grid. */
int constraintCount; /* Count of rows or columns that have
- * constraints. */
+ * constraints. */
int slotCount; /* Last occupied row or column. */
- int gridCount; /* The larger of slotCount and constraintCount.
- */
+ int gridCount; /* The larger of slotCount and
+ * constraintCount. */
GridLayout *layoutPtr; /* Temporary layout structure. */
int requiredSize; /* The natural size of the grid (pixels).
* This is the minimum size needed to
* accomodate all of the slaves at their
* requested sizes. */
int offset; /* The pixel offset of the right edge of the
- * current slot from the beginning of the
- * layout. */
+ * current slot from the beginning of the
+ * layout. */
int slot; /* The current slot. */
int start; /* The first slot of a contiguous set whose
- * constraints are not yet fully resolved. */
+ * constraints are not yet fully resolved. */
int end; /* The Last slot of a contiguous set whose
* constraints are not yet fully resolved. */
UniformGroup uniformPre[UNIFORM_PREALLOC];
@@ -1713,13 +1900,14 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
UniformGroup *uniformGroupPtr;
/* Uniform groups data. */
int uniformGroups; /* Number of currently used uniform groups. */
- int uniformGroupsAlloced; /* Size of allocated space for uniform groups.
- */
+ int uniformGroupsAlloced; /* Size of allocated space for uniform
+ * groups. */
int weight, minSize;
+ int prevGrow, accWeight, grow;
/*
- * For typical sized tables, we'll use stack space for the layout data
- * to avoid the overhead of a malloc and free for every layout.
+ * For typical sized tables, we'll use stack space for the layout data to
+ * avoid the overhead of a malloc and free for every layout.
*/
GridLayout layoutData[TYPICAL_SIZE + 1];
@@ -1727,30 +1915,32 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
if (slotType == COLUMN) {
constraintCount = masterPtr->masterDataPtr->columnMax;
slotCount = masterPtr->masterDataPtr->columnEnd;
- slotPtr = masterPtr->masterDataPtr->columnPtr;
+ slotPtr = masterPtr->masterDataPtr->columnPtr;
} else {
constraintCount = masterPtr->masterDataPtr->rowMax;
slotCount = masterPtr->masterDataPtr->rowEnd;
- slotPtr = masterPtr->masterDataPtr->rowPtr;
+ slotPtr = masterPtr->masterDataPtr->rowPtr;
}
/*
* Make sure there is enough memory for the layout.
*/
- gridCount = MAX(constraintCount,slotCount);
+ gridCount = MAX(constraintCount, slotCount);
if (gridCount >= TYPICAL_SIZE) {
- layoutPtr = (GridLayout *) ckalloc(sizeof(GridLayout) * (1+gridCount));
+ layoutPtr = (GridLayout *)
+ ckalloc(sizeof(GridLayout) * (1+gridCount));
} else {
layoutPtr = layoutData;
}
/*
- * Allocate an extra layout slot to represent the left/top edge of
- * the 0th slot to make it easier to calculate slot widths from
- * offsets without special case code.
- * Initialize the "dummy" slot to the left/top of the table.
- * This slot avoids special casing the first slot.
+ * Allocate an extra layout slot to represent the left/top edge of the 0th
+ * slot to make it easier to calculate slot widths from offsets without
+ * special case code.
+ *
+ * Initialize the "dummy" slot to the left/top of the table. This slot
+ * avoids special casing the first slot.
*/
layoutPtr->minOffset = 0;
@@ -1759,74 +1949,77 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
/*
* Step 1.
- * Copy the slot constraints into the layout structure,
- * and initialize the rest of the fields.
+ * Copy the slot constraints into the layout structure, and initialize the
+ * rest of the fields.
*/
for (slot=0; slot < constraintCount; slot++) {
- layoutPtr[slot].minSize = slotPtr[slot].minSize;
- layoutPtr[slot].weight = slotPtr[slot].weight;
- layoutPtr[slot].uniform = slotPtr[slot].uniform;
- layoutPtr[slot].pad = slotPtr[slot].pad;
- layoutPtr[slot].binNextPtr = NULL;
+ layoutPtr[slot].minSize = slotPtr[slot].minSize;
+ layoutPtr[slot].weight = slotPtr[slot].weight;
+ layoutPtr[slot].uniform = slotPtr[slot].uniform;
+ layoutPtr[slot].pad = slotPtr[slot].pad;
+ layoutPtr[slot].binNextPtr = NULL;
}
- for(;slot<gridCount;slot++) {
- layoutPtr[slot].minSize = 0;
- layoutPtr[slot].weight = 0;
- layoutPtr[slot].uniform = NULL;
- layoutPtr[slot].pad = 0;
- layoutPtr[slot].binNextPtr = NULL;
+ for (; slot<gridCount; slot++) {
+ layoutPtr[slot].minSize = 0;
+ layoutPtr[slot].weight = 0;
+ layoutPtr[slot].uniform = NULL;
+ layoutPtr[slot].pad = 0;
+ layoutPtr[slot].binNextPtr = NULL;
}
/*
* Step 2.
- * Slaves with a span of 1 are used to determine the minimum size of
- * each slot. Slaves whose span is two or more slots don't
- * contribute to the minimum size of each slot directly, but can cause
- * slots to grow if their size exceeds the the sizes of the slots they
- * span.
- *
- * Bin all slaves whose spans are > 1 by their right edges. This
- * allows the computation on minimum and maximum possible layout
- * sizes at each slot boundary, without the need to re-sort the slaves.
+ * Slaves with a span of 1 are used to determine the minimum size of each
+ * slot. Slaves whose span is two or more slots don't contribute to the
+ * minimum size of each slot directly, but can cause slots to grow if
+ * their size exceeds the the sizes of the slots they span.
+ *
+ * Bin all slaves whose spans are > 1 by their right edges. This allows
+ * the computation on minimum and maximum possible layout sizes at each
+ * slot boundary, without the need to re-sort the slaves.
*/
-
+
switch (slotType) {
- case COLUMN:
- for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- int rightEdge = slavePtr->column + slavePtr->numCols - 1;
- slavePtr->size = Tk_ReqWidth(slavePtr->tkwin) +
- slavePtr->padX + slavePtr->iPadX + slavePtr->doubleBw;
- if (slavePtr->numCols > 1) {
- slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
- layoutPtr[rightEdge].binNextPtr = slavePtr;
- } else {
- int size = slavePtr->size + layoutPtr[rightEdge].pad;
- if (size > layoutPtr[rightEdge].minSize) {
- layoutPtr[rightEdge].minSize = size;
- }
+ case COLUMN:
+ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ slavePtr = slavePtr->nextPtr) {
+ int rightEdge = slavePtr->column + slavePtr->numCols - 1;
+
+ slavePtr->size = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->padX
+ + slavePtr->iPadX + slavePtr->doubleBw;
+ if (slavePtr->numCols > 1) {
+ slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
+ layoutPtr[rightEdge].binNextPtr = slavePtr;
+ } else {
+ int size = slavePtr->size + layoutPtr[rightEdge].pad;
+
+ if (size > layoutPtr[rightEdge].minSize) {
+ layoutPtr[rightEdge].minSize = size;
}
}
- break;
- case ROW:
- for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- int rightEdge = slavePtr->row + slavePtr->numRows - 1;
- slavePtr->size = Tk_ReqHeight(slavePtr->tkwin) +
- slavePtr->padY + slavePtr->iPadY + slavePtr->doubleBw;
- if (slavePtr->numRows > 1) {
- slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
- layoutPtr[rightEdge].binNextPtr = slavePtr;
- } else {
- int size = slavePtr->size + layoutPtr[rightEdge].pad;
- if (size > layoutPtr[rightEdge].minSize) {
- layoutPtr[rightEdge].minSize = size;
- }
+ }
+ break;
+ case ROW:
+ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ slavePtr = slavePtr->nextPtr) {
+ int rightEdge = slavePtr->row + slavePtr->numRows - 1;
+
+ slavePtr->size = Tk_ReqHeight(slavePtr->tkwin) + slavePtr->padY
+ + slavePtr->iPadY + slavePtr->doubleBw;
+ if (slavePtr->numRows > 1) {
+ slavePtr->binNextPtr = layoutPtr[rightEdge].binNextPtr;
+ layoutPtr[rightEdge].binNextPtr = slavePtr;
+ } else {
+ int size = slavePtr->size + layoutPtr[rightEdge].pad;
+
+ if (size > layoutPtr[rightEdge].minSize) {
+ layoutPtr[rightEdge].minSize = size;
}
}
- break;
}
+ break;
+ }
/*
* Step 2b.
@@ -1858,13 +2051,14 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
* sizeof(UniformGroup);
size_t newSize = (uniformGroupsAlloced + UNIFORM_PREALLOC)
* sizeof(UniformGroup);
- UniformGroup *new = (UniformGroup *) ckalloc(newSize);
- UniformGroup *old = uniformGroupPtr;
- memcpy((VOID *) new, (VOID *) old, oldSize);
- if (old != uniformPre) {
- ckfree((char *) old);
+ UniformGroup *newUG = (UniformGroup *) ckalloc(newSize);
+ UniformGroup *oldUG = uniformGroupPtr;
+
+ memcpy(newUG, oldUG, oldSize);
+ if (oldUG != uniformPre) {
+ ckfree((char *) oldUG);
}
- uniformGroupPtr = new;
+ uniformGroupPtr = newUG;
uniformGroupsAlloced += UNIFORM_PREALLOC;
}
uniformGroups++;
@@ -1907,54 +2101,58 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
/*
* Step 3.
- * Determine the minimum slot offsets going from left to right
- * that would fit all of the slaves. This determines the minimum
+ * Determine the minimum slot offsets going from left to right that would
+ * fit all of the slaves. This determines the minimum
*/
- for (offset=slot=0; slot < gridCount; slot++) {
- layoutPtr[slot].minOffset = layoutPtr[slot].minSize + offset;
- for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
- slavePtr = slavePtr->binNextPtr) {
- int span = (slotType == COLUMN) ? slavePtr->numCols : slavePtr->numRows;
- int required = slavePtr->size + layoutPtr[slot - span].minOffset;
- if (required > layoutPtr[slot].minOffset) {
- layoutPtr[slot].minOffset = required;
- }
- }
- offset = layoutPtr[slot].minOffset;
+ for (offset=0,slot=0; slot < gridCount; slot++) {
+ layoutPtr[slot].minOffset = layoutPtr[slot].minSize + offset;
+ for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
+ slavePtr = slavePtr->binNextPtr) {
+ int span = (slotType == COLUMN) ?
+ slavePtr->numCols : slavePtr->numRows;
+ int required = slavePtr->size + layoutPtr[slot - span].minOffset;
+
+ if (required > layoutPtr[slot].minOffset) {
+ layoutPtr[slot].minOffset = required;
+ }
+ }
+ offset = layoutPtr[slot].minOffset;
}
/*
* At this point, we know the minimum required size of the entire layout.
- * It might be prudent to stop here if our "master" will resize itself
- * to this size.
+ * It might be prudent to stop here if our "master" will resize itself to
+ * this size.
*/
requiredSize = offset;
if (maxOffset > offset) {
- offset=maxOffset;
+ offset=maxOffset;
}
/*
* Step 4.
- * Determine the minimum slot offsets going from right to left,
- * bounding the pixel range of each slot boundary.
- * Pre-fill all of the right offsets with the actual size of the table;
- * they will be reduced as required.
+ * Determine the minimum slot offsets going from right to left, bounding
+ * the pixel range of each slot boundary. Pre-fill all of the right
+ * offsets with the actual size of the table; they will be reduced as
+ * required.
*/
for (slot=0; slot < gridCount; slot++) {
- layoutPtr[slot].maxOffset = offset;
+ layoutPtr[slot].maxOffset = offset;
}
for (slot=gridCount-1; slot > 0;) {
- for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
- slavePtr = slavePtr->binNextPtr) {
- int span = (slotType == COLUMN) ? slavePtr->numCols : slavePtr->numRows;
- int require = offset - slavePtr->size;
- int startSlot = slot - span;
- if (startSlot >=0 && require < layoutPtr[startSlot].maxOffset) {
- layoutPtr[startSlot].maxOffset = require;
- }
+ for (slavePtr = layoutPtr[slot].binNextPtr; slavePtr != NULL;
+ slavePtr = slavePtr->binNextPtr) {
+ int span = (slotType == COLUMN) ?
+ slavePtr->numCols : slavePtr->numRows;
+ int require = offset - slavePtr->size;
+ int startSlot = slot - span;
+
+ if (startSlot >=0 && require < layoutPtr[startSlot].maxOffset) {
+ layoutPtr[startSlot].maxOffset = require;
+ }
}
offset -= layoutPtr[slot].minSize;
slot--;
@@ -1967,58 +2165,56 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
/*
* Step 5.
- * At this point, each slot boundary has a range of values that
- * will satisfy the overall layout size.
- * Make repeated passes over the layout structure looking for
- * spans of slot boundaries where the minOffsets are less than
- * the maxOffsets, and adjust the offsets according to the slot
- * weights. At each pass, at least one slot boundary will have
- * its range of possible values fixed at a single value.
+ * At this point, each slot boundary has a range of values that will
+ * satisfy the overall layout size. Make repeated passes over the layout
+ * structure looking for spans of slot boundaries where the minOffsets are
+ * less than the maxOffsets, and adjust the offsets according to the slot
+ * weights. At each pass, at least one slot boundary will have its range
+ * of possible values fixed at a single value.
*/
- for (start=0; start < gridCount;) {
- int totalWeight = 0; /* Sum of the weights for all of the
- * slots in this span. */
- int need = 0; /* The minimum space needed to layout
- * this span. */
- int have; /* The actual amount of space that will
- * be taken up by this span. */
- int weight; /* Cumulative weights of the columns in
- * this span. */
- int noWeights = 0; /* True if the span has no weights. */
-
- /*
- * Find a span by identifying ranges of slots whose edges are
- * already constrained at fixed offsets, but whose internal
- * slot boundaries have a range of possible positions.
- */
-
- if (layoutPtr[start].minOffset == layoutPtr[start].maxOffset) {
+ for (start = 0; start < gridCount;) {
+ int totalWeight = 0; /* Sum of the weights for all of the slots in
+ * this span. */
+ int need = 0; /* The minimum space needed to layout this
+ * span. */
+ int have; /* The actual amount of space that will be
+ * taken up by this span. */
+ int weight; /* Cumulative weights of the columns in this
+ * span. */
+ int noWeights = 0; /* True if the span has no weights. */
+
+ /*
+ * Find a span by identifying ranges of slots whose edges are already
+ * constrained at fixed offsets, but whose internal slot boundaries
+ * have a range of possible positions.
+ */
+
+ if (layoutPtr[start].minOffset == layoutPtr[start].maxOffset) {
start++;
continue;
}
- for (end=start+1; end<gridCount; end++) {
+ for (end = start + 1; end < gridCount; end++) {
if (layoutPtr[end].minOffset == layoutPtr[end].maxOffset) {
break;
}
}
/*
- * We found a span. Compute the total weight, minumum space required,
- * for this span, and the actual amount of space the span should
- * use.
+ * We found a span. Compute the total weight, minumum space required,
+ * for this span, and the actual amount of space the span should use.
*/
- for (slot=start; slot<=end; slot++) {
+ for (slot = start; slot <= end; slot++) {
totalWeight += layoutPtr[slot].weight;
need += layoutPtr[slot].minSize;
}
have = layoutPtr[end].maxOffset - layoutPtr[start-1].minOffset;
/*
- * If all the weights in the span are zero, then distribute the
- * extra space evenly.
+ * If all the weights in the span are zero, then distribute the extra
+ * space evenly.
*/
if (totalWeight == 0) {
@@ -2028,100 +2224,180 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
/*
* It might not be possible to give the span all of the space
- * available on this pass without violating the size constraints
- * of one or more of the internal slot boundaries.
- * Determine the maximum amount of space that when added to the
- * entire span, would cause a slot boundary to have its possible
- * range reduced to one value, and reduce the amount of extra
- * space allocated on this pass accordingly.
- *
- * The calculation is done cumulatively to avoid accumulating
- * roundoff errors.
+ * available on this pass without violating the size constraints of
+ * one or more of the internal slot boundaries. Try to determine the
+ * maximum amount of space that when added to the entire span, would
+ * cause a slot boundary to have its possible range reduced to one
+ * value, and reduce the amount of extra space allocated on this pass
+ * accordingly.
+ *
+ * The calculation is done cumulatively to avoid accumulating roundoff
+ * errors.
*/
- for (weight=0,slot=start; slot<end; slot++) {
- int diff = layoutPtr[slot].maxOffset - layoutPtr[slot].minOffset;
- weight += noWeights ? 1 : layoutPtr[slot].weight;
- if ((noWeights || layoutPtr[slot].weight>0) &&
- (diff*totalWeight/weight) < (have-need)) {
- have = diff * totalWeight / weight + need;
+ do {
+ int prevMinOffset = layoutPtr[start - 1].minOffset;
+
+ prevGrow = 0;
+ accWeight = 0;
+ for (slot = start; slot <= end; slot++) {
+ weight = noWeights ? 1 : layoutPtr[slot].weight;
+ accWeight += weight;
+ grow = (have - need) * accWeight / totalWeight - prevGrow;
+ prevGrow += grow;
+
+ if ((weight > 0) &&
+ ((prevMinOffset + layoutPtr[slot].minSize + grow)
+ > layoutPtr[slot].maxOffset)) {
+ int newHave;
+
+ /*
+ * There is not enough room to grow that much. Calculate
+ * how much this slot can grow and how much "have" that
+ * corresponds to.
+ */
+
+ grow = layoutPtr[slot].maxOffset -
+ layoutPtr[slot].minSize - prevMinOffset;
+ newHave = grow * totalWeight / weight;
+ if (newHave > totalWeight) {
+ /*
+ * By distributing multiples of totalWeight we
+ * minimize rounding errors since they will only
+ * happen in the last loop(s).
+ */
+
+ newHave = newHave / totalWeight * totalWeight;
+ }
+ if (newHave <= 0) {
+ /*
+ * We can end up with a "have" of 0 here if the
+ * previous slots have taken all the space. In that
+ * case we cannot guess an appropriate "have" so we
+ * just try some lower "have" that is >= 1, to make
+ * sure this terminates.
+ */
+
+ newHave = (have - need) - 1;
+ if (newHave > (3 * totalWeight)) {
+ /*
+ * Go down 25% for large values.
+ */
+ newHave = newHave * 3 / 4;
+ }
+
+ if (newHave > totalWeight) {
+ /*
+ * Round down to a multiple of totalWeight.
+ */
+ newHave = newHave / totalWeight * totalWeight;
+ }
+
+ if (newHave <= 0) {
+ newHave = 1;
+ }
+ }
+ have = newHave + need;
+
+ /*
+ * Restart loop to check if the new "have" will fit.
+ */
+
+ break;
+ }
+ prevMinOffset += layoutPtr[slot].minSize + grow;
+ if (prevMinOffset < layoutPtr[slot].minOffset) {
+ prevMinOffset = layoutPtr[slot].minOffset;
+ }
}
- }
+
+ /*
+ * Quit the outer loop if the inner loop ran all the way.
+ */
+ } while (slot <= end);
/*
- * Now distribute the extra space among the slots by
- * adjusting the minSizes and minOffsets.
+ * Now distribute the extra space among the slots by adjusting the
+ * minSizes and minOffsets.
*/
- for (weight=0,slot=start; slot<end; slot++) {
- weight += noWeights ? 1 : layoutPtr[slot].weight;
- layoutPtr[slot].minOffset +=
- (int)((double) (have-need) * weight/totalWeight + 0.5);
- layoutPtr[slot].minSize = layoutPtr[slot].minOffset
- - layoutPtr[slot-1].minOffset;
+ prevGrow = 0;
+ accWeight = 0;
+ for (slot = start; slot <= end; slot++) {
+ accWeight += noWeights ? 1 : layoutPtr[slot].weight;
+ grow = (have - need) * accWeight / totalWeight - prevGrow;
+ prevGrow += grow;
+ layoutPtr[slot].minSize += grow;
+ if ((layoutPtr[slot-1].minOffset + layoutPtr[slot].minSize)
+ > layoutPtr[slot].minOffset) {
+ layoutPtr[slot].minOffset = layoutPtr[slot-1].minOffset +
+ layoutPtr[slot].minSize;
+ }
}
- layoutPtr[slot].minSize = layoutPtr[slot].minOffset
- - layoutPtr[slot-1].minOffset;
/*
- * Having pushed the top/left boundaries of the slots to
- * take up extra space, the bottom/right space is recalculated
- * to propagate the new space allocation.
+ * Having pushed the top/left boundaries of the slots to take up extra
+ * space, the bottom/right space is recalculated to propagate the new
+ * space allocation.
*/
- for (slot=end; slot > start; slot--) {
- layoutPtr[slot-1].maxOffset =
- layoutPtr[slot].maxOffset-layoutPtr[slot].minSize;
+ for (slot = end; slot > start; slot--) {
+ /*
+ * maxOffset may not go up.
+ */
+
+ if ((layoutPtr[slot].maxOffset-layoutPtr[slot].minSize)
+ < layoutPtr[slot-1].maxOffset) {
+ layoutPtr[slot-1].maxOffset =
+ layoutPtr[slot].maxOffset-layoutPtr[slot].minSize;
+ }
}
}
-
/*
* Step 6.
- * All of the space has been apportioned; copy the
- * layout information back into the master.
+ * All of the space has been apportioned; copy the layout information back
+ * into the master.
*/
for (slot=0; slot < gridCount; slot++) {
- slotPtr[slot].offset = layoutPtr[slot].minOffset;
+ slotPtr[slot].offset = layoutPtr[slot].minOffset;
}
--layoutPtr;
if (layoutPtr != layoutData) {
- ckfree((char *)layoutPtr);
+ ckfree((char *) layoutPtr);
}
return requiredSize;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* GetGrid --
*
- * This internal procedure is used to locate a Grid
- * structure for a given window, creating one if one
- * doesn't exist already.
+ * This internal procedure is used to locate a Grid structure for a given
+ * window, creating one if one doesn't exist already.
*
* Results:
- * The return value is a pointer to the Grid structure
- * corresponding to tkwin.
+ * The return value is a pointer to the Grid structure corresponding to
+ * tkwin.
*
* Side effects:
- * A new grid structure may be created. If so, then
- * a callback is set up to clean things up when the
- * window is deleted.
+ * A new grid structure may be created. If so, then a callback is set up
+ * to clean things up when the window is deleted.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static Gridder *
-GetGrid(tkwin)
- Tk_Window tkwin; /* Token for window for which
- * grid structure is desired. */
+GetGrid(
+ Tk_Window tkwin) /* Token for window for which grid structure
+ * is desired. */
{
register Gridder *gridPtr;
Tcl_HashEntry *hPtr;
- int new;
+ int isNew;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (!dispPtr->gridInit) {
@@ -2130,12 +2406,12 @@ GetGrid(tkwin)
}
/*
- * See if there's already grid for this window. If not,
- * then create a new one.
+ * See if there's already grid for this window. If not, then create a new
+ * one.
*/
- hPtr = Tcl_CreateHashEntry(&dispPtr->gridHashTable, (char *) tkwin, &new);
- if (!new) {
+ hPtr = Tcl_CreateHashEntry(&dispPtr->gridHashTable, (char*) tkwin, &isNew);
+ if (!isNew) {
return (Gridder *) Tcl_GetHashValue(hPtr);
}
gridPtr = (Gridder *) ckalloc(sizeof(Gridder));
@@ -2146,18 +2422,23 @@ GetGrid(tkwin)
gridPtr->slavePtr = NULL;
gridPtr->binNextPtr = NULL;
- gridPtr->column = gridPtr->row = -1;
+ gridPtr->column = -1;
+ gridPtr->row = -1;
gridPtr->numCols = 1;
gridPtr->numRows = 1;
- gridPtr->padX = gridPtr->padY = 0;
- gridPtr->padLeft = gridPtr->padTop = 0;
- gridPtr->iPadX = gridPtr->iPadY = 0;
+ gridPtr->padX = 0;
+ gridPtr->padY = 0;
+ gridPtr->padLeft = 0;
+ gridPtr->padTop = 0;
+ gridPtr->iPadX = 0;
+ gridPtr->iPadY = 0;
gridPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
gridPtr->abortPtr = NULL;
gridPtr->flags = 0;
gridPtr->sticky = 0;
gridPtr->size = 0;
+ gridPtr->in = NULL;
gridPtr->masterDataPtr = NULL;
Tcl_SetHashValue(hPtr, gridPtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask,
@@ -2166,35 +2447,34 @@ GetGrid(tkwin)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* SetGridSize --
*
- * This internal procedure sets the size of the grid occupied
- * by slaves.
+ * This internal procedure sets the size of the grid occupied by slaves.
*
* Results:
- * none
+ * None
*
* Side effects:
- * The width and height arguments are filled in the master data structure.
- * Additional space is allocated for the constraints to accomodate
- * the offsets.
+ * The width and height arguments are filled in the master data
+ * structure. Additional space is allocated for the constraints to
+ * accomodate the offsets.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-SetGridSize(masterPtr)
- Gridder *masterPtr; /* The geometry master for this grid. */
+SetGridSize(
+ Gridder *masterPtr) /* The geometry master for this grid. */
{
- register Gridder *slavePtr; /* Current slave window. */
+ register Gridder *slavePtr; /* Current slave window. */
int maxX = 0, maxY = 0;
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- maxX = MAX(maxX,slavePtr->numCols + slavePtr->column);
- maxY = MAX(maxY,slavePtr->numRows + slavePtr->row);
+ slavePtr = slavePtr->nextPtr) {
+ maxX = MAX(maxX, slavePtr->numCols + slavePtr->column);
+ maxY = MAX(maxY, slavePtr->numRows + slavePtr->row);
}
masterPtr->masterDataPtr->columnEnd = maxX;
masterPtr->masterDataPtr->rowEnd = maxY;
@@ -2207,37 +2487,37 @@ SetGridSize(masterPtr)
*
* SetSlaveColumn --
*
- * Update column data for a slave, checking that MAX_ELEMENT bound
+ * Update column data for a slave, checking that MAX_ELEMENT bound
* is not passed.
*
* Results:
- * TCL_ERROR if out of bounds, TCL_OK otherwise
+ * TCL_ERROR if out of bounds, TCL_OK otherwise
*
* Side effects:
- * Slave fields are updated.
+ * Slave fields are updated.
*
*----------------------------------------------------------------------
*/
static int
SetSlaveColumn(
- Tcl_Interp *interp, /* Interp for error message */
- Gridder *slavePtr, /* Slave to be updated */
- int column, /* New column or -1 to be unchanged */
- int numCols) /* New columnspan or -1 to be unchanged */
+ Tcl_Interp *interp, /* Interp for error message. */
+ Gridder *slavePtr, /* Slave to be updated. */
+ int column, /* New column or -1 to be unchanged. */
+ int numCols) /* New columnspan or -1 to be unchanged. */
{
int newColumn, newNumCols, lastCol;
- newColumn = (column >= 0) ? column : slavePtr->column;
+ newColumn = (column >= 0) ? column : slavePtr->column;
newNumCols = (numCols >= 1) ? numCols : slavePtr->numCols;
- lastCol = ((newColumn >= 0) ? newColumn : 0) + newNumCols;
+ lastCol = ((newColumn >= 0) ? newColumn : 0) + newNumCols;
if (lastCol >= MAX_ELEMENT) {
- Tcl_SetResult(interp, "Column out of bounds", TCL_STATIC);
- return TCL_ERROR;
+ Tcl_SetResult(interp, "Column out of bounds", TCL_STATIC);
+ return TCL_ERROR;
}
- slavePtr->column = newColumn;
+ slavePtr->column = newColumn;
slavePtr->numCols = newNumCols;
return TCL_OK;
}
@@ -2247,70 +2527,70 @@ SetSlaveColumn(
*
* SetSlaveRow --
*
- * Update row data for a slave, checking that MAX_ELEMENT bound
+ * Update row data for a slave, checking that MAX_ELEMENT bound
* is not passed.
*
* Results:
- * TCL_ERROR if out of bounds, TCL_OK otherwise
+ * TCL_ERROR if out of bounds, TCL_OK otherwise
*
* Side effects:
- * Slave fields are updated.
+ * Slave fields are updated.
*
*----------------------------------------------------------------------
*/
static int
SetSlaveRow(
- Tcl_Interp *interp, /* Interp for error message */
- Gridder *slavePtr, /* Slave to be updated */
- int row, /* New row or -1 to be unchanged */
- int numRows) /* New rowspan or -1 to be unchanged */
+ Tcl_Interp *interp, /* Interp for error message. */
+ Gridder *slavePtr, /* Slave to be updated. */
+ int row, /* New row or -1 to be unchanged. */
+ int numRows) /* New rowspan or -1 to be unchanged. */
{
int newRow, newNumRows, lastRow;
- newRow = (row >= 0) ? row : slavePtr->row;
+ newRow = (row >= 0) ? row : slavePtr->row;
newNumRows = (numRows >= 1) ? numRows : slavePtr->numRows;
- lastRow = ((newRow >= 0) ? newRow : 0) + newNumRows;
+ lastRow = ((newRow >= 0) ? newRow : 0) + newNumRows;
if (lastRow >= MAX_ELEMENT) {
- Tcl_SetResult(interp, "Row out of bounds", TCL_STATIC);
- return TCL_ERROR;
+ Tcl_SetResult(interp, "Row out of bounds", TCL_STATIC);
+ return TCL_ERROR;
}
- slavePtr->row = newRow;
+ slavePtr->row = newRow;
slavePtr->numRows = newNumRows;
return TCL_OK;
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* CheckSlotData --
*
- * This internal procedure is used to manage the storage for
- * row and column (slot) constraints.
+ * This internal procedure is used to manage the storage for row and
+ * column (slot) constraints.
*
* Results:
* TRUE if the index is OK, False otherwise.
*
* Side effects:
- * A new master grid structure may be created. If so, then
- * it is initialized. In addition, additional storage for
- * a row or column constraints may be allocated, and the constraint
- * maximums are adjusted.
+ * A new master grid structure may be created. If so, then it is
+ * initialized. In addition, additional storage for a row or column
+ * constraints may be allocated, and the constraint maximums are
+ * adjusted.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static int
-CheckSlotData(masterPtr, slot, slotType, checkOnly)
- Gridder *masterPtr; /* the geometry master for this grid */
- int slot; /* which slot to look at */
- int slotType; /* ROW or COLUMN */
- int checkOnly; /* don't allocate new space if true */
+CheckSlotData(
+ Gridder *masterPtr, /* The geometry master for this grid. */
+ int slot, /* Which slot to look at. */
+ int slotType, /* ROW or COLUMN. */
+ int checkOnly) /* Don't allocate new space if true. */
{
- int numSlot; /* number of slots already allocated (Space) */
- int end; /* last used constraint */
+ int numSlot; /* Number of slots already allocated (Space) */
+ int end; /* Last used constraint. */
/*
* If slot is out of bounds, return immediately.
@@ -2326,35 +2606,36 @@ CheckSlotData(masterPtr, slot, slotType, checkOnly)
/*
* If we need to allocate more space, allocate a little extra to avoid
- * repeated re-alloc's for large tables. We need enough space to
- * hold all of the offsets as well.
+ * repeated re-alloc's for large tables. We need enough space to hold all
+ * of the offsets as well.
*/
InitMasterData(masterPtr);
end = (slotType == ROW) ? masterPtr->masterDataPtr->rowMax :
masterPtr->masterDataPtr->columnMax;
if (checkOnly == CHECK_ONLY) {
- return (end < slot) ? TCL_ERROR : TCL_OK;
+ return ((end < slot) ? TCL_ERROR : TCL_OK);
} else {
- numSlot = (slotType == ROW) ? masterPtr->masterDataPtr->rowSpace
- : masterPtr->masterDataPtr->columnSpace;
+ numSlot = (slotType == ROW) ? masterPtr->masterDataPtr->rowSpace
+ : masterPtr->masterDataPtr->columnSpace;
if (slot >= numSlot) {
- int newNumSlot = slot + PREALLOC ;
- size_t oldSize = numSlot * sizeof(SlotInfo) ;
- size_t newSize = newNumSlot * sizeof(SlotInfo) ;
- SlotInfo *new = (SlotInfo *) ckalloc(newSize);
- SlotInfo *old = (slotType == ROW) ?
- masterPtr->masterDataPtr->rowPtr :
- masterPtr->masterDataPtr->columnPtr;
- memcpy((VOID *) new, (VOID *) old, oldSize );
- memset((VOID *) (new+numSlot), 0, newSize - oldSize );
- ckfree((char *) old);
+ int newNumSlot = slot + PREALLOC;
+ size_t oldSize = numSlot * sizeof(SlotInfo);
+ size_t newSize = newNumSlot * sizeof(SlotInfo);
+ SlotInfo *newSI = (SlotInfo *) 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);
if (slotType == ROW) {
- masterPtr->masterDataPtr->rowPtr = new ;
- masterPtr->masterDataPtr->rowSpace = newNumSlot ;
+ masterPtr->masterDataPtr->rowPtr = newSI;
+ masterPtr->masterDataPtr->rowSpace = newNumSlot;
} else {
- masterPtr->masterDataPtr->columnPtr = new;
- masterPtr->masterDataPtr->columnSpace = newNumSlot ;
+ masterPtr->masterDataPtr->columnPtr = newSI;
+ masterPtr->masterDataPtr->columnSpace = newNumSlot;
}
}
if (slot >= end && checkOnly != CHECK_SPACE) {
@@ -2369,33 +2650,31 @@ CheckSlotData(masterPtr, slot, slotType, checkOnly)
}
/*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*
* InitMasterData --
*
- * This internal procedure is used to allocate and initialize
- * the data for a geometry master, if the data
- * doesn't exist already.
+ * This internal procedure is used to allocate and initialize the data
+ * for a geometry master, if the data doesn't exist already.
*
* Results:
* none
*
* Side effects:
- * A new master grid structure may be created. If so, then
- * it is initialized.
+ * A new master grid structure may be created. If so, then it is
+ * initialized.
*
- *--------------------------------------------------------------
+ *----------------------------------------------------------------------
*/
static void
-InitMasterData(masterPtr)
- Gridder *masterPtr;
+InitMasterData(
+ Gridder *masterPtr)
{
- size_t size;
if (masterPtr->masterDataPtr == NULL) {
- GridMaster *gridPtr = masterPtr->masterDataPtr =
- (GridMaster *) ckalloc(sizeof(GridMaster));
- size = sizeof(SlotInfo) * TYPICAL_SIZE;
+ GridMaster *gridPtr = masterPtr->masterDataPtr = (GridMaster *)
+ ckalloc(sizeof(GridMaster));
+ size_t size = sizeof(SlotInfo) * TYPICAL_SIZE;
gridPtr->columnEnd = 0;
gridPtr->columnMax = 0;
@@ -2407,9 +2686,10 @@ InitMasterData(masterPtr)
gridPtr->rowSpace = TYPICAL_SIZE;
gridPtr->startX = 0;
gridPtr->startY = 0;
+ gridPtr->anchor = GRID_DEFAULT_ANCHOR;
- memset((VOID *) gridPtr->columnPtr, 0, size);
- memset((VOID *) gridPtr->rowPtr, 0, size);
+ memset(gridPtr->columnPtr, 0, size);
+ memset(gridPtr->rowPtr, 0, size);
}
}
@@ -2418,21 +2698,21 @@ InitMasterData(masterPtr)
*
* Unlink --
*
- * Remove a grid from its parent's list of slaves.
+ * Remove a grid from its master's list of slaves.
*
* Results:
* None.
*
* Side effects:
- * The parent will be scheduled for re-arranging, and the size of the
+ * The master will be scheduled for re-arranging, and the size of the
* grid will be adjusted accordingly
*
*----------------------------------------------------------------------
*/
static void
-Unlink(slavePtr)
- register Gridder *slavePtr; /* Window to unlink. */
+Unlink(
+ register Gridder *slavePtr) /* Window to unlink. */
{
register Gridder *masterPtr, *slavePtr2;
@@ -2444,9 +2724,9 @@ Unlink(slavePtr)
if (masterPtr->slavePtr == slavePtr) {
masterPtr->slavePtr = slavePtr->nextPtr;
} else {
- for (slavePtr2 = masterPtr->slavePtr; ; slavePtr2 = slavePtr2->nextPtr) {
+ for (slavePtr2=masterPtr->slavePtr ; ; slavePtr2=slavePtr2->nextPtr) {
if (slavePtr2 == NULL) {
- panic("Unlink couldn't find previous window");
+ Tcl_Panic("Unlink couldn't find previous window");
}
if (slavePtr2->nextPtr == slavePtr) {
slavePtr2->nextPtr = slavePtr->nextPtr;
@@ -2471,11 +2751,11 @@ Unlink(slavePtr)
*
* DestroyGrid --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a grid at a safe time
- * (when no-one is using it anymore). Cleaning up the grid involves
- * freeing the main structure for all windows. and the master structure
- * for geometry managers.
+ * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
+ * clean up the internal structure of a grid at a safe time (when no-one
+ * is using it anymore). Cleaning up the grid involves freeing the main
+ * structure for all windows and the master structure for geometry
+ * managers.
*
* Results:
* None.
@@ -2487,8 +2767,8 @@ Unlink(slavePtr)
*/
static void
-DestroyGrid(memPtr)
- char *memPtr; /* Info about window that is now dead. */
+DestroyGrid(
+ char *memPtr) /* Info about window that is now dead. */
{
register Gridder *gridPtr = (Gridder *) memPtr;
@@ -2501,6 +2781,9 @@ DestroyGrid(memPtr)
}
ckfree((char *) gridPtr->masterDataPtr);
}
+ if (gridPtr->in != NULL) {
+ Tcl_DecrRefCount(gridPtr->in);
+ }
ckfree((char *) gridPtr);
}
@@ -2509,37 +2792,37 @@ DestroyGrid(memPtr)
*
* GridStructureProc --
*
- * This procedure is invoked by the Tk event dispatcher in response
- * to StructureNotify events.
+ * This procedure is invoked by the Tk event dispatcher in response to
+ * StructureNotify events.
*
* Results:
* None.
*
* Side effects:
* If a window was just deleted, clean up all its grid-related
- * information. If it was just resized, re-configure its slaves, if
- * any.
+ * information. If it was just resized, re-configure its slaves, if any.
*
*----------------------------------------------------------------------
*/
static void
-GridStructureProc(clientData, eventPtr)
- ClientData clientData; /* Our information about window
- * referred to by eventPtr. */
- XEvent *eventPtr; /* Describes what just happened. */
+GridStructureProc(
+ ClientData clientData, /* Our information about window referred to by
+ * eventPtr. */
+ XEvent *eventPtr) /* Describes what just happened. */
{
register Gridder *gridPtr = (Gridder *) clientData;
TkDisplay *dispPtr = ((TkWindow *) gridPtr->tkwin)->dispPtr;
if (eventPtr->type == ConfigureNotify) {
- if (!(gridPtr->flags & REQUESTED_RELAYOUT)) {
+ if ((gridPtr->slavePtr != NULL)
+ && !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
}
- if (gridPtr->doubleBw != 2*Tk_Changes(gridPtr->tkwin)->border_width) {
- if ((gridPtr->masterPtr != NULL) &&
- !(gridPtr->masterPtr->flags & REQUESTED_RELAYOUT)) {
+ 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);
@@ -2552,7 +2835,7 @@ GridStructureProc(clientData, eventPtr)
Unlink(gridPtr);
}
for (gridPtr2 = gridPtr->slavePtr; gridPtr2 != NULL;
- gridPtr2 = nextPtr) {
+ gridPtr2 = nextPtr) {
Tk_UnmapWindow(gridPtr2->tkwin);
gridPtr2->masterPtr = NULL;
nextPtr = gridPtr2->nextPtr;
@@ -2566,7 +2849,8 @@ GridStructureProc(clientData, eventPtr)
gridPtr->tkwin = NULL;
Tcl_EventuallyFree((ClientData) gridPtr, DestroyGrid);
} else if (eventPtr->type == MapNotify) {
- if (!(gridPtr->flags & REQUESTED_RELAYOUT)) {
+ if ((gridPtr->slavePtr != NULL)
+ && !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
}
@@ -2574,7 +2858,7 @@ GridStructureProc(clientData, eventPtr)
register Gridder *gridPtr2;
for (gridPtr2 = gridPtr->slavePtr; gridPtr2 != NULL;
- gridPtr2 = gridPtr2->nextPtr) {
+ gridPtr2 = gridPtr2->nextPtr) {
Tk_UnmapWindow(gridPtr2->tkwin);
}
}
@@ -2585,15 +2869,14 @@ GridStructureProc(clientData, eventPtr)
*
* ConfigureSlaves --
*
- * This implements the guts of the "grid configure" command. Given
- * a list of slaves and configuration options, it arranges for the
- * grid to manage the slaves and sets the specified options.
- * arguments consist of windows or window shortcuts followed by
- * "-option value" pairs.
+ * This implements the guts of the "grid configure" command. Given a list
+ * of slaves and configuration options, it arranges for the grid to
+ * manage the slaves and sets the specified options. Arguments consist
+ * of windows or window shortcuts followed by "-option value" pairs.
*
* Results:
- * TCL_OK is returned if all went well. Otherwise, TCL_ERROR is
- * returned and the interp's result is set to contain an error message.
+ * TCL_OK is returned if all went well. Otherwise, TCL_ERROR is returned
+ * and the interp's result is set to contain an error message.
*
* Side effects:
* Slave windows get taken over by the grid.
@@ -2602,57 +2885,90 @@ GridStructureProc(clientData, eventPtr)
*/
static int
-ConfigureSlaves(interp, tkwin, objc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* Any window in application containing
- * slaves. Used to look up slave names. */
- int objc; /* Number of elements in argv. */
- Tcl_Obj *CONST objv[]; /* Argument objects: contains one or more
- * window names followed by any number
- * of "option value" pairs. Caller must
- * make sure that there is at least one
- * window name. */
+ConfigureSlaves(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ 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
+ * window names followed by any number of
+ * "option value" pairs. Caller must make sure
+ * that there is at least one window name. */
{
- Gridder *masterPtr;
+ Gridder *masterPtr = NULL;
Gridder *slavePtr;
Tk_Window other, slave, parent, ancestor;
int i, j, tmp;
- int length;
int numWindows;
int width;
- int defaultColumn = 0; /* default column number */
- int defaultColumnSpan = 1; /* default number of columns */
- char *lastWindow; /* use this window to base current
- * Row/col on */
- int numSkip; /* number of 'x' found */
+ 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
+ * on */
+ int numSkip; /* Number of 'x' found */
static CONST char *optionStrings[] = {
"-column", "-columnspan", "-in", "-ipadx", "-ipady",
- "-padx", "-pady", "-row", "-rowspan", "-sticky",
- (char *) NULL };
+ "-padx", "-pady", "-row", "-rowspan", "-sticky", NULL
+ };
enum options {
CONF_COLUMN, CONF_COLUMNSPAN, CONF_IN, CONF_IPADX, CONF_IPADY,
CONF_PADX, CONF_PADY, CONF_ROW, CONF_ROWSPAN, CONF_STICKY };
int index;
char *string;
- char firstChar, prevChar;
+ char firstChar;
+ int positionGiven;
/*
* Count the number of windows, or window short-cuts.
*/
firstChar = 0;
- for (numWindows = i = 0; i < objc; i++) {
- prevChar = firstChar;
+ for (numWindows=0, i=0; i < objc; i++) {
+ int length;
+ char prevChar = firstChar;
+
string = Tcl_GetStringFromObj(objv[i], &length);
firstChar = string[0];
-
+
if (firstChar == '.') {
+ /*
+ * Check that windows are valid, and locate the first slave's
+ * parent window (default for -in).
+ */
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (masterPtr == NULL) {
+ /*
+ * Is there any saved -in from a removed slave?
+ * If there is, it becomes default for -in.
+ * If the stored master does not exist, just ignore it.
+ */
+
+ struct Gridder *slavePtr = GetGrid(slave);
+ if (slavePtr->in != NULL) {
+ if (TkGetWindowFromObj(interp, slave, slavePtr->in, &parent)
+ == TCL_OK) {
+ masterPtr = GetGrid(parent);
+ InitMasterData(masterPtr);
+ }
+ }
+ }
+ if (masterPtr == NULL) {
+ parent = Tk_Parent(slave);
+ if (parent != NULL) {
+ masterPtr = GetGrid(parent);
+ InitMasterData(masterPtr);
+ }
+ }
numWindows++;
continue;
}
if (length > 1 && i == 0) {
Tcl_AppendResult(interp, "bad argument \"", string,
- "\": must be name of window", (char *) NULL);
+ "\": must be name of window", NULL);
return TCL_ERROR;
}
if (length > 1 && firstChar == '-') {
@@ -2661,15 +2977,14 @@ ConfigureSlaves(interp, tkwin, objc, objv)
if (length > 1) {
Tcl_AppendResult(interp, "unexpected parameter, \"",
string, "\", in configure list. ",
- "Should be window name or option", (char *) NULL);
+ "Should be window name or option", NULL);
return TCL_ERROR;
}
if ((firstChar == REL_HORIZ) && ((numWindows == 0) ||
(prevChar == REL_SKIP) || (prevChar == REL_VERT))) {
Tcl_AppendResult(interp,
- "Must specify window before shortcut '-'.",
- (char *) NULL);
+ "Must specify window before shortcut '-'.", NULL);
return TCL_ERROR;
}
@@ -2679,36 +2994,79 @@ ConfigureSlaves(interp, tkwin, objc, objv)
}
Tcl_AppendResult(interp, "invalid window shortcut, \"",
- string, "\" should be '-', 'x', or '^'", (char *) NULL);
+ string, "\" should be '-', 'x', or '^'", NULL);
return TCL_ERROR;
}
numWindows = i;
if ((objc - numWindows) & 1) {
- Tcl_AppendResult(interp, "extra option or",
- " option with no value", (char *) NULL);
+ Tcl_AppendResult(interp, "extra option or option with no value", NULL);
return TCL_ERROR;
}
/*
- * Iterate over all of the slave windows and short-cuts, parsing
- * options for each slave. It's a bit wasteful to re-parse the
- * options for each slave, but things get too messy if we try to
- * parse the arguments just once at the beginning. For example,
- * if a slave already is managed we want to just change a few
- * existing values without resetting everything. If there are
- * multiple windows, the -in option only gets processed for the
- * first window.
+ * Go through all options looking for -in and -row, which are needed to be
+ * found first to handle the special case where ^ is used on a row without
+ * windows names, but with an -in option. Since all options are checked
+ * here, we do not need to handle the error case again later.
+ */
+
+ for (i = numWindows; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == CONF_IN) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other) !=
+ TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(other);
+ InitMasterData(masterPtr);
+ } else if (index == CONF_ROW) {
+ if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK
+ || tmp < 0) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad row value \"",
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "a non-negative integer", NULL);
+ return TCL_ERROR;
+ }
+ defaultRow = tmp;
+ }
+ }
+
+ /*
+ * If no -row is given, use the first unoccupied row of the master.
+ */
+
+ if (defaultRow < 0) {
+ if (masterPtr != NULL && masterPtr->masterDataPtr != NULL) {
+ SetGridSize(masterPtr);
+ defaultRow = masterPtr->masterDataPtr->rowEnd;
+ } else {
+ defaultRow = 0;
+ }
+ }
+
+ /*
+ * Iterate over all of the slave windows and short-cuts, parsing options
+ * for each slave. It's a bit wasteful to re-parse the options for each
+ * slave, but things get too messy if we try to parse the arguments just
+ * once at the beginning. For example, if a slave already is managed we
+ * want to just change a few existing values without resetting everything.
+ * If there are multiple windows, the -in option only gets processed for
+ * the first window.
*/
- masterPtr = NULL;
+ positionGiven = 0;
for (j = 0; j < numWindows; j++) {
string = Tcl_GetString(objv[j]);
firstChar = string[0];
/*
- * '^' and 'x' cause us to skip a column. '-' is processed
- * as part of its preceeding slave.
+ * '^' and 'x' cause us to skip a column. '-' is processed as part of
+ * its preceeding slave.
*/
if ((firstChar == REL_VERT) || (firstChar == REL_SKIP)) {
@@ -2722,6 +3080,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
for (defaultColumnSpan = 1; j + defaultColumnSpan < numWindows;
defaultColumnSpan++) {
char *string = Tcl_GetString(objv[j + defaultColumnSpan]);
+
if (*string != REL_HORIZ) {
break;
}
@@ -2733,7 +3092,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
if (Tk_TopWinHierarchy(slave)) {
Tcl_AppendResult(interp, "can't manage \"", Tcl_GetString(objv[j]),
- "\": it's a top-level window", (char *) NULL);
+ "\": it's a top-level window", NULL);
return TCL_ERROR;
}
slavePtr = GetGrid(slave);
@@ -2742,49 +3101,48 @@ ConfigureSlaves(interp, tkwin, objc, objv)
* The following statement is taken from tkPack.c:
*
* "If the slave isn't currently managed, reset all of its
- * configuration information to default values (there could
- * be old values left from a previous packer)."
+ * configuration information to default values (there could be old
+ * values left from a previous packer)."
*
- * I [D.S.] disagree with this statement. If a slave is disabled (using
- * "forget") and then re-enabled, I submit that 90% of the time the
- * programmer will want it to retain its old configuration information.
- * If the programmer doesn't want this behavior, then the
+ * I [D.S.] disagree with this statement. If a slave is disabled
+ * (using "forget") and then re-enabled, I submit that 90% of the time
+ * the programmer will want it to retain its old configuration
+ * information. If the programmer doesn't want this behavior, then the
* defaults can be reestablished by hand, without having to worry
- * about keeping track of the old state.
+ * about keeping track of the old state.
*/
for (i = numWindows; i < objc; i += 2) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
- &index) != TCL_OK) {
- return TCL_ERROR;
- }
- if (index == CONF_COLUMN) {
- if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK ||
- tmp < 0) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad column value \"",
- Tcl_GetString(objv[i+1]),
- "\": must be a non-negative integer", (char *)NULL);
+ Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
+ &index);
+ switch ((enum options) index) {
+ case CONF_COLUMN:
+ if (Tcl_GetIntFromObj(NULL, objv[i+1], &tmp) != TCL_OK
+ || tmp < 0) {
+ Tcl_AppendResult(interp, "bad column value \"",
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "a non-negative integer", NULL);
return TCL_ERROR;
}
if (SetSlaveColumn(interp, slavePtr, tmp, -1) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_COLUMNSPAN) {
- if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK ||
- tmp <= 0) {
- Tcl_ResetResult(interp);
+ break;
+ case CONF_COLUMNSPAN:
+ if (Tcl_GetIntFromObj(NULL, objv[i+1], &tmp) != TCL_OK
+ || tmp <= 0) {
Tcl_AppendResult(interp, "bad columnspan value \"",
- Tcl_GetString(objv[i+1]),
- "\": must be a positive integer", (char *)NULL);
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "a positive integer", NULL);
return TCL_ERROR;
}
if (SetSlaveColumn(interp, slavePtr, -1, tmp) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_IN) {
- if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other) !=
- TCL_OK) {
+ break;
+ case CONF_IN:
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1],
+ &other) != TCL_OK) {
return TCL_ERROR;
}
if (other == slave) {
@@ -2792,89 +3150,106 @@ ConfigureSlaves(interp, tkwin, objc, objv)
TCL_STATIC);
return TCL_ERROR;
}
+ positionGiven = 1;
masterPtr = GetGrid(other);
InitMasterData(masterPtr);
- } else if (index == CONF_IPADX) {
- if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
- != TCL_OK)
- || (tmp < 0)) {
- Tcl_ResetResult(interp);
+ break;
+ case CONF_STICKY: {
+ int sticky = StringToSticky(Tcl_GetString(objv[i+1]));
+
+ if (sticky == -1) {
+ Tcl_AppendResult(interp, "bad stickyness value \"",
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "a string containing n, e, s, and/or w", NULL);
+ return TCL_ERROR;
+ }
+ slavePtr->sticky = sticky;
+ break;
+ }
+ case CONF_IPADX:
+ if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1],
+ &tmp) != TCL_OK) || (tmp < 0)) {
Tcl_AppendResult(interp, "bad ipadx value \"",
- Tcl_GetString(objv[i+1]),
- "\": must be positive screen distance",
- (char *) NULL);
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "positive screen distance", NULL);
return TCL_ERROR;
}
slavePtr->iPadX = tmp*2;
- } else if (index == CONF_IPADY) {
- if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
- != TCL_OK)
- || (tmp < 0)) {
- Tcl_ResetResult(interp);
+ break;
+ case CONF_IPADY:
+ if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1],
+ &tmp) != TCL_OK) || (tmp < 0)) {
Tcl_AppendResult(interp, "bad ipady value \"",
- Tcl_GetString(objv[i+1]),
- "\": must be positive screen distance",
- (char *) NULL);
+ Tcl_GetString(objv[i+1]), "\": must be ",
+ "positive screen distance", NULL);
return TCL_ERROR;
}
slavePtr->iPadY = tmp*2;
- } else if (index == CONF_PADX) {
+ break;
+ case CONF_PADX:
if (TkParsePadAmount(interp, tkwin, objv[i+1],
&slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_PADY) {
+ break;
+ case CONF_PADY:
if (TkParsePadAmount(interp, tkwin, objv[i+1],
&slavePtr->padTop, &slavePtr->padY) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_ROW) {
- if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK
+ break;
+ case CONF_ROW:
+ if (Tcl_GetIntFromObj(NULL, objv[i+1], &tmp) != TCL_OK
|| tmp < 0) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad grid value \"",
+ Tcl_AppendResult(interp, "bad row value \"",
Tcl_GetString(objv[i+1]),
- "\": must be a non-negative integer", (char *)NULL);
+ "\": must be a non-negative integer", NULL);
return TCL_ERROR;
}
if (SetSlaveRow(interp, slavePtr, tmp, -1) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_ROWSPAN) {
- if ((Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK)
+ break;
+ case CONF_ROWSPAN:
+ if ((Tcl_GetIntFromObj(NULL, objv[i+1], &tmp) != TCL_OK)
|| tmp <= 0) {
- Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad rowspan value \"",
Tcl_GetString(objv[i+1]),
- "\": must be a positive integer", (char *)NULL);
+ "\": must be a positive integer", NULL);
return TCL_ERROR;
}
if (SetSlaveRow(interp, slavePtr, -1, tmp) != TCL_OK) {
return TCL_ERROR;
}
- } else if (index == CONF_STICKY) {
- int sticky = StringToSticky(Tcl_GetString(objv[i+1]));
- if (sticky == -1) {
- Tcl_AppendResult(interp, "bad stickyness value \"",
- Tcl_GetString(objv[i+1]),
- "\": must be a string containing n, e, s, and/or w",
- (char *)NULL);
- return TCL_ERROR;
- }
- slavePtr->sticky = sticky;
+ break;
}
}
/*
- * Make sure we have a geometry master. We look at:
- * 1) the -in flag
- * 2) the geometry master of the first slave (if specified)
- * 3) the parent of the first slave.
+ * If no position was specified via -in and the slave is already
+ * packed, then leave it in its current location.
*/
-
- if (masterPtr == NULL) {
+
+ if (!positionGiven && (slavePtr->masterPtr != NULL)) {
masterPtr = slavePtr->masterPtr;
+ goto scheduleLayout;
}
+
+ /*
+ * If the same -in window is passed in again, then just leave it in
+ * its current location.
+ */
+
+ if (positionGiven && (masterPtr == slavePtr->masterPtr)) {
+ goto scheduleLayout;
+ }
+
+ /*
+ * Make sure we have a geometry master. We look at:
+ * 1) the -in flag
+ * 2) the parent of the first slave.
+ */
+
parent = Tk_Parent(slave);
if (masterPtr == NULL) {
masterPtr = GetGrid(parent);
@@ -2888,15 +3263,16 @@ ConfigureSlaves(interp, tkwin, objc, objv)
if (slavePtr->masterPtr == NULL) {
Gridder *tempPtr = masterPtr->slavePtr;
+
slavePtr->masterPtr = masterPtr;
masterPtr->slavePtr = slavePtr;
slavePtr->nextPtr = tempPtr;
}
/*
- * Make sure that the slave's parent is either the master or
- * an ancestor of the master, and that the master and slave
- * aren't the same.
+ * Make sure that the slave's parent is either the master or an
+ * ancestor of the master, and that the master and slave aren't the
+ * same.
*/
for (ancestor = masterPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) {
@@ -2905,8 +3281,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
}
if (Tk_TopWinHierarchy(ancestor)) {
Tcl_AppendResult(interp, "can't put ", Tcl_GetString(objv[j]),
- " inside ", Tk_PathName(masterPtr->tkwin),
- (char *) NULL);
+ " inside ", Tk_PathName(masterPtr->tkwin), NULL);
Unlink(slavePtr);
return TCL_ERROR;
}
@@ -2919,8 +3294,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
if (masterPtr->masterPtr == slavePtr) {
Tcl_AppendResult(interp, "can't put ", Tcl_GetString(objv[j]),
" inside ", Tk_PathName(masterPtr->tkwin),
- ", would cause management loop.",
- (char *) NULL);
+ ", would cause management loop.", NULL);
Unlink(slavePtr);
return TCL_ERROR;
}
@@ -2932,7 +3306,7 @@ ConfigureSlaves(interp, tkwin, objc, objv)
*/
if (slavePtr->column == -1) {
- if (SetSlaveColumn(interp, slavePtr, defaultColumn, -1) != TCL_OK) {
+ if (SetSlaveColumn(interp, slavePtr, defaultColumn,-1) != TCL_OK){
return TCL_ERROR;
}
}
@@ -2941,23 +3315,18 @@ ConfigureSlaves(interp, tkwin, objc, objv)
return TCL_ERROR;
}
if (slavePtr->row == -1) {
- if (masterPtr->masterDataPtr == NULL) {
- slavePtr->row = 0;
- } else {
- if (SetSlaveRow(interp, slavePtr,
- masterPtr->masterDataPtr->rowEnd, -1) != TCL_OK) {
- return TCL_ERROR;
- }
+ if (SetSlaveRow(interp, slavePtr, defaultRow, -1) != TCL_OK) {
+ return TCL_ERROR;
}
}
defaultColumn += slavePtr->numCols;
defaultColumnSpan = 1;
/*
- * Arrange for the parent to be re-arranged at the first
- * idle moment.
+ * Arrange for the master to be re-arranged at the first idle moment.
*/
+ scheduleLayout:
if (masterPtr->abortPtr != NULL) {
*masterPtr->abortPtr = 1;
}
@@ -2967,14 +3336,16 @@ ConfigureSlaves(interp, tkwin, objc, objv)
}
}
- /* Now look for all the "^"'s. */
+ /*
+ * Now look for all the "^"'s.
+ */
lastWindow = NULL;
numSkip = 0;
for (j = 0; j < numWindows; j++) {
struct Gridder *otherPtr;
- int match; /* found a match for the ^ */
- int lastRow, lastColumn; /* implied end of table */
+ int match; /* Found a match for the ^ */
+ int lastRow, lastColumn; /* Implied end of table. */
string = Tcl_GetString(objv[j]);
firstChar = string[0];
@@ -2991,28 +3362,28 @@ ConfigureSlaves(interp, tkwin, objc, objv)
}
if (masterPtr == NULL) {
- Tcl_AppendResult(interp, "can't use '^', cant find master",
- (char *) NULL);
+ Tcl_AppendResult(interp, "can't use '^', cant find master", NULL);
return TCL_ERROR;
}
- /* Count the number of consecutive ^'s starting from this position */
+ /*
+ * Count the number of consecutive ^'s starting from this position.
+ */
+
for (width = 1; width + j < numWindows; width++) {
char *string = Tcl_GetString(objv[j+width]);
- if (*string != REL_VERT) break;
+
+ if (*string != REL_VERT) {
+ break;
+ }
}
/*
* Find the implied grid location of the ^
*/
- if (lastWindow == NULL) {
- if (masterPtr->masterDataPtr != NULL) {
- SetGridSize(masterPtr);
- lastRow = masterPtr->masterDataPtr->rowEnd - 2;
- } else {
- lastRow = 0;
- }
+ if (lastWindow == NULL) {
+ lastRow = defaultRow - 1;
lastColumn = 0;
} else {
other = Tk_NameToWindow(interp, lastWindow, tkwin);
@@ -3023,13 +3394,13 @@ ConfigureSlaves(interp, tkwin, objc, objv)
lastColumn += numSkip;
- for (match=0, slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
+ match = 0;
+ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ slavePtr = slavePtr->nextPtr) {
if (slavePtr->column == lastColumn
&& slavePtr->row + slavePtr->numRows - 1 == lastRow) {
if (slavePtr->numCols <= width) {
-
if (SetSlaveRow(interp, slavePtr, -1,
slavePtr->numRows + 1) != TCL_OK) {
return TCL_ERROR;
@@ -3044,14 +3415,13 @@ ConfigureSlaves(interp, tkwin, objc, objv)
}
if (!match) {
Tcl_AppendResult(interp, "can't find slave to extend with \"^\".",
- (char *) NULL);
+ NULL);
return TCL_ERROR;
}
}
if (masterPtr == NULL) {
- Tcl_AppendResult(interp, "can't determine master window",
- (char *) NULL);
+ Tcl_AppendResult(interp, "can't determine master window", NULL);
return TCL_ERROR;
}
SetGridSize(masterPtr);
@@ -3063,8 +3433,8 @@ ConfigureSlaves(interp, tkwin, objc, objv)
*
* StickyToString
*
- * Converts the internal boolean combination of "sticky" bits onto
- * a TCL list element containing zero or mor of n, s, e, or w.
+ * Converts the internal boolean combination of "sticky" bits onto a Tcl
+ * list element containing zero or more of n, s, e, or w.
*
* Results:
* A string is placed into the "result" pointer.
@@ -3076,9 +3446,9 @@ ConfigureSlaves(interp, tkwin, objc, objv)
*/
static void
-StickyToString(flags, result)
- int flags; /* the sticky flags */
- char *result; /* where to put the result */
+StickyToString(
+ int flags, /* The sticky flags. */
+ char *result) /* Where to put the result. */
{
int count = 0;
if (flags&STICK_NORTH) {
@@ -3096,7 +3466,7 @@ StickyToString(flags, result)
if (count) {
result[count] = '\0';
} else {
- sprintf(result,"{}");
+ sprintf(result, "{}");
}
}
@@ -3105,12 +3475,12 @@ StickyToString(flags, result)
*
* StringToSticky --
*
- * Converts an ascii string representing a widgets stickyness
- * into the boolean result.
+ * Converts an ascii string representing a widgets stickyness into the
+ * boolean result.
*
* Results:
- * The boolean combination of the "sticky" bits is retuned. If an
- * error occurs, such as an invalid character, -1 is returned instead.
+ * The boolean combination of the "sticky" bits is retuned. If an error
+ * occurs, such as an invalid character, -1 is returned instead.
*
* Side effects:
* none
@@ -3119,20 +3489,30 @@ StickyToString(flags, result)
*/
static int
-StringToSticky(string)
- char *string;
+StringToSticky(
+ char *string)
{
int sticky = 0;
char c;
while ((c = *string++) != '\0') {
switch (c) {
- case 'n': case 'N': sticky |= STICK_NORTH; break;
- case 'e': case 'E': sticky |= STICK_EAST; break;
- case 's': case 'S': sticky |= STICK_SOUTH; break;
- case 'w': case 'W': sticky |= STICK_WEST; break;
- case ' ': case ',': case '\t': case '\r': case '\n': break;
- default: return -1;
+ case 'n': case 'N':
+ sticky |= STICK_NORTH;
+ break;
+ case 'e': case 'E':
+ sticky |= STICK_EAST;
+ break;
+ case 's': case 'S':
+ sticky |= STICK_SOUTH;
+ break;
+ case 'w': case 'W':
+ sticky |= STICK_WEST;
+ break;
+ case ' ': case ',': case '\t': case '\r': case '\n':
+ break;
+ default:
+ return -1;
}
}
return sticky;
@@ -3155,14 +3535,14 @@ StringToSticky(string)
*/
static Tcl_Obj *
-NewPairObj(interp, val1, val2)
- Tcl_Interp *interp; /* Current interpreter. */
- int val1, val2;
+NewPairObj(
+ int val1, int val2)
{
- Tcl_Obj *res = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val1));
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val2));
- return res;
+ Tcl_Obj *ary[2];
+
+ ary[0] = Tcl_NewIntObj(val1);
+ ary[1] = Tcl_NewIntObj(val2);
+ return Tcl_NewListObj(2, ary);
}
/*
@@ -3182,14 +3562,22 @@ NewPairObj(interp, val1, val2)
*/
static Tcl_Obj *
-NewQuadObj(interp, val1, val2, val3, val4)
- Tcl_Interp *interp; /* Current interpreter. */
- int val1, val2, val3, val4;
+NewQuadObj(
+ int val1, int val2, int val3, int val4)
{
- Tcl_Obj *res = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val1));
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val2));
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val3));
- Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val4));
- return res;
+ Tcl_Obj *ary[4];
+
+ ary[0] = Tcl_NewIntObj(val1);
+ ary[1] = Tcl_NewIntObj(val2);
+ ary[2] = Tcl_NewIntObj(val3);
+ ary[3] = Tcl_NewIntObj(val4);
+ return Tcl_NewListObj(4, ary);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImage.c b/generic/tkImage.c
index 35f013f..6c7c9cd 100644
--- a/generic/tkImage.c
+++ b/generic/tkImage.c
@@ -1,19 +1,17 @@
-/*
+/*
* tkImage.c --
*
- * This module implements the image protocol, which allows lots
- * of different kinds of images to be used in lots of different
- * widgets.
+ * This module implements the image protocol, which allows lots of
+ * different kinds of images to be used in lots of different widgets.
*
* Copyright (c) 1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkPort.h"
/*
* Each call to Tk_GetImage returns a pointer to one of the following
@@ -25,114 +23,162 @@ typedef struct Image {
Tk_Window tkwin; /* Window passed to Tk_GetImage (needed to
* "re-get" the image later if the manager
* changes). */
- Display *display; /* Display for tkwin. Needed because when
- * the image is eventually freed tkwin may
- * not exist anymore. */
+ Display *display; /* Display for tkwin. Needed because when the
+ * image is eventually freed tkwin may not
+ * exist anymore. */
struct ImageMaster *masterPtr;
/* Master for this image (identifiers image
* manager, for example). */
- ClientData instanceData;
- /* One word argument to pass to image manager
+ ClientData instanceData; /* One word argument to pass to image manager
* when dealing with this image instance. */
Tk_ImageChangedProc *changeProc;
/* Code in widget to call when image changes
* in a way that affects redisplay. */
- ClientData widgetClientData;
- /* Argument to pass to changeProc. */
+ ClientData widgetClientData;/* Argument to pass to changeProc. */
struct Image *nextPtr; /* Next in list of all image instances
* associated with the same name. */
-
} Image;
/*
- * For each image master there is one of the following structures,
- * which represents a name in the image table and all of the images
- * instantiated from it. Entries in mainPtr->imageTable point to
- * these structures.
+ * For each image master there is one of the following structures, which
+ * represents a name in the image table and all of the images instantiated
+ * from it. Entries in mainPtr->imageTable point to these structures.
*/
typedef struct ImageMaster {
- Tk_ImageType *typePtr; /* Information about image type. NULL means
- * that no image manager owns this image: the
+ Tk_ImageType *typePtr; /* Information about image type. NULL means
+ * that no image manager owns this image: the
* image was deleted. */
- ClientData masterData; /* One-word argument to pass to image mgr
- * when dealing with the master, as opposed
- * to instances. */
+ ClientData masterData; /* One-word argument to pass to image mgr when
+ * dealing with the master, as opposed to
+ * instances. */
int width, height; /* Last known dimensions for image. */
- Tcl_HashTable *tablePtr; /* Pointer to hash table containing image
- * (the imageTable field in some TkMainInfo
+ Tcl_HashTable *tablePtr; /* Pointer to hash table containing image (the
+ * imageTable field in some TkMainInfo
* structure). */
- Tcl_HashEntry *hPtr; /* Hash entry in mainPtr->imageTable for
- * this structure (used to delete the hash
+ Tcl_HashEntry *hPtr; /* Hash entry in mainPtr->imageTable for this
+ * structure (used to delete the hash
* entry). */
Image *instancePtr; /* Pointer to first in list of instances
* derived from this name. */
int deleted; /* Flag set when image is being deleted. */
- TkWindow *winPtr; /* Main window of interpreter (used to
- * detect when the world is falling apart.) */
+ TkWindow *winPtr; /* Main window of interpreter (used to detect
+ * when the world is falling apart.) */
} ImageMaster;
typedef struct ThreadSpecificData {
- Tk_ImageType *imageTypeList;/* First in a list of all known image
- * types. */
- Tk_ImageType *oldImageTypeList;/* First in a list of all known old-style image
- * types. */
-} ThreadSpecificData;
+ Tk_ImageType *imageTypeList;/* First in a list of all known image
+ * types. */
+ Tk_ImageType *oldImageTypeList;
+ /* First in a list of all known old-style
+ * image types. */
+ int initialized; /* Set to 1 if we've initialized the
+ * structure. */
+} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Prototypes for local procedures:
+ * Prototypes for local functions:
*/
-static void DeleteImage _ANSI_ARGS_((ImageMaster *masterPtr));
-static void EventuallyDeleteImage _ANSI_ARGS_((ImageMaster *masterPtr,
- int forgetHashEntryNow));
+static void ImageTypeThreadExitProc(ClientData clientData);
+static void DeleteImage(ImageMaster *masterPtr);
+static void EventuallyDeleteImage(ImageMaster *masterPtr,
+ int forgetImageHashNow);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ImageTypeThreadExitProc --
+ *
+ * Clean up the registered list of image types.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The thread's linked lists of photo image formats is deleted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ImageTypeThreadExitProc(
+ ClientData clientData) /* not used */
+{
+ 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);
+ }
+ while (tsdPtr->imageTypeList != NULL) {
+ freePtr = tsdPtr->imageTypeList;
+ tsdPtr->imageTypeList = tsdPtr->imageTypeList->nextPtr;
+ ckfree((char *) freePtr);
+ }
+}
/*
*----------------------------------------------------------------------
*
* Tk_CreateOldImageType, Tk_CreateImageType --
*
- * This procedure is invoked by an image manager to tell Tk about
- * a new kind of image and the procedures that manage the new type.
- * The procedure is typically invoked during Tcl_AppInit.
+ * This function is invoked by an image manager to tell Tk about a new
+ * kind of image and the functions that manage the new type. The function
+ * is typically invoked during Tcl_AppInit.
*
* Results:
* None.
*
* Side effects:
- * The new image type is entered into a table used in the "image
- * create" command.
+ * The new image type is entered into a table used in the "image create"
+ * command.
*
*----------------------------------------------------------------------
*/
void
-Tk_CreateOldImageType(typePtr)
- Tk_ImageType *typePtr; /* Structure describing the type. All of
- * the fields except "nextPtr" must be filled
- * in by caller. Must not have been passed
- * to Tk_CreateImageType previously. */
+Tk_CreateOldImageType(
+ Tk_ImageType *typePtr) /* Structure describing the type. All of the
+ * fields except "nextPtr" must be filled in
+ * by caller. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tk_ImageType *copyPtr;
+ ThreadSpecificData *tsdPtr =
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- typePtr->nextPtr = tsdPtr->oldImageTypeList;
- tsdPtr->oldImageTypeList = typePtr;
+ if (!tsdPtr->initialized) {
+ tsdPtr->initialized = 1;
+ Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL);
+ }
+ copyPtr = (Tk_ImageType *) ckalloc(sizeof(Tk_ImageType));
+ *copyPtr = *typePtr;
+ copyPtr->nextPtr = tsdPtr->oldImageTypeList;
+ tsdPtr->oldImageTypeList = copyPtr;
}
void
-Tk_CreateImageType(typePtr)
- Tk_ImageType *typePtr; /* Structure describing the type. All of
- * the fields except "nextPtr" must be filled
- * in by caller. Must not have been passed
- * to Tk_CreateImageType previously. */
+Tk_CreateImageType(
+ Tk_ImageType *typePtr) /* Structure describing the type. All of the
+ * fields except "nextPtr" must be filled in
+ * by caller. */
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tk_ImageType *copyPtr;
+ ThreadSpecificData *tsdPtr =
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- typePtr->nextPtr = tsdPtr->imageTypeList;
- tsdPtr->imageTypeList = typePtr;
+ if (!tsdPtr->initialized) {
+ tsdPtr->initialized = 1;
+ Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL);
+ }
+ copyPtr = (Tk_ImageType *) ckalloc(sizeof(Tk_ImageType));
+ *copyPtr = *typePtr;
+ copyPtr->nextPtr = tsdPtr->imageTypeList;
+ tsdPtr->imageTypeList = copyPtr;
}
/*
@@ -140,8 +186,8 @@ Tk_CreateImageType(typePtr)
*
* Tk_ImageObjCmd --
*
- * This procedure is invoked to process the "image" Tcl command.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the "image" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -153,30 +199,31 @@ Tk_CreateImageType(typePtr)
*/
int
-Tk_ImageObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+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. */
{
static CONST char *imageOptions[] = {
"create", "delete", "height", "inuse", "names", "type", "types",
- "width", (char *) NULL
+ "width", NULL
};
enum options {
IMAGE_CREATE, IMAGE_DELETE, IMAGE_HEIGHT, IMAGE_INUSE, IMAGE_NAMES,
IMAGE_TYPE, IMAGE_TYPES, IMAGE_WIDTH
};
TkWindow *winPtr = (TkWindow *) clientData;
- int i, new, firstOption, index;
+ int i, isNew, firstOption, index;
Tk_ImageType *typePtr;
ImageMaster *masterPtr;
Image *imagePtr;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
- char idString[16 + TCL_INTEGER_SPACE], *name;
+ char idString[16 + TCL_INTEGER_SPACE];
TkDisplay *dispPtr = winPtr->dispPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ char *arg, *name;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (objc < 2) {
@@ -189,276 +236,256 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
switch ((enum options) index) {
- case IMAGE_CREATE: {
- char *arg;
- Tcl_Obj **args;
- int oldimage = 0;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "type ?name? ?options?");
- return TCL_ERROR;
- }
+ case IMAGE_CREATE: {
+ Tcl_Obj **args;
+ int oldimage = 0;
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "type ?name? ?options?");
+ return TCL_ERROR;
+ }
- /*
- * Look up the image type.
- */
+ /*
+ * Look up the image type.
+ */
- arg = Tcl_GetString(objv[2]);
- for (typePtr = tsdPtr->imageTypeList; typePtr != NULL;
- typePtr = typePtr->nextPtr) {
+ arg = Tcl_GetString(objv[2]);
+ for (typePtr = tsdPtr->imageTypeList; typePtr != NULL;
+ typePtr = typePtr->nextPtr) {
+ if ((*arg == typePtr->name[0])
+ && (strcmp(arg, typePtr->name) == 0)) {
+ break;
+ }
+ }
+ if (typePtr == NULL) {
+ oldimage = 1;
+ for (typePtr = tsdPtr->oldImageTypeList; typePtr != NULL;
+ typePtr = typePtr->nextPtr) {
if ((*arg == typePtr->name[0])
&& (strcmp(arg, typePtr->name) == 0)) {
break;
}
}
- if (typePtr == NULL) {
- oldimage = 1;
- for (typePtr = tsdPtr->oldImageTypeList; typePtr != NULL;
- typePtr = typePtr->nextPtr) {
- if ((*arg == typePtr->name[0])
- && (strcmp(arg, typePtr->name) == 0)) {
- break;
- }
- }
- }
- if (typePtr == NULL) {
- Tcl_AppendResult(interp, "image type \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
+ }
+ if (typePtr == NULL) {
+ Tcl_AppendResult(interp, "image type \"", arg, "\" doesn't exist",
+ NULL);
+ return TCL_ERROR;
+ }
- /*
- * Figure out a name to use for the new image.
- */
+ /*
+ * Figure out a name to use for the new image.
+ */
- if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) {
- Tcl_CmdInfo dummy;
- do {
- dispPtr->imageId++;
- sprintf(idString, "image%d", dispPtr->imageId);
- name = idString;
- } while (Tcl_GetCommandInfo(interp, name, &dummy) != 0);
- firstOption = 3;
- } else {
- TkWindow *topWin;
-
- name = arg;
- firstOption = 4;
- /*
- * Need to check if the _command_ that we are about to
- * create is the name of the current master widget
- * command (normally "." but could have been renamed)
- * and fail in that case before a really nasty and
- * hard to stop crash happens.
- */
- topWin = (TkWindow *) TkToplevelWindowForCommand(interp, name);
- if (topWin != NULL && winPtr->mainPtr->winPtr == topWin) {
- Tcl_AppendResult(interp, "images may not be named the ",
- "same as the main window", (char *) NULL);
- return TCL_ERROR;
- }
- }
+ if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) {
+ Tcl_CmdInfo dummy;
+ do {
+ dispPtr->imageId++;
+ sprintf(idString, "image%d", dispPtr->imageId);
+ name = idString;
+ } while (Tcl_GetCommandInfo(interp, name, &dummy) != 0);
+ firstOption = 3;
+ } else {
+ TkWindow *topWin;
+
+ name = arg;
+ firstOption = 4;
/*
- * Create the data structure for the new image.
+ * Need to check if the _command_ that we are about to create is
+ * the name of the current master widget command (normally "." but
+ * could have been renamed) and fail in that case before a really
+ * nasty and hard to stop crash happens.
*/
- hPtr = Tcl_CreateHashEntry(&winPtr->mainPtr->imageTable,
- name, &new);
- if (new) {
- masterPtr = (ImageMaster *) ckalloc(sizeof(ImageMaster));
- masterPtr->typePtr = NULL;
- masterPtr->masterData = NULL;
- masterPtr->width = masterPtr->height = 1;
- masterPtr->tablePtr = &winPtr->mainPtr->imageTable;
- masterPtr->hPtr = hPtr;
- masterPtr->instancePtr = NULL;
- masterPtr->deleted = 0;
- masterPtr->winPtr = winPtr->mainPtr->winPtr;
- Tcl_Preserve((ClientData) masterPtr->winPtr);
- Tcl_SetHashValue(hPtr, masterPtr);
- } else {
- /*
- * An image already exists by this name. Disconnect the
- * instances from the master.
- */
-
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
- if (masterPtr->typePtr != NULL) {
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
- imagePtr = imagePtr->nextPtr) {
- (*masterPtr->typePtr->freeProc)(
- imagePtr->instanceData, imagePtr->display);
- (*imagePtr->changeProc)(imagePtr->widgetClientData,
- 0, 0, masterPtr->width, masterPtr->height,
- masterPtr->width, masterPtr->height);
- }
- (*masterPtr->typePtr->deleteProc)(masterPtr->masterData);
- masterPtr->typePtr = NULL;
- }
+ topWin = (TkWindow *) TkToplevelWindowForCommand(interp, name);
+ if (topWin != NULL && winPtr->mainPtr->winPtr == topWin) {
+ Tcl_AppendResult(interp, "images may not be named the ",
+ "same as the main window", NULL);
+ return TCL_ERROR;
}
+ }
+ /*
+ * Create the data structure for the new image.
+ */
+
+ hPtr = Tcl_CreateHashEntry(&winPtr->mainPtr->imageTable, name, &isNew);
+ if (isNew) {
+ masterPtr = (ImageMaster *) ckalloc(sizeof(ImageMaster));
+ masterPtr->typePtr = NULL;
+ masterPtr->masterData = NULL;
+ masterPtr->width = masterPtr->height = 1;
+ masterPtr->tablePtr = &winPtr->mainPtr->imageTable;
+ masterPtr->hPtr = hPtr;
+ masterPtr->instancePtr = NULL;
+ masterPtr->deleted = 0;
+ masterPtr->winPtr = winPtr->mainPtr->winPtr;
+ Tcl_Preserve((ClientData) masterPtr->winPtr);
+ Tcl_SetHashValue(hPtr, masterPtr);
+ } else {
/*
- * Call the image type manager so that it can perform its own
- * initialization, then re-"get" for any existing instances of
- * the image.
+ * An image already exists by this name. Disconnect the instances
+ * from the master.
*/
- objv += firstOption;
- objc -= firstOption;
- args = (Tcl_Obj **) objv;
- if (oldimage) {
- int i;
- args = (Tcl_Obj **) ckalloc((objc+1) * sizeof(char *));
- for (i = 0; i < objc; i++) {
- args[i] = (Tcl_Obj *) Tcl_GetString(objv[i]);
+ masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ if (masterPtr->typePtr != NULL) {
+ for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ imagePtr = imagePtr->nextPtr) {
+ (*masterPtr->typePtr->freeProc)(imagePtr->instanceData,
+ imagePtr->display);
+ (*imagePtr->changeProc)(imagePtr->widgetClientData,
+ 0, 0, masterPtr->width, masterPtr->height,
+ masterPtr->width, masterPtr->height);
}
- args[objc] = NULL;
+ (*masterPtr->typePtr->deleteProc)(masterPtr->masterData);
+ masterPtr->typePtr = NULL;
}
- Tcl_Preserve((ClientData) masterPtr);
- if ((*typePtr->createProc)(interp, name, objc,
- args, typePtr, (Tk_ImageMaster) masterPtr,
- &masterPtr->masterData) != TCL_OK) {
- EventuallyDeleteImage(masterPtr, 0);
- Tcl_Release((ClientData) masterPtr);
- if (oldimage) {
- ckfree((char *) args);
- }
- return TCL_ERROR;
+ masterPtr->deleted = 0;
+ }
+
+ /*
+ * Call the image type manager so that it can perform its own
+ * initialization, then re-"get" for any existing instances of the
+ * image.
+ */
+
+ objv += firstOption;
+ objc -= firstOption;
+ args = (Tcl_Obj **) objv;
+ if (oldimage) {
+ int i;
+
+ args = (Tcl_Obj **) 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) {
+ EventuallyDeleteImage(masterPtr, 0);
Tcl_Release((ClientData) masterPtr);
if (oldimage) {
ckfree((char *) args);
}
- masterPtr->typePtr = typePtr;
- for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
- imagePtr = imagePtr->nextPtr) {
- imagePtr->instanceData = (*typePtr->getProc)(
- imagePtr->tkwin, masterPtr->masterData);
- }
- Tcl_SetResult(interp,
- Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr),
- TCL_STATIC);
- break;
+ return TCL_ERROR;
}
- case IMAGE_DELETE: {
- for (i = 2; i < objc; i++) {
- char *arg = Tcl_GetString(objv[i]);
- hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
- DeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr));
- }
- break;
+ Tcl_Release((ClientData) masterPtr);
+ if (oldimage) {
+ ckfree((char *) args);
}
- case IMAGE_HEIGHT: {
- char *arg;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "name");
- return TCL_ERROR;
- }
- arg = Tcl_GetString(objv[2]);
- hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
- Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->height);
- break;
+ masterPtr->typePtr = typePtr;
+ for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
+ imagePtr = imagePtr->nextPtr) {
+ imagePtr->instanceData = (*typePtr->getProc)(imagePtr->tkwin,
+ masterPtr->masterData);
}
-
- case IMAGE_INUSE: {
- int count = 0;
- char *arg;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "name");
- return TCL_ERROR;
- }
- arg = Tcl_GetString(objv[2]);
+ Tcl_SetResult(interp,
+ Tcl_GetHashKey(&winPtr->mainPtr->imageTable, hPtr),
+ TCL_STATIC);
+ break;
+ }
+ case IMAGE_DELETE:
+ for (i = 2; i < objc; i++) {
+ arg = Tcl_GetString(objv[i]);
hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
if (hPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
+ goto alreadyDeleted;
}
masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
- if (masterPtr->typePtr != NULL && masterPtr->instancePtr != NULL) {
- count = 1;
+ if (masterPtr->deleted) {
+ goto alreadyDeleted;
}
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), count);
- break;
+ DeleteImage(masterPtr);
}
-
- case IMAGE_NAMES: {
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- return TCL_ERROR;
+ break;
+ case IMAGE_NAMES:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ return TCL_ERROR;
+ }
+ hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
+ for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
+ masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ if (masterPtr->deleted) {
+ continue;
}
- hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
- for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- Tcl_AppendElement(interp, Tcl_GetHashKey(
+ Tcl_AppendElement(interp, Tcl_GetHashKey(
&winPtr->mainPtr->imageTable, hPtr));
- }
- break;
}
-
- case IMAGE_TYPE: {
- char *arg;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "name");
- return TCL_ERROR;
- }
- arg = Tcl_GetString(objv[2]);
- hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ break;
+ case IMAGE_TYPES:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ return TCL_ERROR;
+ }
+ for (typePtr = tsdPtr->imageTypeList; typePtr != NULL;
+ typePtr = typePtr->nextPtr) {
+ Tcl_AppendElement(interp, typePtr->name);
+ }
+ for (typePtr = tsdPtr->oldImageTypeList; typePtr != NULL;
+ typePtr = typePtr->nextPtr) {
+ Tcl_AppendElement(interp, typePtr->name);
+ }
+ break;
+
+ case IMAGE_HEIGHT:
+ case IMAGE_INUSE:
+ case IMAGE_TYPE:
+ case IMAGE_WIDTH:
+ /*
+ * These operations all parse virtually identically. First check to
+ * see if three args are given. Then get a non-deleted master from the
+ * third arg.
+ */
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "name");
+ return TCL_ERROR;
+ }
+
+ arg = Tcl_GetString(objv[2]);
+ hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
+ if (hPtr == NULL) {
+ goto alreadyDeleted;
+ }
+ masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ if (masterPtr->deleted) {
+ goto alreadyDeleted;
+ }
+
+ /*
+ * Now we read off the specific piece of data we were asked for.
+ */
+
+ switch ((enum options) index) {
+ case IMAGE_HEIGHT:
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->height);
+ break;
+ case IMAGE_INUSE:
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
+ masterPtr->typePtr!=NULL && masterPtr->instancePtr!=NULL);
+ break;
+ case IMAGE_TYPE:
if (masterPtr->typePtr != NULL) {
Tcl_SetResult(interp, masterPtr->typePtr->name, TCL_STATIC);
}
break;
- }
- case IMAGE_TYPES: {
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- return TCL_ERROR;
- }
- for (typePtr = tsdPtr->imageTypeList; typePtr != NULL;
- typePtr = typePtr->nextPtr) {
- Tcl_AppendElement(interp, typePtr->name);
- }
- for (typePtr = tsdPtr->oldImageTypeList; typePtr != NULL;
- typePtr = typePtr->nextPtr) {
- Tcl_AppendElement(interp, typePtr->name);
- }
- break;
- }
- case IMAGE_WIDTH: {
- char *arg;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "name");
- return TCL_ERROR;
- }
- arg = Tcl_GetString(objv[2]);
- hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
- if (hPtr == NULL) {
- Tcl_AppendResult(interp, "image \"", arg,
- "\" doesn't exist", (char *) NULL);
- return TCL_ERROR;
- }
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ case IMAGE_WIDTH:
Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->width);
break;
+ default:
+ Tcl_Panic("can't happen");
}
+ break;
}
return TCL_OK;
+
+ alreadyDeleted:
+ Tcl_AppendResult(interp, "image \"", arg, "\" doesn't exist", NULL);
+ return TCL_ERROR;
}
/*
@@ -466,33 +493,32 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
*
* Tk_ImageChanged --
*
- * This procedure is called by an image manager whenever something
- * has happened that requires the image to be redrawn (some of its
- * pixels have changed, or its size has changed).
+ * This function is called by an image manager whenever something has
+ * happened that requires the image to be redrawn (some of its pixels
+ * have changed, or its size has changed).
*
* Results:
* None.
*
* Side effects:
- * Any widgets that display the image are notified so that they
- * can redisplay themselves as appropriate.
+ * Any widgets that display the image are notified so that they can
+ * redisplay themselves as appropriate.
*
*----------------------------------------------------------------------
*/
void
-Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth,
- imageHeight)
- Tk_ImageMaster imageMaster; /* Image that needs redisplay. */
- int x, y; /* Coordinates of upper-left pixel of
- * region of image that needs to be
- * redrawn. */
- int width, height; /* Dimensions (in pixels) of region of
- * image to redraw. If either dimension
- * is zero then the image doesn't need to
- * be redrawn (perhaps all that happened is
- * that its size changed). */
- int imageWidth, imageHeight;/* New dimensions of image. */
+Tk_ImageChanged(
+ Tk_ImageMaster imageMaster, /* Image that needs redisplay. */
+ int x, int y, /* Coordinates of upper-left pixel of region
+ * of image that needs to be redrawn. */
+ int width, int height, /* Dimensions (in pixels) of region of image
+ * to redraw. If either dimension is zero then
+ * the image doesn't need to be redrawn
+ * (perhaps all that happened is that its size
+ * changed). */
+ int imageWidth, int imageHeight)
+ /* New dimensions of image. */
{
ImageMaster *masterPtr = (ImageMaster *) imageMaster;
Image *imagePtr;
@@ -500,7 +526,7 @@ Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth,
masterPtr->width = imageWidth;
masterPtr->height = imageHeight;
for (imagePtr = masterPtr->instancePtr; imagePtr != NULL;
- imagePtr = imagePtr->nextPtr) {
+ imagePtr = imagePtr->nextPtr) {
(*imagePtr->changeProc)(imagePtr->widgetClientData, x, y,
width, height, imageWidth, imageHeight);
}
@@ -511,8 +537,8 @@ Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth,
*
* Tk_NameOfImage --
*
- * Given a token for an image master, this procedure returns
- * the name of the image.
+ * Given a token for an image master, this function returns the name of
+ * the image.
*
* Results:
* The return value is the string name for imageMaster.
@@ -524,8 +550,8 @@ Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth,
*/
CONST char *
-Tk_NameOfImage(imageMaster)
- Tk_ImageMaster imageMaster; /* Token for image. */
+Tk_NameOfImage(
+ Tk_ImageMaster imageMaster) /* Token for image. */
{
ImageMaster *masterPtr = (ImageMaster *) imageMaster;
@@ -540,36 +566,34 @@ Tk_NameOfImage(imageMaster)
*
* Tk_GetImage --
*
- * This procedure is invoked by a widget when it wants to use
- * a particular image in a particular window.
+ * This function is invoked by a widget when it wants to use a particular
+ * image in a particular window.
*
* Results:
- * The return value is a token for the image. If there is no image
- * by the given name, then NULL is returned and an error message is
- * left in the interp's result.
+ * The return value is a token for the image. If there is no image by the
+ * given name, then NULL is returned and an error message is left in the
+ * interp's result.
*
* Side effects:
- * Tk records the fact that the widget is using the image, and
- * it will invoke changeProc later if the widget needs redisplay
- * (i.e. its size changes or some of its pixels change). The
- * caller must eventually invoke Tk_FreeImage when it no longer
- * needs the image.
+ * Tk records the fact that the widget is using the image, and it will
+ * invoke changeProc later if the widget needs redisplay (i.e. its size
+ * changes or some of its pixels change). The caller must eventually
+ * invoke Tk_FreeImage when it no longer needs the image.
*
*----------------------------------------------------------------------
*/
Tk_Image
-Tk_GetImage(interp, tkwin, name, changeProc, clientData)
- Tcl_Interp *interp; /* Place to leave error message if image
- * can't be found. */
- Tk_Window tkwin; /* Token for window in which image will
- * be used. */
- CONST char *name; /* Name of desired image. */
- Tk_ImageChangedProc *changeProc;
- /* Procedure to invoke when redisplay is
- * needed because image's pixels or size
- * changed. */
- ClientData clientData; /* One-word argument to pass to damageProc. */
+Tk_GetImage(
+ Tcl_Interp *interp, /* Place to leave error message if image can't
+ * be found. */
+ Tk_Window tkwin, /* Token for window in which image will be
+ * used. */
+ CONST char *name, /* Name of desired image. */
+ Tk_ImageChangedProc *changeProc,
+ /* Function to invoke when redisplay is needed
+ * because image's pixels or size changed. */
+ ClientData clientData) /* One-word argument to pass to damageProc. */
{
Tcl_HashEntry *hPtr;
ImageMaster *masterPtr;
@@ -583,6 +607,9 @@ Tk_GetImage(interp, tkwin, name, changeProc, clientData)
if (masterPtr->typePtr == NULL) {
goto noSuchImage;
}
+ if (masterPtr->deleted) {
+ goto noSuchImage;
+ }
imagePtr = (Image *) ckalloc(sizeof(Image));
imagePtr->tkwin = tkwin;
imagePtr->display = Tk_Display(tkwin);
@@ -595,9 +622,10 @@ Tk_GetImage(interp, tkwin, name, changeProc, clientData)
masterPtr->instancePtr = imagePtr;
return (Tk_Image) imagePtr;
- noSuchImage:
- Tcl_AppendResult(interp, "image \"", name, "\" doesn't exist",
- (char *) NULL);
+ noSuchImage:
+ if (interp) {
+ Tcl_AppendResult(interp, "image \"", name, "\" doesn't exist", NULL);
+ }
return NULL;
}
@@ -606,9 +634,9 @@ Tk_GetImage(interp, tkwin, name, changeProc, clientData)
*
* Tk_FreeImage --
*
- * This procedure is invoked by a widget when it no longer needs
- * an image acquired by a previous call to Tk_GetImage. For each
- * call to Tk_GetImage there must be exactly one call to Tk_FreeImage.
+ * This function is invoked by a widget when it no longer needs an image
+ * acquired by a previous call to Tk_GetImage. For each call to
+ * Tk_GetImage there must be exactly one call to Tk_FreeImage.
*
* Results:
* None.
@@ -620,9 +648,9 @@ Tk_GetImage(interp, tkwin, name, changeProc, clientData)
*/
void
-Tk_FreeImage(image)
- Tk_Image image; /* Token for image that is no longer
- * needed by a widget. */
+Tk_FreeImage(
+ Tk_Image image) /* Token for image that is no longer needed by
+ * a widget. */
{
Image *imagePtr = (Image *) image;
ImageMaster *masterPtr = imagePtr->masterPtr;
@@ -647,16 +675,16 @@ Tk_FreeImage(image)
}
ckfree((char *) imagePtr);
- /*
- * If there are no more instances left for the master, and if the
- * master image has been deleted, then delete the master too.
+ /*
+ * If there are no more instances left for the master, and if the master
+ * image has been deleted, then delete the master too.
*/
if ((masterPtr->typePtr == NULL) && (masterPtr->instancePtr == NULL)) {
if (masterPtr->hPtr != NULL) {
Tcl_DeleteHashEntry(masterPtr->hPtr);
}
- Tcl_Release(masterPtr->winPtr);
+ Tcl_Release((ClientData) masterPtr->winPtr);
ckfree((char *) masterPtr);
}
}
@@ -666,29 +694,29 @@ Tk_FreeImage(image)
*
* Tk_PostscriptImage --
*
- * This procedure is called by widgets that contain images in order
- * to redisplay an image on the screen or an off-screen pixmap.
+ * This function is called by widgets that contain images in order to
+ * redisplay an image on the screen or an off-screen pixmap.
*
* Results:
* None.
*
* Side effects:
- * The image's manager is notified, and it redraws the desired
- * portion of the image before returning.
+ * The image's manager is notified, and it redraws the desired portion of
+ * the image before returning.
*
*----------------------------------------------------------------------
*/
int
-Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
- Tk_Image image; /* Token for image to redisplay. */
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psinfo; /* postscript info */
- int x, y; /* Upper-left pixel of region in image that
+Tk_PostscriptImage(
+ Tk_Image image, /* Token for image to redisplay. */
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ Tk_PostscriptInfo psinfo, /* postscript info */
+ int x, int y, /* Upper-left pixel of region in image that
* needs to be redisplayed. */
- int width, height; /* Dimensions of region to redraw. */
- int prepass;
+ int width, int height, /* Dimensions of region to redraw. */
+ int prepass)
{
Image *imagePtr = (Image *) image;
int result;
@@ -701,12 +729,13 @@ Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
/*
* No master for image, so nothing to display on postscript.
*/
+
return TCL_OK;
}
/*
- * Check if an image specific postscript-generation function
- * exists; otherwise go on with generic code.
+ * Check if an image specific postscript-generation function exists;
+ * otherwise go on with generic code.
*/
if (imagePtr->masterPtr->typePtr->postscriptProc != NULL) {
@@ -721,12 +750,12 @@ Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
/*
* Create a Pixmap, tell the image to redraw itself there, and then
- * generate an XImage from the Pixmap. We can then read pixel
- * values out of the XImage.
+ * generate an XImage from the Pixmap. We can then read pixel values out
+ * of the XImage.
*/
- pmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin),
- width, height, Tk_Depth(tkwin));
+ pmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin), width, height,
+ Tk_Depth(tkwin));
gcValues.foreground = WhitePixelOfScreen(Tk_Screen(tkwin));
newGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
@@ -742,11 +771,13 @@ Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
(unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap);
Tk_FreePixmap(Tk_Display(tkwin), pmap);
-
+
if (ximage == NULL) {
- /* The XGetImage() function is apparently not
- * implemented on this system. Just ignore it.
+ /*
+ * The XGetImage() function is apparently not implemented on this
+ * system. Just ignore it.
*/
+
return TCL_OK;
}
result = TkPostscriptImage(interp, tkwin, psinfo, ximage, x, y,
@@ -755,39 +786,38 @@ Tk_PostscriptImage(image, interp, tkwin, psinfo, x, y, width, height, prepass)
XDestroyImage(ximage);
return result;
}
-
+
/*
*----------------------------------------------------------------------
*
* Tk_RedrawImage --
*
- * This procedure is called by widgets that contain images in order
- * to redisplay an image on the screen or an off-screen pixmap.
+ * This function is called by widgets that contain images in order to
+ * redisplay an image on the screen or an off-screen pixmap.
*
* Results:
* None.
*
* Side effects:
- * The image's manager is notified, and it redraws the desired
- * portion of the image before returning.
+ * The image's manager is notified, and it redraws the desired portion of
+ * the image before returning.
*
*----------------------------------------------------------------------
*/
void
-Tk_RedrawImage(image, imageX, imageY, width, height, drawable,
- drawableX, drawableY)
- Tk_Image image; /* Token for image to redisplay. */
- int imageX, imageY; /* Upper-left pixel of region in image that
+Tk_RedrawImage(
+ Tk_Image image, /* Token for image to redisplay. */
+ int imageX, int imageY, /* Upper-left pixel of region in image that
* needs to be redisplayed. */
- int width, height; /* Dimensions of region to redraw. */
- Drawable drawable; /* Drawable in which to display image
- * (window or pixmap). If this is a pixmap,
- * it must have the same depth as the window
- * used in the Tk_GetImage call for the
- * image. */
- int drawableX, drawableY; /* Coordinates in drawable that correspond
- * to imageX and imageY. */
+ int width, int height, /* Dimensions of region to redraw. */
+ Drawable drawable, /* Drawable in which to display image (window
+ * or pixmap). If this is a pixmap, it must
+ * have the same depth as the window used in
+ * the Tk_GetImage call for the image. */
+ int drawableX, int drawableY)
+ /* Coordinates in drawable that correspond to
+ * imageX and imageY. */
{
Image *imagePtr = (Image *) image;
@@ -829,11 +859,11 @@ Tk_RedrawImage(image, imageX, imageY, width, height, drawable,
*
* Tk_SizeOfImage --
*
- * This procedure returns the current dimensions of an image.
+ * This function returns the current dimensions of an image.
*
* Results:
- * The width and height of the image are returned in *widthPtr
- * and *heightPtr.
+ * The width and height of the image are returned in *widthPtr and
+ * *heightPtr.
*
* Side effects:
* None.
@@ -842,10 +872,10 @@ Tk_RedrawImage(image, imageX, imageY, width, height, drawable,
*/
void
-Tk_SizeOfImage(image, widthPtr, heightPtr)
- Tk_Image image; /* Token for image whose size is wanted. */
- int *widthPtr; /* Return width of image here. */
- int *heightPtr; /* Return height of image here. */
+Tk_SizeOfImage(
+ Tk_Image image, /* Token for image whose size is wanted. */
+ int *widthPtr, /* Return width of image here. */
+ int *heightPtr) /* Return height of image here. */
{
Image *imagePtr = (Image *) image;
@@ -858,25 +888,23 @@ Tk_SizeOfImage(image, widthPtr, heightPtr)
*
* Tk_DeleteImage --
*
- * Given the name of an image, this procedure destroys the
- * image.
+ * Given the name of an image, this function destroys the image.
*
* Results:
* None.
*
* Side effects:
- * The image is destroyed; existing instances will display as
- * blank areas. If no such image exists then the procedure does
- * nothing.
+ * The image is destroyed; existing instances will display as blank
+ * areas. If no such image exists then the function does nothing.
*
*----------------------------------------------------------------------
*/
void
-Tk_DeleteImage(interp, name)
- Tcl_Interp *interp; /* Interpreter in which the image was
+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;
@@ -897,22 +925,22 @@ Tk_DeleteImage(interp, name)
*
* DeleteImage --
*
- * This procedure is responsible for deleting an image.
+ * This function is responsible for deleting an image.
*
* Results:
* None.
*
* Side effects:
- * The connection is dropped between instances of this image and
- * an image master. Image instances will redisplay themselves
- * as empty areas, but existing instances will not be deleted.
+ * The connection is dropped between instances of this image and an image
+ * master. Image instances will redisplay themselves as empty areas, but
+ * existing instances will not be deleted.
*
*----------------------------------------------------------------------
*/
static void
-DeleteImage(masterPtr)
- ImageMaster *masterPtr; /* Pointer to main data structure for image. */
+DeleteImage(
+ ImageMaster *masterPtr) /* Pointer to main data structure for image. */
{
Image *imagePtr;
Tk_ImageType *typePtr;
@@ -922,9 +950,9 @@ DeleteImage(masterPtr)
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);
}
@@ -936,6 +964,8 @@ DeleteImage(masterPtr)
}
Tcl_Release((ClientData) masterPtr->winPtr);
ckfree((char *) masterPtr);
+ } else {
+ masterPtr->deleted = 1;
}
}
@@ -950,19 +980,20 @@ DeleteImage(masterPtr)
* None.
*
* Side effects:
- * Image will get freed, though not until it is no longer
- * Tcl_Preserve()d by anything. May be called multiple times on
- * the same image without ill effects.
+ * Image will get freed, though not until it is no longer Tcl_Preserve()d
+ * by anything. May be called multiple times on the same image without
+ * ill effects.
*
*----------------------------------------------------------------------
*/
static void
-EventuallyDeleteImage(masterPtr, forgetHashEntryNow)
- ImageMaster *masterPtr; /* Pointer to main data structure for image. */
- int forgetHashEntryNow;
+EventuallyDeleteImage(
+ ImageMaster *masterPtr, /* Pointer to main data structure for image. */
+ int forgetImageHashNow) /* Flag to say whether the hash table is about
+ * to vanish. */
{
- if (forgetHashEntryNow) {
+ if (forgetImageHashNow) {
masterPtr->hPtr = NULL;
}
if (!masterPtr->deleted) {
@@ -977,10 +1008,9 @@ EventuallyDeleteImage(masterPtr, forgetHashEntryNow)
*
* TkDeleteAllImages --
*
- * This procedure is called when an application is deleted. It
- * calls back all of the managers for all images so that they
- * can cleanup, then it deletes all of Tk's internal information
- * about images.
+ * This function is called when an application is deleted. It calls back
+ * all of the managers for all images so that they can cleanup, then it
+ * deletes all of Tk's internal information about images.
*
* Results:
* None.
@@ -992,8 +1022,8 @@ EventuallyDeleteImage(masterPtr, forgetHashEntryNow)
*/
void
-TkDeleteAllImages(mainPtr)
- TkMainInfo *mainPtr; /* Structure describing application that is
+TkDeleteAllImages(
+ TkMainInfo *mainPtr) /* Structure describing application that is
* going away. */
{
Tcl_HashSearch search;
@@ -1011,15 +1041,14 @@ TkDeleteAllImages(mainPtr)
*
* Tk_GetImageMasterData --
*
- * Given the name of an image, this procedure returns the type
- * of the image and the clientData associated with its master.
+ * Given the name of an image, this function returns the type of the
+ * image and the clientData associated with its master.
*
* Results:
- * If there is no image by the given name, then NULL is returned
- * and a NULL value is stored at *typePtrPtr. Otherwise the return
- * value is the clientData returned by the createProc when the
- * image was created and a pointer to the type structure for the
- * image is stored at *typePtrPtr.
+ * If there is no image by the given name, then NULL is returned and a
+ * NULL value is stored at *typePtrPtr. Otherwise the return value is the
+ * clientData returned by the createProc when the image was created and a
+ * pointer to the type structure for the image is stored at *typePtrPtr.
*
* Side effects:
* None.
@@ -1028,12 +1057,12 @@ TkDeleteAllImages(mainPtr)
*/
ClientData
-Tk_GetImageMasterData(interp, name, typePtrPtr)
- Tcl_Interp *interp; /* Interpreter in which the image was
+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 to type information for image. */
+ CONST char *name, /* Name of image. */
+ Tk_ImageType **typePtrPtr) /* Points to location to fill in with pointer
+ * to type information for image. */
{
Tcl_HashEntry *hPtr;
TkWindow *winPtr;
@@ -1046,36 +1075,41 @@ Tk_GetImageMasterData(interp, name, typePtrPtr)
return NULL;
}
masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ if (masterPtr->deleted) {
+ *typePtrPtr = NULL;
+ return NULL;
+ }
*typePtrPtr = masterPtr->typePtr;
return masterPtr->masterData;
}
-
+
/*
*----------------------------------------------------------------------
*
* Tk_SetTSOrigin --
*
- * Set the pattern origin of the tile to a common point (i.e. the
- * origin (0,0) of the top level window) so that tiles from two
- * different widgets will match up. This done by setting the
- * GCTileStipOrigin field is set to the translated origin of the
- * toplevel window in the hierarchy.
+ * Set the pattern origin of the tile to a common point (i.e. the origin
+ * (0,0) of the top level window) so that tiles from two different
+ * widgets will match up. This done by setting the GCTileStipOrigin field
+ * is set to the translated origin of the toplevel window in the
+ * hierarchy.
*
* Results:
* None.
*
* Side Effects:
- * The GCTileStipOrigin is reset in the GC. This will cause the
- * tile origin to change when the GC is used for drawing.
+ * The GCTileStipOrigin is reset in the GC. This will cause the tile
+ * origin to change when the GC is used for drawing.
*
*----------------------------------------------------------------------
*/
+
/*ARGSUSED*/
void
-Tk_SetTSOrigin(tkwin, gc, x, y)
- Tk_Window tkwin;
- GC gc;
- int x, y;
+Tk_SetTSOrigin(
+ Tk_Window tkwin,
+ GC gc,
+ int x, int y)
{
while (!Tk_TopWinHierarchy(tkwin)) {
x -= Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
@@ -1084,4 +1118,11 @@ Tk_SetTSOrigin(tkwin, gc, x, y)
}
XSetTSOrigin(Tk_Display(tkwin), gc, x, y);
}
-
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c
index 99ae050..88c96d5 100644
--- a/generic/tkImgBmap.c
+++ b/generic/tkImgBmap.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkImgBmap.c --
*
* This procedure implements images of type "bitmap" for Tk.
@@ -12,7 +12,6 @@
*/
#include "tkInt.h"
-#include "tkPort.h"
/*
* The following data structure represents the master for a bitmap
@@ -20,21 +19,19 @@
*/
typedef struct BitmapMaster {
- Tk_ImageMaster tkMaster; /* Tk's token for image master. NULL means
- * the image is being deleted. */
- Tcl_Interp *interp; /* Interpreter for application that is
- * using 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. */
+ Tk_ImageMaster tkMaster; /* Tk's token for image master. NULL means the
+ * image is being deleted. */
+ Tcl_Interp *interp; /* Interpreter for application that is using
+ * 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 width, height; /* Dimensions of image. */
- char *data; /* Data comprising bitmap (suitable for
- * input to XCreateBitmapFromData). May
- * be NULL if no data. Malloc'ed. */
- char *maskData; /* Data for bitmap's mask (suitable for
- * input to XCreateBitmapFromData).
- * Malloc'ed. */
+ char *data; /* Data comprising bitmap (suitable for input
+ * to XCreateBitmapFromData). May be NULL if
+ * no data. Malloc'ed. */
+ char *maskData; /* Data for bitmap's mask (suitable for input
+ * to XCreateBitmapFromData). Malloc'ed. */
Tk_Uid fgUid; /* Value of -foreground option (malloc'ed). */
Tk_Uid bgUid; /* Value of -background option (malloc'ed). */
char *fileString; /* Value of -file option (malloc'ed). */
@@ -47,13 +44,13 @@ typedef struct BitmapMaster {
} BitmapMaster;
/*
- * The following data structure represents all of the instances of an
- * image that lie within a particular window:
+ * The following data structure represents all of the instances of an image
+ * that lie within a particular window:
*/
typedef struct BitmapInstance {
- int refCount; /* Number of instances that share this
- * data structure. */
+ int refCount; /* Number of instances that share this data
+ * structure. */
BitmapMaster *masterPtr; /* Pointer to master for image. */
Tk_Window tkwin; /* Window in which the instances will be
* displayed. */
@@ -63,37 +60,35 @@ typedef struct BitmapInstance {
Pixmap mask; /* Mask: only display bitmap pixels where
* there are 1's here. */
GC gc; /* Graphics context for displaying bitmap.
- * None means there was an error while
- * setting up the instance, so it cannot
- * be displayed. */
+ * None means there was an error while setting
+ * up the instance, so it cannot be
+ * displayed. */
struct BitmapInstance *nextPtr;
/* Next in list of all instance structures
- * associated with masterPtr (NULL means
- * end of list). */
+ * associated with masterPtr (NULL means end
+ * of list). */
} BitmapInstance;
/*
* The type record for bitmap images:
*/
-static int GetByte _ANSI_ARGS_((Tcl_Channel chan));
-static int ImgBmapCreate _ANSI_ARGS_((Tcl_Interp *interp,
+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,
- ClientData *clientDataPtr));
-static ClientData ImgBmapGet _ANSI_ARGS_((Tk_Window tkwin,
- ClientData clientData));
-static void ImgBmapDisplay _ANSI_ARGS_((ClientData clientData,
- Display *display, Drawable drawable,
+ ClientData *clientDataPtr);
+static ClientData ImgBmapGet(Tk_Window tkwin, ClientData clientData);
+static void ImgBmapDisplay(ClientData clientData,
+ Display *display, Drawable drawable,
int imageX, int imageY, int width, int height,
- int drawableX, int drawableY));
-static void ImgBmapFree _ANSI_ARGS_((ClientData clientData,
- Display *display));
-static void ImgBmapDelete _ANSI_ARGS_((ClientData clientData));
-static int ImgBmapPostscript _ANSI_ARGS_((ClientData clientData,
+ int drawableX, int drawableY);
+static void ImgBmapFree(ClientData clientData, Display *display);
+static void ImgBmapDelete(ClientData clientData);
+static int ImgBmapPostscript(ClientData clientData,
Tcl_Interp *interp, Tk_Window tkwin,
Tk_PostscriptInfo psinfo, int x, int y,
- int width, int height, int prepass));
+ int width, int height, int prepass);
Tk_ImageType tkBitmapImageType = {
"bitmap", /* name */
@@ -103,7 +98,7 @@ Tk_ImageType tkBitmapImageType = {
ImgBmapFree, /* freeProc */
ImgBmapDelete, /* deleteProc */
ImgBmapPostscript, /* postscriptProc */
- (Tk_ImageType *) NULL /* nextPtr */
+ NULL /* nextPtr */
};
/*
@@ -111,28 +106,25 @@ Tk_ImageType tkBitmapImageType = {
*/
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_UID, "-background", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_UID, "-background", NULL, NULL,
"", Tk_Offset(BitmapMaster, bgUid), 0},
- {TK_CONFIG_STRING, "-data", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapMaster, dataString), TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-file", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapMaster, fileString), TK_CONFIG_NULL_OK},
- {TK_CONFIG_UID, "-foreground", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-data", NULL, NULL,
+ NULL, Tk_Offset(BitmapMaster, dataString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_STRING, "-file", NULL, NULL,
+ NULL, Tk_Offset(BitmapMaster, fileString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_UID, "-foreground", NULL, NULL,
"#000000", Tk_Offset(BitmapMaster, fgUid), 0},
- {TK_CONFIG_STRING, "-maskdata", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapMaster, maskDataString),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-maskfile", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(BitmapMaster, maskFileString),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_STRING, "-maskdata", NULL, NULL,
+ NULL, Tk_Offset(BitmapMaster, maskDataString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_STRING, "-maskfile", NULL, NULL,
+ NULL, Tk_Offset(BitmapMaster, maskFileString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * The following data structure is used to describe the state of
- * parsing a bitmap file or string. It is used for communication
- * between TkGetBitmapData and NextBitmapWord.
+ * The following data structure is used to describe the state of parsing a
+ * bitmap file or string. It is used for communication between TkGetBitmapData
+ * and NextBitmapWord.
*/
#define MAX_WORD_LENGTH 100
@@ -140,8 +132,8 @@ typedef struct ParseInfo {
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 file. */
+ Tcl_Channel chan; /* File containing bitmap data, or NULL if no
+ * file. */
char word[MAX_WORD_LENGTH+1];
/* Current word of bitmap data, NULL
* terminated. */
@@ -152,24 +144,20 @@ typedef struct ParseInfo {
* Prototypes for procedures used only locally in this file:
*/
-static int ImgBmapCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[]));
-static void ImgBmapCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void ImgBmapConfigureInstance _ANSI_ARGS_((
- BitmapInstance *instancePtr));
-static int ImgBmapConfigureMaster _ANSI_ARGS_((
- BitmapMaster *masterPtr, int argc, Tcl_Obj *CONST objv[],
- int flags));
-static int NextBitmapWord _ANSI_ARGS_((ParseInfo *parseInfoPtr));
+static int ImgBmapCmd(ClientData clientData, Tcl_Interp *interp,
+ 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);
+static int NextBitmapWord(ParseInfo *parseInfoPtr);
/*
*----------------------------------------------------------------------
*
* ImgBmapCreate --
*
- * This procedure is called by the Tk image code to create "test"
- * images.
+ * This procedure is called by the Tk image code to create "test" images.
*
* Results:
* A standard Tcl result.
@@ -182,18 +170,18 @@ static int NextBitmapWord _ANSI_ARGS_((ParseInfo *parseInfoPtr));
/* ARGSUSED */
static int
-ImgBmapCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
- Tcl_Interp *interp; /* Interpreter for application containing
+ImgBmapCreate(
+ Tcl_Interp *interp, /* Interpreter for application containing
* image. */
- char *name; /* Name to use for image. */
- int argc; /* Number of arguments. */
- Tcl_Obj *CONST argv[]; /* Argument objects for options (doesn't
+ char *name, /* Name to use for image. */
+ int argc, /* Number of arguments. */
+ 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). */
- 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. */
+ 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;
@@ -226,28 +214,28 @@ ImgBmapCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
* ImgBmapConfigureMaster --
*
* This procedure is called when a bitmap image is created or
- * reconfigured. It process configuration options and resets
- * any instances of the image.
+ * reconfigured. It process configuration options and resets any
+ * instances of the image.
*
* Results:
- * A standard Tcl return value. If TCL_ERROR is returned then
- * an error message is left in the masterPtr->interp's result.
+ * A standard Tcl return value. If TCL_ERROR is returned then an error
+ * message is left in the masterPtr->interp's result.
*
* Side effects:
- * Existing instances of the image will be redisplayed to match
- * the new configuration options.
+ * Existing instances of the image will be redisplayed to match the new
+ * configuration options.
*
*----------------------------------------------------------------------
*/
static int
-ImgBmapConfigureMaster(masterPtr, objc, objv, flags)
- BitmapMaster *masterPtr; /* Pointer to data structure describing
+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. */
- int flags; /* Flags to pass to Tk_ConfigureWidget,
- * such as TK_CONFIG_ARGV_ONLY. */
+ int objc, /* Number of entries in objv. */
+ 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;
@@ -267,8 +255,8 @@ ImgBmapConfigureMaster(masterPtr, objc, objv, flags)
ckfree((char *) argv);
/*
- * Parse the bitmap and/or mask to create binary data. Make sure that
- * the bitmap and mask have the same dimensions.
+ * Parse the bitmap and/or mask to create binary data. Make sure that the
+ * bitmap and mask have the same dimensions.
*/
if (masterPtr->data != NULL) {
@@ -311,9 +299,9 @@ ImgBmapConfigureMaster(masterPtr, objc, objv, flags)
}
/*
- * Cycle through all of the instances of this image, regenerating
- * the information for each instance. Then force the image to be
- * redisplayed everywhere that it is used.
+ * Cycle through all of the instances of this image, regenerating the
+ * information for each instance. Then force the image to be redisplayed
+ * everywhere that it is used.
*/
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
@@ -330,24 +318,24 @@ ImgBmapConfigureMaster(masterPtr, objc, objv, flags)
*
* ImgBmapConfigureInstance --
*
- * This procedure is called to create displaying information for
- * a bitmap 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.
+ * This procedure is called to create displaying information for a bitmap
+ * 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.
+ * Generates errors via Tcl_BackgroundError if there are problems in
+ * setting up the instance.
*
*----------------------------------------------------------------------
*/
static void
-ImgBmapConfigureInstance(instancePtr)
- BitmapInstance *instancePtr; /* Instance to reconfigure. */
+ImgBmapConfigureInstance(
+ BitmapInstance *instancePtr)/* Instance to reconfigure. */
{
BitmapMaster *masterPtr = instancePtr->masterPtr;
XColor *colorPtr;
@@ -357,8 +345,8 @@ ImgBmapConfigureInstance(instancePtr)
Pixmap oldBitmap, oldMask;
/*
- * For each of the options in masterPtr, translate the string
- * form into an internal form appropriate for instancePtr.
+ * For each of the options in masterPtr, translate the string form into an
+ * internal form appropriate for instancePtr.
*/
if (*masterPtr->bgUid != 0) {
@@ -385,9 +373,6 @@ ImgBmapConfigureInstance(instancePtr)
}
instancePtr->fg = colorPtr;
- oldMask = instancePtr->mask;
- instancePtr->mask = None;
-
/*
* Careful: We have to allocate new Pixmaps before deleting the old ones.
* Otherwise, The XID allocator will always return the same XID for the
@@ -447,11 +432,10 @@ ImgBmapConfigureInstance(instancePtr)
instancePtr->gc = gc;
return;
- error:
+ error:
/*
- * An error occurred: clear the graphics context in the instance to
- * make it clear that this instance cannot be displayed. Then report
- * the error.
+ * An error occurred: clear the graphics context in the instance to make
+ * it clear that this instance cannot be displayed. Then report the error.
*/
if (instancePtr->gc != None) {
@@ -469,17 +453,16 @@ ImgBmapConfigureInstance(instancePtr)
*
* TkGetBitmapData --
*
- * Given a file name or ASCII string, this procedure parses the
- * file or string contents to produce binary data for a bitmap.
+ * Given a file name or ASCII string, this procedure parses the file or
+ * string contents to produce binary data for a bitmap.
*
* Results:
- * If the bitmap description was parsed successfully then the
- * return value is a malloc-ed array containing the bitmap data.
- * The dimensions of the data are stored in *widthPtr and
- * *heightPtr. *hotXPtr and *hotYPtr are set to the bitmap
- * hotspot if one is defined, otherwise they are set to -1, -1.
- * If an error occurred, NULL is returned and an error message is
- * left in the interp's result.
+ * If the bitmap description was parsed successfully then the return
+ * value is a malloc-ed array containing the bitmap data. The dimensions
+ * of the data are stored in *widthPtr and *heightPtr. *hotXPtr and
+ * *hotYPtr are set to the bitmap hotspot if one is defined, otherwise
+ * they are set to -1, -1. If an error occurred, NULL is returned and an
+ * error message is left in the interp's result.
*
* Side effects:
* A bitmap is created.
@@ -488,18 +471,15 @@ ImgBmapConfigureInstance(instancePtr)
*/
char *
-TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
- hotXPtr, hotYPtr)
- Tcl_Interp *interp; /* For reporting errors, or NULL. */
- char *string; /* String describing bitmap. May
- * be NULL. */
- char *fileName; /* Name of file containing bitmap
- * description. Used only if string
- * is NULL. Must not be NULL if
- * string is NULL. */
- int *widthPtr, *heightPtr; /* Dimensions of bitmap get returned
- * here. */
- int *hotXPtr, *hotYPtr; /* Position of hot spot or -1,-1. */
+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.
+ * Used only if string is NULL. Must not be
+ * NULL if string is NULL. */
+ int *widthPtr, int *heightPtr,
+ /* Dimensions of bitmap get returned here. */
+ int *hotXPtr, int *hotYPtr) /* Position of hot spot or -1,-1. */
{
int width, height, numBytes, hotX, hotY;
CONST char *expandedFileName;
@@ -510,11 +490,11 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
pi.string = string;
if (string == NULL) {
- if ((interp != NULL) && Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't get bitmap data from a file in a",
- " safe interpreter", (char *) NULL);
- return NULL;
- }
+ if ((interp != NULL) && Tcl_IsSafe(interp)) {
+ Tcl_AppendResult(interp, "can't get bitmap data from a file in a",
+ " safe interpreter", NULL);
+ return NULL;
+ }
expandedFileName = Tcl_TranslateFileName(interp, fileName, &buffer);
if (expandedFileName == NULL) {
return NULL;
@@ -525,29 +505,28 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
if (interp != NULL) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "couldn't read bitmap file \"",
- fileName, "\": ", Tcl_PosixError(interp),
- (char *) NULL);
+ fileName, "\": ", Tcl_PosixError(interp), NULL);
}
return NULL;
}
-
- if (Tcl_SetChannelOption(interp, pi.chan, "-translation", "binary")
+
+ if (Tcl_SetChannelOption(interp, pi.chan, "-translation", "binary")
!= TCL_OK) {
- return NULL;
- }
- if (Tcl_SetChannelOption(interp, pi.chan, "-encoding", "binary")
+ return NULL;
+ }
+ if (Tcl_SetChannelOption(interp, pi.chan, "-encoding", "binary")
!= TCL_OK) {
- return NULL;
- }
+ return NULL;
+ }
} else {
pi.chan = NULL;
}
/*
- * Parse the lines that define the dimensions of the bitmap,
- * plus the first line that defines the bitmap data (it declares
- * the name of a data variable but doesn't include any actual
- * data). These lines look something like the following:
+ * Parse the lines that define the dimensions of the bitmap, plus the
+ * first line that defines the bitmap data (it declares the name of a data
+ * variable but doesn't include any actual data). These lines look
+ * something like the following:
*
* #define foo_width 16
* #define foo_height 16
@@ -555,9 +534,9 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
* #define foo_y_hot 3
* static char foo_bits[] = {
*
- * The x_hot and y_hot lines may or may not be present. It's
- * important to check for "char" in the last line, in order to
- * reject old X10-style bitmaps that used shorts.
+ * The x_hot and y_hot lines may or may not be present. It's important to
+ * check for "char" in the last line, in order to reject old X10-style
+ * bitmaps that used shorts.
*/
width = 0;
@@ -616,19 +595,18 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
} else if ((pi.word[0] == '{') && (pi.word[1] == 0)) {
if (interp != NULL) {
Tcl_AppendResult(interp, "format error in bitmap data; ",
- "looks like it's an obsolete X10 bitmap file",
- (char *) NULL);
+ "looks like it's an obsolete X10 bitmap file", NULL);
}
goto errorCleanup;
}
}
/*
- * Now we've read everything but the data. Allocate an array
- * and read in the data.
+ * Now we've read everything but the data. Allocate an array and read in
+ * the data.
*/
- getData:
+ getData:
if ((width <= 0) || (height <= 0)) {
goto error;
}
@@ -645,7 +623,7 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
}
/*
- * All done. Clean up and return.
+ * All done. Clean up and return.
*/
if (pi.chan != NULL) {
@@ -657,12 +635,12 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
*hotYPtr = hotY;
return data;
- error:
+ error:
if (interp != NULL) {
Tcl_SetResult(interp, "format error in bitmap data", TCL_STATIC);
}
-
- errorCleanup:
+
+ errorCleanup:
if (data != NULL) {
ckfree(data);
}
@@ -677,13 +655,13 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
*
* NextBitmapWord --
*
- * This procedure retrieves the next word of information (stuff
- * between commas or white space) from a bitmap description.
+ * This procedure retrieves the next word of information (stuff between
+ * commas or white space) from a bitmap description.
*
* Results:
- * Returns TCL_OK if all went well. In this case the next word,
- * and its length, will be availble in *parseInfoPtr. If the end
- * of the bitmap description was reached then TCL_ERROR is returned.
+ * Returns TCL_OK if all went well. In this case the next word, and its
+ * length, will be availble in *parseInfoPtr. If the end of the bitmap
+ * description was reached then TCL_ERROR is returned.
*
* Side effects:
* None.
@@ -692,9 +670,9 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
*/
static int
-NextBitmapWord(parseInfoPtr)
- ParseInfo *parseInfoPtr; /* Describes what we're reading
- * and where we are in it. */
+NextBitmapWord(
+ ParseInfo *parseInfoPtr) /* Describes what we're reading and where we
+ * are in it. */
{
char *src, *dst;
int c;
@@ -746,9 +724,9 @@ NextBitmapWord(parseInfoPtr)
*
* ImgBmapCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to an image managed by this module.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the Tcl command that corresponds
+ * to an image managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -760,15 +738,15 @@ NextBitmapWord(parseInfoPtr)
*/
static int
-ImgBmapCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about the image master. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+ImgBmapCmd(
+ ClientData clientData, /* Information about the image master. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- static CONST char *bmapOptions[] = {"cget", "configure", (char *) NULL};
+ static CONST char *bmapOptions[] = {"cget", "configure", NULL};
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
- int code, index;
+ int index;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
@@ -779,33 +757,29 @@ ImgBmapCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
switch (index) {
- case 0: {
+ case 0: /* cget */
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "option");
return TCL_ERROR;
}
return Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
(char *) masterPtr, Tcl_GetString(objv[2]), 0);
- }
- case 1: {
+ case 1: /* configure */
if (objc == 2) {
- code = Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) masterPtr, (char *) NULL, 0);
+ return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
+ configSpecs, (char *) masterPtr, NULL, 0);
} else if (objc == 3) {
- code = Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
+ return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
configSpecs, (char *) masterPtr,
Tcl_GetString(objv[2]), 0);
} else {
- code = ImgBmapConfigureMaster(masterPtr, objc-2, objv+2,
+ return ImgBmapConfigureMaster(masterPtr, objc-2, objv+2,
TK_CONFIG_ARGV_ONLY);
}
- return code;
- }
- default: {
- panic("bad const entries to bmapOptions in ImgBmapCmd");
- }
+ default:
+ Tcl_Panic("bad const entries to bmapOptions in ImgBmapCmd");
+ return TCL_OK;
}
- return TCL_OK;
}
/*
@@ -813,33 +787,32 @@ ImgBmapCmd(clientData, interp, objc, objv)
*
* ImgBmapGet --
*
- * This procedure is called for each use of a bitmap image in a
- * widget.
+ * This procedure is called for each use of a bitmap image in a widget.
*
* Results:
- * The return value is a token for the instance, which is passed
- * back to us in calls to ImgBmapDisplay and ImgBmapFree.
+ * The return value is a token for the instance, which is passed back to
+ * us in calls to ImgBmapDisplay and ImgBmapFree.
*
* Side effects:
- * A data structure is set up for the instance (or, an existing
- * instance is re-used for the new one).
+ * A data structure is set up for the instance (or, an existing instance
+ * is re-used for the new one).
*
*----------------------------------------------------------------------
*/
static ClientData
-ImgBmapGet(tkwin, masterData)
- Tk_Window tkwin; /* Window in which the instance will be
+ImgBmapGet(
+ Tk_Window tkwin, /* Window in which the instance will be
* used. */
- ClientData masterData; /* Pointer to our master structure for the
+ ClientData masterData) /* Pointer to our master structure for the
* image. */
{
BitmapMaster *masterPtr = (BitmapMaster *) masterData;
BitmapInstance *instancePtr;
/*
- * See if there is already an instance for this window. If so
- * then just re-use it.
+ * See if there is already an instance for this window. If so then just
+ * re-use it.
*/
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
@@ -851,8 +824,8 @@ ImgBmapGet(tkwin, masterData)
}
/*
- * The image isn't already in use in this window. Make a new
- * instance of the image.
+ * The image isn't already in use in this window. Make a new instance of
+ * the image.
*/
instancePtr = (BitmapInstance *) ckalloc(sizeof(BitmapInstance));
@@ -897,24 +870,24 @@ ImgBmapGet(tkwin, masterData)
*/
static void
-ImgBmapDisplay(clientData, display, drawable, imageX, imageY, width,
- height, drawableX, drawableY)
- ClientData clientData; /* Pointer to BitmapInstance structure for
- * 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, imageY; /* Upper-left corner of region within image
- * to draw. */
- int width, height; /* Dimensions of region within image to draw. */
- int drawableX, drawableY; /* Coordinates within drawable that
- * correspond to imageX and imageY. */
+ImgBmapDisplay(
+ ClientData clientData, /* Pointer to BitmapInstance 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. */
{
BitmapInstance *instancePtr = (BitmapInstance *) clientData;
int masking;
/*
- * If there's no graphics context, it means that an error occurred
- * while creating the image instance so it can't be displayed.
+ * If there's no graphics context, it means that an error occurred while
+ * creating the image instance so it can't be displayed.
*/
if (instancePtr->gc == None) {
@@ -922,10 +895,9 @@ ImgBmapDisplay(clientData, display, drawable, imageX, imageY, width,
}
/*
- * If masking is in effect, must modify the mask origin within
- * the graphics context to line up with the image's origin.
- * Then draw the image and reset the clip origin, if there's
- * a mask.
+ * If masking is in effect, must modify the mask origin within the
+ * graphics context to line up with the image's origin. Then draw the
+ * image and reset the clip origin, if there's a mask.
*/
masking = (instancePtr->mask != None) || (instancePtr->bg == NULL);
@@ -946,8 +918,8 @@ ImgBmapDisplay(clientData, display, drawable, imageX, imageY, width,
*
* ImgBmapFree --
*
- * This procedure is called when a widget ceases to use a
- * particular instance of an image.
+ * This procedure is called when a widget ceases to use a particular
+ * instance of an image.
*
* Results:
* None.
@@ -959,10 +931,10 @@ ImgBmapDisplay(clientData, display, drawable, imageX, imageY, width,
*/
static void
-ImgBmapFree(clientData, display)
- ClientData clientData; /* Pointer to BitmapInstance structure for
- * for instance to be displayed. */
- Display *display; /* Display containing window that used image. */
+ImgBmapFree(
+ ClientData clientData, /* Pointer to BitmapInstance structure for
+ * instance to be displayed. */
+ Display *display) /* Display containing window that used image. */
{
BitmapInstance *instancePtr = (BitmapInstance *) clientData;
BitmapInstance *prevPtr;
@@ -973,8 +945,8 @@ ImgBmapFree(clientData, display)
}
/*
- * There are no more uses of the image within this widget. Free
- * the instance structure.
+ * There are no more uses of the image within this widget. Free the
+ * instance structure.
*/
if (instancePtr->fg != NULL) {
@@ -1009,8 +981,8 @@ ImgBmapFree(clientData, display)
*
* ImgBmapDelete --
*
- * This procedure is called by the image code to delete the
- * master structure for an image.
+ * This procedure is called by the image code to delete the master
+ * structure for an image.
*
* Results:
* None.
@@ -1022,14 +994,14 @@ ImgBmapFree(clientData, display)
*/
static void
-ImgBmapDelete(masterData)
- ClientData masterData; /* Pointer to BitmapMaster structure for
- * image. Must not have any more instances. */
+ImgBmapDelete(
+ ClientData masterData) /* Pointer to BitmapMaster structure for
+ * image. Must not have any more instances. */
{
BitmapMaster *masterPtr = (BitmapMaster *) masterData;
if (masterPtr->instancePtr != NULL) {
- panic("tried to delete bitmap image when instances still exist");
+ Tcl_Panic("tried to delete bitmap image when instances still exist");
}
masterPtr->tkMaster = NULL;
if (masterPtr->imageCmd != NULL) {
@@ -1041,7 +1013,7 @@ ImgBmapDelete(masterData)
if (masterPtr->maskData != NULL) {
ckfree(masterPtr->maskData);
}
- Tk_FreeOptions(configSpecs, (char *) masterPtr, (Display *) NULL, 0);
+ Tk_FreeOptions(configSpecs, (char *) masterPtr, NULL, 0);
ckfree((char *) masterPtr);
}
@@ -1050,8 +1022,8 @@ ImgBmapDelete(masterData)
*
* ImgBmapCmdDeletedProc --
*
- * This procedure is invoked when the image command for an image
- * is deleted. It deletes the image.
+ * This procedure is invoked when the image command for an image is
+ * deleted. It deletes the image.
*
* Results:
* None.
@@ -1063,8 +1035,8 @@ ImgBmapDelete(masterData)
*/
static void
-ImgBmapCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to BitmapMaster structure for
+ImgBmapCmdDeletedProc(
+ ClientData clientData) /* Pointer to BitmapMaster structure for
* image. */
{
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
@@ -1092,8 +1064,8 @@ ImgBmapCmdDeletedProc(clientData)
*/
static int
-GetByte(chan)
- Tcl_Channel chan; /* The channel we read from. */
+GetByte(
+ Tcl_Channel chan) /* The channel we read from. */
{
char buffer;
int size;
@@ -1112,29 +1084,28 @@ GetByte(chan)
*
* ImgBmapPsImagemask --
*
- * This procedure generates postscript suitable for rendering a
- * single bitmap of an image. A single bitmap image might contain both
- * a foreground and a background bitmap. This routine is called once
- * for each such bitmap in a bitmap image.
+ * This procedure generates postscript suitable for rendering a single
+ * bitmap of an image. A single bitmap image might contain both a
+ * foreground and a background bitmap. This routine is called once for
+ * each such bitmap in a bitmap image.
*
- * Prior to invoking this routine, the following setup has occurred:
+ * Prior to invoking this routine, the following setup has occurred:
*
- * 1. The postscript foreground color has been set to the color
- * used to render the bitmap.
+ * 1. The postscript foreground color has been set to the color used
+ * to render the bitmap.
*
- * 2. The origin of the postscript coordinate system is set to
- * the lower left corner of the bitmap.
+ * 2. The origin of the postscript coordinate system is set to the
+ * lower left corner of the bitmap.
*
- * 3. The postscript coordinate system has been scaled so that
- * the entire bitmap is one unit squared.
+ * 3. The postscript coordinate system has been scaled so that the
+ * entire bitmap is one unit squared.
*
- * Some postscript implementations cannot handle bitmap strings
- * longer than about 60k characters. If the bitmap data is that big
- * or bigger, then we render it by splitting it into several smaller
- * bitmaps.
+ * Some postscript implementations cannot handle bitmap strings longer
+ * than about 60k characters. If the bitmap data is that big or bigger,
+ * then we render it by splitting it into several smaller bitmaps.
*
* Results:
- * Returns TCL_OK on success. Returns TCL_ERROR and leaves and error
+ * Returns TCL_OK on success. Returns TCL_ERROR and leaves and error
* message in interp->result if there is a problem.
*
* Side effects:
@@ -1144,21 +1115,22 @@ GetByte(chan)
*/
static int
-ImgBmapPsImagemask(interp, width, height, data)
- Tcl_Interp *interp; /* Append postscript to this interpreter */
- int width, height; /* Width and height of the bitmap in pixels */
- char *data; /* Data for the bitmap */
+ImgBmapPsImagemask(
+ Tcl_Interp *interp, /* Append postscript to this interpreter */
+ int width, int height, /* Width and height of the bitmap in pixels */
+ char *data) /* Data for the bitmap */
{
int i, j, nBytePerRow;
char buffer[200];
- /*
+ /*
* The bit order of bitmaps in Tk is the opposite of the bit order that
- * postscript uses. (In Tk, the least significant bit is on the right
- * side of the bitmap and in postscript the least significant bit is shown
- * on the left.) The following array is used to reverse the order of bits
+ * postscript uses. (In Tk, the least significant bit is on the right side
+ * of the bitmap and in postscript the least significant bit is shown on
+ * the left.) The following array is used to reverse the order of bits
* within a byte so that the bits will be in the order postscript expects.
*/
+
static unsigned char bit_reverse[] = {
0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,
8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,
@@ -1184,17 +1156,21 @@ ImgBmapPsImagemask(interp, width, height, data)
"larger than 60000 pixels", NULL);
return TCL_ERROR;
}
+
sprintf(buffer, "0 0 moveto %d %d true [%d 0 0 %d 0 %d] {<\n",
- width, height, width, -height, height);
+ width, height, width, -height, height);
Tcl_AppendResult(interp, buffer, NULL);
+
nBytePerRow = (width+7)/8;
for(i=0; i<height; i++){
- for(j=0; j<nBytePerRow; j++){
- sprintf(buffer, " %02x", bit_reverse[0xff & data[i*nBytePerRow + j]]);
- Tcl_AppendResult(interp, buffer, NULL);
- }
- Tcl_AppendResult(interp, "\n", NULL);
+ for(j=0; j<nBytePerRow; j++){
+ sprintf(buffer, " %02x",
+ bit_reverse[0xff & data[i*nBytePerRow + j]]);
+ Tcl_AppendResult(interp, buffer, NULL);
+ }
+ Tcl_AppendResult(interp, "\n", NULL);
}
+
Tcl_AppendResult(interp, ">} imagemask \n", NULL);
return TCL_OK;
}
@@ -1207,9 +1183,10 @@ ImgBmapPsImagemask(interp, width, height, data)
* This procedure generates postscript for rendering a bitmap image.
*
* Results:
+
* On success, this routine writes postscript code into interp->result
- * and returns TCL_OK TCL_ERROR is returned and an error
- * message is left in interp->result if anything goes wrong.
+ * and returns TCL_OK TCL_ERROR is returned and an error message is left
+ * in interp->result if anything goes wrong.
*
* Side effects:
* None.
@@ -1218,13 +1195,13 @@ ImgBmapPsImagemask(interp, width, height, data)
*/
static int
-ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
- prepass)
- ClientData clientData;
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psinfo;
- int x, y, width, height, prepass;
+ImgBmapPostscript(
+ ClientData clientData,
+ Tcl_Interp *interp,
+ Tk_Window tkwin,
+ Tk_PostscriptInfo psinfo,
+ int x, int y, int width, int height,
+ int prepass)
{
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
char buffer[200];
@@ -1234,38 +1211,42 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
}
/*
- * There is nothing to do for bitmaps with zero width or height
+ * There is nothing to do for bitmaps with zero width or height.
*/
- if( width<=0 || height<=0 || masterPtr->width<=0 || masterPtr->height<=0 ){
+
+ if (width<=0 || height<=0 || masterPtr->width<=0 || masterPtr->height<= 0){
return TCL_OK;
}
/*
* Translate the origin of the coordinate system to be the lower-left
- * corner of the bitmap and adjust the scale of the coordinate system
- * so that entire bitmap covers one square unit of the page.
- * The calling function put a "gsave" into the postscript and
- * will add a "grestore" at after this routine returns, so it is safe
- * to make whatever changes are necessary here.
+ * corner of the bitmap and adjust the scale of the coordinate system so
+ * that entire bitmap covers one square unit of the page. The calling
+ * function put a "gsave" into the postscript and will add a "grestore" at
+ * after this routine returns, so it is safe to make whatever changes are
+ * necessary here.
*/
- if( x!=0 || y!=0 ){
+
+ if (x!=0 || y!=0) {
sprintf(buffer, "%d %d moveto\n", x, y);
Tcl_AppendResult(interp, buffer, NULL);
}
- if( width!=1 || height!=1 ){
+ if (width!=1 || height!=1) {
sprintf(buffer, "%d %d scale\n", width, height);
Tcl_AppendResult(interp, buffer, NULL);
}
/*
- * Color the background, if there is one. This step is skipped if the
- * background is transparent. If the background is not transparent and
+ * Color the background, if there is one. This step is skipped if the
+ * background is transparent. If the background is not transparent and
* there is no background mask, then color the complete rectangle that
- * encloses the bitmap. If there is a background mask, then only apply
+ * encloses the bitmap. If there is a background mask, then only apply
* color to the bits specified by the mask.
*/
+
if ((masterPtr->bgUid != NULL) && (masterPtr->bgUid[0] != '\000')) {
XColor color;
+
XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->bgUid,
&color);
if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) {
@@ -1273,10 +1254,10 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
}
if (masterPtr->maskData == NULL) {
Tcl_AppendResult(interp,
- "0 0 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto "
- "closepath fill\n", NULL);
+ "0 0 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto ",
+ "closepath fill\n", NULL);
} else if (ImgBmapPsImagemask(interp, masterPtr->width,
- masterPtr->height, masterPtr->maskData) != TCL_OK) {
+ masterPtr->height, masterPtr->maskData) != TCL_OK) {
return TCL_ERROR;
}
}
@@ -1284,8 +1265,10 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
/*
* Draw the bitmap foreground, assuming there is one.
*/
- if ( (masterPtr->fgUid != NULL) && (masterPtr->data != NULL) ) {
+
+ if ((masterPtr->fgUid != NULL) && (masterPtr->data != NULL)) {
XColor color;
+
XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->fgUid,
&color);
if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) {
@@ -1298,3 +1281,11 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
}
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index 9c2004a..e576559 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -1,20 +1,20 @@
/*
* tkImgGIF.c --
*
- * A photo image file handler for GIF files. Reads 87a and 89a GIF
- * files. At present, there only is a file write function. GIF images
- * may be read using the -data option of the photo image. The data may be
- * given as a binary string in a Tcl_Obj or by representing
- * the data as BASE64 encoded ascii. Derived from the giftoppm code
- * found in the pbmplus package and tkImgFmtPPM.c in the tk4.0b2
- * distribution.
+ * A photo image file handler for GIF files. Reads 87a and 89a GIF files.
+ * At present, there only is a file write function. GIF images may be
+ * read using the -data option of the photo image. The data may be given
+ * as a binary string in a Tcl_Obj or by representing the data as BASE64
+ * encoded ascii. Derived from the giftoppm code found in the pbmplus
+ * package and tkImgFmtPPM.c in the tk4.0b2 distribution.
*
* 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
*
- * 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.
*
* This file also contains code from the giftoppm program, which is
* copyrighted as follows:
@@ -25,18 +25,22 @@
* | 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 |
+ * | 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"
+
/*
- * GIF's are represented as data in base64 format.
- * base64 strings consist of 4 6-bit characters -> 3 8 bit bytes.
- * A-Z, a-z, 0-9, + and / represent the 64 values (in order).
- * '=' is a trailing padding char when the un-encoded data is not a
- * multiple of 3 bytes. We'll ignore white space when encountered.
- * Any other invalid character is treated as an EOF
+ * GIF's are represented as data in either binary or base64 format. base64
+ * strings consist of 4 6-bit characters -> 3 8 bit bytes. A-Z, a-z, 0-9, +
+ * and / represent the 64 values (in order). '=' is a trailing padding char
+ * when the un-encoded data is not a multiple of 3 bytes. We'll ignore white
+ * space when encountered. Any other invalid character is treated as an EOF
*/
#define GIF_SPECIAL (256)
@@ -46,77 +50,86 @@
#define GIF_DONE (GIF_SPECIAL+4)
/*
- * structure to "mimic" FILE for Mread, so we can look like fread.
- * The decoder state keeps track of which byte we are about to read,
- * or EOF.
+ * structure to "mimic" FILE for Mread, so we can look like fread. The decoder
+ * state keeps track of which byte we are about to read, or EOF.
*/
typedef struct mFile {
unsigned char *data; /* mmencoded source string */
- int length; /* Length of string in bytes */
int c; /* bits left over from previous character */
int state; /* decoder state (0-4 or GIF_DONE) */
+ int length; /* Total amount of bytes in data */
} MFile;
-#include "tkInt.h"
-#include "tkPort.h"
-
/*
* Non-ASCII encoding support:
- * Most data in a GIF image is binary and is treated as such. However,
- * a few key bits are stashed in ASCII. If we try to compare those pieces
- * to the char they represent, it will fail on any non-ASCII (eg, EBCDIC)
- * system. To accomodate these systems, we test against the numeric value
- * of the ASCII characters instead of the characters themselves. This is
- * encoding independant.
+ * Most data in a GIF image is binary and is treated as such. However, a few
+ * key bits are stashed in ASCII. If we try to compare those pieces to the
+ * char they represent, it will fail on any non-ASCII (eg, EBCDIC) system. To
+ * accomodate these systems, we test against the numeric value of the ASCII
+ * characters instead of the characters themselves. This is encoding
+ * independant.
*/
-static CONST char GIF87a[] = { /* ASCII GIF87a */
+static const char GIF87a[] = { /* ASCII GIF87a */
0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x00
};
-static CONST char GIF89a[] = { /* ASCII GIF89a */
+static const char GIF89a[] = { /* ASCII GIF89a */
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x00
};
-# define GIF_TERMINATOR 0x3b /* ASCII ; */
-# define GIF_EXTENSION 0x21 /* ASCII ! */
-# define GIF_START 0x2c /* ASCII , */
+#define GIF_TERMINATOR 0x3b /* ASCII ; */
+#define GIF_EXTENSION 0x21 /* ASCII ! */
+#define GIF_START 0x2c /* ASCII , */
/*
- * HACK ALERT!! HACK ALERT!! HACK ALERT!!
- * This code is hard-wired for reading from files. In order to read
- * from a data stream, we'll trick fread so we can reuse the same code.
- * 0==from file; 1==from base64 encoded data; 2==from binary data
+ * Flags used to notify that we've got inline data instead of a file to read
+ * from. Note that we need to figure out which type of inline data we've got
+ * before handing off to the GIF reading code; this is done in StringReadGIF.
*/
-typedef struct ThreadSpecificData {
- int fromData;
-} ThreadSpecificData;
-static Tcl_ThreadDataKey dataKey;
+#define INLINE_DATA_BINARY ((const char *) 0x01)
+#define INLINE_DATA_BASE64 ((const char *) 0x02)
+
+/*
+ * HACK ALERT!! HACK ALERT!! HACK ALERT!!
+ * This code is hard-wired for reading from files. In order to read from a
+ * data stream, we'll trick fread so we can reuse the same code. 0==from file;
+ * 1==from base64 encoded data; 2==from binary data
+ */
+
+typedef struct {
+ const char *fromData;
+ unsigned char workingBuffer[280];
+ struct {
+ int bytes;
+ int done;
+ unsigned int window;
+ int bitsInWindow;
+ unsigned char *c;
+ } reader;
+} GIFImageConfig;
/*
* The format record for the GIF file format:
*/
-static int FileMatchGIF _ANSI_ARGS_((Tcl_Channel chan, CONST char *fileName,
- Tcl_Obj *format, int *widthPtr, int *heightPtr,
- Tcl_Interp *interp));
-static int FileReadGIF _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Channel chan, CONST char *fileName, Tcl_Obj *format,
- Tk_PhotoHandle imageHandle, int destX, int destY,
- int width, int height, int srcX, int srcY));
-static int StringMatchGIF _ANSI_ARGS_(( Tcl_Obj *dataObj,
- Tcl_Obj *format, int *widthPtr, int *heightPtr,
- Tcl_Interp *interp));
-static int StringReadGIF _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));
-static int FileWriteGIF _ANSI_ARGS_((Tcl_Interp *interp,
- CONST char *filename, Tcl_Obj *format,
- Tk_PhotoImageBlock *blockPtr));
-static int CommonWriteGIF _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Channel handle, Tcl_Obj *format,
- Tk_PhotoImageBlock *blockPtr));
+static int FileMatchGIF(Tcl_Channel chan, const char *fileName,
+ Tcl_Obj *format, int *widthPtr, int *heightPtr,
+ Tcl_Interp *interp);
+static int FileReadGIF(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);
+static int StringMatchGIF(Tcl_Obj *dataObj, Tcl_Obj *format,
+ int *widthPtr, int *heightPtr, Tcl_Interp *interp);
+static int StringReadGIF(Tcl_Interp *interp, Tcl_Obj *dataObj,
+ Tcl_Obj *format, Tk_PhotoHandle imageHandle,
+ int destX, int destY, int width, int height,
+ 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);
Tk_PhotoImageFormat tkImgFmtGIF = {
"gif", /* name */
@@ -138,54 +151,53 @@ Tk_PhotoImageFormat tkImgFmtGIF = {
#define CM_ALPHA 3
#define MAX_LWZ_BITS 12
#define LM_to_uint(a,b) (((b)<<8)|(a))
-#define ReadOK(file,buffer,len) (Fread(buffer, len, 1, file) != 0)
/*
- * Prototypes for local procedures defined in this file:
+ * Prototypes for local functions defined in this file:
*/
-static int DoExtension _ANSI_ARGS_((Tcl_Channel chan, int label,
- int *transparent));
-static int GetCode _ANSI_ARGS_((Tcl_Channel chan, int code_size,
- int flag));
-static int GetDataBlock _ANSI_ARGS_((Tcl_Channel chan,
- unsigned char *buf));
-static int ReadColorMap _ANSI_ARGS_((Tcl_Channel chan, int number,
- unsigned char buffer[MAXCOLORMAPSIZE][4]));
-static int ReadGIFHeader _ANSI_ARGS_((Tcl_Channel chan,
- int *widthPtr, int *heightPtr));
-static int ReadImage _ANSI_ARGS_((Tcl_Interp *interp,
- char *imagePtr, Tcl_Channel chan,
- int len, int rows,
- unsigned char cmap[MAXCOLORMAPSIZE][4],
- int width, int height, int srcX, int srcY,
- int interlace, int transparent));
+static int DoExtension(GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan, int label, unsigned char *buffer,
+ int *transparent);
+static int GetCode(Tcl_Channel chan, int code_size, int flag,
+ GIFImageConfig *gifConfPtr);
+static int GetDataBlock(GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan, unsigned char *buf);
+static int ReadColorMap(GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan, int number,
+ unsigned char buffer[MAXCOLORMAPSIZE][4]);
+static int ReadGIFHeader(GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan, int *widthPtr, int *heightPtr);
+static int ReadImage(GIFImageConfig *gifConfPtr,
+ Tcl_Interp *interp, unsigned char *imagePtr,
+ Tcl_Channel chan, int len, int rows,
+ unsigned char cmap[MAXCOLORMAPSIZE][4], int srcX,
+ int srcY, int interlace, int transparent);
/*
* these are for the BASE64 image reader code only
*/
-static int Fread _ANSI_ARGS_((unsigned char *dst, size_t size,
- size_t count, Tcl_Channel chan));
-static int Mread _ANSI_ARGS_((unsigned char *dst, size_t size,
- size_t count, MFile *handle));
-static int Mgetc _ANSI_ARGS_((MFile *handle));
-static int char64 _ANSI_ARGS_((int c));
-static void mInit _ANSI_ARGS_((unsigned char *string,
- int length, MFile *handle));
-
+static int Fread(GIFImageConfig *gifConfPtr, unsigned char *dst,
+ size_t size, size_t count, Tcl_Channel chan);
+static int Mread(unsigned char *dst, size_t size, size_t count,
+ MFile *handle);
+static int Mgetc(MFile *handle);
+static int char64(int c);
+static void mInit(unsigned char *string, MFile *handle,
+ int length);
/*
*----------------------------------------------------------------------
*
* FileMatchGIF --
*
- * This procedure is invoked by the photo image type to see if
- * a file contains image data in GIF format.
+ * This function is invoked by the photo image type to see if a file
+ * contains image data in GIF format.
*
* Results:
- * The return value is 1 if the first characters in file f look
- * like GIF data, and 0 otherwise.
+ * The return value is 1 if the first characters in file f look like GIF
+ * data, and 0 otherwise.
*
* Side effects:
* The access position in f may change.
@@ -194,16 +206,19 @@ static void mInit _ANSI_ARGS_((unsigned char *string,
*/
static int
-FileMatchGIF(chan, fileName, format, widthPtr, heightPtr, interp)
- Tcl_Channel chan; /* The image file, open for reading. */
- CONST char *fileName; /* The name of the image file. */
- Tcl_Obj *format; /* User-specified format object, or NULL. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here if the file is a valid
- * raw GIF file. */
- Tcl_Interp *interp; /* not used */
+FileMatchGIF(
+ Tcl_Channel chan, /* The image file, open for reading. */
+ const char *fileName, /* The name of the image file. */
+ Tcl_Obj *format, /* User-specified format object, or NULL. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here if the file is a valid raw GIF file. */
+ Tcl_Interp *interp) /* not used */
{
- return ReadGIFHeader(chan, widthPtr, heightPtr);
+ GIFImageConfig gifConf;
+
+ memset(&gifConf, 0, sizeof(GIFImageConfig));
+ return ReadGIFHeader(&gifConf, chan, widthPtr, heightPtr);
}
/*
@@ -211,88 +226,108 @@ FileMatchGIF(chan, fileName, format, widthPtr, heightPtr, interp)
*
* FileReadGIF --
*
- * This procedure is called by the photo image type to read
- * GIF format data from a file and write it into a given
- * photo image.
+ * This function is called by the photo image type to read GIF 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.
+ * 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.
+ * The access position in file f is changed, and new data is added to the
+ * image given by imageHandle.
*
*----------------------------------------------------------------------
*/
static int
-FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
- width, height, srcX, srcY)
- 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. */
- Tcl_Obj *format; /* User-specified format object, or NULL. */
- Tk_PhotoHandle imageHandle; /* The photo image to write into. */
- int destX, destY; /* Coordinates of top-left pixel in
- * photo image to be written to. */
- int width, height; /* Dimensions of block of photo image to
- * be written to. */
- int srcX, srcY; /* Coordinates of top-left pixel to be used
- * in image being read. */
+FileReadGIF(
+ 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. */
+ Tcl_Obj *format, /* User-specified format object, or NULL. */
+ Tk_PhotoHandle imageHandle, /* The photo image to write into. */
+ int destX, int destY, /* Coordinates of top-left pixel in photo
+ * image to be written to. */
+ int width, int height, /* Dimensions of block of photo image to be
+ * written to. */
+ int srcX, int srcY) /* Coordinates of top-left pixel to be used in
+ * image being read. */
{
int fileWidth, fileHeight, imageWidth, imageHeight;
- int nBytes, index = 0, argc = 0, i;
+ int nBytes, index = 0, argc = 0, i, result = TCL_ERROR;
Tcl_Obj **objv;
- Tk_PhotoImageBlock block;
unsigned char buf[100];
unsigned char *trashBuffer = NULL;
int bitPixel;
unsigned char colorMap[MAXCOLORMAPSIZE][4];
int transparent = -1;
- static CONST char *optionStrings[] = {
- "-index", NULL
+ static const char *optionStrings[] = {
+ "-index", NULL
};
+ GIFImageConfig gifConf, *gifConfPtr = &gifConf;
+
+ /*
+ * Decode the magic used to convey when we're sourcing data from a string
+ * source and not a file.
+ */
+
+ memset(gifConfPtr, 0, sizeof(GIFImageConfig));
+ if (fileName == INLINE_DATA_BINARY || fileName == INLINE_DATA_BASE64) {
+ gifConfPtr->fromData = fileName;
+ fileName = "inline data";
+ }
+
+ /*
+ * Parse the format string to get options.
+ */
if (format && Tcl_ListObjGetElements(interp, format,
&argc, &objv) != TCL_OK) {
return TCL_ERROR;
}
for (i = 1; i < argc; i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option name", 0,
- &nBytes) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option name",
+ 0, &nBytes) != TCL_OK) {
return TCL_ERROR;
}
if (i == (argc-1)) {
Tcl_AppendResult(interp, "no value given for \"",
- Tcl_GetStringFromObj(objv[i], NULL),
- "\" option", (char *) NULL);
+ Tcl_GetString(objv[i]), "\" option", NULL);
return TCL_ERROR;
}
if (Tcl_GetIntFromObj(interp, objv[++i], &index) != TCL_OK) {
return TCL_ERROR;
}
}
- if (!ReadGIFHeader(chan, &fileWidth, &fileHeight)) {
- Tcl_AppendResult(interp, "couldn't read GIF header from file \"",
+
+ /*
+ * Read the GIF file header and check for some sanity.
+ */
+
+ if (!ReadGIFHeader(gifConfPtr, chan, &fileWidth, &fileHeight)) {
+ Tcl_AppendResult(interp, "couldn't read GIF header from file \"",
fileName, "\"", NULL);
return TCL_ERROR;
}
if ((fileWidth <= 0) || (fileHeight <= 0)) {
Tcl_AppendResult(interp, "GIF image file \"", fileName,
- "\" has dimension(s) <= 0", (char *) NULL);
+ "\" has dimension(s) <= 0", NULL);
return TCL_ERROR;
}
- if (Fread(buf, 1, 3, chan) != 3) {
+ /*
+ * Get the general colormap information.
+ */
+
+ if (Fread(gifConfPtr, buf, 1, 3, chan) != 3) {
return TCL_OK;
}
- bitPixel = 2<<(buf[0]&0x07);
+ bitPixel = 2 << (buf[0] & 0x07);
if (BitSet(buf[0], LOCALCOLORMAP)) { /* Global Colormap */
- if (!ReadColorMap(chan, bitPixel, colorMap)) {
- Tcl_AppendResult(interp, "error reading color map",
- (char *) NULL);
+ if (!ReadColorMap(gifConfPtr, chan, bitPixel, colorMap)) {
+ Tcl_AppendResult(interp, "error reading color map", NULL);
return TCL_ERROR;
}
}
@@ -308,85 +343,87 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
return TCL_OK;
}
- Tk_PhotoExpand(imageHandle, destX + width, destY + height);
+ /*
+ * Make sure we have enough space in the photo image to hold the data from
+ * the GIF.
+ */
+
+ if (Tk_PhotoExpand(interp, imageHandle,
+ destX + width, destY + height) != TCL_OK) {
+ return TCL_ERROR;
+ }
- block.width = width;
- block.height = height;
- block.pixelSize = 4;
- block.pitch = block.pixelSize * block.width;
- block.offset[0] = 0;
- block.offset[1] = 1;
- block.offset[2] = 2;
- block.offset[3] = 3;
- block.pixelPtr = NULL;
+ /*
+ * Search for the frame from the GIF to display.
+ */
while (1) {
- if (Fread(buf, 1, 1, chan) != 1) {
+ if (Fread(gifConfPtr, buf, 1, 1, chan) != 1) {
/*
* Premature end of image.
*/
- Tcl_AppendResult(interp,"premature end of image data for this index",
- (char *) NULL);
+ Tcl_AppendResult(interp,
+ "premature end of image data for this index", NULL);
goto error;
}
- if (buf[0] == GIF_TERMINATOR) {
- /*
- * GIF terminator.
- */
-
- Tcl_AppendResult(interp,"no image data for this index",
- (char *) NULL);
+ switch (buf[0]) {
+ case GIF_TERMINATOR:
+ Tcl_AppendResult(interp, "no image data for this index", NULL);
goto error;
- }
- if (buf[0] == GIF_EXTENSION) {
+ case GIF_EXTENSION:
/*
* This is a GIF extension.
*/
- if (Fread(buf, 1, 1, chan) != 1) {
+ if (Fread(gifConfPtr, buf, 1, 1, chan) != 1) {
Tcl_SetResult(interp,
"error reading extension function code in GIF image",
TCL_STATIC);
goto error;
}
- if (DoExtension(chan, buf[0], &transparent) < 0) {
+ if (DoExtension(gifConfPtr, chan, buf[0],
+ gifConfPtr->workingBuffer, &transparent) < 0) {
Tcl_SetResult(interp, "error reading extension in GIF image",
TCL_STATIC);
goto error;
}
continue;
- }
-
- if (buf[0] != GIF_START) {
+ case GIF_START:
+ if (Fread(gifConfPtr, buf, 1, 9, chan) != 9) {
+ Tcl_SetResult(interp,
+ "couldn't read left/top/width/height in GIF image",
+ TCL_STATIC);
+ goto error;
+ }
+ break;
+ default:
/*
* Not a valid start character; ignore it.
*/
- continue;
- }
- if (Fread(buf, 1, 9, chan) != 9) {
- Tcl_SetResult(interp,
- "couldn't read left/top/width/height in GIF image",
- TCL_STATIC);
- goto error;
+ continue;
}
- imageWidth = LM_to_uint(buf[4],buf[5]);
- imageHeight = LM_to_uint(buf[6],buf[7]);
+ /*
+ * We've read the header for a GIF frame. Work out what we are going
+ * to do about it.
+ */
- bitPixel = 1<<((buf[8]&0x07)+1);
+ imageWidth = LM_to_uint(buf[4], buf[5]);
+ imageHeight = LM_to_uint(buf[6], buf[7]);
+ bitPixel = 1 << ((buf[8] & 0x07) + 1);
if (index--) {
/*
- * This is not the image we want to read: skip it.
+ * This is not the GIF frame we want to read: skip it.
*/
+
if (BitSet(buf[8], LOCALCOLORMAP)) {
- if (!ReadColorMap(chan, bitPixel, colorMap)) {
- Tcl_AppendResult(interp,
- "error reading color map", (char *) NULL);
+ if (!ReadColorMap(gifConfPtr, chan, bitPixel, colorMap)) {
+ Tcl_AppendResult(interp, "error reading color map", NULL);
goto error;
}
}
@@ -394,113 +431,126 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
/*
* If we've not yet allocated a trash buffer, do so now.
*/
+
if (trashBuffer == NULL) {
nBytes = fileWidth * fileHeight * 3;
- trashBuffer =
- (unsigned char *) ckalloc((unsigned int) nBytes);
+ trashBuffer = (unsigned char *) ckalloc((unsigned) nBytes);
}
/*
- * Slurp! Process the data for this image and stuff it in
- * a trash buffer.
+ * Slurp! Process the data for this image and stuff it in a trash
+ * buffer.
*
- * Yes, it might be more efficient here to *not* store the
- * data (we're just going to throw it away later).
- * However, I elected to implement it this way for good
- * reasons. First, I wanted to avoid duplicating the
- * (fairly complex) LWZ decoder in ReadImage. Fine, you
- * say, why didn't you just modify it to allow the use of
- * a NULL specifier for the output buffer? I tried that,
- * but it negatively impacted the performance of what I
- * think will be the common case: reading the first image
- * in the file. Rather than marginally improve the speed
- * of the less frequent case, I chose to maintain high
- * performance for the common case.
+ * Yes, it might be more efficient here to *not* store the data
+ * (we're just going to throw it away later). However, I elected
+ * to implement it this way for good reasons. First, I wanted to
+ * avoid duplicating the (fairly complex) LWZ decoder in
+ * ReadImage. Fine, you say, why didn't you just modify it to
+ * allow the use of a NULL specifier for the output buffer? I
+ * tried that, but it negatively impacted the performance of what
+ * I think will be the common case: reading the first image in the
+ * file. Rather than marginally improve the speed of the less
+ * frequent case, I chose to maintain high performance for the
+ * common case.
*/
- if (ReadImage(interp, (char *) trashBuffer, chan, imageWidth,
- imageHeight, colorMap, 0, 0, 0, 0, 0, -1) != TCL_OK) {
+
+ if (ReadImage(gifConfPtr, interp, trashBuffer, chan, imageWidth,
+ imageHeight, colorMap, 0, 0, 0, -1) != TCL_OK) {
goto error;
}
continue;
}
+ break;
+ }
- if (BitSet(buf[8], LOCALCOLORMAP)) {
- if (!ReadColorMap(chan, bitPixel, colorMap)) {
- Tcl_AppendResult(interp, "error reading color map",
- (char *) NULL);
- goto error;
- }
- }
+ /*
+ * Found the frame we want to read. Next, check for a local color map for
+ * this frame.
+ */
- index = LM_to_uint(buf[0],buf[1]);
- srcX -= index;
- if (srcX<0) {
- destX -= srcX; width += srcX;
- srcX = 0;
+ if (BitSet(buf[8], LOCALCOLORMAP)) {
+ if (!ReadColorMap(gifConfPtr, chan, bitPixel, colorMap)) {
+ Tcl_AppendResult(interp, "error reading color map", NULL);
+ goto error;
}
+ }
- if (width > imageWidth) {
- width = imageWidth;
- }
+ /*
+ * Extract the location within the overall visible image to put the data
+ * in this frame, together with the size of this frame.
+ */
- index = LM_to_uint(buf[2],buf[3]);
- srcY -= index;
- if (index > srcY) {
- destY -= srcY; height += srcY;
- srcY = 0;
- }
- if (height > imageHeight) {
- height = imageHeight;
- }
+ index = LM_to_uint(buf[0], buf[1]);
+ srcX -= index;
+ if (srcX<0) {
+ destX -= srcX; width += srcX;
+ srcX = 0;
+ }
- if ((width <= 0) || (height <= 0)) {
- block.pixelPtr = 0;
- goto noerror;
- }
+ if (width > imageWidth) {
+ width = imageWidth;
+ }
+
+ index = LM_to_uint(buf[2], buf[3]);
+ srcY -= index;
+ if (index > srcY) {
+ destY -= srcY; height += srcY;
+ srcY = 0;
+ }
+ if (height > imageHeight) {
+ height = imageHeight;
+ }
+
+ if ((width > 0) && (height > 0)) {
+ Tk_PhotoImageBlock block;
+
+ /*
+ * Read the data and put it into the photo buffer for display by the
+ * general image machinery.
+ */
block.width = width;
block.height = height;
block.pixelSize = (transparent>=0) ? 4 : 3;
+ block.offset[0] = 0;
+ block.offset[1] = 1;
+ block.offset[2] = 2;
block.offset[3] = (transparent>=0) ? 3 : 0;
block.pitch = block.pixelSize * imageWidth;
nBytes = block.pitch * imageHeight;
block.pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes);
- if (ReadImage(interp, (char *) block.pixelPtr, chan, imageWidth,
- imageHeight, colorMap, fileWidth, fileHeight, srcX, srcY,
- BitSet(buf[8], INTERLACE), transparent) != TCL_OK) {
+ if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth,
+ imageHeight, colorMap, srcX, srcY, BitSet(buf[8],INTERLACE),
+ transparent) != TCL_OK) {
+ ckfree((char *) block.pixelPtr);
goto error;
}
- break;
+ if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
+ width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
+ ckfree((char *) block.pixelPtr);
+ goto error;
+ }
+ ckfree((char *) block.pixelPtr);
}
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height,
- TK_PHOTO_COMPOSITE_SET);
-
- noerror:
/*
- * If a trash buffer has been allocated, free it now.
+ * We've successfully read the GIF frame (or there was nothing to read,
+ * which suits as well). We're done.
*/
- if (trashBuffer != NULL) {
- ckfree((char *)trashBuffer);
- }
- if (block.pixelPtr) {
- ckfree((char *) block.pixelPtr);
- }
- Tcl_AppendResult(interp, tkImgFmtGIF.name, (char *) NULL);
- return TCL_OK;
- error:
+ Tcl_AppendResult(interp, tkImgFmtGIF.name, NULL);
+ result = TCL_OK;
+
+ error:
/*
* If a trash buffer has been allocated, free it now.
*/
+
if (trashBuffer != NULL) {
- ckfree((char *)trashBuffer);
- }
- if (block.pixelPtr) {
- ckfree((char *) block.pixelPtr);
+ ckfree((char *) trashBuffer);
}
- return TCL_ERROR;
+ return result;
}
/*
@@ -508,26 +558,26 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
*
* StringMatchGIF --
*
- * This procedure is invoked by the photo image type to see if
- * an object contains image data in GIF format.
+ * This function is invoked by the photo image type to see if an object
+ * contains image data in GIF format.
*
* Results:
- * The return value is 1 if the first characters in the data are
- * like GIF data, and 0 otherwise.
+ * The return value is 1 if the first characters in the data are like GIF
+ * data, and 0 otherwise.
*
* Side effects:
- * the size of the image is placed in widthPre and heightPtr.
+ * The size of the image is placed in widthPtr and heightPtr.
*
*----------------------------------------------------------------------
*/
static int
-StringMatchGIF(dataObj, format, widthPtr, heightPtr, interp)
- Tcl_Obj *dataObj; /* the object containing the image data */
- Tcl_Obj *format; /* the image format object, or NULL */
- int *widthPtr; /* where to put the string width */
- int *heightPtr; /* where to put the string height */
- Tcl_Interp *interp; /* not used */
+StringMatchGIF(
+ Tcl_Obj *dataObj, /* the object containing the image data */
+ Tcl_Obj *format, /* the image format object, or NULL */
+ int *widthPtr, /* where to put the string width */
+ int *heightPtr, /* where to put the string height */
+ Tcl_Interp *interp) /* not used */
{
unsigned char *data, header[10];
int got, length;
@@ -538,6 +588,7 @@ StringMatchGIF(dataObj, format, widthPtr, heightPtr, interp)
/*
* Header is a minimum of 10 bytes.
*/
+
if (length < 10) {
return 0;
}
@@ -546,97 +597,99 @@ StringMatchGIF(dataObj, format, widthPtr, heightPtr, interp)
* Check whether the data is Base64 encoded.
*/
- if ((strncmp(GIF87a, (char *) data, 6) != 0) &&
+ if ((strncmp(GIF87a, (char *) data, 6) != 0) &&
(strncmp(GIF89a, (char *) data, 6) != 0)) {
/*
* Try interpreting the data as Base64 encoded
*/
- mInit((unsigned char *) data, length, &handle);
+
+ mInit((unsigned char *) data, &handle, length);
got = Mread(header, 10, 1, &handle);
- if (got != 10
- || ((strncmp(GIF87a, (char *) header, 6) != 0)
+ if (got != 10 ||
+ ((strncmp(GIF87a, (char *) header, 6) != 0)
&& (strncmp(GIF89a, (char *) header, 6) != 0))) {
return 0;
}
} else {
- memcpy((VOID *) header, (VOID *) data, 10);
+ memcpy(header, data, 10);
}
- *widthPtr = LM_to_uint(header[6],header[7]);
- *heightPtr = LM_to_uint(header[8],header[9]);
+ *widthPtr = LM_to_uint(header[6], header[7]);
+ *heightPtr = LM_to_uint(header[8], header[9]);
return 1;
}
/*
*----------------------------------------------------------------------
*
- * StringReadGif -- --
+ * StringReadGIF --
*
- * This procedure is called by the photo image type to read
- * GIF format data from an object, optionally base64 encoded,
- * and give it to the photo image.
+ * This function is called by the photo image type to read GIF format
+ * data from an object, optionally base64 encoded, 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.
+ * 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. This
- * procedure calls FileReadGif by redefining the operation of
- * fprintf temporarily.
+ * New data is added to the image given by imageHandle. This function
+ * calls FileReadGIF by redefining the operation of fprintf temporarily.
*
*----------------------------------------------------------------------
*/
static int
-StringReadGIF(interp, dataObj, format, imageHandle,
- destX, destY, width, height, srcX, srcY)
- Tcl_Interp *interp; /* interpreter for reporting errors in */
- Tcl_Obj *dataObj; /* object containing the image */
- Tcl_Obj *format; /* format object, or NULL */
- Tk_PhotoHandle imageHandle; /* the image to write this data into */
- int destX, destY; /* The rectangular region of the */
- int width, height; /* image to copy */
- int srcX, srcY;
+StringReadGIF(
+ Tcl_Interp *interp, /* interpreter for reporting errors in */
+ Tcl_Obj *dataObj, /* object containing the image */
+ Tcl_Obj *format, /* format object, or NULL */
+ Tk_PhotoHandle imageHandle, /* the image to write this data into */
+ int destX, int destY, /* The rectangular region of the */
+ int width, int height, /* image to copy */
+ int srcX, int srcY)
{
- int result, length;
- MFile handle;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- Tcl_Channel dataSrc;
- char *data;
+ MFile handle, *hdlPtr = &handle;
+ int length;
+ const char *xferFormat;
+ unsigned char *data = Tcl_GetByteArrayFromObj(dataObj, &length);
+
+ mInit(data, hdlPtr, length);
/*
- * Check whether the data is Base64 encoded
+ * Check whether the data is Base64 encoded by doing a character-by-
+ * charcter comparison with the binary-format headers; BASE64-encoded
+ * never matches (matching the other way is harder because of potential
+ * padding of the BASE64 data).
*/
- data = (char *) Tcl_GetByteArrayFromObj(dataObj, &length);
- if ((strncmp(GIF87a, data, 6) != 0) && (strncmp(GIF89a, data, 6) != 0)) {
- mInit((unsigned char *)data, length, &handle);
- tsdPtr->fromData = 1;
- dataSrc = (Tcl_Channel) &handle;
+
+ if (strncmp(GIF87a, (char *) data, 6)
+ && strncmp(GIF89a, (char *) data, 6)) {
+ xferFormat = INLINE_DATA_BASE64;
} else {
- tsdPtr->fromData = 2;
- mInit((unsigned char *)data, length, &handle);
- dataSrc = (Tcl_Channel) &handle;
+ xferFormat = INLINE_DATA_BINARY;
}
- result = FileReadGIF(interp, dataSrc, "inline data",
- format, imageHandle, destX, destY, width, height, srcX, srcY);
- tsdPtr->fromData = 0;
- return result;
-}
+ /*
+ * Fall through to the file reader now that we have a correctly-configured
+ * pseudo-channel to pull the data from.
+ */
+
+ return FileReadGIF(interp, (Tcl_Channel) hdlPtr, xferFormat, format,
+ imageHandle, destX, destY, width, height, srcX, srcY);
+}
+
/*
*----------------------------------------------------------------------
*
* ReadGIFHeader --
*
- * This procedure reads the GIF header from the beginning of a
- * GIF file and returns the dimensions of the image.
+ * This function reads the GIF header from the beginning of a GIF file
+ * and returns the dimensions of the image.
*
* Results:
- * The return value is 1 if file "f" appears to start with
- * a valid GIF header, 0 otherwise. If the header is valid,
- * then *widthPtr and *heightPtr are modified to hold the
- * dimensions of the image.
+ * The return value is 1 if file "f" appears to start with a valid GIF
+ * 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.
@@ -645,68 +698,70 @@ StringReadGIF(interp, dataObj, format, imageHandle,
*/
static int
-ReadGIFHeader(chan, widthPtr, heightPtr)
- Tcl_Channel chan; /* Image file to read the header from */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here. */
+ReadGIFHeader(
+ GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan, /* Image file to read the header from */
+ int *widthPtr, int *heightPtr)
+ /* The dimensions of the image are returned
+ * here. */
{
unsigned char buf[7];
- if ((Fread(buf, 1, 6, chan) != 6)
+ if ((Fread(gifConfPtr, buf, 1, 6, chan) != 6)
|| ((strncmp(GIF87a, (char *) buf, 6) != 0)
&& (strncmp(GIF89a, (char *) buf, 6) != 0))) {
return 0;
}
- if (Fread(buf, 1, 4, chan) != 4) {
+ if (Fread(gifConfPtr, buf, 1, 4, chan) != 4) {
return 0;
}
- *widthPtr = LM_to_uint(buf[0],buf[1]);
- *heightPtr = LM_to_uint(buf[2],buf[3]);
+ *widthPtr = LM_to_uint(buf[0], buf[1]);
+ *heightPtr = LM_to_uint(buf[2], buf[3]);
return 1;
}
-
+
/*
*-----------------------------------------------------------------
- * The code below is copied from the giftoppm program and modified
- * just slightly.
+ * The code below is copied from the giftoppm program and modified just
+ * slightly.
*-----------------------------------------------------------------
*/
static int
-ReadColorMap(chan, number, buffer)
- Tcl_Channel chan;
- int number;
- unsigned char buffer[MAXCOLORMAPSIZE][4];
+ReadColorMap(
+ GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan,
+ int number,
+ unsigned char buffer[MAXCOLORMAPSIZE][4])
{
int i;
unsigned char rgb[3];
for (i = 0; i < number; ++i) {
- if (! ReadOK(chan, rgb, sizeof(rgb))) {
+ if (Fread(gifConfPtr, rgb, sizeof(rgb), 1, chan) <= 0) {
return 0;
}
if (buffer) {
- buffer[i][CM_RED] = rgb[0] ;
- buffer[i][CM_GREEN] = rgb[1] ;
- buffer[i][CM_BLUE] = rgb[2] ;
- buffer[i][CM_ALPHA] = 255 ;
+ buffer[i][CM_RED] = rgb[0];
+ buffer[i][CM_GREEN] = rgb[1];
+ buffer[i][CM_BLUE] = rgb[2];
+ buffer[i][CM_ALPHA] = 255;
}
}
return 1;
}
-
-
-
+
static int
-DoExtension(chan, label, transparent)
- Tcl_Channel chan;
- int label;
- int *transparent;
+DoExtension(
+ GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan,
+ int label,
+ unsigned char *buf,
+ int *transparent)
{
- static unsigned char buf[256];
int count;
switch (label) {
@@ -718,12 +773,12 @@ DoExtension(chan, label, transparent)
case 0xfe: /* Comment Extension */
do {
- count = GetDataBlock(chan, (unsigned char*) buf);
+ count = GetDataBlock(gifConfPtr, chan, buf);
} while (count > 0);
return count;
case 0xf9: /* Graphic Control Extension */
- count = GetDataBlock(chan, (unsigned char*) buf);
+ count = GetDataBlock(gifConfPtr, chan, buf);
if (count < 0) {
return 1;
}
@@ -732,53 +787,52 @@ DoExtension(chan, label, transparent)
}
do {
- count = GetDataBlock(chan, (unsigned char*) buf);
+ count = GetDataBlock(gifConfPtr, chan, buf);
} while (count > 0);
return count;
}
do {
- count = GetDataBlock(chan, (unsigned char*) buf);
+ count = GetDataBlock(gifConfPtr, chan, buf);
} while (count > 0);
return count;
}
-
+
static int
-GetDataBlock(chan, buf)
- Tcl_Channel chan;
- unsigned char *buf;
+GetDataBlock(
+ GIFImageConfig *gifConfPtr,
+ Tcl_Channel chan,
+ unsigned char *buf)
{
unsigned char count;
- if (! ReadOK(chan, &count,1)) {
+ if (Fread(gifConfPtr, &count, 1, 1, chan) <= 0) {
return -1;
}
- if ((count != 0) && (! ReadOK(chan, buf, count))) {
+ if ((count != 0) && (Fread(gifConfPtr, buf, count, 1, chan) <= 0)) {
return -1;
}
return count;
}
-
-
/*
*----------------------------------------------------------------------
*
* ReadImage --
*
- * Process a GIF image from a given source, with a given height,
- * width, transparency, etc.
+ * Process a GIF image from a given source, with a given height, width,
+ * transparency, etc.
*
* This code is based on the code found in the ImageMagick GIF decoder,
* which is (c) 2000 ImageMagick Studio.
*
* Some thoughts on our implementation:
- * It sure would be nice if ReadImage didn't take 11 parameters! I think
+ * It sure would be nice if ReadImage didn't take 11 parameters! I think
* that if we were smarter, we could avoid doing that.
*
- * Possible further optimizations: we could pull the GetCode function
+ * Possible further optimizations: we could pull the GetCode function
* directly into ReadImage, which would improve our speed.
*
* Results:
@@ -791,37 +845,36 @@ GetDataBlock(chan, buf)
*/
static int
-ReadImage(interp, imagePtr, chan, len, rows, cmap,
- width, height, srcX, srcY, interlace, transparent)
- Tcl_Interp *interp;
- char *imagePtr;
- Tcl_Channel chan;
- int len, rows;
- unsigned char cmap[MAXCOLORMAPSIZE][4];
- int width, height;
- int srcX, srcY;
- int interlace;
- int transparent;
+ReadImage(
+ GIFImageConfig *gifConfPtr,
+ Tcl_Interp *interp,
+ unsigned char *imagePtr,
+ Tcl_Channel chan,
+ int len, int rows,
+ unsigned char cmap[MAXCOLORMAPSIZE][4],
+ int srcX, int srcY,
+ int interlace,
+ int transparent)
{
unsigned char initialCodeSize;
- int v;
int xpos = 0, ypos = 0, pass = 0, i;
- register char *pixelPtr;
- CONST static int interlaceStep[] = { 8, 8, 4, 2 };
- CONST static int interlaceStart[] = { 0, 4, 2, 1 };
+ register unsigned char *pixelPtr;
+ static const int interlaceStep[] = { 8, 8, 4, 2 };
+ static const int interlaceStart[] = { 0, 4, 2, 1 };
unsigned short prefix[(1 << MAX_LWZ_BITS)];
- unsigned char append[(1 << MAX_LWZ_BITS)];
- unsigned char stack[(1 << MAX_LWZ_BITS)*2];
+ unsigned char append[(1 << MAX_LWZ_BITS)];
+ unsigned char stack[(1 << MAX_LWZ_BITS)*2];
register unsigned char *top;
int codeSize, clearCode, inCode, endCode, oldCode, maxCode;
- int code, firstCode;
+ int code, firstCode, v;
/*
- * Initialize the decoder
+ * Initialize the decoder
*/
- if (! ReadOK(chan, &initialCodeSize, 1)) {
+
+ if (Fread(gifConfPtr, &initialCodeSize, 1, 1, chan) <= 0) {
Tcl_AppendResult(interp, "error reading GIF image: ",
- Tcl_PosixError(interp), (char *) NULL);
+ Tcl_PosixError(interp), NULL);
return TCL_ERROR;
}
@@ -848,46 +901,49 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
* code size size of the next code to retrieve
* max code next available table position
*/
+
clearCode = 1 << (int) initialCodeSize;
endCode = clearCode + 1;
codeSize = (int) initialCodeSize + 1;
maxCode = clearCode + 2;
oldCode = -1;
firstCode = -1;
-
- memset((void *)prefix, 0, (1 << MAX_LWZ_BITS) * sizeof(short));
- memset((void *)append, 0, (1 << MAX_LWZ_BITS) * sizeof(char));
+
+ memset(prefix, 0, (1 << MAX_LWZ_BITS) * sizeof(short));
+ memset(append, 0, (1 << MAX_LWZ_BITS) * sizeof(char));
for (i = 0; i < clearCode; i++) {
append[i] = i;
}
top = stack;
- GetCode(chan, 0, 1);
+ GetCode(chan, 0, 1, gifConfPtr);
/*
* Read until we finish the image
*/
+
for (i = 0, ypos = 0; i < rows; i++) {
for (xpos = 0; xpos < len; ) {
-
if (top == stack) {
/*
- * Bummer -- our stack is empty. Now we have to work!
+ * Bummer - our stack is empty. Now we have to work!
*/
- code = GetCode(chan, codeSize, 0);
+
+ code = GetCode(chan, codeSize, 0, gifConfPtr);
if (code < 0) {
return TCL_OK;
}
if (code > maxCode || code == endCode) {
/*
- * If we're doing things right, we should never
- * receive a code that is greater than our current
- * maximum code. If we do, bail, because our decoder
- * does not yet have that code set up.
+ * If we're doing things right, we should never receive a
+ * code that is greater than our current maximum code. If
+ * we do, bail, because our decoder does not yet have that
+ * code set up.
*
* If the code is the magic endCode value, quit.
*/
+
return TCL_OK;
}
@@ -895,44 +951,48 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
/*
* Reset the decoder.
*/
+
codeSize = initialCodeSize + 1;
maxCode = clearCode + 2;
oldCode = -1;
continue;
}
-
+
if (oldCode == -1) {
/*
- * Last pass reset the decoder, so the first code we
- * see must be a singleton. Seed the stack with it,
- * and set up the old/first code pointers for
- * insertion into the string table. We can't just
- * roll this into the clearCode test above, because
- * at that point we have not yet read the next code.
+ * Last pass reset the decoder, so the first code we see
+ * must be a singleton. Seed the stack with it, and set up
+ * the old/first code pointers for insertion into the
+ * string table. We can't just roll this into the
+ * clearCode test above, because at that point we have not
+ * yet read the next code.
*/
+
*top++ = append[code];
oldCode = code;
firstCode = code;
continue;
}
-
+
inCode = code;
if (code == maxCode) {
/*
* maxCode is always one bigger than our highest assigned
- * code. If the code we see is equal to maxCode, then
- * we are about to add a new string to the table. ???
+ * code. If the code we see is equal to maxCode, then we
+ * are about to add a new string to the table. ???
*/
+
*top++ = firstCode;
code = oldCode;
}
while (code > clearCode) {
/*
- * Populate the stack by tracing the string in the
- * string table from its tail to its head
+ * Populate the stack by tracing the string in the string
+ * table from its tail to its head
*/
+
*top++ = append[code];
code = prefix[code];
}
@@ -942,6 +1002,7 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
* If there's no more room in our string table, quit.
* Otherwise, add a new string to the table
*/
+
if (maxCode >= (1 << MAX_LWZ_BITS)) {
return TCL_OK;
}
@@ -949,21 +1010,24 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
/*
* Push the head of the string onto the stack.
*/
+
*top++ = firstCode;
/*
* Add a new string to the string table
*/
+
prefix[maxCode] = oldCode;
append[maxCode] = firstCode;
maxCode++;
/*
- * maxCode tells us the maximum code value we can accept.
- * If we see that we need more bits to represent it than
- * we are requesting from the unpacker, we need to increase
- * the number we ask for.
+ * maxCode tells us the maximum code value we can accept. If
+ * we see that we need more bits to represent it than we are
+ * requesting from the unpacker, we need to increase the
+ * number we ask for.
*/
+
if ((maxCode >= (1 << codeSize))
&& (maxCode < (1<<MAX_LWZ_BITS))) {
codeSize++;
@@ -974,16 +1038,18 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
/*
* Pop the next color index off the stack.
*/
+
v = *(--top);
if (v < 0) {
return TCL_OK;
}
- /*
+ /*
* If pixelPtr is null, we're skipping this image (presumably
- * there are more in the file and we will be called to read
- * one of them later)
+ * there are more in the file and we will be called to read one of
+ * them later)
*/
+
*pixelPtr++ = cmap[v][CM_RED];
*pixelPtr++ = cmap[v][CM_GREEN];
*pixelPtr++ = cmap[v][CM_BLUE];
@@ -995,8 +1061,9 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
}
/*
- * If interlacing, the next ypos is not just +1
+ * If interlacing, the next ypos is not just +1.
*/
+
if (interlace) {
ypos += interlaceStep[pass];
while (ypos >= rows) {
@@ -1013,27 +1080,25 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
}
return TCL_OK;
}
-
/*
*----------------------------------------------------------------------
*
* GetCode --
*
- * Extract the next compression code from the file. In GIF's, the
- * compression codes are between 3 and 12 bits long and are then
- * packed into 8 bit bytes, left to right, for example:
+ * Extract the next compression code from the file. In GIF's, the
+ * compression codes are between 3 and 12 bits long and are then packed
+ * into 8 bit bytes, left to right, for example:
* bbbaaaaa
* dcccccbb
* eeeedddd
* ...
- * We use a byte buffer read from the file and a sliding window
- * to unpack the bytes. Thanks to ImageMagick for the sliding window
- * idea.
+ * We use a byte buffer read from the file and a sliding window to unpack
+ * the bytes. Thanks to ImageMagick for the sliding window idea.
* args: chan the channel to read from
* code_size size of the code to extract
- * flag boolean indicating whether the extractor
- * should be reset or not
+ * flag boolean indicating whether the extractor should be
+ * reset or not
*
* Results:
* code the next compression code
@@ -1045,69 +1110,72 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
*/
static int
-GetCode(chan, code_size, flag)
- Tcl_Channel chan;
- int code_size;
- int flag;
+GetCode(
+ Tcl_Channel chan,
+ int code_size,
+ int flag,
+ GIFImageConfig *gifConfPtr)
{
- static unsigned char buf[280];
- static int bytes = 0, done;
- static unsigned char *c;
-
- static unsigned int window;
- static int bitsInWindow = 0;
int ret;
-
+
if (flag) {
/*
* Initialize the decoder.
*/
- bitsInWindow = 0;
- bytes = 0;
- window = 0;
- done = 0;
- c = NULL;
+
+ gifConfPtr->reader.bitsInWindow = 0;
+ gifConfPtr->reader.bytes = 0;
+ gifConfPtr->reader.window = 0;
+ gifConfPtr->reader.done = 0;
+ gifConfPtr->reader.c = NULL;
return 0;
}
- while (bitsInWindow < code_size) {
+ while (gifConfPtr->reader.bitsInWindow < code_size) {
/*
* Not enough bits in our window to cover the request.
*/
- if (done) {
+
+ if (gifConfPtr->reader.done) {
return -1;
}
- if (bytes == 0) {
+ if (gifConfPtr->reader.bytes == 0) {
/*
* Not enough bytes in our buffer to add to the window.
*/
- bytes = GetDataBlock(chan, buf);
- c = buf;
- if (bytes <= 0) {
- done = 1;
+
+ gifConfPtr->reader.bytes =
+ GetDataBlock(gifConfPtr, chan, gifConfPtr->workingBuffer);
+ gifConfPtr->reader.c = gifConfPtr->workingBuffer;
+ if (gifConfPtr->reader.bytes <= 0) {
+ gifConfPtr->reader.done = 1;
break;
}
}
+
/*
* Tack another byte onto the window, see if that's enough.
*/
- window += (*c) << bitsInWindow;
- c++;
- bitsInWindow += 8;
- bytes--;
- }
+ gifConfPtr->reader.window +=
+ (*gifConfPtr->reader.c) << gifConfPtr->reader.bitsInWindow;
+ gifConfPtr->reader.c++;
+ gifConfPtr->reader.bitsInWindow += 8;
+ gifConfPtr->reader.bytes--;
+ }
/*
* The next code will always be the last code_size bits of the window.
*/
- ret = window & ((1 << code_size) - 1);
-
+
+ ret = gifConfPtr->reader.window & ((1 << code_size) - 1);
+
/*
* Shift data in the window to put the next code at the end.
*/
- window >>= code_size;
- bitsInWindow -= code_size;
+
+ gifConfPtr->reader.window >>= code_size;
+ gifConfPtr->reader.bitsInWindow -= code_size;
return ret;
}
@@ -1116,27 +1184,27 @@ GetCode(chan, code_size, flag)
*
* Minit -- --
*
- * This procedure initializes a base64 decoder handle
+ * This function initializes a base64 decoder handle
*
* Results:
- * none
+ * None
*
* Side effects:
- * the base64 handle is initialized
+ * The base64 handle is initialized
*
*----------------------------------------------------------------------
*/
static void
-mInit(string, length, handle)
- unsigned char *string; /* string containing initial mmencoded data */
- int length; /* Length of string */
- MFile *handle; /* mmdecode "file" handle */
+mInit(
+ unsigned char *string, /* string containing initial mmencoded data */
+ MFile *handle, /* mmdecode "file" handle */
+ int length) /* Number of bytes in string */
{
handle->data = string;
- handle->length = length;
handle->state = 0;
handle->c = 0;
+ handle->length = length;
}
/*
@@ -1144,9 +1212,9 @@ mInit(string, length, handle)
*
* Mread --
*
- * This procedure is invoked by the GIF file reader as a
- * temporary replacement for "fread", to get GIF data out
- * of a string (using Mgetc).
+ * This function is invoked by the GIF file reader as a temporary
+ * replacement for "fread", to get GIF data out of a string (using
+ * Mgetc).
*
* Results:
* The return value is the number of characters "read"
@@ -1158,50 +1226,45 @@ mInit(string, length, handle)
*/
static int
-Mread(dst, chunkSize, numChunks, handle)
- unsigned char *dst; /* where to put the result */
- size_t chunkSize; /* size of each transfer */
- size_t numChunks; /* number of chunks */
- MFile *handle; /* mmdecode "file" handle */
+Mread(
+ unsigned char *dst, /* where to put the result */
+ size_t chunkSize, /* size of each transfer */
+ size_t numChunks, /* number of chunks */
+ MFile *handle) /* mmdecode "file" handle */
{
register int i, c;
int count = chunkSize * numChunks;
- for(i=0; i<count && (c=Mgetc(handle)) != GIF_DONE; i++) {
+ for (i=0; i<count && (c=Mgetc(handle)) != GIF_DONE; i++) {
*dst++ = c;
}
return i;
}
-
-/*
- * get the next decoded character from an mmencode handle
- * This causes at least 1 character to be "read" from the encoded string
- */
/*
*----------------------------------------------------------------------
*
* Mgetc --
*
- * This procedure decodes and returns the next byte from a base64
- * encoded string.
+ * This function gets the next decoded character from an mmencode handle.
+ * This causes at least 1 character to be "read" from the encoded string.
*
* Results:
- * The next byte (or GIF_DONE) is returned.
+ * The next byte (or GIF_DONE) is returned.
*
* Side effects:
- * The base64 handle will change state.
+ * The base64 handle will change state.
*
*----------------------------------------------------------------------
*/
static int
-Mgetc(handle)
- MFile *handle; /* Handle containing decoder data and state */
+Mgetc(
+ MFile *handle) /* Handle containing decoder data and state */
{
int c;
- int result = 0; /* Initialization needed only to prevent
- * gcc compiler warning. */
+ int result = 0; /* Initialization needed only to prevent gcc
+ * compiler warning. */
if (handle->state == GIF_DONE) {
return GIF_DONE;
@@ -1209,7 +1272,6 @@ Mgetc(handle)
do {
if (handle->length-- <= 0) {
- handle->state = GIF_DONE;
return GIF_DONE;
}
c = char64(*handle->data);
@@ -1247,21 +1309,22 @@ Mgetc(handle)
*
* char64 --
*
- * This procedure converts a base64 ascii character into its binary
- * equivalent. This code is a slightly modified version of the
- * char64 proc in N. Borenstein's metamail decoder.
+ * This function converts a base64 ascii character into its binary
+ * equivalent. This code is a slightly modified version of the char64
+ * function in N. Borenstein's metamail decoder.
*
* Results:
* The binary value, or an error code.
*
* Side effects:
* None.
+ *
*----------------------------------------------------------------------
*/
static int
-char64(c)
-int c;
+char64(
+ int c)
{
switch(c) {
case 'A': return 0; case 'B': return 1; case 'C': return 2;
@@ -1303,52 +1366,53 @@ int c;
*
* Fread --
*
- * This procedure calls either fread or Mread to read data
- * from a file or a base64 encoded string.
+ * This function calls either fread or Mread to read data from a file or
+ * a base64 encoded string.
*
- * Results: - same as fread
+ * Results: - same as POSIX fread() or Tcl Tcl_Read()
*
*----------------------------------------------------------------------
*/
static int
-Fread(dst, hunk, count, chan)
- unsigned char *dst; /* where to put the result */
- size_t hunk,count; /* how many */
- Tcl_Channel chan;
+Fread(
+ GIFImageConfig *gifConfPtr,
+ unsigned char *dst, /* where to put the result */
+ size_t hunk, size_t count, /* how many */
+ Tcl_Channel chan)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- MFile *handle;
-
- switch (tsdPtr->fromData) {
- case 1:
+ if (gifConfPtr->fromData == INLINE_DATA_BASE64) {
return Mread(dst, hunk, count, (MFile *) chan);
- case 2:
- handle = (MFile *) chan;
- if (handle->length <= 0 || (size_t)handle->length < (size_t) (hunk * count)) {
+ }
+
+ if (gifConfPtr->fromData == INLINE_DATA_BINARY) {
+ MFile *handle = (MFile *) chan;
+
+ if (handle->length <= 0 || (size_t) handle->length < hunk*count) {
return -1;
}
- memcpy((VOID *)dst, (VOID *) handle->data, (size_t) (hunk * count));
+ memcpy(dst, handle->data, (size_t) (hunk * count));
handle->data += hunk * count;
- handle->length -= hunk * count;
return (int)(hunk * count);
- default:
- return Tcl_Read(chan, (char *) dst, (int) (hunk * count));
}
-}
+ /*
+ * Otherwise we've got a real file to read.
+ */
+
+ return Tcl_Read(chan, (char *) dst, (int) (hunk * count));
+}
/*
* ChanWriteGIF - writes a image in GIF format.
*-------------------------------------------------------------------------
- * Author: Lolo
- * Engeneering Projects Area
- * Department of Mining
- * University of Oviedo
- * e-mail zz11425958@zeus.etsimo.uniovi.es
- * lolo@pcsig22.etsimo.uniovi.es
- * Date: Fri September 20 1996
+ * Author: Lolo
+ * Engeneering Projects Area
+ * Department of Mining
+ * University of Oviedo
+ * e-mail zz11425958@zeus.etsimo.uniovi.es
+ * lolo@pcsig22.etsimo.uniovi.es
+ * Date: Fri September 20 1996
*
* Modified for transparency handling (gif89a) and miGIF compression
* by Jan Nijtmans <j.nijtmans@chello.nl>
@@ -1356,60 +1420,65 @@ Fread(dst, hunk, count, chan)
*----------------------------------------------------------------------
* FileWriteGIF-
*
- * This procedure is called by the photo image type to write
- * GIF format data from a photo image into a given file
+ * This function is called by the photo image type to write GIF format
+ * 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 interp->result.
*
*----------------------------------------------------------------------
*/
- /*
- * Types, defines and variables needed to write and compress a GIF.
- */
-
-typedef int (* ifunptr) _ANSI_ARGS_((void));
-
-#define LSB(a) ((unsigned char) (((short)(a)) & 0x00FF))
-#define MSB(a) ((unsigned char) (((short)(a)) >> 8))
-
-#define GIFBITS 12
-#define HSIZE 5003 /* 80% occupancy */
+/*
+ * Types, defines and variables needed to write and compress a GIF.
+ */
-static int ssize;
-static int csize;
-static int rsize;
-static unsigned char *pixelo;
-static int pixelSize;
-static int pixelPitch;
-static int greenOffset;
-static int blueOffset;
-static int alphaOffset;
-static int num;
-static unsigned char mapa[MAXCOLORMAPSIZE][3];
+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
+ * Definition of new functions to write GIFs
*/
-static int color _ANSI_ARGS_((int red,int green, int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3]));
-static void compress _ANSI_ARGS_((int init_bits, Tcl_Channel handle,
- ifunptr readValue));
-static int nuevo _ANSI_ARGS_((int red, int green ,int blue,
- unsigned char mapa[MAXCOLORMAPSIZE][3]));
-static void savemap _ANSI_ARGS_((Tk_PhotoImageBlock *blockPtr,
- unsigned char mapa[MAXCOLORMAPSIZE][3]));
-static int ReadValue _ANSI_ARGS_((void));
-
+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(interp, filename, format, blockPtr)
- Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
- CONST char *filename;
- Tcl_Obj *format;
- Tk_PhotoImageBlock *blockPtr;
+FileWriteGIF(
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
+ const char *filename,
+ Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr)
{
Tcl_Channel chan = NULL;
int result;
@@ -1418,167 +1487,168 @@ FileWriteGIF(interp, filename, format, blockPtr)
if (!chan) {
return TCL_ERROR;
}
- if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) {
+ if (Tcl_SetChannelOption(interp, chan, "-translation",
+ "binary") != TCL_OK) {
Tcl_Close(NULL, chan);
return TCL_ERROR;
}
result = CommonWriteGIF(interp, chan, format, blockPtr);
+
if (Tcl_Close(interp, chan) == TCL_ERROR) {
return TCL_ERROR;
}
return result;
}
-
-#define Mputc(c,handle) Tcl_Write(handle,(char *) &c,1)
-
+
static int
-CommonWriteGIF(interp, handle, format, blockPtr)
- Tcl_Interp *interp;
- Tcl_Channel handle;
- Tcl_Obj *format;
- Tk_PhotoImageBlock *blockPtr;
+CommonWriteGIF(
+ Tcl_Interp *interp,
+ Tcl_Channel handle,
+ Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr)
{
- int resolution;
-
- long width,height,x;
+ GifWriterState state, *statePtr = &state;
+ int resolution;
+ long width, height, x;
unsigned char c;
- unsigned int top,left;
+ unsigned int top, left;
top = 0;
left = 0;
- pixelSize = blockPtr->pixelSize;
- greenOffset = blockPtr->offset[1]-blockPtr->offset[0];
- blueOffset = blockPtr->offset[2]-blockPtr->offset[0];
- alphaOffset = blockPtr->offset[0];
- if (alphaOffset < blockPtr->offset[2]) {
- alphaOffset = blockPtr->offset[2];
+ memset(statePtr, 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];
}
- if (++alphaOffset < pixelSize) {
- alphaOffset -= blockPtr->offset[0];
+ if (++statePtr->alphaOffset < statePtr->pixelSize) {
+ statePtr->alphaOffset -= blockPtr->offset[0];
} else {
- alphaOffset = 0;
+ statePtr->alphaOffset = 0;
}
- Tcl_Write(handle, (char *) (alphaOffset ? GIF89a : GIF87a), 6);
+ Tcl_Write(handle, (char *) (statePtr->alphaOffset ? GIF89a : GIF87a), 6);
for (x=0 ; x<MAXCOLORMAPSIZE ; x++) {
- mapa[x][CM_RED] = 255;
- mapa[x][CM_GREEN] = 255;
- mapa[x][CM_BLUE] = 255;
+ statePtr->mapa[x][CM_RED] = 255;
+ statePtr->mapa[x][CM_GREEN] = 255;
+ statePtr->mapa[x][CM_BLUE] = 255;
}
-
width = blockPtr->width;
height = blockPtr->height;
- pixelo = blockPtr->pixelPtr + blockPtr->offset[0];
- pixelPitch = blockPtr->pitch;
- savemap(blockPtr,mapa);
- if (num >= MAXCOLORMAPSIZE) {
- Tcl_AppendResult(interp, "too many colors", (char *) NULL);
+ statePtr->pixelo = blockPtr->pixelPtr + blockPtr->offset[0];
+ statePtr->pixelPitch = blockPtr->pitch;
+ savemap(statePtr, blockPtr, statePtr->mapa);
+ if (statePtr->num >= MAXCOLORMAPSIZE) {
+ Tcl_AppendResult(interp, "too many colors", NULL);
return TCL_ERROR;
}
- if (num<2) {
- num = 2;
+ if (statePtr->num<2) {
+ statePtr->num = 2;
}
c = LSB(width);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(width);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = LSB(height);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(height);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
resolution = 0;
- while (num >> resolution) {
+ while (statePtr->num >> resolution) {
resolution++;
}
c = 111 + resolution * 17;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
- num = 1 << resolution;
+ statePtr->num = 1 << resolution;
/*
- * background color
+ * Background color
*/
c = 0;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
/*
- * zero for future expansion.
+ * Zero for future expansion.
*/
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
- for (x=0 ; x<num ; x++) {
- c = mapa[x][CM_RED];
- Mputc(c,handle);
- c = mapa[x][CM_GREEN];
- Mputc(c,handle);
- c = mapa[x][CM_BLUE];
- Mputc(c,handle);
+ 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);
}
/*
* Write out extension for transparent colour index, if necessary.
*/
- if (alphaOffset) {
+ if (statePtr->alphaOffset) {
c = GIF_EXTENSION;
- Mputc(c, handle);
+ Tcl_Write(handle, (char *) &c, 1);
Tcl_Write(handle, "\371\4\1\0\0\0", 7);
}
c = GIF_START;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = LSB(top);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(top);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = LSB(left);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(left);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = LSB(width);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(width);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = LSB(height);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = MSB(height);
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = 0;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
c = resolution;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
- ssize = rsize = blockPtr->width;
- csize = blockPtr->height;
- compress(resolution+1, handle, ReadValue);
+ statePtr->ssize = statePtr->rsize = blockPtr->width;
+ statePtr->csize = blockPtr->height;
+ compress(resolution+1, handle, ReadValue, (ClientData) statePtr);
- c = 0;
- Mputc(c,handle);
+ c = 0;
+ Tcl_Write(handle, (char *) &c, 1);
c = GIF_TERMINATOR;
- Mputc(c,handle);
+ Tcl_Write(handle, (char *) &c, 1);
- return TCL_OK;
+ return TCL_OK;
}
-
+
static int
-color(red, green, blue, mapa)
- int red;
- int green;
- int blue;
- unsigned char mapa[MAXCOLORMAPSIZE][3];
+color(
+ GifWriterState *statePtr,
+ int red, int green, int blue,
+ unsigned char mapa[MAXCOLORMAPSIZE][3])
{
- int x;
- for (x=(alphaOffset != 0) ; x<=MAXCOLORMAPSIZE ; x++) {
+ 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)) {
return x;
@@ -1586,15 +1656,16 @@ color(red, green, blue, mapa)
}
return -1;
}
-
static int
-nuevo(red, green, blue, mapa)
- int red,green,blue;
- unsigned char mapa[MAXCOLORMAPSIZE][3];
+nuevo(
+ GifWriterState *statePtr,
+ int red, int green, int blue,
+ unsigned char mapa[MAXCOLORMAPSIZE][3])
{
- int x = (alphaOffset != 0);
- for (; x<=num ; x++) {
+ 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)) {
return 0;
@@ -1602,74 +1673,76 @@ nuevo(red, green, blue, mapa)
}
return 1;
}
-
+
static void
-savemap(blockPtr,mapa)
- Tk_PhotoImageBlock *blockPtr;
- unsigned char mapa[MAXCOLORMAPSIZE][3];
+savemap(
+ GifWriterState *statePtr,
+ Tk_PhotoImageBlock *blockPtr,
+ unsigned char mapa[MAXCOLORMAPSIZE][3])
{
unsigned char *colores;
- int x,y;
- unsigned char red,green,blue;
+ int x, y;
+ unsigned char red, green, blue;
- if (alphaOffset) {
- num = 0;
+ if (statePtr->alphaOffset) {
+ statePtr->num = 0;
mapa[0][CM_RED] = 0xd9;
mapa[0][CM_GREEN] = 0xd9;
mapa[0][CM_BLUE] = 0xd9;
} else {
- num = -1;
+ statePtr->num = -1;
}
- for(y=0 ; y<blockPtr->height ; y++) {
- colores = blockPtr->pixelPtr + blockPtr->offset[0]
- + y * blockPtr->pitch;
- for(x=0 ; x<blockPtr->width ; x++) {
- if (!alphaOffset || (colores[alphaOffset] != 0)) {
+ for (y=0 ; y<blockPtr->height ; y++) {
+ colores = blockPtr->pixelPtr + blockPtr->offset[0] + y*blockPtr->pitch;
+ for (x=0 ; x<blockPtr->width ; x++) {
+ if (!statePtr->alphaOffset || colores[statePtr->alphaOffset]!=0) {
red = colores[0];
- green = colores[greenOffset];
- blue = colores[blueOffset];
- if (nuevo(red,green,blue,mapa)) {
- num++;
- if (num >= MAXCOLORMAPSIZE) {
+ green = colores[statePtr->greenOffset];
+ blue = colores[statePtr->blueOffset];
+ if (nuevo(statePtr, red, green, blue, mapa)) {
+ statePtr->num++;
+ if (statePtr->num >= MAXCOLORMAPSIZE) {
return;
}
- mapa[num][CM_RED] = red;
- mapa[num][CM_GREEN] = green;
- mapa[num][CM_BLUE] = blue;
+ mapa[statePtr->num][CM_RED] = red;
+ mapa[statePtr->num][CM_GREEN] = green;
+ mapa[statePtr->num][CM_BLUE] = blue;
}
}
- colores += pixelSize;
+ colores += statePtr->pixelSize;
}
}
- return;
}
-
+
static int
-ReadValue()
+ReadValue(
+ ClientData clientData)
{
+ GifWriterState *statePtr = (GifWriterState *) clientData;
unsigned int col;
- if (csize == 0) {
+ if (statePtr->csize == 0) {
return EOF;
}
- if (alphaOffset && (pixelo[alphaOffset] == 0)) {
+ if (statePtr->alphaOffset && statePtr->pixelo[statePtr->alphaOffset]==0) {
col = 0;
} else {
- col = color(pixelo[0], pixelo[greenOffset], pixelo[blueOffset], mapa);
+ col = color(statePtr, statePtr->pixelo[0],
+ statePtr->pixelo[statePtr->greenOffset],
+ statePtr->pixelo[statePtr->blueOffset], statePtr->mapa);
}
- pixelo += pixelSize;
- if (--ssize <= 0) {
- ssize = rsize;
- csize--;
- pixelo += pixelPitch - (rsize * pixelSize);
+ statePtr->pixelo += statePtr->pixelSize;
+ if (--statePtr->ssize <= 0) {
+ statePtr->ssize = statePtr->rsize;
+ statePtr->csize--;
+ statePtr->pixelo += statePtr->pixelPitch
+ - (statePtr->rsize * statePtr->pixelSize);
}
return col;
}
-
-
/*
*-----------------------------------------------------------------------
*
@@ -1681,30 +1754,27 @@ ReadValue()
* 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
+ * 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.
+ *
+ * The miGIF compression routines do not, strictly speaking, generate files
+ * conforming to the GIF spec, since the image data is not LZW-compressed
+ * (this is the point: in order to avoid transgression of the Unisys patent on
+ * the LZW algorithm.) However, miGIF generates data streams that any
+ * reasonably sane LZW decompresser will decompress to what we want.
+ *
+ * miGIF compression uses run length encoding. It compresses horizontal runs
+ * of pixels of the same color. This type of compression gives good results on
+ * images with many runs, for example images with lines, text and solid shapes
+ * on a solid-colored background. It gives little or no compression on images
+ * with few runs, for example digital or scanned photos.
*
* der Mouse
* mouse@rodents.montreal.qc.ca
@@ -1712,35 +1782,36 @@ ReadValue()
*
* 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.
+ * The Graphics Interchange Format(c) is the Copyright property of CompuServe
+ * Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated.
*
*-----------------------------------------------------------------------
*/
-static int rl_pixel;
-static int rl_basecode;
-static int rl_count;
-static int rl_table_pixel;
-static int rl_table_max;
-static int just_cleared;
-static int out_bits;
-static int out_bits_init;
-static int out_count;
-static int out_bump;
-static int out_bump_init;
-static int out_clear;
-static int out_clear_init;
-static int max_ocodes;
-static int code_clear;
-static int code_eof;
-static unsigned int obuf;
-static int obits;
-static Tcl_Channel ofile;
-static unsigned char oblock[256];
-static int oblen;
-
+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
*/
@@ -1748,23 +1819,28 @@ static int oblen;
#ifdef MIGIF_DEBUGGING_ENVARS
-static int verbose_set = 0;
+/*
+ * This debugging code is _absolutely_ not thread-safe. It's also not normally
+ * enabled either.
+ */
+
+static int verboseSet = 0;
static int verbose;
-#define MIGIF_VERBOSE (verbose_set?verbose:set_verbose())
-#define DEBUGMSG(printf_args) if (MIGIF_VERBOSE) { printf printf_args; }
+#define MIGIF_VERBOSE (verboseSet?verbose:setVerbose())
+#define DEBUGMSG(printfArgs) if (MIGIF_VERBOSE) { printf printfArgs; }
static int
-set_verbose(void)
+setVerbose(void)
{
verbose = !!getenv("MIGIF_VERBOSE");
- verbose_set = 1;
+ verboseSet = 1;
return verbose;
}
-static CONST char *
-binformat(v, nbits)
- unsigned int v;
- int nbits;
+static const char *
+binformat(
+ unsigned int v,
+ int nbits)
{
static char bufs[8][64];
static int bhand = 0;
@@ -1786,112 +1862,119 @@ binformat(v, nbits)
*bp = '\0';
return &bufs[bhand][0];
}
-
-#else
-
-#define MIGIF_VERBOSE 0
-#define DEBUGMSG(printf_args) /* do nothing */
-
+#else /* !MIGIF_DEBUGGING_ENVARS */
+#define DEBUGMSG(printfArgs) /* do nothing */
#endif
-
+
static void
-write_block()
+writeBlock(
+ miGIFState_t *statePtr)
{
- int i;
unsigned char c;
+#ifdef MIGIF_DEBUGGING_ENVARS
if (MIGIF_VERBOSE) {
- printf("write_block %d:", oblen);
- for (i=0 ; i<oblen ; i++) {
- printf(" %02x", oblock[i]);
+ int i;
+ printf("writeBlock %d:", statePtr->oblen);
+ for (i=0 ; i<statePtr->oblen ; i++) {
+ printf(" %02x", statePtr->oblock[i]);
}
printf("\n");
}
- c = oblen;
- Tcl_Write(ofile, (char *) &c, 1);
- Tcl_Write(ofile, (char *) &oblock[0], oblen);
- oblen = 0;
+#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
-block_out(c)
- unsigned char c;
+blockOut(
+ miGIFState_t *statePtr,
+ unsigned c)
{
- DEBUGMSG(("block_out %s\n", binformat(c, 8)));
- oblock[oblen++] = c;
- if (oblen >= 255) {
- write_block();
+ DEBUGMSG(("blockOut %s\n", binformat(c, 8)));
+ statePtr->oblock[statePtr->oblen++] = (unsigned char) c;
+ if (statePtr->oblen >= 255) {
+ writeBlock(statePtr);
}
}
-
+
static void
-block_flush()
+blockFlush(
+ miGIFState_t *statePtr)
{
- DEBUGMSG(("block_flush\n"));
- if (oblen > 0) {
- write_block();
+ DEBUGMSG(("blockFlush\n"));
+ if (statePtr->oblen > 0) {
+ writeBlock(statePtr);
}
}
-
+
static void
-output(val)
- int val;
+output(
+ miGIFState_t *statePtr,
+ int val)
{
- DEBUGMSG(("output %s [%s %d %d]\n", binformat(val, out_bits),
- binformat(obuf, obits), obits, out_bits));
- obuf |= val << obits;
- obits += out_bits;
- while (obits >= 8) {
- block_out(UCHAR(obuf&0xff));
- obuf >>= 8;
- obits -= 8;
- }
- DEBUGMSG(("output leaving [%s %d]\n", binformat(obuf, obits), obits));
+ 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
-output_flush()
+outputFlush(
+ miGIFState_t *statePtr)
{
- DEBUGMSG(("output_flush\n"));
- if (obits > 0) {
- block_out(UCHAR(obuf));
+ DEBUGMSG(("outputFlush\n"));
+ if (statePtr->obits > 0) {
+ blockOut(statePtr, statePtr->obuf);
}
- block_flush();
+ blockFlush(statePtr);
}
-
+
static void
-did_clear()
+didClear(
+ miGIFState_t *statePtr)
{
- DEBUGMSG(("did_clear\n"));
- out_bits = out_bits_init;
- out_bump = out_bump_init;
- out_clear = out_clear_init;
- out_count = 0;
- rl_table_max = 0;
- just_cleared = 1;
+ DEBUGMSG(("didClear\n"));
+ statePtr->outputBits = statePtr->outputBitsInit;
+ statePtr->outputBump = statePtr->outputBumpInit;
+ statePtr->outputClear = statePtr->outputClearInit;
+ statePtr->outputCount = 0;
+ statePtr->runlengthTableMax = 0;
+ statePtr->justCleared = 1;
}
-
+
static void
-output_plain(c)
- int c;
+outputPlain(
+ miGIFState_t *statePtr,
+ int c)
{
- DEBUGMSG(("output_plain %s\n", binformat(c, out_bits)));
- just_cleared = 0;
- output(c);
- out_count++;
- if (out_count >= out_bump) {
- out_bits++;
- out_bump += 1 << (out_bits - 1);
- }
- if (out_count >= out_clear) {
- output(code_clear);
- did_clear();
+ 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 unsigned int
-isqrt(x)
- unsigned int x;
+isqrt(
+ unsigned int x)
{
unsigned int r;
unsigned int v;
@@ -1908,11 +1991,11 @@ isqrt(x)
r = v;
}
}
-
-static unsigned int
-compute_triangle_count(count, nrepcodes)
- unsigned int count;
- unsigned int nrepcodes;
+
+static int
+computeTriangleCount(
+ unsigned int count,
+ unsigned int nrepcodes)
{
unsigned int perrep;
unsigned int cost;
@@ -1924,8 +2007,8 @@ compute_triangle_count(count, nrepcodes)
count -= perrep;
}
if (count > 0) {
- unsigned int n;
- n = isqrt(count);
+ unsigned int n = isqrt(count);
+
while (n*(n+1) >= 2*count) {
n--;
}
@@ -1934,204 +2017,233 @@ compute_triangle_count(count, nrepcodes)
}
cost += n;
}
- return cost;
+ return (int) cost + 1;
}
-
+
static void
-max_out_clear()
+maxOutputClear(
+ miGIFState_t *statePtr)
{
- out_clear = max_ocodes;
+ statePtr->outputClear = statePtr->maxOcodes;
}
-
+
static void
-reset_out_clear()
+resetOutputClear(
+ miGIFState_t *statePtr)
{
- out_clear = out_clear_init;
- if (out_count >= out_clear) {
- output(code_clear);
- did_clear();
+ statePtr->outputClear = statePtr->outputClearInit;
+ if (statePtr->outputCount >= statePtr->outputClear) {
+ output(statePtr, statePtr->codeClear);
+ didClear(statePtr);
}
}
-
+
static void
-rl_flush_fromclear(count)
- int count;
+runlengthFlushFromClear(
+ miGIFState_t *statePtr,
+ int count)
{
int n;
- DEBUGMSG(("rl_flush_fromclear %d\n", count));
- max_out_clear();
- rl_table_pixel = rl_pixel;
+ DEBUGMSG(("runlengthFlushFromClear %d\n", count));
+ maxOutputClear(statePtr);
+ statePtr->runlengthTablePixel = statePtr->runlengthPixel;
n = 1;
while (count > 0) {
if (n == 1) {
- rl_table_max = 1;
- output_plain(rl_pixel);
+ statePtr->runlengthTableMax = 1;
+ outputPlain(statePtr, statePtr->runlengthPixel);
count--;
} else if (count >= n) {
- rl_table_max = n;
- output_plain(rl_basecode+n-2);
+ statePtr->runlengthTableMax = n;
+ outputPlain(statePtr, statePtr->runlengthBaseCode+n-2);
count -= n;
} else if (count == 1) {
- rl_table_max++;
- output_plain(rl_pixel);
+ statePtr->runlengthTableMax++;
+ outputPlain(statePtr, statePtr->runlengthPixel);
count = 0;
} else {
- rl_table_max++;
- output_plain(rl_basecode+count-2);
+ statePtr->runlengthTableMax++;
+ outputPlain(statePtr, statePtr->runlengthBaseCode+count-2);
count = 0;
}
- if (out_count == 0) {
+ if (statePtr->outputCount == 0) {
n = 1;
} else {
n++;
}
}
- reset_out_clear();
- DEBUGMSG(("rl_flush_fromclear leaving table_max=%d\n", rl_table_max));
+ resetOutputClear(statePtr);
+ DEBUGMSG(("runlengthFlushFromClear leaving tableMax=%d\n",
+ statePtr->runlengthTableMax));
}
-
+
static void
-rl_flush_clearorrep(count)
- int count;
+runlengthFlushClearOrRep(
+ miGIFState_t *statePtr,
+ int count)
{
int withclr;
- DEBUGMSG(("rl_flush_clearorrep %d\n", count));
- withclr = 1 + compute_triangle_count(count, max_ocodes);
+ DEBUGMSG(("runlengthFlushClearOrRep %d\n", count));
+ withclr = computeTriangleCount((unsigned) count,
+ (unsigned) statePtr->maxOcodes);
if (withclr < count) {
- output(code_clear);
- did_clear();
- rl_flush_fromclear(count);
+ output(statePtr, statePtr->codeClear);
+ didClear(statePtr);
+ runlengthFlushFromClear(statePtr, count);
} else {
for (; count>0 ; count--) {
- output_plain(rl_pixel);
+ outputPlain(statePtr, statePtr->runlengthPixel);
}
}
}
-
+
static void
-rl_flush_withtable(count)
- int count;
+runlengthFlushWithTable(
+ miGIFState_t *statePtr,
+ int count)
{
int repmax;
int repleft;
int leftover;
- DEBUGMSG(("rl_flush_withtable %d\n", count));
- repmax = count / rl_table_max;
- leftover = count % rl_table_max;
+ DEBUGMSG(("runlengthFlushWithTable %d\n", count));
+ repmax = count / statePtr->runlengthTableMax;
+ leftover = count % statePtr->runlengthTableMax;
repleft = (leftover ? 1 : 0);
- if (out_count+repmax+repleft > max_ocodes) {
- repmax = max_ocodes - out_count;
- leftover = count - (repmax * rl_table_max);
- repleft = 1 + compute_triangle_count(leftover, max_ocodes);
+ if (statePtr->outputCount+repmax+repleft > statePtr->maxOcodes) {
+ repmax = statePtr->maxOcodes - statePtr->outputCount;
+ leftover = count - (repmax * statePtr->runlengthTableMax);
+ repleft = computeTriangleCount((unsigned) leftover,
+ (unsigned) statePtr->maxOcodes);
}
- DEBUGMSG(("rl_flush_withtable repmax=%d leftover=%d repleft=%d\n",
+ DEBUGMSG(("runlengthFlushWithTable repmax=%d leftover=%d repleft=%d\n",
repmax, leftover, repleft));
- if (1+(int)compute_triangle_count(count, max_ocodes) < repmax+repleft) {
- output(code_clear);
- did_clear();
- rl_flush_fromclear(count);
+ if (computeTriangleCount((unsigned) count, (unsigned) statePtr->maxOcodes)
+ < repmax+repleft) {
+ output(statePtr, statePtr->codeClear);
+ didClear(statePtr);
+ runlengthFlushFromClear(statePtr, count);
return;
}
- max_out_clear();
+ maxOutputClear(statePtr);
for (; repmax>0 ; repmax--) {
- output_plain(rl_basecode + rl_table_max - 2);
+ outputPlain(statePtr,
+ statePtr->runlengthBaseCode + statePtr->runlengthTableMax - 2);
}
if (leftover) {
- if (just_cleared) {
- rl_flush_fromclear(leftover);
+ if (statePtr->justCleared) {
+ runlengthFlushFromClear(statePtr, leftover);
} else if (leftover == 1) {
- output_plain(rl_pixel);
+ outputPlain(statePtr, statePtr->runlengthPixel);
} else {
- output_plain(rl_basecode + leftover - 2);
+ outputPlain(statePtr, statePtr->runlengthBaseCode + leftover - 2);
}
}
- reset_out_clear();
+ resetOutputClear(statePtr);
}
-
+
static void
-rl_flush()
+runlengthFlush(
+ miGIFState_t *statePtr)
{
- DEBUGMSG(("rl_flush [ %d %d\n", rl_count, rl_pixel));
- if (rl_count == 1) {
- output_plain(rl_pixel);
- rl_count = 0;
- DEBUGMSG(("rl_flush ]\n"));
+ 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 (just_cleared) {
- rl_flush_fromclear(rl_count);
- } else if ((rl_table_max < 2) || (rl_table_pixel != rl_pixel)) {
- rl_flush_clearorrep(rl_count);
+ if (statePtr->justCleared) {
+ runlengthFlushFromClear(statePtr, statePtr->runlengthCount);
+ } else if ((statePtr->runlengthTableMax < 2)
+ || (statePtr->runlengthTablePixel != statePtr->runlengthPixel)) {
+ runlengthFlushClearOrRep(statePtr, statePtr->runlengthCount);
} else {
- rl_flush_withtable(rl_count);
+ runlengthFlushWithTable(statePtr, statePtr->runlengthCount);
}
- DEBUGMSG(("rl_flush ]\n"));
- rl_count = 0;
+ DEBUGMSG(("runlengthFlush ]\n"));
+ statePtr->runlengthCount = 0;
}
-
-
+
static void
-compress(init_bits, handle, readValue)
- int init_bits;
- Tcl_Channel handle;
- ifunptr readValue;
+compress(
+ int initBits,
+ Tcl_Channel handle,
+ ifunptr readValue,
+ ClientData clientData)
{
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;
- ofile = handle;
- obuf = 0;
- obits = 0;
- oblen = 0;
- code_clear = 1 << (init_bits - 1);
- code_eof = code_clear + 1;
- rl_basecode = code_eof + 1;
- out_bump_init = (1 << (init_bits - 1)) - 1;
/*
- * For images with a lot of runs, making out_clear_init larger
- * will give better compression.
+ * For images with a lot of runs, making outputClearInit larger will give
+ * better compression.
*/
- out_clear_init = (init_bits <= 3) ? 9 : (out_bump_init-1);
+
+ statePtr->outputClearInit =
+ (initBits <= 3) ? 9 : (statePtr->outputBumpInit-1);
#ifdef MIGIF_DEBUGGING_ENVARS
{
- const char *ocienv;
- ocienv = getenv("MIGIF_OUT_CLEAR_INIT");
+ const char *ocienv = getenv("MIGIF_OUT_CLEAR_INIT");
+
if (ocienv) {
- out_clear_init = atoi(ocienv);
- DEBUGMSG(("[overriding out_clear_init to %d]\n", out_clear_init));
+ statePtr->outputClearInit = atoi(ocienv);
+ DEBUGMSG(("[overriding outputClearInit to %d]\n",
+ statePtr->outputClearInit));
}
}
#endif
- out_bits_init = init_bits;
- max_ocodes = (1 << GIFBITS) - ((1 << (out_bits_init - 1)) + 3);
- did_clear();
- output(code_clear);
- rl_count = 0;
+ 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();
- if ((rl_count > 0) && (c != rl_pixel)) {
- rl_flush();
+ c = readValue(clientData);
+ if (statePtr->runlengthCount>0 && statePtr->runlengthPixel!=c) {
+ runlengthFlush(statePtr);
}
if (c == EOF) {
break;
}
- if (rl_pixel == c) {
- rl_count++;
+ if (statePtr->runlengthPixel == c) {
+ statePtr->runlengthCount++;
} else {
- rl_pixel = c;
- rl_count = 1;
+ statePtr->runlengthPixel = c;
+ statePtr->runlengthCount = 1;
}
}
- output(code_eof);
- output_flush();
+ output(statePtr, statePtr->codeEOF);
+ outputFlush(statePtr);
}
/*
*-----------------------------------------------------------------------
*
- * End of miGIF section - See copyright notice at start of section.
+ * End of miGIF section - See copyright notice at start of section.
*
*-----------------------------------------------------------------------
*/
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index ffa369d..8a46fde 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -6,20 +6,19 @@
* Copyright (c) 1994 The Australian National University.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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.
+ * Department of Computer Science,
+ * Australian National University.
*/
#include "tkInt.h"
-#include "tkPort.h"
/*
- * The maximum amount of memory to allocate for data read from the
- * file. If we need more than this, we do it in pieces.
+ * The maximum amount of memory to allocate for data read from the file. If we
+ * need more than this, we do it in pieces.
*/
#define MAX_MEMORY 10000 /* don't allocate > 10KB */
@@ -35,28 +34,23 @@
* The format record for the PPM file format:
*/
-static int FileMatchPPM _ANSI_ARGS_((Tcl_Channel chan,
+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,
- int *widthPtr, int *heightPtr,
- Tcl_Interp *interp));
-static int FileReadPPM _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Channel chan, CONST char *fileName,
+ Tk_PhotoHandle imageHandle, int destX, int destY,
+ int width, int height, int srcX, int srcY);
+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);
+static int StringMatchPPM(Tcl_Obj *dataObj, Tcl_Obj *format,
+ int *widthPtr, int *heightPtr, Tcl_Interp *interp);
+static int StringReadPPM(Tcl_Interp *interp, Tcl_Obj *dataObj,
Tcl_Obj *format, Tk_PhotoHandle imageHandle,
int destX, int destY, int width, int height,
- int srcX, int srcY));
-static int FileWritePPM _ANSI_ARGS_((Tcl_Interp *interp,
- CONST char *fileName, Tcl_Obj *format,
- Tk_PhotoImageBlock *blockPtr));
-static int StringWritePPM _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr));
-static int StringMatchPPM _ANSI_ARGS_((Tcl_Obj *dataObj,
- Tcl_Obj *format, int *widthPtr, int *heightPtr,
- Tcl_Interp *interp));
-static int StringReadPPM _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));
-
+ int srcX, int srcY);
Tk_PhotoImageFormat tkImgFmtPPM = {
"ppm", /* name */
@@ -69,28 +63,26 @@ Tk_PhotoImageFormat tkImgFmtPPM = {
};
/*
- * Prototypes for local procedures defined in this file:
+ * Prototypes for local functions defined in this file:
*/
-static int ReadPPMFileHeader _ANSI_ARGS_((Tcl_Channel chan,
- int *widthPtr, int *heightPtr,
- int *maxIntensityPtr));
-static int ReadPPMStringHeader _ANSI_ARGS_((Tcl_Obj *dataObj,
- int *widthPtr, int *heightPtr,
- int *maxIntensityPtr,
- unsigned char **dataBufferPtr, int *dataSizePtr));
+static int ReadPPMFileHeader(Tcl_Channel chan, int *widthPtr,
+ int *heightPtr, int *maxIntensityPtr);
+static int ReadPPMStringHeader(Tcl_Obj *dataObj, int *widthPtr,
+ int *heightPtr, int *maxIntensityPtr,
+ unsigned char **dataBufferPtr, int *dataSizePtr);
/*
*----------------------------------------------------------------------
*
* FileMatchPPM --
*
- * This procedure is invoked by the photo image type to see if
- * a file contains image data in PPM format.
+ * This function is invoked by the photo image type to see if a file
+ * contains image data in PPM format.
*
* Results:
- * The return value is >0 if the first characters in file "f" look
- * like PPM data, and 0 otherwise.
+ * The return value is >0 if the first characters in file "f" look like
+ * PPM data, and 0 otherwise.
*
* Side effects:
* The access position in f may change.
@@ -99,14 +91,15 @@ static int ReadPPMStringHeader _ANSI_ARGS_((Tcl_Obj *dataObj,
*/
static int
-FileMatchPPM(chan, fileName, format, widthPtr, heightPtr, interp)
- Tcl_Channel chan; /* The image file, open for reading. */
- CONST char *fileName; /* The name of the image file. */
- Tcl_Obj *format; /* User-specified format string, or NULL. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here if the file is a valid
- * raw PPM file. */
- Tcl_Interp *interp;
+FileMatchPPM(
+ Tcl_Channel chan, /* The image file, open for reading. */
+ 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
+ * here if the file is a valid raw PPM
+ * file. */
+ Tcl_Interp *interp) /* unused */
{
int dummy;
@@ -118,35 +111,33 @@ FileMatchPPM(chan, fileName, format, widthPtr, heightPtr, interp)
*
* FileReadPPM --
*
- * This procedure is called by the photo image type to read
- * PPM format data from a file and write it into a given
- * photo image.
+ * This function is called by the photo image type to read PPM 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.
+ * 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.
+ * The access position in file f is changed, and new data is added to the
+ * image given by imageHandle.
*
*----------------------------------------------------------------------
*/
static int
-FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
- width, height, srcX, srcY)
- 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. */
- Tcl_Obj *format; /* User-specified format string, or NULL. */
- Tk_PhotoHandle imageHandle; /* The photo image to write into. */
- int destX, destY; /* Coordinates of top-left pixel in
- * photo image to be written to. */
- int width, height; /* Dimensions of block of photo image to
- * be written to. */
- int srcX, srcY; /* Coordinates of top-left pixel to be used
- * in image being read. */
+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. */
+ 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
+ * image to be written to. */
+ int width, int height, /* Dimensions of block of photo image to be
+ * written to. */
+ int srcX, int srcY) /* Coordinates of top-left pixel to be used in
+ * image being read. */
{
int fileWidth, fileHeight, maxIntensity;
int nLines, nBytes, h, type, count;
@@ -185,14 +176,13 @@ FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
}
if (type == PGM) {
- block.pixelSize = 1;
- block.offset[0] = 0;
+ block.pixelSize = 1;
+ block.offset[0] = 0;
block.offset[1] = 0;
block.offset[2] = 0;
- }
- else {
- block.pixelSize = 3;
- block.offset[0] = 0;
+ } else {
+ block.pixelSize = 3;
+ block.offset[0] = 0;
block.offset[1] = 1;
block.offset[2] = 2;
}
@@ -200,7 +190,10 @@ FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
block.width = width;
block.pitch = block.pixelSize * fileWidth;
- Tk_PhotoExpand(imageHandle, destX + width, destY + height);
+ if (Tk_PhotoExpand(interp, imageHandle,
+ destX + width, destY + height) != TCL_OK) {
+ return TCL_ERROR;
+ }
if (srcY > 0) {
Tcl_Seek(chan, (Tcl_WideInt)(srcY * block.pitch), SEEK_CUR);
@@ -239,8 +232,11 @@ FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
}
}
block.height = nLines;
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines,
- TK_PHOTO_COMPOSITE_SET);
+ if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
+ width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
+ ckfree((char *) pixelPtr);
+ return TCL_ERROR;
+ }
destY += nLines;
}
@@ -253,12 +249,12 @@ FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
*
* FileWritePPM --
*
- * This procedure is invoked to write image data to a file in PPM
- * format.
+ * This function is invoked to write image data to a file in PPM format
+ * (although we can read PGM files, we never write them).
*
* Results:
- * A standard TCL completion code. If TCL_ERROR is returned
- * then an error message is left in the interp's result.
+ * A standard TCL completion code. If TCL_ERROR is returned then an error
+ * message is left in the interp's result.
*
* Side effects:
* Data is written to the file given by "fileName".
@@ -267,15 +263,14 @@ FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
*/
static int
-FileWritePPM(interp, fileName, format, blockPtr)
- Tcl_Interp *interp;
- CONST char *fileName;
- Tcl_Obj *format;
- Tk_PhotoImageBlock *blockPtr;
+FileWritePPM(
+ Tcl_Interp *interp,
+ CONST char *fileName,
+ Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr)
{
Tcl_Channel chan;
- int w, h;
- int greenOffset, blueOffset, nBytes;
+ int w, h, greenOffset, blueOffset, nBytes;
unsigned char *pixelPtr, *pixLinePtr;
char header[16 + TCL_INTEGER_SPACE * 2];
@@ -312,9 +307,9 @@ FileWritePPM(interp, fileName, format, blockPtr)
for (h = blockPtr->height; h > 0; h--) {
pixelPtr = pixLinePtr;
for (w = blockPtr->width; w > 0; w--) {
- if ((Tcl_Write(chan, (char *) &pixelPtr[0], 1) == -1)
- || (Tcl_Write(chan, (char *) &pixelPtr[greenOffset], 1) == -1)
- || (Tcl_Write(chan, (char *) &pixelPtr[blueOffset], 1) == -1)) {
+ if ( Tcl_Write(chan,(char *)&pixelPtr[0], 1) == -1 ||
+ Tcl_Write(chan,(char *)&pixelPtr[greenOffset],1)==-1 ||
+ Tcl_Write(chan,(char *)&pixelPtr[blueOffset],1) ==-1) {
goto writeerror;
}
pixelPtr += blockPtr->pixelSize;
@@ -328,7 +323,7 @@ FileWritePPM(interp, fileName, format, blockPtr)
}
chan = NULL;
- writeerror:
+ writeerror:
Tcl_AppendResult(interp, "error writing \"", fileName, "\": ",
Tcl_PosixError(interp), NULL);
if (chan != NULL) {
@@ -342,12 +337,12 @@ FileWritePPM(interp, fileName, format, blockPtr)
*
* StringWritePPM --
*
- * This procedure is invoked to write image data to a string in PPM
+ * This function is invoked to write image data to a string in PPM
* format.
*
* Results:
- * A standard TCL completion code. If TCL_ERROR is returned
- * then an error message is left in the interp's result.
+ * A standard TCL completion code. If TCL_ERROR is returned then an error
+ * message is left in the interp's result.
*
* Side effects:
* None.
@@ -356,10 +351,10 @@ FileWritePPM(interp, fileName, format, blockPtr)
*/
static int
-StringWritePPM(interp, format, blockPtr)
- Tcl_Interp *interp;
- Tcl_Obj *format;
- Tk_PhotoImageBlock *blockPtr;
+StringWritePPM(
+ Tcl_Interp *interp,
+ Tcl_Obj *format,
+ Tk_PhotoImageBlock *blockPtr)
{
int w, h, size, greenOffset, blueOffset;
unsigned char *pixLinePtr, *byteArray;
@@ -367,10 +362,12 @@ StringWritePPM(interp, format, blockPtr)
Tcl_Obj *byteArrayObj;
sprintf(header, "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height);
+
/*
* Construct a byte array of the right size with the header and
* get a pointer to the data part of it.
*/
+
size = strlen(header);
byteArrayObj = Tcl_NewByteArrayObj((unsigned char *)header, size);
byteArray = Tcl_SetByteArrayLength(byteArrayObj,
@@ -384,6 +381,7 @@ StringWritePPM(interp, format, blockPtr)
/*
* Check if we can do the data move in single action.
*/
+
if ((greenOffset == 1) && (blueOffset == 2) && (blockPtr->pixelSize == 3)
&& (blockPtr->pitch == (blockPtr->width * 3))) {
memcpy(byteArray, pixLinePtr,
@@ -405,6 +403,7 @@ StringWritePPM(interp, format, blockPtr)
/*
* Return the object in the interpreter result.
*/
+
Tcl_SetObjResult(interp, byteArrayObj);
return TCL_OK;
}
@@ -414,12 +413,12 @@ StringWritePPM(interp, format, blockPtr)
*
* StringMatchPPM --
*
- * This procedure is invoked by the photo image type to see if
- * a string contains image data in PPM format.
+ * This function is invoked by the photo image type to see if a string
+ * contains image data in PPM format.
*
* Results:
- * The return value is >0 if the first characters in file "f" look
- * like PPM data, and 0 otherwise.
+ * The return value is >0 if the first characters in file "f" look like
+ * PPM data, and 0 otherwise.
*
* Side effects:
* The access position in f may change.
@@ -428,13 +427,14 @@ StringWritePPM(interp, format, blockPtr)
*/
static int
-StringMatchPPM(dataObj, format, widthPtr, heightPtr, interp)
- Tcl_Obj *dataObj; /* The image data. */
- Tcl_Obj *format; /* User-specified format string, or NULL. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here if the file is a valid
- * raw PPM file. */
- Tcl_Interp *interp; /* unused */
+StringMatchPPM(
+ Tcl_Obj *dataObj, /* The image data. */
+ Tcl_Obj *format, /* User-specified format string, or NULL. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here if the file is a valid raw PPM
+ * file. */
+ Tcl_Interp *interp) /* unused */
{
int dummy;
@@ -447,13 +447,12 @@ StringMatchPPM(dataObj, format, widthPtr, heightPtr, interp)
*
* StringReadPPM --
*
- * This procedure is called by the photo image type to read
- * PPM format data from a string and write it into a given
- * photo image.
+ * This function is called by the photo image type to read PPM format
+ * data from a string 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.
+ * 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.
@@ -462,18 +461,17 @@ StringMatchPPM(dataObj, format, widthPtr, heightPtr, interp)
*/
static int
-StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
- width, height, srcX, srcY)
- Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
- Tcl_Obj *dataObj; /* The image data. */
- Tcl_Obj *format; /* User-specified format string, or NULL. */
- Tk_PhotoHandle imageHandle; /* The photo image to write into. */
- int destX, destY; /* Coordinates of top-left pixel in
- * photo image to be written to. */
- int width, height; /* Dimensions of block of photo image to
- * be written to. */
- int srcX, srcY; /* Coordinates of top-left pixel to be used
- * in image being read. */
+StringReadPPM(
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
+ Tcl_Obj *dataObj, /* The image data. */
+ 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
+ * image to be written to. */
+ int width, int height, /* Dimensions of block of photo image to be
+ * written to. */
+ int srcX, int srcY) /* Coordinates of top-left pixel to be used in
+ * image being read. */
{
int fileWidth, fileHeight, maxIntensity;
int nLines, nBytes, h, type, count, dataSize;
@@ -514,13 +512,13 @@ StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
}
if (type == PGM) {
- block.pixelSize = 1;
- block.offset[0] = 0;
+ block.pixelSize = 1;
+ block.offset[0] = 0;
block.offset[1] = 0;
block.offset[2] = 0;
} else {
- block.pixelSize = 3;
- block.offset[0] = 0;
+ block.pixelSize = 3;
+ block.offset[0] = 0;
block.offset[1] = 1;
block.offset[2] = 2;
}
@@ -535,21 +533,23 @@ StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
if (maxIntensity == 255) {
/*
- * We have all the data in memory, so write everything in one
- * go.
+ * We have all the data in memory, so write everything in one go.
*/
+
if (block.pitch*height > dataSize) {
Tcl_AppendResult(interp, "truncated PPM data", NULL);
return TCL_ERROR;
}
block.pixelPtr = dataBuffer + srcX * block.pixelSize;
block.height = height;
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height,
- TK_PHOTO_COMPOSITE_SET);
- return TCL_OK;
+ return Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
+ width, height, TK_PHOTO_COMPOSITE_SET);
}
- Tk_PhotoExpand(imageHandle, destX + width, destY + height);
+ if (Tk_PhotoExpand(interp, imageHandle,
+ destX + width, destY + height) != TCL_OK) {
+ return TCL_ERROR;
+ }
nLines = (MAX_MEMORY + block.pitch - 1) / block.pitch;
if (nLines > height) {
@@ -579,8 +579,11 @@ StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
}
dataSize -= nBytes;
block.height = nLines;
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines,
- TK_PHOTO_COMPOSITE_SET);
+ if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY,
+ width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
+ ckfree((char *) pixelPtr);
+ return TCL_ERROR;
+ }
destY += nLines;
}
@@ -593,16 +596,15 @@ StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
*
* ReadPPMFileHeader --
*
- * This procedure reads the PPM header from the beginning of a
- * PPM file and returns information from the header.
+ * This function reads the PPM header from the beginning of a PPM file
+ * and returns information from the header.
*
* Results:
- * The return value is PGM if file "f" appears to start with
- * a valid PGM header, PPM if "f" appears to start with a valid
- * PPM header, and 0 otherwise. If the header is valid,
- * then *widthPtr and *heightPtr are modified to hold the
- * dimensions of the image and *maxIntensityPtr is modified to
- * hold the value of a "fully on" intensity value.
+ * The return value is PGM if file "f" appears to start with a valid PGM
+ * header, PPM if "f" appears to start with a valid PPM header, and 0
+ * otherwise. If the header is valid, then *widthPtr and *heightPtr are
+ * modified to hold the dimensions of the image and *maxIntensityPtr is
+ * modified to hold the value of a "fully on" intensity value.
*
* Side effects:
* The access position in f advances.
@@ -611,22 +613,21 @@ StringReadPPM(interp, dataObj, format, imageHandle, destX, destY,
*/
static int
-ReadPPMFileHeader(chan, widthPtr, heightPtr, maxIntensityPtr)
- Tcl_Channel chan; /* Image file to read the header from */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here. */
- int *maxIntensityPtr; /* The maximum intensity value for
- * the image is stored here. */
+ReadPPMFileHeader(
+ Tcl_Channel chan, /* Image file to read the header from. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here. */
+ int *maxIntensityPtr) /* The maximum intensity value for the image
+ * is stored here. */
{
#define BUFFER_SIZE 1000
- char buffer[BUFFER_SIZE];
- int i, numFields;
- int type = 0;
- char c;
+ char buffer[BUFFER_SIZE], c;
+ int i, numFields, type = 0;
/*
- * Read 4 space-separated fields from the file, ignoring
- * comments (any line that starts with "#").
+ * Read 4 space-separated fields from the file, ignoring comments (any
+ * line that starts with "#").
*/
if (Tcl_Read(chan, &c, 1) != 1) {
@@ -672,7 +673,8 @@ ReadPPMFileHeader(chan, widthPtr, heightPtr, maxIntensityPtr)
i++;
}
}
- done:
+
+ done:
buffer[i] = 0;
/*
@@ -698,16 +700,16 @@ ReadPPMFileHeader(chan, widthPtr, heightPtr, maxIntensityPtr)
*
* ReadPPMStringHeader --
*
- * This procedure reads the PPM header from the beginning of a
- * PPM-format string and returns information from the header.
+ * This function reads the PPM header from the beginning of a PPM-format
+ * string and returns information from the header.
*
* Results:
- * The return value is PGM if the string appears to start with
- * a valid PGM header, PPM if the string appears to start with
- * a valid PPM header, and 0 otherwise. If the header is valid,
- * then *widthPtr and *heightPtr are modified to hold the
- * dimensions of the image and *maxIntensityPtr is modified to
- * hold the value of a "fully on" intensity value.
+ * The return value is PGM if the string appears to start with a valid
+ * PGM header, PPM if the string appears to start with a valid PPM
+ * header, and 0 otherwise. If the header is valid, then *widthPtr and
+ * *heightPtr are modified to hold the dimensions of the image and
+ * *maxIntensityPtr is modified to hold the value of a "fully on"
+ * intensity value.
*
* Side effects:
* None
@@ -716,28 +718,26 @@ ReadPPMFileHeader(chan, widthPtr, heightPtr, maxIntensityPtr)
*/
static int
-ReadPPMStringHeader(dataPtr, widthPtr, heightPtr, maxIntensityPtr,
- dataBufferPtr, dataSizePtr)
- Tcl_Obj *dataPtr; /* Object to read the header from. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here. */
- int *maxIntensityPtr; /* The maximum intensity value for
- * the image is stored here. */
- unsigned char **dataBufferPtr;
- int *dataSizePtr;
+ReadPPMStringHeader(
+ Tcl_Obj *dataPtr, /* Object to read the header from. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here. */
+ int *maxIntensityPtr, /* The maximum intensity value for the image
+ * is stored here. */
+ unsigned char **dataBufferPtr,
+ int *dataSizePtr)
{
#define BUFFER_SIZE 1000
- char buffer[BUFFER_SIZE];
- int i, numFields, dataSize;
- int type = 0;
- char c;
+ char buffer[BUFFER_SIZE], c;
+ int i, numFields, dataSize, type = 0;
unsigned char *dataBuffer;
dataBuffer = Tcl_GetByteArrayFromObj(dataPtr, &dataSize);
/*
- * Read 4 space-separated fields from the string, ignoring
- * comments (any line that starts with "#").
+ * Read 4 space-separated fields from the string, ignoring comments (any
+ * line that starts with "#").
*/
if (dataSize-- < 1) {
@@ -787,7 +787,8 @@ ReadPPMStringHeader(dataPtr, widthPtr, heightPtr, maxIntensityPtr,
i++;
}
}
- done:
+
+ done:
buffer[i] = 0;
/*
@@ -811,3 +812,11 @@ ReadPPMStringHeader(dataPtr, widthPtr, heightPtr, maxIntensityPtr,
}
return type;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 3f439de..ef907e6 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -1,17 +1,17 @@
/*
* tkImgPhoto.c --
*
- * Implements 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.
+ * Implements 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 Donal K. Fellows
+ * Copyright (c) 2002-2003 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.
+ * 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,
@@ -19,8 +19,6 @@
*/
#include "tkInt.h"
-#include "tkPort.h"
-#include "tclMath.h"
#include <ctype.h>
#ifdef __WIN32__
@@ -31,12 +29,12 @@
* Declaration for internal Xlib function used here:
*/
-extern int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
+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.
+ * 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)
@@ -50,16 +48,15 @@ extern int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
#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.
+ * 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.
+ * The maximum number of pixels to transmit to the server in a single
+ * XPutImage call.
*/
#define MAX_PIXELS 65536
@@ -67,20 +64,19 @@ typedef unsigned int pixel;
/*
* 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 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:
+ * 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 */
+ 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
@@ -88,33 +84,33 @@ typedef struct {
} 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:
+ * 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. */
+ 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 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 */
+ 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. */
+ * intensities. The first index is 0 for red,
+ * 1 for green, 2 for blue. */
} ColorTable;
/*
@@ -123,12 +119,13 @@ typedef struct ColorTable {
* 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.
+ * 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
@@ -143,14 +140,13 @@ typedef struct ColorTable {
*/
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. */
+ 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. */
@@ -159,26 +155,27 @@ typedef struct PhotoMaster {
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. */
+ 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. */
+ 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. */
+ /* 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.
+ * 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
@@ -193,9 +190,8 @@ typedef struct PhotoMaster {
#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.
+ * 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 {
@@ -204,34 +200,34 @@ typedef struct PhotoInstance {
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. */
+ /* 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. */
+ 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. */
+ * 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. */
+ GC gc; /* Graphics context for writing images to the
+ * pixmap. */
} PhotoInstance;
/*
- * The following data structure is used to return information
- * from ParseSubcommandOptions:
+ * The following data structure is used to return information from
+ * ParseSubcommandOptions:
*/
struct SubcommandOptions {
- int options; /* Individual bits indicate which
- * options were specified - see below. */
+ int options; /* Individual bits indicate which options were
+ * specified - see below. */
Tcl_Obj *name; /* Name specified without an option. */
int fromX, fromY; /* Values specified for -from option. */
int fromX2, fromY2; /* Second coordinate pair for -from option. */
@@ -241,15 +237,16 @@ struct SubcommandOptions {
int subsampleX, subsampleY; /* Values specified for -subsample option. */
Tcl_Obj *format; /* Value specified for -format option. */
XColor *background; /* Value specified for -background option. */
- int compositingRule; /* Value specified for -compositingrule opt */
+ int compositingRule; /* Value specified for -compositingrule
+ * option. */
};
/*
- * Bit definitions for use with ParseSubcommandOptions:
- * Each bit is set in the allowedOptions parameter on a call to
- * ParseSubcommandOptions if that option is allowed for the current
- * photo image subcommand. On return, the bit is set in the options
- * field of the SubcommandOptions structure if that option was specified.
+ * Bit definitions for use with ParseSubcommandOptions: each bit is set in the
+ * allowedOptions parameter on a call to ParseSubcommandOptions if that option
+ * is allowed for the current photo image subcommand. On return, the bit is
+ * set in the options field of the SubcommandOptions structure if that option
+ * was specified.
*
* OPT_BACKGROUND: Set if -format option allowed/specified.
* OPT_COMPOSITE: Set if -compositingrule option allowed/spec'd.
@@ -273,8 +270,8 @@ struct SubcommandOptions {
#define OPT_ZOOM 0x100
/*
- * List of option names. The order here must match the order of
- * declarations of the OPT_* constants above.
+ * List of option names. The order here must match the order of declarations
+ * of the OPT_* constants above.
*/
static char *optionNames[] = {
@@ -287,13 +284,14 @@ static char *optionNames[] = {
"-subsample",
"-to",
"-zoom",
- (char *) NULL
+ NULL
};
/*
- * Message to generate when an attempt to resize an image fails due
- * to memory problems.
+ * Message to generate when an attempt to resize an image fails due to memory
+ * problems.
*/
+
#define TK_PHOTO_ALLOC_FAILURE_MESSAGE \
"not enough free memory for image buffer"
@@ -301,23 +299,21 @@ static char *optionNames[] = {
* Functions used in the type record for photo images.
*/
-static int ImgPhotoCreate _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, int objc, Tcl_Obj *CONST objv[],
+static int ImgPhotoCreate(Tcl_Interp *interp, char *name,
+ int objc, Tcl_Obj *CONST objv[],
Tk_ImageType *typePtr, Tk_ImageMaster master,
- ClientData *clientDataPtr));
-static ClientData ImgPhotoGet _ANSI_ARGS_((Tk_Window tkwin,
- ClientData clientData));
-static void ImgPhotoDisplay _ANSI_ARGS_((ClientData clientData,
+ 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 _ANSI_ARGS_((ClientData clientData,
- Display *display));
-static void ImgPhotoDelete _ANSI_ARGS_((ClientData clientData));
-static int ImgPhotoPostscript _ANSI_ARGS_((ClientData clientData,
+ 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,
Tk_PostscriptInfo psInfo, int x, int y, int width,
- int height, int prepass));
+ int height, int prepass);
/*
* The type record itself for photo images:
@@ -331,15 +327,18 @@ Tk_ImageType tkPhotoImageType = {
ImgPhotoFree, /* freeProc */
ImgPhotoDelete, /* deleteProc */
ImgPhotoPostscript, /* postscriptProc */
- (Tk_ImageType *) NULL /* nextPtr */
+ NULL /* nextPtr */
};
typedef struct ThreadSpecificData {
- Tk_PhotoImageFormat *formatList; /* Pointer to the first in the
- * list of known photo image formats.*/
- Tk_PhotoImageFormat *oldFormatList; /* Pointer to the first in the
- * list of known photo image formats.*/
- int initialized; /* set to 1 if we've initialized the strucuture */
+ Tk_PhotoImageFormat *formatList;
+ /* Pointer to the first in the list of known
+ * photo image formats.*/
+ Tk_PhotoImageFormat *oldFormatList;
+ /* Pointer to the first in the list of known
+ * photo image formats.*/
+ int initialized; /* Set to 1 if we've initialized the
+ * strucuture. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -355,24 +354,24 @@ static Tcl_ThreadDataKey dataKey;
/*
* Information used for parsing configuration specifications:
*/
+
static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_STRING, "-file", (char *) NULL, (char *) NULL,
- (char *) NULL, Tk_Offset(PhotoMaster, fileString), TK_CONFIG_NULL_OK},
- {TK_CONFIG_DOUBLE, "-gamma", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_STRING, "-file", NULL, NULL,
+ NULL, Tk_Offset(PhotoMaster, fileString), TK_CONFIG_NULL_OK},
+ {TK_CONFIG_DOUBLE, "-gamma", NULL, NULL,
DEF_PHOTO_GAMMA, Tk_Offset(PhotoMaster, gamma), 0},
- {TK_CONFIG_INT, "-height", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_INT, "-height", NULL, NULL,
DEF_PHOTO_HEIGHT, Tk_Offset(PhotoMaster, userHeight), 0},
- {TK_CONFIG_UID, "-palette", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_UID, "-palette", NULL, NULL,
DEF_PHOTO_PALETTE, Tk_Offset(PhotoMaster, palette), 0},
- {TK_CONFIG_INT, "-width", (char *) NULL, (char *) NULL,
+ {TK_CONFIG_INT, "-width", NULL, NULL,
DEF_PHOTO_WIDTH, Tk_Offset(PhotoMaster, userWidth), 0},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * Hash table used to hash from (display, colormap, palette, gamma)
- * to ColorTable address.
+ * Hash table used to hash from (display, colormap, palette, gamma) to
+ * ColorTable address.
*/
static Tcl_HashTable imgPhotoColorHash;
@@ -392,61 +391,53 @@ static int imgPhotoColorHashInitialized;
* Forward declarations
*/
-static void PhotoFormatThreadExitProc _ANSI_ARGS_((
- ClientData clientData));
-static int ImgPhotoCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
-static int ParseSubcommandOptions _ANSI_ARGS_((
+static void PhotoFormatThreadExitProc(ClientData clientData);
+static int ImgPhotoCmd(ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]);
+static int ParseSubcommandOptions(
struct SubcommandOptions *optPtr,
Tcl_Interp *interp, int allowedOptions,
- int *indexPtr, int objc, Tcl_Obj *CONST objv[]));
-static void ImgPhotoCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static int ImgPhotoConfigureMaster _ANSI_ARGS_((
- Tcl_Interp *interp, PhotoMaster *masterPtr,
- int objc, Tcl_Obj *CONST objv[], int flags));
-static void ImgPhotoConfigureInstance _ANSI_ARGS_((
- PhotoInstance *instancePtr));
-static int ToggleComplexAlphaIfNeeded _ANSI_ARGS_((
- PhotoMaster *mPtr));
-static void ImgPhotoBlendComplexAlpha _ANSI_ARGS_((
- XImage *bgImg, PhotoInstance *iPtr,
- int xOffset, int yOffset, int width, int height));
-static int ImgPhotoSetSize _ANSI_ARGS_((PhotoMaster *masterPtr,
- int width, int height));
-static void ImgPhotoInstanceSetSize _ANSI_ARGS_((
- PhotoInstance *instancePtr));
-static int ImgStringWrite _ANSI_ARGS_((Tcl_Interp *interp,
+ int *indexPtr, int objc, Tcl_Obj *const objv[]);
+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 _ANSI_ARGS_((PhotoMaster *masterPtr,
+ Tk_PhotoImageBlock *blockPtr);
+static char * ImgGetPhoto(PhotoMaster *masterPtr,
Tk_PhotoImageBlock *blockPtr,
- struct SubcommandOptions *optPtr));
-static int IsValidPalette _ANSI_ARGS_((PhotoInstance *instancePtr,
- CONST char *palette));
-static int CountBits _ANSI_ARGS_((pixel mask));
-static void GetColorTable _ANSI_ARGS_((PhotoInstance *instancePtr));
-static void FreeColorTable _ANSI_ARGS_((ColorTable *colorPtr,
- int force));
-static void AllocateColors _ANSI_ARGS_((ColorTable *colorPtr));
-static void DisposeColorTable _ANSI_ARGS_((ClientData clientData));
-static void DisposeInstance _ANSI_ARGS_((ClientData clientData));
-static int ReclaimColors _ANSI_ARGS_((ColorTableId *id,
- int numColors));
-static int MatchFileFormat _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Channel chan, char *fileName, Tcl_Obj *formatString,
+ 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,
Tk_PhotoImageFormat **imageFormatPtr,
- int *widthPtr, int *heightPtr, int *oldformat));
-static int MatchStringFormat _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *data, Tcl_Obj *formatString,
+ 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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tcl_Obj *obj));
-static void DitherInstance _ANSI_ARGS_((PhotoInstance *instancePtr,
- int x, int y, int width, int height));
-static void PhotoOptionCleanupProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp));
+ 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))
@@ -456,35 +447,30 @@ static void PhotoOptionCleanupProc _ANSI_ARGS_((
/*
*----------------------------------------------------------------------
*
- * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat --
+ * PhotoFormatThreadExitProc --
*
- * This procedure is invoked by an image file handler to register
- * a new photo image format and the procedures that handle the
- * new format. The procedure is typically invoked during
- * Tcl_AppInit.
+ * Clean up the registered list of photo formats.
*
* Results:
* None.
*
* Side effects:
- * The new image file format is entered into a table used in the
- * photo image "read" and "write" subcommands.
+ * The thread's linked lists of photo image formats is deleted.
*
*----------------------------------------------------------------------
*/
static void
-PhotoFormatThreadExitProc(clientData)
- ClientData clientData; /* not used */
+PhotoFormatThreadExitProc(
+ ClientData clientData) /* not used */
{
Tk_PhotoImageFormat *freePtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
while (tsdPtr->oldFormatList != NULL) {
freePtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
- ckfree((char *) freePtr->name);
ckfree((char *) freePtr);
}
while (tsdPtr->formatList != NULL) {
@@ -500,31 +486,30 @@ PhotoFormatThreadExitProc(clientData)
*
* Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat --
*
- * This procedure is invoked by an image file handler to register
- * a new photo image format and the procedures that handle the
- * new format. The procedure is typically invoked during
- * Tcl_AppInit.
+ * This function is invoked by an image file handler to register a new
+ * photo image format and the functions that handle the new format. The
+ * function is typically invoked during Tcl_AppInit.
*
* Results:
* None.
*
* Side effects:
- * The new image file format is entered into a table used in the
- * photo image "read" and "write" subcommands.
+ * The new image file format is entered into a table used in the photo
+ * image "read" and "write" subcommands.
*
*----------------------------------------------------------------------
*/
+
void
-Tk_CreateOldPhotoImageFormat(formatPtr)
- Tk_PhotoImageFormat *formatPtr;
- /* Structure describing the format. All of
- * the fields except "nextPtr" must be filled
- * in by caller. Must not have been passed
- * to Tk_CreatePhotoImageFormat previously. */
+Tk_CreateOldPhotoImageFormat(
+ 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 *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
@@ -532,23 +517,20 @@ Tk_CreateOldPhotoImageFormat(formatPtr)
}
copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
- copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
- strcpy(copyPtr->name, formatPtr->name);
copyPtr->nextPtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = copyPtr;
}
void
-Tk_CreatePhotoImageFormat(formatPtr)
- Tk_PhotoImageFormat *formatPtr;
- /* Structure describing the format. All of
- * the fields except "nextPtr" must be filled
- * in by caller. Must not have been passed
- * to Tk_CreatePhotoImageFormat previously. */
+Tk_CreatePhotoImageFormat(
+ 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 *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
tsdPtr->initialized = 1;
@@ -556,12 +538,14 @@ Tk_CreatePhotoImageFormat(formatPtr)
}
copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
- copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
- strcpy(copyPtr->name, formatPtr->name);
if (isupper((unsigned char) *formatPtr->name)) {
copyPtr->nextPtr = tsdPtr->oldFormatList;
tsdPtr->oldFormatList = copyPtr;
} else {
+ /* for compatibility with aMSN: make a copy of formatPtr->name */
+ char *name = ckalloc(strlen(formatPtr->name) + 1);
+ strcpy(name, formatPtr->name);
+ copyPtr->name = name;
copyPtr->nextPtr = tsdPtr->formatList;
tsdPtr->formatList = copyPtr;
}
@@ -572,32 +556,31 @@ Tk_CreatePhotoImageFormat(formatPtr)
*
* ImgPhotoCreate --
*
- * This procedure is called by the Tk image code to create
- * a new photo image.
+ * This function is called by the Tk image code to create a new photo
+ * image.
*
* Results:
* A standard Tcl result.
*
* Side effects:
- * The data structure for a new photo image is allocated and
- * initialized.
+ * The data structure for a new photo image is allocated and initialized.
*
*----------------------------------------------------------------------
*/
static int
-ImgPhotoCreate(interp, name, objc, objv, typePtr, master, clientDataPtr)
- Tcl_Interp *interp; /* Interpreter for application containing
+ImgPhotoCreate(
+ Tcl_Interp *interp, /* Interpreter for application containing
* image. */
- char *name; /* Name to use for image. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects for options (doesn't
+ char *name, /* Name to use for image. */
+ int objc, /* Number of arguments. */
+ 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). */
- 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. */
+ 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. */
{
PhotoMaster *masterPtr;
@@ -606,7 +589,7 @@ ImgPhotoCreate(interp, name, objc, objv, typePtr, master, clientDataPtr)
*/
masterPtr = (PhotoMaster *) ckalloc(sizeof(PhotoMaster));
- memset((void *) masterPtr, 0, sizeof(PhotoMaster));
+ memset(masterPtr, 0, sizeof(PhotoMaster));
masterPtr->tkMaster = master;
masterPtr->interp = interp;
masterPtr->imageCmd = Tcl_CreateObjCommand(interp, name, ImgPhotoCmd,
@@ -634,9 +617,9 @@ ImgPhotoCreate(interp, name, objc, objv, typePtr, master, clientDataPtr)
*
* ImgPhotoCmd --
*
- * This procedure is invoked to process the Tcl command that
- * corresponds to a photo image. See the user documentation
- * for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a photo image. See the user documentation for details on what it
+ * does.
*
* Results:
* A standard Tcl result.
@@ -648,42 +631,35 @@ ImgPhotoCreate(interp, name, objc, objv, typePtr, master, clientDataPtr)
*/
static int
-ImgPhotoCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about photo master. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+ImgPhotoCmd(
+ ClientData clientData, /* Information about photo master. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- int oldformat = 0;
- static CONST char *photoOptions[] = {
+ static const char *photoOptions[] = {
"blank", "cget", "configure", "copy", "data", "get", "put",
- "read", "redither", "transparency", "write", (char *) NULL
+ "read", "redither", "transparency", "write", NULL
};
- enum options {
+ enum PhotoOptions {
PHOTO_BLANK, PHOTO_CGET, PHOTO_CONFIGURE, PHOTO_COPY, PHOTO_DATA,
PHOTO_GET, PHOTO_PUT, PHOTO_READ, PHOTO_REDITHER, PHOTO_TRANS,
PHOTO_WRITE
};
PhotoMaster *masterPtr = (PhotoMaster *) clientData;
- int result, index;
- int x, y, width, height;
- int dataWidth, dataHeight;
+ int result, index, x, y, width, height, dataWidth, dataHeight, listObjc;
struct SubcommandOptions options;
- int listArgc;
- CONST char **listArgv;
- CONST char **srcArgv;
+ Tcl_Obj **listObjv, **srcObjv;
unsigned char *pixelPtr;
Tk_PhotoImageBlock block;
Tk_Window tkwin;
- XColor color;
Tk_PhotoImageFormat *imageFormat;
- int imageWidth, imageHeight;
- int length, matched;
+ int imageWidth, imageHeight, matched, length, oldformat = 0;
Tcl_Channel chan;
Tk_PhotoHandle srcHandle;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
@@ -694,13 +670,13 @@ ImgPhotoCmd(clientData, interp, objc, objv)
&index) != TCL_OK) {
Tcl_ObjCmdProc *proc;
proc = PhotoOptionFind(interp, objv[1]);
- if (proc == (Tcl_ObjCmdProc *) NULL) {
+ if (proc == NULL) {
return TCL_ERROR;
}
return proc(clientData, interp, objc, objv);
}
- switch ((enum options) index) {
+ switch ((enum PhotoOptions) index) {
case PHOTO_BLANK:
/*
* photo blank command - just call Tk_PhotoBlank.
@@ -710,7 +686,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tk_PhotoBlank(masterPtr);
return TCL_OK;
} else {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
@@ -744,53 +720,51 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (objc == 2) {
Tcl_Obj *obj, *subobj;
+
result = Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) masterPtr, (char *) NULL, 0);
+ configSpecs, (char *) masterPtr, NULL, 0);
if (result != TCL_OK) {
return result;
}
obj = Tcl_NewObj();
subobj = Tcl_NewStringObj("-data {} {} {}", 14);
if (masterPtr->dataString) {
- Tcl_ListObjAppendElement(interp, subobj, masterPtr->dataString);
+ Tcl_ListObjAppendElement(NULL, subobj, masterPtr->dataString);
} else {
- Tcl_AppendStringsToObj(subobj, " {}", (char *) NULL);
+ Tcl_AppendStringsToObj(subobj, " {}", NULL);
}
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewStringObj("-format {} {} {}", 16);
if (masterPtr->format) {
- Tcl_ListObjAppendElement(interp, subobj, masterPtr->format);
+ Tcl_ListObjAppendElement(NULL, subobj, masterPtr->format);
} else {
- Tcl_AppendStringsToObj(subobj, " {}", (char *) NULL);
+ Tcl_AppendStringsToObj(subobj, " {}", NULL);
}
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_ListObjAppendList(interp, obj, Tcl_GetObjResult(interp));
Tcl_SetObjResult(interp, obj);
return TCL_OK;
- }
- if (objc == 3) {
+
+ } else if (objc == 3) {
char *arg = Tcl_GetStringFromObj(objv[2], &length);
- if (!strncmp(arg, "-data", (unsigned) length)) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "-data {} {} {}", (char *) NULL);
+ if (length > 1 && !strncmp(arg, "-data", (unsigned) length)) {
+ Tcl_AppendResult(interp, "-data {} {} {}", NULL);
if (masterPtr->dataString) {
Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
masterPtr->dataString);
} else {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- " {}", (char *) NULL);
+ Tcl_AppendResult(interp, " {}", NULL);
}
return TCL_OK;
- } else if (!strncmp(arg, "-format", (unsigned) length)) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "-format {} {} {}", (char *) NULL);
+ } else if (length > 1 &&
+ !strncmp(arg, "-format", (unsigned) length)) {
+ Tcl_AppendResult(interp, "-format {} {} {}", NULL);
if (masterPtr->format) {
Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
masterPtr->format);
} else {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- " {}", (char *) NULL);
+ Tcl_AppendResult(interp, " {}", NULL);
}
return TCL_OK;
} else {
@@ -807,7 +781,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
index = 2;
- memset((VOID *) &options, 0, sizeof(options));
+ memset(&options, 0, sizeof(options));
options.zoomX = options.zoomY = 1;
options.subsampleX = options.subsampleY = 1;
options.name = NULL;
@@ -832,7 +806,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (srcHandle == NULL) {
Tcl_AppendResult(interp, "image \"",
Tcl_GetString(options.name), "\" doesn't",
- " exist or is not a photo image", (char *) NULL);
+ " exist or is not a photo image", NULL);
return TCL_ERROR;
}
Tk_PhotoGetImage(srcHandle, &block);
@@ -840,7 +814,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
|| (options.fromX2 > block.width)
|| (options.fromY2 > block.height)) {
Tcl_AppendResult(interp, "coordinates for -from option extend ",
- "outside source image", (char *) NULL);
+ "outside source image", NULL);
return TCL_ERROR;
}
@@ -893,8 +867,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (ImgPhotoSetSize(masterPtr, options.toX2,
options.toY2) != TCL_OK) {
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
return TCL_ERROR;
}
}
@@ -907,12 +880,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
+ options.fromY * block.pitch;
block.width = options.fromX2 - options.fromX;
block.height = options.fromY2 - options.fromY;
- Tk_PhotoPutZoomedBlock((Tk_PhotoHandle) masterPtr, &block,
- options.toX, options.toY, options.toX2 - options.toX,
+ return Tk_PhotoPutZoomedBlock(interp, (Tk_PhotoHandle) masterPtr,
+ &block, options.toX, options.toY, options.toX2 - options.toX,
options.toY2 - options.toY, options.zoomX, options.zoomY,
options.subsampleX, options.subsampleY,
options.compositingRule);
- return TCL_OK;
case PHOTO_DATA: {
char *data;
@@ -920,10 +892,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
/*
* photo data command - first parse and check any options given.
*/
+
Tk_ImageStringWriteProc *stringWriteProc = NULL;
index = 2;
- memset((VOID *) &options, 0, sizeof(options));
+ memset(&options, 0, sizeof(options));
options.name = NULL;
options.format = NULL;
options.fromX = 0;
@@ -942,7 +915,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
|| (options.fromX2 > masterPtr->width)
|| (options.fromY2 > masterPtr->height)) {
Tcl_AppendResult(interp, "coordinates for -from option extend ",
- "outside image", (char *) NULL);
+ "outside image", NULL);
return TCL_ERROR;
}
@@ -990,8 +963,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (stringWriteProc == NULL) {
Tcl_AppendResult(interp, "image string format \"",
Tcl_GetString(options.format), "\" is ",
- (matched ? "not supported" : "unknown"),
- (char *) NULL);
+ (matched ? "not supported" : "unknown"), NULL);
return TCL_ERROR;
}
} else {
@@ -999,8 +971,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
/*
- * Call the handler's string write procedure to write out
- * the image.
+ * Call the handler's string write function to write out the image.
*/
data = ImgGetPhoto(masterPtr, &block, &options);
@@ -1009,9 +980,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_DString buffer;
Tcl_DStringInit(&buffer);
- result = ((int (*) _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_DString *buffer, char *formatString,
- Tk_PhotoImageBlock *blockPtr))) stringWriteProc)
+ result = ((int (*) (Tcl_Interp *interp,
+ Tcl_DString *dataPtr, char *formatString,
+ Tk_PhotoImageBlock *blockPtr)) stringWriteProc)
(interp, &buffer, Tcl_GetString(options.format), &block);
if (result == TCL_OK) {
Tcl_DStringResult(interp, &buffer);
@@ -1019,10 +990,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_DStringFree(&buffer);
}
} else {
- result = ((int (*) _ANSI_ARGS_((Tcl_Interp *interp,
+
+ result = ((int (*) (Tcl_Interp *interp,
Tcl_Obj *formatString, Tk_PhotoImageBlock *blockPtr,
- VOID *dummy))) stringWriteProc)
- (interp, options.format, &block, (VOID *) NULL);
+ void *dummy)) stringWriteProc)
+ (interp, options.format, &block, NULL);
}
if (options.background) {
Tk_FreeColor(options.background);
@@ -1051,7 +1023,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if ((x < 0) || (x >= masterPtr->width)
|| (y < 0) || (y >= masterPtr->height)) {
Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " get: ",
- "coordinates out of range", (char *) NULL);
+ "coordinates out of range", NULL);
return TCL_ERROR;
}
@@ -1062,7 +1034,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
pixelPtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4;
sprintf(string, "%d %d %d", pixelPtr[0], pixelPtr[1],
pixelPtr[2]);
- Tcl_AppendResult(interp, string, (char *) NULL);
+ Tcl_AppendResult(interp, string, NULL);
return TCL_OK;
}
@@ -1072,7 +1044,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
index = 2;
- memset((VOID *) &options, 0, sizeof(options));
+ memset(&options, 0, sizeof(options));
options.name = NULL;
if (ParseSubcommandOptions(&options, interp, OPT_TO|OPT_FORMAT,
&index, objc, objv) != TCL_OK) {
@@ -1083,7 +1055,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
- if (MatchStringFormat(interp, options.name ? objv[2]:NULL,
+ if (MatchStringFormat(interp, options.name ? objv[2]:NULL,
options.format, &imageFormat, &imageWidth,
&imageHeight, &oldformat) == TCL_OK) {
Tcl_Obj *format, *data;
@@ -1119,8 +1091,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
Tcl_ResetResult(interp);
- if (Tcl_SplitList(interp, Tcl_GetString(options.name),
- &dataHeight, &srcArgv) != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, options.name,
+ &dataHeight, &srcObjv) != TCL_OK) {
return TCL_ERROR;
}
tkwin = Tk_MainWindow(interp);
@@ -1128,44 +1100,80 @@ ImgPhotoCmd(clientData, interp, objc, objv)
dataWidth = 0;
pixelPtr = NULL;
for (y = 0; y < dataHeight; ++y) {
- if (Tcl_SplitList(interp, srcArgv[y], &listArgc, &listArgv)
- != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, srcObjv[y],
+ &listObjc, &listObjv) != TCL_OK) {
break;
}
+
if (y == 0) {
- if (listArgc == 0) {
+ if (listObjc == 0) {
/*
* Lines must be non-empty...
*/
+
break;
}
- dataWidth = listArgc;
+ dataWidth = listObjc;
pixelPtr = (unsigned char *)
ckalloc((unsigned) dataWidth * dataHeight * 3);
block.pixelPtr = pixelPtr;
- } else if (listArgc != dataWidth) {
+ } else if (listObjc != dataWidth) {
Tcl_AppendResult(interp, "all elements of color list must",
- " have the same number of elements", (char *) NULL);
- ckfree((char *) listArgv);
+ " have the same number of elements", NULL);
break;
}
+
for (x = 0; x < dataWidth; ++x) {
+ char *colorString = Tcl_GetString(listObjv[x]);
+ XColor color;
+ int tmpr, tmpg, tmpb;
+
+ /*
+ * We do not use Tk_GetColorFromObj() because we absolutely do
+ * not want to invoke the fallback code.
+ */
+
+ if (colorString[0] == '#') {
+ if (isxdigit(UCHAR(colorString[1])) &&
+ isxdigit(UCHAR(colorString[2])) &&
+ isxdigit(UCHAR(colorString[3]))) {
+ if (colorString[4] == '\0') {
+ /* Got #rgb */
+ sscanf(colorString+1, "%1x%1x%1x",
+ &tmpr, &tmpg, &tmpb);
+ *pixelPtr++ = tmpr * 0x11;
+ *pixelPtr++ = tmpg * 0x11;
+ *pixelPtr++ = tmpb * 0x11;
+ continue;
+ } else if (isxdigit(UCHAR(colorString[4])) &&
+ isxdigit(UCHAR(colorString[5])) &&
+ isxdigit(UCHAR(colorString[6])) &&
+ colorString[7] == '\0') {
+ /* Got #rrggbb */
+ sscanf(colorString+1, "%2x%2x%2x",
+ &tmpr, &tmpg, &tmpb);
+ *pixelPtr++ = tmpr;
+ *pixelPtr++ = tmpg;
+ *pixelPtr++ = tmpb;
+ continue;
+ }
+ }
+ }
+
if (!XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin),
- listArgv[x], &color)) {
+ colorString, &color)) {
Tcl_AppendResult(interp, "can't parse color \"",
- listArgv[x], "\"", (char *) NULL);
+ colorString, "\"", NULL);
break;
}
*pixelPtr++ = color.red >> 8;
*pixelPtr++ = color.green >> 8;
*pixelPtr++ = color.blue >> 8;
}
- ckfree((char *) listArgv);
if (x < dataWidth) {
break;
}
}
- ckfree((char *) srcArgv);
if (y < dataHeight || dataHeight == 0 || dataWidth == 0) {
if (block.pixelPtr != NULL) {
ckfree((char *) block.pixelPtr);
@@ -1177,8 +1185,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
/*
- * Fill in default values for the -to option, then
- * copy the block in using Tk_PhotoPutBlock.
+ * Fill in default values for the -to option, then copy the block in
+ * using Tk_PhotoPutBlock.
*/
if (!(options.options & OPT_TO) || (options.toX2 < 0)) {
@@ -1193,11 +1201,12 @@ ImgPhotoCmd(clientData, interp, objc, objv)
block.offset[1] = 1;
block.offset[2] = 2;
block.offset[3] = 0;
- Tk_PhotoPutBlock((ClientData)masterPtr, &block,
+ result = Tk_PhotoPutBlock(interp, (ClientData)masterPtr, &block,
options.toX, options.toY, options.toX2 - options.toX,
- options.toY2 - options.toY, TK_PHOTO_COMPOSITE_SET);
+ options.toY2 - options.toY,
+ TK_PHOTO_COMPOSITE_SET);
ckfree((char *) block.pixelPtr);
- return TCL_OK;
+ return result;
case PHOTO_READ: {
Tcl_Obj *format;
@@ -1207,7 +1216,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
index = 2;
- memset((VOID *) &options, 0, sizeof(options));
+ memset(&options, 0, sizeof(options));
options.name = NULL;
options.format = NULL;
if (ParseSubcommandOptions(&options, interp,
@@ -1220,16 +1229,16 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
- /*
- * Prevent file system access in safe interpreters.
- */
+ /*
+ * Prevent file system access in safe interpreters.
+ */
+
+ if (Tcl_IsSafe(interp)) {
+ Tcl_AppendResult(interp, "can't get image from a file in a",
+ " safe interpreter", NULL);
+ return TCL_ERROR;
+ }
- if (Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't get image from a file in a",
- " safe interpreter", (char *) NULL);
- return TCL_ERROR;
- }
-
/*
* Open the image file and look for a handler for it.
*/
@@ -1239,17 +1248,17 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (chan == NULL) {
return TCL_ERROR;
}
- if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
+ if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
!= TCL_OK) {
Tcl_Close(NULL, chan);
- return TCL_ERROR;
- }
- if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
+ return TCL_ERROR;
+ }
+ if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
!= TCL_OK) {
Tcl_Close(NULL, chan);
- return TCL_ERROR;
- }
-
+ return TCL_ERROR;
+ }
+
if (MatchFileFormat(interp, chan,
Tcl_GetString(options.name), options.format, &imageFormat,
&imageWidth, &imageHeight, &oldformat) != TCL_OK) {
@@ -1265,7 +1274,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
|| (options.fromX2 > imageWidth)
|| (options.fromY2 > imageHeight)) {
Tcl_AppendResult(interp, "coordinates for -from option extend ",
- "outside source image", (char *) NULL);
+ "outside source image", NULL);
Tcl_Close(NULL, chan);
return TCL_ERROR;
}
@@ -1285,15 +1294,14 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (ImgPhotoSetSize(masterPtr, options.toX + width,
options.toY + height) != TCL_OK) {
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
return TCL_ERROR;
}
}
/*
- * Call the handler's file read procedure to read the data
- * into the image.
+ * Call the handler's file read function to read the data into the
+ * image.
*/
format = options.format;
@@ -1312,13 +1320,13 @@ ImgPhotoCmd(clientData, interp, objc, objv)
case PHOTO_REDITHER:
if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
/*
- * Call Dither if any part of the image is not correctly
- * dithered at present.
+ * Call Dither if any part of the image is not correctly dithered at
+ * present.
*/
x = masterPtr->ditherX;
@@ -1346,8 +1354,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_OK;
case PHOTO_TRANS: {
- static CONST char *photoTransOptions[] = {
- "get", "set", (char *) NULL
+ static const char *photoTransOptions[] = {
+ "get", "set", NULL
};
enum transOptions {
PHOTO_TRANS_GET, PHOTO_TRANS_SET
@@ -1378,8 +1386,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if ((x < 0) || (x >= masterPtr->width)
|| (y < 0) || (y >= masterPtr->height)) {
Tcl_AppendResult(interp, Tcl_GetString(objv[0]),
- " transparency get: coordinates out of range",
- (char *) NULL);
+ " transparency get: coordinates out of range", NULL);
return TCL_ERROR;
}
@@ -1416,8 +1423,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if ((x < 0) || (x >= masterPtr->width)
|| (y < 0) || (y >= masterPtr->height)) {
Tcl_AppendResult(interp, Tcl_GetString(objv[0]),
- " transparency set: coordinates out of range",
- (char *) NULL);
+ " transparency set: coordinates out of range", NULL);
return TCL_ERROR;
}
@@ -1431,20 +1437,24 @@ ImgPhotoCmd(clientData, interp, objc, objv)
/*
* Make pixel transparent.
*/
+
TkRegion clearRegion = TkCreateRegion();
TkUnionRectWithRegion(&setBox, clearRegion, clearRegion);
TkSubtractRegion(masterPtr->validRegion, clearRegion,
masterPtr->validRegion);
TkDestroyRegion(clearRegion);
+
/*
* Set the alpha value correctly.
*/
+
pixelPtr[3] = 0;
} else {
/*
* Make pixel opaque.
*/
+
TkUnionRectWithRegion(&setBox, masterPtr->validRegion,
masterPtr->validRegion);
pixelPtr[3] = 255;
@@ -1460,31 +1470,31 @@ ImgPhotoCmd(clientData, interp, objc, objv)
masterPtr->flags &= ~IMAGE_CHANGED;
return TCL_OK;
}
- }
- panic("unexpected fallthrough");
+ }
+ Tcl_Panic("unexpected fallthrough");
}
case PHOTO_WRITE: {
char *data;
Tcl_Obj *format;
- /*
- * Prevent file system access in safe interpreters.
- */
+ /*
+ * Prevent file system access in safe interpreters.
+ */
+
+ if (Tcl_IsSafe(interp)) {
+ Tcl_AppendResult(interp, "can't write image to a file in a",
+ " safe interpreter", NULL);
+ return TCL_ERROR;
+ }
- if (Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't write image to a file in a",
- " safe interpreter", (char *) NULL);
- return TCL_ERROR;
- }
-
/*
* photo write command - first parse and check any options given.
*/
index = 2;
- memset((VOID *) &options, 0, sizeof(options));
+ memset(&options, 0, sizeof(options));
options.name = NULL;
options.format = NULL;
if (ParseSubcommandOptions(&options, interp,
@@ -1501,7 +1511,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
|| (options.fromX2 > masterPtr->width)
|| (options.fromY2 > masterPtr->height)) {
Tcl_AppendResult(interp, "coordinates for -from option extend ",
- "outside image", (char *) NULL);
+ "outside image", NULL);
return TCL_ERROR;
}
@@ -1515,8 +1525,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
/*
- * Search for an appropriate image file format handler,
- * and give an error if none is found.
+ * Search for an appropriate image file format handler, and give an
+ * error if none is found.
*/
matched = 0;
@@ -1548,23 +1558,21 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (imageFormat == NULL) {
if (options.format == NULL) {
Tcl_AppendResult(interp, "no available image file format ",
- "has file writing capability", (char *) NULL);
+ "has file writing capability", NULL);
} else if (!matched) {
Tcl_AppendResult(interp, "image file format \"",
Tcl_GetString(options.format),
- "\" is unknown", (char *) NULL);
+ "\" is unknown", NULL);
} else {
Tcl_AppendResult(interp, "image file format \"",
Tcl_GetString(options.format),
- "\" has no file writing capability",
- (char *) NULL);
+ "\" has no file writing capability", NULL);
}
return TCL_ERROR;
}
/*
- * Call the handler's file write procedure to write out
- * the image.
+ * Call the handler's file write function to write out the image.
*/
data = ImgGetPhoto(masterPtr, &block, &options);
@@ -1584,7 +1592,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
}
- panic("unexpected fallthrough");
+ Tcl_Panic("unexpected fallthrough");
return TCL_ERROR; /* NOT REACHED */
}
@@ -1593,10 +1601,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*
* ParseSubcommandOptions --
*
- * This procedure is invoked to process one of the options
- * which may be specified for the photo image subcommands,
- * namely, -from, -to, -zoom, -subsample, -format, -shrink,
- * and -compositingrule.
+ * This function is invoked to process one of the options which may be
+ * specified for the photo image subcommands, namely, -from, -to, -zoom,
+ * -subsample, -format, -shrink, and -compositingrule.
*
* Results:
* A standard Tcl result.
@@ -1608,29 +1615,27 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
static int
-ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
- struct SubcommandOptions *optPtr;
- /* Information about the options specified
- * and the values given is returned here. */
- Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
- int allowedOptions; /* Indicates which options are valid for
- * the current command. */
- int *optIndexPtr; /* Points to a variable containing the
- * current index in objv; this variable is
- * updated by this procedure. */
- int objc; /* Number of arguments in objv[]. */
- Tcl_Obj *CONST objv[]; /* Arguments to be parsed. */
+ParseSubcommandOptions(
+ struct SubcommandOptions *optPtr,
+ /* Information about the options specified and
+ * the values given is returned here. */
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
+ int allowedOptions, /* Indicates which options are valid for the
+ * current command. */
+ int *optIndexPtr, /* Points to a variable containing the current
+ * index in objv; this variable is updated by
+ * this function. */
+ int objc, /* Number of arguments in objv[]. */
+ Tcl_Obj *const objv[]) /* Arguments to be parsed. */
{
- int index, c, bit, currentBit;
- int length;
+ int index, c, bit, currentBit, length;
+ int values[4], numValues, maxValues, argIndex;
char *option, **listPtr;
- int values[4];
- int numValues, maxValues, argIndex;
for (index = *optIndexPtr; index < objc; *optIndexPtr = ++index) {
/*
- * We can have one value specified without an option;
- * it goes into optPtr->name.
+ * We can have one value specified without an option; it goes into
+ * optPtr->name.
*/
option = Tcl_GetStringFromObj(objv[index], &length);
@@ -1662,24 +1667,24 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
}
/*
- * If this option is not recognized and allowed, put
- * an error message in the interpreter and return.
+ * If this option is not recognized and allowed, put an error message
+ * in the interpreter and return.
*/
if ((allowedOptions & bit) == 0) {
Tcl_AppendResult(interp, "unrecognized option \"",
Tcl_GetString(objv[index]),
- "\": must be ", (char *)NULL);
+ "\": must be ", NULL);
bit = 1;
for (listPtr = optionNames; *listPtr != NULL; ++listPtr) {
if ((allowedOptions & bit) != 0) {
if ((allowedOptions & (bit - 1)) != 0) {
- Tcl_AppendResult(interp, ", ", (char *) NULL);
+ Tcl_AppendResult(interp, ", ", NULL);
if ((allowedOptions & ~((bit << 1) - 1)) == 0) {
- Tcl_AppendResult(interp, "or ", (char *) NULL);
+ Tcl_AppendResult(interp, "or ", NULL);
}
}
- Tcl_AppendResult(interp, *listPtr, (char *) NULL);
+ Tcl_AppendResult(interp, *listPtr, NULL);
}
bit <<= 1;
}
@@ -1687,9 +1692,8 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
}
/*
- * For the -from, -to, -zoom and -subsample options,
- * parse the values given. Report an error if too few
- * or too many values are given.
+ * For the -from, -to, -zoom and -subsample options, parse the values
+ * given. Report an error if too few or too many values are given.
*/
if (bit == OPT_BACKGROUND) {
@@ -1706,14 +1710,13 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
}
} else {
Tcl_AppendResult(interp, "the \"-background\" option ",
- "requires a value", (char *) NULL);
+ "requires a value", NULL);
return TCL_ERROR;
}
} else if (bit == OPT_FORMAT) {
/*
- * The -format option takes a single string value. Note
- * that parsing this is outside the scope of this
- * function.
+ * The -format option takes a single string value. Note that
+ * parsing this is outside the scope of this function.
*/
if (index + 1 < objc) {
@@ -1721,13 +1724,13 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
optPtr->format = objv[index];
} else {
Tcl_AppendResult(interp, "the \"-format\" option ",
- "requires a value", (char *) NULL);
+ "requires a value", NULL);
return TCL_ERROR;
}
} else if (bit == OPT_COMPOSITE) {
/*
- * The -compositingrule option takes a single value from
- * a well-known set.
+ * The -compositingrule option takes a single value from a
+ * well-known set.
*/
if (index + 1 < objc) {
@@ -1735,9 +1738,9 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
* Note that these must match the TK_PHOTO_COMPOSITE_*
* constants.
*/
- static CONST char *compositingRules[] = {
- "overlay", "set",
- NULL
+
+ static const char *compositingRules[] = {
+ "overlay", "set", NULL
};
index++;
@@ -1749,7 +1752,7 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
*optIndexPtr = index;
} else {
Tcl_AppendResult(interp, "the \"-compositingrule\" option ",
- "requires a value", (char *) NULL);
+ "requires a value", NULL);
return TCL_ERROR;
}
} else if ((bit != OPT_SHRINK) && (bit != OPT_GRAYSCALE)) {
@@ -1760,7 +1763,7 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
if (argIndex >= objc) {
break;
}
- val = Tcl_GetString(objv[argIndex]);
+ val = Tcl_GetString(objv[argIndex]);
if ((argIndex < objc) && (isdigit(UCHAR(val[0]))
|| ((val[0] == '-') && isdigit(UCHAR(val[1]))))) {
if (Tcl_GetInt(interp, val, &values[numValues])
@@ -1776,7 +1779,7 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
if (numValues == 0) {
Tcl_AppendResult(interp, "the \"", option, "\" option ",
"requires one ", maxValues == 2? "or two": "to four",
- " integer values", (char *) NULL);
+ " integer values", NULL);
return TCL_ERROR;
}
*optIndexPtr = (index += numValues);
@@ -1793,62 +1796,62 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
}
/*
- * Check the values given and put them in the appropriate
- * field of the SubcommandOptions structure.
+ * Check the values given and put them in the appropriate field of
+ * the SubcommandOptions structure.
*/
switch (bit) {
- case OPT_FROM:
- if ((values[0] < 0) || (values[1] < 0) || ((numValues > 2)
- && ((values[2] < 0) || (values[3] < 0)))) {
- Tcl_AppendResult(interp, "value(s) for the -from",
- " option must be non-negative", (char *) NULL);
- return TCL_ERROR;
- }
- if (numValues <= 2) {
- optPtr->fromX = values[0];
- optPtr->fromY = values[1];
- optPtr->fromX2 = -1;
- optPtr->fromY2 = -1;
- } else {
- optPtr->fromX = MIN(values[0], values[2]);
- optPtr->fromY = MIN(values[1], values[3]);
- optPtr->fromX2 = MAX(values[0], values[2]);
- optPtr->fromY2 = MAX(values[1], values[3]);
- }
- break;
- case OPT_SUBSAMPLE:
- optPtr->subsampleX = values[0];
- optPtr->subsampleY = values[1];
- break;
- case OPT_TO:
- if ((values[0] < 0) || (values[1] < 0) || ((numValues > 2)
- && ((values[2] < 0) || (values[3] < 0)))) {
- Tcl_AppendResult(interp, "value(s) for the -to",
- " option must be non-negative", (char *) NULL);
- return TCL_ERROR;
- }
- if (numValues <= 2) {
- optPtr->toX = values[0];
- optPtr->toY = values[1];
- optPtr->toX2 = -1;
- optPtr->toY2 = -1;
- } else {
- optPtr->toX = MIN(values[0], values[2]);
- optPtr->toY = MIN(values[1], values[3]);
- optPtr->toX2 = MAX(values[0], values[2]);
- optPtr->toY2 = MAX(values[1], values[3]);
- }
- break;
- case OPT_ZOOM:
- if ((values[0] <= 0) || (values[1] <= 0)) {
- Tcl_AppendResult(interp, "value(s) for the -zoom",
- " option must be positive", (char *) NULL);
- return TCL_ERROR;
- }
- optPtr->zoomX = values[0];
- optPtr->zoomY = values[1];
- break;
+ case OPT_FROM:
+ if ((values[0] < 0) || (values[1] < 0) || ((numValues > 2)
+ && ((values[2] < 0) || (values[3] < 0)))) {
+ Tcl_AppendResult(interp, "value(s) for the -from",
+ " option must be non-negative", NULL);
+ return TCL_ERROR;
+ }
+ if (numValues <= 2) {
+ optPtr->fromX = values[0];
+ optPtr->fromY = values[1];
+ optPtr->fromX2 = -1;
+ optPtr->fromY2 = -1;
+ } else {
+ optPtr->fromX = MIN(values[0], values[2]);
+ optPtr->fromY = MIN(values[1], values[3]);
+ optPtr->fromX2 = MAX(values[0], values[2]);
+ optPtr->fromY2 = MAX(values[1], values[3]);
+ }
+ break;
+ case OPT_SUBSAMPLE:
+ optPtr->subsampleX = values[0];
+ optPtr->subsampleY = values[1];
+ break;
+ case OPT_TO:
+ if ((values[0] < 0) || (values[1] < 0) || ((numValues > 2)
+ && ((values[2] < 0) || (values[3] < 0)))) {
+ Tcl_AppendResult(interp, "value(s) for the -to",
+ " option must be non-negative", NULL);
+ return TCL_ERROR;
+ }
+ if (numValues <= 2) {
+ optPtr->toX = values[0];
+ optPtr->toY = values[1];
+ optPtr->toX2 = -1;
+ optPtr->toY2 = -1;
+ } else {
+ optPtr->toX = MIN(values[0], values[2]);
+ optPtr->toY = MIN(values[1], values[3]);
+ optPtr->toX2 = MAX(values[0], values[2]);
+ optPtr->toY2 = MAX(values[1], values[3]);
+ }
+ break;
+ case OPT_ZOOM:
+ if ((values[0] <= 0) || (values[1] <= 0)) {
+ Tcl_AppendResult(interp, "value(s) for the -zoom",
+ " option must be positive", NULL);
+ return TCL_ERROR;
+ }
+ optPtr->zoomX = values[0];
+ optPtr->zoomY = values[1];
+ break;
}
}
@@ -1867,45 +1870,42 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
*
* ImgPhotoConfigureMaster --
*
- * This procedure is called when a photo image is created or
- * reconfigured. It processes configuration options and resets
- * any instances of the image.
+ * This function is called when a photo image is created or reconfigured.
+ * It processes configuration options and resets any instances of the
+ * image.
*
* Results:
- * A standard Tcl return value. If TCL_ERROR is returned then
- * an error message is left in the masterPtr->interp's result.
+ * A standard Tcl return value. If TCL_ERROR is returned then an error
+ * message is left in the masterPtr->interp's result.
*
* Side effects:
- * Existing instances of the image will be redisplayed to match
- * the new configuration options.
+ * Existing instances of the image will be redisplayed to match the new
+ * configuration options.
*
*----------------------------------------------------------------------
*/
static int
-ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
- PhotoMaster *masterPtr; /* Pointer to data structure describing
+ImgPhotoConfigureMaster(
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
+ PhotoMaster *masterPtr, /* Pointer to data structure describing
* overall photo image to (re)configure. */
- int objc; /* Number of entries in objv. */
- Tcl_Obj *CONST objv[]; /* Pairs of configuration options for image. */
- int flags; /* Flags to pass to Tk_ConfigureWidget,
- * such as TK_CONFIG_ARGV_ONLY. */
+ int objc, /* Number of entries in objv. */
+ Tcl_Obj *const objv[], /* Pairs of configuration options for image. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget, such
+ * as TK_CONFIG_ARGV_ONLY. */
{
PhotoInstance *instancePtr;
- CONST char *oldFileString, *oldPaletteString;
+ const char *oldFileString, *oldPaletteString;
Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL;
- int length, i, j;
+ Tcl_Obj *tempdata, *tempformat;
+ int length, i, j, result, imageWidth, imageHeight, oldformat;
double oldGamma;
- int result;
Tcl_Channel chan;
Tk_PhotoImageFormat *imageFormat;
- int imageWidth, imageHeight;
- CONST char **args;
- int oldformat;
- Tcl_Obj *tempdata, *tempformat;
+ const char **args;
- args = (CONST char **) ckalloc((objc + 1) * sizeof(char *));
+ args = (const char **) ckalloc((objc + 1) * sizeof(char *));
for (i = 0, j = 0; i < objc; i++,j++) {
args[j] = Tcl_GetStringFromObj(objv[i], &length);
if ((length > 1) && (args[j][0] == '-')) {
@@ -1916,7 +1916,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
j--;
} else {
Tcl_AppendResult(interp,
- "value for \"-data\" missing", (char *) NULL);
+ "value for \"-data\" missing", NULL);
return TCL_ERROR;
}
} else if ((args[j][1] == 'f') &&
@@ -1926,7 +1926,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
j--;
} else {
Tcl_AppendResult(interp,
- "value for \"-format\" missing", (char *) NULL);
+ "value for \"-format\" missing", NULL);
return TCL_ERROR;
}
}
@@ -1934,12 +1934,10 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
/*
- * Save the current values for fileString and dataString, so we
- * can tell if the user specifies them anew.
- * IMPORTANT: if the format changes we have to interpret
- * "-file" and "-data" again as well!!!!!!! It might be
- * that the format string influences how "-data" or "-file"
- * is interpreted.
+ * Save the current values for fileString and dataString, so we can tell
+ * if the user specifies them anew. IMPORTANT: if the format changes we
+ * have to interpret "-file" and "-data" again as well! It might be that
+ * the format string influences how "-data" or "-file" is interpreted.
*/
oldFileString = masterPtr->fileString;
@@ -1970,8 +1968,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
ckfree((char *) args);
/*
- * Regard the empty string for -file, -data or -format as the null
- * value.
+ * Regard the empty string for -file, -data or -format as the null value.
*/
if ((masterPtr->fileString != NULL) && (masterPtr->fileString[0] == 0)) {
@@ -1980,9 +1977,10 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
if (data) {
/*
- * Force into ByteArray format, which most (all) image handlers
- * will use anyway. Empty length means ignore the -data option.
+ * Force into ByteArray format, which most (all) image handlers will
+ * use anyway. Empty length means ignore the -data option.
*/
+
(void) Tcl_GetByteArrayFromObj(data, &length);
if (length) {
Tcl_IncrRefCount(data);
@@ -1996,9 +1994,10 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
if (format) {
/*
- * Stringify to ignore -format "". It may come in as a list or
- * other object.
+ * Stringify to ignore -format "". It may come in as a list or other
+ * object.
*/
+
(void) Tcl_GetStringFromObj(format, &length);
if (length) {
Tcl_IncrRefCount(format);
@@ -2011,47 +2010,47 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
masterPtr->format = format;
}
/*
- * Set the image to the user-requested size, if any,
- * and make sure storage is correctly allocated for this image.
+ * Set the image to the user-requested size, if any, and make sure storage
+ * is correctly allocated for this image.
*/
if (ImgPhotoSetSize(masterPtr, masterPtr->width,
masterPtr->height) != TCL_OK) {
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
goto errorExit;
}
/*
- * Read in the image from the file or string if the user has
- * specified the -file or -data option.
+ * Read in the image from the file or string if the user has specified the
+ * -file or -data option.
*/
if ((masterPtr->fileString != NULL)
&& ((masterPtr->fileString != oldFileString)
|| (masterPtr->format != oldFormat))) {
- /*
- * Prevent file system access in a safe interpreter.
- */
+ /*
+ * Prevent file system access in a safe interpreter.
+ */
- if (Tcl_IsSafe(interp)) {
+ if (Tcl_IsSafe(interp)) {
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "can't get image from a file in a safe interpreter",
- (char *) NULL);
+ Tcl_AppendResult(interp,
+ "can't get image from a file in a safe interpreter", NULL);
goto errorExit;
- }
-
+ }
+
chan = Tcl_OpenFileChannel(interp, masterPtr->fileString, "r", 0);
if (chan == NULL) {
goto errorExit;
}
+
/*
* -translation binary also sets -encoding binary
*/
- if ((Tcl_SetChannelOption(interp, chan,
+
+ if ((Tcl_SetChannelOption(interp, chan,
"-translation", "binary") != TCL_OK) ||
(MatchFileFormat(interp, chan, masterPtr->fileString,
masterPtr->format, &imageFormat, &imageWidth,
@@ -2063,8 +2062,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
if (result != TCL_OK) {
Tcl_Close(NULL, chan);
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
goto errorExit;
}
tempformat = masterPtr->format;
@@ -2072,9 +2070,8 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
tempformat = (Tcl_Obj *) Tcl_GetString(tempformat);
}
result = (*imageFormat->fileReadProc)(interp, chan,
- masterPtr->fileString, tempformat,
- (Tk_PhotoHandle) masterPtr, 0, 0,
- imageWidth, imageHeight, 0, 0);
+ masterPtr->fileString, tempformat, (Tk_PhotoHandle) masterPtr,
+ 0, 0, imageWidth, imageHeight, 0, 0);
Tcl_Close(NULL, chan);
if (result != TCL_OK) {
goto errorExit;
@@ -2095,8 +2092,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
if (ImgPhotoSetSize(masterPtr, imageWidth, imageHeight) != TCL_OK) {
Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
goto errorExit;
}
tempformat = masterPtr->format;
@@ -2131,9 +2127,9 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
/*
- * Cycle through all of the instances of this image, regenerating
- * the information for each instance. Then force the image to be
- * redisplayed everywhere that it is used.
+ * Cycle through all of the instances of this image, regenerating the
+ * information for each instance. Then force the image to be redisplayed
+ * everywhere that it is used.
*/
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
@@ -2142,8 +2138,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
}
/*
- * Inform the generic image code that the image
- * has (potentially) changed.
+ * Inform the generic image code that the image has (potentially) changed.
*/
Tk_ImageChanged(masterPtr->tkMaster, 0, 0, masterPtr->width,
@@ -2176,24 +2171,24 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
*
* ImgPhotoConfigureInstance --
*
- * This procedure 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.
+ * 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.
+ * Generates errors via Tcl_BackgroundError if there are problems in
+ * setting up the instance.
*
*----------------------------------------------------------------------
*/
static void
-ImgPhotoConfigureInstance(instancePtr)
- PhotoInstance *instancePtr; /* Instance to reconfigure. */
+ImgPhotoConfigureInstance(
+ PhotoInstance *instancePtr) /* Instance to reconfigure. */
{
PhotoMaster *masterPtr = instancePtr->masterPtr;
XImage *imagePtr;
@@ -2202,10 +2197,9 @@ ImgPhotoConfigureInstance(instancePtr)
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 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])
@@ -2217,9 +2211,9 @@ ImgPhotoConfigureInstance(instancePtr)
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.
+ * 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;
@@ -2238,8 +2232,8 @@ ImgPhotoConfigureInstance(instancePtr)
GetColorTable(instancePtr);
/*
- * Create a new XImage structure for sending data to
- * the X server, if necessary.
+ * Create a new XImage structure for sending data to the X server, if
+ * necessary.
*/
if (instancePtr->colorTablePtr->flags & BLACK_AND_WHITE) {
@@ -2255,7 +2249,7 @@ ImgPhotoConfigureInstance(instancePtr)
}
imagePtr = XCreateImage(instancePtr->display,
instancePtr->visualInfo.visual, (unsigned) bitsPerPixel,
- (bitsPerPixel > 1? ZPixmap: XYBitmap), 0, (char *) NULL,
+ (bitsPerPixel > 1? ZPixmap: XYBitmap), 0, NULL,
1, 1, 32, 0);
instancePtr->imagePtr = imagePtr;
@@ -2278,11 +2272,10 @@ ImgPhotoConfigureInstance(instancePtr)
}
/*
- * 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 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)
@@ -2310,62 +2303,60 @@ ImgPhotoConfigureInstance(instancePtr)
*
* ImgPhotoGet --
*
- * This procedure is called for each use of a photo image in a
- * widget.
+ * 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.
+ * 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).
+ * A data structure is set up for the instance (or, an existing instance
+ * is re-used for the new one).
*
*----------------------------------------------------------------------
*/
static ClientData
-ImgPhotoGet(tkwin, masterData)
- Tk_Window tkwin; /* Window in which the instance will be
+ImgPhotoGet(
+ Tk_Window tkwin, /* Window in which the instance will be
* used. */
- ClientData masterData; /* Pointer to our master structure for the
+ ClientData masterData) /* Pointer to our master structure for the
* image. */
{
PhotoMaster *masterPtr = (PhotoMaster *) masterData;
PhotoInstance *instancePtr;
Colormap colormap;
- int mono, nRed, nGreen, nBlue;
+ int mono, nRed, nGreen, nBlue, numVisuals;
XVisualInfo visualInfo, *visInfoPtr;
char buf[TCL_INTEGER_SPACE * 3];
- int numVisuals;
XColor *white, *black;
XGCValues gcValues;
/*
- * Table of "best" choices for palette for PseudoColor displays
- * with between 3 and 15 bits/pixel.
+ * Table of "best" choices for palette for PseudoColor displays with
+ * between 3 and 15 bits/pixel.
*/
- static int paletteChoice[13][3] = {
+ 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 */}
+ {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.
+ * See if there is already an instance for windows using the same
+ * colormap. If so then just re-use it.
*/
colormap = Tk_Colormap(tkwin);
@@ -2373,7 +2364,6 @@ ImgPhotoGet(tkwin, masterData)
instancePtr = instancePtr->nextPtr) {
if ((colormap == instancePtr->colormap)
&& (Tk_Display(tkwin) == instancePtr->display)) {
-
/*
* Re-use this instance.
*/
@@ -2395,8 +2385,8 @@ ImgPhotoGet(tkwin, masterData)
}
/*
- * The image isn't already in use in a window with the same colormap.
- * Make a new instance of the image.
+ * 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));
@@ -2415,53 +2405,51 @@ ImgPhotoGet(tkwin, masterData)
masterPtr->instancePtr = instancePtr;
/*
- * Obtain information about the visual and decide on the
- * default palette.
+ * 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;
- if (visInfoPtr != NULL) {
- 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) {
- 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);
-
- } else {
- panic("ImgPhotoGet couldn't find visual for window");
- }
+ 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);
@@ -2483,8 +2471,8 @@ ImgPhotoGet(tkwin, masterData)
GCForeground|GCBackground|GCGraphicsExposures, &gcValues);
/*
- * Set configuration options and finish the initialization of the instance.
- * This will also dither the image if necessary.
+ * Set configuration options and finish the initialization of the
+ * instance. This will also dither the image if necessary.
*/
ImgPhotoConfigureInstance(instancePtr);
@@ -2506,9 +2494,9 @@ ImgPhotoGet(tkwin, masterData)
*
* ToggleComplexAlphaIfNeeded --
*
- * This procedure is called when an image is modified to
- * check if any partially transparent pixels exist, which
- * requires blending instead of straight copy.
+ * This function is called when an image is modified to check if any
+ * partially transparent pixels exist, which requires blending instead of
+ * straight copy.
*
* Results:
* None.
@@ -2520,19 +2508,21 @@ ImgPhotoGet(tkwin, masterData)
*/
static int
-ToggleComplexAlphaIfNeeded(PhotoMaster *mPtr)
+ToggleComplexAlphaIfNeeded(
+ PhotoMaster *mPtr)
{
size_t len = MAX(mPtr->userWidth, mPtr->width) *
- MAX(mPtr->userHeight, mPtr->height) * 4;
- unsigned char *c = mPtr->pix32;
+ MAX(mPtr->userHeight, mPtr->height) * 4;
+ unsigned char *c = mPtr->pix32;
unsigned char *end = c + len;
/*
* Set the COMPLEX_ALPHA flag if we have an image with partially
* transparent bits.
*/
+
mPtr->flags &= ~COMPLEX_ALPHA;
- c += 3; /* start at first alpha byte */
+ c += 3; /* Start at first alpha byte. */
for (; c < end; c += 4) {
if (*c && *c != 255) {
mPtr->flags |= COMPLEX_ALPHA;
@@ -2547,8 +2537,13 @@ ToggleComplexAlphaIfNeeded(PhotoMaster *mPtr)
*
* ImgPhotoBlendComplexAlpha --
*
- * This procedure is called when an image with partially
- * transparent pixels must be drawn over another image.
+ * 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.
@@ -2556,53 +2551,61 @@ ToggleComplexAlphaIfNeeded(PhotoMaster *mPtr)
* Side effects:
* Background image passed in gets drawn over with image data.
*
- *----------------------------------------------------------------------
- */
-
-/*
- * 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+.
+ * 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.
*
- * 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)))
+#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(bgImg, iPtr, xOffset, yOffset, width, height)
- XImage *bgImg; /* background image to draw on */
- PhotoInstance *iPtr; /* image instance to draw */
- int xOffset, yOffset; /* X & Y offset into image instance to draw */
- int width, height; /* width & height of image to draw */
+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;
+ unsigned char r, g, b, alpha, unalpha, *masterPtr;
unsigned char *alphaAr = iPtr->masterPtr->pix32;
- unsigned char *masterPtr;
/*
- * 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.
+ * 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.
+ * 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__
@@ -2628,9 +2631,9 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
#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.
+ * 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))
@@ -2645,14 +2648,17 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
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];
@@ -2660,13 +2666,14 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
/*
* 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;
+ 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);
@@ -2684,14 +2691,17 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
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".
+ * 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];
@@ -2699,13 +2709,14 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
/*
* 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;
+ 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);
@@ -2714,7 +2725,6 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
}
}
}
-
#undef ALPHA_BLEND
}
@@ -2723,7 +2733,7 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
*
* ImgPhotoDisplay --
*
- * This procedure is invoked to draw a photo image.
+ * This function is invoked to draw a photo image.
*
* Results:
* None.
@@ -2735,48 +2745,31 @@ ImgPhotoBlendComplexAlpha(bgImg, iPtr, xOffset, yOffset, width, height)
*/
static void
-ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
- height, drawableX, drawableY)
- ClientData clientData; /* Pointer to PhotoInstance structure for
- * 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, imageY; /* Upper-left corner of region within image
- * to draw. */
- int width, height; /* Dimensions of region within image to draw. */
- int drawableX, drawableY; /* Coordinates within drawable that
- * correspond to imageX and imageY. */
+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 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;
}
- /*
- * Check for bogus widths/heights. This prevents us from calling
- * XGetImage with a zero size, which it does not like. [Bug 979239]
- */
-
- if (width < 1 || height < 1) {
- return;
- }
-
- if (
-#if defined(MAC_TCL)
- /*
- * The retrieval of bgImg is currently not functional on OS9
- * so skip attempts to alpha blend.
- */
- 0 &&
-#endif
- (instancePtr->masterPtr->flags & COMPLEX_ALPHA)
+ if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA)
&& visInfo.depth >= 15
&& (visInfo.class == DirectColor || visInfo.class == TrueColor)) {
Tk_ErrorHandler handler;
@@ -2786,11 +2779,14 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
* 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,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
+
+ 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) {
@@ -2798,13 +2794,14 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
return;
}
- ImgPhotoBlendComplexAlpha(bgImg, instancePtr,
- imageX, imageY, width, height);
+ ImgPhotoBlendComplexAlpha(bgImg, instancePtr, imageX, imageY, width,
+ height);
/*
- * Color info is unimportant as we only do this operation for
- * depth >= 15.
+ * 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);
@@ -2812,21 +2809,22 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
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.
+ * 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);
+
+ TkSetRegion(display, instancePtr->gc,
+ instancePtr->masterPtr->validRegion);
XSetClipOrigin(display, instancePtr->gc, drawableX - imageX,
- drawableY - imageY);
+ drawableY - imageY);
XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc,
- imageX, imageY, (unsigned) width, (unsigned) height,
- drawableX, drawableY);
+ imageX, imageY, (unsigned) width, (unsigned) height,
+ drawableX, drawableY);
XSetClipMask(display, instancePtr->gc, None);
XSetClipOrigin(display, instancePtr->gc, 0, 0);
}
- XFlush (display);
+ XFlush(display);
}
/*
@@ -2834,10 +2832,9 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
*
* ImgPhotoFree --
*
- * This procedure 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.
+ * 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.
@@ -2849,10 +2846,11 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
*/
static void
-ImgPhotoFree(clientData, display)
- ClientData clientData; /* Pointer to PhotoInstance structure for
- * for instance to be displayed. */
- Display *display; /* Display containing window that used image. */
+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;
@@ -2863,17 +2861,17 @@ ImgPhotoFree(clientData, display)
}
/*
- * 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.
+ * 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);
}
@@ -2882,8 +2880,8 @@ ImgPhotoFree(clientData, display)
*
* ImgPhotoDelete --
*
- * This procedure is called by the image code to delete the
- * master structure for an image.
+ * This function is called by the image code to delete the master
+ * structure for an image.
*
* Results:
* None.
@@ -2895,16 +2893,16 @@ ImgPhotoFree(clientData, display)
*/
static void
-ImgPhotoDelete(masterData)
- ClientData masterData; /* Pointer to PhotoMaster structure for
- * image. Must not have any more instances. */
+ImgPhotoDelete(
+ ClientData masterData) /* Pointer to PhotoMaster structure for image.
+ * Must not have any more instances. */
{
PhotoMaster *masterPtr = (PhotoMaster *) masterData;
PhotoInstance *instancePtr;
while ((instancePtr = masterPtr->instancePtr) != NULL) {
if (instancePtr->refCount > 0) {
- panic("tried to delete photo image when instances still exist");
+ Tcl_Panic("tried to delete photo image when instances still exist");
}
Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr);
DisposeInstance((ClientData) instancePtr);
@@ -2925,7 +2923,7 @@ ImgPhotoDelete(masterData)
if (masterPtr->format != NULL) {
Tcl_DecrRefCount(masterPtr->format);
}
- Tk_FreeOptions(configSpecs, (char *) masterPtr, (Display *) NULL, 0);
+ Tk_FreeOptions(configSpecs, (char *) masterPtr, NULL, 0);
ckfree((char *) masterPtr);
}
@@ -2934,8 +2932,8 @@ ImgPhotoDelete(masterData)
*
* ImgPhotoCmdDeletedProc --
*
- * This procedure is invoked when the image command for an image
- * is deleted. It deletes the image.
+ * This function is invoked when the image command for an image is
+ * deleted. It deletes the image.
*
* Results:
* None.
@@ -2947,8 +2945,8 @@ ImgPhotoDelete(masterData)
*/
static void
-ImgPhotoCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to PhotoMaster structure for
+ImgPhotoCmdDeletedProc(
+ ClientData clientData) /* Pointer to PhotoMaster structure for
* image. */
{
PhotoMaster *masterPtr = (PhotoMaster *) clientData;
@@ -2964,13 +2962,13 @@ ImgPhotoCmdDeletedProc(clientData)
*
* ImgPhotoSetSize --
*
- * This procedure reallocates the image storage and instance
- * pixmaps for a photo image, as necessary, to change the
- * image's size to `width' x `height' pixels.
+ * This function reallocates the image storage and instance pixmaps for a
+ * photo image, as necessary, to change the image's size to `width' x
+ * `height' pixels.
*
* Results:
- * TCL_OK if successful, TCL_ERROR if failure occurred (currently
- * just with memory allocation.)
+ * TCL_OK if successful, TCL_ERROR if failure occurred (currently just
+ * with memory allocation.)
*
* Side effects:
* Storage gets reallocated, for the master and all its instances.
@@ -2979,9 +2977,9 @@ ImgPhotoCmdDeletedProc(clientData)
*/
static int
-ImgPhotoSetSize(masterPtr, width, height)
- PhotoMaster *masterPtr;
- int width, height;
+ImgPhotoSetSize(
+ PhotoMaster *masterPtr,
+ int width, int height)
{
unsigned char *newPix32 = NULL;
int h, offset, pitch;
@@ -3000,19 +2998,22 @@ ImgPhotoSetSize(masterPtr, width, height)
pitch = width * 4;
/*
- * Test if we're going to (re)allocate the main buffer now, so
- * that any failures will leave the photo unchanged.
+ * Test if we're going to (re)allocate the main buffer now, so that any
+ * failures will leave the photo unchanged.
*/
+
if ((width != masterPtr->width) || (height != masterPtr->height)
|| (masterPtr->pix32 == NULL)) {
/*
* Not a u-long, but should be one.
*/
+
unsigned /*long*/ newPixSize = (unsigned /*long*/) (height * pitch);
/*
* Some mallocs() really hate allocating zero bytes. [Bug 619544]
*/
+
if (newPixSize == 0) {
newPix32 = NULL;
} else {
@@ -3024,8 +3025,8 @@ ImgPhotoSetSize(masterPtr, width, height)
}
/*
- * We have to trim the valid region if it is currently
- * larger than the new image size.
+ * We have to trim the valid region if it is currently larger than the new
+ * image size.
*/
TkClipBox(masterPtr->validRegion, &validBox);
@@ -3044,36 +3045,35 @@ ImgPhotoSetSize(masterPtr, width, height)
}
/*
- * Use the reallocated storage (allocation above) for the 32-bit
- * image and copy over valid regions. Note that this test is true
- * precisely when the allocation has already been done.
+ * Use the reallocated storage (allocation above) for the 32-bit image and
+ * copy over valid regions. Note that this test is true precisely when the
+ * allocation has already been done.
*/
+
if (newPix32 != NULL) {
/*
- * Zero the new array. The dithering code shouldn't read the
- * areas outside validBox, but they might be copied to another
- * photo image or written to a file.
+ * Zero the new array. The dithering code shouldn't read the areas
+ * outside validBox, but they might be copied to another photo image
+ * or written to a file.
*/
if ((masterPtr->pix32 != NULL)
&& ((width == masterPtr->width) || (width == validBox.width))) {
if (validBox.y > 0) {
- memset((VOID *) newPix32, 0, (size_t) (validBox.y * pitch));
+ memset(newPix32, 0, (size_t) (validBox.y * pitch));
}
h = validBox.y + validBox.height;
if (h < height) {
- memset((VOID *) (newPix32 + h * pitch), 0,
- (size_t) ((height - h) * pitch));
+ memset(newPix32 + h*pitch, 0, (size_t) ((height - h) * pitch));
}
} else {
- memset((VOID *) newPix32, 0, (size_t) (height * pitch));
+ memset(newPix32, 0, (size_t) (height * pitch));
}
if (masterPtr->pix32 != NULL) {
-
/*
- * Copy the common area over to the new array array and
- * free the old array.
+ * Copy the common area over to the new array array and free the
+ * old array.
*/
if (width == masterPtr->width) {
@@ -3083,12 +3083,10 @@ ImgPhotoSetSize(masterPtr, width, height)
*/
offset = validBox.y * pitch;
- memcpy((VOID *) (newPix32 + offset),
- (VOID *) (masterPtr->pix32 + offset),
+ memcpy(newPix32 + offset, masterPtr->pix32 + offset,
(size_t) (validBox.height * pitch));
} else if ((validBox.width > 0) && (validBox.height > 0)) {
-
/*
* Area to be copied is not contiguous - copy line by line.
*/
@@ -3097,8 +3095,7 @@ ImgPhotoSetSize(masterPtr, width, height)
srcPtr = masterPtr->pix32 + (validBox.y * masterPtr->width
+ validBox.x) * 4;
for (h = validBox.height; h > 0; h--) {
- memcpy((VOID *) destPtr, (VOID *) srcPtr,
- (size_t) (validBox.width * 4));
+ memcpy(destPtr, srcPtr, (size_t) (validBox.width * 4));
destPtr += width * 4;
srcPtr += masterPtr->width * 4;
}
@@ -3112,8 +3109,8 @@ ImgPhotoSetSize(masterPtr, width, height)
masterPtr->height = height;
/*
- * Dithering will be correct up to the end of the last
- * pre-existing complete scanline.
+ * Dithering will be correct up to the end of the last pre-existing
+ * complete scanline.
*/
if ((validBox.x > 0) || (validBox.y > 0)) {
@@ -3150,9 +3147,9 @@ ImgPhotoSetSize(masterPtr, width, height)
*
* ImgPhotoInstanceSetSize --
*
- * This procedure 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.
+ * 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.
@@ -3164,13 +3161,11 @@ ImgPhotoSetSize(masterPtr, width, height)
*/
static void
-ImgPhotoInstanceSetSize(instancePtr)
- PhotoInstance *instancePtr; /* Instance whose size is to be
- * changed. */
+ImgPhotoInstanceSetSize(
+ PhotoInstance *instancePtr) /* Instance whose size is to be changed. */
{
PhotoMaster *masterPtr;
- schar *newError;
- schar *errSrcPtr, *errDestPtr;
+ schar *newError, *errSrcPtr, *errDestPtr;
int h, offset;
XRectangle validBox;
Pixmap newPixmap;
@@ -3183,22 +3178,21 @@ ImgPhotoInstanceSetSize(instancePtr)
|| (instancePtr->pixels == None)) {
newPixmap = Tk_GetPixmap(instancePtr->display,
RootWindow(instancePtr->display,
- instancePtr->visualInfo.screen),
+ instancePtr->visualInfo.screen),
(masterPtr->width > 0) ? masterPtr->width: 1,
(masterPtr->height > 0) ? masterPtr->height: 1,
instancePtr->visualInfo.depth);
- if (!newPixmap) {
- panic("Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize.\n");
- return;
- }
+ 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.
+ * 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);
@@ -3207,6 +3201,7 @@ ImgPhotoInstanceSetSize(instancePtr)
/*
* 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);
@@ -3224,54 +3219,51 @@ ImgPhotoInstanceSetSize(instancePtr)
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.
+ * 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((VOID *) newError, 0, (size_t)
+ memset(newError, 0, (size_t)
validBox.y * masterPtr->width * 3 * sizeof(schar));
}
h = validBox.y + validBox.height;
if (h < masterPtr->height) {
- memset((VOID *) (newError + h * masterPtr->width * 3), 0,
+ memset(newError + h*masterPtr->width*3, 0,
(size_t) (masterPtr->height - h)
* masterPtr->width * 3 * sizeof(schar));
}
} else {
- memset((VOID *) newError, 0, (size_t)
- masterPtr->height * masterPtr->width * 3 * sizeof(schar));
+ 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.
+ * 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((VOID *) (newError + offset),
- (VOID *) (instancePtr->error + offset),
+ 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;
- 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((VOID *) errDestPtr, (VOID *) errSrcPtr,
+ memcpy(errDestPtr, errSrcPtr,
validBox.width * 3 * sizeof(schar));
errDestPtr += masterPtr->width * 3;
errSrcPtr += instancePtr->width * 3;
@@ -3292,9 +3284,8 @@ ImgPhotoInstanceSetSize(instancePtr)
*
* IsValidPalette --
*
- * This procedure is called to check whether a value given for
- * the -palette option is valid for a particular instance
- * of a photo image.
+ * 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.
@@ -3306,17 +3297,16 @@ ImgPhotoInstanceSetSize(instancePtr)
*/
static int
-IsValidPalette(instancePtr, palette)
- PhotoInstance *instancePtr; /* Instance to which the palette
- * specification is to be applied. */
- CONST char *palette; /* Palette specification string. */
+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.
+ * First parse the specification: it must be of the form %d or %d/%d/%d.
*/
nRed = strtol(palette, &endp, 10);
@@ -3345,32 +3335,30 @@ IsValidPalette(instancePtr, palette)
}
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;
+ 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;
@@ -3381,7 +3369,7 @@ IsValidPalette(instancePtr, palette)
*
* CountBits --
*
- * This procedure counts how many bits are set to 1 in `mask'.
+ * This function counts how many bits are set to 1 in `mask'.
*
* Results:
* The integer number of bits.
@@ -3393,13 +3381,14 @@ IsValidPalette(instancePtr, palette)
*/
static int
-CountBits(mask)
- pixel mask; /* Value to count the 1 bits in. */
+CountBits(
+ pixel mask) /* Value to count the 1 bits in. */
{
int n;
- for( n = 0; mask != 0; mask &= mask - 1 )
+ for (n=0 ; mask!=0 ; mask&=mask-1) {
n++;
+ }
return n;
}
@@ -3408,28 +3397,27 @@ CountBits(mask)
*
* GetColorTable --
*
- * This procedure 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 procedure
- * maintains a hash table to find previously-allocated
+ * 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.
+ * A new ColorTable may be allocated and placed in the hash table, and
+ * have colors allocated for it.
*
*----------------------------------------------------------------------
*/
static void
-GetColorTable(instancePtr)
- PhotoInstance *instancePtr; /* Instance needing a color table. */
+GetColorTable(
+ PhotoInstance *instancePtr) /* Instance needing a color table. */
{
ColorTable *colorPtr;
Tcl_HashEntry *entry;
@@ -3440,7 +3428,7 @@ GetColorTable(instancePtr)
* Look for an existing ColorTable in the hash table.
*/
- memset((VOID *) &id, 0, sizeof(id));
+ memset(&id, 0, sizeof(id));
id.display = instancePtr->display;
id.colormap = instancePtr->colormap;
id.palette = instancePtr->palette;
@@ -3457,7 +3445,6 @@ GetColorTable(instancePtr)
*/
colorPtr = (ColorTable *) Tcl_GetHashValue(entry);
-
} else {
/*
* No color table currently available; need to make one.
@@ -3466,16 +3453,15 @@ GetColorTable(instancePtr)
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.
+ * 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((VOID *) &colorPtr->id, 0, sizeof(ColorTableId));
+ memset(&colorPtr->id, 0, sizeof(ColorTableId));
colorPtr->id = id;
Tk_PreserveColormap(colorPtr->id.display, colorPtr->id.colormap);
colorPtr->flags = 0;
@@ -3510,30 +3496,30 @@ GetColorTable(instancePtr)
*
* FreeColorTable --
*
- * This procedure is called when an instance ceases using a
- * color table.
+ * 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.
+ * 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(colorPtr, force)
- ColorTable *colorPtr; /* Pointer to the color table which is
- * no longer required by an instance. */
- int force; /* Force free to happen immediately. */
+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);
@@ -3551,24 +3537,24 @@ FreeColorTable(colorPtr, force)
*
* AllocateColors --
*
- * This procedure allocates the colors required by a color table,
- * and sets up the fields in the color table data structure which
- * are used in dithering.
+ * This 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.
+ * Colors are allocated from the X server. Fields in the color table data
+ * structure are updated.
*
*----------------------------------------------------------------------
*/
static void
-AllocateColors(colorPtr)
- ColorTable *colorPtr; /* Pointer to the color table requiring
- * colors to be allocated. */
+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;
@@ -3576,11 +3562,13 @@ AllocateColors(colorPtr)
XColor *colors;
unsigned long *pixels;
- /* 16-bit intensity value for i/n of full intensity. */
-# define CFRAC(i, n) ((i) * 65535 / (n))
+ /*
+ * 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))))
+#define CGFRAC(i, n, g) ((int)(65535 * pow((double)(i) / (n), (g))))
/*
* First parse the palette specification to get the required number of
@@ -3592,16 +3580,14 @@ AllocateColors(colorPtr)
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.
+ * 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 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)) {
@@ -3610,12 +3596,12 @@ AllocateColors(colorPtr)
}
/*
- * Calculate the RGB coordinates of the colors we want to
- * allocate and store them in *colors.
+ * 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)) {
+ || (colorPtr->visualInfo.class == TrueColor)) {
/*
* Direct/True Color: allocate shades of red, green, blue
@@ -3642,8 +3628,8 @@ AllocateColors(colorPtr)
}
} else {
/*
- * PseudoColor, StaticColor, GrayScale or StaticGray visual:
- * we have to allocate each color in the color cube separately.
+ * PseudoColor, StaticColor, GrayScale or StaticGray visual: we
+ * have to allocate each color in the color cube separately.
*/
numColors = (mono) ? nRed: (nRed * nGreen * nBlue);
@@ -3695,7 +3681,6 @@ AllocateColors(colorPtr)
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.
@@ -3707,6 +3692,7 @@ AllocateColors(colorPtr)
/*
* Still can't allocate the color.
*/
+
break;
}
}
@@ -3714,9 +3700,8 @@ AllocateColors(colorPtr)
}
/*
- * 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 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) {
@@ -3735,10 +3720,10 @@ AllocateColors(colorPtr)
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.
+ * 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;
@@ -3753,23 +3738,22 @@ AllocateColors(colorPtr)
nRed = nRed / 2;
}
}
-
+
/*
- * We have allocated all of the necessary colors:
- * fill in various fields of the ColorTable record.
+ * 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.
+ * 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)) {
@@ -3784,6 +3768,7 @@ AllocateColors(colorPtr)
/*
* Set up quantization tables for dithering.
*/
+
rMult = nGreen * nBlue;
for (i = 0; i < 256; ++i) {
r = (i * (nRed - 1) + 127) / 255;
@@ -3799,12 +3784,12 @@ AllocateColors(colorPtr)
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;
+ 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;
@@ -3834,27 +3819,27 @@ AllocateColors(colorPtr)
*
* 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.
+ * 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 clientData; /* Pointer to the ColorTable whose
+DisposeColorTable(
+ ClientData clientData) /* Pointer to the ColorTable whose
* colors are to be released. */
{
- ColorTable *colorPtr;
+ ColorTable *colorPtr = (ColorTable *) clientData;
Tcl_HashEntry *entry;
- colorPtr = (ColorTable *) clientData;
if (colorPtr->pixelMap != NULL) {
if (colorPtr->numColors > 0) {
XFreeColors(colorPtr->id.display, colorPtr->id.colormap,
@@ -3866,7 +3851,7 @@ DisposeColorTable(clientData)
entry = Tcl_FindHashEntry(&imgPhotoColorHash, (char *) &colorPtr->id);
if (entry == NULL) {
- panic("DisposeColorTable couldn't find hash entry");
+ Tcl_Panic("DisposeColorTable couldn't find hash entry");
}
Tcl_DeleteHashEntry(entry);
@@ -3878,48 +3863,46 @@ DisposeColorTable(clientData)
*
* ReclaimColors --
*
- * This procedure 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.
+ * 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.
+ * 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.
+ * ColorTables which are not currently in use may lose their color
+ * allocations.
*
- *---------------------------------------------------------------------- */
+ *----------------------------------------------------------------------
+ */
static int
-ReclaimColors(id, numColors)
- ColorTableId *id; /* Pointer to information identifying
+ReclaimColors(
+ ColorTableId *id, /* Pointer to information identifying
* the color table which needs more colors. */
- int numColors; /* Number of colors required. */
+ int numColors) /* Number of colors required. */
{
Tcl_HashSearch srch;
Tcl_HashEntry *entry;
ColorTable *colorPtr;
- int nAvail;
+ 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.
+ * First scan through the color hash table to get an upper bound on how
+ * many colors we might be able to free.
*/
- nAvail = 0;
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))) {
-
+ && (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.
*/
@@ -3948,8 +3931,7 @@ ReclaimColors(id, numColors)
&& (colorPtr->id.colormap == id->colormap)
&& (colorPtr->liveRefCount == 0) && (colorPtr->numColors != 0)
&& ((colorPtr->id.palette != id->palette)
- || (colorPtr->id.gamma != id->gamma))) {
-
+ || (colorPtr->id.gamma != id->gamma))) {
/*
* Free the colors that this ColorTable has.
*/
@@ -3964,7 +3946,7 @@ ReclaimColors(id, numColors)
entry = Tcl_NextHashEntry(&srch);
}
- return 1; /* we freed some colors */
+ return 1; /* We freed some colors. */
}
/*
@@ -3972,23 +3954,22 @@ ReclaimColors(id, numColors)
*
* DisposeInstance --
*
- * This procedure is called to finally free up an instance
- * of a photo image which is no longer required.
+ * 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.
+ * The instance data structure and the resources it references are freed.
*
*----------------------------------------------------------------------
*/
static void
-DisposeInstance(clientData)
- ClientData clientData; /* Pointer to the instance whose resources
- * are to be released. */
+DisposeInstance(
+ ClientData clientData) /* Pointer to the instance whose resources are
+ * to be released. */
{
PhotoInstance *instancePtr = (PhotoInstance *) clientData;
PhotoInstance *prevPtr;
@@ -4014,7 +3995,7 @@ DisposeInstance(clientData)
} else {
for (prevPtr = instancePtr->masterPtr->instancePtr;
prevPtr->nextPtr != instancePtr; prevPtr = prevPtr->nextPtr) {
- /* Empty loop body */
+ /* Empty loop body. */
}
prevPtr->nextPtr = instancePtr->nextPtr;
}
@@ -4027,16 +4008,16 @@ DisposeInstance(clientData)
*
* MatchFileFormat --
*
- * This procedure is called to find a photo image file format
- * handler which can parse the image data in the given file.
- * If a user-specified format string is provided, only handlers
- * whose names match a prefix of the format string are tried.
+ * This function is called to find a photo image file format handler
+ * which can parse the image data in the given file. If a user-specified
+ * format string is provided, only handlers whose names match a prefix of
+ * the format string are tried.
*
* Results:
- * A standard TCL return value. If the return value is TCL_OK, a
- * pointer to the image format record is returned in
- * *imageFormatPtr, and the width and height of the image are
- * returned in *widthPtr and *heightPtr.
+ * A standard TCL return value. If the return value is TCL_OK, a pointer
+ * to the image format record is returned in *imageFormatPtr, and the
+ * width and height of the image are returned in *widthPtr and
+ * *heightPtr.
*
* Side effects:
* None.
@@ -4045,24 +4026,23 @@ DisposeInstance(clientData)
*/
static int
-MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
- widthPtr, heightPtr, oldformat)
- 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. */
- Tcl_Obj *formatObj; /* User-specified format string, or NULL. */
- Tk_PhotoImageFormat **imageFormatPtr;
- /* A pointer to the photo image format
- * record is returned here. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here. */
- int *oldformat;
+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. */
+ Tcl_Obj *formatObj, /* User-specified format string, or NULL. */
+ Tk_PhotoImageFormat **imageFormatPtr,
+ /* A pointer to the photo image format record
+ * is returned here. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here. */
+ int *oldformat) /* Returns 1 if the old image API is used. */
{
- int matched;
- int useoldformat = 0;
+ int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
char *formatString = NULL;
if (formatObj) {
@@ -4070,13 +4050,12 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
}
/*
- * Scan through the table of file format handlers to find
- * one which can handle the image.
+ * Scan through the table of file format handlers to find one which can
+ * handle the image.
*/
- matched = 0;
for (formatPtr = tsdPtr->formatList; formatPtr != NULL;
- formatPtr = formatPtr->nextPtr) {
+ formatPtr = formatPtr->nextPtr) {
if (formatObj != NULL) {
if (strncasecmp(formatString,
formatPtr->name, strlen(formatPtr->name)) != 0) {
@@ -4085,13 +4064,13 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
matched = 1;
if (formatPtr->fileMatchProc == NULL) {
Tcl_AppendResult(interp, "-file option isn't supported for ",
- formatString, " images", (char *) NULL);
+ formatString, " images", NULL);
return TCL_ERROR;
}
}
if (formatPtr->fileMatchProc != NULL) {
(void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
-
+
if ((*formatPtr->fileMatchProc)(chan, fileName, formatObj,
widthPtr, heightPtr, interp)) {
if (*widthPtr < 1) {
@@ -4116,7 +4095,7 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
matched = 1;
if (formatPtr->fileMatchProc == NULL) {
Tcl_AppendResult(interp, "-file option isn't supported",
- " for ", formatString, " images", (char *) NULL);
+ " for ", formatString, " images", NULL);
return TCL_ERROR;
}
}
@@ -4138,13 +4117,12 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
if (formatPtr == NULL) {
if ((formatObj != NULL) && !matched) {
- Tcl_AppendResult(interp, "image file format \"",
- formatString,
- "\" is not supported", (char *) NULL);
+ Tcl_AppendResult(interp, "image file format \"", formatString,
+ "\" is not supported", NULL);
} else {
Tcl_AppendResult(interp,
- "couldn't recognize data in image file \"",
- fileName, "\"", (char *) NULL);
+ "couldn't recognize data in image file \"", fileName, "\"",
+ NULL);
}
return TCL_ERROR;
}
@@ -4160,16 +4138,16 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
*
* MatchStringFormat --
*
- * This procedure is called to find a photo image file format
- * handler which can parse the image data in the given string.
- * If a user-specified format string is provided, only handlers
- * whose names match a prefix of the format string are tried.
+ * This function is called to find a photo image file format handler
+ * which can parse the image data in the given string. If a
+ * user-specified format string is provided, only handlers whose names
+ * match a prefix of the format string are tried.
*
* Results:
- * A standard TCL return value. If the return value is TCL_OK, a
- * pointer to the image format record is returned in
- * *imageFormatPtr, and the width and height of the image are
- * returned in *widthPtr and *heightPtr.
+ * A standard TCL return value. If the return value is TCL_OK, a pointer
+ * to the image format record is returned in *imageFormatPtr, and the
+ * width and height of the image are returned in *widthPtr and
+ * *heightPtr.
*
* Side effects:
* None.
@@ -4178,35 +4156,33 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
*/
static int
-MatchStringFormat(interp, data, formatObj, imageFormatPtr,
- widthPtr, heightPtr, oldformat)
- Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
- Tcl_Obj *data; /* Object containing the image data. */
- Tcl_Obj *formatObj; /* User-specified format string, or NULL. */
- Tk_PhotoImageFormat **imageFormatPtr;
- /* A pointer to the photo image format
- * record is returned here. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are
- * returned here. */
- int *oldformat; /* returns 1 if the old image API is used */
+MatchStringFormat(
+ Tcl_Interp *interp, /* Interpreter to use for reporting errors. */
+ Tcl_Obj *data, /* Object containing the image data. */
+ Tcl_Obj *formatObj, /* User-specified format string, or NULL. */
+ Tk_PhotoImageFormat **imageFormatPtr,
+ /* A pointer to the photo image format record
+ * is returned here. */
+ int *widthPtr, int *heightPtr,
+ /* The dimensions of the image are returned
+ * here. */
+ int *oldformat) /* Returns 1 if the old image API is used. */
{
- int matched;
- int useoldformat = 0;
+ int matched = 0, useoldformat = 0;
Tk_PhotoImageFormat *formatPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
char *formatString = NULL;
-
+
if (formatObj) {
formatString = Tcl_GetString(formatObj);
}
/*
- * Scan through the table of file format handlers to find
- * one which can handle the image.
+ * Scan through the table of file format handlers to find one which can
+ * handle the image.
*/
- matched = 0;
for (formatPtr = tsdPtr->formatList; formatPtr != NULL;
formatPtr = formatPtr->nextPtr) {
if (formatObj != NULL) {
@@ -4217,7 +4193,7 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
matched = 1;
if (formatPtr->stringMatchProc == NULL) {
Tcl_AppendResult(interp, "-data option isn't supported for ",
- formatString, " images", (char *) NULL);
+ formatString, " images", NULL);
return TCL_ERROR;
}
}
@@ -4241,7 +4217,7 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
matched = 1;
if (formatPtr->stringMatchProc == NULL) {
Tcl_AppendResult(interp, "-data option isn't supported",
- " for ", formatString, " images", (char *) NULL);
+ " for ", formatString, " images", NULL);
return TCL_ERROR;
}
}
@@ -4258,10 +4234,9 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
if (formatPtr == NULL) {
if ((formatObj != NULL) && !matched) {
Tcl_AppendResult(interp, "image format \"", formatString,
- "\" is not supported", (char *) NULL);
+ "\" is not supported", NULL);
} else {
- Tcl_AppendResult(interp, "couldn't recognize image data",
- (char *) NULL);
+ Tcl_AppendResult(interp, "couldn't recognize image data", NULL);
}
return TCL_ERROR;
}
@@ -4276,14 +4251,14 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
*
* Tk_FindPhoto --
*
- * This procedure is called to get an opaque handle (actually a
- * PhotoMaster *) for a given image, which can be used in
- * subsequent calls to Tk_PhotoPutBlock, etc. The `name'
- * parameter is the name of the image.
+ * This function is called to get an opaque handle (actually a
+ * PhotoMaster *) for a given image, which can be used in subsequent
+ * calls to Tk_PhotoPutBlock, etc. The `name' parameter is the name of
+ * the image.
*
* Results:
- * The handle for the photo image, or NULL if there is no
- * photo image with the name given.
+ * The handle for the photo image, or NULL if there is no photo image
+ * with the name given.
*
* Side effects:
* None.
@@ -4292,16 +4267,16 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
*/
Tk_PhotoHandle
-Tk_FindPhoto(interp, imageName)
- Tcl_Interp *interp; /* Interpreter (application) in which image
+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;
clientData = Tk_GetImageMasterData(interp, imageName, &typePtr);
- if (typePtr != &tkPhotoImageType) {
+ if ((typePtr == NULL) || (typePtr->name != tkPhotoImageType.name)) {
return NULL;
}
return (Tk_PhotoHandle) clientData;
@@ -4312,39 +4287,40 @@ Tk_FindPhoto(interp, imageName)
*
* Tk_PhotoPutBlock --
*
- * This procedure is called to put image data into a photo image.
+ * This function is called to put image data into a photo image.
*
* Results:
- * None.
+ * A standard Tcl result code.
*
* Side effects:
- * The image data is stored. The image may be expanded.
- * The Tk image code is informed that the image has changed.
+ * The image data is stored. The image may be expanded. The Tk image code
+ * is informed that the image has changed. If the result code is
+ * TCL_ERROR, an error message will be placed in the interpreter (if
+ * non-NULL).
*
- *---------------------------------------------------------------------- */
+ *----------------------------------------------------------------------
+ */
-void
-Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
- Tk_PhotoHandle handle; /* Opaque handle for the photo image
- * to be updated. */
- register Tk_PhotoImageBlock *blockPtr;
- /* Pointer to a structure describing the
- * pixel data to be copied into the image. */
- int x, y; /* Coordinates of the top-left pixel to
- * be updated in the image. */
- int width, height; /* Dimensions of the area of the image
- * to be updated. */
- int compRule; /* Compositing rule to use when processing
+int
+Tk_PhotoPutBlock(
+ Tcl_Interp *interp, /* Interpreter for passing back error
+ * messages, or NULL. */
+ Tk_PhotoHandle handle, /* Opaque handle for the photo image to be
+ * updated. */
+ register Tk_PhotoImageBlock *blockPtr,
+ /* Pointer to a structure describing the pixel
+ * data to be copied into the image. */
+ int x, int y, /* Coordinates of the top-left pixel to be
+ * updated in the image. */
+ int width, int height, /* Dimensions of the area of the image to be
+ * updated. */
+ int compRule) /* Compositing rule to use when processing
* transparent pixels. */
{
register PhotoMaster *masterPtr;
- int xEnd, yEnd;
- int greenOffset, blueOffset, alphaOffset;
- int wLeft, hLeft;
- int wCopy, hCopy;
- unsigned char *srcPtr, *srcLinePtr;
- unsigned char *destPtr, *destLinePtr;
- int pitch;
+ 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;
@@ -4359,16 +4335,21 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
height = masterPtr->userHeight - y;
}
if ((width <= 0) || (height <= 0)) {
- return;
+ return TCL_OK;
}
xEnd = x + width;
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) {
- panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ if (interp != NULL) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
+ }
+ return TCL_ERROR;
}
if (sameSrc) {
blockPtr->pixelPtr = masterPtr->pix32;
@@ -4376,12 +4357,12 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
}
}
-
if ((y < masterPtr->ditherY) || ((y == masterPtr->ditherY)
&& (x < masterPtr->ditherX))) {
/*
* The dithering isn't correct past the start of this block.
*/
+
masterPtr->ditherX = x;
masterPtr->ditherY = y;
}
@@ -4405,111 +4386,162 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
}
/*
- * Copy the data into our local 32-bit/pixel array.
- * If we can do it with a single memcpy, we do.
+ * Copy the data into our local 32-bit/pixel array. If we can do it with a
+ * single memcpy, we do.
*/
destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4;
pitch = masterPtr->width * 4;
/*
- * This test is probably too restrictive. We should also be able to
- * do a memcpy if pixelSize == 3 and alphaOffset == 0. Maybe other cases
- * too.
+ * Test to see if we can do the whole write in a single copy. This test is
+ * probably too restrictive. We should also be able to do a memcpy if
+ * pixelSize == 3 and alphaOffset == 0. Maybe other cases too.
*/
+
if ((blockPtr->pixelSize == 4)
&& (greenOffset == 1) && (blueOffset == 2) && (alphaOffset == 3)
&& (width <= blockPtr->width) && (height <= blockPtr->height)
&& ((height == 1) || ((x == 0) && (width == masterPtr->width)
&& (blockPtr->pitch == pitch)))
&& (compRule == TK_PHOTO_COMPOSITE_SET)) {
- memcpy((VOID *) destLinePtr,
- (VOID *) (blockPtr->pixelPtr + blockPtr->offset[0]),
+ memcpy(destLinePtr, blockPtr->pixelPtr + blockPtr->offset[0],
(size_t) (height * width * 4));
- } else {
- int alpha;
- for (hLeft = height; hLeft > 0;) {
- srcLinePtr = blockPtr->pixelPtr + blockPtr->offset[0];
- hCopy = MIN(hLeft, blockPtr->height);
- hLeft -= hCopy;
- for (; hCopy > 0; --hCopy) {
- if ((blockPtr->pixelSize == 4) && (greenOffset == 1)
+
+ /*
+ * We know there's an alpha offset and we're setting the data, so skip
+ * directly to the point when we recompute the photo validity region.
+ */
+
+ goto recalculateValidRegion;
+ }
+
+ /*
+ * Copy and merge pixels according to the compositing rule.
+ */
+
+ for (hLeft = height; hLeft > 0;) {
+ int pixelSize = blockPtr->pixelSize;
+ int compRuleSet = (compRule == TK_PHOTO_COMPOSITE_SET);
+
+ srcLinePtr = blockPtr->pixelPtr + blockPtr->offset[0];
+ hCopy = MIN(hLeft, blockPtr->height);
+ hLeft -= hCopy;
+ for (; hCopy > 0; --hCopy) {
+ /*
+ * If the layout of the source line matches our memory layout and
+ * we're setting, we can just copy the bytes directly, which is
+ * much faster.
+ */
+
+ if ((pixelSize == 4) && (greenOffset == 1)
&& (blueOffset == 2) && (alphaOffset == 3)
&& (width <= blockPtr->width)
- && (compRule == TK_PHOTO_COMPOSITE_SET)) {
- memcpy((VOID *) destLinePtr, (VOID *) srcLinePtr,
- (size_t) (width * 4));
- } else {
- destPtr = destLinePtr;
- for (wLeft = width; wLeft > 0;) {
- wCopy = MIN(wLeft, blockPtr->width);
- wLeft -= wCopy;
- srcPtr = srcLinePtr;
- for (; wCopy > 0; --wCopy) {
- alpha = srcPtr[alphaOffset];
-
- /*
- * In the easy case, we can just copy.
- */
- if (!alphaOffset || (alpha == 255)) {
- /* new solid part of the image */
- *destPtr++ = srcPtr[0];
- *destPtr++ = srcPtr[greenOffset];
- *destPtr++ = srcPtr[blueOffset];
- *destPtr++ = 255;
- srcPtr += blockPtr->pixelSize;
- continue;
- }
+ && compRuleSet) {
+ memcpy(destLinePtr, srcLinePtr, (size_t) (width * 4));
+ srcLinePtr += blockPtr->pitch;
+ destLinePtr += pitch;
+ continue;
+ }
- /*
- * Combine according to the compositing rule.
- */
- switch (compRule) {
- case TK_PHOTO_COMPOSITE_OVERLAY:
- if (!destPtr[3]) {
- /*
- * The destination is entirely
- * blank, so set it to the source,
- * just as if we used the SET
- * compositing rule.
- */
- case TK_PHOTO_COMPOSITE_SET:
- *destPtr++ = srcPtr[0];
- *destPtr++ = srcPtr[greenOffset];
- *destPtr++ = srcPtr[blueOffset];
- *destPtr++ = alpha;
- break;
- }
+ /*
+ * Have to copy the slow way.
+ */
+
+ destPtr = destLinePtr;
+ for (wLeft = width; wLeft > 0;) {
+ wCopy = MIN(wLeft, blockPtr->width);
+ wLeft -= wCopy;
+ srcPtr = srcLinePtr;
- if (alpha) {
- int Alpha = destPtr[3];
+ /*
+ * But we might be lucky and be able to use fairly fast loops.
+ * It's worth checking...
+ */
- /*
- * This implements the Porter-Duff
- * Source-Over compositing rule.
- */
+ if (alphaOffset == 0) {
+ /*
+ * This is the non-alpha case, so can still be fairly
+ * fast. Note that in the non-alpha-source case, the
+ * compositing rule doesn't apply.
+ */
- destPtr[0] = PD_SRC_OVER(srcPtr[0],alpha,destPtr[0],Alpha);
- destPtr[1] = PD_SRC_OVER(srcPtr[greenOffset],alpha,destPtr[1],Alpha);
- destPtr[2] = PD_SRC_OVER(srcPtr[blueOffset],alpha,destPtr[2],Alpha);
- destPtr[3] = PD_SRC_OVER_ALPHA(alpha,Alpha);
- }
- /*
- * else should be empty space
- */
- destPtr += 4;
- break;
-
- default:
- panic("unknown compositing rule: %d", compRule);
- }
- srcPtr += blockPtr->pixelSize;
- }
+ for (; wCopy>0 ; --wCopy, srcPtr+=pixelSize) {
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = 255;
+ }
+ continue;
+ } else if (compRuleSet) {
+ /*
+ * This is the SET compositing rule, which just replaces
+ * what was there before with the new data. This is
+ * another fairly fast case. No point in doing a memcpy();
+ * the order of channels is probably wrong.
+ */
+
+ for (; wCopy>0 ; --wCopy, srcPtr+=pixelSize) {
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = srcPtr[alphaOffset];
}
+ continue;
+ }
+
+ /*
+ * Bother; need to consider the alpha value of each pixel to
+ * know what to do.
+ */
+
+ for (; wCopy>0 ; --wCopy, srcPtr+=pixelSize) {
+ int alpha = srcPtr[alphaOffset];
+
+ if (alpha == 255 || !destPtr[3]) {
+ /*
+ * Either the source is 100% opaque, or the
+ * destination is entirely blank. In all cases, we
+ * just set the destination to the source.
+ */
+
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = alpha;
+ continue;
+ }
+
+ /*
+ * Can still skip doing work if the source is 100%
+ * transparent at this point.
+ */
+
+ if (alpha) {
+ int Alpha = destPtr[3];
+
+ /*
+ * OK, there's real work to be done. Luckily, there's
+ * a substantial literature on what to do in this
+ * case. In particular, Porter and Duff have done a
+ * taxonomy of compositing rules, and the right one is
+ * the "Source Over" rule. This code implements that.
+ */
+
+ destPtr[0] = PD_SRC_OVER(srcPtr[0], alpha, destPtr[0],
+ Alpha);
+ destPtr[1] = PD_SRC_OVER(srcPtr[greenOffset], alpha,
+ destPtr[1], Alpha);
+ destPtr[2] = PD_SRC_OVER(srcPtr[blueOffset], alpha,
+ destPtr[2], Alpha);
+ destPtr[3] = PD_SRC_OVER_ALPHA(alpha, Alpha);
+ }
+
+ destPtr += 4;
}
- srcLinePtr += blockPtr->pitch;
- destLinePtr += pitch;
}
+ srcLinePtr += blockPtr->pitch;
+ destLinePtr += pitch;
}
}
@@ -4518,34 +4550,35 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
*/
if (alphaOffset) {
- int x1, y1, end;
-
/*
- * This block is grossly inefficient. For each row in the image, it
+ * This block is grossly inefficient. For each row in the image, it
* finds each continguous string of nontransparent pixels, then marks
- * those areas as valid in the validRegion mask. This makes drawing
+ * those areas as valid in the validRegion mask. This makes drawing
* very efficient, because of the way we use X: we just say, here's
- * your mask, and here's your data. We need not worry about the
- * current background color, etc. But this costs us a lot on the
- * image setup. Still, image setup only happens once, whereas the
- * drawing happens many times, so this might be the best way to go.
+ * your mask, and here's your data. We need not worry about the
+ * current background color, etc. But this costs us a lot on the image
+ * setup. Still, image setup only happens once, whereas the drawing
+ * happens many times, so this might be the best way to go.
*
* An alternative might be to not set up this mask, and instead, at
* drawing time, for each transparent pixel, set its color to the
- * color of the background behind that pixel. This is what I suspect
- * most of programs do. However, they don't have to deal with the
+ * color of the background behind that pixel. This is what I suspect
+ * most of programs do. However, they don't have to deal with the
* canvas, which could have many different background colors.
* Determining the correct bg color for a given pixel might be
* expensive.
*/
if (compRule != TK_PHOTO_COMPOSITE_OVERLAY) {
+ TkRegion workRgn;
+
/*
- * Don't need this when using the OVERLAY compositing rule,
- * which always strictly increases the valid region.
+ * Don't need this when using the OVERLAY compositing rule, which
+ * always strictly increases the valid region.
*/
- TkRegion workRgn = TkCreateRegion();
+ recalculateValidRegion:
+ workRgn = TkCreateRegion();
rect.x = x;
rect.y = y;
rect.width = width;
@@ -4556,34 +4589,15 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
TkDestroyRegion(workRgn);
}
- destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4 + 3;
- for (y1 = 0; y1 < height; y1++) {
- x1 = 0;
- destPtr = destLinePtr;
- while (x1 < width) {
- /* search for first non-transparent pixel */
- while ((x1 < width) && !*destPtr) {
- x1++;
- destPtr += 4;
- }
- end = x1;
- /* search for first transparent pixel */
- while ((end < width) && *destPtr) {
- end++;
- destPtr += 4;
- }
- if (end > x1) {
- rect.x = x + x1;
- rect.y = y + y1;
- rect.width = end - x1;
- rect.height = 1;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
- }
- x1 = end;
- }
- destLinePtr += masterPtr->width * 4;
- }
+ /*
+ * Factorize out the main part of the building of the region data to
+ * allow for more efficient per-platform implementations. [Bug 919066]
+ */
+
+ TkpBuildRegionFromAlphaData(masterPtr->validRegion, (unsigned) x,
+ (unsigned) y, (unsigned) width, (unsigned) height,
+ masterPtr->pix32 + (y * masterPtr->width + x) * 4 + 3,
+ 4, (unsigned) masterPtr->width * 4);
} else {
rect.x = x;
rect.y = y;
@@ -4603,6 +4617,7 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
* 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)) {
unsigned char newAlpha;
@@ -4620,6 +4635,7 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
* Toggle to only checking the changed pixels requires knowing where
* the alpha pixels are.
*/
+
ToggleComplexAlphaIfNeeded(masterPtr);
}
@@ -4633,8 +4649,9 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
* Tell the core image code that this image has changed.
*/
- Tk_ImageChanged(masterPtr->tkMaster, x, y, width, height, masterPtr->width,
- masterPtr->height);
+ Tk_ImageChanged(masterPtr->tkMaster, x, y, width, height,
+ masterPtr->width, masterPtr->height);
+ return TCL_OK;
}
/*
@@ -4642,60 +4659,56 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
*
* Tk_PhotoPutZoomedBlock --
*
- * This procedure is called to put image data into a photo image,
- * with possible subsampling and/or zooming of the pixels.
+ * This function is called to put image data into a photo image, with
+ * possible subsampling and/or zooming of the pixels.
*
* Results:
* None.
*
* Side effects:
- * The image data is stored. The image may be expanded.
- * The Tk image code is informed that the image has changed.
+ * The image data is stored. The image may be expanded. The Tk image code
+ * is informed that the image has changed.
*
*----------------------------------------------------------------------
*/
-void
-Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
- subsampleX, subsampleY, compRule)
- Tk_PhotoHandle handle; /* Opaque handle for the photo image
- * to be updated. */
- register Tk_PhotoImageBlock *blockPtr;
- /* Pointer to a structure describing the
- * pixel data to be copied into the image. */
- int x, y; /* Coordinates of the top-left pixel to
- * be updated in the image. */
- int width, height; /* Dimensions of the area of the image
- * to be updated. */
- int zoomX, zoomY; /* Zoom factors for the X and Y axes. */
- int subsampleX, subsampleY; /* Subsampling factors for the X and Y axes. */
- int compRule; /* Compositing rule to use when processing
+int
+Tk_PhotoPutZoomedBlock(
+ Tcl_Interp *interp, /* Interpreter for passing back error
+ * messages, or NULL. */
+ Tk_PhotoHandle handle, /* Opaque handle for the photo image to be
+ * updated. */
+ register Tk_PhotoImageBlock *blockPtr,
+ /* Pointer to a structure describing the pixel
+ * data to be copied into the image. */
+ int x, int y, /* Coordinates of the top-left pixel to be
+ * updated in the image. */
+ int width, int height, /* Dimensions of the area of the image to be
+ * updated. */
+ int zoomX, int zoomY, /* Zoom factors for the X and Y axes. */
+ int subsampleX, int subsampleY,
+ /* Subsampling factors for the X and Y
+ * axes. */
+ int compRule) /* Compositing rule to use when processing
* transparent pixels. */
{
- register PhotoMaster *masterPtr;
- int xEnd, yEnd;
- int greenOffset, blueOffset, alphaOffset;
- int wLeft, hLeft;
- int wCopy, hCopy;
- int blockWid, blockHt;
- unsigned char *srcPtr, *srcLinePtr, *srcOrigPtr;
- unsigned char *destPtr, *destLinePtr;
- int pitch;
- int xRepeat, yRepeat;
- int blockXSkip, blockYSkip, sourceIsSimplePhoto;
+ register PhotoMaster *masterPtr = (PhotoMaster *) handle;
+ int xEnd, yEnd, greenOffset, blueOffset, alphaOffset;
+ int wLeft, hLeft, wCopy, hCopy, blockWid, blockHt;
+ unsigned char *srcPtr, *srcLinePtr, *srcOrigPtr, *destPtr, *destLinePtr;
+ int pitch, xRepeat, yRepeat, blockXSkip, blockYSkip, sourceIsSimplePhoto;
XRectangle rect;
if (zoomX==1 && zoomY==1 && subsampleX==1 && subsampleY==1) {
- Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule);
- return;
+ return Tk_PhotoPutBlock(interp, handle, blockPtr, x, y, width, height,
+ compRule);
}
sourceIsSimplePhoto = compRule & SOURCE_IS_SIMPLE_ALPHA_PHOTO;
compRule &= ~SOURCE_IS_SIMPLE_ALPHA_PHOTO;
- masterPtr = (PhotoMaster *) handle;
if (zoomX <= 0 || zoomY <= 0) {
- return;
+ return TCL_OK;
}
if ((masterPtr->userWidth != 0) && ((x + width) > masterPtr->userWidth)) {
width = masterPtr->userWidth - x;
@@ -4705,7 +4718,7 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
height = masterPtr->userHeight - y;
}
if (width <= 0 || height <= 0) {
- return;
+ return TCL_OK;
}
xEnd = x + width;
@@ -4714,7 +4727,11 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
int sameSrc = (blockPtr->pixelPtr == masterPtr->pix32);
if (ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
MAX(yEnd, masterPtr->height)) == TCL_ERROR) {
- panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ if (interp != NULL) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
+ }
+ return TCL_ERROR;
}
if (sameSrc) {
blockPtr->pixelPtr = masterPtr->pix32;
@@ -4799,10 +4816,12 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
srcPtr = srcLinePtr;
for (; wCopy > 0; wCopy -= zoomX) {
for (xRepeat = MIN(wCopy, zoomX); xRepeat > 0; xRepeat--) {
- int alpha = srcPtr[alphaOffset];
+ int alpha = srcPtr[alphaOffset];/* Source alpha. */
+
/*
* Common case (solid pixels) first
*/
+
if (!alphaOffset || (alpha == 255)) {
*destPtr++ = srcPtr[0];
*destPtr++ = srcPtr[greenOffset];
@@ -4811,32 +4830,33 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
continue;
}
- switch (compRule) {
- case TK_PHOTO_COMPOSITE_OVERLAY:
- if (!destPtr[3]) {
- /*
- * The destination is entirely blank,
- * so set it to the source, just as if
- * we used the SET compositing rule.
- */
- case TK_PHOTO_COMPOSITE_SET:
- *destPtr++ = srcPtr[0];
- *destPtr++ = srcPtr[greenOffset];
- *destPtr++ = srcPtr[blueOffset];
- *destPtr++ = alpha;
- break;
- }
- if (alpha) {
- int Alpha = destPtr[3];
- destPtr[0] = PD_SRC_OVER(srcPtr[0],alpha,destPtr[0],Alpha);
- destPtr[1] = PD_SRC_OVER(srcPtr[greenOffset],alpha,destPtr[1],Alpha);
- destPtr[2] = PD_SRC_OVER(srcPtr[blueOffset],alpha,destPtr[2],Alpha);
- destPtr[3] = PD_SRC_OVER_ALPHA(alpha,Alpha);
- }
+ if (compRule==TK_PHOTO_COMPOSITE_SET || !destPtr[3]) {
+ /*
+ * Either this is the SET rule (we overwrite
+ * whatever is there) or the destination is
+ * entirely blank. In both cases, we just set the
+ * destination to the source.
+ */
+
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = alpha;
+ } else if (alpha) {
+ int Alpha = destPtr[3]; /* Destination
+ * alpha. */
+
+ destPtr[0] = PD_SRC_OVER(srcPtr[0], alpha,
+ destPtr[0], Alpha);
+ destPtr[1] = PD_SRC_OVER(srcPtr[greenOffset],alpha,
+ destPtr[1], Alpha);
+ destPtr[2] = PD_SRC_OVER(srcPtr[blueOffset], alpha,
+ destPtr[2], Alpha);
+ destPtr[3] = PD_SRC_OVER_ALPHA(alpha, Alpha);
+
+ destPtr += 4;
+ } else {
destPtr += 4;
- break;
- default:
- panic("unknown compositing rule: %d", compRule);
}
}
srcPtr += blockXSkip;
@@ -4856,13 +4876,12 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
*/
if (alphaOffset) {
- int x1, y1, end;
-
if (compRule != TK_PHOTO_COMPOSITE_OVERLAY) {
/*
* Don't need this when using the OVERLAY compositing rule, which
* always strictly increases the valid region.
*/
+
TkRegion workRgn = TkCreateRegion();
rect.x = x;
@@ -4875,34 +4894,10 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
TkDestroyRegion(workRgn);
}
- destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4 + 3;
- for (y1 = 0; y1 < height; y1++) {
- x1 = 0;
- destPtr = destLinePtr;
- while (x1 < width) {
- /* search for first non-transparent pixel */
- while ((x1 < width) && !*destPtr) {
- x1++;
- destPtr += 4;
- }
- end = x1;
- /* search for first transparent pixel */
- while ((end < width) && *destPtr) {
- end++;
- destPtr += 4;
- }
- if (end > x1) {
- rect.x = x + x1;
- rect.y = y + y1;
- rect.width = end - x1;
- rect.height = 1;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
- }
- x1 = end;
- }
- destLinePtr += masterPtr->width * 4;
- }
+ TkpBuildRegionFromAlphaData(masterPtr->validRegion,
+ (unsigned)x, (unsigned)y, (unsigned)width, (unsigned)height,
+ &masterPtr->pix32[(y * masterPtr->width + x) * 4 + 3], 4,
+ (unsigned) masterPtr->width * 4);
} else {
rect.x = x;
rect.y = y;
@@ -4946,7 +4941,7 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
* Update each instance.
*/
- Tk_DitherPhoto((Tk_PhotoHandle)masterPtr, x, y, width, height);
+ Tk_DitherPhoto((Tk_PhotoHandle) masterPtr, x, y, width, height);
/*
* Tell the core image code that this image has changed.
@@ -4954,6 +4949,7 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
Tk_ImageChanged(masterPtr->tkMaster, x, y, width, height, masterPtr->width,
masterPtr->height);
+ return TCL_OK;
}
/*
@@ -4961,27 +4957,27 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
*
* Tk_DitherPhoto --
*
- * This procedure is called to update an area of each instance's
- * pixmap by dithering the corresponding area of the image master.
+ * This function is called to update an area of each instance's pixmap by
+ * dithering the corresponding area of the image master.
*
* Results:
* None.
*
* Side effects:
- * The pixmap of each instance of this image gets updated.
- * The fields in *masterPtr indicating which area of the image
- * is correctly dithered get updated.
+ * The pixmap of each instance of this image gets updated. The fields in
+ * *masterPtr indicating which area of the image is correctly dithered
+ * get updated.
*
*----------------------------------------------------------------------
*/
void
-Tk_DitherPhoto(photo, x, y, width, height)
- Tk_PhotoHandle photo; /* Image master whose instances are
- * to be updated. */
- int x, y; /* Coordinates of the top-left pixel
- * in the area to be dithered. */
- int width, height; /* Dimensions of the area to be dithered. */
+Tk_DitherPhoto(
+ Tk_PhotoHandle photo, /* Image master whose instances are to be
+ * updated. */
+ int x, int y, /* Coordinates of the top-left pixel in the
+ * area to be dithered. */
+ int width, int height) /* Dimensions of the area to be dithered. */
{
PhotoMaster *masterPtr = (PhotoMaster *) photo;
PhotoInstance *instancePtr;
@@ -4996,14 +4992,13 @@ Tk_DitherPhoto(photo, x, y, width, height)
}
/*
- * Work out whether this block will be correctly dithered
- * and whether it will extend the correctly dithered region.
+ * Work out whether this block will be correctly dithered and whether it
+ * will extend the correctly dithered region.
*/
if (((y < masterPtr->ditherY)
|| ((y == masterPtr->ditherY) && (x <= masterPtr->ditherX)))
&& ((y + height) > (masterPtr->ditherY))) {
-
/*
* This block starts inside (or immediately after) the correctly
* dithered region, so the first scan line at least will be right.
@@ -5012,8 +5007,8 @@ Tk_DitherPhoto(photo, x, y, width, height)
if ((x == 0) && (width == masterPtr->width)) {
/*
- * We are doing the full width, therefore the dithering
- * will be correct to the end.
+ * We are doing the full width, therefore the dithering will be
+ * correct to the end.
*/
masterPtr->ditherX = 0;
@@ -5021,8 +5016,8 @@ Tk_DitherPhoto(photo, x, y, width, height)
} else {
/*
* We are doing partial scanlines, therefore the
- * correctly-dithered region will be extended by
- * at most one scan line.
+ * correctly-dithered region will be extended by at most one scan
+ * line.
*/
if (x <= masterPtr->ditherX) {
@@ -5034,16 +5029,15 @@ Tk_DitherPhoto(photo, x, y, width, height)
}
}
}
-
-}
+}
/*
*----------------------------------------------------------------------
*
* DitherInstance --
*
- * This procedure is called to update an area of an instance's
- * pixmap by dithering the corresponding area of the master.
+ * This function is called to update an area of an instance's pixmap by
+ * dithering the corresponding area of the master.
*
* Results:
* None.
@@ -5055,33 +5049,24 @@ Tk_DitherPhoto(photo, x, y, width, height)
*/
static void
-DitherInstance(instancePtr, xStart, yStart, width, height)
- PhotoInstance *instancePtr; /* The instance to be updated. */
- int xStart, yStart; /* Coordinates of the top-left pixel in the
+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, height; /* Dimensions of the block to be dithered. */
+ int width, int height) /* Dimensions of the block to be dithered. */
{
- PhotoMaster *masterPtr;
- ColorTable *colorPtr;
+ PhotoMaster *masterPtr = instancePtr->masterPtr;
+ ColorTable *colorPtr = instancePtr->colorTablePtr;
XImage *imagePtr;
- int nLines, bigEndian;
- int i, c, x, y;
- int xEnd, yEnd;
+ int nLines, bigEndian, i, c, x, y, xEnd, doDithering = 1;
int bitsPerPixel, bytesPerLine, lineLength;
- unsigned char *srcLinePtr, *srcPtr;
- schar *errLinePtr, *errPtr;
- unsigned char *destBytePtr, *dstLinePtr;
- pixel *destLongPtr;
+ unsigned char *srcLinePtr;
+ schar *errLinePtr;
pixel firstBit, word, mask;
- int col[3];
- int doDithering = 1;
-
- colorPtr = instancePtr->colorTablePtr;
- masterPtr = instancePtr->masterPtr;
/*
- * Turn dithering off in certain cases where it is not
- * needed (TrueColor, DirectColor with many colors).
+ * Turn dithering off in certain cases where it is not needed (TrueColor,
+ * DirectColor with many colors).
*/
if ((colorPtr->visualInfo.class == DirectColor)
@@ -5097,9 +5082,8 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
}
/*
- * First work out how many lines to do at a time,
- * then how many bytes we'll need for pixel storage,
- * and allocate it.
+ * 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;
@@ -5112,14 +5096,15 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
imagePtr = instancePtr->imagePtr;
if (imagePtr == NULL) {
- return; /* we must be really tight on memory */
+ 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));
+ imagePtr->data = (char *)
+ ckalloc((unsigned) (imagePtr->bytes_per_line * nLines));
bigEndian = imagePtr->bitmap_bit_order == MSBFirst;
firstBit = bigEndian? (1 << (imagePtr->bitmap_unit - 1)): 1;
@@ -5129,46 +5114,50 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
xEnd = xStart + width;
/*
- * Loop over the image, doing at most nLines lines before
- * updating the screen image.
+ * 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;
}
- dstLinePtr = (unsigned char *) imagePtr->data;
yEnd = yStart + nLines;
for (y = yStart; y < yEnd; ++y) {
- srcPtr = srcLinePtr;
- errPtr = errLinePtr;
- destBytePtr = dstLinePtr;
- destLongPtr = (pixel *) dstLinePtr;
+ 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.
+ * 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
+ * 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.
+ * 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) {
@@ -5179,13 +5168,13 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
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;
@@ -5196,9 +5185,9 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
*errPtr++ = c - col[i];
}
} else {
- /*
- * Output is virtually continuous in this case,
- * so don't bother dithering.
+ /*
+ * Output is virtually continuous in this case, so
+ * don't bother dithering.
*/
col[0] = *srcPtr++;
@@ -5208,8 +5197,8 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
srcPtr++;
/*
- * Translate the quantized component values into
- * an X pixel value, and store it in the image.
+ * Translate the quantized component values into an X
+ * pixel value, and store it in the image.
*/
i = colorPtr->redValues[col[0]]
@@ -5219,32 +5208,34 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
i = colorPtr->pixelMap[i];
}
switch (bitsPerPixel) {
- case NBBY:
- *destBytePtr++ = i;
- break;
+ 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.
- */
+ /*
+ * 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;
+ case NBBY * sizeof(pixel):
+ *destLongPtr++ = i;
+ break;
#endif
- default:
- XPutPixel(imagePtr, x - xStart, y - yStart,
- (unsigned) i);
+ default:
+ XPutPixel(imagePtr, x - xStart, y - yStart,
+ (unsigned) i);
}
}
} else if (bitsPerPixel > 1) {
/*
- * Multibit monochrome window. The operation here is similar
+ * 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
+ * one component. If the master image is in color, use the
* luminance computed as
* 0.344 * red + 0.5 * green + 0.156 * blue.
*/
@@ -5266,7 +5257,7 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
c += srcPtr[0];
} else {
c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
- + srcPtr[2] * 5 + 16) >> 5;
+ + srcPtr[2] * 5 + 16) >> 5;
}
srcPtr += 4;
@@ -5279,40 +5270,42 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
*errPtr++ = c - i;
i = colorPtr->redValues[i];
switch (bitsPerPixel) {
- case NBBY:
- *destBytePtr++ = i;
- break;
+ 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.
- */
+ /*
+ * 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;
+ case NBBY * sizeof(pixel):
+ *destLongPtr++ = i;
+ break;
#endif
- default:
- XPutPixel(imagePtr, x - xStart, y - yStart,
- (unsigned) i);
+ 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.
+ * 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 we have accumulated a whole word, store it in the
+ * image and start a new word.
*/
if (mask == 0) {
@@ -5337,7 +5330,7 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
c += srcPtr[0];
} else {
c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16
- + srcPtr[2] * 5 + 16) >> 5;
+ + srcPtr[2] * 5 + 16) >> 5;
}
srcPtr += 4;
@@ -5362,8 +5355,8 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
}
/*
- * Update the pixmap for this instance with the block of
- * pixels that we have just computed.
+ * Update the pixmap for this instance with the block of pixels that
+ * we have just computed.
*/
TkPutImage(colorPtr->pixelMap, colorPtr->numColors,
@@ -5371,7 +5364,6 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
instancePtr->gc, imagePtr, 0, 0, xStart, yStart,
(unsigned) width, (unsigned) nLines);
yStart = yEnd;
-
}
ckfree(imagePtr->data);
@@ -5383,26 +5375,25 @@ DitherInstance(instancePtr, xStart, yStart, width, height)
*
* Tk_PhotoBlank --
*
- * This procedure is called to clear an entire photo image.
+ * This function is called to clear an entire photo image.
*
* Results:
* None.
*
* Side effects:
- * The valid region for the image is set to the null region.
- * The generic image code is notified that the image has changed.
+ * The valid region for the image is set to the null region. The generic
+ * image code is notified that the image has changed.
*
*----------------------------------------------------------------------
*/
void
-Tk_PhotoBlank(handle)
- Tk_PhotoHandle handle; /* Handle for the image to be blanked. */
+Tk_PhotoBlank(
+ Tk_PhotoHandle handle) /* Handle for the image to be blanked. */
{
- PhotoMaster *masterPtr;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
PhotoInstance *instancePtr;
- masterPtr = (PhotoMaster *) handle;
masterPtr->ditherX = masterPtr->ditherY = 0;
masterPtr->flags = 0;
@@ -5416,16 +5407,16 @@ Tk_PhotoBlank(handle)
masterPtr->validRegion = TkCreateRegion();
/*
- * Clear out the 32-bit pixel storage array.
- * Clear out the dithering error arrays for each instance.
+ * Clear out the 32-bit pixel storage array. Clear out the dithering error
+ * arrays for each instance.
*/
- memset((VOID *) masterPtr->pix32, 0,
+ memset(masterPtr->pix32, 0,
(size_t) (masterPtr->width * masterPtr->height * 4));
for (instancePtr = masterPtr->instancePtr; instancePtr != NULL;
instancePtr = instancePtr->nextPtr) {
if (instancePtr->error) {
- memset((VOID *) instancePtr->error, 0,
+ memset(instancePtr->error, 0,
(size_t) (masterPtr->width * masterPtr->height
* 3 * sizeof(schar)));
}
@@ -5444,30 +5435,29 @@ Tk_PhotoBlank(handle)
*
* Tk_PhotoExpand --
*
- * This procedure is called to request that a photo image be
- * expanded if necessary to be at least `width' pixels wide and
- * `height' pixels high. If the user has declared a definite
- * image size (using the -width and -height configuration
- * options) then this call has no effect.
+ * This function is called to request that a photo image be expanded if
+ * necessary to be at least `width' pixels wide and `height' pixels high.
+ * If the user has declared a definite image size (using the -width and
+ * -height configuration options) then this call has no effect.
*
* Results:
* None.
*
* Side effects:
- * The size of the photo image may change; if so the generic
- * image code is informed.
+ * The size of the photo image may change; if so the generic image code
+ * is informed.
*
*----------------------------------------------------------------------
*/
-void
-Tk_PhotoExpand(handle, width, height)
- Tk_PhotoHandle handle; /* Handle for the image to be expanded. */
- int width, height; /* Desired minimum dimensions of the image. */
+int
+Tk_PhotoExpand(
+ Tcl_Interp *interp, /* Interpreter for passing back error
+ * messages, or NULL. */
+ Tk_PhotoHandle handle, /* Handle for the image to be expanded. */
+ int width, int height) /* Desired minimum dimensions of the image. */
{
- PhotoMaster *masterPtr;
-
- masterPtr = (PhotoMaster *) handle;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
if (width <= masterPtr->width) {
width = masterPtr->width;
@@ -5478,11 +5468,16 @@ Tk_PhotoExpand(handle, width, height)
if ((width != masterPtr->width) || (height != masterPtr->height)) {
if (ImgPhotoSetSize(masterPtr, MAX(width, masterPtr->width),
MAX(height, masterPtr->height)) == TCL_ERROR) {
- panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ if (interp != NULL) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
+ }
+ return TCL_ERROR;
}
Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0, masterPtr->width,
masterPtr->height);
}
+ return TCL_OK;
}
/*
@@ -5490,12 +5485,10 @@ Tk_PhotoExpand(handle, width, height)
*
* Tk_PhotoGetSize --
*
- * This procedure is called to obtain the current size of a photo
- * image.
+ * This function is called to obtain the current size of a photo image.
*
* Results:
- * The image's width and height are returned in *widthp
- * and *heightp.
+ * The image's width and height are returned in *widthp and *heightp.
*
* Side effects:
* None.
@@ -5504,15 +5497,15 @@ Tk_PhotoExpand(handle, width, height)
*/
void
-Tk_PhotoGetSize(handle, widthPtr, heightPtr)
- Tk_PhotoHandle handle; /* Handle for the image whose dimensions
- * are requested. */
- int *widthPtr, *heightPtr; /* The dimensions of the image are returned
+Tk_PhotoGetSize(
+ Tk_PhotoHandle handle, /* Handle for the image whose dimensions are
+ * requested. */
+ int *widthPtr, int *heightPtr)
+ /* The dimensions of the image are returned
* here. */
{
- PhotoMaster *masterPtr;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
- masterPtr = (PhotoMaster *) handle;
*widthPtr = masterPtr->width;
*heightPtr = masterPtr->height;
}
@@ -5522,38 +5515,42 @@ Tk_PhotoGetSize(handle, widthPtr, heightPtr)
*
* Tk_PhotoSetSize --
*
- * This procedure is called to set size of a photo image.
- * This call is equivalent to using the -width and -height
- * configuration options.
+ * This function is called to set size of a photo image. This call is
+ * equivalent to using the -width and -height configuration options.
*
* Results:
* None.
*
* Side effects:
- * The size of the image may change; if so the generic
- * image code is informed.
+ * The size of the image may change; if so the generic image code is
+ * informed.
*
*----------------------------------------------------------------------
*/
-void
-Tk_PhotoSetSize(handle, width, height)
- Tk_PhotoHandle handle; /* Handle for the image whose size is to
- * be set. */
- int width, height; /* New dimensions for the image. */
+int
+Tk_PhotoSetSize(
+ Tcl_Interp *interp, /* Interpreter for passing back error
+ * messages, or NULL. */
+ Tk_PhotoHandle handle, /* Handle for the image whose size is to be
+ * set. */
+ int width, int height) /* New dimensions for the image. */
{
- PhotoMaster *masterPtr;
-
- masterPtr = (PhotoMaster *) handle;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
masterPtr->userWidth = width;
masterPtr->userHeight = height;
if (ImgPhotoSetSize(masterPtr, ((width > 0) ? width: masterPtr->width),
((height > 0) ? height: masterPtr->height)) == TCL_ERROR) {
- panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ if (interp != NULL) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, TK_PHOTO_ALLOC_FAILURE_MESSAGE, NULL);
+ }
+ return TCL_ERROR;
}
Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0,
masterPtr->width, masterPtr->height);
+ return TCL_OK;
}
/*
@@ -5561,14 +5558,14 @@ Tk_PhotoSetSize(handle, width, height)
*
* TkGetPhotoValidRegion --
*
- * This procedure is called to get the part of the photo where
- * there is valid data. Or, conversely, the part of the photo
- * which is transparent.
+ * This function is called to get the part of the photo where there is
+ * valid data. Or, conversely, the part of the photo which is
+ * transparent.
*
* Results:
- * A TkRegion value that indicates the current area of the photo
- * that is valid. This value should not be used after any
- * modification to the photo image.
+ * A TkRegion value that indicates the current area of the photo that is
+ * valid. This value should not be used after any modification to the
+ * photo image.
*
* Side Effects:
* None.
@@ -5577,13 +5574,12 @@ Tk_PhotoSetSize(handle, width, height)
*/
TkRegion
-TkPhotoGetValidRegion(handle)
- Tk_PhotoHandle handle; /* Handle for the image whose valid region
- * is to obtained. */
+TkPhotoGetValidRegion(
+ Tk_PhotoHandle handle) /* Handle for the image whose valid region is
+ * to obtained. */
{
- PhotoMaster *masterPtr;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
- masterPtr = (PhotoMaster *) handle;
return masterPtr->validRegion;
}
@@ -5592,15 +5588,15 @@ TkPhotoGetValidRegion(handle)
*
* ImgGetPhoto --
*
- * This procedure is called to obtain image data from a photo
- * image. This procedure fills in the Tk_PhotoImageBlock structure
- * pointed to by `blockPtr' with details of the address and
- * layout of the image data in memory.
+ * This function is called to obtain image data from a photo image. This
+ * function fills in the Tk_PhotoImageBlock structure pointed to by
+ * `blockPtr' with details of the address and layout of the image data in
+ * memory.
*
* Results:
- * A pointer to the allocated data which should be freed later.
- * NULL if there is no need to free data because
- * blockPtr->pixelPtr points directly to the image data.
+ * A pointer to the allocated data which should be freed later. NULL if
+ * there is no need to free data because blockPtr->pixelPtr points
+ * directly to the image data.
*
* Side effects:
* None.
@@ -5609,13 +5605,13 @@ TkPhotoGetValidRegion(handle)
*/
static char *
-ImgGetPhoto(masterPtr, blockPtr, optPtr)
- PhotoMaster *masterPtr; /* Handle for the photo image from which
- * image data is desired. */
- Tk_PhotoImageBlock *blockPtr;
- /* Information about the address and layout
- * of the image data is returned here. */
- struct SubcommandOptions *optPtr;
+ImgGetPhoto(
+ PhotoMaster *masterPtr, /* Handle for the photo image from which image
+ * data is desired. */
+ Tk_PhotoImageBlock *blockPtr,
+ /* Information about the address and layout of
+ * the image data is returned here. */
+ struct SubcommandOptions *optPtr)
{
unsigned char *pixelPtr;
int x, y, greenOffset, blueOffset, alphaOffset;
@@ -5630,8 +5626,7 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
(!(optPtr->options & OPT_BACKGROUND)
|| ((optPtr->background->red == optPtr->background->green)
&& (optPtr->background->red == optPtr->background->blue)))) {
- blockPtr->offset[0] = blockPtr->offset[1] =
- blockPtr->offset[2];
+ blockPtr->offset[0] = blockPtr->offset[1] = blockPtr->offset[2];
}
alphaOffset = 0;
for (y = 0; y < blockPtr->height; y++) {
@@ -5657,13 +5652,14 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
greenOffset = blockPtr->offset[1] - blockPtr->offset[0];
blueOffset = blockPtr->offset[2] - blockPtr->offset[0];
if (((optPtr->options & OPT_BACKGROUND) && alphaOffset) ||
- ((optPtr->options & OPT_GRAYSCALE) && (greenOffset || blueOffset))) {
+ ((optPtr->options & OPT_GRAYSCALE) && (greenOffset||blueOffset))) {
int newPixelSize,x,y;
unsigned char *srcPtr, *destPtr;
char *data;
- newPixelSize = (!(optPtr->options & OPT_BACKGROUND) && alphaOffset) ? 2 : 1;
- if ((greenOffset || blueOffset) && !(optPtr->options & OPT_GRAYSCALE)) {
+ newPixelSize = (!(optPtr->options & OPT_BACKGROUND) && alphaOffset)
+ ? 2 : 1;
+ if ((greenOffset||blueOffset) && !(optPtr->options & OPT_GRAYSCALE)) {
newPixelSize += 2;
}
data = ckalloc((unsigned int) (newPixelSize *
@@ -5677,17 +5673,19 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
} else if (optPtr->options & OPT_GRAYSCALE) {
for (y = blockPtr->height; y > 0; y--) {
for (x = blockPtr->width; x > 0; x--) {
- *destPtr = (unsigned char) ((srcPtr[0] * 11 + srcPtr[1] * 16
- + srcPtr[2] * 5 + 16) >> 5);
+ *destPtr = (unsigned char) ((srcPtr[0]*11 + srcPtr[1]*16
+ + srcPtr[2]*5 + 16) >> 5);
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
} else {
for (y = blockPtr->height; y > 0; y--) {
@@ -5698,18 +5696,22 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
}
srcPtr = blockPtr->pixelPtr + alphaOffset;
destPtr = (unsigned char *) data;
if (!alphaOffset) {
- /* nothing to be done */
+ /*
+ * Nothing to be done.
+ */
} else if (optPtr->options & OPT_BACKGROUND) {
if (newPixelSize > 2) {
- int red = optPtr->background->red>>8;
- int green = optPtr->background->green>>8;
- int blue = optPtr->background->blue>>8;
+ int red = optPtr->background->red>>8;
+ int green = optPtr->background->green>>8;
+ int blue = optPtr->background->blue>>8;
+
for (y = blockPtr->height; y > 0; y--) {
for (x = blockPtr->width; x > 0; x--) {
destPtr[0] += (unsigned char) (((255 - *srcPtr) *
@@ -5721,12 +5723,14 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
} else {
int gray = (unsigned char) (((optPtr->background->red>>8) * 11
- + (optPtr->background->green>>8) * 16
- + (optPtr->background->blue>>8) * 5 + 16) >> 5);
+ + (optPtr->background->green>>8) * 16
+ + (optPtr->background->blue>>8) * 5 + 16) >> 5);
+
for (y = blockPtr->height; y > 0; y--) {
for (x = blockPtr->width; x > 0; x--) {
destPtr[0] += ((255 - *srcPtr) *
@@ -5734,7 +5738,8 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
}
} else {
@@ -5745,7 +5750,8 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
srcPtr += blockPtr->pixelSize;
destPtr += newPixelSize;
}
- srcPtr += blockPtr->pitch - (blockPtr->width * blockPtr->pixelSize);
+ srcPtr += blockPtr->pitch -
+ blockPtr->width * blockPtr->pixelSize;
}
}
blockPtr->pixelPtr = (unsigned char *) data;
@@ -5769,8 +5775,8 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
*
* ImgStringWrite --
*
- * Default string write function. The data is formatted in
- * the default format as accepted by the "<img> put" command.
+ * Default string write function. The data is formatted in the default
+ * format as accepted by the "<img> put" command.
*
* Results:
* A standard Tcl result.
@@ -5782,12 +5788,12 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
*/
static int
-ImgStringWrite(interp, formatString, blockPtr)
- Tcl_Interp *interp;
- Tcl_Obj *formatString;
- Tk_PhotoImageBlock *blockPtr;
+ImgStringWrite(
+ Tcl_Interp *interp,
+ Tcl_Obj *formatString,
+ Tk_PhotoImageBlock *blockPtr)
{
- int row,col;
+ int row, col;
char *line, *linePtr;
unsigned char *pixelPtr;
int greenOffset, blueOffset;
@@ -5822,14 +5828,14 @@ ImgStringWrite(interp, formatString, blockPtr)
*
* Tk_PhotoGetImage --
*
- * This procedure is called to obtain image data from a photo
- * image. This procedure fills in the Tk_PhotoImageBlock structure
- * pointed to by `blockPtr' with details of the address and
- * layout of the image data in memory.
+ * This function is called to obtain image data from a photo image. This
+ * function fills in the Tk_PhotoImageBlock structure pointed to by
+ * `blockPtr' with details of the address and layout of the image data in
+ * memory.
*
* Results:
- * TRUE (1) indicating that image data is available,
- * for backwards compatibility with the old photo widget.
+ * TRUE (1) indicating that image data is available, for backwards
+ * compatibility with the old photo widget.
*
* Side effects:
* None.
@@ -5838,16 +5844,15 @@ ImgStringWrite(interp, formatString, blockPtr)
*/
int
-Tk_PhotoGetImage(handle, blockPtr)
- Tk_PhotoHandle handle; /* Handle for the photo image from which
- * image data is desired. */
- Tk_PhotoImageBlock *blockPtr;
- /* Information about the address and layout
- * of the image data is returned here. */
+Tk_PhotoGetImage(
+ Tk_PhotoHandle handle, /* Handle for the photo image from which image
+ * data is desired. */
+ Tk_PhotoImageBlock *blockPtr)
+ /* Information about the address and layout of
+ * the image data is returned here. */
{
- PhotoMaster *masterPtr;
+ PhotoMaster *masterPtr = (PhotoMaster *) handle;
- masterPtr = (PhotoMaster *) handle;
blockPtr->pixelPtr = masterPtr->pix32;
blockPtr->width = masterPtr->width;
blockPtr->height = masterPtr->height;
@@ -5859,7 +5864,7 @@ Tk_PhotoGetImage(handle, blockPtr)
blockPtr->offset[3] = 3;
return 1;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -5877,57 +5882,56 @@ Tk_PhotoGetImage(handle, blockPtr)
*/
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) */
+ 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(interp, obj)
- Tcl_Interp *interp; /* Interpreter that is being deleted. */
- Tcl_Obj *obj; /* Name of option to be found. */
+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);
- OptionAssocData *list;
char *prevname = NULL;
- Tcl_ObjCmdProc *proc = (Tcl_ObjCmdProc *) NULL;
+ Tcl_ObjCmdProc *proc = NULL;
+ OptionAssocData *list = (OptionAssocData *) Tcl_GetAssocData(interp,
+ "photoOption", NULL);
- list = (OptionAssocData *) Tcl_GetAssocData(interp, "photoOption",
- (Tcl_InterpDeleteProc **) NULL);
- while (list != (OptionAssocData *) NULL) {
+ while (list != NULL) {
if (strncmp(name, list->name, (unsigned) length) == 0) {
- if (proc != (Tcl_ObjCmdProc *) NULL) {
+ if (proc != NULL) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "ambiguous option \"", name,
- "\": must be ", prevname, (char *) NULL);
- while (list->nextPtr != (OptionAssocData *) NULL) {
- Tcl_AppendResult(interp, prevname, ", ",(char *) NULL);
+ "\": must be ", prevname, NULL);
+ while (list->nextPtr != NULL) {
+ Tcl_AppendResult(interp, prevname, ", ",NULL);
list = list->nextPtr;
prevname = list->name;
}
- Tcl_AppendResult(interp, ", or", prevname, (char *) NULL);
- return (Tcl_ObjCmdProc *) NULL;
+ Tcl_AppendResult(interp, ", or", prevname, NULL);
+ return NULL;
}
proc = list->command;
prevname = list->name;
}
list = list->nextPtr;
}
- if (proc != (Tcl_ObjCmdProc *) NULL) {
+ if (proc != NULL) {
Tcl_ResetResult(interp);
}
return proc;
}
-
+
/*
*----------------------------------------------------------------------
*
* PhotoOptionCleanupProc --
*
- * This procedure is invoked whenever an interpreter is deleted
- * to cleanup the AssocData for "photoVisitor".
+ * This function is invoked whenever an interpreter is deleted to cleanup
+ * the AssocData for "photoVisitor".
*
* Results:
* None.
@@ -5939,49 +5943,47 @@ PhotoOptionFind(interp, obj)
*/
static void
-PhotoOptionCleanupProc(clientData, interp)
- ClientData clientData; /* Points to "photoVisitor" AssocData
- * for the interpreter. */
- Tcl_Interp *interp; /* Interpreter that is being deleted. */
+PhotoOptionCleanupProc(
+ ClientData clientData, /* Points to "photoVisitor" AssocData for the
+ * interpreter. */
+ Tcl_Interp *interp) /* Interpreter that is being deleted. */
{
OptionAssocData *list = (OptionAssocData *) clientData;
- OptionAssocData *ptr;
while (list != NULL) {
+ register OptionAssocData *ptr;
+
list = (ptr = list)->nextPtr;
ckfree((char *) ptr);
}
}
-
+
/*
*--------------------------------------------------------------
*
* Tk_CreatePhotoOption --
*
- * This procedure may be invoked to add a new kind of photo
- * option to the core photo command supported by Tk.
+ * 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.
+ * From now on, the new option will be useable by the photo command.
*
*--------------------------------------------------------------
*/
-void
-Tk_CreatePhotoOption(interp, name, proc)
- Tcl_Interp *interp; /* interpreter */
- CONST char *name; /* option name */
- Tcl_ObjCmdProc *proc; /* proc to execute 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;
-
- list = (OptionAssocData *) Tcl_GetAssocData(interp, "photoOption",
- (Tcl_InterpDeleteProc **) NULL);
+ OptionAssocData *list = (OptionAssocData *)
+ Tcl_GetAssocData(interp, "photoOption", NULL);
/*
* If there's already a photo option with the given name, remove it.
@@ -6004,7 +6006,7 @@ Tk_CreatePhotoOption(interp, name, proc)
ptr->command = proc;
ptr->nextPtr = list;
Tcl_SetAssocData(interp, "photoOption", PhotoOptionCleanupProc,
- (ClientData) ptr);
+ (ClientData) ptr);
}
/*
@@ -6012,9 +6014,8 @@ Tk_CreatePhotoOption(interp, name, proc)
*
* TkPostscriptPhoto --
*
- * This procedure is called to output the contents of a
- * photo image in Postscript by calling the Tk_PostscriptPhoto
- * function.
+ * This function is called to output the contents of a photo image in
+ * Postscript by calling the Tk_PostscriptPhoto function.
*
* Results:
* Returns a standard Tcl return value.
@@ -6024,16 +6025,16 @@ Tk_CreatePhotoOption(interp, name, proc)
*
*--------------------------------------------------------------
*/
+
static int
-ImgPhotoPostscript(clientData, interp, tkwin, psInfo,
- x, y, width, height, prepass)
- ClientData clientData; /* Handle for the photo image */
- Tcl_Interp *interp; /* Interpreter */
- Tk_Window tkwin; /* (unused) */
- Tk_PostscriptInfo psInfo; /* postscript info */
- int x, y; /* First pixel to output */
- int width, height; /* Width and height of area */
- int prepass; /* (unused) */
+ImgPhotoPostscript(
+ ClientData clientData, /* Handle for the photo image. */
+ Tcl_Interp *interp, /* Interpreter. */
+ Tk_Window tkwin, /* (unused) */
+ Tk_PostscriptInfo psInfo, /* Postscript info. */
+ int x, int y, /* First pixel to output. */
+ int width, int height, /* Width and height of area. */
+ int prepass) /* (unused) */
{
Tk_PhotoImageBlock block;
@@ -6048,29 +6049,105 @@ ImgPhotoPostscript(clientData, interp, tkwin, psInfo,
*
* Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite --
*
- * These backward-compatability functions just exist to fill slots in
- * stubs table. For the behaviour of *_NoComposite, refer to the
- * corresponding function without the extra suffix.
+ * These backward-compatability functions just exist to fill slots in stubs
+ * table. For the behaviour of *_NoComposite, refer to the corresponding
+ * function without the extra suffix, except that the compositing rule is
+ * always "overlay" and the function always panics on memory-allocation
+ * failure.
*
*----------------------------------------------------------------------
*/
+
void
-Tk_PhotoPutBlock_NoComposite(handle, blockPtr, x, y, width, height)
- Tk_PhotoHandle handle;
- Tk_PhotoImageBlock *blockPtr;
- int x, y, width, height;
+Tk_PhotoPutBlock_NoComposite(
+ Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr,
+ int x, int y, int width, int height)
{
- Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height,
- TK_PHOTO_COMPOSITE_OVERLAY);
+ if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height,
+ TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
}
void
-Tk_PhotoPutZoomedBlock_NoComposite(handle, blockPtr, x, y, width, height,
- zoomX, zoomY, subsampleX, subsampleY)
- Tk_PhotoHandle handle;
- Tk_PhotoImageBlock *blockPtr;
- int x, y, width, height, zoomX, zoomY, subsampleX, subsampleY;
+Tk_PhotoPutZoomedBlock_NoComposite(
+ Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr,
+ int x, int y, int width, int height,
+ int zoomX, int zoomY, int subsampleX, int subsampleY)
{
- Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height,
- zoomX, zoomY, subsampleX, subsampleY, TK_PHOTO_COMPOSITE_OVERLAY);
+ if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height,
+ zoomX, zoomY, subsampleX, subsampleY,
+ TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic,
+ * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic
+ *
+ * Backward compatability functions for preserving the old behaviour (i.e.
+ * panic on memory allocation failure) so that extensions do not need to be
+ * significantly updated to take account of TIP #116. These call the new
+ * interface (i.e. the interface without the extra suffix), but panic if an
+ * error condition is returned.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_PhotoExpand_Panic(
+ Tk_PhotoHandle handle,
+ int width, int height)
+{
+ if (Tk_PhotoExpand(NULL, handle, width, height) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
+}
+
+void
+Tk_PhotoPutBlock_Panic(
+ Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr,
+ int x, int y, int width, int height, int compRule)
+{
+ if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height,
+ compRule) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
+}
+
+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)
+{
+ if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height,
+ zoomX, zoomY, subsampleX, subsampleY, compRule) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
+}
+
+void
+Tk_PhotoSetSize_Panic(
+ Tk_PhotoHandle handle,
+ int width, int height)
+{
+ if (Tk_PhotoSetSize(NULL, handle, width, height) != TCL_OK) {
+ Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkImgUtil.c b/generic/tkImgUtil.c
index 0bb599a..8ba6c0e 100644
--- a/generic/tkImgUtil.c
+++ b/generic/tkImgUtil.c
@@ -1,16 +1,15 @@
-/*
+/*
* tkImgUtil.c --
*
* This file contains image related utility functions.
*
* Copyright (c) 1995 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkPort.h"
#include "xbytes.h"
@@ -19,12 +18,11 @@
*
* TkAlignImageData --
*
- * This function takes an image and copies the data into an
- * aligned buffer, performing any necessary bit swapping.
+ * This function takes an image and copies the data into an aligned
+ * buffer, performing any necessary bit swapping.
*
* Results:
- * Returns a newly allocated buffer that should be freed by the
- * caller.
+ * Returns a newly allocated buffer that should be freed by the caller.
*
* Side effects:
* None.
@@ -33,18 +31,19 @@
*/
char *
-TkAlignImageData(image, alignment, bitOrder)
- XImage *image; /* Image to be aligned. */
- int alignment; /* Number of bytes to which the data should
- * be aligned (e.g. 2 or 4) */
- int bitOrder; /* Desired bit order: LSBFirst or MSBFirst. */
+TkAlignImageData(
+ XImage *image, /* Image to be aligned. */
+ int alignment, /* Number of bytes to which the data should be
+ * aligned (e.g. 2 or 4) */
+ int bitOrder) /* Desired bit order: LSBFirst or MSBFirst. */
{
long dataWidth;
char *data, *srcPtr, *destPtr;
int i, j;
if (image->bits_per_pixel != 1) {
- panic("TkAlignImageData: Can't handle image depths greater than 1.");
+ Tcl_Panic(
+ "TkAlignImageData: Can't handle image depths greater than 1.");
}
/*
@@ -56,7 +55,7 @@ TkAlignImageData(image, alignment, bitOrder)
dataWidth += (alignment - (dataWidth % alignment));
}
- data = ckalloc(dataWidth * image->height);
+ data = ckalloc((unsigned) dataWidth * image->height);
destPtr = data;
for (i = 0; i < image->height; i++) {
@@ -74,3 +73,11 @@ TkAlignImageData(image, alignment, bitOrder)
}
return data;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkInitScript.h b/generic/tkInitScript.h
deleted file mode 100644
index 4997fe7..0000000
--- a/generic/tkInitScript.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * tkInitScript.h --
- *
- * This file contains Unix & Windows common init script
- * It is not used on the Mac. (the mac init script is in tkMacInit.c)
- *
- * Copyright (c) 1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-
-
-/*
- * In order to find tk.tcl during initialization, the following script
- * is invoked by Tk_Init(). It looks in several different directories:
- *
- * $tk_library - can specify a primary location, if set
- * no other locations will be checked
- *
- * $env(TK_LIBRARY) - highest priority so user can always override
- * the search path unless the application has
- * specified an exact directory above
- *
- * $tcl_library/../tk$tk_version
- * - look relative to init.tcl in an installed
- * lib directory (e.g. /usr/local)
- *
- * <executable directory>/../lib/tk$tk_version
- * - look for a lib/tk<ver> in a sibling of
- * the bin directory (e.g. /usr/local)
- *
- * <executable directory>/../library
- * - look in Tk build directory
- *
- * <executable directory>/../../tk$tk_patchLevel/library
- * - look for Tk build directory relative
- * to a parallel build directory
- *
- * The first directory on this path that contains a valid tk.tcl script
- * will be set ast the value of tk_library.
- *
- * Note that this entire search mechanism can be bypassed by defining an
- * alternate tkInit procedure before calling Tk_Init().
- */
-
-static char initScript[] = "if {[info proc tkInit]==\"\"} {\n\
- proc tkInit {} {\n\
- global tk_library tk_version tk_patchLevel\n\
- rename tkInit {}\n\
- tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
- }\n\
-}\n\
-tkInit";
-
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 9ecfb72..45447f5 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -1,697 +1,575 @@
- # tkInt.decls --
+# tkInt.decls --
#
-# This file contains the declarations for all unsupported
-# functions that are exported by the Tk library. This file
-# is used to generate the tkIntDecls.h, tkIntPlatDecls.h,
-# tkIntStub.c, and tkPlatStub.c files.
+# This file contains the declarations for all unsupported functions that
+# are exported by the Tk library. This file is used to generate the
+# tkIntDecls.h, tkIntPlatDecls.h, tkIntStub.c, and tkPlatStub.c files.
#
# 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.
library tk
+
+##############################################################################
# Define the unsupported generic interfaces.
interface tkInt
-# 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 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 {
- TkWindow * TkAllocWindow (TkDisplay *dispPtr, int screenNum, \
+ TkWindow *TkAllocWindow(TkDisplay *dispPtr, int screenNum,
TkWindow *parentPtr)
}
-
declare 1 generic {
- void TkBezierPoints (double control[], int numSteps, double *coordPtr)
+ void TkBezierPoints(double control[], int numSteps, double *coordPtr)
}
-
declare 2 generic {
- void TkBezierScreenPoints (Tk_Canvas canvas, double control[], \
+ void TkBezierScreenPoints(Tk_Canvas canvas, double control[],
int numSteps, XPoint *xPointPtr)
}
-
declare 3 generic {
- void TkBindDeadWindow (TkWindow *winPtr)
+ void TkBindDeadWindow(TkWindow *winPtr)
}
-
declare 4 generic {
- void TkBindEventProc (TkWindow *winPtr, XEvent *eventPtr)
+ void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr)
}
-
declare 5 generic {
- void TkBindFree (TkMainInfo *mainPtr)
+ void TkBindFree(TkMainInfo *mainPtr)
}
-
declare 6 generic {
- void TkBindInit (TkMainInfo *mainPtr)
+ void TkBindInit(TkMainInfo *mainPtr)
}
-
declare 7 generic {
- void TkChangeEventWindow (XEvent *eventPtr, TkWindow *winPtr)
+ void TkChangeEventWindow(XEvent *eventPtr, TkWindow *winPtr)
}
-
declare 8 generic {
- int TkClipInit (Tcl_Interp *interp, TkDisplay *dispPtr)
+ int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr)
}
-
declare 9 generic {
- void TkComputeAnchor (Tk_Anchor anchor, Tk_Window tkwin, \
- int padX, int padY, int innerWidth, int innerHeight, \
- int *xPtr, int *yPtr)
+ 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)
+ 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)
+ unsigned long TkCreateBindingProcedure(Tcl_Interp *interp,
+ Tk_BindingTable bindingTable, ClientData object,
+ CONST char *eventString, TkBindEvalProc *evalProc,
+ TkBindFreeProc *freeProc, ClientData clientData)
}
-
declare 12 generic {
- TkCursor * TkCreateCursorFromData (Tk_Window tkwin, \
- CONST char *source, CONST char *mask, int width, int height, \
+ TkCursor *TkCreateCursorFromData(Tk_Window tkwin,
+ CONST char *source, CONST char *mask, int width, int height,
int xHot, int yHot, XColor fg, XColor bg)
}
-
declare 13 generic {
- int TkCreateFrame (ClientData clientData, \
- Tcl_Interp *interp, int argc, char **argv, \
- int toplevel, char *appName)
+ int TkCreateFrame(ClientData clientData, Tcl_Interp *interp,
+ int argc, char **argv, int toplevel, char *appName)
}
-
declare 14 generic {
- Tk_Window TkCreateMainWindow (Tcl_Interp *interp, \
+ Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
CONST char *screenName, char *baseName)
}
-
declare 15 generic {
- Time TkCurrentTime (TkDisplay *dispPtr)
+ Time TkCurrentTime(TkDisplay *dispPtr)
}
-
declare 16 generic {
- void TkDeleteAllImages (TkMainInfo *mainPtr)
+ void TkDeleteAllImages(TkMainInfo *mainPtr)
}
-
declare 17 generic {
- void TkDoConfigureNotify (TkWindow *winPtr)
+ void TkDoConfigureNotify(TkWindow *winPtr)
}
-
declare 18 generic {
- void TkDrawInsetFocusHighlight (Tk_Window tkwin, GC gc, int width, \
+ void TkDrawInsetFocusHighlight(Tk_Window tkwin, GC gc, int width,
Drawable drawable, int padding)
}
-
declare 19 generic {
- void TkEventDeadWindow (TkWindow *winPtr)
+ void TkEventDeadWindow(TkWindow *winPtr)
}
-
declare 20 generic {
- void TkFillPolygon (Tk_Canvas canvas, \
- double *coordPtr, int numPoints, Display *display, \
- Drawable drawable, GC gc, GC outlineGC)
+ 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)
+ int TkFindStateNum(Tcl_Interp *interp, CONST char *option,
+ CONST TkStateMap *mapPtr, CONST char *strKey)
}
-
declare 22 generic {
- char * TkFindStateString (CONST TkStateMap *mapPtr, int numKey)
+ char *TkFindStateString(CONST TkStateMap *mapPtr, int numKey)
}
-
declare 23 generic {
- void TkFocusDeadWindow (TkWindow *winPtr)
+ void TkFocusDeadWindow(TkWindow *winPtr)
}
-
declare 24 generic {
- int TkFocusFilterEvent (TkWindow *winPtr, XEvent *eventPtr)
+ int TkFocusFilterEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-
declare 25 generic {
- TkWindow * TkFocusKeyEvent (TkWindow *winPtr, XEvent *eventPtr)
+ TkWindow *TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-
declare 26 generic {
- void TkFontPkgInit (TkMainInfo *mainPtr)
+ void TkFontPkgInit(TkMainInfo *mainPtr)
}
-
declare 27 generic {
- void TkFontPkgFree (TkMainInfo *mainPtr)
+ void TkFontPkgFree(TkMainInfo *mainPtr)
}
-
declare 28 generic {
- void TkFreeBindingTags (TkWindow *winPtr)
+ void TkFreeBindingTags(TkWindow *winPtr)
}
# Name change only, TkFreeCursor in Tcl 8.0.x now TkpFreeCursor
declare 29 generic {
- void TkpFreeCursor (TkCursor *cursorPtr)
+ void TkpFreeCursor(TkCursor *cursorPtr)
}
-
declare 30 generic {
- char * TkGetBitmapData (Tcl_Interp *interp, \
- char *string, char *fileName, int *widthPtr, \
- int *heightPtr, int *hotXPtr, int *hotYPtr)
+ char *TkGetBitmapData(Tcl_Interp *interp, char *string,
+ char *fileName, int *widthPtr, int *heightPtr,
+ int *hotXPtr, int *hotYPtr)
}
-
declare 31 generic {
- void TkGetButtPoints (double p1[], double p2[], \
+ void TkGetButtPoints(double p1[], double p2[],
double width, int project, double m1[], double m2[])
}
-
declare 32 generic {
- TkCursor * TkGetCursorByName (Tcl_Interp *interp, \
+ TkCursor *TkGetCursorByName(Tcl_Interp *interp,
Tk_Window tkwin, Tk_Uid string)
}
-
declare 33 generic {
- CONST84_RETURN char * TkGetDefaultScreenName (Tcl_Interp *interp, \
+ CONST84_RETURN char *TkGetDefaultScreenName(Tcl_Interp *interp,
CONST char *screenName)
}
-
declare 34 generic {
- TkDisplay * TkGetDisplay (Display *display)
+ TkDisplay *TkGetDisplay(Display *display)
}
-
declare 35 generic {
- int TkGetDisplayOf (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \
+ int TkGetDisplayOf(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[],
Tk_Window *tkwinPtr)
}
-
declare 36 generic {
- TkWindow * TkGetFocusWin (TkWindow *winPtr)
+ TkWindow *TkGetFocusWin(TkWindow *winPtr)
}
-
declare 37 generic {
- int TkGetInterpNames (Tcl_Interp *interp, Tk_Window tkwin)
+ int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin)
}
-
declare 38 generic {
- int TkGetMiterPoints (double p1[], double p2[], double p3[], \
- double width, double m1[],double m2[])
+ int TkGetMiterPoints(double p1[], double p2[], double p3[],
+ double width, double m1[], double m2[])
}
-
declare 39 generic {
- void TkGetPointerCoords (Tk_Window tkwin, int *xPtr, int *yPtr)
+ void TkGetPointerCoords(Tk_Window tkwin, int *xPtr, int *yPtr)
}
-
declare 40 generic {
- void TkGetServerInfo (Tcl_Interp *interp, Tk_Window tkwin)
+ void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin)
}
-
declare 41 generic {
- void TkGrabDeadWindow (TkWindow *winPtr)
+ void TkGrabDeadWindow(TkWindow *winPtr)
}
-
declare 42 generic {
- int TkGrabState (TkWindow *winPtr)
+ int TkGrabState(TkWindow *winPtr)
}
-
declare 43 generic {
- void TkIncludePoint (Tk_Item *itemPtr, double *pointPtr)
+ void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr)
}
-
declare 44 generic {
- void TkInOutEvents (XEvent *eventPtr, TkWindow *sourcePtr, \
- TkWindow *destPtr, int leaveType, int enterType, \
+ void TkInOutEvents(XEvent *eventPtr, TkWindow *sourcePtr,
+ TkWindow *destPtr, int leaveType, int enterType,
Tcl_QueuePosition position)
}
-
declare 45 generic {
- void TkInstallFrameMenu (Tk_Window tkwin)
+ void TkInstallFrameMenu(Tk_Window tkwin)
}
-
declare 46 generic {
- char * TkKeysymToString (KeySym keysym)
+ char *TkKeysymToString(KeySym keysym)
}
-
declare 47 generic {
- int TkLineToArea (double end1Ptr[], double end2Ptr[], double rectPtr[])
+ int TkLineToArea(double end1Ptr[], double end2Ptr[], double rectPtr[])
}
-
declare 48 generic {
- double TkLineToPoint (double end1Ptr[], \
- double end2Ptr[], double pointPtr[])
+ double TkLineToPoint(double end1Ptr[], double end2Ptr[], double pointPtr[])
}
-
declare 49 generic {
- int TkMakeBezierCurve (Tk_Canvas canvas, \
- double *pointPtr, int numPoints, int numSteps, \
- XPoint xPoints[], double dblPoints[])
+ int TkMakeBezierCurve(Tk_Canvas canvas, double *pointPtr, int numPoints,
+ int numSteps, XPoint xPoints[], double dblPoints[])
}
-
declare 50 generic {
- void TkMakeBezierPostscript (Tcl_Interp *interp, \
+ void TkMakeBezierPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, double *pointPtr, int numPoints)
}
-
declare 51 generic {
- void TkOptionClassChanged (TkWindow *winPtr)
+ void TkOptionClassChanged(TkWindow *winPtr)
}
-
declare 52 generic {
- void TkOptionDeadWindow (TkWindow *winPtr)
+ void TkOptionDeadWindow(TkWindow *winPtr)
}
-
declare 53 generic {
- int TkOvalToArea (double *ovalPtr, double *rectPtr)
+ int TkOvalToArea(double *ovalPtr, double *rectPtr)
}
-
declare 54 generic {
- double TkOvalToPoint (double ovalPtr[], \
+ double TkOvalToPoint(double ovalPtr[],
double width, int filled, double pointPtr[])
}
-
declare 55 generic {
- int TkpChangeFocus (TkWindow *winPtr, int force)
+ int TkpChangeFocus(TkWindow *winPtr, int force)
}
-
declare 56 generic {
- void TkpCloseDisplay (TkDisplay *dispPtr)
+ void TkpCloseDisplay(TkDisplay *dispPtr)
}
-
declare 57 generic {
- void TkpClaimFocus (TkWindow *topLevelPtr, int force)
+ void TkpClaimFocus(TkWindow *topLevelPtr, int force)
}
-
declare 58 generic {
- void TkpDisplayWarning (CONST char *msg, CONST char *title)
+ void TkpDisplayWarning(CONST char *msg, CONST char *title)
}
-
declare 59 generic {
- void TkpGetAppName (Tcl_Interp *interp, Tcl_DString *name)
+ void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name)
}
-
declare 60 generic {
- TkWindow * TkpGetOtherWindow (TkWindow *winPtr)
+ TkWindow *TkpGetOtherWindow(TkWindow *winPtr)
}
-
declare 61 generic {
- TkWindow * TkpGetWrapperWindow (TkWindow *winPtr)
+ TkWindow *TkpGetWrapperWindow(TkWindow *winPtr)
}
-
declare 62 generic {
- int TkpInit (Tcl_Interp *interp)
+ int TkpInit(Tcl_Interp *interp)
}
-
declare 63 generic {
- void TkpInitializeMenuBindings (Tcl_Interp *interp, \
+ void TkpInitializeMenuBindings(Tcl_Interp *interp,
Tk_BindingTable bindingTable)
}
-
declare 64 generic {
- void TkpMakeContainer (Tk_Window tkwin)
+ void TkpMakeContainer(Tk_Window tkwin)
}
-
declare 65 generic {
- void TkpMakeMenuWindow (Tk_Window tkwin, int transient)
+ void TkpMakeMenuWindow(Tk_Window tkwin, int transient)
}
-
declare 66 generic {
- Window TkpMakeWindow (TkWindow *winPtr, Window parent)
+ Window TkpMakeWindow(TkWindow *winPtr, Window parent)
}
-
declare 67 generic {
- void TkpMenuNotifyToplevelCreate (Tcl_Interp *interp1, char *menuName)
+ void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1, char *menuName)
}
-
declare 68 generic {
- TkDisplay * TkpOpenDisplay (CONST char *display_name)
+ TkDisplay *TkpOpenDisplay(CONST char *display_name)
}
-
declare 69 generic {
- int TkPointerEvent (XEvent *eventPtr, TkWindow *winPtr)
+ int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr)
}
-
declare 70 generic {
- int TkPolygonToArea (double *polyPtr, int numPoints, double *rectPtr)
+ int TkPolygonToArea(double *polyPtr, int numPoints, double *rectPtr)
}
-
declare 71 generic {
- double TkPolygonToPoint (double *polyPtr, int numPoints, double *pointPtr)
+ double TkPolygonToPoint(double *polyPtr, int numPoints, double *pointPtr)
}
-
declare 72 generic {
- int TkPositionInTree (TkWindow *winPtr, TkWindow *treePtr)
+ int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr)
}
-
declare 73 generic {
- void TkpRedirectKeyEvent (TkWindow *winPtr, XEvent *eventPtr)
+ void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr)
}
-
declare 74 generic {
- void TkpSetMainMenubar (Tcl_Interp *interp, \
- Tk_Window tkwin, char *menuName)
+ void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, char *menuName)
}
-
declare 75 generic {
- int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
+ int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
}
-
declare 76 generic {
- int TkpWindowWasRecentlyDeleted (Window win, TkDisplay *dispPtr)
+ int TkpWindowWasRecentlyDeleted(Window win, TkDisplay *dispPtr)
}
-
declare 77 generic {
- void TkQueueEventForAllChildren (TkWindow *winPtr, XEvent *eventPtr)
+ void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr)
}
-
declare 78 generic {
- 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)
+ 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 {
- int TkScrollWindow (Tk_Window tkwin, GC gc, \
- int x, int y, int width, int height, int dx, \
- int dy, TkRegion damageRgn)
+ int TkScrollWindow(Tk_Window tkwin, GC gc, int x, int y,
+ int width, int height, int dx, int dy, TkRegion damageRgn)
}
-
declare 80 generic {
- void TkSelDeadWindow (TkWindow *winPtr)
+ void TkSelDeadWindow(TkWindow *winPtr)
}
-
declare 81 generic {
- void TkSelEventProc (Tk_Window tkwin, XEvent *eventPtr)
+ void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr)
}
-
declare 82 generic {
- void TkSelInit (Tk_Window tkwin)
+ void TkSelInit(Tk_Window tkwin)
}
-
declare 83 generic {
- void TkSelPropProc (XEvent *eventPtr)
+ void TkSelPropProc(XEvent *eventPtr)
}
# Exported publically as Tk_SetClassProcs in 8.4a2
#declare 84 generic {
-# void TkSetClassProcs (Tk_Window tkwin, \
+# void TkSetClassProcs(Tk_Window tkwin,
# TkClassProcs *procs, ClientData instanceData)
#}
declare 85 generic {
- void TkSetWindowMenuBar (Tcl_Interp *interp, \
- Tk_Window tkwin, char *oldMenuName, char *menuName)
+ void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin,
+ char *oldMenuName, char *menuName)
}
-
declare 86 generic {
- KeySym TkStringToKeysym (char *name)
+ KeySym TkStringToKeysym(char *name)
}
-
declare 87 generic {
- int TkThickPolyLineToArea (double *coordPtr, \
- int numPoints, double width, int capStyle, \
- int joinStyle, double *rectPtr)
+ int TkThickPolyLineToArea(double *coordPtr, int numPoints,
+ double width, int capStyle, int joinStyle, double *rectPtr)
}
-
declare 88 generic {
- void TkWmAddToColormapWindows (TkWindow *winPtr)
+ void TkWmAddToColormapWindows(TkWindow *winPtr)
}
-
declare 89 generic {
- void TkWmDeadWindow (TkWindow *winPtr)
+ void TkWmDeadWindow(TkWindow *winPtr)
}
-
declare 90 generic {
- TkWindow * TkWmFocusToplevel (TkWindow *winPtr)
+ TkWindow *TkWmFocusToplevel(TkWindow *winPtr)
}
-
declare 91 generic {
- void TkWmMapWindow (TkWindow *winPtr)
+ void TkWmMapWindow(TkWindow *winPtr)
}
-
declare 92 generic {
- void TkWmNewWindow (TkWindow *winPtr)
+ void TkWmNewWindow(TkWindow *winPtr)
}
-
declare 93 generic {
- void TkWmProtocolEventProc (TkWindow *winPtr, XEvent *evenvPtr)
+ void TkWmProtocolEventProc(TkWindow *winPtr, XEvent *evenvPtr)
}
-
declare 94 generic {
- void TkWmRemoveFromColormapWindows (TkWindow *winPtr)
+ void TkWmRemoveFromColormapWindows(TkWindow *winPtr)
}
-
declare 95 generic {
- void TkWmRestackToplevel (TkWindow *winPtr, int aboveBelow, \
+ void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow,
TkWindow *otherPtr)
}
-
declare 96 generic {
- void TkWmSetClass (TkWindow *winPtr)
+ void TkWmSetClass(TkWindow *winPtr)
}
-
declare 97 generic {
- void TkWmUnmapWindow (TkWindow *winPtr)
+ void TkWmUnmapWindow(TkWindow *winPtr)
}
# new for 8.1
declare 98 generic {
- Tcl_Obj * TkDebugBitmap ( Tk_Window tkwin, char *name)
+ Tcl_Obj *TkDebugBitmap(Tk_Window tkwin, char *name)
}
-
declare 99 generic {
- Tcl_Obj * TkDebugBorder ( Tk_Window tkwin, char *name)
+ Tcl_Obj *TkDebugBorder(Tk_Window tkwin, char *name)
}
-
declare 100 generic {
- Tcl_Obj * TkDebugCursor ( Tk_Window tkwin, char *name)
+ Tcl_Obj *TkDebugCursor(Tk_Window tkwin, char *name)
}
-
declare 101 generic {
- Tcl_Obj * TkDebugColor ( Tk_Window tkwin, char *name)
+ Tcl_Obj *TkDebugColor(Tk_Window tkwin, char *name)
}
-
declare 102 generic {
- Tcl_Obj * TkDebugConfig (Tcl_Interp *interp, Tk_OptionTable table)
+ Tcl_Obj *TkDebugConfig(Tcl_Interp *interp, Tk_OptionTable table)
}
-
declare 103 generic {
- Tcl_Obj * TkDebugFont ( Tk_Window tkwin, char *name)
+ Tcl_Obj *TkDebugFont(Tk_Window tkwin, char *name)
}
-
declare 104 generic {
- int TkFindStateNumObj (Tcl_Interp *interp, \
- Tcl_Obj *optionPtr, CONST TkStateMap *mapPtr, \
- Tcl_Obj *keyPtr)
+ int TkFindStateNumObj(Tcl_Interp *interp, Tcl_Obj *optionPtr,
+ CONST TkStateMap *mapPtr, Tcl_Obj *keyPtr)
}
-
declare 105 generic {
- Tcl_HashTable * TkGetBitmapPredefTable (void)
+ Tcl_HashTable *TkGetBitmapPredefTable(void)
}
-
declare 106 generic {
- TkDisplay * TkGetDisplayList (void)
+ TkDisplay *TkGetDisplayList(void)
}
-
declare 107 generic {
- TkMainInfo * TkGetMainInfoList (void)
+ TkMainInfo *TkGetMainInfoList(void)
}
-
declare 108 generic {
- int TkGetWindowFromObj (Tcl_Interp *interp, \
- Tk_Window tkwin, Tcl_Obj *objPtr, \
- Tk_Window *windowPtr)
+ 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)
+ char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr)
}
-
declare 110 generic {
- void TkpGetSubFonts (Tcl_Interp *interp, Tk_Font tkfont)
+ void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont)
}
-
declare 111 generic {
- Tcl_Obj * TkpGetSystemDefault (Tk_Window tkwin, \
+ Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin,
CONST char *dbName, CONST char *className)
}
-
declare 112 generic {
- void TkpMenuThreadInit (void)
+ void TkpMenuThreadInit(void)
}
-
-declare 113 {mac aqua win} {
- void TkClipBox (TkRegion rgn, XRectangle* rect_return)
+declare 113 {aqua win} {
+ void TkClipBox(TkRegion rgn, XRectangle *rect_return)
}
-
-declare 114 {mac aqua win} {
- TkRegion TkCreateRegion (void)
+declare 114 {aqua win} {
+ TkRegion TkCreateRegion(void)
}
-
-declare 115 {mac aqua win} {
- void TkDestroyRegion (TkRegion rgn)
+declare 115 {aqua win} {
+ void TkDestroyRegion(TkRegion rgn)
}
-
-declare 116 {mac aqua win} {
- void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return)
+declare 116 {aqua win} {
+ void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
-
-declare 117 {mac aqua win} {
- int TkRectInRegion (TkRegion rgn, int x, int y, unsigned int width, \
+declare 117 {aqua win} {
+ int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
unsigned int height)
}
-
-declare 118 {mac aqua win} {
- void TkSetRegion (Display* display, GC gc, TkRegion rgn)
+declare 118 {aqua win} {
+ void TkSetRegion(Display *display, GC gc, TkRegion rgn)
}
-
-declare 119 {mac aqua win} {
- void TkUnionRectWithRegion (XRectangle* rect, \
+declare 119 {aqua win} {
+ void TkUnionRectWithRegion(XRectangle *rect,
TkRegion src, TkRegion dr_return)
}
-
-# removed duplicate from tkIntPlat table
-#declare 120 mac {
-# void TkGenerateActivateEvents (TkWindow *winPtr, int active)
-#}
-
-declare 121 {mac aqua} {
- Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
+declare 121 aqua {
+ Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source)
}
-
-declare 122 {mac aqua} {
- void TkpDefineNativeBitmaps (void)
+declare 122 aqua {
+ void TkpDefineNativeBitmaps(void)
}
-
-# removed duplicate from tkIntPlat table
-#declare 123 mac {
-# unsigned long TkpGetMS (void)
-#}
-
-declare 124 {mac aqua} {
- Pixmap TkpGetNativeAppBitmap (Display *display, \
+declare 124 aqua {
+ Pixmap TkpGetNativeAppBitmap(Display *display,
CONST char *name, int *width, int *height)
}
-
-# removed duplicates from tkIntPlat table
-#declare 125 mac {
-# void TkPointerDeadWindow (TkWindow *winPtr)
-#}
-#
-#declare 126 mac {
-# void TkpSetCapture (TkWindow *winPtr)
-#}
-#
-#declare 127 mac {
-# void TkpSetCursor (TkpCursor cursor)
-#}
-#
-#declare 128 mac {
-# void TkpWmSetState (TkWindow *winPtr, int state)
-#}
-#
-#declare 130 mac {
-# Window TkGetTransientMaster (TkWindow *winPtr)
-#}
-#
-#declare 131 mac {
-# int TkGenerateButtonEvent (int x, int y, \
-# Window window, unsigned int state)
-#}
-#
-#declare 133 mac {
-# void TkGenWMDestroyEvent (Tk_Window tkwin)
-#}
-#
-#declare 134 mac {
-# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
-# int width, int height, int flags)
-#}
-
declare 135 generic {
- void TkpDrawHighlightBorder (Tk_Window tkwin, GC fgGC, GC bgGC, \
+ void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC,
int highlightWidth, Drawable drawable)
}
-
declare 136 generic {
- void TkSetFocusWin (TkWindow *winPtr, int force)
+ void TkSetFocusWin(TkWindow *winPtr, int force)
}
-
declare 137 generic {
- void TkpSetKeycodeAndState (Tk_Window tkwin, KeySym keySym, \
+ void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym,
XEvent *eventPtr)
}
-
declare 138 generic {
- KeySym TkpGetKeySym (TkDisplay *dispPtr, XEvent *eventPtr)
+ KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr)
}
-
declare 139 generic {
- void TkpInitKeymapInfo (TkDisplay *dispPtr)
+ void TkpInitKeymapInfo(TkDisplay *dispPtr)
}
-
declare 140 generic {
- TkRegion TkPhotoGetValidRegion (Tk_PhotoHandle handle)
+ TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle)
}
-
declare 141 generic {
- TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr)
+ TkWindow **TkWmStackorderToplevel(TkWindow *parentPtr)
}
-
declare 142 generic {
void TkFocusFree(TkMainInfo *mainPtr)
}
-
declare 143 generic {
void TkClipCleanup(TkDisplay *dispPtr)
}
-
declare 144 generic {
void TkGCCleanup(TkDisplay *dispPtr)
}
-
-declare 145 {mac win aqua} {
- void TkSubtractRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return)
+declare 145 {win aqua} {
+ void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
-
declare 146 generic {
- void TkStylePkgInit (TkMainInfo *mainPtr)
+ void TkStylePkgInit(TkMainInfo *mainPtr)
}
declare 147 generic {
- void TkStylePkgFree (TkMainInfo *mainPtr)
+ void TkStylePkgFree(TkMainInfo *mainPtr)
}
-
declare 148 generic {
Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp,
CONST char *cmdName)
}
-
declare 149 generic {
- CONST Tk_OptionSpec * TkGetOptionSpec (CONST char *name,
- Tk_OptionTable optionTable)
+ CONST Tk_OptionSpec *TkGetOptionSpec(CONST char *name,
+ Tk_OptionTable optionTable)
}
-# TIP#168 - 8.5+
-#declare 150 generic {
-# int TkMakeRawCurve (Tk_Canvas canvas,
-# double *pointPtr, int numPoints, int numSteps,
-# XPoint xPoints[], double dblPoints[])
-#}
-#declare 151 generic {
-# void TkMakeRawCurvePostscript (Tcl_Interp *interp,
-# Tk_Canvas canvas, double *pointPtr, int numPoints)
-#}
-
+# TIP#168
+declare 150 generic {
+ int TkMakeRawCurve(Tk_Canvas canvas, double *pointPtr, int numPoints,
+ int numSteps, XPoint xPoints[], double dblPoints[])
+}
+declare 151 generic {
+ void TkMakeRawCurvePostscript(Tcl_Interp *interp,
+ Tk_Canvas canvas, double *pointPtr, int numPoints)
+}
declare 152 generic {
void TkpDrawFrame(Tk_Window tkwin, Tk_3DBorder border,
- int highlightWidth, int borderWidth, int relief)
+ int highlightWidth, int borderWidth, int relief)
+}
+declare 153 generic {
+ void TkCreateThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData)
+}
+declare 154 generic {
+ void TkDeleteThreadExitHandler(Tcl_ExitProc *proc, ClientData clientData)
}
+# entries needed only by tktest:
+declare 156 generic {
+ int TkpTestembedCmd(ClientData clientData, Tcl_Interp *interp, int argc,
+ CONST char **argv)
+}
+declare 157 generic {
+ 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 {
+ int TkStateParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 170 generic {
+ char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+declare 171 generic {
+ int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 172 generic {
+ char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+declare 173 generic {
+ int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 174 generic {
+ char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+declare 175 generic {
+ int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 176 generic {
+ char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+declare 177 generic {
+ int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 178 generic {
+ char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+declare 179 generic {
+ int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
+}
+declare 180 generic {
+ char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin,
+ char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
+}
+
##############################################################################
# Define the platform specific internal Tcl interface. These functions are
@@ -699,200 +577,160 @@ declare 152 generic {
interface tkIntPlat
-#########################
+################################
# Unix specific functions
declare 0 x11 {
- void TkCreateXEventSource (void)
+ void TkCreateXEventSource(void)
}
-
declare 1 x11 {
- void TkFreeWindowId (TkDisplay *dispPtr, Window w)
+ void TkFreeWindowId(TkDisplay *dispPtr, Window w)
}
-
declare 2 x11 {
- void TkInitXId (TkDisplay *dispPtr)
+ void TkInitXId(TkDisplay *dispPtr)
}
-
declare 3 x11 {
- int TkpCmapStressed (Tk_Window tkwin, Colormap colormap)
+ int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
}
-
declare 4 x11 {
- void TkpSync (Display *display)
+ void TkpSync(Display *display)
}
-
declare 5 x11 {
- Window TkUnixContainerId (TkWindow *winPtr)
+ Window TkUnixContainerId(TkWindow *winPtr)
}
-
declare 6 x11 {
- int TkUnixDoOneXEvent (Tcl_Time *timePtr)
+ int TkUnixDoOneXEvent(Tcl_Time *timePtr)
}
-
declare 7 x11 {
- void TkUnixSetMenubar (Tk_Window tkwin, Tk_Window menubar)
+ 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)
+ void TkWmCleanup(TkDisplay *dispPtr)
}
-
declare 10 x11 {
- void TkSendCleanup (TkDisplay *dispPtr)
+ void TkSendCleanup(TkDisplay *dispPtr)
}
-
declare 11 x11 {
- void TkFreeXId (TkDisplay *dispPtr)
+ void TkFreeXId(TkDisplay *dispPtr)
}
-
declare 12 x11 {
- int TkpWmSetState (TkWindow *winPtr, int state)
+ 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)
}
-############################
+################################
# Windows specific functions
declare 0 win {
- char * TkAlignImageData (XImage *image, int alignment, int bitOrder)
+ char *TkAlignImageData(XImage *image, int alignment, int bitOrder)
}
-
declare 2 win {
- void TkGenerateActivateEvents (TkWindow *winPtr, int active)
+ void TkGenerateActivateEvents(TkWindow *winPtr, int active)
}
-
declare 3 win {
- unsigned long TkpGetMS (void)
+ unsigned long TkpGetMS(void)
}
-
declare 4 win {
- void TkPointerDeadWindow (TkWindow *winPtr)
+ void TkPointerDeadWindow(TkWindow *winPtr)
}
-
declare 5 win {
- void TkpPrintWindowId (char *buf, Window window)
+ 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)
+ void TkpSetCapture(TkWindow *winPtr)
}
-
declare 8 win {
- void TkpSetCursor (TkpCursor cursor)
+ void TkpSetCursor(TkpCursor cursor)
}
-
declare 9 win {
- void TkpWmSetState (TkWindow *winPtr, int state)
+ void TkpWmSetState(TkWindow *winPtr, int state)
}
-
declare 10 win {
- void TkSetPixmapColormap (Pixmap pixmap, Colormap colormap)
+ void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap)
}
-
declare 11 win {
- void TkWinCancelMouseTimer (void)
+ void TkWinCancelMouseTimer(void)
}
-
declare 12 win {
- void TkWinClipboardRender (TkDisplay *dispPtr, UINT format)
+ void TkWinClipboardRender(TkDisplay *dispPtr, UINT format)
}
-
declare 13 win {
- LRESULT TkWinEmbeddedEventProc (HWND hwnd, UINT message, \
+ LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
}
-
declare 14 win {
- void TkWinFillRect (HDC dc, int x, int y, int width, int height, \
- int pixel)
+ void TkWinFillRect(HDC dc, int x, int y, int width, int height, int pixel)
}
-
declare 15 win {
- COLORREF TkWinGetBorderPixels (Tk_Window tkwin, Tk_3DBorder border, \
+ COLORREF TkWinGetBorderPixels(Tk_Window tkwin, Tk_3DBorder border,
int which)
}
-
declare 16 win {
- HDC TkWinGetDrawableDC (Display *display, Drawable d, TkWinDCState* state)
+ HDC TkWinGetDrawableDC(Display *display, Drawable d, TkWinDCState *state)
}
-
declare 17 win {
- int TkWinGetModifierState (void)
+ int TkWinGetModifierState(void)
}
-
declare 18 win {
- HPALETTE TkWinGetSystemPalette (void)
+ HPALETTE TkWinGetSystemPalette(void)
}
-
declare 19 win {
- HWND TkWinGetWrapperWindow (Tk_Window tkwin)
+ HWND TkWinGetWrapperWindow(Tk_Window tkwin)
}
-
declare 20 win {
- int TkWinHandleMenuEvent (HWND *phwnd, \
- UINT *pMessage, WPARAM *pwParam, LPARAM *plParam, \
- LRESULT *plResult)
+ int TkWinHandleMenuEvent(HWND *phwnd, UINT *pMessage, WPARAM *pwParam,
+ LPARAM *plParam, LRESULT *plResult)
}
-
declare 21 win {
- int TkWinIndexOfColor (XColor *colorPtr)
+ int TkWinIndexOfColor(XColor *colorPtr)
}
-
declare 22 win {
- void TkWinReleaseDrawableDC (Drawable d, HDC hdc, TkWinDCState* state)
+ void TkWinReleaseDrawableDC(Drawable d, HDC hdc, TkWinDCState *state)
}
-
declare 23 win {
- LRESULT TkWinResendEvent (WNDPROC wndproc, HWND hwnd, XEvent *eventPtr)
+ LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd, XEvent *eventPtr)
}
-
declare 24 win {
- HPALETTE TkWinSelectPalette (HDC dc, Colormap colormap)
+ HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap)
}
-
declare 25 win {
- void TkWinSetMenu (Tk_Window tkwin, HMENU hMenu)
+ void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu)
}
-
declare 26 win {
- void TkWinSetWindowPos (HWND hwnd, HWND siblingHwnd, int pos)
+ void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd, int pos)
}
-
declare 27 win {
- void TkWinWmCleanup (HINSTANCE hInstance)
+ void TkWinWmCleanup(HINSTANCE hInstance)
}
-
declare 28 win {
- void TkWinXCleanup (ClientData clientData)
+ void TkWinXCleanup(ClientData clientData)
}
-
declare 29 win {
- void TkWinXInit (HINSTANCE hInstance)
+ void TkWinXInit(HINSTANCE hInstance)
}
# new for 8.1
declare 30 win {
- void TkWinSetForegroundWindow (TkWindow *winPtr)
+ void TkWinSetForegroundWindow(TkWindow *winPtr)
}
-
declare 31 win {
- void TkWinDialogDebug (int debug)
+ void TkWinDialogDebug(int debug)
}
-
declare 32 win {
- Tcl_Obj * TkWinGetMenuSystemDefault (Tk_Window tkwin, \
+ Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin,
CONST char *dbName, CONST char *className)
}
-
declare 33 win {
int TkWinGetPlatformId(void)
}
@@ -900,475 +738,200 @@ declare 33 win {
# new for 8.4.1
declare 34 win {
- void TkWinSetHINSTANCE (HINSTANCE hInstance)
-}
-
-########################
-# Mac specific functions
-
-declare 0 mac {
- void TkGenerateActivateEvents (TkWindow *winPtr, int active)
-}
-
-# removed duplicates from tkInt table
-#declare 1 mac {
-# Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
-#}
-#
-#declare 2 mac {
-# void TkpDefineNativeBitmaps (void)
-#}
-
-declare 3 mac {
- unsigned long TkpGetMS (void)
-}
-
-declare 5 mac {
- void TkPointerDeadWindow (TkWindow *winPtr)
-}
-
-declare 6 mac {
- void TkpSetCapture (TkWindow *winPtr)
+ void TkWinSetHINSTANCE(HINSTANCE hInstance)
}
-
-declare 7 mac {
- void TkpSetCursor (TkpCursor cursor)
-}
-
-declare 8 mac {
- void TkpWmSetState (TkWindow *winPtr, int state)
-}
-
-declare 10 mac {
- void TkAboutDlg (void)
-}
-
-declare 13 mac {
- Window TkGetTransientMaster (TkWindow *winPtr)
-}
-
-declare 14 mac {
- int TkGenerateButtonEvent (int x, int y, \
- Window window, unsigned int state)
-}
-
-declare 16 mac {
- void TkGenWMDestroyEvent (Tk_Window tkwin)
-}
-
-# removed duplicate from tkPlat table (tk.decls)
-#declare 17 mac {
-# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
-# int width, int height, int flags)
-#}
-
-declare 18 mac {
- unsigned int TkMacButtonKeyState (void)
-}
-
-declare 19 mac {
- void TkMacClearMenubarActive (void)
-}
-
-# removed duplicate from tkPlat table (tk.decls)
-#declare 20 mac {
-# int TkMacConvertEvent (EventRecord *eventPtr)
-#}
-
-declare 21 mac {
- int TkMacDispatchMenuEvent (int menuID, int index)
-}
-
-declare 22 mac {
- void TkMacInstallCursor (int resizeOverride)
-}
-
-# removed duplicate from tkPlat table (tk.decls)
-#declare 23 mac {
-# int TkMacConvertTkEvent (EventRecord *eventPtr, Window window)
-#}
-
-declare 24 mac {
- void TkMacHandleTearoffMenu (void)
-}
-
-# removed duplicate from tkPlat table (tk.decls)
-#declare 26 mac {
-# void TkMacInvalClipRgns (TkWindow *winPtr)
-#}
-
-declare 27 mac {
- void TkMacDoHLEvent (EventRecord *theEvent)
-}
-
-declare 29 mac {
- Time TkMacGenerateTime (void)
-}
-
-# removed duplicate from tkPlat table (tk.decls)
-#declare 30 mac {
-# GWorldPtr TkMacGetDrawablePort (Drawable drawable)
-#}
-
-declare 31 mac {
- TkWindow * TkMacGetScrollbarGrowWindow (TkWindow *winPtr)
-}
-
-declare 32 mac {
- Window TkMacGetXWindow (WindowRef macWinPtr)
-}
-
-declare 33 mac {
- int TkMacGrowToplevel (WindowRef whichWindow, Point start)
-}
-
-declare 34 mac {
- void TkMacHandleMenuSelect (long mResult, int optionKeyPressed)
-}
-
-# removed duplicates from tkPlat table (tk.decls)
-#declare 35 mac {
-# int TkMacHaveAppearance (void)
-#}
-#
-#declare 36 mac {
-# void TkMacInitAppleEvents (Tcl_Interp *interp)
-#}
-#
-#declare 37 mac {
-# void TkMacInitMenus (Tcl_Interp *interp)
-#}
-
-declare 38 mac {
- void TkMacInvalidateWindow (MacDrawable *macWin, int flag)
-}
-
-declare 39 mac {
- int TkMacIsCharacterMissing (Tk_Font tkfont, unsigned int searchChar)
-}
-
-declare 40 mac {
- void TkMacMakeRealWindowExist (TkWindow *winPtr)
-}
-
-declare 41 mac {
- BitMapPtr TkMacMakeStippleMap(Drawable d1, Drawable d2)
-}
-
-declare 42 mac {
- void TkMacMenuClick (void)
-}
-
-declare 43 mac {
- void TkMacRegisterOffScreenWindow (Window window, GWorldPtr portPtr)
-}
-
-declare 44 mac {
- int TkMacResizable (TkWindow *winPtr)
-}
-
-declare 46 mac {
- void TkMacSetHelpMenuItemCount (void)
-}
-
-declare 47 mac {
- void TkMacSetScrollbarGrow (TkWindow *winPtr, int flag)
-}
-
-declare 48 mac {
- void TkMacSetUpClippingRgn (Drawable drawable)
-}
-
-declare 49 mac {
- void TkMacSetUpGraphicsPort (GC gc)
-}
-
-declare 50 mac {
- void TkMacUpdateClipRgn (TkWindow *winPtr)
-}
-
-declare 51 mac {
- void TkMacUnregisterMacWindow (GWorldPtr portPtr)
-}
-
-declare 52 mac {
- int TkMacUseMenuID (short macID)
-}
-
-declare 53 mac {
- RgnHandle TkMacVisableClipRgn (TkWindow *winPtr)
-}
-
-declare 54 mac {
- void TkMacWinBounds (TkWindow *winPtr, Rect *geometry)
-}
-
-declare 55 mac {
- void TkMacWindowOffset (WindowRef wRef, int *xOffset, int *yOffset)
-}
-
-declare 57 mac {
- int TkSetMacColor (unsigned long pixel, RGBColor *macColor)
-}
-
-declare 58 mac {
- void TkSetWMName (TkWindow *winPtr, Tk_Uid titleUid)
-}
-
-declare 59 mac {
- void TkSuspendClipboard (void)
-}
-
-declare 61 mac {
- int TkMacZoomToplevel (WindowPtr whichWindow, Point where, short zoomPart)
-}
-
-declare 62 mac {
- Tk_Window Tk_TopCoordsToWindow (Tk_Window tkwin, \
- int rootX, int rootY, int *newX, int *newY)
-}
-
-declare 63 mac {
- MacDrawable * TkMacContainerId (TkWindow *winPtr)
-}
-
-declare 64 mac {
- MacDrawable * TkMacGetHostToplevel (TkWindow *winPtr)
-}
-
-declare 65 mac {
- void TkMacPreprocessMenu (void)
+declare 35 win {
+ int TkWinGetPlatformTheme(void)
}
-declare 66 mac {
- int TkpIsWindowFloating (WindowRef window)
-}
+# Exported through stub table since Tk 8.5.9
-declare 35 win {
- int TkWinGetPlatformTheme (void)
+declare 36 win {
+ LRESULT CALLBACK TkWinChildProc(HWND hwnd,
+ UINT message, WPARAM wParam, LPARAM lParam)
}
-########################
-# Mac OS X specific functions
+################################
+# Aqua specific functions
declare 0 aqua {
- void TkGenerateActivateEvents (TkWindow *winPtr, int active)
+ void TkGenerateActivateEvents(TkWindow *winPtr, int active)
}
# removed duplicates from tkInt table
#declare 1 aqua {
-# Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
+# Pixmap TkpCreateNativeBitmap(Display *display, CONST char *source)
#}
#
#declare 2 aqua {
-# void TkpDefineNativeBitmaps (void)
+# void TkpDefineNativeBitmaps(void)
#}
declare 3 aqua {
- void TkPointerDeadWindow (TkWindow *winPtr)
+ void TkPointerDeadWindow(TkWindow *winPtr)
}
-
declare 4 aqua {
- void TkpSetCapture (TkWindow *winPtr)
+ void TkpSetCapture(TkWindow *winPtr)
}
-
declare 5 aqua {
- void TkpSetCursor (TkpCursor cursor)
+ void TkpSetCursor(TkpCursor cursor)
}
-
declare 6 aqua {
- void TkpWmSetState (TkWindow *winPtr, int state)
+ void TkpWmSetState(TkWindow *winPtr, int state)
}
-
declare 7 aqua {
- void TkAboutDlg (void)
+ void TkAboutDlg(void)
}
-
declare 8 aqua {
- unsigned int TkMacOSXButtonKeyState (void)
+ unsigned int TkMacOSXButtonKeyState(void)
}
-
declare 9 aqua {
- void TkMacOSXClearMenubarActive (void)
+ void TkMacOSXClearMenubarActive(void)
}
-
declare 10 aqua {
- int TkMacOSXDispatchMenuEvent (int menuID, int index)
+ int TkMacOSXDispatchMenuEvent(int menuID, int index)
}
-
declare 11 aqua {
- void TkMacOSXInstallCursor (int resizeOverride)
+ void TkMacOSXInstallCursor(int resizeOverride)
}
-
declare 12 aqua {
- void TkMacOSXHandleTearoffMenu (void)
+ void TkMacOSXHandleTearoffMenu(void)
}
-# removed duplicate from tkPlat table (tk.decls)
+# removed duplicate from tkPlat table(tk.decls)
#declare 13 aqua {
-# void TkMacOSXInvalClipRgns (TkWindow *winPtr)
+# void TkMacOSXInvalClipRgns(TkWindow *winPtr)
#}
declare 14 aqua {
- int TkMacOSXDoHLEvent (EventRecord *theEvent)
+ int TkMacOSXDoHLEvent(EventRecord *theEvent)
}
-# removed duplicate from tkPlat table (tk.decls)
+# removed duplicate from tkPlat table(tk.decls)
#declare 15 aqua {
-# GWorldPtr TkMacOSXGetDrawablePort (Drawable drawable)
+# GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable)
#}
declare 16 aqua {
- Window TkMacOSXGetXWindow (WindowRef macWinPtr)
+ Window TkMacOSXGetXWindow(WindowRef macWinPtr)
}
-
declare 17 aqua {
- int TkMacOSXGrowToplevel (WindowRef whichWindow, Point start)
+ int TkMacOSXGrowToplevel(WindowRef whichWindow, Point start)
}
-
declare 18 aqua {
- void TkMacOSXHandleMenuSelect(MenuID theMenu, MenuItemIndex theItem, int optionKeyPressed)
+ void TkMacOSXHandleMenuSelect(MenuID theMenu, MenuItemIndex theItem,
+ int optionKeyPressed)
}
-# removed duplicates from tkPlat table (tk.decls)
+# removed duplicates from tkPlat table(tk.decls)
#declare 19 aqua {
-# void TkMacOSXInitAppleEvents (Tcl_Interp *interp)
+# void TkMacOSXInitAppleEvents(Tcl_Interp *interp)
#}
#
#declare 20 aqua {
-# void TkMacOSXInitMenus (Tcl_Interp *interp)
+# void TkMacOSXInitMenus(Tcl_Interp *interp)
#}
declare 21 aqua {
- void TkMacOSXInvalidateWindow (MacDrawable *macWin, int flag)
+ void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag)
}
-
declare 22 aqua {
- int TkMacOSXIsCharacterMissing (Tk_Font tkfont, unsigned int searchChar)
+ int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar)
}
-
declare 23 aqua {
- void TkMacOSXMakeRealWindowExist (TkWindow *winPtr)
+ void TkMacOSXMakeRealWindowExist(TkWindow *winPtr)
}
-
declare 24 aqua {
BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2)
}
-
declare 25 aqua {
- void TkMacOSXMenuClick (void)
+ void TkMacOSXMenuClick(void)
}
-
declare 26 aqua {
- void TkMacOSXRegisterOffScreenWindow (Window window, GWorldPtr portPtr)
+ void TkMacOSXRegisterOffScreenWindow(Window window, GWorldPtr portPtr)
}
-
declare 27 aqua {
- int TkMacOSXResizable (TkWindow *winPtr)
+ int TkMacOSXResizable(TkWindow *winPtr)
}
-
declare 28 aqua {
- void TkMacOSXSetHelpMenuItemCount (void)
+ void TkMacOSXSetHelpMenuItemCount(void)
}
-
declare 29 aqua {
- void TkMacOSXSetScrollbarGrow (TkWindow *winPtr, int flag)
+ void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag)
}
-
declare 30 aqua {
- void TkMacOSXSetUpClippingRgn (Drawable drawable)
+ void TkMacOSXSetUpClippingRgn(Drawable drawable)
}
-
declare 31 aqua {
- void TkMacOSXSetUpGraphicsPort (GC gc, GWorldPtr destPort)
+ void TkMacOSXSetUpGraphicsPort(GC gc, GWorldPtr destPort)
}
-
declare 32 aqua {
- void TkMacOSXUpdateClipRgn (TkWindow *winPtr)
+ void TkMacOSXUpdateClipRgn(TkWindow *winPtr)
}
-
declare 33 aqua {
- void TkMacOSXUnregisterMacWindow (WindowRef portPtr)
+ void TkMacOSXUnregisterMacWindow(WindowRef portPtr)
}
-
declare 34 aqua {
- int TkMacOSXUseMenuID (short macID)
+ int TkMacOSXUseMenuID(short macID)
}
-
declare 35 aqua {
- RgnHandle TkMacOSXVisableClipRgn (TkWindow *winPtr)
+ RgnHandle TkMacOSXVisableClipRgn(TkWindow *winPtr)
}
-
declare 36 aqua {
- void TkMacOSXWinBounds (TkWindow *winPtr, Rect *geometry)
+ void TkMacOSXWinBounds(TkWindow *winPtr, Rect *geometry)
}
-
declare 37 aqua {
- void TkMacOSXWindowOffset (WindowRef wRef, int *xOffset, int *yOffset)
+ void TkMacOSXWindowOffset(WindowRef wRef, int *xOffset, int *yOffset)
}
-
declare 38 aqua {
- int TkSetMacColor (unsigned long pixel, RGBColor *macColor)
+ int TkSetMacColor(unsigned long pixel, RGBColor *macColor)
}
-
declare 39 aqua {
- void TkSetWMName (TkWindow *winPtr, Tk_Uid titleUid)
+ void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid)
}
-
declare 40 aqua {
- void TkSuspendClipboard (void)
+ void TkSuspendClipboard(void)
}
-
declare 41 aqua {
- int TkMacOSXZoomToplevel (WindowPtr whichWindow, short zoomPart)
+ int TkMacOSXZoomToplevel(WindowPtr whichWindow, short zoomPart)
}
-
declare 42 aqua {
- Tk_Window Tk_TopCoordsToWindow (Tk_Window tkwin, \
- int rootX, int rootY, int *newX, int *newY)
+ Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX, int rootY,
+ int *newX, int *newY)
}
-
declare 43 aqua {
- MacDrawable * TkMacOSXContainerId (TkWindow *winPtr)
+ MacDrawable *TkMacOSXContainerId(TkWindow *winPtr)
}
-
declare 44 aqua {
- MacDrawable * TkMacOSXGetHostToplevel (TkWindow *winPtr)
+ MacDrawable *TkMacOSXGetHostToplevel(TkWindow *winPtr)
}
-
declare 45 aqua {
- void TkMacOSXPreprocessMenu (void)
+ void TkMacOSXPreprocessMenu(void)
}
-
declare 46 aqua {
- int TkpIsWindowFloating (WindowRef window)
+ int TkpIsWindowFloating(WindowRef window)
}
-
declare 47 aqua {
- Tk_Window TkMacOSXGetCapture (void)
+ Tk_Window TkMacOSXGetCapture(void)
}
-
declare 49 aqua {
- Window TkGetTransientMaster (TkWindow *winPtr)
+ Window TkGetTransientMaster(TkWindow *winPtr)
}
-
declare 50 aqua {
- int TkGenerateButtonEvent (int x, int y, \
- Window window, unsigned int state)
+ int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state)
}
-
declare 51 aqua {
- void TkGenWMDestroyEvent (Tk_Window tkwin)
+ void TkGenWMDestroyEvent(Tk_Window tkwin)
}
# removed duplicate from tkPlat table (tk.decls)
#declare 52 aqua {
-# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
+# void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y,
# int width, int height, int flags)
#}
declare 53 aqua {
- unsigned long TkpGetMS (void)
+ unsigned long TkpGetMS(void)
}
##############################################################################
@@ -1378,899 +941,704 @@ declare 53 aqua {
interface tkIntXlib
+################################
# X functions for Windows
declare 0 win {
- void XSetDashes (Display* display, GC gc, int dash_offset,
- _Xconst char* dash_list, int n)
+ void XSetDashes(Display *display, GC gc, int dash_offset,
+ _Xconst char *dash_list, int n)
}
-
declare 1 win {
- XModifierKeymap* XGetModifierMapping (Display* d)
+ XModifierKeymap *XGetModifierMapping(Display *d)
}
-
declare 2 win {
- XImage * XCreateImage (Display* d, Visual* v, unsigned int ui1, int i1, \
- int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, \
+ XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1,
+ int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3,
int i4)
-
}
-
declare 3 win {
- XImage *XGetImage (Display* d, Drawable dr, int i1, int i2, \
+ XImage *XGetImage(Display *d, Drawable dr, int i1, int i2,
unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)
}
-
declare 4 win {
- char *XGetAtomName (Display* d,Atom a)
-
+ char *XGetAtomName(Display *d, Atom a)
}
-
declare 5 win {
- char *XKeysymToString (KeySym k)
+ char *XKeysymToString(KeySym k)
}
-
declare 6 win {
- Colormap XCreateColormap (Display* d, Window w, Visual* v, int i)
-
+ Colormap XCreateColormap(Display *d, Window w, Visual *v, int i)
}
-
declare 7 win {
- Cursor XCreatePixmapCursor (Display* d, Pixmap p1, Pixmap p2, \
- XColor* x1, XColor* x2, \
- unsigned int ui1, unsigned int ui2)
+ Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2,
+ XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2)
}
-
declare 8 win {
- Cursor XCreateGlyphCursor (Display* d, Font f1, Font f2, \
- unsigned int ui1, unsigned int ui2, XColor* x1, XColor* x2)
+ Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2,
+ unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2)
}
-
declare 9 win {
- GContext XGContextFromGC (GC g)
+ GContext XGContextFromGC(GC g)
}
-
declare 10 win {
- XHostAddress *XListHosts (Display* d, int* i, Bool* b)
+ XHostAddress *XListHosts(Display *d, int *i, Bool *b)
}
# second parameter was of type KeyCode
declare 11 win {
- KeySym XKeycodeToKeysym (Display* d, unsigned int k, int i)
+ KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i)
}
-
declare 12 win {
- KeySym XStringToKeysym (_Xconst char* c)
+ KeySym XStringToKeysym(_Xconst char *c)
}
-
declare 13 win {
- Window XRootWindow (Display* d, int i)
+ Window XRootWindow(Display *d, int i)
}
-
declare 14 win {
- XErrorHandler XSetErrorHandler (XErrorHandler x)
+ XErrorHandler XSetErrorHandler(XErrorHandler x)
}
-
declare 15 win {
- Status XIconifyWindow (Display* d, Window w, int i)
+ Status XIconifyWindow(Display *d, Window w, int i)
}
-
declare 16 win {
- Status XWithdrawWindow (Display* d, Window w, int i)
+ Status XWithdrawWindow(Display *d, Window w, int i)
}
-
declare 17 win {
- Status XGetWMColormapWindows (Display* d, Window w, Window** wpp, int* ip)
+ Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip)
}
-
declare 18 win {
- Status XAllocColor (Display* d, Colormap c, XColor* xp)
+ Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
-
declare 19 win {
- void XBell (Display* d, int i)
+ void XBell(Display *d, int i)
}
-
declare 20 win {
- void XChangeProperty (Display* d, Window w, Atom a1, Atom a2, int i1, \
- int i2, _Xconst unsigned char* c, int i3)
+ void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
+ int i2, _Xconst unsigned char *c, int i3)
}
-
declare 21 win {
- void XChangeWindowAttributes (Display* d, Window w, unsigned long ul, \
- XSetWindowAttributes* x)
+ void XChangeWindowAttributes(Display *d, Window w, unsigned long ul,
+ XSetWindowAttributes *x)
}
-
declare 22 win {
- void XClearWindow (Display* d, Window w)
+ void XClearWindow(Display *d, Window w)
}
-
declare 23 win {
- void XConfigureWindow (Display* d, Window w, unsigned int i, \
- XWindowChanges* x)
+ void XConfigureWindow(Display *d, Window w, unsigned int i,
+ XWindowChanges *x)
}
-
declare 24 win {
- void XCopyArea (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \
- int i2, unsigned int ui1, \
- unsigned int ui2, int i3, int i4)
+ void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
declare 25 win {
- void XCopyPlane (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \
- int i2, unsigned int ui1, \
+ void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4, unsigned long ul)
}
-
declare 26 win {
- Pixmap XCreateBitmapFromData(Display* display, Drawable d, \
- _Xconst char* data, unsigned int width,unsigned int height)
+ Pixmap XCreateBitmapFromData(Display *display, Drawable d,
+ _Xconst char *data, unsigned int width, unsigned int height)
}
-
declare 27 win {
- void XDefineCursor (Display* d, Window w, Cursor c)
+ void XDefineCursor(Display *d, Window w, Cursor c)
}
-
declare 28 win {
- void XDeleteProperty (Display* d, Window w, Atom a)
+ void XDeleteProperty(Display *d, Window w, Atom a)
}
-
declare 29 win {
- void XDestroyWindow (Display* d, Window w)
+ void XDestroyWindow(Display *d, Window w)
}
-
declare 30 win {
- void XDrawArc (Display* d, Drawable dr, GC g, int i1, int i2, \
+ void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
declare 31 win {
- void XDrawLines (Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)
+ void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
}
-
declare 32 win {
- void XDrawRectangle (Display* d, Drawable dr, GC g, int i1, int i2,\
+ void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2)
}
-
declare 33 win {
- void XFillArc (Display* d, Drawable dr, GC g, int i1, int i2, \
+ void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
declare 34 win {
- void XFillPolygon (Display* d, Drawable dr, GC g, XPoint* x, \
+ void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2, int i3)
}
-
declare 35 win {
- void XFillRectangles (Display* d, Drawable dr, GC g, XRectangle* x, int i)
+ void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
-
declare 36 win {
- void XForceScreenSaver (Display* d, int i)
+ void XForceScreenSaver(Display *d, int i)
}
-
declare 37 win {
- void XFreeColormap (Display* d, Colormap c)
+ void XFreeColormap(Display *d, Colormap c)
}
-
declare 38 win {
- void XFreeColors (Display* d, Colormap c, \
- unsigned long* ulp, int i, unsigned long ul)
+ void XFreeColors(Display *d, Colormap c,
+ unsigned long *ulp, int i, unsigned long ul)
}
-
declare 39 win {
- void XFreeCursor (Display* d, Cursor c)
+ void XFreeCursor(Display *d, Cursor c)
}
-
declare 40 win {
- void XFreeModifiermap (XModifierKeymap* x)
+ void XFreeModifiermap(XModifierKeymap *x)
}
-
declare 41 win {
- Status XGetGeometry (Display* d, Drawable dr, Window* w, int* i1, \
- int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, \
- unsigned int* ui4)
+ Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
+ int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3,
+ unsigned int *ui4)
}
-
declare 42 win {
- void XGetInputFocus (Display* d, Window* w, int* i)
+ void XGetInputFocus(Display *d, Window *w, int *i)
}
-
declare 43 win {
- 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)
+ int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2,
+ Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1,
+ unsigned long *ulp2, unsigned char **cpp)
}
-
declare 44 win {
- Status XGetWindowAttributes (Display* d, Window w, XWindowAttributes* x)
+ Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x)
}
-
declare 45 win {
- int XGrabKeyboard (Display* d, Window w, Bool b, int i1, int i2, Time t)
+ int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t)
}
-
declare 46 win {
- int XGrabPointer (Display* d, Window w1, Bool b, unsigned int ui, \
+ int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui,
int i1, int i2, Window w2, Cursor c, Time t)
}
-
declare 47 win {
- KeyCode XKeysymToKeycode (Display* d, KeySym k)
+ KeyCode XKeysymToKeycode(Display *d, KeySym k)
}
-
declare 48 win {
- Status XLookupColor (Display* d, Colormap c1, _Xconst char* c2, \
- XColor* x1, XColor* x2)
+ Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2,
+ XColor *x1, XColor *x2)
}
-
declare 49 win {
- void XMapWindow (Display* d, Window w)
+ void XMapWindow(Display *d, Window w)
}
-
declare 50 win {
- void XMoveResizeWindow (Display* d, Window w, int i1, int i2, \
+ void XMoveResizeWindow(Display *d, Window w, int i1, int i2,
unsigned int ui1, unsigned int ui2)
}
-
declare 51 win {
- void XMoveWindow (Display* d, Window w, int i1, int i2)
+ void XMoveWindow(Display *d, Window w, int i1, int i2)
}
-
declare 52 win {
- void XNextEvent (Display* d, XEvent* x)
+ void XNextEvent(Display *d, XEvent *x)
}
-
declare 53 win {
- void XPutBackEvent (Display* d, XEvent* x)
+ void XPutBackEvent(Display *d, XEvent *x)
}
-
declare 54 win {
- void XQueryColors (Display* d, Colormap c, XColor* x, int i)
+ void XQueryColors(Display *d, Colormap c, XColor *x, int i)
}
-
declare 55 win {
- Bool XQueryPointer (Display* d, Window w1, Window* w2, Window* w3, \
- int* i1, int* i2, int* i3, int* i4, unsigned int* ui)
+ Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3,
+ int *i1, int *i2, int *i3, int *i4, unsigned int *ui)
}
-
declare 56 win {
- Status XQueryTree (Display* d, Window w1, Window* w2, Window* w3, \
- Window** w4, unsigned int* ui)
+ Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3,
+ Window **w4, unsigned int *ui)
}
-
declare 57 win {
- void XRaiseWindow (Display* d, Window w)
+ void XRaiseWindow(Display *d, Window w)
}
-
declare 58 win {
- void XRefreshKeyboardMapping (XMappingEvent* x)
+ void XRefreshKeyboardMapping(XMappingEvent *x)
}
-
declare 59 win {
- void XResizeWindow (Display* d, Window w, unsigned int ui1, \
+ void XResizeWindow(Display *d, Window w, unsigned int ui1,
unsigned int ui2)
}
-
declare 60 win {
- void XSelectInput (Display* d, Window w, long l)
+ void XSelectInput(Display *d, Window w, long l)
}
-
declare 61 win {
- Status XSendEvent (Display* d, Window w, Bool b, long l, XEvent* x)
+ 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)
+ void XSetIconName(Display *d, Window w, _Xconst char *c)
}
-
declare 64 win {
- void XSetInputFocus (Display* d, Window w, int i, Time t)
+ void XSetInputFocus(Display *d, Window w, int i, Time t)
}
-
declare 65 win {
- void XSetSelectionOwner (Display* d, Atom a, Window w, Time t)
+ void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
-
declare 66 win {
- void XSetWindowBackground (Display* d, Window w, unsigned long ul)
+ void XSetWindowBackground(Display *d, Window w, unsigned long ul)
}
-
declare 67 win {
- void XSetWindowBackgroundPixmap (Display* d, Window w, Pixmap p)
+ void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p)
}
-
declare 68 win {
- void XSetWindowBorder (Display* d, Window w, unsigned long ul)
+ void XSetWindowBorder(Display *d, Window w, unsigned long ul)
}
-
declare 69 win {
- void XSetWindowBorderPixmap (Display* d, Window w, Pixmap p)
+ void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p)
}
-
declare 70 win {
- void XSetWindowBorderWidth (Display* d, Window w, unsigned int ui)
+ void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui)
}
-
declare 71 win {
- void XSetWindowColormap (Display* d, Window w, Colormap c)
+ void XSetWindowColormap(Display *d, Window w, Colormap c)
}
-
declare 72 win {
- Bool XTranslateCoordinates (Display* d, Window w1, Window w2, int i1,\
- int i2, int* i3, int* i4, Window* w3)
+ Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1,
+ int i2, int *i3, int *i4, Window *w3)
}
-
declare 73 win {
- void XUngrabKeyboard (Display* d, Time t)
+ void XUngrabKeyboard(Display *d, Time t)
}
-
declare 74 win {
- void XUngrabPointer (Display* d, Time t)
+ void XUngrabPointer(Display *d, Time t)
}
-
declare 75 win {
- void XUnmapWindow (Display* d, Window w)
+ void XUnmapWindow(Display *d, Window w)
}
-
declare 76 win {
- void XWindowEvent (Display* d, Window w, long l, XEvent* x)
+ void XWindowEvent(Display *d, Window w, long l, XEvent *x)
}
-
declare 77 win {
- void XDestroyIC (XIC x)
+ void XDestroyIC(XIC x)
}
-
declare 78 win {
- Bool XFilterEvent (XEvent* x, Window w)
+ Bool XFilterEvent(XEvent *x, Window w)
}
-
declare 79 win {
- int XmbLookupString (XIC xi, XKeyPressedEvent* xk, \
- char* c, int i, KeySym* k, Status* s)
+ int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i,
+ KeySym *k, Status *s)
}
-
declare 80 win {
- 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)
+ 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)
}
# This slot is reserved for use by the clipping rectangle patch:
# declare 81 win {
-# XSetClipRectangles(Display *display, GC gc, int clip_x_origin, \
+# XSetClipRectangles(Display *display, GC gc, int clip_x_origin,
# int clip_y_origin, XRectangle rectangles[], int n, int ordering)
# }
declare 82 win {
- Status XParseColor (Display *display, Colormap map, \
- _Xconst char* spec, XColor *colorPtr)
+ Status XParseColor(Display *display, Colormap map,
+ _Xconst char *spec, XColor *colorPtr)
}
-
declare 83 win {
- GC XCreateGC(Display* display, Drawable d, \
- unsigned long valuemask, XGCValues* values)
+ GC XCreateGC(Display *display, Drawable d,
+ unsigned long valuemask, XGCValues *values)
}
-
declare 84 win {
- void XFreeGC(Display* display, GC gc)
+ void XFreeGC(Display *display, GC gc)
}
-
declare 85 win {
- Atom XInternAtom(Display* display,_Xconst char* atom_name, \
+ Atom XInternAtom(Display *display, _Xconst char *atom_name,
Bool only_if_exists)
}
-
declare 86 win {
- void XSetBackground(Display* display, GC gc, \
- unsigned long foreground)
+ void XSetBackground(Display *display, GC gc, unsigned long foreground)
}
-
declare 87 win {
- void XSetForeground(Display* display, GC gc, \
- unsigned long foreground)
+ void XSetForeground(Display *display, GC gc, unsigned long foreground)
}
-
declare 88 win {
- void XSetClipMask(Display* display, GC gc, Pixmap pixmap)
+ void XSetClipMask(Display *display, GC gc, Pixmap pixmap)
}
-
declare 89 win {
- void XSetClipOrigin(Display* display, GC gc, \
+ void XSetClipOrigin(Display *display, GC gc,
int clip_x_origin, int clip_y_origin)
}
-
declare 90 win {
- void XSetTSOrigin(Display* display, GC gc, \
+ void XSetTSOrigin(Display *display, GC gc,
int ts_x_origin, int ts_y_origin)
}
-
declare 91 win {
- void XChangeGC(Display * d, GC gc, unsigned long mask, XGCValues *values)
+ void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values)
}
-
declare 92 win {
void XSetFont(Display *display, GC gc, Font font)
}
-
declare 93 win {
void XSetArcMode(Display *display, GC gc, int arc_mode)
}
-
declare 94 win {
void XSetStipple(Display *display, GC gc, Pixmap stipple)
}
-
declare 95 win {
void XSetFillRule(Display *display, GC gc, int fill_rule)
}
-
declare 96 win {
void XSetFillStyle(Display *display, GC gc, int fill_style)
}
-
declare 97 win {
void XSetFunction(Display *display, GC gc, int function)
}
-
declare 98 win {
- void XSetLineAttributes(Display *display, GC gc, \
- unsigned int line_width, int line_style, \
- int cap_style, int join_style)
+ void XSetLineAttributes(Display *display, GC gc, unsigned int line_width,
+ int line_style, int cap_style, int join_style)
}
-
declare 99 win {
int _XInitImageFuncPtrs(XImage *image)
}
-
declare 100 win {
XIC XCreateIC(void)
}
-
declare 101 win {
- XVisualInfo *XGetVisualInfo(Display* display, long vinfo_mask, \
- XVisualInfo* vinfo_template, int* nitems_return)
+ XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
+ XVisualInfo *vinfo_template, int *nitems_return)
}
-
declare 102 win {
- void XSetWMClientMachine(Display* display, Window w, XTextProperty* text_prop)
+ void XSetWMClientMachine(Display *display, Window w,
+ XTextProperty *text_prop)
}
-
declare 103 win {
- Status XStringListToTextProperty(char** list, int count, \
- XTextProperty* text_prop_return)
+ Status XStringListToTextProperty(char **list, int count,
+ XTextProperty *text_prop_return)
}
declare 104 win {
- void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
+ void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
int x2, int y2)
}
declare 106 win {
- void XFillRectangle (Display* display, Drawable d, GC gc, \
+ void XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width, unsigned int height)
}
declare 105 win {
- void XWarpPointer (Display* d, Window s, Window dw, int sx, int sy, \
+ void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy,
unsigned int sw, unsigned int sh, int dx, int dy)
}
-# X functions for Mac and Aqua
+################################
+# X functions for Aqua
-declare 0 {mac aqua} {
- void XSetDashes (Display* display, GC gc, int dash_offset,
- _Xconst char* dash_list, int n)
+declare 0 aqua {
+ void XSetDashes(Display *display, GC gc, int dash_offset,
+ _Xconst char *dash_list, int n)
}
-
-declare 1 {mac aqua} {
- XModifierKeymap* XGetModifierMapping (Display* d)
+declare 1 aqua {
+ XModifierKeymap *XGetModifierMapping(Display *d)
}
-
-declare 2 {mac aqua} {
- XImage * XCreateImage (Display* d, Visual* v, unsigned int ui1, int i1, \
- int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, \
+declare 2 aqua {
+ XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1,
+ int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3,
int i4)
-
}
-
-declare 3 {mac aqua} {
- XImage *XGetImage (Display* d, Drawable dr, int i1, int i2, \
+declare 3 aqua {
+ XImage *XGetImage(Display *d, Drawable dr, int i1, int i2,
unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)
}
-
-declare 4 {mac aqua} {
- char *XGetAtomName (Display* d,Atom a)
-
+declare 4 aqua {
+ char *XGetAtomName(Display *d, Atom a)
}
-
-declare 5 {mac aqua} {
- char *XKeysymToString (KeySym k)
+declare 5 aqua {
+ char *XKeysymToString(KeySym k)
}
-
-declare 6 {mac aqua} {
- Colormap XCreateColormap (Display* d, Window w, Visual* v, int i)
-
+declare 6 aqua {
+ Colormap XCreateColormap(Display *d, Window w, Visual *v, int i)
}
-
-declare 7 {mac aqua} {
- GContext XGContextFromGC (GC g)
+declare 7 aqua {
+ GContext XGContextFromGC(GC g)
}
-
-declare 8 {mac aqua} {
- KeySym XKeycodeToKeysym (Display* d, KeyCode k, int i)
+declare 8 aqua {
+ KeySym XKeycodeToKeysym(Display *d, KeyCode k, int i)
}
-
-declare 9 {mac aqua} {
- KeySym XStringToKeysym (_Xconst char* c)
+declare 9 aqua {
+ KeySym XStringToKeysym(_Xconst char *c)
}
-
-declare 10 {mac aqua} {
- Window XRootWindow (Display* d, int i)
+declare 10 aqua {
+ Window XRootWindow(Display *d, int i)
}
-
-declare 11 {mac aqua} {
- XErrorHandler XSetErrorHandler (XErrorHandler x)
+declare 11 aqua {
+ XErrorHandler XSetErrorHandler(XErrorHandler x)
}
-
-declare 12 {mac aqua} {
- Status XAllocColor (Display* d, Colormap c, XColor* xp)
+declare 12 aqua {
+ Status XAllocColor(Display *d, Colormap c, XColor *xp)
}
-
-declare 13 {mac aqua} {
- void XBell (Display* d, int i)
+declare 13 aqua {
+ void XBell(Display *d, int i)
}
-
-declare 14 {mac aqua} {
- void XChangeProperty (Display* d, Window w, Atom a1, Atom a2, int i1, \
- int i2, _Xconst unsigned char* c, int i3)
+declare 14 aqua {
+ void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1,
+ int i2, _Xconst unsigned char *c, int i3)
}
-
-declare 15 {mac aqua} {
- void XChangeWindowAttributes (Display* d, Window w, unsigned long ul, \
- XSetWindowAttributes* x)
+declare 15 aqua {
+ void XChangeWindowAttributes(Display *d, Window w, unsigned long ul,
+ XSetWindowAttributes *x)
}
-
-declare 16 {mac aqua} {
- void XConfigureWindow (Display* d, Window w, unsigned int i, \
- XWindowChanges* x)
+declare 16 aqua {
+ void XConfigureWindow(Display *d, Window w, unsigned int i,
+ XWindowChanges *x)
}
-
-declare 17 {mac aqua} {
- void XCopyArea (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \
- int i2, unsigned int ui1, \
- unsigned int ui2, int i3, int i4)
+declare 17 aqua {
+ void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
-declare 18 {mac aqua} {
- void XCopyPlane (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \
- int i2, unsigned int ui1, \
+declare 18 aqua {
+ void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1,
+ int i2, unsigned int ui1,
unsigned int ui2, int i3, int i4, unsigned long ul)
}
-
-declare 19 {mac aqua} {
- Pixmap XCreateBitmapFromData(Display* display, Drawable d, \
- _Xconst char* data, unsigned int width,unsigned int height)
+declare 19 aqua {
+ Pixmap XCreateBitmapFromData(Display *display, Drawable d,
+ _Xconst char *data, unsigned int width, unsigned int height)
}
-
-declare 20 {mac aqua} {
- void XDefineCursor (Display* d, Window w, Cursor c)
+declare 20 aqua {
+ void XDefineCursor(Display *d, Window w, Cursor c)
}
-
-declare 21 {mac aqua} {
- void XDestroyWindow (Display* d, Window w)
+declare 21 aqua {
+ void XDestroyWindow(Display *d, Window w)
}
-
-declare 22 {mac aqua} {
- void XDrawArc (Display* d, Drawable dr, GC g, int i1, int i2, \
+declare 22 aqua {
+ void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
-declare 23 {mac aqua} {
- void XDrawLines (Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)
+declare 23 aqua {
+ void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2)
}
-
-declare 24 {mac aqua} {
- void XDrawRectangle (Display* d, Drawable dr, GC g, int i1, int i2,\
+declare 24 aqua {
+ void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2)
}
-
-declare 25 {mac aqua} {
- void XFillArc (Display* d, Drawable dr, GC g, int i1, int i2, \
+declare 25 aqua {
+ void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2,
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-
-declare 26 {mac aqua} {
- void XFillPolygon (Display* d, Drawable dr, GC g, XPoint* x, \
+declare 26 aqua {
+ void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x,
int i1, int i2, int i3)
}
-
-declare 27 {mac aqua} {
- void XFillRectangles (Display* d, Drawable dr, GC g, XRectangle* x, int i)
+declare 27 aqua {
+ void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i)
}
-
-declare 28 {mac aqua} {
- void XFreeColormap (Display* d, Colormap c)
+declare 28 aqua {
+ void XFreeColormap(Display *d, Colormap c)
}
-
-declare 29 {mac aqua} {
- void XFreeColors (Display* d, Colormap c, \
- unsigned long* ulp, int i, unsigned long ul)
+declare 29 aqua {
+ void XFreeColors(Display *d, Colormap c,
+ unsigned long *ulp, int i, unsigned long ul)
}
-
-declare 30 {mac aqua} {
- void XFreeModifiermap (XModifierKeymap* x)
+declare 30 aqua {
+ void XFreeModifiermap(XModifierKeymap *x)
}
-
-declare 31 {mac aqua} {
- Status XGetGeometry (Display* d, Drawable dr, Window* w, int* i1, \
- int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, \
- unsigned int* ui4)
+declare 31 aqua {
+ Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1,
+ int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3,
+ unsigned int *ui4)
}
-
-declare 32 {mac aqua} {
- int XGetWindowProperty (Display* d, Window w, Atom a1, long l1, long l2, \
- Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, \
- unsigned long* ulp2, unsigned char** cpp)
+declare 32 aqua {
+ int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2,
+ Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1,
+ unsigned long *ulp2, unsigned char **cpp)
}
-
-declare 33 {mac aqua} {
- int XGrabKeyboard (Display* d, Window w, Bool b, int i1, int i2, Time t)
+declare 33 aqua {
+ int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t)
}
-
-declare 34 {mac aqua} {
- int XGrabPointer (Display* d, Window w1, Bool b, unsigned int ui, \
+declare 34 aqua {
+ int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui,
int i1, int i2, Window w2, Cursor c, Time t)
}
-
-declare 35 {mac aqua} {
- KeyCode XKeysymToKeycode (Display* d, KeySym k)
+declare 35 aqua {
+ KeyCode XKeysymToKeycode(Display *d, KeySym k)
}
-
-declare 36 {mac aqua} {
- void XMapWindow (Display* d, Window w)
+declare 36 aqua {
+ void XMapWindow(Display *d, Window w)
}
-
-declare 37 {mac aqua} {
- void XMoveResizeWindow (Display* d, Window w, int i1, int i2, \
+declare 37 aqua {
+ void XMoveResizeWindow(Display *d, Window w, int i1, int i2,
unsigned int ui1, unsigned int ui2)
}
-
-declare 38 {mac aqua} {
- void XMoveWindow (Display* d, Window w, int i1, int i2)
+declare 38 aqua {
+ void XMoveWindow(Display *d, Window w, int i1, int i2)
}
-
-declare 39 {mac aqua} {
- Bool XQueryPointer (Display* d, Window w1, Window* w2, Window* w3, \
- int* i1, int* i2, int* i3, int* i4, unsigned int* ui)
+declare 39 aqua {
+ Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3,
+ int *i1, int *i2, int *i3, int *i4, unsigned int *ui)
}
-
-declare 40 {mac aqua} {
- void XRaiseWindow (Display* d, Window w)
+declare 40 aqua {
+ void XRaiseWindow(Display *d, Window w)
}
-
-declare 41 {mac aqua} {
- void XRefreshKeyboardMapping (XMappingEvent* x)
+declare 41 aqua {
+ void XRefreshKeyboardMapping(XMappingEvent *x)
}
-
-declare 42 {mac aqua} {
- void XResizeWindow (Display* d, Window w, unsigned int ui1, \
+declare 42 aqua {
+ void XResizeWindow(Display *d, Window w, unsigned int ui1,
unsigned int ui2)
}
-
-declare 43 {mac aqua} {
- void XSelectInput (Display* d, Window w, long l)
+declare 43 aqua {
+ void XSelectInput(Display *d, Window w, long l)
}
-
-declare 44 {mac aqua} {
- Status XSendEvent (Display* d, Window w, Bool b, long l, XEvent* x)
+declare 44 aqua {
+ Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x)
}
-
-declare 45 {mac aqua} {
- void XSetIconName (Display* d, Window w, _Xconst char* c)
+declare 45 aqua {
+ void XSetIconName(Display *d, Window w, _Xconst char *c)
}
-
-declare 46 {mac aqua} {
- void XSetInputFocus (Display* d, Window w, int i, Time t)
+declare 46 aqua {
+ void XSetInputFocus(Display *d, Window w, int i, Time t)
}
-
-declare 47 {mac aqua} {
- void XSetSelectionOwner (Display* d, Atom a, Window w, Time t)
+declare 47 aqua {
+ void XSetSelectionOwner(Display *d, Atom a, Window w, Time t)
}
-
-declare 48 {mac aqua} {
- void XSetWindowBackground (Display* d, Window w, unsigned long ul)
+declare 48 aqua {
+ void XSetWindowBackground(Display *d, Window w, unsigned long ul)
}
-
-declare 49 {mac aqua} {
- void XSetWindowBackgroundPixmap (Display* d, Window w, Pixmap p)
+declare 49 aqua {
+ void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p)
}
-
-declare 50 {mac aqua} {
- void XSetWindowBorder (Display* d, Window w, unsigned long ul)
+declare 50 aqua {
+ void XSetWindowBorder(Display *d, Window w, unsigned long ul)
}
-
-declare 51 {mac aqua} {
- void XSetWindowBorderPixmap (Display* d, Window w, Pixmap p)
+declare 51 aqua {
+ void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p)
}
-
-declare 52 {mac aqua} {
- void XSetWindowBorderWidth (Display* d, Window w, unsigned int ui)
+declare 52 aqua {
+ void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui)
}
-
-declare 53 {mac aqua} {
- void XSetWindowColormap (Display* d, Window w, Colormap c)
+declare 53 aqua {
+ void XSetWindowColormap(Display *d, Window w, Colormap c)
}
-
-declare 54 {mac aqua} {
- void XUngrabKeyboard (Display* d, Time t)
+declare 54 aqua {
+ void XUngrabKeyboard(Display *d, Time t)
}
-
-declare 55 {mac aqua} {
- void XUngrabPointer (Display* d, Time t)
+declare 55 aqua {
+ void XUngrabPointer(Display *d, Time t)
}
-
-declare 56 {mac aqua} {
- void XUnmapWindow (Display* d, Window w)
+declare 56 aqua {
+ void XUnmapWindow(Display *d, Window w)
}
-
-declare 57 {mac aqua} {
- void TkPutImage (unsigned long *colors, \
- int ncolors, Display* display, Drawable d, \
- GC gc, XImage* image, int src_x, int src_y, \
- int dest_x, int dest_y, unsigned int width, \
- unsigned int height)
-}
-declare 58 {mac aqua} {
- Status XParseColor (Display *display, Colormap map, \
- _Xconst char* spec, XColor *colorPtr)
+declare 57 aqua {
+ void TkPutImage(unsigned long *colors, int ncolors, Display *display,
+ Drawable d, GC gc, XImage *image, int src_x, int src_y,
+ int dest_x, int dest_y, unsigned int width, unsigned int height)
}
-
-declare 59 {mac aqua} {
- GC XCreateGC(Display* display, Drawable d, \
- unsigned long valuemask, XGCValues* values)
+declare 58 aqua {
+ Status XParseColor(Display *display, Colormap map,
+ _Xconst char *spec, XColor *colorPtr)
}
-
-declare 60 {mac aqua} {
- void XFreeGC(Display* display, GC gc)
+declare 59 aqua {
+ GC XCreateGC(Display *display, Drawable d,
+ unsigned long valuemask, XGCValues *values)
}
-
-declare 61 {mac aqua} {
- Atom XInternAtom(Display* display,_Xconst char* atom_name, \
+declare 60 aqua {
+ void XFreeGC(Display *display, GC gc)
+}
+declare 61 aqua {
+ Atom XInternAtom(Display *display, _Xconst char *atom_name,
Bool only_if_exists)
}
-
-declare 62 {mac aqua} {
- void XSetBackground(Display* display, GC gc, \
- unsigned long foreground)
+declare 62 aqua {
+ void XSetBackground(Display *display, GC gc, unsigned long foreground)
}
-
-declare 63 {mac aqua} {
- void XSetForeground(Display* display, GC gc, \
- unsigned long foreground)
+declare 63 aqua {
+ void XSetForeground(Display *display, GC gc, unsigned long foreground)
}
-
-declare 64 {mac aqua} {
- void XSetClipMask(Display* display, GC gc, Pixmap pixmap)
+declare 64 aqua {
+ void XSetClipMask(Display *display, GC gc, Pixmap pixmap)
}
-
-declare 65 {mac aqua} {
- void XSetClipOrigin(Display* display, GC gc, \
+declare 65 aqua {
+ void XSetClipOrigin(Display *display, GC gc,
int clip_x_origin, int clip_y_origin)
}
-
-declare 66 {mac aqua} {
- void XSetTSOrigin(Display* display, GC gc, \
+declare 66 aqua {
+ void XSetTSOrigin(Display *display, GC gc,
int ts_x_origin, int ts_y_origin)
}
-
-declare 67 {mac aqua} {
- void XChangeGC(Display * d, GC gc, unsigned long mask, XGCValues *values)
+declare 67 aqua {
+ void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values)
}
-
-declare 68 {mac aqua} {
+declare 68 aqua {
void XSetFont(Display *display, GC gc, Font font)
}
-
-declare 69 {mac aqua} {
+declare 69 aqua {
void XSetArcMode(Display *display, GC gc, int arc_mode)
}
-
-declare 70 {mac aqua} {
+declare 70 aqua {
void XSetStipple(Display *display, GC gc, Pixmap stipple)
}
-
-declare 71 {mac aqua} {
+declare 71 aqua {
void XSetFillRule(Display *display, GC gc, int fill_rule)
}
-
-declare 72 {mac aqua} {
+declare 72 aqua {
void XSetFillStyle(Display *display, GC gc, int fill_style)
}
-
-declare 73 {mac aqua} {
+declare 73 aqua {
void XSetFunction(Display *display, GC gc, int function)
}
-
-declare 74 {mac aqua} {
- void XSetLineAttributes(Display *display, GC gc, \
- unsigned int line_width, int line_style, \
+declare 74 aqua {
+ void XSetLineAttributes(Display *display, GC gc,
+ unsigned int line_width, int line_style,
int cap_style, int join_style)
}
-
-declare 75 {mac aqua} {
+declare 75 aqua {
int _XInitImageFuncPtrs(XImage *image)
}
-
-declare 76 {mac aqua} {
+declare 76 aqua {
XIC XCreateIC(void)
}
-
-declare 77 {mac aqua} {
- XVisualInfo *XGetVisualInfo(Display* display, long vinfo_mask, \
- XVisualInfo* vinfo_template, int* nitems_return)
+declare 77 aqua {
+ XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask,
+ XVisualInfo *vinfo_template, int *nitems_return)
}
-
-declare 78 {mac aqua} {
- void XSetWMClientMachine(Display* display, Window w, \
- XTextProperty* text_prop)
+declare 78 aqua {
+ void XSetWMClientMachine(Display *display, Window w,
+ XTextProperty *text_prop)
}
-
-declare 79 {mac aqua} {
- Status XStringListToTextProperty(char** list, int count, \
- XTextProperty* text_prop_return)
+declare 79 aqua {
+ Status XStringListToTextProperty(char **list, int count,
+ XTextProperty *text_prop_return)
}
-declare 80 {mac aqua} {
- void XDrawSegments(Display *display, Drawable d, GC gc, \
- XSegment *segments, int nsegments)
+declare 80 aqua {
+ void XDrawSegments(Display *display, Drawable d, GC gc,
+ XSegment *segments, int nsegments)
}
-declare 81 {mac aqua} {
- void XForceScreenSaver(Display* display, int mode)
+declare 81 aqua {
+ void XForceScreenSaver(Display *display, int mode)
}
-declare 82 {mac aqua} {
- void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
+declare 82 aqua {
+ void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1,
int x2, int y2)
}
-declare 83 {mac aqua} {
- void XFillRectangle (Display* display, Drawable d, GC gc, \
+declare 83 aqua {
+ void XFillRectangle(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width, unsigned int height)
}
-declare 84 {mac aqua} {
- void XClearWindow (Display* d, Window w)
+declare 84 aqua {
+ void XClearWindow(Display *d, Window w)
}
-
-declare 85 {mac aqua} {
- void XDrawPoint (Display* display, Drawable d, GC gc, int x, int y)
+declare 85 aqua {
+ void XDrawPoint(Display *display, Drawable d, GC gc, int x, int y)
}
-
-declare 86 {mac aqua} {
- void XDrawPoints (Display* display, Drawable d, GC gc, XPoint *points, \
+declare 86 aqua {
+ void XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points,
int npoints, int mode)
}
-
-declare 87 {mac aqua} {
- void XWarpPointer (Display* display, Window src_w, Window dest_w, \
- int src_x, int src_y, unsigned int src_width, \
+declare 87 aqua {
+ void XWarpPointer(Display *display, Window src_w, Window dest_w,
+ int src_x, int src_y, unsigned int src_width,
unsigned int src_height, int dest_x, int dest_y)
}
-
-declare 88 {mac aqua} {
- void XQueryColor (Display *display, Colormap colormap, XColor *def_in_out)
+declare 88 aqua {
+ void XQueryColor(Display *display, Colormap colormap, XColor *def_in_out)
}
-
-declare 89 {mac aqua} {
- void XQueryColors (Display *display, Colormap colormap, \
+declare 89 aqua {
+ void XQueryColors(Display *display, Colormap colormap,
XColor *defs_in_out, int ncolors)
}
-
-declare 90 {mac aqua} {
- Status XQueryTree (Display* d, Window w1, Window* w2, Window* w3, \
- Window** w4, unsigned int* ui)
+declare 90 aqua {
+ Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3,
+ Window **w4, unsigned int *ui)
}
-declare 91 {aqua} {
+declare 91 aqua {
int XSync(Display *display, Bool flag)
}
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 777201e..aa27243 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -1,15 +1,15 @@
/*
* tkInt.h --
*
- * Declarations for things used internally by the Tk
- * procedures but not exported outside the module.
+ * Declarations for things used internally by the Tk functions but not
+ * exported outside the module.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKINT
@@ -41,7 +41,7 @@
# ifdef BIG_ENDIAN
# if BYTE_ORDER == BIG_ENDIAN
# undef WORDS_BIGENDIAN
-# define WORDS_BIGENDIAN
+# define WORDS_BIGENDIAN 1
# endif
# endif
# ifdef LITTLE_ENDIAN
@@ -65,10 +65,36 @@
#endif
/*
+ * Macros used to cast between pointers and integers (e.g. when storing an int
+ * in ClientData), on 64-bit architectures they avoid gcc warning about "cast
+ * to/from pointer from/to integer of different size".
+ */
+
+#if !defined(INT2PTR) && !defined(PTR2INT)
+# if defined(HAVE_INTPTR_T) || defined(intptr_t)
+# define INT2PTR(p) ((void*)(intptr_t)(p))
+# define PTR2INT(p) ((int)(intptr_t)(p))
+# else
+# define INT2PTR(p) ((void*)(p))
+# define PTR2INT(p) ((int)(p))
+# endif
+#endif
+#if !defined(UINT2PTR) && !defined(PTR2UINT)
+# if defined(HAVE_UINTPTR_T) || defined(uintptr_t)
+# define UINT2PTR(p) ((void*)(uintptr_t)(p))
+# define PTR2UINT(p) ((unsigned int)(uintptr_t)(p))
+# else
+# define UINT2PTR(p) ((void*)(p))
+# define PTR2UINT(p) ((unsigned int)(p))
+# endif
+#endif
+
+/*
* Opaque type declarations:
*/
typedef struct TkColormap TkColormap;
+typedef struct TkFontAttributes TkFontAttributes;
typedef struct TkGrabEvent TkGrabEvent;
typedef struct TkpCursor_ *TkpCursor;
typedef struct TkRegion_ *TkRegion;
@@ -76,18 +102,17 @@ typedef struct TkStressedCmap TkStressedCmap;
typedef struct TkBindInfo_ *TkBindInfo;
/*
- * Procedure types.
+ * Function types.
*/
-typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
- KeySym keySym));
-typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));
+typedef int (TkBindEvalProc)(ClientData clientData, Tcl_Interp *interp,
+ XEvent *eventPtr, Tk_Window tkwin, KeySym keySym);
+typedef void (TkBindFreeProc)(ClientData clientData);
/*
- * 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 specific cursor files.
+ * 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
+ * specific cursor files.
*/
typedef struct TkCursor {
@@ -96,65 +121,53 @@ typedef struct TkCursor {
* disposal and retrieval of cursors. */
int resourceRefCount; /* Number of active uses of this cursor (each
* active use corresponds to a call to
- * Tk_AllocPreserveFromObj or Tk_Preserve).
- * If this count is 0, then this structure
- * is no longer valid and it isn't present
- * in a hash table: it is being kept around
- * only because there are objects referring
- * to it. The structure is freed when
- * resourceRefCount and objRefCount are
- * both 0. */
- int objRefCount; /* Number of Tcl objects that reference
- * this structure.. */
- Tcl_HashTable *otherTable; /* Second table (other than idTable) used
- * to index this entry. */
+ * Tk_AllocPreserveFromObj or Tk_Preserve). If
+ * this count is 0, then this structure is no
+ * longer valid and it isn't present in a hash
+ * table: it is being kept around only because
+ * there are objects referring to it. The
+ * structure is freed when resourceRefCount
+ * and objRefCount are both 0. */
+ int objRefCount; /* Number of Tcl objects that reference this
+ * structure.. */
+ Tcl_HashTable *otherTable; /* Second table (other than idTable) used to
+ * index this entry. */
Tcl_HashEntry *hashPtr; /* Entry in otherTable for this structure
* (needed when deleting). */
- Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure
- * (needed when deleting). */
+ Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure (needed
+ * when deleting). */
struct TkCursor *nextPtr; /* Points to the next TkCursor structure with
- * the same name. Cursors with the same
- * name but different displays are chained
- * together off a single hash table entry. */
+ * the same name. Cursors with the same name
+ * but different displays are chained together
+ * off a single hash table entry. */
} TkCursor;
/*
- * This defines whether we should try to use XIM over-the-spot style
- * input. Allow users to override it. It is a much more elegant use
- * of XIM, but uses a bit more memory.
- */
-
-#ifndef TK_XIM_SPOT
-# define TK_XIM_SPOT 1
-#endif
-
-/*
* The following structure is kept one-per-TkDisplay to maintain information
- * about the caret (cursor location) on this display. This is used to
- * dictate global focus location (Windows Accessibility guidelines) and to
- * position the IME or XIM over-the-spot window.
+ * about the caret (cursor location) on this display. This is used to dictate
+ * global focus location (Windows Accessibility guidelines) and to position
+ * the IME or XIM over-the-spot window.
*/
typedef struct TkCaret {
- struct TkWindow *winPtr; /* the window on which we requested caret
- * placement */
- int x; /* relative x coord of the caret */
- int y; /* relative y coord of the caret */
- int height; /* specified height of the window */
+ struct TkWindow *winPtr; /* The window on which we requested caret
+ * placement. */
+ int x; /* Relative x coord of the caret. */
+ int y; /* Relative y coord of the caret. */
+ int height; /* Specified height of the window. */
} TkCaret;
/*
- * One of the following structures is maintained for each display
- * containing a window managed by Tk. In part, the structure is
- * used to store thread-specific data, since each thread will have
- * its own TkDisplay structure.
+ * One of the following structures is maintained for each display containing a
+ * window managed by Tk. In part, the structure is used to store thread-
+ * specific data, since each thread will have its own TkDisplay structure.
*/
typedef struct TkDisplay {
Display *display; /* Xlib's info about display. */
struct TkDisplay *nextPtr; /* Next in list of all displays. */
- char *name; /* Name of display (with any screen
- * identifier removed). Malloc-ed. */
+ char *name; /* Name of display (with any screen identifier
+ * removed). Malloc-ed. */
Time lastEventTime; /* Time of last event received for this
* display. */
@@ -162,16 +175,16 @@ typedef struct TkDisplay {
* Information used primarily by tk3d.c:
*/
- int borderInit; /* 0 means borderTable needs initializing. */
- Tcl_HashTable borderTable; /* Maps from color name to TkBorder
+ int borderInit; /* 0 means borderTable needs initializing. */
+ Tcl_HashTable borderTable; /* Maps from color name to TkBorder
* structure. */
/*
* Information used by tkAtom.c only:
*/
- int atomInit; /* 0 means stuff below hasn't been
- * initialized yet. */
+ int atomInit; /* 0 means stuff below hasn't been initialized
+ * yet. */
Tcl_HashTable nameTable; /* Maps from names to Atom's. */
Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
@@ -179,139 +192,137 @@ typedef struct TkDisplay {
* Information used primarily by tkBind.c:
*/
- int bindInfoStale; /* Non-zero means the variables in this
- * part of the structure are potentially
- * incorrect and should be recomputed. */
+ int bindInfoStale; /* Non-zero means the variables in this part
+ * of the structure are potentially incorrect
+ * and should be recomputed. */
unsigned int modeModMask; /* Has one bit set to indicate the modifier
- * corresponding to "mode shift". If no
- * such modifier, than this is zero. */
+ * corresponding to "mode shift". If no such
+ * modifier, than this is zero. */
unsigned int metaModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
+ * corresponding to the "Meta" key. If no such
+ * modifier, then this is zero. */
unsigned int altModMask; /* Has one bit set to indicate the modifier
- * corresponding to the "Meta" key. If no
- * such modifier, then this is zero. */
+ * corresponding to the "Meta" key. If no such
+ * modifier, then this is zero. */
enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
- /* Indicates how to interpret lock modifier. */
+ /* Indicates how to interpret lock
+ * modifier. */
int numModKeyCodes; /* Number of entries in modKeyCodes array
* below. */
- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
- * all of the keys that have modifiers
- * associated with them. Malloc'ed, but
- * may be NULL. */
+ KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for all
+ * of the keys that have modifiers associated
+ * with them. Malloc'ed, but may be NULL. */
/*
* Information used by tkBitmap.c only:
*/
-
- int bitmapInit; /* 0 means tables above need initializing. */
- int bitmapAutoNumber; /* Used to number bitmaps. */
- Tcl_HashTable bitmapNameTable;
- /* Maps from name of bitmap to the first
+
+ int bitmapInit; /* 0 means tables above need initializing. */
+ int bitmapAutoNumber; /* Used to number bitmaps. */
+ Tcl_HashTable bitmapNameTable;
+ /* Maps from name of bitmap to the first
* TkBitmap record for that name. */
Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
* structure for the bitmap. */
- Tcl_HashTable bitmapDataTable;
- /* Used by Tk_GetBitmapFromData to map from
- * a collection of in-core data about a
- * bitmap to a reference giving an auto-
- * matically-generated name for the bitmap. */
+ Tcl_HashTable bitmapDataTable;
+ /* Used by Tk_GetBitmapFromData to map from a
+ * collection of in-core data about a bitmap
+ * to a reference giving an automatically-
+ * generated name for the bitmap. */
/*
* Information used by tkCanvas.c only:
*/
- int numIdSearches;
+ int numIdSearches;
int numSlowSearches;
/*
* Used by tkColor.c only:
*/
- int colorInit; /* 0 means color module needs initializing. */
- TkStressedCmap *stressPtr; /* First in list of colormaps that have
- * filled up, so we have to pick an
- * approximate color. */
+ int colorInit; /* 0 means color module needs initializing. */
+ TkStressedCmap *stressPtr; /* First in list of colormaps that have filled
+ * up, so we have to pick an approximate
+ * color. */
Tcl_HashTable colorNameTable;
- /* Maps from color name to TkColor structure
+ /* Maps from color name to TkColor structure
* for that color. */
Tcl_HashTable colorValueTable;
- /* Maps from integer RGB values to TkColor
+ /* Maps from integer RGB values to TkColor
* structures. */
/*
* Used by tkCursor.c only:
*/
- int cursorInit; /* 0 means cursor module need initializing. */
+ int cursorInit; /* 0 means cursor module need initializing. */
Tcl_HashTable cursorNameTable;
- /* Maps from a string name to a cursor to the
+ /* Maps from a string name to a cursor to the
* TkCursor record for the cursor. */
Tcl_HashTable cursorDataTable;
- /* Maps from a collection of in-core data
+ /* Maps from a collection of in-core data
* about a cursor to a TkCursor structure. */
Tcl_HashTable cursorIdTable;
- /* Maps from a cursor id to the TkCursor
+ /* Maps from a cursor id to the TkCursor
* structure for the cursor. */
- char cursorString[20]; /* Used to store a cursor id string. */
- Font cursorFont; /* Font to use for standard cursors.
- * None means font not loaded yet. */
+ char cursorString[20]; /* Used to store a cursor id string. */
+ Font cursorFont; /* Font to use for standard cursors. None
+ * means font not loaded yet. */
/*
* Information used by tkError.c only:
*/
struct TkErrorHandler *errorPtr;
- /* First in list of error handlers
- * for this display. NULL means
- * no handlers exist at present. */
- int deleteCount; /* Counts # of handlers deleted since
- * last time inactive handlers were
- * garbage-collected. When this number
- * gets big, handlers get cleaned up. */
+ /* First in list of error handlers for this
+ * display. NULL means no handlers exist at
+ * present. */
+ int deleteCount; /* Counts # of handlers deleted since last
+ * time inactive handlers were garbage-
+ * collected. When this number gets big,
+ * handlers get cleaned up. */
/*
* Used by tkEvent.c only:
*/
struct TkWindowEvent *delayedMotionPtr;
- /* Points to a malloc-ed motion event
- * whose processing has been delayed in
- * the hopes that another motion event
- * will come along right away and we can
- * merge the two of them together. NULL
- * means that there is no delayed motion
- * event. */
+ /* Points to a malloc-ed motion event whose
+ * processing has been delayed in the hopes
+ * that another motion event will come along
+ * right away and we can merge the two of them
+ * together. NULL means that there is no
+ * delayed motion event. */
/*
* Information used by tkFocus.c only:
*/
- int focusDebug; /* 1 means collect focus debugging
+ int focusDebug; /* 1 means collect focus debugging
* statistics. */
struct TkWindow *implicitWinPtr;
/* If the focus arrived at a toplevel window
- * implicitly via an Enter event (rather
- * than via a FocusIn event), this points
- * to the toplevel window. Otherwise it is
- * NULL. */
+ * implicitly via an Enter event (rather than
+ * via a FocusIn event), this points to the
+ * toplevel window. Otherwise it is NULL. */
struct TkWindow *focusPtr; /* Points to the window on this display that
- * should be receiving keyboard events. When
+ * should be receiving keyboard events. When
* multiple applications on the display have
- * the focus, this will refer to the
- * innermost window in the innermost
- * application. This information isn't used
- * under Unix or Windows, but it's needed on
- * the Macintosh. */
+ * the focus, this will refer to the innermost
+ * window in the innermost application. This
+ * information isn't used on Windows, but it's
+ * needed on the Mac, and also on X11 when XIM
+ * processing is being done. */
/*
* Information used by tkGC.c only:
*/
-
+
Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
* describing a GC with those values. */
- Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
- int gcInit; /* 0 means the tables below need
+ Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
+ int gcInit; /* 0 means the tables below need
* initializing. */
/*
@@ -319,24 +330,23 @@ typedef struct TkDisplay {
*/
Tcl_HashTable maintainHashTable;
- /* Hash table that maps from a master's
- * Tk_Window token to a list of slaves
- * managed by that master. */
- int geomInit;
+ /* Hash table that maps from a master's
+ * Tk_Window token to a list of slaves managed
+ * by that master. */
+ int geomInit;
/*
* Information used by tkGet.c only:
*/
-
- Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */
- int uidInit; /* 0 means uidTable needs initializing. */
+
+ Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */
+ int uidInit; /* 0 means uidTable needs initializing. */
/*
* Information used by tkGrab.c only:
*/
- struct TkWindow *grabWinPtr;
- /* Window in which the pointer is currently
+ struct TkWindow *grabWinPtr;/* Window in which the pointer is currently
* grabbed, or NULL if none. */
struct TkWindow *eventualGrabWinPtr;
/* Value that grabWinPtr will have once the
@@ -348,68 +358,65 @@ typedef struct TkDisplay {
* if no such press in effect. */
struct TkWindow *serverWinPtr;
/* If no application contains the pointer then
- * this is NULL. Otherwise it contains the
- * last window for which we've gotten an
- * Enter or Leave event from the server (i.e.
- * the last window known to have contained
- * the pointer). Doesn't reflect events
- * that were synthesized in tkGrab.c. */
+ * this is NULL. Otherwise it contains the
+ * last window for which we've gotten an Enter
+ * or Leave event from the server (i.e. the
+ * last window known to have contained the
+ * pointer). Doesn't reflect events that were
+ * synthesized in tkGrab.c. */
TkGrabEvent *firstGrabEventPtr;
/* First in list of enter/leave events
- * synthesized by grab code. These events
- * must be processed in order before any other
- * events are processed. NULL means no such
+ * synthesized by grab code. These events must
+ * be processed in order before any other
+ * events are processed. NULL means no such
* events. */
TkGrabEvent *lastGrabEventPtr;
/* Last in list of synthesized events, or NULL
* if list is empty. */
- int grabFlags; /* Miscellaneous flag values. See definitions
+ int grabFlags; /* Miscellaneous flag values. See definitions
* in tkGrab.c. */
/*
* Information used by tkGrid.c only:
*/
- int gridInit; /* 0 means table below needs initializing. */
- Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
- * corresponding Grid structures. */
+ int gridInit; /* 0 means table below needs initializing. */
+ Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to corresponding
+ * Grid structures. */
/*
* Information used by tkImage.c only:
*/
- int imageId; /* Value used to number image ids. */
+ int imageId; /* Value used to number image ids. */
/*
* Information used by tkMacWinMenu.c only:
*/
- int postCommandGeneration;
+ int postCommandGeneration;
/*
* Information used by tkOption.c only.
*/
-
-
/*
* Information used by tkPack.c only.
*/
- int packInit; /* 0 means table below needs initializing. */
+ int packInit; /* 0 means table below needs initializing. */
Tcl_HashTable packerHashTable;
- /* Maps from Tk_Window tokens to
- * corresponding Packer structures. */
-
+ /* Maps from Tk_Window tokens to corresponding
+ * Packer structures. */
/*
* Information used by tkPlace.c only.
*/
- int placeInit; /* 0 means tables below need initializing. */
- Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
+ int placeInit; /* 0 means tables below need initializing. */
+ Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
* structure for the window, if it exists. */
- Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
+ Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
* structure for the window, if it exists. */
/*
@@ -418,11 +425,11 @@ typedef struct TkDisplay {
struct TkSelectionInfo *selectionInfoPtr;
/* First in list of selection information
- * records. Each entry contains information
+ * records. Each entry contains information
* about the current owner of a particular
* selection on this display. */
- Atom multipleAtom; /* Atom for MULTIPLE. None means
- * selection stuff isn't initialized. */
+ Atom multipleAtom; /* Atom for MULTIPLE. None means selection
+ * stuff isn't initialized. */
Atom incrAtom; /* Atom for INCR. */
Atom targetsAtom; /* Atom for TARGETS. */
Atom timestampAtom; /* Atom for TIMESTAMP. */
@@ -443,7 +450,7 @@ typedef struct TkDisplay {
/* Last application that owned clipboard. */
struct TkClipboardTarget *clipTargetPtr;
/* First in list of clipboard type information
- * records. Each entry contains information
+ * records. Each entry contains information
* about the buffers for a given selection
* target. */
@@ -451,13 +458,13 @@ typedef struct TkDisplay {
* Information used by tkSend.c only:
*/
- Tk_Window commTkwin; /* Window used for communication
- * between interpreters during "send"
- * commands. NULL means send info hasn't
- * been initialized yet. */
+ Tk_Window commTkwin; /* Window used for communication between
+ * interpreters during "send" commands. NULL
+ * means send info hasn't been initialized
+ * yet. */
Atom commProperty; /* X's name for comm property. */
- Atom registryProperty; /* X's name for property containing
- * registry of interpreter names. */
+ Atom registryProperty; /* X's name for property containing registry
+ * of interpreter names. */
Atom appNameProperty; /* X's name for property used to hold the
* application name on each comm window. */
@@ -469,12 +476,11 @@ typedef struct TkDisplay {
/* First in list of chunks of free resource
* identifiers, or NULL if there are no free
* resources. */
- XID (*defaultAllocProc) _ANSI_ARGS_((Display *display));
+ XID (*defaultAllocProc) (Display *display);
/* Default resource allocator for display. */
struct TkIdStack *windowStackPtr;
- /* First in list of chunks of window
- * identifers that can't be reused right
- * now. */
+ /* 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
@@ -484,17 +490,16 @@ typedef struct TkDisplay {
* Information used by tkUnixWm.c and tkWinWm.c only:
*/
- struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
- struct TkWmInfo *foregroundWmPtr;
- /* Points to the foreground window. */
+ struct TkWmInfo *firstWmPtr;/* Points to first top-level window. */
+ struct TkWmInfo *foregroundWmPtr;
+ /* Points to the foreground window. */
/*
* Information maintained by tkWindow.c for use later on by tkXId.c:
*/
-
- int destroyCount; /* Number of Tk_DestroyWindow operations
- * in progress. */
+ 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
@@ -513,25 +518,25 @@ typedef struct TkDisplay {
*/
#ifdef TK_USE_INPUT_METHODS
- XIM inputMethod; /* Input method for this display */
-#if TK_XIM_SPOT
+ XIM inputMethod; /* Input method for this display. */
+ XIMStyle inputStyle; /* Input style selected for this display. */
XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
-#endif
#endif /* TK_USE_INPUT_METHODS */
Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
int refCount; /* Reference count of how many Tk applications
- * are using this display. Used to clean up
- * the display when we no longer have any
- * Tk applications using it.
- */
+ * are using this display. Used to clean up
+ * the display when we no longer have any Tk
+ * applications using it. */
+
/*
* The following field were all added for Tk8.3
*/
- int mouseButtonState; /* current mouse button state for this
- * display */
- Window mouseButtonWindow; /* Window the button state was set in,
- * added in Tk 8.4. */
+
+ int mouseButtonState; /* Current mouse button state for this
+ * display. */
+ Window mouseButtonWindow; /* Window the button state was set in, added
+ * in Tk 8.4. */
Window warpWindow;
int warpX;
int warpY;
@@ -539,13 +544,14 @@ typedef struct TkDisplay {
/*
* The following field(s) were all added for Tk8.4
*/
- unsigned int flags; /* Various flag values: these are all
- * defined in below. */
- TkCaret caret; /* information about the caret for this
- * display. This is not a pointer. */
- int iconDataSize; /* size of default iconphoto image data */
- unsigned char *iconDataPtr; /* default iconphoto image data, if set */
+ unsigned int flags; /* Various flag values: these are all defined
+ * in below. */
+ TkCaret caret; /* Information about the caret for this
+ * display. This is not a pointer. */
+
+ int iconDataSize; /* Size of default iconphoto image data. */
+ unsigned char *iconDataPtr; /* Default iconphoto image data, if set. */
} TkDisplay;
/*
@@ -554,8 +560,6 @@ typedef struct TkDisplay {
* Indicates that we should collapse motion events on this display
* TK_DISPLAY_USE_IM: (default on, set via tk.tcl)
* Whether to use input methods for this display
- * TK_DISPLAY_XIM_SPOT: (default off)
- * Indicates that we should use over-the-spot XIM on this display
* TK_DISPLAY_WM_TRACING: (default off)
* Whether we should do wm tracing on this display.
* TK_DISPLAY_IN_WARP: (default off)
@@ -564,88 +568,75 @@ typedef struct TkDisplay {
#define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0)
#define TK_DISPLAY_USE_IM (1 << 1)
-#define TK_DISPLAY_XIM_SPOT (1 << 2)
#define TK_DISPLAY_WM_TRACING (1 << 3)
#define TK_DISPLAY_IN_WARP (1 << 4)
/*
- * One of the following structures exists for each error handler
- * created by a call to Tk_CreateErrorHandler. The structure
- * is managed by tkError.c.
+ * One of the following structures exists for each error handler created by a
+ * call to Tk_CreateErrorHandler. The structure is managed by tkError.c.
*/
typedef struct TkErrorHandler {
TkDisplay *dispPtr; /* Display to which handler applies. */
- unsigned long firstRequest; /* Only errors with serial numbers
- * >= to this are considered. */
- unsigned long lastRequest; /* Only errors with serial numbers
- * <= to this are considered. This
- * field is filled in when XUnhandle
- * is called. -1 means XUnhandle
- * hasn't been called yet. */
- int error; /* Consider only errors with this
- * error_code (-1 means consider
- * all errors). */
- int request; /* Consider only errors with this
- * major request code (-1 means
- * consider all major codes). */
- int minorCode; /* Consider only errors with this
- * minor request code (-1 means
- * consider all minor codes). */
- Tk_ErrorProc *errorProc; /* Procedure to invoke when a matching
- * error occurs. NULL means just ignore
- * errors. */
- ClientData clientData; /* Arbitrary value to pass to
- * errorProc. */
+ unsigned long firstRequest; /* Only errors with serial numbers >= to this
+ * are considered. */
+ unsigned long lastRequest; /* Only errors with serial numbers <= to this
+ * are considered. This field is filled in
+ * when XUnhandle is called. -1 means
+ * XUnhandle hasn't been called yet. */
+ int error; /* Consider only errors with this error_code
+ * (-1 means consider all errors). */
+ int request; /* Consider only errors with this major
+ * request code (-1 means consider all major
+ * codes). */
+ int minorCode; /* Consider only errors with this minor
+ * request code (-1 means consider all minor
+ * codes). */
+ Tk_ErrorProc *errorProc; /* Function to invoke when a matching error
+ * occurs. NULL means just ignore errors. */
+ ClientData clientData; /* Arbitrary value to pass to errorProc. */
struct TkErrorHandler *nextPtr;
- /* Pointer to next older handler for
- * this display, or NULL for end of
- * list. */
+ /* Pointer to next older handler for this
+ * display, or NULL for end of list. */
} TkErrorHandler;
-
/*
- * One of the following structures exists for each event handler
- * created by calling Tk_CreateEventHandler. This information
- * is used by tkEvent.c only.
+ * One of the following structures exists for each event handler created by
+ * calling Tk_CreateEventHandler. This information is used by tkEvent.c only.
*/
typedef struct TkEventHandler {
- unsigned long mask; /* Events for which to invoke
- * proc. */
- Tk_EventProc *proc; /* Procedure to invoke when an event
- * in mask occurs. */
+ unsigned long mask; /* Events for which to invoke proc. */
+ Tk_EventProc *proc; /* Function to invoke when an event in mask
+ * occurs. */
ClientData clientData; /* Argument to pass to proc. */
struct TkEventHandler *nextPtr;
- /* Next in list of handlers
- * associated with window (NULL means
- * end of list). */
+ /* Next in list of handlers associated with
+ * window (NULL means end of list). */
} TkEventHandler;
/*
- * Tk keeps one of the following data structures for each main
- * window (created by a call to TkCreateMainWindow). It stores
- * information that is shared by all of the windows associated
- * with a particular main window.
+ * Tk keeps one of the following data structures for each main window (created
+ * by a call to TkCreateMainWindow). It stores information that is shared by
+ * all of the windows associated with a particular main window.
*/
typedef struct TkMainInfo {
int refCount; /* Number of windows whose "mainPtr" fields
- * point here. When this becomes zero, can
- * free up the structure (the reference
- * count is zero because windows can get
- * deleted in almost any order; the main
- * window isn't necessarily the last one
- * deleted). */
+ * point here. When this becomes zero, can
+ * free up the structure (the reference count
+ * is zero because windows can get deleted in
+ * almost any order; the main window isn't
+ * necessarily the last one deleted). */
struct TkWindow *winPtr; /* Pointer to main window. */
Tcl_Interp *interp; /* Interpreter associated with application. */
Tcl_HashTable nameTable; /* Hash table mapping path names to TkWindow
* structs for all windows related to this
- * main window. Managed by tkWindow.c. */
- long deletionEpoch; /* Incremented by window deletions */
+ * main window. Managed by tkWindow.c. */
+ long deletionEpoch; /* Incremented by window deletions. */
Tk_BindingTable bindingTable;
- /* Used in conjunction with "bind" command
- * to bind events to Tcl commands. */
+ /* Used in conjunction with "bind" command to
+ * bind events to Tcl commands. */
TkBindInfo bindInfo; /* Information used by tkBind.c on a per
* application basis. */
struct TkFontInfo *fontInfoPtr;
@@ -659,21 +650,21 @@ typedef struct TkMainInfo {
struct TkToplevelFocusInfo *tlFocusPtr;
/* First in list of records containing focus
* information for each top-level in the
- * application. Used only by tkFocus.c. */
+ * application. Used only by tkFocus.c. */
struct TkDisplayFocusInfo *displayFocusPtr;
/* First in list of records containing focus
* information for each display that this
- * application has ever used. Used only
- * by tkFocus.c. */
+ * application has ever used. Used only by
+ * tkFocus.c. */
struct ElArray *optionRootPtr;
- /* Top level of option hierarchy for this
- * main window. NULL means uninitialized.
- * Managed by tkOption.c. */
+ /* Top level of option hierarchy for this main
+ * window. NULL means uninitialized. Managed
+ * by tkOption.c. */
Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageMaster
- * structures. Managed by tkImage.c. */
- int strictMotif; /* This is linked to the tk_strictMotif
- * global variable. */
+ * structures. Managed by tkImage.c. */
+ int strictMotif; /* This is linked to the tk_strictMotif global
+ * variable. */
int alwaysShowSelection; /* This is linked to the
* ::tk::AlwaysShowSelection variable. */
struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
@@ -681,172 +672,157 @@ typedef struct TkMainInfo {
} TkMainInfo;
/*
- * Tk keeps the following data structure for each of it's builtin
- * bitmaps. This structure is only used by tkBitmap.c and other
- * platform specific bitmap files.
+ * Tk keeps the following data structure for each of it's builtin bitmaps.
+ * This structure is only used by tkBitmap.c and other platform specific
+ * bitmap files.
*/
typedef struct {
- CONST char *source; /* Bits for bitmap. */
+ const char *source; /* Bits for bitmap. */
int width, height; /* Dimensions of bitmap. */
- int native; /* 0 means generic (X style) bitmap,
- * 1 means native style bitmap. */
+ int native; /* 0 means generic (X style) bitmap, 1 means
+ * native style bitmap. */
} TkPredefBitmap;
/*
- * Tk keeps one of the following structures for each window.
- * Some of the information (like size and location) is a shadow
- * of information managed by the X server, and some is special
- * information used here, such as event and geometry management
- * information. This information is (mostly) managed by tkWindow.c.
- * WARNING: the declaration below must be kept consistent with the
- * Tk_FakeWin structure in tk.h. If you change one, be sure to
- * change the other!!
+ * Tk keeps one of the following structures for each window. Some of the
+ * information (like size and location) is a shadow of information managed by
+ * the X server, and some is special information used here, such as event and
+ * geometry management information. This information is (mostly) managed by
+ * tkWindow.c. WARNING: the declaration below must be kept consistent with the
+ * Tk_FakeWin structure in tk.h. If you change one, be sure to change the
+ * other!
*/
typedef struct TkWindow {
-
/*
* Structural information:
*/
Display *display; /* Display containing window. */
- TkDisplay *dispPtr; /* Tk's information about display
- * for window. */
- int screenNum; /* Index of screen for window, among all
- * those for dispPtr. */
- Visual *visual; /* Visual to use for window. If not default,
+ TkDisplay *dispPtr; /* Tk's information about display for
+ * window. */
+ int screenNum; /* Index of screen for window, among all those
+ * for dispPtr. */
+ Visual *visual; /* Visual to use for window. If not default,
* MUST be set before X window is created. */
int depth; /* Number of bits/pixel. */
- Window window; /* X's id for window. NULL means window
- * hasn't actually been created yet, or it's
- * been deleted. */
- struct TkWindow *childList; /* First in list of child windows,
- * or NULL if no children. List is in
- * stacking order, lowest window first.*/
- struct TkWindow *lastChildPtr;
- /* Last in list of child windows (highest
- * in stacking order), or NULL if no
- * children. */
- struct TkWindow *parentPtr; /* Pointer to parent window (logical
- * parent, not necessarily X parent). NULL
- * means either this is the main window, or
- * the window's parent has already been
+ Window window; /* X's id for window. NULL means window hasn't
+ * actually been created yet, or it's been
* deleted. */
- struct TkWindow *nextPtr; /* Next higher sibling (in stacking order)
- * in list of children with same parent. NULL
+ struct TkWindow *childList; /* First in list of child windows, or NULL if
+ * no children. List is in stacking order,
+ * lowest window first.*/
+ struct TkWindow *lastChildPtr;
+ /* Last in list of child windows (highest in
+ * stacking order), or NULL if no children. */
+ struct TkWindow *parentPtr; /* Pointer to parent window (logical parent,
+ * not necessarily X parent). NULL means
+ * either this is the main window, or the
+ * window's parent has already been deleted. */
+ struct TkWindow *nextPtr; /* Next higher sibling (in stacking order) in
+ * list of children with same parent. NULL
* means end of list. */
TkMainInfo *mainPtr; /* Information shared by all windows
- * associated with a particular main
- * window. NULL means this window is
- * a rogue that isn't associated with
- * any application (at present, this
- * only happens for the dummy windows
- * used for "send" communication). */
+ * associated with a particular main window.
+ * NULL means this window is a rogue that is
+ * not associated with any application (at
+ * present, this only happens for the dummy
+ * windows used for "send" communication). */
/*
* Name and type information for the window:
*/
- char *pathName; /* Path name of window (concatenation
- * of all names between this window and
- * its top-level ancestor). This is a
- * pointer into an entry in
- * mainPtr->nameTable. NULL means that
- * the window hasn't been completely
- * created yet. */
+ char *pathName; /* Path name of window (concatenation of all
+ * names between this window and its top-level
+ * ancestor). This is a pointer into an entry
+ * in mainPtr->nameTable. NULL means that the
+ * window hasn't been completely created
+ * yet. */
Tk_Uid nameUid; /* Name of the window within its parent
* (unique within the parent). */
- Tk_Uid classUid; /* Class of the window. NULL means window
+ Tk_Uid classUid; /* Class of the window. NULL means window
* hasn't been given a class yet. */
/*
- * Geometry and other attributes of window. This information
- * may not be updated on the server immediately; stuff that
- * hasn't been reflected in the server yet is called "dirty".
- * At present, information can be dirty only if the window
- * hasn't yet been created.
+ * Geometry and other attributes of window. This information may not be
+ * updated on the server immediately; stuff that hasn't been reflected in
+ * the server yet is called "dirty". At present, information can be dirty
+ * only if the window hasn't yet been created.
*/
- XWindowChanges changes; /* Geometry and other info about
- * window. */
- unsigned int dirtyChanges; /* Bits indicate fields of "changes"
- * that are dirty. */
+ XWindowChanges changes; /* Geometry and other info about window. */
+ unsigned int dirtyChanges; /* Bits indicate fields of "changes" that are
+ * dirty. */
XSetWindowAttributes atts; /* Current attributes of window. */
- unsigned long dirtyAtts; /* Bits indicate fields of "atts"
- * that are dirty. */
+ unsigned long dirtyAtts; /* Bits indicate fields of "atts" that are
+ * dirty. */
- unsigned int flags; /* Various flag values: these are all
- * defined in tk.h (confusing, but they're
- * needed there for some query macros). */
+ unsigned int flags; /* Various flag values: these are all defined
+ * in tk.h (confusing, but they're needed
+ * there for some query macros). */
/*
* Information kept by the event manager (tkEvent.c):
*/
- TkEventHandler *handlerList;/* First in list of event handlers
- * declared for this window, or
- * NULL if none. */
+ TkEventHandler *handlerList;/* First in list of event handlers declared
+ * for this window, or NULL if none. */
#ifdef TK_USE_INPUT_METHODS
XIC inputContext; /* XIM input context. */
#endif /* TK_USE_INPUT_METHODS */
/*
- * Information used for event bindings (see "bind" and "bindtags"
- * commands in tkCmds.c):
+ * Information used for event bindings (see "bind" and "bindtags" commands
+ * in tkCmds.c):
*/
ClientData *tagPtr; /* Points to array of tags used for bindings
- * on this window. Each tag is a Tk_Uid.
- * Malloc'ed. NULL means no tags. */
+ * on this window. Each tag is a Tk_Uid.
+ * Malloc'ed. NULL means no tags. */
int numTags; /* Number of tags at *tagPtr. */
/*
- * Information used by tkOption.c to manage options for the
- * window.
+ * Information used by tkOption.c to manage options for the window.
*/
- int optionLevel; /* -1 means no option information is
- * currently cached for this window.
- * Otherwise this gives the level in
- * the option stack at which info is
- * cached. */
+ int optionLevel; /* -1 means no option information is currently
+ * cached for this window. Otherwise this
+ * gives the level in the option stack at
+ * which info is cached. */
/*
* Information used by tkSelect.c to manage the selection.
*/
struct TkSelHandler *selHandlerList;
- /* First in list of handlers for
- * returning the selection in various
- * forms. */
+ /* First in list of handlers for returning the
+ * selection in various forms. */
/*
* Information used by tkGeometry.c for geometry management.
*/
- Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for
- * this window. */
- ClientData geomData; /* Argument for geometry manager procedures. */
+ 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
* Tk_GeometryRequest, or 0's if
- * Tk_GeometryRequest hasn't been
- * called. */
- int internalBorderLeft; /* Width of internal border of window
- * (0 means no internal border). Geometry
- * managers should not normally place children
- * on top of the border.
- * Fields for the other three sides are found
- * below. */
+ * Tk_GeometryRequest hasn't been called. */
+ int internalBorderLeft; /* Width of internal border of window (0 means
+ * no internal border). Geometry managers
+ * should not normally place children on top
+ * of the border. Fields for the other three
+ * sides are found below. */
/*
* Information maintained by tkWm.c for window manager communication.
*/
- 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. */
+ 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. */
/*
* Information used by widget classes.
@@ -866,32 +842,48 @@ typedef struct TkWindow {
*/
/* The remaining fields of internal border. */
- int internalBorderRight;
+ int internalBorderRight;
int internalBorderTop;
int internalBorderBottom;
-
+
int minReqWidth; /* Minimum requested width. */
int minReqHeight; /* Minimum requested height. */
} TkWindow;
/*
- * 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.
+ * Real definition of some events. Note that these events come from outside
+ * but have internally generated pieces added to them.
+ */
+
+typedef struct {
+ XKeyEvent keyEvent; /* The real event from X11. */
+ char *charValuePtr; /* A pointer to a string that holds the key's
+ * %A substitution text (before backslash
+ * adding), or NULL if that has not been
+ * computed yet. If non-NULL, this string was
+ * allocated with ckalloc(). */
+ int charValueLen; /* Length of string in charValuePtr when that
+ * is non-NULL. */
+} TkKeyEvent;
+
+/*
+ * 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.
*/
typedef struct TkStateMap {
int numKey; /* Integer representation of a value. */
- char *strKey; /* String representation of a value. */
+ const char *strKey; /* String representation of a value. */
} TkStateMap;
/*
- * This structure is used by the Mac and Window porting layers as
- * the internal representation of a clip_mask in a GC.
+ * This structure is used by the Mac and Window porting layers as the internal
+ * representation of a clip_mask in a GC.
*/
typedef struct TkpClipMask {
- int type; /* One of TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
+ int type; /* TKP_CLIP_PIXMAP or TKP_CLIP_REGION. */
union {
Pixmap pixmap;
TkRegion region;
@@ -917,311 +909,292 @@ extern TkDisplay *tkDisplayList;
#define TK_GRAB_EXCLUDED 3
/*
- * The macro below is used to modify a "char" value (e.g. by casting
- * it to an unsigned character) so that it can be used safely with
- * macros such as isspace.
+ * Additional flag for TkpMeasureCharsInContext. Coordinate with other flags
+ * for this routine, but don't make public until TkpMeasureCharsInContext is
+ * made public, too.
+ */
+
+#define TK_ISOLATE_END 32
+
+/*
+ * The macro below is used to modify a "char" value (e.g. by casting it to an
+ * unsigned character) so that it can be used safely with macros such as
+ * isspace().
*/
#define UCHAR(c) ((unsigned char) (c))
/*
- * The following symbol is used in the mode field of FocusIn events
- * generated by an embedded application to request the input focus from
- * its container.
+ * The following symbol is used in the mode field of FocusIn events generated
+ * by an embedded application to request the input focus from its container.
*/
#define EMBEDDED_APP_WANTS_FOCUS (NotifyNormal + 20)
/*
- * The following special modifier mask bits are defined, to indicate
- * logical modifiers such as Meta and Alt that may float among the
- * actual modifier bits.
+ * The following special modifier mask bits are defined, to indicate logical
+ * modifiers such as Meta and Alt that may float among the actual modifier
+ * bits.
*/
#define META_MASK (AnyModifier<<1)
#define ALT_MASK (AnyModifier<<2)
+#define EXTENDED_MASK (AnyModifier<<3)
/*
- * Object types not declared in tkObj.c need to be mentioned here so
- * they can be properly registered with Tcl:
+ * Object types not declared in tkObj.c need to be mentioned here so they can
+ * be properly registered with Tcl:
*/
-extern Tcl_ObjType tkBorderObjType;
-extern Tcl_ObjType tkBitmapObjType;
-extern Tcl_ObjType tkColorObjType;
-extern Tcl_ObjType tkCursorObjType;
-extern Tcl_ObjType tkFontObjType;
-extern Tcl_ObjType tkOptionObjType;
-extern Tcl_ObjType tkStateKeyObjType;
+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;
/*
- * Miscellaneous variables shared among Tk modules but not exported
- * to the outside world:
+ * Miscellaneous variables shared among Tk modules but not exported to the
+ * outside world:
*/
-extern Tk_SmoothMethod tkBezierSmoothMethod;
-extern Tk_ImageType tkBitmapImageType;
-extern Tk_PhotoImageFormat tkImgFmtGIF;
-extern void (*tkHandleEventProc) _ANSI_ARGS_((
- XEvent* eventPtr));
-extern Tk_PhotoImageFormat tkImgFmtPPM;
-extern TkMainInfo *tkMainWindowList;
-extern Tk_ImageType tkPhotoImageType;
-extern Tcl_HashTable tkPredefBitmapTable;
-extern int tkSendSerial;
+MODULE_SCOPE Tk_SmoothMethod tkBezierSmoothMethod;
+MODULE_SCOPE Tk_ImageType tkBitmapImageType;
+MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtGIF;
+MODULE_SCOPE void (*tkHandleEventProc) (XEvent* eventPtr);
+MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtPPM;
+MODULE_SCOPE TkMainInfo *tkMainWindowList;
+MODULE_SCOPE Tk_ImageType tkPhotoImageType;
+MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable;
#include "tkIntDecls.h"
#ifdef BUILD_tk
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLEXPORT
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
#endif
/*
- * Internal procedures shared among Tk modules but not exported
- * to the outside world:
+ * Themed widget set init function:
*/
-EXTERN int Tk_BellObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_BindObjCmd _ANSI_ARGS_((ClientData clientData,
+MODULE_SCOPE int Ttk_Init(Tcl_Interp *interp);
+
+/*
+ * Internal functions shared among Tk modules but not exported to the outside
+ * world:
+ */
+
+MODULE_SCOPE int Tk_BellObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_BindObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_BindtagsObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_BindtagsObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ButtonObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ButtonObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_CanvasObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_CanvasObjCmd(ClientData clientData,
Tcl_Interp *interp, int argc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_CheckbuttonObjCmd _ANSI_ARGS_((
- ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_CheckbuttonObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ClipboardObjCmd _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ChooseColorObjCmd _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ChooseDirectoryObjCmd _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ChooseFontObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_DestroyObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_EntryObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_EventObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ClipboardObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_FileeventCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_FrameObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ChooseColorObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_FocusObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_FontObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GetOpenFileObjCmd _ANSI_ARGS_((
- ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GetSaveFileObjCmd _ANSI_ARGS_((
- ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GrabObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ChooseDirectoryObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GridObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ChooseFontObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ImageObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_LabelObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_DestroyObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_LabelframeObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_EntryObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ListboxObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_EventObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_LowerObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_FrameObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_MenubuttonObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_MessageBoxObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_MessageObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_FocusObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_PanedWindowObjCmd _ANSI_ARGS_((
- ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_FontObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_OptionObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_GetOpenFileObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_PackObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_GetSaveFileObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_PlaceObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_GrabObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_((
- ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_GridObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_RaiseObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ImageObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ScaleObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ScrollbarCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv));
-EXTERN int Tk_SelectionObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_LabelObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_SendCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv));
-EXTERN int Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_SpinboxObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_TextCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv));
-EXTERN int Tk_TkObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_LabelframeObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_TkwaitObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ListboxObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ToplevelObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_LowerObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_UpdateObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_WinfoObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_MenubuttonObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-EXTERN int Tk_WmObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_MessageBoxObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-
-EXTERN void TkEventInit _ANSI_ARGS_((void));
-
-EXTERN void TkRegisterObjTypes _ANSI_ARGS_((void));
-
-EXTERN int TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp));
-EXTERN int TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv));
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_MessageObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_PanedWindowObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_OptionObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_PackObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_PlaceObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_RadiobuttonObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_RaiseObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ScaleObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_ScrollbarCmd(ClientData clientData,
+ Tcl_Interp *interp, int argc, const char **argv);
+MODULE_SCOPE int Tk_SelectionObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_SendCmd(ClientData clientData,
+ Tcl_Interp *interp, int argc, const char **argv);
+MODULE_SCOPE int Tk_SendObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_SpinboxObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+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[]);
+MODULE_SCOPE int Tk_ToplevelObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_UpdateObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_WinfoObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+MODULE_SCOPE int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *const objv[]);
-EXTERN int TkpTestembedCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, CONST char **argv));
-EXTERN int TkCanvasGetCoordObj _ANSI_ARGS_((Tcl_Interp *interp,
+MODULE_SCOPE int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp,
+ Tk_Window tkwin, Tcl_Obj *objPtr,
+ double *doublePtr);
+
+MODULE_SCOPE void TkEventInit(void);
+MODULE_SCOPE void TkRegisterObjTypes(void);
+MODULE_SCOPE int TkCreateMenuCmd(Tcl_Interp *interp);
+MODULE_SCOPE int TkDeadAppCmd(ClientData clientData,
+ Tcl_Interp *interp, int argc, const char **argv);
+MODULE_SCOPE int TkCanvasGetCoordObj(Tcl_Interp *interp,
Tk_Canvas canvas, Tcl_Obj *obj,
- double *doublePtr));
-EXTERN int TkCanvasDashParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec,
- int offset));
-EXTERN char * TkCanvasDashPrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkGetDoublePixels _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *string,
- double *doublePtr));
-EXTERN int TkOffsetParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec,
- int offset));
-EXTERN char * TkOffsetPrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkOrientParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value,
- char *widgRec, int offset));
-EXTERN char * TkOrientPrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkPixelParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec,
- int offset));
-EXTERN char * TkPixelPrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkPostscriptImage _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, Tk_PostscriptInfo psInfo,
- XImage *ximage, int x, int y, int width,
- int height));
-EXTERN int TkSmoothParseProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin,
- CONST char *value, char *recordPtr, int offset));
-EXTERN char * TkSmoothPrintProc _ANSI_ARGS_((ClientData clientData,
- Tk_Window tkwin, char *recordPtr, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkStateParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value,
- char *widgRec, int offset));
-EXTERN char * TkStatePrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN int TkTileParseProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- Tk_Window tkwin, CONST char *value, char *widgRec,
- int offset));
-EXTERN char * TkTilePrintProc _ANSI_ARGS_((
- ClientData clientData, Tk_Window tkwin,
- char *widgRec, int offset,
- Tcl_FreeProc **freeProcPtr));
-EXTERN void TkCreateExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
- ClientData clientData));
-EXTERN void TkDeleteExitHandler _ANSI_ARGS_((Tcl_ExitProc *proc,
- ClientData clientData));
-EXTERN Tcl_ExitProc TkFinalize;
-EXTERN void TkPrintPadAmount _ANSI_ARGS_((Tcl_Interp *interp,
- char *buffer, int pad1, int pad2));
-EXTERN int TkParsePadAmount _ANSI_ARGS_((Tcl_Interp *interp,
+ double *doublePtr);
+MODULE_SCOPE int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin,
+ const char *string, double *doublePtr);
+MODULE_SCOPE int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_PostscriptInfo psInfo, XImage *ximage,
+ int x, int y, int width, int height);
+MODULE_SCOPE void TkMapTopFrame(Tk_Window tkwin);
+MODULE_SCOPE XEvent * TkpGetBindingXEvent(Tcl_Interp *interp);
+MODULE_SCOPE void TkCreateExitHandler(Tcl_ExitProc *proc,
+ ClientData clientData);
+MODULE_SCOPE void TkDeleteExitHandler(Tcl_ExitProc *proc,
+ ClientData clientData);
+MODULE_SCOPE Tcl_ExitProc TkFinalize;
+MODULE_SCOPE Tcl_ExitProc TkFinalizeThread;
+MODULE_SCOPE void TkpBuildRegionFromAlphaData(TkRegion region,
+ unsigned x, unsigned y, unsigned width,
+ unsigned height, unsigned char *dataPtr,
+ unsigned pixelStride, unsigned lineStride);
+MODULE_SCOPE void TkPrintPadAmount(Tcl_Interp *interp,
+ char *buffer, int pad1, int pad2);
+MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr,
- int *pad1Ptr, int *pad2Ptr));
-EXTERN int TkpAlwaysShowSelection _ANSI_ARGS_((Tk_Window tkwin));
+ int *pad1Ptr, int *pad2Ptr);
+MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr);
+MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr);
+MODULE_SCOPE int TkpAlwaysShowSelection(Tk_Window tkwin);
+MODULE_SCOPE void TkpDrawCharsInContext(Display * display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ const char *source, int numBytes, int rangeStart,
+ int rangeLength, int x, int y);
+MODULE_SCOPE int TkpMeasureCharsInContext(Tk_Font tkfont,
+ const char *source, int numBytes, int rangeStart,
+ int rangeLength, int maxLength, int flags,
+ int *lengthPtr);
+MODULE_SCOPE void TkUnderlineCharsInContext(Display *display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ const char *string, int numBytes, int x, int y,
+ int firstByte, int lastByte);
+MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont,
+ Tcl_UniChar c, struct TkFontAttributes *faPtr);
/*
* Unsupported commands.
*/
-EXTERN int TkUnsupported1ObjCmd _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]));
-# undef TCL_STORAGE_CLASS
-# define TCL_STORAGE_CLASS DLLIMPORT
+MODULE_SCOPE int TkUnsupported1ObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
-#endif /* _TKINT */
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLIMPORT
+
+#endif /* _TKINT */
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index 76d181c..531ee5f 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -32,472 +32,769 @@
* Exported function declarations:
*/
+#ifndef TkAllocWindow_TCL_DECLARED
+#define TkAllocWindow_TCL_DECLARED
/* 0 */
-EXTERN TkWindow * TkAllocWindow _ANSI_ARGS_((TkDisplay * dispPtr,
- int screenNum, TkWindow * parentPtr));
+EXTERN TkWindow * TkAllocWindow(TkDisplay *dispPtr, int screenNum,
+ TkWindow *parentPtr);
+#endif
+#ifndef TkBezierPoints_TCL_DECLARED
+#define TkBezierPoints_TCL_DECLARED
/* 1 */
-EXTERN void TkBezierPoints _ANSI_ARGS_((double control[],
- int numSteps, double * coordPtr));
+EXTERN void TkBezierPoints(double control[], int numSteps,
+ double *coordPtr);
+#endif
+#ifndef TkBezierScreenPoints_TCL_DECLARED
+#define TkBezierScreenPoints_TCL_DECLARED
/* 2 */
-EXTERN void TkBezierScreenPoints _ANSI_ARGS_((Tk_Canvas canvas,
- double control[], int numSteps,
- XPoint * xPointPtr));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkBindDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkBindEventProc_TCL_DECLARED
+#define TkBindEventProc_TCL_DECLARED
/* 4 */
-EXTERN void TkBindEventProc _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * eventPtr));
+EXTERN void TkBindEventProc(TkWindow *winPtr, XEvent *eventPtr);
+#endif
+#ifndef TkBindFree_TCL_DECLARED
+#define TkBindFree_TCL_DECLARED
/* 5 */
-EXTERN void TkBindFree _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkBindFree(TkMainInfo *mainPtr);
+#endif
+#ifndef TkBindInit_TCL_DECLARED
+#define TkBindInit_TCL_DECLARED
/* 6 */
-EXTERN void TkBindInit _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkBindInit(TkMainInfo *mainPtr);
+#endif
+#ifndef TkChangeEventWindow_TCL_DECLARED
+#define TkChangeEventWindow_TCL_DECLARED
/* 7 */
-EXTERN void TkChangeEventWindow _ANSI_ARGS_((XEvent * eventPtr,
- TkWindow * winPtr));
+EXTERN void TkChangeEventWindow(XEvent *eventPtr,
+ TkWindow *winPtr);
+#endif
+#ifndef TkClipInit_TCL_DECLARED
+#define TkClipInit_TCL_DECLARED
/* 8 */
-EXTERN int TkClipInit _ANSI_ARGS_((Tcl_Interp * interp,
- TkDisplay * dispPtr));
+EXTERN int TkClipInit(Tcl_Interp *interp, TkDisplay *dispPtr);
+#endif
+#ifndef TkComputeAnchor_TCL_DECLARED
+#define TkComputeAnchor_TCL_DECLARED
/* 9 */
-EXTERN void TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor,
- Tk_Window tkwin, int padX, int padY,
- int innerWidth, int innerHeight, int * xPtr,
- int * yPtr));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- char * script));
+EXTERN int TkCopyAndGlobalEval(Tcl_Interp *interp, char *script);
+#endif
+#ifndef TkCreateBindingProcedure_TCL_DECLARED
+#define TkCreateBindingProcedure_TCL_DECLARED
/* 11 */
-EXTERN unsigned long TkCreateBindingProcedure _ANSI_ARGS_((
- Tcl_Interp * interp,
- Tk_BindingTable bindingTable,
- ClientData object, CONST char * eventString,
- TkBindEvalProc * evalProc,
- TkBindFreeProc * freeProc,
- ClientData clientData));
+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
/* 12 */
-EXTERN TkCursor * TkCreateCursorFromData _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * source, CONST char * mask,
- int width, int height, int xHot, int yHot,
- XColor fg, XColor bg));
+EXTERN TkCursor * TkCreateCursorFromData(Tk_Window tkwin,
+ 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 _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp * interp, int argc, char ** argv,
- int toplevel, char * appName));
+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
/* 14 */
-EXTERN Tk_Window TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * screenName, char * baseName));
+EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp,
+ CONST char *screenName, char *baseName);
+#endif
+#ifndef TkCurrentTime_TCL_DECLARED
+#define TkCurrentTime_TCL_DECLARED
/* 15 */
-EXTERN Time TkCurrentTime _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN Time TkCurrentTime(TkDisplay *dispPtr);
+#endif
+#ifndef TkDeleteAllImages_TCL_DECLARED
+#define TkDeleteAllImages_TCL_DECLARED
/* 16 */
-EXTERN void TkDeleteAllImages _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkDeleteAllImages(TkMainInfo *mainPtr);
+#endif
+#ifndef TkDoConfigureNotify_TCL_DECLARED
+#define TkDoConfigureNotify_TCL_DECLARED
/* 17 */
-EXTERN void TkDoConfigureNotify _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkDoConfigureNotify(TkWindow *winPtr);
+#endif
+#ifndef TkDrawInsetFocusHighlight_TCL_DECLARED
+#define TkDrawInsetFocusHighlight_TCL_DECLARED
/* 18 */
-EXTERN void TkDrawInsetFocusHighlight _ANSI_ARGS_((
- Tk_Window tkwin, GC gc, int width,
- Drawable drawable, int padding));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkEventDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkFillPolygon_TCL_DECLARED
+#define TkFillPolygon_TCL_DECLARED
/* 20 */
-EXTERN void TkFillPolygon _ANSI_ARGS_((Tk_Canvas canvas,
- double * coordPtr, int numPoints,
- Display * display, Drawable drawable, GC gc,
- GC outlineGC));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * option,
- CONST TkStateMap * mapPtr,
- CONST char * strKey));
+EXTERN int TkFindStateNum(Tcl_Interp *interp,
+ CONST char *option, CONST TkStateMap *mapPtr,
+ CONST char *strKey);
+#endif
+#ifndef TkFindStateString_TCL_DECLARED
+#define TkFindStateString_TCL_DECLARED
/* 22 */
-EXTERN char * TkFindStateString _ANSI_ARGS_((
- CONST TkStateMap * mapPtr, int numKey));
+EXTERN char * TkFindStateString(CONST TkStateMap *mapPtr,
+ int numKey);
+#endif
+#ifndef TkFocusDeadWindow_TCL_DECLARED
+#define TkFocusDeadWindow_TCL_DECLARED
/* 23 */
-EXTERN void TkFocusDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkFocusDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkFocusFilterEvent_TCL_DECLARED
+#define TkFocusFilterEvent_TCL_DECLARED
/* 24 */
-EXTERN int TkFocusFilterEvent _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * eventPtr));
+EXTERN int TkFocusFilterEvent(TkWindow *winPtr,
+ XEvent *eventPtr);
+#endif
+#ifndef TkFocusKeyEvent_TCL_DECLARED
+#define TkFocusKeyEvent_TCL_DECLARED
/* 25 */
-EXTERN TkWindow * TkFocusKeyEvent _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * eventPtr));
+EXTERN TkWindow * TkFocusKeyEvent(TkWindow *winPtr, XEvent *eventPtr);
+#endif
+#ifndef TkFontPkgInit_TCL_DECLARED
+#define TkFontPkgInit_TCL_DECLARED
/* 26 */
-EXTERN void TkFontPkgInit _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkFontPkgInit(TkMainInfo *mainPtr);
+#endif
+#ifndef TkFontPkgFree_TCL_DECLARED
+#define TkFontPkgFree_TCL_DECLARED
/* 27 */
-EXTERN void TkFontPkgFree _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkFontPkgFree(TkMainInfo *mainPtr);
+#endif
+#ifndef TkFreeBindingTags_TCL_DECLARED
+#define TkFreeBindingTags_TCL_DECLARED
/* 28 */
-EXTERN void TkFreeBindingTags _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkFreeBindingTags(TkWindow *winPtr);
+#endif
+#ifndef TkpFreeCursor_TCL_DECLARED
+#define TkpFreeCursor_TCL_DECLARED
/* 29 */
-EXTERN void TkpFreeCursor _ANSI_ARGS_((TkCursor * cursorPtr));
+EXTERN void TkpFreeCursor(TkCursor *cursorPtr);
+#endif
+#ifndef TkGetBitmapData_TCL_DECLARED
+#define TkGetBitmapData_TCL_DECLARED
/* 30 */
-EXTERN char * TkGetBitmapData _ANSI_ARGS_((Tcl_Interp * interp,
- char * string, char * fileName,
- int * widthPtr, int * heightPtr,
- int * hotXPtr, int * hotYPtr));
+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
/* 31 */
-EXTERN void TkGetButtPoints _ANSI_ARGS_((double p1[],
- double p2[], double width, int project,
- double m1[], double m2[]));
+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 _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tk_Uid string));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, CONST char * screenName));
+EXTERN CONST84_RETURN char * TkGetDefaultScreenName(Tcl_Interp *interp,
+ CONST char *screenName);
+#endif
+#ifndef TkGetDisplay_TCL_DECLARED
+#define TkGetDisplay_TCL_DECLARED
/* 34 */
-EXTERN TkDisplay * TkGetDisplay _ANSI_ARGS_((Display * display));
+EXTERN TkDisplay * TkGetDisplay(Display *display);
+#endif
+#ifndef TkGetDisplayOf_TCL_DECLARED
+#define TkGetDisplayOf_TCL_DECLARED
/* 35 */
-EXTERN int TkGetDisplayOf _ANSI_ARGS_((Tcl_Interp * interp,
- int objc, Tcl_Obj *CONST objv[],
- Tk_Window * tkwinPtr));
+EXTERN int TkGetDisplayOf(Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr);
+#endif
+#ifndef TkGetFocusWin_TCL_DECLARED
+#define TkGetFocusWin_TCL_DECLARED
/* 36 */
-EXTERN TkWindow * TkGetFocusWin _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN TkWindow * TkGetFocusWin(TkWindow *winPtr);
+#endif
+#ifndef TkGetInterpNames_TCL_DECLARED
+#define TkGetInterpNames_TCL_DECLARED
/* 37 */
-EXTERN int TkGetInterpNames _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin));
+EXTERN int TkGetInterpNames(Tcl_Interp *interp, Tk_Window tkwin);
+#endif
+#ifndef TkGetMiterPoints_TCL_DECLARED
+#define TkGetMiterPoints_TCL_DECLARED
/* 38 */
-EXTERN int TkGetMiterPoints _ANSI_ARGS_((double p1[],
- double p2[], double p3[], double width,
- double m1[], double m2[]));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- int * xPtr, int * yPtr));
+EXTERN void TkGetPointerCoords(Tk_Window tkwin, int *xPtr,
+ int *yPtr);
+#endif
+#ifndef TkGetServerInfo_TCL_DECLARED
+#define TkGetServerInfo_TCL_DECLARED
/* 40 */
-EXTERN void TkGetServerInfo _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin));
+EXTERN void TkGetServerInfo(Tcl_Interp *interp, Tk_Window tkwin);
+#endif
+#ifndef TkGrabDeadWindow_TCL_DECLARED
+#define TkGrabDeadWindow_TCL_DECLARED
/* 41 */
-EXTERN void TkGrabDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkGrabDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkGrabState_TCL_DECLARED
+#define TkGrabState_TCL_DECLARED
/* 42 */
-EXTERN int TkGrabState _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN int TkGrabState(TkWindow *winPtr);
+#endif
+#ifndef TkIncludePoint_TCL_DECLARED
+#define TkIncludePoint_TCL_DECLARED
/* 43 */
-EXTERN void TkIncludePoint _ANSI_ARGS_((Tk_Item * itemPtr,
- double * pointPtr));
+EXTERN void TkIncludePoint(Tk_Item *itemPtr, double *pointPtr);
+#endif
+#ifndef TkInOutEvents_TCL_DECLARED
+#define TkInOutEvents_TCL_DECLARED
/* 44 */
-EXTERN void TkInOutEvents _ANSI_ARGS_((XEvent * eventPtr,
- TkWindow * sourcePtr, TkWindow * destPtr,
- int leaveType, int enterType,
- Tcl_QueuePosition position));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void TkInstallFrameMenu(Tk_Window tkwin);
+#endif
+#ifndef TkKeysymToString_TCL_DECLARED
+#define TkKeysymToString_TCL_DECLARED
/* 46 */
-EXTERN char * TkKeysymToString _ANSI_ARGS_((KeySym keysym));
+EXTERN char * TkKeysymToString(KeySym keysym);
+#endif
+#ifndef TkLineToArea_TCL_DECLARED
+#define TkLineToArea_TCL_DECLARED
/* 47 */
-EXTERN int TkLineToArea _ANSI_ARGS_((double end1Ptr[],
- double end2Ptr[], double rectPtr[]));
+EXTERN int TkLineToArea(double end1Ptr[], double end2Ptr[],
+ double rectPtr[]);
+#endif
+#ifndef TkLineToPoint_TCL_DECLARED
+#define TkLineToPoint_TCL_DECLARED
/* 48 */
-EXTERN double TkLineToPoint _ANSI_ARGS_((double end1Ptr[],
- double end2Ptr[], double pointPtr[]));
+EXTERN double TkLineToPoint(double end1Ptr[], double end2Ptr[],
+ double pointPtr[]);
+#endif
+#ifndef TkMakeBezierCurve_TCL_DECLARED
+#define TkMakeBezierCurve_TCL_DECLARED
/* 49 */
-EXTERN int TkMakeBezierCurve _ANSI_ARGS_((Tk_Canvas canvas,
- double * pointPtr, int numPoints,
- int numSteps, XPoint xPoints[],
- double dblPoints[]));
+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 _ANSI_ARGS_((
- Tcl_Interp * interp, Tk_Canvas canvas,
- double * pointPtr, int numPoints));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkOptionClassChanged(TkWindow *winPtr);
+#endif
+#ifndef TkOptionDeadWindow_TCL_DECLARED
+#define TkOptionDeadWindow_TCL_DECLARED
/* 52 */
-EXTERN void TkOptionDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkOptionDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkOvalToArea_TCL_DECLARED
+#define TkOvalToArea_TCL_DECLARED
/* 53 */
-EXTERN int TkOvalToArea _ANSI_ARGS_((double * ovalPtr,
- double * rectPtr));
+EXTERN int TkOvalToArea(double *ovalPtr, double *rectPtr);
+#endif
+#ifndef TkOvalToPoint_TCL_DECLARED
+#define TkOvalToPoint_TCL_DECLARED
/* 54 */
-EXTERN double TkOvalToPoint _ANSI_ARGS_((double ovalPtr[],
- double width, int filled, double pointPtr[]));
+EXTERN double TkOvalToPoint(double ovalPtr[], double width,
+ int filled, double pointPtr[]);
+#endif
+#ifndef TkpChangeFocus_TCL_DECLARED
+#define TkpChangeFocus_TCL_DECLARED
/* 55 */
-EXTERN int TkpChangeFocus _ANSI_ARGS_((TkWindow * winPtr,
- int force));
+EXTERN int TkpChangeFocus(TkWindow *winPtr, int force);
+#endif
+#ifndef TkpCloseDisplay_TCL_DECLARED
+#define TkpCloseDisplay_TCL_DECLARED
/* 56 */
-EXTERN void TkpCloseDisplay _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkpCloseDisplay(TkDisplay *dispPtr);
+#endif
+#ifndef TkpClaimFocus_TCL_DECLARED
+#define TkpClaimFocus_TCL_DECLARED
/* 57 */
-EXTERN void TkpClaimFocus _ANSI_ARGS_((TkWindow * topLevelPtr,
- int force));
+EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force);
+#endif
+#ifndef TkpDisplayWarning_TCL_DECLARED
+#define TkpDisplayWarning_TCL_DECLARED
/* 58 */
-EXTERN void TkpDisplayWarning _ANSI_ARGS_((CONST char * msg,
- CONST char * title));
+EXTERN void TkpDisplayWarning(CONST char *msg, CONST char *title);
+#endif
+#ifndef TkpGetAppName_TCL_DECLARED
+#define TkpGetAppName_TCL_DECLARED
/* 59 */
-EXTERN void TkpGetAppName _ANSI_ARGS_((Tcl_Interp * interp,
- Tcl_DString * name));
+EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name);
+#endif
+#ifndef TkpGetOtherWindow_TCL_DECLARED
+#define TkpGetOtherWindow_TCL_DECLARED
/* 60 */
-EXTERN TkWindow * TkpGetOtherWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN TkWindow * TkpGetOtherWindow(TkWindow *winPtr);
+#endif
+#ifndef TkpGetWrapperWindow_TCL_DECLARED
+#define TkpGetWrapperWindow_TCL_DECLARED
/* 61 */
-EXTERN TkWindow * TkpGetWrapperWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr);
+#endif
+#ifndef TkpInit_TCL_DECLARED
+#define TkpInit_TCL_DECLARED
/* 62 */
-EXTERN int TkpInit _ANSI_ARGS_((Tcl_Interp * interp));
+EXTERN int TkpInit(Tcl_Interp *interp);
+#endif
+#ifndef TkpInitializeMenuBindings_TCL_DECLARED
+#define TkpInitializeMenuBindings_TCL_DECLARED
/* 63 */
-EXTERN void TkpInitializeMenuBindings _ANSI_ARGS_((
- Tcl_Interp * interp,
- Tk_BindingTable bindingTable));
+EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp,
+ Tk_BindingTable bindingTable);
+#endif
+#ifndef TkpMakeContainer_TCL_DECLARED
+#define TkpMakeContainer_TCL_DECLARED
/* 64 */
-EXTERN void TkpMakeContainer _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void TkpMakeContainer(Tk_Window tkwin);
+#endif
+#ifndef TkpMakeMenuWindow_TCL_DECLARED
+#define TkpMakeMenuWindow_TCL_DECLARED
/* 65 */
-EXTERN void TkpMakeMenuWindow _ANSI_ARGS_((Tk_Window tkwin,
- int transient));
+EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient);
+#endif
+#ifndef TkpMakeWindow_TCL_DECLARED
+#define TkpMakeWindow_TCL_DECLARED
/* 66 */
-EXTERN Window TkpMakeWindow _ANSI_ARGS_((TkWindow * winPtr,
- Window parent));
+EXTERN Window TkpMakeWindow(TkWindow *winPtr, Window parent);
+#endif
+#ifndef TkpMenuNotifyToplevelCreate_TCL_DECLARED
+#define TkpMenuNotifyToplevelCreate_TCL_DECLARED
/* 67 */
-EXTERN void TkpMenuNotifyToplevelCreate _ANSI_ARGS_((
- Tcl_Interp * interp1, char * menuName));
+EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp1,
+ char *menuName);
+#endif
+#ifndef TkpOpenDisplay_TCL_DECLARED
+#define TkpOpenDisplay_TCL_DECLARED
/* 68 */
-EXTERN TkDisplay * TkpOpenDisplay _ANSI_ARGS_((
- CONST char * display_name));
+EXTERN TkDisplay * TkpOpenDisplay(CONST char *display_name);
+#endif
+#ifndef TkPointerEvent_TCL_DECLARED
+#define TkPointerEvent_TCL_DECLARED
/* 69 */
-EXTERN int TkPointerEvent _ANSI_ARGS_((XEvent * eventPtr,
- TkWindow * winPtr));
+EXTERN int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr);
+#endif
+#ifndef TkPolygonToArea_TCL_DECLARED
+#define TkPolygonToArea_TCL_DECLARED
/* 70 */
-EXTERN int TkPolygonToArea _ANSI_ARGS_((double * polyPtr,
- int numPoints, double * rectPtr));
+EXTERN int TkPolygonToArea(double *polyPtr, int numPoints,
+ double *rectPtr);
+#endif
+#ifndef TkPolygonToPoint_TCL_DECLARED
+#define TkPolygonToPoint_TCL_DECLARED
/* 71 */
-EXTERN double TkPolygonToPoint _ANSI_ARGS_((double * polyPtr,
- int numPoints, double * pointPtr));
+EXTERN double TkPolygonToPoint(double *polyPtr, int numPoints,
+ double *pointPtr);
+#endif
+#ifndef TkPositionInTree_TCL_DECLARED
+#define TkPositionInTree_TCL_DECLARED
/* 72 */
-EXTERN int TkPositionInTree _ANSI_ARGS_((TkWindow * winPtr,
- TkWindow * treePtr));
+EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr);
+#endif
+#ifndef TkpRedirectKeyEvent_TCL_DECLARED
+#define TkpRedirectKeyEvent_TCL_DECLARED
/* 73 */
-EXTERN void TkpRedirectKeyEvent _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * eventPtr));
+EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr,
+ XEvent *eventPtr);
+#endif
+#ifndef TkpSetMainMenubar_TCL_DECLARED
+#define TkpSetMainMenubar_TCL_DECLARED
/* 74 */
-EXTERN void TkpSetMainMenubar _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * menuName));
+EXTERN void TkpSetMainMenubar(Tcl_Interp *interp,
+ Tk_Window tkwin, char *menuName);
+#endif
+#ifndef TkpUseWindow_TCL_DECLARED
+#define TkpUseWindow_TCL_DECLARED
/* 75 */
-EXTERN int TkpUseWindow _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, CONST char * string));
+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 _ANSI_ARGS_((Window win,
- TkDisplay * dispPtr));
+EXTERN int TkpWindowWasRecentlyDeleted(Window win,
+ TkDisplay *dispPtr);
+#endif
+#ifndef TkQueueEventForAllChildren_TCL_DECLARED
+#define TkQueueEventForAllChildren_TCL_DECLARED
/* 77 */
-EXTERN void TkQueueEventForAllChildren _ANSI_ARGS_((
- TkWindow * winPtr, XEvent * eventPtr));
+EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr,
+ XEvent *eventPtr);
+#endif
+#ifndef TkReadBitmapFile_TCL_DECLARED
+#define TkReadBitmapFile_TCL_DECLARED
/* 78 */
-EXTERN int TkReadBitmapFile _ANSI_ARGS_((Display* display,
- Drawable d, CONST char* filename,
- unsigned int* width_return,
- unsigned int* height_return,
- Pixmap* bitmap_return, int* x_hot_return,
- int* y_hot_return));
+EXTERN 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);
+#endif
+#ifndef TkScrollWindow_TCL_DECLARED
+#define TkScrollWindow_TCL_DECLARED
/* 79 */
-EXTERN int TkScrollWindow _ANSI_ARGS_((Tk_Window tkwin, GC gc,
- int x, int y, int width, int height, int dx,
- int dy, TkRegion damageRgn));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkSelDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkSelEventProc_TCL_DECLARED
+#define TkSelEventProc_TCL_DECLARED
/* 81 */
-EXTERN void TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin,
- XEvent * eventPtr));
+EXTERN void TkSelEventProc(Tk_Window tkwin, XEvent *eventPtr);
+#endif
+#ifndef TkSelInit_TCL_DECLARED
+#define TkSelInit_TCL_DECLARED
/* 82 */
-EXTERN void TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void TkSelInit(Tk_Window tkwin);
+#endif
+#ifndef TkSelPropProc_TCL_DECLARED
+#define TkSelPropProc_TCL_DECLARED
/* 83 */
-EXTERN void TkSelPropProc _ANSI_ARGS_((XEvent * eventPtr));
+EXTERN void TkSelPropProc(XEvent *eventPtr);
+#endif
/* Slot 84 is reserved */
+#ifndef TkSetWindowMenuBar_TCL_DECLARED
+#define TkSetWindowMenuBar_TCL_DECLARED
/* 85 */
-EXTERN void TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * oldMenuName,
- char * menuName));
+EXTERN void TkSetWindowMenuBar(Tcl_Interp *interp,
+ Tk_Window tkwin, char *oldMenuName,
+ char *menuName);
+#endif
+#ifndef TkStringToKeysym_TCL_DECLARED
+#define TkStringToKeysym_TCL_DECLARED
/* 86 */
-EXTERN KeySym TkStringToKeysym _ANSI_ARGS_((char * name));
+EXTERN KeySym TkStringToKeysym(char *name);
+#endif
+#ifndef TkThickPolyLineToArea_TCL_DECLARED
+#define TkThickPolyLineToArea_TCL_DECLARED
/* 87 */
-EXTERN int TkThickPolyLineToArea _ANSI_ARGS_((double * coordPtr,
- int numPoints, double width, int capStyle,
- int joinStyle, double * rectPtr));
+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 _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN void TkWmAddToColormapWindows(TkWindow *winPtr);
+#endif
+#ifndef TkWmDeadWindow_TCL_DECLARED
+#define TkWmDeadWindow_TCL_DECLARED
/* 89 */
-EXTERN void TkWmDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkWmDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkWmFocusToplevel_TCL_DECLARED
+#define TkWmFocusToplevel_TCL_DECLARED
/* 90 */
-EXTERN TkWindow * TkWmFocusToplevel _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN TkWindow * TkWmFocusToplevel(TkWindow *winPtr);
+#endif
+#ifndef TkWmMapWindow_TCL_DECLARED
+#define TkWmMapWindow_TCL_DECLARED
/* 91 */
-EXTERN void TkWmMapWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkWmMapWindow(TkWindow *winPtr);
+#endif
+#ifndef TkWmNewWindow_TCL_DECLARED
+#define TkWmNewWindow_TCL_DECLARED
/* 92 */
-EXTERN void TkWmNewWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkWmNewWindow(TkWindow *winPtr);
+#endif
+#ifndef TkWmProtocolEventProc_TCL_DECLARED
+#define TkWmProtocolEventProc_TCL_DECLARED
/* 93 */
-EXTERN void TkWmProtocolEventProc _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * evenvPtr));
+EXTERN void TkWmProtocolEventProc(TkWindow *winPtr,
+ XEvent *evenvPtr);
+#endif
+#ifndef TkWmRemoveFromColormapWindows_TCL_DECLARED
+#define TkWmRemoveFromColormapWindows_TCL_DECLARED
/* 94 */
-EXTERN void TkWmRemoveFromColormapWindows _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN void TkWmRemoveFromColormapWindows(TkWindow *winPtr);
+#endif
+#ifndef TkWmRestackToplevel_TCL_DECLARED
+#define TkWmRestackToplevel_TCL_DECLARED
/* 95 */
-EXTERN void TkWmRestackToplevel _ANSI_ARGS_((TkWindow * winPtr,
- int aboveBelow, TkWindow * otherPtr));
+EXTERN void TkWmRestackToplevel(TkWindow *winPtr, int aboveBelow,
+ TkWindow *otherPtr);
+#endif
+#ifndef TkWmSetClass_TCL_DECLARED
+#define TkWmSetClass_TCL_DECLARED
/* 96 */
-EXTERN void TkWmSetClass _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkWmSetClass(TkWindow *winPtr);
+#endif
+#ifndef TkWmUnmapWindow_TCL_DECLARED
+#define TkWmUnmapWindow_TCL_DECLARED
/* 97 */
-EXTERN void TkWmUnmapWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkWmUnmapWindow(TkWindow *winPtr);
+#endif
+#ifndef TkDebugBitmap_TCL_DECLARED
+#define TkDebugBitmap_TCL_DECLARED
/* 98 */
-EXTERN Tcl_Obj * TkDebugBitmap _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN Tcl_Obj * TkDebugBitmap(Tk_Window tkwin, char *name);
+#endif
+#ifndef TkDebugBorder_TCL_DECLARED
+#define TkDebugBorder_TCL_DECLARED
/* 99 */
-EXTERN Tcl_Obj * TkDebugBorder _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN Tcl_Obj * TkDebugBorder(Tk_Window tkwin, char *name);
+#endif
+#ifndef TkDebugCursor_TCL_DECLARED
+#define TkDebugCursor_TCL_DECLARED
/* 100 */
-EXTERN Tcl_Obj * TkDebugCursor _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN Tcl_Obj * TkDebugCursor(Tk_Window tkwin, char *name);
+#endif
+#ifndef TkDebugColor_TCL_DECLARED
+#define TkDebugColor_TCL_DECLARED
/* 101 */
-EXTERN Tcl_Obj * TkDebugColor _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN Tcl_Obj * TkDebugColor(Tk_Window tkwin, char *name);
+#endif
+#ifndef TkDebugConfig_TCL_DECLARED
+#define TkDebugConfig_TCL_DECLARED
/* 102 */
-EXTERN Tcl_Obj * TkDebugConfig _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_OptionTable table));
+EXTERN Tcl_Obj * TkDebugConfig(Tcl_Interp *interp,
+ Tk_OptionTable table);
+#endif
+#ifndef TkDebugFont_TCL_DECLARED
+#define TkDebugFont_TCL_DECLARED
/* 103 */
-EXTERN Tcl_Obj * TkDebugFont _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN Tcl_Obj * TkDebugFont(Tk_Window tkwin, char *name);
+#endif
+#ifndef TkFindStateNumObj_TCL_DECLARED
+#define TkFindStateNumObj_TCL_DECLARED
/* 104 */
-EXTERN int TkFindStateNumObj _ANSI_ARGS_((Tcl_Interp * interp,
- Tcl_Obj * optionPtr,
- CONST TkStateMap * mapPtr, Tcl_Obj * keyPtr));
+EXTERN int TkFindStateNumObj(Tcl_Interp *interp,
+ Tcl_Obj *optionPtr, CONST TkStateMap *mapPtr,
+ Tcl_Obj *keyPtr);
+#endif
+#ifndef TkGetBitmapPredefTable_TCL_DECLARED
+#define TkGetBitmapPredefTable_TCL_DECLARED
/* 105 */
-EXTERN Tcl_HashTable * TkGetBitmapPredefTable _ANSI_ARGS_((void));
+EXTERN Tcl_HashTable * TkGetBitmapPredefTable(void);
+#endif
+#ifndef TkGetDisplayList_TCL_DECLARED
+#define TkGetDisplayList_TCL_DECLARED
/* 106 */
-EXTERN TkDisplay * TkGetDisplayList _ANSI_ARGS_((void));
+EXTERN TkDisplay * TkGetDisplayList(void);
+#endif
+#ifndef TkGetMainInfoList_TCL_DECLARED
+#define TkGetMainInfoList_TCL_DECLARED
/* 107 */
-EXTERN TkMainInfo * TkGetMainInfoList _ANSI_ARGS_((void));
+EXTERN TkMainInfo * TkGetMainInfoList(void);
+#endif
+#ifndef TkGetWindowFromObj_TCL_DECLARED
+#define TkGetWindowFromObj_TCL_DECLARED
/* 108 */
-EXTERN int TkGetWindowFromObj _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, Tcl_Obj * objPtr,
- Tk_Window * windowPtr));
+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 _ANSI_ARGS_((TkWindow * winPtr,
- XEvent * eventPtr, Tcl_DString * dsPtr));
+EXTERN char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr,
+ Tcl_DString *dsPtr);
+#endif
+#ifndef TkpGetSubFonts_TCL_DECLARED
+#define TkpGetSubFonts_TCL_DECLARED
/* 110 */
-EXTERN void TkpGetSubFonts _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Font tkfont));
+EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
+#endif
+#ifndef TkpGetSystemDefault_TCL_DECLARED
+#define TkpGetSystemDefault_TCL_DECLARED
/* 111 */
-EXTERN Tcl_Obj * TkpGetSystemDefault _ANSI_ARGS_((Tk_Window tkwin,
- CONST char * dbName, CONST char * className));
+EXTERN Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin,
+ CONST char *dbName, CONST char *className);
+#endif
+#ifndef TkpMenuThreadInit_TCL_DECLARED
+#define TkpMenuThreadInit_TCL_DECLARED
/* 112 */
-EXTERN void TkpMenuThreadInit _ANSI_ARGS_((void));
-#ifdef __WIN32__
-/* 113 */
-EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
- XRectangle* rect_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+EXTERN void TkpMenuThreadInit(void);
+#endif
+#ifdef __WIN32__ /* WIN */
+#ifndef TkClipBox_TCL_DECLARED
+#define TkClipBox_TCL_DECLARED
/* 113 */
-EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
- XRectangle* rect_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((TkRegion rgn,
- XRectangle* rect_return));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 114 */
-EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+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 _ANSI_ARGS_((void));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+EXTERN TkRegion TkCreateRegion(void);
+#endif
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
+#ifndef TkCreateRegion_TCL_DECLARED
+#define TkCreateRegion_TCL_DECLARED
/* 114 */
-EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 115 */
-EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+EXTERN TkRegion TkCreateRegion(void);
+#endif
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
+#ifndef TkDestroyRegion_TCL_DECLARED
+#define TkDestroyRegion_TCL_DECLARED
/* 115 */
-EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((TkRegion rgn));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 116 */
-EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+EXTERN void TkDestroyRegion(TkRegion rgn);
+#endif
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
+#ifndef TkIntersectRegion_TCL_DECLARED
+#define TkIntersectRegion_TCL_DECLARED
/* 116 */
-EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 117 */
-EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
- int y, unsigned int width,
- unsigned int height));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+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 _ANSI_ARGS_((TkRegion rgn, int x,
- int y, unsigned int width,
- unsigned int height));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((TkRegion rgn, int x,
- int y, unsigned int width,
- unsigned int height));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 118 */
-EXTERN void TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
- TkRegion rgn));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+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 _ANSI_ARGS_((Display* display, GC gc,
- TkRegion rgn));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((Display* display, GC gc,
- TkRegion rgn));
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-/* 119 */
-EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
- TkRegion src, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+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 _ANSI_ARGS_((XRectangle* rect,
- TkRegion src, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((XRectangle* rect,
- TkRegion src, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
+EXTERN void TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
+ TkRegion dr_return);
+#endif
+#endif /* AQUA */
/* Slot 120 is reserved */
-#ifdef MAC_TCL
-/* 121 */
-EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display * display,
- CONST char * source));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#ifdef MAC_OSX_TK /* AQUA */
+#ifndef TkpCreateNativeBitmap_TCL_DECLARED
+#define TkpCreateNativeBitmap_TCL_DECLARED
/* 121 */
-EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display * display,
- CONST char * source));
-#endif /* MAC_OSX_TK */
-#ifdef MAC_TCL
-/* 122 */
-EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+EXTERN Pixmap TkpCreateNativeBitmap(Display *display,
+ CONST char *source);
+#endif
+#endif /* AQUA */
+#ifdef MAC_OSX_TK /* AQUA */
+#ifndef TkpDefineNativeBitmaps_TCL_DECLARED
+#define TkpDefineNativeBitmaps_TCL_DECLARED
/* 122 */
-EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void));
-#endif /* MAC_OSX_TK */
+EXTERN void TkpDefineNativeBitmaps(void);
+#endif
+#endif /* AQUA */
/* Slot 123 is reserved */
-#ifdef MAC_TCL
-/* 124 */
-EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display * display,
- CONST char * name, int * width, int * height));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#ifdef MAC_OSX_TK /* AQUA */
+#ifndef TkpGetNativeAppBitmap_TCL_DECLARED
+#define TkpGetNativeAppBitmap_TCL_DECLARED
/* 124 */
-EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display * display,
- CONST char * name, int * width, int * height));
-#endif /* MAC_OSX_TK */
+EXTERN Pixmap TkpGetNativeAppBitmap(Display *display,
+ CONST char *name, int *width, int *height);
+#endif
+#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
/* Slot 127 is reserved */
@@ -508,343 +805,524 @@ EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((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 _ANSI_ARGS_((Tk_Window tkwin,
- GC fgGC, GC bgGC, int highlightWidth,
- Drawable drawable));
+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 _ANSI_ARGS_((TkWindow * winPtr,
- int force));
+EXTERN void TkSetFocusWin(TkWindow *winPtr, int force);
+#endif
+#ifndef TkpSetKeycodeAndState_TCL_DECLARED
+#define TkpSetKeycodeAndState_TCL_DECLARED
/* 137 */
-EXTERN void TkpSetKeycodeAndState _ANSI_ARGS_((Tk_Window tkwin,
- KeySym keySym, XEvent * eventPtr));
+EXTERN void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym,
+ XEvent *eventPtr);
+#endif
+#ifndef TkpGetKeySym_TCL_DECLARED
+#define TkpGetKeySym_TCL_DECLARED
/* 138 */
-EXTERN KeySym TkpGetKeySym _ANSI_ARGS_((TkDisplay * dispPtr,
- XEvent * eventPtr));
+EXTERN KeySym TkpGetKeySym(TkDisplay *dispPtr, XEvent *eventPtr);
+#endif
+#ifndef TkpInitKeymapInfo_TCL_DECLARED
+#define TkpInitKeymapInfo_TCL_DECLARED
/* 139 */
-EXTERN void TkpInitKeymapInfo _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkpInitKeymapInfo(TkDisplay *dispPtr);
+#endif
+#ifndef TkPhotoGetValidRegion_TCL_DECLARED
+#define TkPhotoGetValidRegion_TCL_DECLARED
/* 140 */
-EXTERN TkRegion TkPhotoGetValidRegion _ANSI_ARGS_((
- Tk_PhotoHandle handle));
+EXTERN TkRegion TkPhotoGetValidRegion(Tk_PhotoHandle handle);
+#endif
+#ifndef TkWmStackorderToplevel_TCL_DECLARED
+#define TkWmStackorderToplevel_TCL_DECLARED
/* 141 */
-EXTERN TkWindow ** TkWmStackorderToplevel _ANSI_ARGS_((
- TkWindow * parentPtr));
+EXTERN TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr);
+#endif
+#ifndef TkFocusFree_TCL_DECLARED
+#define TkFocusFree_TCL_DECLARED
/* 142 */
-EXTERN void TkFocusFree _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkFocusFree(TkMainInfo *mainPtr);
+#endif
+#ifndef TkClipCleanup_TCL_DECLARED
+#define TkClipCleanup_TCL_DECLARED
/* 143 */
-EXTERN void TkClipCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkClipCleanup(TkDisplay *dispPtr);
+#endif
+#ifndef TkGCCleanup_TCL_DECLARED
+#define TkGCCleanup_TCL_DECLARED
/* 144 */
-EXTERN void TkGCCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
-#ifdef __WIN32__
-/* 145 */
-EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+EXTERN void TkGCCleanup(TkDisplay *dispPtr);
+#endif
+#ifdef __WIN32__ /* WIN */
+#ifndef TkSubtractRegion_TCL_DECLARED
+#define TkSubtractRegion_TCL_DECLARED
/* 145 */
-EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((TkRegion sra,
- TkRegion srcb, TkRegion dr_return));
-#endif /* MAC_OSX_TK */
+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 _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkStylePkgInit(TkMainInfo *mainPtr);
+#endif
+#ifndef TkStylePkgFree_TCL_DECLARED
+#define TkStylePkgFree_TCL_DECLARED
/* 147 */
-EXTERN void TkStylePkgFree _ANSI_ARGS_((TkMainInfo * mainPtr));
+EXTERN void TkStylePkgFree(TkMainInfo *mainPtr);
+#endif
+#ifndef TkToplevelWindowForCommand_TCL_DECLARED
+#define TkToplevelWindowForCommand_TCL_DECLARED
/* 148 */
-EXTERN Tk_Window TkToplevelWindowForCommand _ANSI_ARGS_((
- Tcl_Interp * interp, CONST char * cmdName));
+EXTERN Tk_Window TkToplevelWindowForCommand(Tcl_Interp *interp,
+ CONST char *cmdName);
+#endif
+#ifndef TkGetOptionSpec_TCL_DECLARED
+#define TkGetOptionSpec_TCL_DECLARED
/* 149 */
-EXTERN CONST Tk_OptionSpec * TkGetOptionSpec _ANSI_ARGS_((CONST char * name,
- Tk_OptionTable optionTable));
-/* Slot 150 is reserved */
-/* Slot 151 is reserved */
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tk_3DBorder border, int highlightWidth,
- int borderWidth, int relief));
+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
+/* 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
+/* 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
+/* 170 */
+EXTERN 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
+/* 172 */
+EXTERN 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
+/* 174 */
+EXTERN 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
+/* 176 */
+EXTERN 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
+/* 178 */
+EXTERN 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
+/* 180 */
+EXTERN char * TkSmoothPrintProc(ClientData clientData,
+ Tk_Window tkwin, char *widgRec, int offset,
+ Tcl_FreeProc **freeProcPtr);
+#endif
typedef struct TkIntStubs {
int magic;
struct TkIntStubHooks *hooks;
- TkWindow * (*tkAllocWindow) _ANSI_ARGS_((TkDisplay * dispPtr, int screenNum, TkWindow * parentPtr)); /* 0 */
- void (*tkBezierPoints) _ANSI_ARGS_((double control[], int numSteps, double * coordPtr)); /* 1 */
- void (*tkBezierScreenPoints) _ANSI_ARGS_((Tk_Canvas canvas, double control[], int numSteps, XPoint * xPointPtr)); /* 2 */
- void (*tkBindDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 3 */
- void (*tkBindEventProc) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 4 */
- void (*tkBindFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 5 */
- void (*tkBindInit) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 6 */
- void (*tkChangeEventWindow) _ANSI_ARGS_((XEvent * eventPtr, TkWindow * winPtr)); /* 7 */
- int (*tkClipInit) _ANSI_ARGS_((Tcl_Interp * interp, TkDisplay * dispPtr)); /* 8 */
- void (*tkComputeAnchor) _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int * xPtr, int * yPtr)); /* 9 */
- int (*tkCopyAndGlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * script)); /* 10 */
- unsigned long (*tkCreateBindingProcedure) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventString, TkBindEvalProc * evalProc, TkBindFreeProc * freeProc, ClientData clientData)); /* 11 */
- TkCursor * (*tkCreateCursorFromData) _ANSI_ARGS_((Tk_Window tkwin, CONST char * source, CONST char * mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg)); /* 12 */
- int (*tkCreateFrame) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int argc, char ** argv, int toplevel, char * appName)); /* 13 */
- Tk_Window (*tkCreateMainWindow) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * screenName, char * baseName)); /* 14 */
- Time (*tkCurrentTime) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 15 */
- void (*tkDeleteAllImages) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 16 */
- void (*tkDoConfigureNotify) _ANSI_ARGS_((TkWindow * winPtr)); /* 17 */
- void (*tkDrawInsetFocusHighlight) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding)); /* 18 */
- void (*tkEventDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 19 */
- void (*tkFillPolygon) _ANSI_ARGS_((Tk_Canvas canvas, double * coordPtr, int numPoints, Display * display, Drawable drawable, GC gc, GC outlineGC)); /* 20 */
- int (*tkFindStateNum) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * option, CONST TkStateMap * mapPtr, CONST char * strKey)); /* 21 */
- char * (*tkFindStateString) _ANSI_ARGS_((CONST TkStateMap * mapPtr, int numKey)); /* 22 */
- void (*tkFocusDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 23 */
- int (*tkFocusFilterEvent) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 24 */
- TkWindow * (*tkFocusKeyEvent) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 25 */
- void (*tkFontPkgInit) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 26 */
- void (*tkFontPkgFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 27 */
- void (*tkFreeBindingTags) _ANSI_ARGS_((TkWindow * winPtr)); /* 28 */
- void (*tkpFreeCursor) _ANSI_ARGS_((TkCursor * cursorPtr)); /* 29 */
- char * (*tkGetBitmapData) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * fileName, int * widthPtr, int * heightPtr, int * hotXPtr, int * hotYPtr)); /* 30 */
- void (*tkGetButtPoints) _ANSI_ARGS_((double p1[], double p2[], double width, int project, double m1[], double m2[])); /* 31 */
- TkCursor * (*tkGetCursorByName) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid string)); /* 32 */
- CONST84_RETURN char * (*tkGetDefaultScreenName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * screenName)); /* 33 */
- TkDisplay * (*tkGetDisplay) _ANSI_ARGS_((Display * display)); /* 34 */
- int (*tkGetDisplayOf) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], Tk_Window * tkwinPtr)); /* 35 */
- TkWindow * (*tkGetFocusWin) _ANSI_ARGS_((TkWindow * winPtr)); /* 36 */
- int (*tkGetInterpNames) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin)); /* 37 */
- int (*tkGetMiterPoints) _ANSI_ARGS_((double p1[], double p2[], double p3[], double width, double m1[], double m2[])); /* 38 */
- void (*tkGetPointerCoords) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr)); /* 39 */
- void (*tkGetServerInfo) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin)); /* 40 */
- void (*tkGrabDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 41 */
- int (*tkGrabState) _ANSI_ARGS_((TkWindow * winPtr)); /* 42 */
- void (*tkIncludePoint) _ANSI_ARGS_((Tk_Item * itemPtr, double * pointPtr)); /* 43 */
- void (*tkInOutEvents) _ANSI_ARGS_((XEvent * eventPtr, TkWindow * sourcePtr, TkWindow * destPtr, int leaveType, int enterType, Tcl_QueuePosition position)); /* 44 */
- void (*tkInstallFrameMenu) _ANSI_ARGS_((Tk_Window tkwin)); /* 45 */
- char * (*tkKeysymToString) _ANSI_ARGS_((KeySym keysym)); /* 46 */
- int (*tkLineToArea) _ANSI_ARGS_((double end1Ptr[], double end2Ptr[], double rectPtr[])); /* 47 */
- double (*tkLineToPoint) _ANSI_ARGS_((double end1Ptr[], double end2Ptr[], double pointPtr[])); /* 48 */
- int (*tkMakeBezierCurve) _ANSI_ARGS_((Tk_Canvas canvas, double * pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[])); /* 49 */
- void (*tkMakeBezierPostscript) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, double * pointPtr, int numPoints)); /* 50 */
- void (*tkOptionClassChanged) _ANSI_ARGS_((TkWindow * winPtr)); /* 51 */
- void (*tkOptionDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 52 */
- int (*tkOvalToArea) _ANSI_ARGS_((double * ovalPtr, double * rectPtr)); /* 53 */
- double (*tkOvalToPoint) _ANSI_ARGS_((double ovalPtr[], double width, int filled, double pointPtr[])); /* 54 */
- int (*tkpChangeFocus) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 55 */
- void (*tkpCloseDisplay) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 56 */
- void (*tkpClaimFocus) _ANSI_ARGS_((TkWindow * topLevelPtr, int force)); /* 57 */
- void (*tkpDisplayWarning) _ANSI_ARGS_((CONST char * msg, CONST char * title)); /* 58 */
- void (*tkpGetAppName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * name)); /* 59 */
- TkWindow * (*tkpGetOtherWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 60 */
- TkWindow * (*tkpGetWrapperWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 61 */
- int (*tkpInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 62 */
- void (*tkpInitializeMenuBindings) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable)); /* 63 */
- void (*tkpMakeContainer) _ANSI_ARGS_((Tk_Window tkwin)); /* 64 */
- void (*tkpMakeMenuWindow) _ANSI_ARGS_((Tk_Window tkwin, int transient)); /* 65 */
- Window (*tkpMakeWindow) _ANSI_ARGS_((TkWindow * winPtr, Window parent)); /* 66 */
- void (*tkpMenuNotifyToplevelCreate) _ANSI_ARGS_((Tcl_Interp * interp1, char * menuName)); /* 67 */
- TkDisplay * (*tkpOpenDisplay) _ANSI_ARGS_((CONST char * display_name)); /* 68 */
- int (*tkPointerEvent) _ANSI_ARGS_((XEvent * eventPtr, TkWindow * winPtr)); /* 69 */
- int (*tkPolygonToArea) _ANSI_ARGS_((double * polyPtr, int numPoints, double * rectPtr)); /* 70 */
- double (*tkPolygonToPoint) _ANSI_ARGS_((double * polyPtr, int numPoints, double * pointPtr)); /* 71 */
- int (*tkPositionInTree) _ANSI_ARGS_((TkWindow * winPtr, TkWindow * treePtr)); /* 72 */
- void (*tkpRedirectKeyEvent) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 73 */
- void (*tkpSetMainMenubar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * menuName)); /* 74 */
- int (*tkpUseWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * string)); /* 75 */
- int (*tkpWindowWasRecentlyDeleted) _ANSI_ARGS_((Window win, TkDisplay * dispPtr)); /* 76 */
- void (*tkQueueEventForAllChildren) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 77 */
- int (*tkReadBitmapFile) _ANSI_ARGS_((Display* display, Drawable d, CONST char* filename, unsigned int* width_return, unsigned int* height_return, Pixmap* bitmap_return, int* x_hot_return, int* y_hot_return)); /* 78 */
- int (*tkScrollWindow) _ANSI_ARGS_((Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, TkRegion damageRgn)); /* 79 */
- void (*tkSelDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 80 */
- void (*tkSelEventProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent * eventPtr)); /* 81 */
- void (*tkSelInit) _ANSI_ARGS_((Tk_Window tkwin)); /* 82 */
- void (*tkSelPropProc) _ANSI_ARGS_((XEvent * eventPtr)); /* 83 */
- void *reserved84;
- void (*tkSetWindowMenuBar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, char * menuName)); /* 85 */
- KeySym (*tkStringToKeysym) _ANSI_ARGS_((char * name)); /* 86 */
- int (*tkThickPolyLineToArea) _ANSI_ARGS_((double * coordPtr, int numPoints, double width, int capStyle, int joinStyle, double * rectPtr)); /* 87 */
- void (*tkWmAddToColormapWindows) _ANSI_ARGS_((TkWindow * winPtr)); /* 88 */
- void (*tkWmDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 89 */
- TkWindow * (*tkWmFocusToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 90 */
- void (*tkWmMapWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 91 */
- void (*tkWmNewWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 92 */
- void (*tkWmProtocolEventProc) _ANSI_ARGS_((TkWindow * winPtr, XEvent * evenvPtr)); /* 93 */
- void (*tkWmRemoveFromColormapWindows) _ANSI_ARGS_((TkWindow * winPtr)); /* 94 */
- void (*tkWmRestackToplevel) _ANSI_ARGS_((TkWindow * winPtr, int aboveBelow, TkWindow * otherPtr)); /* 95 */
- void (*tkWmSetClass) _ANSI_ARGS_((TkWindow * winPtr)); /* 96 */
- void (*tkWmUnmapWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 97 */
- Tcl_Obj * (*tkDebugBitmap) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 98 */
- Tcl_Obj * (*tkDebugBorder) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 99 */
- Tcl_Obj * (*tkDebugCursor) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 100 */
- Tcl_Obj * (*tkDebugColor) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 101 */
- Tcl_Obj * (*tkDebugConfig) _ANSI_ARGS_((Tcl_Interp * interp, Tk_OptionTable table)); /* 102 */
- Tcl_Obj * (*tkDebugFont) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 103 */
- int (*tkFindStateNumObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * optionPtr, CONST TkStateMap * mapPtr, Tcl_Obj * keyPtr)); /* 104 */
- Tcl_HashTable * (*tkGetBitmapPredefTable) _ANSI_ARGS_((void)); /* 105 */
- TkDisplay * (*tkGetDisplayList) _ANSI_ARGS_((void)); /* 106 */
- TkMainInfo * (*tkGetMainInfoList) _ANSI_ARGS_((void)); /* 107 */
- int (*tkGetWindowFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, Tk_Window * windowPtr)); /* 108 */
- char * (*tkpGetString) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr, Tcl_DString * dsPtr)); /* 109 */
- void (*tkpGetSubFonts) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Font tkfont)); /* 110 */
- Tcl_Obj * (*tkpGetSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char * dbName, CONST char * className)); /* 111 */
- void (*tkpMenuThreadInit) _ANSI_ARGS_((void)); /* 112 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved113;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle* rect_return)); /* 113 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle* rect_return)); /* 113 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle* rect_return)); /* 113 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved114;
-#endif /* UNIX */
-#ifdef __WIN32__
- TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved115;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved116;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved117;
-#endif /* UNIX */
-#ifdef __WIN32__
- int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved118;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkSetRegion) _ANSI_ARGS_((Display* display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkSetRegion) _ANSI_ARGS_((Display* display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkSetRegion) _ANSI_ARGS_((Display* display, GC gc, TkRegion rgn)); /* 118 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved119;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle* rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle* rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle* rect, TkRegion src, TkRegion dr_return)); /* 119 */
-#endif /* MAC_OSX_TK */
- void *reserved120;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved121;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved121;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, CONST char * source)); /* 121 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, CONST char * source)); /* 121 */
-#endif /* MAC_OSX_TK */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved122;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved122;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */
-#endif /* MAC_OSX_TK */
- void *reserved123;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved124;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved124;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display * display, CONST char * name, int * width, int * height)); /* 124 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display * display, CONST char * name, int * width, int * height)); /* 124 */
-#endif /* MAC_OSX_TK */
- void *reserved125;
- void *reserved126;
- void *reserved127;
- void *reserved128;
- void *reserved129;
- void *reserved130;
- void *reserved131;
- void *reserved132;
- void *reserved133;
- void *reserved134;
- void (*tkpDrawHighlightBorder) _ANSI_ARGS_((Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable)); /* 135 */
- void (*tkSetFocusWin) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 136 */
- void (*tkpSetKeycodeAndState) _ANSI_ARGS_((Tk_Window tkwin, KeySym keySym, XEvent * eventPtr)); /* 137 */
- KeySym (*tkpGetKeySym) _ANSI_ARGS_((TkDisplay * dispPtr, XEvent * eventPtr)); /* 138 */
- void (*tkpInitKeymapInfo) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 139 */
- TkRegion (*tkPhotoGetValidRegion) _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 140 */
- TkWindow ** (*tkWmStackorderToplevel) _ANSI_ARGS_((TkWindow * parentPtr)); /* 141 */
- void (*tkFocusFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 142 */
- void (*tkClipCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 143 */
- void (*tkGCCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 144 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved145;
-#endif /* UNIX */
-#ifdef __WIN32__
- void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
-#endif /* MAC_OSX_TK */
- void (*tkStylePkgInit) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 146 */
- void (*tkStylePkgFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 147 */
- Tk_Window (*tkToplevelWindowForCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName)); /* 148 */
- CONST Tk_OptionSpec * (*tkGetOptionSpec) _ANSI_ARGS_((CONST char * name, Tk_OptionTable optionTable)); /* 149 */
- void *reserved150;
- void *reserved151;
- void (*tkpDrawFrame) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief)); /* 152 */
+ 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 (*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 */
+ 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 */
+ void (*tkFocusDeadWindow) (TkWindow *winPtr); /* 23 */
+ int (*tkFocusFilterEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 24 */
+ TkWindow * (*tkFocusKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 25 */
+ void (*tkFontPkgInit) (TkMainInfo *mainPtr); /* 26 */
+ 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 */
+ 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 */
+ TkDisplay * (*tkGetDisplay) (Display *display); /* 34 */
+ 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 */
+ void (*tkGetPointerCoords) (Tk_Window tkwin, int *xPtr, int *yPtr); /* 39 */
+ void (*tkGetServerInfo) (Tcl_Interp *interp, Tk_Window tkwin); /* 40 */
+ void (*tkGrabDeadWindow) (TkWindow *winPtr); /* 41 */
+ int (*tkGrabState) (TkWindow *winPtr); /* 42 */
+ 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 */
+ 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 */
+ void (*tkMakeBezierPostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 50 */
+ void (*tkOptionClassChanged) (TkWindow *winPtr); /* 51 */
+ void (*tkOptionDeadWindow) (TkWindow *winPtr); /* 52 */
+ int (*tkOvalToArea) (double *ovalPtr, double *rectPtr); /* 53 */
+ double (*tkOvalToPoint) (double ovalPtr[], double width, int filled, double pointPtr[]); /* 54 */
+ 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 (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */
+ TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */
+ TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */
+ int (*tkpInit) (Tcl_Interp *interp); /* 62 */
+ void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */
+ 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 */
+ 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 (*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 (*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 */
+ 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 */
+ TkWindow * (*tkWmFocusToplevel) (TkWindow *winPtr); /* 90 */
+ void (*tkWmMapWindow) (TkWindow *winPtr); /* 91 */
+ void (*tkWmNewWindow) (TkWindow *winPtr); /* 92 */
+ void (*tkWmProtocolEventProc) (TkWindow *winPtr, XEvent *evenvPtr); /* 93 */
+ void (*tkWmRemoveFromColormapWindows) (TkWindow *winPtr); /* 94 */
+ 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 * (*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_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 */
+ void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
+ 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;
+#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 (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved114;
+#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 */
+ TkRegion (*tkCreateRegion) (void); /* 114 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved115;
+#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 (*tkDestroyRegion) (TkRegion rgn); /* 115 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved116;
+#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 (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved117;
+#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 */
+ 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;
+#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 (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved119;
+#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 (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
+#endif /* AQUA */
+ VOID *reserved120;
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved121;
+#endif /* X11 */
+#ifdef __WIN32__ /* WIN */
+ VOID *reserved121;
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
+ VOID *reserved121; /* Dummy entry for stubs table backwards compatibility */
+ Pixmap (*tkpCreateNativeBitmap) (Display *display, CONST char *source); /* 121 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved122;
+#endif /* X11 */
+#ifdef __WIN32__ /* WIN */
+ VOID *reserved122;
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
+ VOID *reserved122; /* Dummy entry for stubs table backwards compatibility */
+ void (*tkpDefineNativeBitmaps) (void); /* 122 */
+#endif /* AQUA */
+ VOID *reserved123;
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved124;
+#endif /* X11 */
+#ifdef __WIN32__ /* WIN */
+ VOID *reserved124;
+#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 */
+#endif /* AQUA */
+ VOID *reserved125;
+ VOID *reserved126;
+ VOID *reserved127;
+ VOID *reserved128;
+ VOID *reserved129;
+ VOID *reserved130;
+ VOID *reserved131;
+ VOID *reserved132;
+ VOID *reserved133;
+ VOID *reserved134;
+ 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 */
+ KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */
+ void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */
+ TkRegion (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */
+ TkWindow ** (*tkWmStackorderToplevel) (TkWindow *parentPtr); /* 141 */
+ void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */
+ void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */
+ void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
+ VOID *reserved145;
+#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 (*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 */
+ 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 */
} TkIntStubs;
#ifdef __cplusplus
@@ -1310,170 +1788,110 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkpMenuThreadInit \
(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
#endif
-#ifdef __WIN32__
-#ifndef TkClipBox
-#define TkClipBox \
- (tkIntStubsPtr->tkClipBox) /* 113 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#ifdef __WIN32__ /* WIN */
#ifndef TkClipBox
#define TkClipBox \
(tkIntStubsPtr->tkClipBox) /* 113 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkClipBox
#define TkClipBox \
(tkIntStubsPtr->tkClipBox) /* 113 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkCreateRegion
#define TkCreateRegion \
(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkCreateRegion
#define TkCreateRegion \
(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkCreateRegion
-#define TkCreateRegion \
- (tkIntStubsPtr->tkCreateRegion) /* 114 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkDestroyRegion
#define TkDestroyRegion \
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkDestroyRegion
#define TkDestroyRegion \
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkDestroyRegion
-#define TkDestroyRegion \
- (tkIntStubsPtr->tkDestroyRegion) /* 115 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkIntersectRegion
-#define TkIntersectRegion \
- (tkIntStubsPtr->tkIntersectRegion) /* 116 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkIntersectRegion
#define TkIntersectRegion \
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkIntersectRegion
#define TkIntersectRegion \
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkRectInRegion
#define TkRectInRegion \
(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkRectInRegion
#define TkRectInRegion \
(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkRectInRegion
-#define TkRectInRegion \
- (tkIntStubsPtr->tkRectInRegion) /* 117 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
-#ifndef TkSetRegion
-#define TkSetRegion \
- (tkIntStubsPtr->tkSetRegion) /* 118 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkSetRegion
#define TkSetRegion \
(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkSetRegion
#define TkSetRegion \
(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif
-#endif /* MAC_OSX_TK */
-#ifdef __WIN32__
+#endif /* AQUA */
+#ifdef __WIN32__ /* WIN */
#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkUnionRectWithRegion
-#define TkUnionRectWithRegion \
- (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
-#endif
-#endif /* MAC_OSX_TK */
+#endif /* AQUA */
/* Slot 120 is reserved */
-#ifdef MAC_TCL
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkpCreateNativeBitmap
#define TkpCreateNativeBitmap \
(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkpCreateNativeBitmap
-#define TkpCreateNativeBitmap \
- (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
-#endif
-#endif /* MAC_OSX_TK */
-#ifdef MAC_TCL
+#endif /* AQUA */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkpDefineNativeBitmaps
#define TkpDefineNativeBitmaps \
(tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
-#ifndef TkpDefineNativeBitmaps
-#define TkpDefineNativeBitmaps \
- (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
-#endif
-#endif /* MAC_OSX_TK */
+#endif /* AQUA */
/* Slot 123 is reserved */
-#ifdef MAC_TCL
-#ifndef TkpGetNativeAppBitmap
-#define TkpGetNativeAppBitmap \
- (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkpGetNativeAppBitmap
#define TkpGetNativeAppBitmap \
(tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
#endif
-#endif /* MAC_OSX_TK */
+#endif /* AQUA */
/* Slot 125 is reserved */
/* Slot 126 is reserved */
/* Slot 127 is reserved */
@@ -1524,24 +1942,18 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkGCCleanup \
(tkIntStubsPtr->tkGCCleanup) /* 144 */
#endif
-#ifdef __WIN32__
-#ifndef TkSubtractRegion
-#define TkSubtractRegion \
- (tkIntStubsPtr->tkSubtractRegion) /* 145 */
-#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
+#ifdef __WIN32__ /* WIN */
#ifndef TkSubtractRegion
#define TkSubtractRegion \
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkSubtractRegion
#define TkSubtractRegion \
(tkIntStubsPtr->tkSubtractRegion) /* 145 */
#endif
-#endif /* MAC_OSX_TK */
+#endif /* AQUA */
#ifndef TkStylePkgInit
#define TkStylePkgInit \
(tkIntStubsPtr->tkStylePkgInit) /* 146 */
@@ -1558,12 +1970,94 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkGetOptionSpec \
(tkIntStubsPtr->tkGetOptionSpec) /* 149 */
#endif
-/* Slot 150 is reserved */
-/* Slot 151 is reserved */
+#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 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
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 2cd4253..8de3a71 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -30,578 +30,644 @@
* Exported function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef TkAlignImageData_TCL_DECLARED
+#define TkAlignImageData_TCL_DECLARED
/* 0 */
-EXTERN char * TkAlignImageData _ANSI_ARGS_((XImage * image,
- int alignment, int bitOrder));
+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 _ANSI_ARGS_((
- TkWindow * winPtr, int active));
+EXTERN void TkGenerateActivateEvents(TkWindow *winPtr,
+ int active);
+#endif
+#ifndef TkpGetMS_TCL_DECLARED
+#define TkpGetMS_TCL_DECLARED
/* 3 */
-EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
+EXTERN unsigned long TkpGetMS(void);
+#endif
+#ifndef TkPointerDeadWindow_TCL_DECLARED
+#define TkPointerDeadWindow_TCL_DECLARED
/* 4 */
-EXTERN void TkPointerDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkpPrintWindowId_TCL_DECLARED
+#define TkpPrintWindowId_TCL_DECLARED
/* 5 */
-EXTERN void TkpPrintWindowId _ANSI_ARGS_((char * buf,
- Window window));
+EXTERN void TkpPrintWindowId(char *buf, Window window);
+#endif
+#ifndef TkpScanWindowId_TCL_DECLARED
+#define TkpScanWindowId_TCL_DECLARED
/* 6 */
-EXTERN int TkpScanWindowId _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * string, Window * idPtr));
+EXTERN int TkpScanWindowId(Tcl_Interp *interp,
+ CONST char *string, Window *idPtr);
+#endif
+#ifndef TkpSetCapture_TCL_DECLARED
+#define TkpSetCapture_TCL_DECLARED
/* 7 */
-EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkpSetCapture(TkWindow *winPtr);
+#endif
+#ifndef TkpSetCursor_TCL_DECLARED
+#define TkpSetCursor_TCL_DECLARED
/* 8 */
-EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
+EXTERN void TkpSetCursor(TkpCursor cursor);
+#endif
+#ifndef TkpWmSetState_TCL_DECLARED
+#define TkpWmSetState_TCL_DECLARED
/* 9 */
-EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
- int state));
+EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
+#endif
+#ifndef TkSetPixmapColormap_TCL_DECLARED
+#define TkSetPixmapColormap_TCL_DECLARED
/* 10 */
-EXTERN void TkSetPixmapColormap _ANSI_ARGS_((Pixmap pixmap,
- Colormap colormap));
+EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap);
+#endif
+#ifndef TkWinCancelMouseTimer_TCL_DECLARED
+#define TkWinCancelMouseTimer_TCL_DECLARED
/* 11 */
-EXTERN void TkWinCancelMouseTimer _ANSI_ARGS_((void));
+EXTERN void TkWinCancelMouseTimer(void);
+#endif
+#ifndef TkWinClipboardRender_TCL_DECLARED
+#define TkWinClipboardRender_TCL_DECLARED
/* 12 */
-EXTERN void TkWinClipboardRender _ANSI_ARGS_((
- TkDisplay * dispPtr, UINT format));
+EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format);
+#endif
+#ifndef TkWinEmbeddedEventProc_TCL_DECLARED
+#define TkWinEmbeddedEventProc_TCL_DECLARED
/* 13 */
-EXTERN LRESULT TkWinEmbeddedEventProc _ANSI_ARGS_((HWND hwnd,
- UINT message, WPARAM wParam, LPARAM lParam));
+EXTERN LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+#endif
+#ifndef TkWinFillRect_TCL_DECLARED
+#define TkWinFillRect_TCL_DECLARED
/* 14 */
-EXTERN void TkWinFillRect _ANSI_ARGS_((HDC dc, int x, int y,
- int width, int height, int pixel));
+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 _ANSI_ARGS_((Tk_Window tkwin,
- Tk_3DBorder border, int which));
+EXTERN COLORREF TkWinGetBorderPixels(Tk_Window tkwin,
+ Tk_3DBorder border, int which);
+#endif
+#ifndef TkWinGetDrawableDC_TCL_DECLARED
+#define TkWinGetDrawableDC_TCL_DECLARED
/* 16 */
-EXTERN HDC TkWinGetDrawableDC _ANSI_ARGS_((Display * display,
- Drawable d, TkWinDCState* state));
+EXTERN HDC TkWinGetDrawableDC(Display *display, Drawable d,
+ TkWinDCState *state);
+#endif
+#ifndef TkWinGetModifierState_TCL_DECLARED
+#define TkWinGetModifierState_TCL_DECLARED
/* 17 */
-EXTERN int TkWinGetModifierState _ANSI_ARGS_((void));
+EXTERN int TkWinGetModifierState(void);
+#endif
+#ifndef TkWinGetSystemPalette_TCL_DECLARED
+#define TkWinGetSystemPalette_TCL_DECLARED
/* 18 */
-EXTERN HPALETTE TkWinGetSystemPalette _ANSI_ARGS_((void));
+EXTERN HPALETTE TkWinGetSystemPalette(void);
+#endif
+#ifndef TkWinGetWrapperWindow_TCL_DECLARED
+#define TkWinGetWrapperWindow_TCL_DECLARED
/* 19 */
-EXTERN HWND TkWinGetWrapperWindow _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN HWND TkWinGetWrapperWindow(Tk_Window tkwin);
+#endif
+#ifndef TkWinHandleMenuEvent_TCL_DECLARED
+#define TkWinHandleMenuEvent_TCL_DECLARED
/* 20 */
-EXTERN int TkWinHandleMenuEvent _ANSI_ARGS_((HWND * phwnd,
- UINT * pMessage, WPARAM * pwParam,
- LPARAM * plParam, LRESULT * plResult));
+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 _ANSI_ARGS_((XColor * colorPtr));
+EXTERN int TkWinIndexOfColor(XColor *colorPtr);
+#endif
+#ifndef TkWinReleaseDrawableDC_TCL_DECLARED
+#define TkWinReleaseDrawableDC_TCL_DECLARED
/* 22 */
-EXTERN void TkWinReleaseDrawableDC _ANSI_ARGS_((Drawable d,
- HDC hdc, TkWinDCState* state));
+EXTERN void TkWinReleaseDrawableDC(Drawable d, HDC hdc,
+ TkWinDCState *state);
+#endif
+#ifndef TkWinResendEvent_TCL_DECLARED
+#define TkWinResendEvent_TCL_DECLARED
/* 23 */
-EXTERN LRESULT TkWinResendEvent _ANSI_ARGS_((WNDPROC wndproc,
- HWND hwnd, XEvent * eventPtr));
+EXTERN LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd,
+ XEvent *eventPtr);
+#endif
+#ifndef TkWinSelectPalette_TCL_DECLARED
+#define TkWinSelectPalette_TCL_DECLARED
/* 24 */
-EXTERN HPALETTE TkWinSelectPalette _ANSI_ARGS_((HDC dc,
- Colormap colormap));
+EXTERN HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap);
+#endif
+#ifndef TkWinSetMenu_TCL_DECLARED
+#define TkWinSetMenu_TCL_DECLARED
/* 25 */
-EXTERN void TkWinSetMenu _ANSI_ARGS_((Tk_Window tkwin,
- HMENU hMenu));
+EXTERN void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu);
+#endif
+#ifndef TkWinSetWindowPos_TCL_DECLARED
+#define TkWinSetWindowPos_TCL_DECLARED
/* 26 */
-EXTERN void TkWinSetWindowPos _ANSI_ARGS_((HWND hwnd,
- HWND siblingHwnd, int pos));
+EXTERN void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd,
+ int pos);
+#endif
+#ifndef TkWinWmCleanup_TCL_DECLARED
+#define TkWinWmCleanup_TCL_DECLARED
/* 27 */
-EXTERN void TkWinWmCleanup _ANSI_ARGS_((HINSTANCE hInstance));
+EXTERN void TkWinWmCleanup(HINSTANCE hInstance);
+#endif
+#ifndef TkWinXCleanup_TCL_DECLARED
+#define TkWinXCleanup_TCL_DECLARED
/* 28 */
-EXTERN void TkWinXCleanup _ANSI_ARGS_((ClientData clientData));
+EXTERN void TkWinXCleanup(ClientData clientData);
+#endif
+#ifndef TkWinXInit_TCL_DECLARED
+#define TkWinXInit_TCL_DECLARED
/* 29 */
-EXTERN void TkWinXInit _ANSI_ARGS_((HINSTANCE hInstance));
+EXTERN void TkWinXInit(HINSTANCE hInstance);
+#endif
+#ifndef TkWinSetForegroundWindow_TCL_DECLARED
+#define TkWinSetForegroundWindow_TCL_DECLARED
/* 30 */
-EXTERN void TkWinSetForegroundWindow _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr);
+#endif
+#ifndef TkWinDialogDebug_TCL_DECLARED
+#define TkWinDialogDebug_TCL_DECLARED
/* 31 */
-EXTERN void TkWinDialogDebug _ANSI_ARGS_((int debug));
+EXTERN void TkWinDialogDebug(int debug);
+#endif
+#ifndef TkWinGetMenuSystemDefault_TCL_DECLARED
+#define TkWinGetMenuSystemDefault_TCL_DECLARED
/* 32 */
-EXTERN Tcl_Obj * TkWinGetMenuSystemDefault _ANSI_ARGS_((
- Tk_Window tkwin, CONST char * dbName,
- CONST char * className));
+EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin,
+ CONST char *dbName, CONST char *className);
+#endif
+#ifndef TkWinGetPlatformId_TCL_DECLARED
+#define TkWinGetPlatformId_TCL_DECLARED
/* 33 */
-EXTERN int TkWinGetPlatformId _ANSI_ARGS_((void));
+EXTERN int TkWinGetPlatformId(void);
+#endif
+#ifndef TkWinSetHINSTANCE_TCL_DECLARED
+#define TkWinSetHINSTANCE_TCL_DECLARED
/* 34 */
-EXTERN void TkWinSetHINSTANCE _ANSI_ARGS_((HINSTANCE hInstance));
+EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance);
+#endif
+#ifndef TkWinGetPlatformTheme_TCL_DECLARED
+#define TkWinGetPlatformTheme_TCL_DECLARED
/* 35 */
-EXTERN int TkWinGetPlatformTheme _ANSI_ARGS_((void));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 0 */
-EXTERN void TkGenerateActivateEvents _ANSI_ARGS_((
- TkWindow * winPtr, int active));
-/* Slot 1 is reserved */
-/* Slot 2 is reserved */
-/* 3 */
-EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
-/* Slot 4 is reserved */
-/* 5 */
-EXTERN void TkPointerDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
-/* 6 */
-EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
-/* 7 */
-EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
-/* 8 */
-EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
- int state));
-/* Slot 9 is reserved */
-/* 10 */
-EXTERN void TkAboutDlg _ANSI_ARGS_((void));
-/* Slot 11 is reserved */
-/* Slot 12 is reserved */
-/* 13 */
-EXTERN Window TkGetTransientMaster _ANSI_ARGS_((TkWindow * winPtr));
-/* 14 */
-EXTERN int TkGenerateButtonEvent _ANSI_ARGS_((int x, int y,
- Window window, unsigned int state));
-/* Slot 15 is reserved */
-/* 16 */
-EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin));
-/* Slot 17 is reserved */
-/* 18 */
-EXTERN unsigned int TkMacButtonKeyState _ANSI_ARGS_((void));
-/* 19 */
-EXTERN void TkMacClearMenubarActive _ANSI_ARGS_((void));
-/* Slot 20 is reserved */
-/* 21 */
-EXTERN int TkMacDispatchMenuEvent _ANSI_ARGS_((int menuID,
- int index));
-/* 22 */
-EXTERN void TkMacInstallCursor _ANSI_ARGS_((int resizeOverride));
-/* Slot 23 is reserved */
-/* 24 */
-EXTERN void TkMacHandleTearoffMenu _ANSI_ARGS_((void));
-/* Slot 25 is reserved */
-/* Slot 26 is reserved */
-/* 27 */
-EXTERN void TkMacDoHLEvent _ANSI_ARGS_((EventRecord * theEvent));
-/* Slot 28 is reserved */
-/* 29 */
-EXTERN Time TkMacGenerateTime _ANSI_ARGS_((void));
-/* Slot 30 is reserved */
-/* 31 */
-EXTERN TkWindow * TkMacGetScrollbarGrowWindow _ANSI_ARGS_((
- TkWindow * winPtr));
-/* 32 */
-EXTERN Window TkMacGetXWindow _ANSI_ARGS_((WindowRef macWinPtr));
-/* 33 */
-EXTERN int TkMacGrowToplevel _ANSI_ARGS_((WindowRef whichWindow,
- Point start));
-/* 34 */
-EXTERN void TkMacHandleMenuSelect _ANSI_ARGS_((long mResult,
- int optionKeyPressed));
-/* Slot 35 is reserved */
-/* Slot 36 is reserved */
-/* Slot 37 is reserved */
-/* 38 */
-EXTERN void TkMacInvalidateWindow _ANSI_ARGS_((
- MacDrawable * macWin, int flag));
-/* 39 */
-EXTERN int TkMacIsCharacterMissing _ANSI_ARGS_((Tk_Font tkfont,
- unsigned int searchChar));
-/* 40 */
-EXTERN void TkMacMakeRealWindowExist _ANSI_ARGS_((
- TkWindow * winPtr));
-/* 41 */
-EXTERN BitMapPtr TkMacMakeStippleMap _ANSI_ARGS_((Drawable d1,
- Drawable d2));
-/* 42 */
-EXTERN void TkMacMenuClick _ANSI_ARGS_((void));
-/* 43 */
-EXTERN void TkMacRegisterOffScreenWindow _ANSI_ARGS_((
- Window window, GWorldPtr portPtr));
-/* 44 */
-EXTERN int TkMacResizable _ANSI_ARGS_((TkWindow * winPtr));
-/* Slot 45 is reserved */
-/* 46 */
-EXTERN void TkMacSetHelpMenuItemCount _ANSI_ARGS_((void));
-/* 47 */
-EXTERN void TkMacSetScrollbarGrow _ANSI_ARGS_((TkWindow * winPtr,
- int flag));
-/* 48 */
-EXTERN void TkMacSetUpClippingRgn _ANSI_ARGS_((Drawable drawable));
-/* 49 */
-EXTERN void TkMacSetUpGraphicsPort _ANSI_ARGS_((GC gc));
-/* 50 */
-EXTERN void TkMacUpdateClipRgn _ANSI_ARGS_((TkWindow * winPtr));
-/* 51 */
-EXTERN void TkMacUnregisterMacWindow _ANSI_ARGS_((
- GWorldPtr portPtr));
-/* 52 */
-EXTERN int TkMacUseMenuID _ANSI_ARGS_((short macID));
-/* 53 */
-EXTERN RgnHandle TkMacVisableClipRgn _ANSI_ARGS_((TkWindow * winPtr));
-/* 54 */
-EXTERN void TkMacWinBounds _ANSI_ARGS_((TkWindow * winPtr,
- Rect * geometry));
-/* 55 */
-EXTERN void TkMacWindowOffset _ANSI_ARGS_((WindowRef wRef,
- int * xOffset, int * yOffset));
-/* Slot 56 is reserved */
-/* 57 */
-EXTERN int TkSetMacColor _ANSI_ARGS_((unsigned long pixel,
- RGBColor * macColor));
-/* 58 */
-EXTERN void TkSetWMName _ANSI_ARGS_((TkWindow * winPtr,
- Tk_Uid titleUid));
-/* 59 */
-EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
-/* Slot 60 is reserved */
-/* 61 */
-EXTERN int TkMacZoomToplevel _ANSI_ARGS_((WindowPtr whichWindow,
- Point where, short zoomPart));
-/* 62 */
-EXTERN Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
- int rootX, int rootY, int * newX, int * newY));
-/* 63 */
-EXTERN MacDrawable * TkMacContainerId _ANSI_ARGS_((TkWindow * winPtr));
-/* 64 */
-EXTERN MacDrawable * TkMacGetHostToplevel _ANSI_ARGS_((TkWindow * winPtr));
-/* 65 */
-EXTERN void TkMacPreprocessMenu _ANSI_ARGS_((void));
-/* 66 */
-EXTERN int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((
- TkWindow * winPtr, int active));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkPointerDeadWindow(TkWindow *winPtr);
+#endif
+#ifndef TkpSetCapture_TCL_DECLARED
+#define TkpSetCapture_TCL_DECLARED
/* 4 */
-EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkpSetCapture(TkWindow *winPtr);
+#endif
+#ifndef TkpSetCursor_TCL_DECLARED
+#define TkpSetCursor_TCL_DECLARED
/* 5 */
-EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
+EXTERN void TkpSetCursor(TkpCursor cursor);
+#endif
+#ifndef TkpWmSetState_TCL_DECLARED
+#define TkpWmSetState_TCL_DECLARED
/* 6 */
-EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
- int state));
+EXTERN void TkpWmSetState(TkWindow *winPtr, int state);
+#endif
+#ifndef TkAboutDlg_TCL_DECLARED
+#define TkAboutDlg_TCL_DECLARED
/* 7 */
-EXTERN void TkAboutDlg _ANSI_ARGS_((void));
+EXTERN void TkAboutDlg(void);
+#endif
+#ifndef TkMacOSXButtonKeyState_TCL_DECLARED
+#define TkMacOSXButtonKeyState_TCL_DECLARED
/* 8 */
-EXTERN unsigned int TkMacOSXButtonKeyState _ANSI_ARGS_((void));
+EXTERN unsigned int TkMacOSXButtonKeyState(void);
+#endif
+#ifndef TkMacOSXClearMenubarActive_TCL_DECLARED
+#define TkMacOSXClearMenubarActive_TCL_DECLARED
/* 9 */
-EXTERN void TkMacOSXClearMenubarActive _ANSI_ARGS_((void));
+EXTERN void TkMacOSXClearMenubarActive(void);
+#endif
+#ifndef TkMacOSXDispatchMenuEvent_TCL_DECLARED
+#define TkMacOSXDispatchMenuEvent_TCL_DECLARED
/* 10 */
-EXTERN int TkMacOSXDispatchMenuEvent _ANSI_ARGS_((int menuID,
- int index));
+EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index);
+#endif
+#ifndef TkMacOSXInstallCursor_TCL_DECLARED
+#define TkMacOSXInstallCursor_TCL_DECLARED
/* 11 */
-EXTERN void TkMacOSXInstallCursor _ANSI_ARGS_((
- int resizeOverride));
+EXTERN void TkMacOSXInstallCursor(int resizeOverride);
+#endif
+#ifndef TkMacOSXHandleTearoffMenu_TCL_DECLARED
+#define TkMacOSXHandleTearoffMenu_TCL_DECLARED
/* 12 */
-EXTERN void TkMacOSXHandleTearoffMenu _ANSI_ARGS_((void));
+EXTERN void TkMacOSXHandleTearoffMenu(void);
+#endif
/* Slot 13 is reserved */
+#ifndef TkMacOSXDoHLEvent_TCL_DECLARED
+#define TkMacOSXDoHLEvent_TCL_DECLARED
/* 14 */
-EXTERN int TkMacOSXDoHLEvent _ANSI_ARGS_((
- EventRecord * theEvent));
+EXTERN int TkMacOSXDoHLEvent(EventRecord *theEvent);
+#endif
/* Slot 15 is reserved */
+#ifndef TkMacOSXGetXWindow_TCL_DECLARED
+#define TkMacOSXGetXWindow_TCL_DECLARED
/* 16 */
-EXTERN Window TkMacOSXGetXWindow _ANSI_ARGS_((WindowRef macWinPtr));
+EXTERN Window TkMacOSXGetXWindow(WindowRef macWinPtr);
+#endif
+#ifndef TkMacOSXGrowToplevel_TCL_DECLARED
+#define TkMacOSXGrowToplevel_TCL_DECLARED
/* 17 */
-EXTERN int TkMacOSXGrowToplevel _ANSI_ARGS_((
- WindowRef whichWindow, Point start));
+EXTERN int TkMacOSXGrowToplevel(WindowRef whichWindow,
+ Point start);
+#endif
+#ifndef TkMacOSXHandleMenuSelect_TCL_DECLARED
+#define TkMacOSXHandleMenuSelect_TCL_DECLARED
/* 18 */
-EXTERN void TkMacOSXHandleMenuSelect _ANSI_ARGS_((MenuID theMenu,
- MenuItemIndex theItem, int optionKeyPressed));
+EXTERN void TkMacOSXHandleMenuSelect(MenuID theMenu,
+ MenuItemIndex theItem, int optionKeyPressed);
+#endif
/* Slot 19 is reserved */
/* Slot 20 is reserved */
+#ifndef TkMacOSXInvalidateWindow_TCL_DECLARED
+#define TkMacOSXInvalidateWindow_TCL_DECLARED
/* 21 */
-EXTERN void TkMacOSXInvalidateWindow _ANSI_ARGS_((
- MacDrawable * macWin, int flag));
+EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin,
+ int flag);
+#endif
+#ifndef TkMacOSXIsCharacterMissing_TCL_DECLARED
+#define TkMacOSXIsCharacterMissing_TCL_DECLARED
/* 22 */
-EXTERN int TkMacOSXIsCharacterMissing _ANSI_ARGS_((
- Tk_Font tkfont, unsigned int searchChar));
+EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont,
+ unsigned int searchChar);
+#endif
+#ifndef TkMacOSXMakeRealWindowExist_TCL_DECLARED
+#define TkMacOSXMakeRealWindowExist_TCL_DECLARED
/* 23 */
-EXTERN void TkMacOSXMakeRealWindowExist _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXMakeStippleMap_TCL_DECLARED
+#define TkMacOSXMakeStippleMap_TCL_DECLARED
/* 24 */
-EXTERN BitMapPtr TkMacOSXMakeStippleMap _ANSI_ARGS_((Drawable d1,
- Drawable d2));
+EXTERN BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2);
+#endif
+#ifndef TkMacOSXMenuClick_TCL_DECLARED
+#define TkMacOSXMenuClick_TCL_DECLARED
/* 25 */
-EXTERN void TkMacOSXMenuClick _ANSI_ARGS_((void));
+EXTERN void TkMacOSXMenuClick(void);
+#endif
+#ifndef TkMacOSXRegisterOffScreenWindow_TCL_DECLARED
+#define TkMacOSXRegisterOffScreenWindow_TCL_DECLARED
/* 26 */
-EXTERN void TkMacOSXRegisterOffScreenWindow _ANSI_ARGS_((
- Window window, GWorldPtr portPtr));
+EXTERN void TkMacOSXRegisterOffScreenWindow(Window window,
+ GWorldPtr portPtr);
+#endif
+#ifndef TkMacOSXResizable_TCL_DECLARED
+#define TkMacOSXResizable_TCL_DECLARED
/* 27 */
-EXTERN int TkMacOSXResizable _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN int TkMacOSXResizable(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXSetHelpMenuItemCount_TCL_DECLARED
+#define TkMacOSXSetHelpMenuItemCount_TCL_DECLARED
/* 28 */
-EXTERN void TkMacOSXSetHelpMenuItemCount _ANSI_ARGS_((void));
+EXTERN void TkMacOSXSetHelpMenuItemCount(void);
+#endif
+#ifndef TkMacOSXSetScrollbarGrow_TCL_DECLARED
+#define TkMacOSXSetScrollbarGrow_TCL_DECLARED
/* 29 */
-EXTERN void TkMacOSXSetScrollbarGrow _ANSI_ARGS_((
- TkWindow * winPtr, int flag));
+EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag);
+#endif
+#ifndef TkMacOSXSetUpClippingRgn_TCL_DECLARED
+#define TkMacOSXSetUpClippingRgn_TCL_DECLARED
/* 30 */
-EXTERN void TkMacOSXSetUpClippingRgn _ANSI_ARGS_((
- Drawable drawable));
+EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable);
+#endif
+#ifndef TkMacOSXSetUpGraphicsPort_TCL_DECLARED
+#define TkMacOSXSetUpGraphicsPort_TCL_DECLARED
/* 31 */
-EXTERN void TkMacOSXSetUpGraphicsPort _ANSI_ARGS_((GC gc,
- GWorldPtr destPort));
+EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, GWorldPtr destPort);
+#endif
+#ifndef TkMacOSXUpdateClipRgn_TCL_DECLARED
+#define TkMacOSXUpdateClipRgn_TCL_DECLARED
/* 32 */
-EXTERN void TkMacOSXUpdateClipRgn _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXUnregisterMacWindow_TCL_DECLARED
+#define TkMacOSXUnregisterMacWindow_TCL_DECLARED
/* 33 */
-EXTERN void TkMacOSXUnregisterMacWindow _ANSI_ARGS_((
- WindowRef portPtr));
+EXTERN void TkMacOSXUnregisterMacWindow(WindowRef portPtr);
+#endif
+#ifndef TkMacOSXUseMenuID_TCL_DECLARED
+#define TkMacOSXUseMenuID_TCL_DECLARED
/* 34 */
-EXTERN int TkMacOSXUseMenuID _ANSI_ARGS_((short macID));
+EXTERN int TkMacOSXUseMenuID(short macID);
+#endif
+#ifndef TkMacOSXVisableClipRgn_TCL_DECLARED
+#define TkMacOSXVisableClipRgn_TCL_DECLARED
/* 35 */
-EXTERN RgnHandle TkMacOSXVisableClipRgn _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN RgnHandle TkMacOSXVisableClipRgn(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXWinBounds_TCL_DECLARED
+#define TkMacOSXWinBounds_TCL_DECLARED
/* 36 */
-EXTERN void TkMacOSXWinBounds _ANSI_ARGS_((TkWindow * winPtr,
- Rect * geometry));
+EXTERN void TkMacOSXWinBounds(TkWindow *winPtr, Rect *geometry);
+#endif
+#ifndef TkMacOSXWindowOffset_TCL_DECLARED
+#define TkMacOSXWindowOffset_TCL_DECLARED
/* 37 */
-EXTERN void TkMacOSXWindowOffset _ANSI_ARGS_((WindowRef wRef,
- int * xOffset, int * yOffset));
+EXTERN void TkMacOSXWindowOffset(WindowRef wRef, int *xOffset,
+ int *yOffset);
+#endif
+#ifndef TkSetMacColor_TCL_DECLARED
+#define TkSetMacColor_TCL_DECLARED
/* 38 */
-EXTERN int TkSetMacColor _ANSI_ARGS_((unsigned long pixel,
- RGBColor * macColor));
+EXTERN int TkSetMacColor(unsigned long pixel,
+ RGBColor *macColor);
+#endif
+#ifndef TkSetWMName_TCL_DECLARED
+#define TkSetWMName_TCL_DECLARED
/* 39 */
-EXTERN void TkSetWMName _ANSI_ARGS_((TkWindow * winPtr,
- Tk_Uid titleUid));
+EXTERN void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid);
+#endif
+#ifndef TkSuspendClipboard_TCL_DECLARED
+#define TkSuspendClipboard_TCL_DECLARED
/* 40 */
-EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
+EXTERN void TkSuspendClipboard(void);
+#endif
+#ifndef TkMacOSXZoomToplevel_TCL_DECLARED
+#define TkMacOSXZoomToplevel_TCL_DECLARED
/* 41 */
-EXTERN int TkMacOSXZoomToplevel _ANSI_ARGS_((
- WindowPtr whichWindow, short zoomPart));
+EXTERN int TkMacOSXZoomToplevel(WindowPtr whichWindow,
+ short zoomPart);
+#endif
+#ifndef Tk_TopCoordsToWindow_TCL_DECLARED
+#define Tk_TopCoordsToWindow_TCL_DECLARED
/* 42 */
-EXTERN Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
- int rootX, int rootY, int * newX, int * newY));
+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 _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN MacDrawable * TkMacOSXContainerId(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXGetHostToplevel_TCL_DECLARED
+#define TkMacOSXGetHostToplevel_TCL_DECLARED
/* 44 */
-EXTERN MacDrawable * TkMacOSXGetHostToplevel _ANSI_ARGS_((
- TkWindow * winPtr));
+EXTERN MacDrawable * TkMacOSXGetHostToplevel(TkWindow *winPtr);
+#endif
+#ifndef TkMacOSXPreprocessMenu_TCL_DECLARED
+#define TkMacOSXPreprocessMenu_TCL_DECLARED
/* 45 */
-EXTERN void TkMacOSXPreprocessMenu _ANSI_ARGS_((void));
+EXTERN void TkMacOSXPreprocessMenu(void);
+#endif
+#ifndef TkpIsWindowFloating_TCL_DECLARED
+#define TkpIsWindowFloating_TCL_DECLARED
/* 46 */
-EXTERN int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window));
+EXTERN int TkpIsWindowFloating(WindowRef window);
+#endif
+#ifndef TkMacOSXGetCapture_TCL_DECLARED
+#define TkMacOSXGetCapture_TCL_DECLARED
/* 47 */
-EXTERN Tk_Window TkMacOSXGetCapture _ANSI_ARGS_((void));
+EXTERN Tk_Window TkMacOSXGetCapture(void);
+#endif
/* Slot 48 is reserved */
+#ifndef TkGetTransientMaster_TCL_DECLARED
+#define TkGetTransientMaster_TCL_DECLARED
/* 49 */
-EXTERN Window TkGetTransientMaster _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN Window TkGetTransientMaster(TkWindow *winPtr);
+#endif
+#ifndef TkGenerateButtonEvent_TCL_DECLARED
+#define TkGenerateButtonEvent_TCL_DECLARED
/* 50 */
-EXTERN int TkGenerateButtonEvent _ANSI_ARGS_((int x, int y,
- Window window, unsigned int state));
+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 _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin);
+#endif
/* Slot 52 is reserved */
+#ifndef TkpGetMS_TCL_DECLARED
+#define TkpGetMS_TCL_DECLARED
/* 53 */
-EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
-#endif /* MAC_OSX_TK */
-#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+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 _ANSI_ARGS_((void));
+EXTERN void TkCreateXEventSource(void);
+#endif
+#ifndef TkFreeWindowId_TCL_DECLARED
+#define TkFreeWindowId_TCL_DECLARED
/* 1 */
-EXTERN void TkFreeWindowId _ANSI_ARGS_((TkDisplay * dispPtr,
- Window w));
+EXTERN void TkFreeWindowId(TkDisplay *dispPtr, Window w);
+#endif
+#ifndef TkInitXId_TCL_DECLARED
+#define TkInitXId_TCL_DECLARED
/* 2 */
-EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkInitXId(TkDisplay *dispPtr);
+#endif
+#ifndef TkpCmapStressed_TCL_DECLARED
+#define TkpCmapStressed_TCL_DECLARED
/* 3 */
-EXTERN int TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
- Colormap colormap));
+EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap);
+#endif
+#ifndef TkpSync_TCL_DECLARED
+#define TkpSync_TCL_DECLARED
/* 4 */
-EXTERN void TkpSync _ANSI_ARGS_((Display * display));
+EXTERN void TkpSync(Display *display);
+#endif
+#ifndef TkUnixContainerId_TCL_DECLARED
+#define TkUnixContainerId_TCL_DECLARED
/* 5 */
-EXTERN Window TkUnixContainerId _ANSI_ARGS_((TkWindow * winPtr));
+EXTERN Window TkUnixContainerId(TkWindow *winPtr);
+#endif
+#ifndef TkUnixDoOneXEvent_TCL_DECLARED
+#define TkUnixDoOneXEvent_TCL_DECLARED
/* 6 */
-EXTERN int TkUnixDoOneXEvent _ANSI_ARGS_((Tcl_Time * timePtr));
+EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr);
+#endif
+#ifndef TkUnixSetMenubar_TCL_DECLARED
+#define TkUnixSetMenubar_TCL_DECLARED
/* 7 */
-EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin,
- Tk_Window menubar));
+EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar);
+#endif
+#ifndef TkpScanWindowId_TCL_DECLARED
+#define TkpScanWindowId_TCL_DECLARED
/* 8 */
-EXTERN int TkpScanWindowId _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * string, Window * idPtr));
+EXTERN int TkpScanWindowId(Tcl_Interp *interp,
+ CONST char *string, Window *idPtr);
+#endif
+#ifndef TkWmCleanup_TCL_DECLARED
+#define TkWmCleanup_TCL_DECLARED
/* 9 */
-EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkWmCleanup(TkDisplay *dispPtr);
+#endif
+#ifndef TkSendCleanup_TCL_DECLARED
+#define TkSendCleanup_TCL_DECLARED
/* 10 */
-EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkSendCleanup(TkDisplay *dispPtr);
+#endif
+#ifndef TkFreeXId_TCL_DECLARED
+#define TkFreeXId_TCL_DECLARED
/* 11 */
-EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay * dispPtr));
+EXTERN void TkFreeXId(TkDisplay *dispPtr);
+#endif
+#ifndef TkpWmSetState_TCL_DECLARED
+#define TkpWmSetState_TCL_DECLARED
/* 12 */
-EXTERN int TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
- int state));
+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
#endif /* X11 */
typedef struct TkIntPlatStubs {
int magic;
struct TkIntPlatStubHooks *hooks;
-#ifdef __WIN32__
- char * (*tkAlignImageData) _ANSI_ARGS_((XImage * image, int alignment, int bitOrder)); /* 0 */
- void *reserved1;
- void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 2 */
- unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 3 */
- void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 4 */
- void (*tkpPrintWindowId) _ANSI_ARGS_((char * buf, Window window)); /* 5 */
- int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, Window * idPtr)); /* 6 */
- void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 7 */
- void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 8 */
- void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 9 */
- void (*tkSetPixmapColormap) _ANSI_ARGS_((Pixmap pixmap, Colormap colormap)); /* 10 */
- void (*tkWinCancelMouseTimer) _ANSI_ARGS_((void)); /* 11 */
- void (*tkWinClipboardRender) _ANSI_ARGS_((TkDisplay * dispPtr, UINT format)); /* 12 */
- LRESULT (*tkWinEmbeddedEventProc) _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); /* 13 */
- void (*tkWinFillRect) _ANSI_ARGS_((HDC dc, int x, int y, int width, int height, int pixel)); /* 14 */
- COLORREF (*tkWinGetBorderPixels) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int which)); /* 15 */
- HDC (*tkWinGetDrawableDC) _ANSI_ARGS_((Display * display, Drawable d, TkWinDCState* state)); /* 16 */
- int (*tkWinGetModifierState) _ANSI_ARGS_((void)); /* 17 */
- HPALETTE (*tkWinGetSystemPalette) _ANSI_ARGS_((void)); /* 18 */
- HWND (*tkWinGetWrapperWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 19 */
- int (*tkWinHandleMenuEvent) _ANSI_ARGS_((HWND * phwnd, UINT * pMessage, WPARAM * pwParam, LPARAM * plParam, LRESULT * plResult)); /* 20 */
- int (*tkWinIndexOfColor) _ANSI_ARGS_((XColor * colorPtr)); /* 21 */
- void (*tkWinReleaseDrawableDC) _ANSI_ARGS_((Drawable d, HDC hdc, TkWinDCState* state)); /* 22 */
- LRESULT (*tkWinResendEvent) _ANSI_ARGS_((WNDPROC wndproc, HWND hwnd, XEvent * eventPtr)); /* 23 */
- HPALETTE (*tkWinSelectPalette) _ANSI_ARGS_((HDC dc, Colormap colormap)); /* 24 */
- void (*tkWinSetMenu) _ANSI_ARGS_((Tk_Window tkwin, HMENU hMenu)); /* 25 */
- void (*tkWinSetWindowPos) _ANSI_ARGS_((HWND hwnd, HWND siblingHwnd, int pos)); /* 26 */
- void (*tkWinWmCleanup) _ANSI_ARGS_((HINSTANCE hInstance)); /* 27 */
- void (*tkWinXCleanup) _ANSI_ARGS_((ClientData clientData)); /* 28 */
- void (*tkWinXInit) _ANSI_ARGS_((HINSTANCE hInstance)); /* 29 */
- void (*tkWinSetForegroundWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 30 */
- void (*tkWinDialogDebug) _ANSI_ARGS_((int debug)); /* 31 */
- Tcl_Obj * (*tkWinGetMenuSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char * dbName, CONST char * className)); /* 32 */
- int (*tkWinGetPlatformId) _ANSI_ARGS_((void)); /* 33 */
- void (*tkWinSetHINSTANCE) _ANSI_ARGS_((HINSTANCE hInstance)); /* 34 */
- int (*tkWinGetPlatformTheme) _ANSI_ARGS_((void)); /* 35 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 0 */
- void *reserved1;
- void *reserved2;
- unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 3 */
- void *reserved4;
- void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
- void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 6 */
- void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 7 */
- void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 8 */
- void *reserved9;
- void (*tkAboutDlg) _ANSI_ARGS_((void)); /* 10 */
- void *reserved11;
- void *reserved12;
- Window (*tkGetTransientMaster) _ANSI_ARGS_((TkWindow * winPtr)); /* 13 */
- int (*tkGenerateButtonEvent) _ANSI_ARGS_((int x, int y, Window window, unsigned int state)); /* 14 */
- void *reserved15;
- void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 16 */
- void *reserved17;
- unsigned int (*tkMacButtonKeyState) _ANSI_ARGS_((void)); /* 18 */
- void (*tkMacClearMenubarActive) _ANSI_ARGS_((void)); /* 19 */
- void *reserved20;
- int (*tkMacDispatchMenuEvent) _ANSI_ARGS_((int menuID, int index)); /* 21 */
- void (*tkMacInstallCursor) _ANSI_ARGS_((int resizeOverride)); /* 22 */
- void *reserved23;
- void (*tkMacHandleTearoffMenu) _ANSI_ARGS_((void)); /* 24 */
- void *reserved25;
- void *reserved26;
- void (*tkMacDoHLEvent) _ANSI_ARGS_((EventRecord * theEvent)); /* 27 */
- void *reserved28;
- Time (*tkMacGenerateTime) _ANSI_ARGS_((void)); /* 29 */
- void *reserved30;
- TkWindow * (*tkMacGetScrollbarGrowWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 31 */
- Window (*tkMacGetXWindow) _ANSI_ARGS_((WindowRef macWinPtr)); /* 32 */
- int (*tkMacGrowToplevel) _ANSI_ARGS_((WindowRef whichWindow, Point start)); /* 33 */
- void (*tkMacHandleMenuSelect) _ANSI_ARGS_((long mResult, int optionKeyPressed)); /* 34 */
- void *reserved35;
- void *reserved36;
- void *reserved37;
- void (*tkMacInvalidateWindow) _ANSI_ARGS_((MacDrawable * macWin, int flag)); /* 38 */
- int (*tkMacIsCharacterMissing) _ANSI_ARGS_((Tk_Font tkfont, unsigned int searchChar)); /* 39 */
- void (*tkMacMakeRealWindowExist) _ANSI_ARGS_((TkWindow * winPtr)); /* 40 */
- BitMapPtr (*tkMacMakeStippleMap) _ANSI_ARGS_((Drawable d1, Drawable d2)); /* 41 */
- void (*tkMacMenuClick) _ANSI_ARGS_((void)); /* 42 */
- void (*tkMacRegisterOffScreenWindow) _ANSI_ARGS_((Window window, GWorldPtr portPtr)); /* 43 */
- int (*tkMacResizable) _ANSI_ARGS_((TkWindow * winPtr)); /* 44 */
- void *reserved45;
- void (*tkMacSetHelpMenuItemCount) _ANSI_ARGS_((void)); /* 46 */
- void (*tkMacSetScrollbarGrow) _ANSI_ARGS_((TkWindow * winPtr, int flag)); /* 47 */
- void (*tkMacSetUpClippingRgn) _ANSI_ARGS_((Drawable drawable)); /* 48 */
- void (*tkMacSetUpGraphicsPort) _ANSI_ARGS_((GC gc)); /* 49 */
- void (*tkMacUpdateClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 50 */
- void (*tkMacUnregisterMacWindow) _ANSI_ARGS_((GWorldPtr portPtr)); /* 51 */
- int (*tkMacUseMenuID) _ANSI_ARGS_((short macID)); /* 52 */
- RgnHandle (*tkMacVisableClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 53 */
- void (*tkMacWinBounds) _ANSI_ARGS_((TkWindow * winPtr, Rect * geometry)); /* 54 */
- void (*tkMacWindowOffset) _ANSI_ARGS_((WindowRef wRef, int * xOffset, int * yOffset)); /* 55 */
- void *reserved56;
- int (*tkSetMacColor) _ANSI_ARGS_((unsigned long pixel, RGBColor * macColor)); /* 57 */
- void (*tkSetWMName) _ANSI_ARGS_((TkWindow * winPtr, Tk_Uid titleUid)); /* 58 */
- void (*tkSuspendClipboard) _ANSI_ARGS_((void)); /* 59 */
- void *reserved60;
- int (*tkMacZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, Point where, short zoomPart)); /* 61 */
- Tk_Window (*tk_TopCoordsToWindow) _ANSI_ARGS_((Tk_Window tkwin, int rootX, int rootY, int * newX, int * newY)); /* 62 */
- MacDrawable * (*tkMacContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 63 */
- MacDrawable * (*tkMacGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 64 */
- void (*tkMacPreprocessMenu) _ANSI_ARGS_((void)); /* 65 */
- int (*tkpIsWindowFloating) _ANSI_ARGS_((WindowRef window)); /* 66 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 0 */
- void *reserved1;
- void *reserved2;
- void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 3 */
- void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 4 */
- void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 5 */
- void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 6 */
- void (*tkAboutDlg) _ANSI_ARGS_((void)); /* 7 */
- unsigned int (*tkMacOSXButtonKeyState) _ANSI_ARGS_((void)); /* 8 */
- void (*tkMacOSXClearMenubarActive) _ANSI_ARGS_((void)); /* 9 */
- int (*tkMacOSXDispatchMenuEvent) _ANSI_ARGS_((int menuID, int index)); /* 10 */
- void (*tkMacOSXInstallCursor) _ANSI_ARGS_((int resizeOverride)); /* 11 */
- void (*tkMacOSXHandleTearoffMenu) _ANSI_ARGS_((void)); /* 12 */
- void *reserved13;
- int (*tkMacOSXDoHLEvent) _ANSI_ARGS_((EventRecord * theEvent)); /* 14 */
- void *reserved15;
- Window (*tkMacOSXGetXWindow) _ANSI_ARGS_((WindowRef macWinPtr)); /* 16 */
- int (*tkMacOSXGrowToplevel) _ANSI_ARGS_((WindowRef whichWindow, Point start)); /* 17 */
- void (*tkMacOSXHandleMenuSelect) _ANSI_ARGS_((MenuID theMenu, MenuItemIndex theItem, int optionKeyPressed)); /* 18 */
- void *reserved19;
- void *reserved20;
- void (*tkMacOSXInvalidateWindow) _ANSI_ARGS_((MacDrawable * macWin, int flag)); /* 21 */
- int (*tkMacOSXIsCharacterMissing) _ANSI_ARGS_((Tk_Font tkfont, unsigned int searchChar)); /* 22 */
- void (*tkMacOSXMakeRealWindowExist) _ANSI_ARGS_((TkWindow * winPtr)); /* 23 */
- BitMapPtr (*tkMacOSXMakeStippleMap) _ANSI_ARGS_((Drawable d1, Drawable d2)); /* 24 */
- void (*tkMacOSXMenuClick) _ANSI_ARGS_((void)); /* 25 */
- void (*tkMacOSXRegisterOffScreenWindow) _ANSI_ARGS_((Window window, GWorldPtr portPtr)); /* 26 */
- int (*tkMacOSXResizable) _ANSI_ARGS_((TkWindow * winPtr)); /* 27 */
- void (*tkMacOSXSetHelpMenuItemCount) _ANSI_ARGS_((void)); /* 28 */
- void (*tkMacOSXSetScrollbarGrow) _ANSI_ARGS_((TkWindow * winPtr, int flag)); /* 29 */
- void (*tkMacOSXSetUpClippingRgn) _ANSI_ARGS_((Drawable drawable)); /* 30 */
- void (*tkMacOSXSetUpGraphicsPort) _ANSI_ARGS_((GC gc, GWorldPtr destPort)); /* 31 */
- void (*tkMacOSXUpdateClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 32 */
- void (*tkMacOSXUnregisterMacWindow) _ANSI_ARGS_((WindowRef portPtr)); /* 33 */
- int (*tkMacOSXUseMenuID) _ANSI_ARGS_((short macID)); /* 34 */
- RgnHandle (*tkMacOSXVisableClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 35 */
- void (*tkMacOSXWinBounds) _ANSI_ARGS_((TkWindow * winPtr, Rect * geometry)); /* 36 */
- void (*tkMacOSXWindowOffset) _ANSI_ARGS_((WindowRef wRef, int * xOffset, int * yOffset)); /* 37 */
- int (*tkSetMacColor) _ANSI_ARGS_((unsigned long pixel, RGBColor * macColor)); /* 38 */
- void (*tkSetWMName) _ANSI_ARGS_((TkWindow * winPtr, Tk_Uid titleUid)); /* 39 */
- void (*tkSuspendClipboard) _ANSI_ARGS_((void)); /* 40 */
- int (*tkMacOSXZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, short zoomPart)); /* 41 */
- Tk_Window (*tk_TopCoordsToWindow) _ANSI_ARGS_((Tk_Window tkwin, int rootX, int rootY, int * newX, int * newY)); /* 42 */
- MacDrawable * (*tkMacOSXContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 43 */
- MacDrawable * (*tkMacOSXGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 44 */
- void (*tkMacOSXPreprocessMenu) _ANSI_ARGS_((void)); /* 45 */
- int (*tkpIsWindowFloating) _ANSI_ARGS_((WindowRef window)); /* 46 */
- Tk_Window (*tkMacOSXGetCapture) _ANSI_ARGS_((void)); /* 47 */
- void *reserved48;
- Window (*tkGetTransientMaster) _ANSI_ARGS_((TkWindow * winPtr)); /* 49 */
- int (*tkGenerateButtonEvent) _ANSI_ARGS_((int x, int y, Window window, unsigned int state)); /* 50 */
- void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 51 */
- void *reserved52;
- unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 53 */
-#endif /* MAC_OSX_TK */
-#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
- void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */
- void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay * dispPtr, Window w)); /* 1 */
- void (*tkInitXId) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 2 */
- int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 3 */
- void (*tkpSync) _ANSI_ARGS_((Display * display)); /* 4 */
- Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
- int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 6 */
- void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 7 */
- int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, Window * idPtr)); /* 8 */
- void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 9 */
- void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 10 */
- void (*tkFreeXId) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 11 */
- int (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 12 */
+#ifdef __WIN32__ /* WIN */
+ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */
+ VOID *reserved1;
+ 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 */
+ void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */
+ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */
+ void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */
+ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */
+ void (*tkWinCancelMouseTimer) (void); /* 11 */
+ void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */
+ LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */
+ void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */
+ COLORREF (*tkWinGetBorderPixels) (Tk_Window tkwin, Tk_3DBorder border, int which); /* 15 */
+ HDC (*tkWinGetDrawableDC) (Display *display, Drawable d, TkWinDCState *state); /* 16 */
+ int (*tkWinGetModifierState) (void); /* 17 */
+ HPALETTE (*tkWinGetSystemPalette) (void); /* 18 */
+ HWND (*tkWinGetWrapperWindow) (Tk_Window tkwin); /* 19 */
+ int (*tkWinHandleMenuEvent) (HWND *phwnd, UINT *pMessage, WPARAM *pwParam, LPARAM *plParam, LRESULT *plResult); /* 20 */
+ int (*tkWinIndexOfColor) (XColor *colorPtr); /* 21 */
+ void (*tkWinReleaseDrawableDC) (Drawable d, HDC hdc, TkWinDCState *state); /* 22 */
+ LRESULT (*tkWinResendEvent) (WNDPROC wndproc, HWND hwnd, XEvent *eventPtr); /* 23 */
+ HPALETTE (*tkWinSelectPalette) (HDC dc, Colormap colormap); /* 24 */
+ void (*tkWinSetMenu) (Tk_Window tkwin, HMENU hMenu); /* 25 */
+ void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */
+ void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */
+ void (*tkWinXCleanup) (ClientData clientData); /* 28 */
+ 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 */
+ int (*tkWinGetPlatformId) (void); /* 33 */
+ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */
+ int (*tkWinGetPlatformTheme) (void); /* 35 */
+ LRESULT (CALLBACK *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
+ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */
+ VOID *reserved1;
+ VOID *reserved2;
+ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */
+ void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */
+ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */
+ void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */
+ void (*tkAboutDlg) (void); /* 7 */
+ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */
+ void (*tkMacOSXClearMenubarActive) (void); /* 9 */
+ 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 (*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 (*tkMacOSXMenuClick) (void); /* 25 */
+ void (*tkMacOSXRegisterOffScreenWindow) (Window window, GWorldPtr 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 (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */
+ void (*tkMacOSXUnregisterMacWindow) (WindowRef 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 */
+ void (*tkSetWMName) (TkWindow *winPtr, Tk_Uid titleUid); /* 39 */
+ void (*tkSuspendClipboard) (void); /* 40 */
+ int (*tkMacOSXZoomToplevel) (WindowPtr 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 */
+ Tk_Window (*tkMacOSXGetCapture) (void); /* 47 */
+ VOID *reserved48;
+ 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;
+ 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 */
+ 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 */
+ void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */
+ void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */
+ void (*tkFreeXId) (TkDisplay *dispPtr); /* 11 */
+ int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */
+ int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 13 */
#endif /* X11 */
} TkIntPlatStubs;
@@ -619,7 +685,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
* Inline function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef TkAlignImageData
#define TkAlignImageData \
(tkIntPlatStubsPtr->tkAlignImageData) /* 0 */
@@ -761,218 +827,12 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkWinGetPlatformTheme \
(tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#ifndef TkGenerateActivateEvents
-#define TkGenerateActivateEvents \
- (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */
-#endif
-/* Slot 1 is reserved */
-/* Slot 2 is reserved */
-#ifndef TkpGetMS
-#define TkpGetMS \
- (tkIntPlatStubsPtr->tkpGetMS) /* 3 */
-#endif
-/* Slot 4 is reserved */
-#ifndef TkPointerDeadWindow
-#define TkPointerDeadWindow \
- (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 5 */
-#endif
-#ifndef TkpSetCapture
-#define TkpSetCapture \
- (tkIntPlatStubsPtr->tkpSetCapture) /* 6 */
-#endif
-#ifndef TkpSetCursor
-#define TkpSetCursor \
- (tkIntPlatStubsPtr->tkpSetCursor) /* 7 */
-#endif
-#ifndef TkpWmSetState
-#define TkpWmSetState \
- (tkIntPlatStubsPtr->tkpWmSetState) /* 8 */
-#endif
-/* Slot 9 is reserved */
-#ifndef TkAboutDlg
-#define TkAboutDlg \
- (tkIntPlatStubsPtr->tkAboutDlg) /* 10 */
-#endif
-/* Slot 11 is reserved */
-/* Slot 12 is reserved */
-#ifndef TkGetTransientMaster
-#define TkGetTransientMaster \
- (tkIntPlatStubsPtr->tkGetTransientMaster) /* 13 */
-#endif
-#ifndef TkGenerateButtonEvent
-#define TkGenerateButtonEvent \
- (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 14 */
-#endif
-/* Slot 15 is reserved */
-#ifndef TkGenWMDestroyEvent
-#define TkGenWMDestroyEvent \
- (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 16 */
-#endif
-/* Slot 17 is reserved */
-#ifndef TkMacButtonKeyState
-#define TkMacButtonKeyState \
- (tkIntPlatStubsPtr->tkMacButtonKeyState) /* 18 */
-#endif
-#ifndef TkMacClearMenubarActive
-#define TkMacClearMenubarActive \
- (tkIntPlatStubsPtr->tkMacClearMenubarActive) /* 19 */
-#endif
-/* Slot 20 is reserved */
-#ifndef TkMacDispatchMenuEvent
-#define TkMacDispatchMenuEvent \
- (tkIntPlatStubsPtr->tkMacDispatchMenuEvent) /* 21 */
-#endif
-#ifndef TkMacInstallCursor
-#define TkMacInstallCursor \
- (tkIntPlatStubsPtr->tkMacInstallCursor) /* 22 */
-#endif
-/* Slot 23 is reserved */
-#ifndef TkMacHandleTearoffMenu
-#define TkMacHandleTearoffMenu \
- (tkIntPlatStubsPtr->tkMacHandleTearoffMenu) /* 24 */
-#endif
-/* Slot 25 is reserved */
-/* Slot 26 is reserved */
-#ifndef TkMacDoHLEvent
-#define TkMacDoHLEvent \
- (tkIntPlatStubsPtr->tkMacDoHLEvent) /* 27 */
-#endif
-/* Slot 28 is reserved */
-#ifndef TkMacGenerateTime
-#define TkMacGenerateTime \
- (tkIntPlatStubsPtr->tkMacGenerateTime) /* 29 */
-#endif
-/* Slot 30 is reserved */
-#ifndef TkMacGetScrollbarGrowWindow
-#define TkMacGetScrollbarGrowWindow \
- (tkIntPlatStubsPtr->tkMacGetScrollbarGrowWindow) /* 31 */
-#endif
-#ifndef TkMacGetXWindow
-#define TkMacGetXWindow \
- (tkIntPlatStubsPtr->tkMacGetXWindow) /* 32 */
-#endif
-#ifndef TkMacGrowToplevel
-#define TkMacGrowToplevel \
- (tkIntPlatStubsPtr->tkMacGrowToplevel) /* 33 */
-#endif
-#ifndef TkMacHandleMenuSelect
-#define TkMacHandleMenuSelect \
- (tkIntPlatStubsPtr->tkMacHandleMenuSelect) /* 34 */
-#endif
-/* Slot 35 is reserved */
-/* Slot 36 is reserved */
-/* Slot 37 is reserved */
-#ifndef TkMacInvalidateWindow
-#define TkMacInvalidateWindow \
- (tkIntPlatStubsPtr->tkMacInvalidateWindow) /* 38 */
-#endif
-#ifndef TkMacIsCharacterMissing
-#define TkMacIsCharacterMissing \
- (tkIntPlatStubsPtr->tkMacIsCharacterMissing) /* 39 */
-#endif
-#ifndef TkMacMakeRealWindowExist
-#define TkMacMakeRealWindowExist \
- (tkIntPlatStubsPtr->tkMacMakeRealWindowExist) /* 40 */
-#endif
-#ifndef TkMacMakeStippleMap
-#define TkMacMakeStippleMap \
- (tkIntPlatStubsPtr->tkMacMakeStippleMap) /* 41 */
-#endif
-#ifndef TkMacMenuClick
-#define TkMacMenuClick \
- (tkIntPlatStubsPtr->tkMacMenuClick) /* 42 */
-#endif
-#ifndef TkMacRegisterOffScreenWindow
-#define TkMacRegisterOffScreenWindow \
- (tkIntPlatStubsPtr->tkMacRegisterOffScreenWindow) /* 43 */
-#endif
-#ifndef TkMacResizable
-#define TkMacResizable \
- (tkIntPlatStubsPtr->tkMacResizable) /* 44 */
-#endif
-/* Slot 45 is reserved */
-#ifndef TkMacSetHelpMenuItemCount
-#define TkMacSetHelpMenuItemCount \
- (tkIntPlatStubsPtr->tkMacSetHelpMenuItemCount) /* 46 */
-#endif
-#ifndef TkMacSetScrollbarGrow
-#define TkMacSetScrollbarGrow \
- (tkIntPlatStubsPtr->tkMacSetScrollbarGrow) /* 47 */
-#endif
-#ifndef TkMacSetUpClippingRgn
-#define TkMacSetUpClippingRgn \
- (tkIntPlatStubsPtr->tkMacSetUpClippingRgn) /* 48 */
-#endif
-#ifndef TkMacSetUpGraphicsPort
-#define TkMacSetUpGraphicsPort \
- (tkIntPlatStubsPtr->tkMacSetUpGraphicsPort) /* 49 */
-#endif
-#ifndef TkMacUpdateClipRgn
-#define TkMacUpdateClipRgn \
- (tkIntPlatStubsPtr->tkMacUpdateClipRgn) /* 50 */
-#endif
-#ifndef TkMacUnregisterMacWindow
-#define TkMacUnregisterMacWindow \
- (tkIntPlatStubsPtr->tkMacUnregisterMacWindow) /* 51 */
-#endif
-#ifndef TkMacUseMenuID
-#define TkMacUseMenuID \
- (tkIntPlatStubsPtr->tkMacUseMenuID) /* 52 */
-#endif
-#ifndef TkMacVisableClipRgn
-#define TkMacVisableClipRgn \
- (tkIntPlatStubsPtr->tkMacVisableClipRgn) /* 53 */
-#endif
-#ifndef TkMacWinBounds
-#define TkMacWinBounds \
- (tkIntPlatStubsPtr->tkMacWinBounds) /* 54 */
-#endif
-#ifndef TkMacWindowOffset
-#define TkMacWindowOffset \
- (tkIntPlatStubsPtr->tkMacWindowOffset) /* 55 */
-#endif
-/* Slot 56 is reserved */
-#ifndef TkSetMacColor
-#define TkSetMacColor \
- (tkIntPlatStubsPtr->tkSetMacColor) /* 57 */
-#endif
-#ifndef TkSetWMName
-#define TkSetWMName \
- (tkIntPlatStubsPtr->tkSetWMName) /* 58 */
-#endif
-#ifndef TkSuspendClipboard
-#define TkSuspendClipboard \
- (tkIntPlatStubsPtr->tkSuspendClipboard) /* 59 */
-#endif
-/* Slot 60 is reserved */
-#ifndef TkMacZoomToplevel
-#define TkMacZoomToplevel \
- (tkIntPlatStubsPtr->tkMacZoomToplevel) /* 61 */
-#endif
-#ifndef Tk_TopCoordsToWindow
-#define Tk_TopCoordsToWindow \
- (tkIntPlatStubsPtr->tk_TopCoordsToWindow) /* 62 */
-#endif
-#ifndef TkMacContainerId
-#define TkMacContainerId \
- (tkIntPlatStubsPtr->tkMacContainerId) /* 63 */
+#ifndef TkWinChildProc
+#define TkWinChildProc \
+ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */
#endif
-#ifndef TkMacGetHostToplevel
-#define TkMacGetHostToplevel \
- (tkIntPlatStubsPtr->tkMacGetHostToplevel) /* 64 */
-#endif
-#ifndef TkMacPreprocessMenu
-#define TkMacPreprocessMenu \
- (tkIntPlatStubsPtr->tkMacPreprocessMenu) /* 65 */
-#endif
-#ifndef TkpIsWindowFloating
-#define TkpIsWindowFloating \
- (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 66 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef TkGenerateActivateEvents
#define TkGenerateActivateEvents \
(tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */
@@ -1165,8 +1025,8 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkpGetMS \
(tkIntPlatStubsPtr->tkpGetMS) /* 53 */
#endif
-#endif /* MAC_OSX_TK */
-#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+#endif /* AQUA */
+#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
#ifndef TkCreateXEventSource
#define TkCreateXEventSource \
(tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */
@@ -1219,6 +1079,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#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) */
diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h
index 05fb35a..bf80342 100644
--- a/generic/tkIntXlibDecls.h
+++ b/generic/tkIntXlibDecls.h
@@ -13,11 +13,7 @@
#ifndef _TKINTXLIBDECLS
#define _TKINTXLIBDECLS
-#ifdef MAC_TCL
-#include "Xutil.h"
-#else
#include "X11/Xutil.h"
-#endif
#ifdef BUILD_tk
#undef TCL_STORAGE_CLASS
@@ -36,1217 +32,1370 @@
* Exported function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
+#ifndef XSetDashes_TCL_DECLARED
+#define XSetDashes_TCL_DECLARED
/* 0 */
-EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc,
- int dash_offset, _Xconst char* dash_list,
- int n));
+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 _ANSI_ARGS_((Display* d));
+EXTERN XModifierKeymap * XGetModifierMapping(Display *d);
+#endif
+#ifndef XCreateImage_TCL_DECLARED
+#define XCreateImage_TCL_DECLARED
/* 2 */
-EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v,
- unsigned int ui1, int i1, int i2, char* cp,
- unsigned int ui2, unsigned int ui3, int i3,
- int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, unsigned long ul, int i3));
+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 _ANSI_ARGS_((Display* d, Atom a));
+EXTERN char * XGetAtomName(Display *d, Atom a);
+#endif
+#ifndef XKeysymToString_TCL_DECLARED
+#define XKeysymToString_TCL_DECLARED
/* 5 */
-EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k));
+EXTERN char * XKeysymToString(KeySym k);
+#endif
+#ifndef XCreateColormap_TCL_DECLARED
+#define XCreateColormap_TCL_DECLARED
/* 6 */
-EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w,
- Visual* v, int i));
+EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v,
+ int i);
+#endif
+#ifndef XCreatePixmapCursor_TCL_DECLARED
+#define XCreatePixmapCursor_TCL_DECLARED
/* 7 */
-EXTERN Cursor XCreatePixmapCursor _ANSI_ARGS_((Display* d,
- Pixmap p1, Pixmap p2, XColor* x1, XColor* x2,
- unsigned int ui1, unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Font f1,
- Font f2, unsigned int ui1, unsigned int ui2,
- XColor* x1, XColor* x2));
+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 _ANSI_ARGS_((GC g));
+EXTERN GContext XGContextFromGC(GC g);
+#endif
+#ifndef XListHosts_TCL_DECLARED
+#define XListHosts_TCL_DECLARED
/* 10 */
-EXTERN XHostAddress * XListHosts _ANSI_ARGS_((Display* d, int* i, Bool* b));
+EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b);
+#endif
+#ifndef XKeycodeToKeysym_TCL_DECLARED
+#define XKeycodeToKeysym_TCL_DECLARED
/* 11 */
-EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d,
- unsigned int k, int i));
+EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i);
+#endif
+#ifndef XStringToKeysym_TCL_DECLARED
+#define XStringToKeysym_TCL_DECLARED
/* 12 */
-EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c));
+EXTERN KeySym XStringToKeysym(_Xconst char *c);
+#endif
+#ifndef XRootWindow_TCL_DECLARED
+#define XRootWindow_TCL_DECLARED
/* 13 */
-EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i));
+EXTERN Window XRootWindow(Display *d, int i);
+#endif
+#ifndef XSetErrorHandler_TCL_DECLARED
+#define XSetErrorHandler_TCL_DECLARED
/* 14 */
-EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
+EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
+#endif
+#ifndef XIconifyWindow_TCL_DECLARED
+#define XIconifyWindow_TCL_DECLARED
/* 15 */
-EXTERN Status XIconifyWindow _ANSI_ARGS_((Display* d, Window w,
- int i));
+EXTERN Status XIconifyWindow(Display *d, Window w, int i);
+#endif
+#ifndef XWithdrawWindow_TCL_DECLARED
+#define XWithdrawWindow_TCL_DECLARED
/* 16 */
-EXTERN Status XWithdrawWindow _ANSI_ARGS_((Display* d, Window w,
- int i));
+EXTERN Status XWithdrawWindow(Display *d, Window w, int i);
+#endif
+#ifndef XGetWMColormapWindows_TCL_DECLARED
+#define XGetWMColormapWindows_TCL_DECLARED
/* 17 */
-EXTERN Status XGetWMColormapWindows _ANSI_ARGS_((Display* d,
- Window w, Window** wpp, int* ip));
+EXTERN Status XGetWMColormapWindows(Display *d, Window w,
+ Window **wpp, int *ip);
+#endif
+#ifndef XAllocColor_TCL_DECLARED
+#define XAllocColor_TCL_DECLARED
/* 18 */
-EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c,
- XColor* xp));
+EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
+#endif
+#ifndef XBell_TCL_DECLARED
+#define XBell_TCL_DECLARED
/* 19 */
-EXTERN void XBell _ANSI_ARGS_((Display* d, int i));
+EXTERN void XBell(Display *d, int i);
+#endif
+#ifndef XChangeProperty_TCL_DECLARED
+#define XChangeProperty_TCL_DECLARED
/* 20 */
-EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a1, Atom a2, int i1, int i2,
- _Xconst unsigned char* c, int i3));
+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 _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul,
- XSetWindowAttributes* x));
+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 _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XClearWindow(Display *d, Window w);
+#endif
+#ifndef XConfigureWindow_TCL_DECLARED
+#define XConfigureWindow_TCL_DECLARED
/* 23 */
-EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w,
- unsigned int i, XWindowChanges* x));
+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 _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4, unsigned long ul));
+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 _ANSI_ARGS_((Display* display,
- Drawable d, _Xconst char* data,
- unsigned int width, unsigned int height));
+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 _ANSI_ARGS_((Display* d, Window w,
- Cursor c));
+EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
+#endif
+#ifndef XDeleteProperty_TCL_DECLARED
+#define XDeleteProperty_TCL_DECLARED
/* 28 */
-EXTERN void XDeleteProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a));
+EXTERN void XDeleteProperty(Display *d, Window w, Atom a);
+#endif
+#ifndef XDestroyWindow_TCL_DECLARED
+#define XDestroyWindow_TCL_DECLARED
/* 29 */
-EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XDestroyWindow(Display *d, Window w);
+#endif
+#ifndef XDrawArc_TCL_DECLARED
+#define XDrawArc_TCL_DECLARED
/* 30 */
-EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, int i1, int i2, unsigned int ui1,
- unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2, int i3));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XRectangle* x, int i));
+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 _ANSI_ARGS_((Display* d, int i));
+EXTERN void XForceScreenSaver(Display *d, int i);
+#endif
+#ifndef XFreeColormap_TCL_DECLARED
+#define XFreeColormap_TCL_DECLARED
/* 37 */
-EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c));
+EXTERN void XFreeColormap(Display *d, Colormap c);
+#endif
+#ifndef XFreeColors_TCL_DECLARED
+#define XFreeColors_TCL_DECLARED
/* 38 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c,
- unsigned long* ulp, int i, unsigned long ul));
+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 _ANSI_ARGS_((Display* d, Cursor c));
+EXTERN void XFreeCursor(Display *d, Cursor c);
+#endif
+#ifndef XFreeModifiermap_TCL_DECLARED
+#define XFreeModifiermap_TCL_DECLARED
/* 40 */
-EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x));
+EXTERN void XFreeModifiermap(XModifierKeymap *x);
+#endif
+#ifndef XGetGeometry_TCL_DECLARED
+#define XGetGeometry_TCL_DECLARED
/* 41 */
-EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr,
- Window* w, int* i1, int* i2,
- unsigned int* ui1, unsigned int* ui2,
- unsigned int* ui3, unsigned int* ui4));
+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 _ANSI_ARGS_((Display* d, Window* w,
- int* i));
+EXTERN void XGetInputFocus(Display *d, Window *w, int *i);
+#endif
+#ifndef XGetWindowProperty_TCL_DECLARED
+#define XGetWindowProperty_TCL_DECLARED
/* 43 */
-EXTERN int XGetWindowProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a1, long l1, long l2, Bool b, Atom a2,
- Atom* ap, int* ip, unsigned long* ulp1,
- unsigned long* ulp2, unsigned char** cpp));
+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 _ANSI_ARGS_((Display* d,
- Window w, XWindowAttributes* x));
+EXTERN Status XGetWindowAttributes(Display *d, Window w,
+ XWindowAttributes *x);
+#endif
+#ifndef XGrabKeyboard_TCL_DECLARED
+#define XGrabKeyboard_TCL_DECLARED
/* 45 */
-EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w,
- Bool b, int i1, int i2, Time t));
+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 _ANSI_ARGS_((Display* d, Window w1,
- Bool b, unsigned int ui, int i1, int i2,
- Window w2, Cursor c, Time t));
+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 _ANSI_ARGS_((Display* d, KeySym k));
+EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k);
+#endif
+#ifndef XLookupColor_TCL_DECLARED
+#define XLookupColor_TCL_DECLARED
/* 48 */
-EXTERN Status XLookupColor _ANSI_ARGS_((Display* d, Colormap c1,
- _Xconst char* c2, XColor* x1, XColor* x2));
+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 _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XMapWindow(Display *d, Window w);
+#endif
+#ifndef XMoveResizeWindow_TCL_DECLARED
+#define XMoveResizeWindow_TCL_DECLARED
/* 50 */
-EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2));
+EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2);
+#endif
+#ifndef XNextEvent_TCL_DECLARED
+#define XNextEvent_TCL_DECLARED
/* 52 */
-EXTERN void XNextEvent _ANSI_ARGS_((Display* d, XEvent* x));
+EXTERN void XNextEvent(Display *d, XEvent *x);
+#endif
+#ifndef XPutBackEvent_TCL_DECLARED
+#define XPutBackEvent_TCL_DECLARED
/* 53 */
-EXTERN void XPutBackEvent _ANSI_ARGS_((Display* d, XEvent* x));
+EXTERN void XPutBackEvent(Display *d, XEvent *x);
+#endif
+#ifndef XQueryColors_TCL_DECLARED
+#define XQueryColors_TCL_DECLARED
/* 54 */
-EXTERN void XQueryColors _ANSI_ARGS_((Display* d, Colormap c,
- XColor* x, int i));
+EXTERN void XQueryColors(Display *d, Colormap c, XColor *x,
+ int i);
+#endif
+#ifndef XQueryPointer_TCL_DECLARED
+#define XQueryPointer_TCL_DECLARED
/* 55 */
-EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, int* i1, int* i2,
- int* i3, int* i4, unsigned int* ui));
+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 _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, Window** w4,
- unsigned int* ui));
+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 _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XRaiseWindow(Display *d, Window w);
+#endif
+#ifndef XRefreshKeyboardMapping_TCL_DECLARED
+#define XRefreshKeyboardMapping_TCL_DECLARED
/* 58 */
-EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_((
- XMappingEvent* x));
+EXTERN void XRefreshKeyboardMapping(XMappingEvent *x);
+#endif
+#ifndef XResizeWindow_TCL_DECLARED
+#define XResizeWindow_TCL_DECLARED
/* 59 */
-EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w,
- unsigned int ui1, unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Window w,
- long l));
+EXTERN void XSelectInput(Display *d, Window w, long l);
+#endif
+#ifndef XSendEvent_TCL_DECLARED
+#define XSendEvent_TCL_DECLARED
/* 61 */
-EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b,
- long l, XEvent* x));
+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 _ANSI_ARGS_((Display* d, Window w,
- CONST char** c, int i));
+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 _ANSI_ARGS_((Display* d, Window w,
- _Xconst char* c));
+EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c);
+#endif
+#ifndef XSetInputFocus_TCL_DECLARED
+#define XSetInputFocus_TCL_DECLARED
/* 64 */
-EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w,
- int i, Time t));
+EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
+#endif
+#ifndef XSetSelectionOwner_TCL_DECLARED
+#define XSetSelectionOwner_TCL_DECLARED
/* 65 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a,
- Window w, Time t));
+EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
+ Time t);
+#endif
+#ifndef XSetWindowBackground_TCL_DECLARED
+#define XSetWindowBackground_TCL_DECLARED
/* 66 */
-EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul));
+EXTERN void XSetWindowBackground(Display *d, Window w,
+ unsigned long ul);
+#endif
+#ifndef XSetWindowBackgroundPixmap_TCL_DECLARED
+#define XSetWindowBackgroundPixmap_TCL_DECLARED
/* 67 */
-EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
+EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w,
+ Pixmap p);
+#endif
+#ifndef XSetWindowBorder_TCL_DECLARED
+#define XSetWindowBorder_TCL_DECLARED
/* 68 */
-EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w,
- unsigned long ul));
+EXTERN void XSetWindowBorder(Display *d, Window w,
+ unsigned long ul);
+#endif
+#ifndef XSetWindowBorderPixmap_TCL_DECLARED
+#define XSetWindowBorderPixmap_TCL_DECLARED
/* 69 */
-EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
+EXTERN void XSetWindowBorderPixmap(Display *d, Window w,
+ Pixmap p);
+#endif
+#ifndef XSetWindowBorderWidth_TCL_DECLARED
+#define XSetWindowBorderWidth_TCL_DECLARED
/* 70 */
-EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d,
- Window w, unsigned int ui));
+EXTERN void XSetWindowBorderWidth(Display *d, Window w,
+ unsigned int ui);
+#endif
+#ifndef XSetWindowColormap_TCL_DECLARED
+#define XSetWindowColormap_TCL_DECLARED
/* 71 */
-EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w,
- Colormap c));
+EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c);
+#endif
+#ifndef XTranslateCoordinates_TCL_DECLARED
+#define XTranslateCoordinates_TCL_DECLARED
/* 72 */
-EXTERN Bool XTranslateCoordinates _ANSI_ARGS_((Display* d,
- Window w1, Window w2, int i1, int i2,
- int* i3, int* i4, Window* w3));
+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 _ANSI_ARGS_((Display* d, Time t));
+EXTERN void XUngrabKeyboard(Display *d, Time t);
+#endif
+#ifndef XUngrabPointer_TCL_DECLARED
+#define XUngrabPointer_TCL_DECLARED
/* 74 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t));
+EXTERN void XUngrabPointer(Display *d, Time t);
+#endif
+#ifndef XUnmapWindow_TCL_DECLARED
+#define XUnmapWindow_TCL_DECLARED
/* 75 */
-EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XUnmapWindow(Display *d, Window w);
+#endif
+#ifndef XWindowEvent_TCL_DECLARED
+#define XWindowEvent_TCL_DECLARED
/* 76 */
-EXTERN void XWindowEvent _ANSI_ARGS_((Display* d, Window w,
- long l, XEvent* x));
+EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x);
+#endif
+#ifndef XDestroyIC_TCL_DECLARED
+#define XDestroyIC_TCL_DECLARED
/* 77 */
-EXTERN void XDestroyIC _ANSI_ARGS_((XIC x));
+EXTERN void XDestroyIC(XIC x);
+#endif
+#ifndef XFilterEvent_TCL_DECLARED
+#define XFilterEvent_TCL_DECLARED
/* 78 */
-EXTERN Bool XFilterEvent _ANSI_ARGS_((XEvent* x, Window w));
+EXTERN Bool XFilterEvent(XEvent *x, Window w);
+#endif
+#ifndef XmbLookupString_TCL_DECLARED
+#define XmbLookupString_TCL_DECLARED
/* 79 */
-EXTERN int XmbLookupString _ANSI_ARGS_((XIC xi,
- XKeyPressedEvent* xk, char* c, int i,
- KeySym* k, Status* s));
+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 _ANSI_ARGS_((unsigned long * colors,
- int ncolors, Display* display, Drawable d,
- GC gc, XImage* image, int src_x, int src_y,
- int dest_x, int dest_y, unsigned int width,
- unsigned int height));
+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 _ANSI_ARGS_((Display * display,
- Colormap map, _Xconst char* spec,
- XColor * colorPtr));
+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 _ANSI_ARGS_((Display* display, Drawable d,
- unsigned long valuemask, XGCValues* values));
+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 _ANSI_ARGS_((Display* display, GC gc));
+EXTERN void XFreeGC(Display *display, GC gc);
+#endif
+#ifndef XInternAtom_TCL_DECLARED
+#define XInternAtom_TCL_DECLARED
/* 85 */
-EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display,
- _Xconst char* atom_name, Bool only_if_exists));
+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 _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
+EXTERN void XSetBackground(Display *display, GC gc,
+ unsigned long foreground);
+#endif
+#ifndef XSetForeground_TCL_DECLARED
+#define XSetForeground_TCL_DECLARED
/* 87 */
-EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
+EXTERN void XSetForeground(Display *display, GC gc,
+ unsigned long foreground);
+#endif
+#ifndef XSetClipMask_TCL_DECLARED
+#define XSetClipMask_TCL_DECLARED
/* 88 */
-EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc,
- Pixmap pixmap));
+EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap);
+#endif
+#ifndef XSetClipOrigin_TCL_DECLARED
+#define XSetClipOrigin_TCL_DECLARED
/* 89 */
-EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc,
- int clip_x_origin, int clip_y_origin));
+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 _ANSI_ARGS_((Display* display, GC gc,
- int ts_x_origin, int ts_y_origin));
+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 _ANSI_ARGS_((Display * d, GC gc,
- unsigned long mask, XGCValues * values));
+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 _ANSI_ARGS_((Display * display, GC gc,
- Font font));
+EXTERN void XSetFont(Display *display, GC gc, Font font);
+#endif
+#ifndef XSetArcMode_TCL_DECLARED
+#define XSetArcMode_TCL_DECLARED
/* 93 */
-EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc,
- int arc_mode));
+EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode);
+#endif
+#ifndef XSetStipple_TCL_DECLARED
+#define XSetStipple_TCL_DECLARED
/* 94 */
-EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc,
- Pixmap stipple));
+EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple);
+#endif
+#ifndef XSetFillRule_TCL_DECLARED
+#define XSetFillRule_TCL_DECLARED
/* 95 */
-EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc,
- int fill_rule));
+EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule);
+#endif
+#ifndef XSetFillStyle_TCL_DECLARED
+#define XSetFillStyle_TCL_DECLARED
/* 96 */
-EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc,
- int fill_style));
+EXTERN void XSetFillStyle(Display *display, GC gc,
+ int fill_style);
+#endif
+#ifndef XSetFunction_TCL_DECLARED
+#define XSetFunction_TCL_DECLARED
/* 97 */
-EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc,
- int function));
+EXTERN void XSetFunction(Display *display, GC gc, int function);
+#endif
+#ifndef XSetLineAttributes_TCL_DECLARED
+#define XSetLineAttributes_TCL_DECLARED
/* 98 */
-EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display,
- GC gc, unsigned int line_width,
- int line_style, int cap_style,
- int join_style));
+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 _ANSI_ARGS_((XImage * image));
+EXTERN int _XInitImageFuncPtrs(XImage *image);
+#endif
+#ifndef XCreateIC_TCL_DECLARED
+#define XCreateIC_TCL_DECLARED
/* 100 */
-EXTERN XIC XCreateIC _ANSI_ARGS_((void));
+EXTERN XIC XCreateIC(void);
+#endif
+#ifndef XGetVisualInfo_TCL_DECLARED
+#define XGetVisualInfo_TCL_DECLARED
/* 101 */
-EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display,
- long vinfo_mask, XVisualInfo* vinfo_template,
- int* nitems_return));
+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 _ANSI_ARGS_((Display* display,
- Window w, XTextProperty* text_prop));
+EXTERN void XSetWMClientMachine(Display *display, Window w,
+ XTextProperty *text_prop);
+#endif
+#ifndef XStringListToTextProperty_TCL_DECLARED
+#define XStringListToTextProperty_TCL_DECLARED
/* 103 */
-EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list,
- int count, XTextProperty* text_prop_return));
+EXTERN Status XStringListToTextProperty(char **list, int count,
+ XTextProperty *text_prop_return);
+#endif
+#ifndef XDrawLine_TCL_DECLARED
+#define XDrawLine_TCL_DECLARED
/* 104 */
-EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int x1, int y1, int x2, int y2));
+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 _ANSI_ARGS_((Display* d, Window s,
- Window dw, int sx, int sy, unsigned int sw,
- unsigned int sh, int dx, int dy));
+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 _ANSI_ARGS_((Display* display,
- Drawable d, GC gc, int x, int y,
- unsigned int width, unsigned int height));
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-/* 0 */
-EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc,
- int dash_offset, _Xconst char* dash_list,
- int n));
-/* 1 */
-EXTERN XModifierKeymap* XGetModifierMapping _ANSI_ARGS_((Display* d));
-/* 2 */
-EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v,
- unsigned int ui1, int i1, int i2, char* cp,
- unsigned int ui2, unsigned int ui3, int i3,
- int i4));
-/* 3 */
-EXTERN XImage * XGetImage _ANSI_ARGS_((Display* d, Drawable dr,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, unsigned long ul, int i3));
-/* 4 */
-EXTERN char * XGetAtomName _ANSI_ARGS_((Display* d, Atom a));
-/* 5 */
-EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k));
-/* 6 */
-EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w,
- Visual* v, int i));
-/* 7 */
-EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g));
-/* 8 */
-EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, KeyCode k,
- int i));
-/* 9 */
-EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c));
-/* 10 */
-EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i));
-/* 11 */
-EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
-/* 12 */
-EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c,
- XColor* xp));
-/* 13 */
-EXTERN void XBell _ANSI_ARGS_((Display* d, int i));
-/* 14 */
-EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a1, Atom a2, int i1, int i2,
- _Xconst unsigned char* c, int i3));
-/* 15 */
-EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul,
- XSetWindowAttributes* x));
-/* 16 */
-EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w,
- unsigned int i, XWindowChanges* x));
-/* 17 */
-EXTERN void XCopyArea _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4));
-/* 18 */
-EXTERN void XCopyPlane _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4, unsigned long ul));
-/* 19 */
-EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display* display,
- Drawable d, _Xconst char* data,
- unsigned int width, unsigned int height));
-/* 20 */
-EXTERN void XDefineCursor _ANSI_ARGS_((Display* d, Window w,
- Cursor c));
-/* 21 */
-EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w));
-/* 22 */
-EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
-/* 23 */
-EXTERN void XDrawLines _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2));
-/* 24 */
-EXTERN void XDrawRectangle _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, int i1, int i2, unsigned int ui1,
- unsigned int ui2));
-/* 25 */
-EXTERN void XFillArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
-/* 26 */
-EXTERN void XFillPolygon _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2, int i3));
-/* 27 */
-EXTERN void XFillRectangles _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XRectangle* x, int i));
-/* 28 */
-EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c));
-/* 29 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c,
- unsigned long* ulp, int i, unsigned long ul));
-/* 30 */
-EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x));
-/* 31 */
-EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr,
- Window* w, int* i1, int* i2,
- unsigned int* ui1, unsigned int* ui2,
- unsigned int* ui3, unsigned int* ui4));
-/* 32 */
-EXTERN int XGetWindowProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a1, long l1, long l2, Bool b, Atom a2,
- Atom* ap, int* ip, unsigned long* ulp1,
- unsigned long* ulp2, unsigned char** cpp));
-/* 33 */
-EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w,
- Bool b, int i1, int i2, Time t));
-/* 34 */
-EXTERN int XGrabPointer _ANSI_ARGS_((Display* d, Window w1,
- Bool b, unsigned int ui, int i1, int i2,
- Window w2, Cursor c, Time t));
-/* 35 */
-EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display* d, KeySym k));
-/* 36 */
-EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w));
-/* 37 */
-EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2));
-/* 38 */
-EXTERN void XMoveWindow _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2));
-/* 39 */
-EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, int* i1, int* i2,
- int* i3, int* i4, unsigned int* ui));
-/* 40 */
-EXTERN void XRaiseWindow _ANSI_ARGS_((Display* d, Window w));
-/* 41 */
-EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_((
- XMappingEvent* x));
-/* 42 */
-EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w,
- unsigned int ui1, unsigned int ui2));
-/* 43 */
-EXTERN void XSelectInput _ANSI_ARGS_((Display* d, Window w,
- long l));
-/* 44 */
-EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b,
- long l, XEvent* x));
-/* 45 */
-EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w,
- _Xconst char* c));
-/* 46 */
-EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w,
- int i, Time t));
-/* 47 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a,
- Window w, Time t));
-/* 48 */
-EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul));
-/* 49 */
-EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
-/* 50 */
-EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w,
- unsigned long ul));
-/* 51 */
-EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
-/* 52 */
-EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d,
- Window w, unsigned int ui));
-/* 53 */
-EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w,
- Colormap c));
-/* 54 */
-EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t));
-/* 55 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t));
-/* 56 */
-EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w));
-/* 57 */
-EXTERN void TkPutImage _ANSI_ARGS_((unsigned long * colors,
- int ncolors, Display* display, Drawable d,
- GC gc, XImage* image, int src_x, int src_y,
- int dest_x, int dest_y, unsigned int width,
- unsigned int height));
-/* 58 */
-EXTERN Status XParseColor _ANSI_ARGS_((Display * display,
- Colormap map, _Xconst char* spec,
- XColor * colorPtr));
-/* 59 */
-EXTERN GC XCreateGC _ANSI_ARGS_((Display* display, Drawable d,
- unsigned long valuemask, XGCValues* values));
-/* 60 */
-EXTERN void XFreeGC _ANSI_ARGS_((Display* display, GC gc));
-/* 61 */
-EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display,
- _Xconst char* atom_name, Bool only_if_exists));
-/* 62 */
-EXTERN void XSetBackground _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
-/* 63 */
-EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
-/* 64 */
-EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc,
- Pixmap pixmap));
-/* 65 */
-EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc,
- int clip_x_origin, int clip_y_origin));
-/* 66 */
-EXTERN void XSetTSOrigin _ANSI_ARGS_((Display* display, GC gc,
- int ts_x_origin, int ts_y_origin));
-/* 67 */
-EXTERN void XChangeGC _ANSI_ARGS_((Display * d, GC gc,
- unsigned long mask, XGCValues * values));
-/* 68 */
-EXTERN void XSetFont _ANSI_ARGS_((Display * display, GC gc,
- Font font));
-/* 69 */
-EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc,
- int arc_mode));
-/* 70 */
-EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc,
- Pixmap stipple));
-/* 71 */
-EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc,
- int fill_rule));
-/* 72 */
-EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc,
- int fill_style));
-/* 73 */
-EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc,
- int function));
-/* 74 */
-EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display,
- GC gc, unsigned int line_width,
- int line_style, int cap_style,
- int join_style));
-/* 75 */
-EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage * image));
-/* 76 */
-EXTERN XIC XCreateIC _ANSI_ARGS_((void));
-/* 77 */
-EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display,
- long vinfo_mask, XVisualInfo* vinfo_template,
- int* nitems_return));
-/* 78 */
-EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display* display,
- Window w, XTextProperty* text_prop));
-/* 79 */
-EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list,
- int count, XTextProperty* text_prop_return));
-/* 80 */
-EXTERN void XDrawSegments _ANSI_ARGS_((Display * display,
- Drawable d, GC gc, XSegment * segments,
- int nsegments));
-/* 81 */
-EXTERN void XForceScreenSaver _ANSI_ARGS_((Display* display,
- int mode));
-/* 82 */
-EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int x1, int y1, int x2, int y2));
-/* 83 */
-EXTERN void XFillRectangle _ANSI_ARGS_((Display* display,
- Drawable d, GC gc, int x, int y,
- unsigned int width, unsigned int height));
-/* 84 */
-EXTERN void XClearWindow _ANSI_ARGS_((Display* d, Window w));
-/* 85 */
-EXTERN void XDrawPoint _ANSI_ARGS_((Display* display, Drawable d,
- GC gc, int x, int y));
-/* 86 */
-EXTERN void XDrawPoints _ANSI_ARGS_((Display* display,
- Drawable d, GC gc, XPoint * points,
- int npoints, int mode));
-/* 87 */
-EXTERN void XWarpPointer _ANSI_ARGS_((Display* display,
- Window src_w, Window dest_w, int src_x,
- int src_y, unsigned int src_width,
- unsigned int src_height, int dest_x,
- int dest_y));
-/* 88 */
-EXTERN void XQueryColor _ANSI_ARGS_((Display * display,
- Colormap colormap, XColor * def_in_out));
-/* 89 */
-EXTERN void XQueryColors _ANSI_ARGS_((Display * display,
- Colormap colormap, XColor * defs_in_out,
- int ncolors));
-/* 90 */
-EXTERN Status XQueryTree _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, Window** w4,
- unsigned int* ui));
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+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 _ANSI_ARGS_((Display* display, GC gc,
- int dash_offset, _Xconst char* dash_list,
- int n));
+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 _ANSI_ARGS_((Display* d));
+EXTERN XModifierKeymap * XGetModifierMapping(Display *d);
+#endif
+#ifndef XCreateImage_TCL_DECLARED
+#define XCreateImage_TCL_DECLARED
/* 2 */
-EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v,
- unsigned int ui1, int i1, int i2, char* cp,
- unsigned int ui2, unsigned int ui3, int i3,
- int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, unsigned long ul, int i3));
+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 _ANSI_ARGS_((Display* d, Atom a));
+EXTERN char * XGetAtomName(Display *d, Atom a);
+#endif
+#ifndef XKeysymToString_TCL_DECLARED
+#define XKeysymToString_TCL_DECLARED
/* 5 */
-EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k));
+EXTERN char * XKeysymToString(KeySym k);
+#endif
+#ifndef XCreateColormap_TCL_DECLARED
+#define XCreateColormap_TCL_DECLARED
/* 6 */
-EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w,
- Visual* v, int i));
+EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v,
+ int i);
+#endif
+#ifndef XGContextFromGC_TCL_DECLARED
+#define XGContextFromGC_TCL_DECLARED
/* 7 */
-EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g));
+EXTERN GContext XGContextFromGC(GC g);
+#endif
+#ifndef XKeycodeToKeysym_TCL_DECLARED
+#define XKeycodeToKeysym_TCL_DECLARED
/* 8 */
-EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, KeyCode k,
- int i));
+EXTERN KeySym XKeycodeToKeysym(Display *d, KeyCode k, int i);
+#endif
+#ifndef XStringToKeysym_TCL_DECLARED
+#define XStringToKeysym_TCL_DECLARED
/* 9 */
-EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c));
+EXTERN KeySym XStringToKeysym(_Xconst char *c);
+#endif
+#ifndef XRootWindow_TCL_DECLARED
+#define XRootWindow_TCL_DECLARED
/* 10 */
-EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i));
+EXTERN Window XRootWindow(Display *d, int i);
+#endif
+#ifndef XSetErrorHandler_TCL_DECLARED
+#define XSetErrorHandler_TCL_DECLARED
/* 11 */
-EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
+EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x);
+#endif
+#ifndef XAllocColor_TCL_DECLARED
+#define XAllocColor_TCL_DECLARED
/* 12 */
-EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c,
- XColor* xp));
+EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp);
+#endif
+#ifndef XBell_TCL_DECLARED
+#define XBell_TCL_DECLARED
/* 13 */
-EXTERN void XBell _ANSI_ARGS_((Display* d, int i));
+EXTERN void XBell(Display *d, int i);
+#endif
+#ifndef XChangeProperty_TCL_DECLARED
+#define XChangeProperty_TCL_DECLARED
/* 14 */
-EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w,
- Atom a1, Atom a2, int i1, int i2,
- _Xconst unsigned char* c, int i3));
+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 _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul,
- XSetWindowAttributes* x));
+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 _ANSI_ARGS_((Display* d, Window w,
- unsigned int i, XWindowChanges* x));
+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 _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr1,
- Drawable dr2, GC g, int i1, int i2,
- unsigned int ui1, unsigned int ui2, int i3,
- int i4, unsigned long ul));
+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 _ANSI_ARGS_((Display* display,
- Drawable d, _Xconst char* data,
- unsigned int width, unsigned int height));
+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 _ANSI_ARGS_((Display* d, Window w,
- Cursor c));
+EXTERN void XDefineCursor(Display *d, Window w, Cursor c);
+#endif
+#ifndef XDestroyWindow_TCL_DECLARED
+#define XDestroyWindow_TCL_DECLARED
/* 21 */
-EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XDestroyWindow(Display *d, Window w);
+#endif
+#ifndef XDrawArc_TCL_DECLARED
+#define XDrawArc_TCL_DECLARED
/* 22 */
-EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, int i1, int i2, unsigned int ui1,
- unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2, int i3, int i4));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XPoint* x, int i1, int i2, int i3));
+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 _ANSI_ARGS_((Display* d, Drawable dr,
- GC g, XRectangle* x, int i));
+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 _ANSI_ARGS_((Display* d, Colormap c));
+EXTERN void XFreeColormap(Display *d, Colormap c);
+#endif
+#ifndef XFreeColors_TCL_DECLARED
+#define XFreeColors_TCL_DECLARED
/* 29 */
-EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c,
- unsigned long* ulp, int i, unsigned long ul));
+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 _ANSI_ARGS_((XModifierKeymap* x));
+EXTERN void XFreeModifiermap(XModifierKeymap *x);
+#endif
+#ifndef XGetGeometry_TCL_DECLARED
+#define XGetGeometry_TCL_DECLARED
/* 31 */
-EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr,
- Window* w, int* i1, int* i2,
- unsigned int* ui1, unsigned int* ui2,
- unsigned int* ui3, unsigned int* ui4));
+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 _ANSI_ARGS_((Display* d, Window w,
- Atom a1, long l1, long l2, Bool b, Atom a2,
- Atom* ap, int* ip, unsigned long* ulp1,
- unsigned long* ulp2, unsigned char** cpp));
+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 _ANSI_ARGS_((Display* d, Window w,
- Bool b, int i1, int i2, Time t));
+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 _ANSI_ARGS_((Display* d, Window w1,
- Bool b, unsigned int ui, int i1, int i2,
- Window w2, Cursor c, Time t));
+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 _ANSI_ARGS_((Display* d, KeySym k));
+EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k);
+#endif
+#ifndef XMapWindow_TCL_DECLARED
+#define XMapWindow_TCL_DECLARED
/* 36 */
-EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XMapWindow(Display *d, Window w);
+#endif
+#ifndef XMoveResizeWindow_TCL_DECLARED
+#define XMoveResizeWindow_TCL_DECLARED
/* 37 */
-EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2, unsigned int ui1,
- unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Window w,
- int i1, int i2));
+EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2);
+#endif
+#ifndef XQueryPointer_TCL_DECLARED
+#define XQueryPointer_TCL_DECLARED
/* 39 */
-EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, int* i1, int* i2,
- int* i3, int* i4, unsigned int* ui));
+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 _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XRaiseWindow(Display *d, Window w);
+#endif
+#ifndef XRefreshKeyboardMapping_TCL_DECLARED
+#define XRefreshKeyboardMapping_TCL_DECLARED
/* 41 */
-EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_((
- XMappingEvent* x));
+EXTERN void XRefreshKeyboardMapping(XMappingEvent *x);
+#endif
+#ifndef XResizeWindow_TCL_DECLARED
+#define XResizeWindow_TCL_DECLARED
/* 42 */
-EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w,
- unsigned int ui1, unsigned int ui2));
+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 _ANSI_ARGS_((Display* d, Window w,
- long l));
+EXTERN void XSelectInput(Display *d, Window w, long l);
+#endif
+#ifndef XSendEvent_TCL_DECLARED
+#define XSendEvent_TCL_DECLARED
/* 44 */
-EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b,
- long l, XEvent* x));
+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 _ANSI_ARGS_((Display* d, Window w,
- _Xconst char* c));
+EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c);
+#endif
+#ifndef XSetInputFocus_TCL_DECLARED
+#define XSetInputFocus_TCL_DECLARED
/* 46 */
-EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w,
- int i, Time t));
+EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t);
+#endif
+#ifndef XSetSelectionOwner_TCL_DECLARED
+#define XSetSelectionOwner_TCL_DECLARED
/* 47 */
-EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a,
- Window w, Time t));
+EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w,
+ Time t);
+#endif
+#ifndef XSetWindowBackground_TCL_DECLARED
+#define XSetWindowBackground_TCL_DECLARED
/* 48 */
-EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d,
- Window w, unsigned long ul));
+EXTERN void XSetWindowBackground(Display *d, Window w,
+ unsigned long ul);
+#endif
+#ifndef XSetWindowBackgroundPixmap_TCL_DECLARED
+#define XSetWindowBackgroundPixmap_TCL_DECLARED
/* 49 */
-EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
+EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w,
+ Pixmap p);
+#endif
+#ifndef XSetWindowBorder_TCL_DECLARED
+#define XSetWindowBorder_TCL_DECLARED
/* 50 */
-EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w,
- unsigned long ul));
+EXTERN void XSetWindowBorder(Display *d, Window w,
+ unsigned long ul);
+#endif
+#ifndef XSetWindowBorderPixmap_TCL_DECLARED
+#define XSetWindowBorderPixmap_TCL_DECLARED
/* 51 */
-EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d,
- Window w, Pixmap p));
+EXTERN void XSetWindowBorderPixmap(Display *d, Window w,
+ Pixmap p);
+#endif
+#ifndef XSetWindowBorderWidth_TCL_DECLARED
+#define XSetWindowBorderWidth_TCL_DECLARED
/* 52 */
-EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d,
- Window w, unsigned int ui));
+EXTERN void XSetWindowBorderWidth(Display *d, Window w,
+ unsigned int ui);
+#endif
+#ifndef XSetWindowColormap_TCL_DECLARED
+#define XSetWindowColormap_TCL_DECLARED
/* 53 */
-EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w,
- Colormap c));
+EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c);
+#endif
+#ifndef XUngrabKeyboard_TCL_DECLARED
+#define XUngrabKeyboard_TCL_DECLARED
/* 54 */
-EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t));
+EXTERN void XUngrabKeyboard(Display *d, Time t);
+#endif
+#ifndef XUngrabPointer_TCL_DECLARED
+#define XUngrabPointer_TCL_DECLARED
/* 55 */
-EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t));
+EXTERN void XUngrabPointer(Display *d, Time t);
+#endif
+#ifndef XUnmapWindow_TCL_DECLARED
+#define XUnmapWindow_TCL_DECLARED
/* 56 */
-EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XUnmapWindow(Display *d, Window w);
+#endif
+#ifndef TkPutImage_TCL_DECLARED
+#define TkPutImage_TCL_DECLARED
/* 57 */
-EXTERN void TkPutImage _ANSI_ARGS_((unsigned long * colors,
- int ncolors, Display* display, Drawable d,
- GC gc, XImage* image, int src_x, int src_y,
- int dest_x, int dest_y, unsigned int width,
- unsigned int height));
+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 _ANSI_ARGS_((Display * display,
- Colormap map, _Xconst char* spec,
- XColor * colorPtr));
+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 _ANSI_ARGS_((Display* display, Drawable d,
- unsigned long valuemask, XGCValues* values));
+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 _ANSI_ARGS_((Display* display, GC gc));
+EXTERN void XFreeGC(Display *display, GC gc);
+#endif
+#ifndef XInternAtom_TCL_DECLARED
+#define XInternAtom_TCL_DECLARED
/* 61 */
-EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display,
- _Xconst char* atom_name, Bool only_if_exists));
+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 _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
+EXTERN void XSetBackground(Display *display, GC gc,
+ unsigned long foreground);
+#endif
+#ifndef XSetForeground_TCL_DECLARED
+#define XSetForeground_TCL_DECLARED
/* 63 */
-EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc,
- unsigned long foreground));
+EXTERN void XSetForeground(Display *display, GC gc,
+ unsigned long foreground);
+#endif
+#ifndef XSetClipMask_TCL_DECLARED
+#define XSetClipMask_TCL_DECLARED
/* 64 */
-EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc,
- Pixmap pixmap));
+EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap);
+#endif
+#ifndef XSetClipOrigin_TCL_DECLARED
+#define XSetClipOrigin_TCL_DECLARED
/* 65 */
-EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc,
- int clip_x_origin, int clip_y_origin));
+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 _ANSI_ARGS_((Display* display, GC gc,
- int ts_x_origin, int ts_y_origin));
+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 _ANSI_ARGS_((Display * d, GC gc,
- unsigned long mask, XGCValues * values));
+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 _ANSI_ARGS_((Display * display, GC gc,
- Font font));
+EXTERN void XSetFont(Display *display, GC gc, Font font);
+#endif
+#ifndef XSetArcMode_TCL_DECLARED
+#define XSetArcMode_TCL_DECLARED
/* 69 */
-EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc,
- int arc_mode));
+EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode);
+#endif
+#ifndef XSetStipple_TCL_DECLARED
+#define XSetStipple_TCL_DECLARED
/* 70 */
-EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc,
- Pixmap stipple));
+EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple);
+#endif
+#ifndef XSetFillRule_TCL_DECLARED
+#define XSetFillRule_TCL_DECLARED
/* 71 */
-EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc,
- int fill_rule));
+EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule);
+#endif
+#ifndef XSetFillStyle_TCL_DECLARED
+#define XSetFillStyle_TCL_DECLARED
/* 72 */
-EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc,
- int fill_style));
+EXTERN void XSetFillStyle(Display *display, GC gc,
+ int fill_style);
+#endif
+#ifndef XSetFunction_TCL_DECLARED
+#define XSetFunction_TCL_DECLARED
/* 73 */
-EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc,
- int function));
+EXTERN void XSetFunction(Display *display, GC gc, int function);
+#endif
+#ifndef XSetLineAttributes_TCL_DECLARED
+#define XSetLineAttributes_TCL_DECLARED
/* 74 */
-EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display,
- GC gc, unsigned int line_width,
- int line_style, int cap_style,
- int join_style));
+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 _ANSI_ARGS_((XImage * image));
+EXTERN int _XInitImageFuncPtrs(XImage *image);
+#endif
+#ifndef XCreateIC_TCL_DECLARED
+#define XCreateIC_TCL_DECLARED
/* 76 */
-EXTERN XIC XCreateIC _ANSI_ARGS_((void));
+EXTERN XIC XCreateIC(void);
+#endif
+#ifndef XGetVisualInfo_TCL_DECLARED
+#define XGetVisualInfo_TCL_DECLARED
/* 77 */
-EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display,
- long vinfo_mask, XVisualInfo* vinfo_template,
- int* nitems_return));
+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 _ANSI_ARGS_((Display* display,
- Window w, XTextProperty* text_prop));
+EXTERN void XSetWMClientMachine(Display *display, Window w,
+ XTextProperty *text_prop);
+#endif
+#ifndef XStringListToTextProperty_TCL_DECLARED
+#define XStringListToTextProperty_TCL_DECLARED
/* 79 */
-EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list,
- int count, XTextProperty* text_prop_return));
+EXTERN Status XStringListToTextProperty(char **list, int count,
+ XTextProperty *text_prop_return);
+#endif
+#ifndef XDrawSegments_TCL_DECLARED
+#define XDrawSegments_TCL_DECLARED
/* 80 */
-EXTERN void XDrawSegments _ANSI_ARGS_((Display * display,
- Drawable d, GC gc, XSegment * segments,
- int nsegments));
+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 _ANSI_ARGS_((Display* display,
- int mode));
+EXTERN void XForceScreenSaver(Display *display, int mode);
+#endif
+#ifndef XDrawLine_TCL_DECLARED
+#define XDrawLine_TCL_DECLARED
/* 82 */
-EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g,
- int x1, int y1, int x2, int y2));
+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 _ANSI_ARGS_((Display* display,
- Drawable d, GC gc, int x, int y,
- unsigned int width, unsigned int height));
+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 _ANSI_ARGS_((Display* d, Window w));
+EXTERN void XClearWindow(Display *d, Window w);
+#endif
+#ifndef XDrawPoint_TCL_DECLARED
+#define XDrawPoint_TCL_DECLARED
/* 85 */
-EXTERN void XDrawPoint _ANSI_ARGS_((Display* display, Drawable d,
- GC gc, int x, int y));
+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 _ANSI_ARGS_((Display* display,
- Drawable d, GC gc, XPoint * points,
- int npoints, int mode));
+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 _ANSI_ARGS_((Display* display,
- Window src_w, Window dest_w, int src_x,
- int src_y, unsigned int src_width,
- unsigned int src_height, int dest_x,
- int dest_y));
+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 _ANSI_ARGS_((Display * display,
- Colormap colormap, XColor * def_in_out));
+EXTERN void XQueryColor(Display *display, Colormap colormap,
+ XColor *def_in_out);
+#endif
+#ifndef XQueryColors_TCL_DECLARED
+#define XQueryColors_TCL_DECLARED
/* 89 */
-EXTERN void XQueryColors _ANSI_ARGS_((Display * display,
- Colormap colormap, XColor * defs_in_out,
- int ncolors));
+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 _ANSI_ARGS_((Display* d, Window w1,
- Window* w2, Window* w3, Window** w4,
- unsigned int* ui));
+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 _ANSI_ARGS_((Display * display, Bool flag));
-#endif /* MAC_OSX_TK */
+EXTERN int XSync(Display *display, Bool flag);
+#endif
+#endif /* AQUA */
typedef struct TkIntXlibStubs {
int magic;
struct TkIntXlibStubHooks *hooks;
-#ifdef __WIN32__
- void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */
- XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */
- XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
- XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
- char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */
- char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */
- Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */
- Cursor (*xCreatePixmapCursor) _ANSI_ARGS_((Display* d, Pixmap p1, Pixmap p2, XColor* x1, XColor* x2, unsigned int ui1, unsigned int ui2)); /* 7 */
- Cursor (*xCreateGlyphCursor) _ANSI_ARGS_((Display* d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor* x1, XColor* x2)); /* 8 */
- GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 9 */
- XHostAddress * (*xListHosts) _ANSI_ARGS_((Display* d, int* i, Bool* b)); /* 10 */
- KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, unsigned int k, int i)); /* 11 */
- KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 12 */
- Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 13 */
- XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 14 */
- Status (*xIconifyWindow) _ANSI_ARGS_((Display* d, Window w, int i)); /* 15 */
- Status (*xWithdrawWindow) _ANSI_ARGS_((Display* d, Window w, int i)); /* 16 */
- Status (*xGetWMColormapWindows) _ANSI_ARGS_((Display* d, Window w, Window** wpp, int* ip)); /* 17 */
- Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 18 */
- void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 19 */
- void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 20 */
- void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 21 */
- void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 22 */
- void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 23 */
- void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 24 */
- void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 25 */
- Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 26 */
- void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 27 */
- void (*xDeleteProperty) _ANSI_ARGS_((Display* d, Window w, Atom a)); /* 28 */
- void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 29 */
- void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 30 */
- void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 31 */
- void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 32 */
- void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 33 */
- void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 34 */
- void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 35 */
- void (*xForceScreenSaver) _ANSI_ARGS_((Display* d, int i)); /* 36 */
- void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 37 */
- void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 38 */
- void (*xFreeCursor) _ANSI_ARGS_((Display* d, Cursor c)); /* 39 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 40 */
- Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 41 */
- void (*xGetInputFocus) _ANSI_ARGS_((Display* d, Window* w, int* i)); /* 42 */
- int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 43 */
- Status (*xGetWindowAttributes) _ANSI_ARGS_((Display* d, Window w, XWindowAttributes* x)); /* 44 */
- int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 45 */
- int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 46 */
- KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 47 */
- Status (*xLookupColor) _ANSI_ARGS_((Display* d, Colormap c1, _Xconst char* c2, XColor* x1, XColor* x2)); /* 48 */
- void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 49 */
- void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 50 */
- void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 51 */
- void (*xNextEvent) _ANSI_ARGS_((Display* d, XEvent* x)); /* 52 */
- void (*xPutBackEvent) _ANSI_ARGS_((Display* d, XEvent* x)); /* 53 */
- void (*xQueryColors) _ANSI_ARGS_((Display* d, Colormap c, XColor* x, int i)); /* 54 */
- Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 55 */
- Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 56 */
- void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 57 */
- void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 58 */
- void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */
- void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 60 */
- Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 61 */
- void (*xSetCommand) _ANSI_ARGS_((Display* d, Window w, CONST char** c, int i)); /* 62 */
- void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 63 */
- void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 64 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 65 */
- void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 66 */
- void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 67 */
- void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 68 */
- void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 69 */
- void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 70 */
- void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 71 */
- Bool (*xTranslateCoordinates) _ANSI_ARGS_((Display* d, Window w1, Window w2, int i1, int i2, int* i3, int* i4, Window* w3)); /* 72 */
- void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 73 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 74 */
- void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 75 */
- void (*xWindowEvent) _ANSI_ARGS_((Display* d, Window w, long l, XEvent* x)); /* 76 */
- void (*xDestroyIC) _ANSI_ARGS_((XIC x)); /* 77 */
- Bool (*xFilterEvent) _ANSI_ARGS_((XEvent* x, Window w)); /* 78 */
- int (*xmbLookupString) _ANSI_ARGS_((XIC xi, XKeyPressedEvent* xk, char* c, int i, KeySym* k, Status* s)); /* 79 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 80 */
- void *reserved81;
- Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 82 */
- GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 83 */
- void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 84 */
- Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 85 */
- void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 86 */
- void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 87 */
- void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 88 */
- void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 89 */
- void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 90 */
- void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 91 */
- void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 92 */
- void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 93 */
- void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 94 */
- void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 95 */
- void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 96 */
- void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 97 */
- void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 98 */
- int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 99 */
- XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 100 */
- XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 101 */
- void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 102 */
- Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 103 */
- void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 104 */
- void (*xWarpPointer) _ANSI_ARGS_((Display* d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy)); /* 105 */
- void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 106 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */
- XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */
- XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
- XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
- char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */
- char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */
- Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */
- GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 7 */
- KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, KeyCode k, int i)); /* 8 */
- KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 9 */
- Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 10 */
- XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */
- Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 12 */
- void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 13 */
- void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 14 */
- void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 15 */
- void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 16 */
- void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */
- void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */
- Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 19 */
- void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 20 */
- void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 21 */
- void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */
- void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 23 */
- void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */
- void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */
- void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 26 */
- void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 27 */
- void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 28 */
- void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 29 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 30 */
- Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 31 */
- int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 32 */
- int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */
- int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */
- KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 35 */
- void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 36 */
- void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */
- void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 38 */
- Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 39 */
- void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 40 */
- void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 41 */
- void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */
- void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 43 */
- Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 44 */
- void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 45 */
- void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 46 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 47 */
- void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 48 */
- void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 49 */
- void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 50 */
- void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 51 */
- void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 52 */
- void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 53 */
- void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 54 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 55 */
- void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 56 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
- Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 58 */
- GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 59 */
- void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 60 */
- Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 61 */
- void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 62 */
- void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 63 */
- void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 64 */
- void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */
- void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */
- void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 67 */
- void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 68 */
- void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 69 */
- void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 70 */
- void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 71 */
- void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 72 */
- void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 73 */
- void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */
- int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 75 */
- XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */
- XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 77 */
- void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 78 */
- Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 79 */
- void (*xDrawSegments) _ANSI_ARGS_((Display * display, Drawable d, GC gc, XSegment * segments, int nsegments)); /* 80 */
- void (*xForceScreenSaver) _ANSI_ARGS_((Display* display, int mode)); /* 81 */
- void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */
- void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */
- void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 84 */
- void (*xDrawPoint) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y)); /* 85 */
- void (*xDrawPoints) _ANSI_ARGS_((Display* display, Drawable d, GC gc, XPoint * points, int npoints, int mode)); /* 86 */
- void (*xWarpPointer) _ANSI_ARGS_((Display* display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
- void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */
- void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */
- Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 90 */
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
- void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */
- XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */
- XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
- XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
- char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */
- char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */
- Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */
- GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 7 */
- KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, KeyCode k, int i)); /* 8 */
- KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 9 */
- Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 10 */
- XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */
- Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 12 */
- void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 13 */
- void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 14 */
- void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 15 */
- void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 16 */
- void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */
- void (*xCopyPlane) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul)); /* 18 */
- Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 19 */
- void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 20 */
- void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 21 */
- void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */
- void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 23 */
- void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */
- void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */
- void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 26 */
- void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 27 */
- void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 28 */
- void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 29 */
- void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 30 */
- Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 31 */
- int (*xGetWindowProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom* ap, int* ip, unsigned long* ulp1, unsigned long* ulp2, unsigned char** cpp)); /* 32 */
- int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */
- int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */
- KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 35 */
- void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 36 */
- void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */
- void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 38 */
- Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 39 */
- void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 40 */
- void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 41 */
- void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */
- void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 43 */
- Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 44 */
- void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 45 */
- void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 46 */
- void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 47 */
- void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 48 */
- void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 49 */
- void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 50 */
- void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 51 */
- void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 52 */
- void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 53 */
- void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 54 */
- void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 55 */
- void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 56 */
- void (*tkPutImage) _ANSI_ARGS_((unsigned long * colors, int ncolors, Display* display, Drawable d, GC gc, XImage* image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height)); /* 57 */
- Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 58 */
- GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 59 */
- void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 60 */
- Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 61 */
- void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 62 */
- void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 63 */
- void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 64 */
- void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */
- void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */
- void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 67 */
- void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 68 */
- void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 69 */
- void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 70 */
- void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 71 */
- void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 72 */
- void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 73 */
- void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */
- int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 75 */
- XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */
- XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 77 */
- void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 78 */
- Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 79 */
- void (*xDrawSegments) _ANSI_ARGS_((Display * display, Drawable d, GC gc, XSegment * segments, int nsegments)); /* 80 */
- void (*xForceScreenSaver) _ANSI_ARGS_((Display* display, int mode)); /* 81 */
- void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */
- void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */
- void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 84 */
- void (*xDrawPoint) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y)); /* 85 */
- void (*xDrawPoints) _ANSI_ARGS_((Display* display, Drawable d, GC gc, XPoint * points, int npoints, int mode)); /* 86 */
- void (*xWarpPointer) _ANSI_ARGS_((Display* display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
- void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */
- void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */
- Status (*xQueryTree) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, Window** w4, unsigned int* ui)); /* 90 */
- int (*xSync) _ANSI_ARGS_((Display * display, Bool flag)); /* 91 */
-#endif /* MAC_OSX_TK */
+#ifdef __WIN32__ /* WIN */
+ void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
+ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */
+ 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); /* 2 */
+ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */
+ char * (*xGetAtomName) (Display *d, Atom a); /* 4 */
+ char * (*xKeysymToString) (KeySym k); /* 5 */
+ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */
+ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */
+ Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */
+ GContext (*xGContextFromGC) (GC g); /* 9 */
+ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */
+ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */
+ KeySym (*xStringToKeysym) (_Xconst char *c); /* 12 */
+ Window (*xRootWindow) (Display *d, int i); /* 13 */
+ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 14 */
+ Status (*xIconifyWindow) (Display *d, Window w, int i); /* 15 */
+ Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */
+ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */
+ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */
+ void (*xBell) (Display *d, int i); /* 19 */
+ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */
+ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */
+ void (*xClearWindow) (Display *d, Window w); /* 22 */
+ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */
+ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */
+ 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); /* 25 */
+ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */
+ void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */
+ void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */
+ void (*xDestroyWindow) (Display *d, Window w); /* 29 */
+ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */
+ void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */
+ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */
+ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */
+ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */
+ void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */
+ void (*xForceScreenSaver) (Display *d, int i); /* 36 */
+ void (*xFreeColormap) (Display *d, Colormap c); /* 37 */
+ void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */
+ void (*xFreeCursor) (Display *d, Cursor c); /* 39 */
+ void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */
+ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */
+ void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */
+ 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); /* 43 */
+ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */
+ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */
+ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */
+ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */
+ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */
+ void (*xMapWindow) (Display *d, Window w); /* 49 */
+ void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */
+ void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */
+ void (*xNextEvent) (Display *d, XEvent *x); /* 52 */
+ void (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */
+ void (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */
+ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */
+ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */
+ void (*xRaiseWindow) (Display *d, Window w); /* 57 */
+ void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */
+ 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 (*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 */
+ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */
+ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */
+ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */
+ void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */
+ void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */
+ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */
+ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */
+ void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */
+ void (*xUngrabPointer) (Display *d, Time t); /* 74 */
+ void (*xUnmapWindow) (Display *d, Window w); /* 75 */
+ void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */
+ void (*xDestroyIC) (XIC x); /* 77 */
+ 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;
+ 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 */
+ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */
+ void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */
+ void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */
+ void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */
+ void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */
+ void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */
+ void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */
+ void (*xSetFont) (Display *display, GC gc, Font font); /* 92 */
+ void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */
+ void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */
+ void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */
+ void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */
+ void (*xSetFunction) (Display *display, GC gc, int function); /* 97 */
+ void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */
+ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */
+ XIC (*xCreateIC) (void); /* 100 */
+ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */
+ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */
+ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */
+ void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */
+ void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */
+ void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
+ void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */
+ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */
+ 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); /* 2 */
+ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */
+ char * (*xGetAtomName) (Display *d, Atom a); /* 4 */
+ char * (*xKeysymToString) (KeySym k); /* 5 */
+ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */
+ GContext (*xGContextFromGC) (GC g); /* 7 */
+ KeySym (*xKeycodeToKeysym) (Display *d, KeyCode k, int i); /* 8 */
+ KeySym (*xStringToKeysym) (_Xconst char *c); /* 9 */
+ Window (*xRootWindow) (Display *d, int i); /* 10 */
+ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */
+ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */
+ void (*xBell) (Display *d, int i); /* 13 */
+ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */
+ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */
+ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */
+ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */
+ void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */
+ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */
+ void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */
+ void (*xDestroyWindow) (Display *d, Window w); /* 21 */
+ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */
+ void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */
+ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */
+ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */
+ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */
+ void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */
+ void (*xFreeColormap) (Display *d, Colormap c); /* 28 */
+ void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */
+ void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */
+ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */
+ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */
+ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */
+ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 34 */
+ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 35 */
+ void (*xMapWindow) (Display *d, Window w); /* 36 */
+ void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 37 */
+ void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 38 */
+ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 39 */
+ void (*xRaiseWindow) (Display *d, Window w); /* 40 */
+ void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 41 */
+ void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 42 */
+ void (*xSelectInput) (Display *d, Window w, long l); /* 43 */
+ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */
+ void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */
+ void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */
+ void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */
+ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */
+ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */
+ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */
+ void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 51 */
+ void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */
+ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */
+ void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */
+ void (*xUngrabPointer) (Display *d, Time t); /* 55 */
+ void (*xUnmapWindow) (Display *d, Window w); /* 56 */
+ 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); /* 57 */
+ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */
+ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */
+ void (*xFreeGC) (Display *display, GC gc); /* 60 */
+ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */
+ void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */
+ void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */
+ void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */
+ void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */
+ void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */
+ void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */
+ void (*xSetFont) (Display *display, GC gc, Font font); /* 68 */
+ void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */
+ void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */
+ void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */
+ void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */
+ void (*xSetFunction) (Display *display, GC gc, int function); /* 73 */
+ void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */
+ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */
+ XIC (*xCreateIC) (void); /* 76 */
+ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */
+ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 78 */
+ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */
+ void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */
+ void (*xForceScreenSaver) (Display *display, int mode); /* 81 */
+ void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */
+ void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */
+ void (*xClearWindow) (Display *d, Window w); /* 84 */
+ void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */
+ void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */
+ 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); /* 87 */
+ void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */
+ void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */
+ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */
+ int (*xSync) (Display *display, Bool flag); /* 91 */
+#endif /* AQUA */
} TkIntXlibStubs;
#ifdef __cplusplus
@@ -1263,7 +1412,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
* Inline function declarations:
*/
-#ifdef __WIN32__
+#ifdef __WIN32__ /* WIN */
#ifndef XSetDashes
#define XSetDashes \
(tkIntXlibStubsPtr->xSetDashes) /* 0 */
@@ -1689,374 +1838,8 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#define XFillRectangle \
(tkIntXlibStubsPtr->xFillRectangle) /* 106 */
#endif
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
-#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
-#endif /* MAC_TCL */
-#ifdef MAC_OSX_TK
+#endif /* WIN */
+#ifdef MAC_OSX_TK /* AQUA */
#ifndef XSetDashes
#define XSetDashes \
(tkIntXlibStubsPtr->xSetDashes) /* 0 */
@@ -2425,7 +2208,7 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
#define XSync \
(tkIntXlibStubsPtr->xSync) /* 91 */
#endif
-#endif /* MAC_OSX_TK */
+#endif /* AQUA */
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 0aa66ff..44421d2 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -1,18 +1,17 @@
-/*
+/*
* tkListbox.c --
*
- * This module implements listbox widgets for the Tk
- * toolkit. A listbox displays a collection of strings,
- * one per line, and provides scrolling and selection.
+ * This module implements listbox widgets for the Tk toolkit. A listbox
+ * displays a collection of strings, one per line, and provides scrolling
+ * and selection.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "default.h"
#include "tkInt.h"
@@ -21,38 +20,40 @@
#endif
typedef struct {
- Tk_OptionTable listboxOptionTable; /* Table defining configuration options
- * available for the listbox */
- Tk_OptionTable itemAttrOptionTable; /* Table definining configuration
- * options available for listbox
- * items */
+ Tk_OptionTable listboxOptionTable;
+ /* Table defining configuration options
+ * available for the listbox. */
+ Tk_OptionTable itemAttrOptionTable;
+ /* Table definining configuration options
+ * available for listbox items. */
} ListboxOptionTables;
/*
- * A data structure of the following type is kept for each listbox
- * widget managed by this file:
+ * A data structure of the following type is kept for each listbox widget
+ * managed by this file:
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the listbox. NULL
+ Tk_Window tkwin; /* Window that embodies the listbox. NULL
* means that the window has been destroyed
* but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Used, among
+ * cleaned up. */
+ Display *display; /* Display containing widget. Used, among
* other things, so that resources can be
* freed even after tkwin has gone away. */
Tcl_Interp *interp; /* Interpreter associated with listbox. */
Tcl_Command widgetCmd; /* Token for listbox's widget command. */
Tk_OptionTable optionTable; /* Table that defines configuration options
* available for this widget. */
- Tk_OptionTable itemAttrOptionTable; /* Table that defines configuration
- * options available for listbox
- * items */
- char *listVarName; /* List variable name */
- Tcl_Obj *listObj; /* Pointer to the list object being used */
- int nElements; /* Holds the current count of elements */
- Tcl_HashTable *selection; /* Tracks selection */
- Tcl_HashTable *itemAttrTable; /* Tracks item attributes */
+ Tk_OptionTable itemAttrOptionTable;
+ /* Table that defines configuration options
+ * available for listbox items. */
+ char *listVarName; /* List variable name */
+ Tcl_Obj *listObj; /* Pointer to the list object being used */
+ int nElements; /* Holds the current count of elements */
+ Tcl_HashTable *selection; /* Tracks selection */
+ Tcl_HashTable *itemAttrTable;
+ /* Tracks item attributes */
/*
* Information used when displaying widget:
@@ -62,18 +63,18 @@ typedef struct {
* window, plus used for background. */
int borderWidth; /* Width of 3-D border around window. */
int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
+ int highlightWidth; /* Width in pixels of highlight to draw around
+ * widget when it has the focus. <= 0 means
+ * don't draw a highlight. */
XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
+ /* Color for drawing traversal highlight area
+ * when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
int inset; /* Total width of all borders, including
* traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
+ * Indicates how much interior stuff must be
+ * offset from outside edges to leave room for
+ * borders. */
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *fgColorPtr; /* Text color in normal mode. */
XColor *dfgColorPtr; /* Text color in disabled mode. */
@@ -85,20 +86,20 @@ typedef struct {
GC selTextGC; /* For drawing selected text. */
int width; /* Desired width of window, in characters. */
int height; /* Desired height of window, in lines. */
- int lineHeight; /* Number of pixels allocated for each line
- * in display. */
+ int lineHeight; /* Number of pixels allocated for each line in
+ * display. */
int topIndex; /* Index of top-most element visible in
* window. */
int fullLines; /* Number of lines that fit are completely
- * visible in window. There may be one
+ * visible in window. There may be one
* additional line at the bottom that is
* partially visible. */
int partialLine; /* 0 means that the window holds exactly
- * fullLines lines. 1 means that there is
- * one additional line that is partially
+ * fullLines lines. 1 means that there is one
+ * additional line that is partially
* visble. */
- int setGrid; /* Non-zero means pass gridding information
- * to window manager. */
+ int setGrid; /* Non-zero means pass gridding information to
+ * window manager. */
/*
* Information to support horizontal scrolling:
@@ -110,26 +111,26 @@ typedef struct {
* horizontal scrolling (window scrolls
* horizontally in increments of this size).
* This is an average character size. */
- int xOffset; /* The left edge of each string in the
- * listbox is offset to the left by this
- * many pixels (0 means no offset, positive
- * means there is an offset). */
+ int xOffset; /* The left edge of each string in the listbox
+ * is offset to the left by this many pixels
+ * (0 means no offset, positive means there is
+ * an offset). */
/*
* Information about what's selected or active, if any.
*/
Tk_Uid selectMode; /* Selection style: single, browse, multiple,
- * or extended. This value isn't used in C
+ * or extended. This value isn't used in C
* code, but the Tcl bindings use it. */
int numSelected; /* Number of elements currently selected. */
- int selectAnchor; /* Fixed end of selection (i.e. element
- * at which selection was started.) */
- int exportSelection; /* Non-zero means tie internal listbox
- * to X selection. */
- int active; /* Index of "active" element (the one that
- * has been selected by keyboard traversal).
- * -1 means none. */
+ int selectAnchor; /* Fixed end of selection (i.e. element at
+ * which selection was started.) */
+ int exportSelection; /* Non-zero means tie internal listbox to X
+ * selection. */
+ int active; /* Index of "active" element (the one that has
+ * been selected by keyboard traversal). -1
+ * means none. */
int activeStyle; /* style in which to draw the active element.
* One of: underline, none, dotbox */
@@ -151,18 +152,18 @@ typedef struct {
*/
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
char *yScrollCmd; /* Command prefix for communicating with
- * vertical scrollbar. NULL means no command
- * to issue. Malloc'ed. */
+ * vertical scrollbar. NULL means no command
+ * to issue. Malloc'ed. */
char *xScrollCmd; /* Command prefix for communicating with
- * horizontal scrollbar. NULL means no command
- * to issue. Malloc'ed. */
+ * horizontal scrollbar. NULL means no command
+ * to issue. Malloc'ed. */
int state; /* Listbox state. */
Pixmap gray; /* Pixmap for displaying disabled text. */
- int flags; /* Various flag bits: see below for
+ int flags; /* Various flag bits: see below for
* definitions. */
} Listbox;
@@ -170,26 +171,26 @@ typedef struct {
* ItemAttr structures are used to store item configuration information for
* the items in a listbox
*/
+
typedef struct {
Tk_3DBorder border; /* Used for drawing background around text */
Tk_3DBorder selBorder; /* Used for selected text */
XColor *fgColor; /* Text color in normal mode. */
XColor *selFgColor; /* Text color in selected mode. */
-} ItemAttr;
+} ItemAttr;
/*
* Flag bits for listboxes:
*
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * UPDATE_V_SCROLLBAR: Non-zero means vertical scrollbar needs
- * to be updated.
- * UPDATE_H_SCROLLBAR: Non-zero means horizontal scrollbar needs
- * to be updated.
- * GOT_FOCUS: Non-zero means this widget currently
- * has the input focus.
- * MAXWIDTH_IS_STALE: Stored maxWidth may be out-of-date
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * already been queued to redraw this window.
+ * UPDATE_V_SCROLLBAR: Non-zero means vertical scrollbar needs to be
+ * updated.
+ * UPDATE_H_SCROLLBAR: Non-zero means horizontal scrollbar needs to
+ * be updated.
+ * GOT_FOCUS: Non-zero means this widget currently has the
+ * input focus.
+ * MAXWIDTH_IS_STALE: Stored maxWidth may be out-of-date
* LISTBOX_DELETED: This listbox has been effectively destroyed.
*/
@@ -201,9 +202,9 @@ typedef struct {
#define LISTBOX_DELETED 32
/*
- * The following enum is used to define a type for the -state option
- * of the Entry widget. These values are used as indices into the
- * string table below.
+ * The following enum is used to define a type for the -state option of the
+ * Listbox widget. These values are used as indices into the string table
+ * below.
*/
enum state {
@@ -211,7 +212,7 @@ enum state {
};
static char *stateStrings[] = {
- "disabled", "normal", (char *) NULL
+ "disabled", "normal", NULL
};
enum activeStyle {
@@ -219,24 +220,25 @@ enum activeStyle {
};
static char *activeStyleStrings[] = {
- "dotbox", "none", "underline", (char *) NULL
+ "dotbox", "none", "underline", NULL
};
/*
* The optionSpecs table defines the valid configuration options for the
- * listbox widget
+ * listbox widget.
*/
-static Tk_OptionSpec optionSpecs[] = {
+
+static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle",
DEF_LISTBOX_ACTIVE_STYLE, -1, Tk_Offset(Listbox, activeStyle),
- 0, (ClientData) activeStyleStrings, 0},
+ 0, (ClientData) activeStyleStrings, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_LISTBOX_BG_COLOR, -1, Tk_Offset(Listbox, normalBorder),
0, (ClientData) DEF_LISTBOX_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_LISTBOX_BORDER_WIDTH, -1, Tk_Offset(Listbox, borderWidth),
0, 0, 0},
@@ -249,8 +251,8 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
"ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, -1,
Tk_Offset(Listbox, exportSelection), 0, 0, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_LISTBOX_FONT, -1, Tk_Offset(Listbox, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
@@ -258,7 +260,7 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_INT, "-height", "height", "Height",
DEF_LISTBOX_HEIGHT, -1, Tk_Offset(Listbox, height), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, -1,
+ "HighlightBackground", DEF_LISTBOX_HIGHLIGHT_BG, -1,
Tk_Offset(Listbox, highlightBgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
DEF_LISTBOX_HIGHLIGHT, -1, Tk_Offset(Listbox, highlightColorPtr),
@@ -283,8 +285,8 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid",
DEF_LISTBOX_SET_GRID, -1, Tk_Offset(Listbox, setGrid), 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
- DEF_LISTBOX_STATE, -1, Tk_Offset(Listbox, state),
- 0, (ClientData) stateStrings, 0},
+ DEF_LISTBOX_STATE, -1, Tk_Offset(Listbox, state),
+ 0, (ClientData) stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_LISTBOX_TAKE_FOCUS, -1, Tk_Offset(Listbox, takeFocus),
TK_OPTION_NULL_OK, 0, 0},
@@ -299,50 +301,48 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_STRING, "-listvariable", "listVariable", "Variable",
DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
* The itemAttrOptionSpecs table defines the valid configuration options for
* listbox items
*/
-static Tk_OptionSpec itemAttrOptionSpecs[] = {
+
+static const Tk_OptionSpec itemAttrOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
- (char *)NULL, -1, Tk_Offset(ItemAttr, border),
+ NULL, -1, Tk_Offset(ItemAttr, border),
TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- (char *) NULL, -1, Tk_Offset(ItemAttr, fgColor),
+ NULL, -1, Tk_Offset(ItemAttr, fgColor),
TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
{TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
- (char *) NULL, -1, Tk_Offset(ItemAttr, selBorder),
+ NULL, -1, Tk_Offset(ItemAttr, selBorder),
TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_SELECT_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
- (char *) NULL, -1, Tk_Offset(ItemAttr, selFgColor),
+ NULL, -1, Tk_Offset(ItemAttr, selFgColor),
TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0}
};
/*
- * The following tables define the listbox widget commands (and sub-
- * commands) and map the indexes into the string tables into
- * enumerated types used to dispatch the listbox widget command.
+ * The following tables define the listbox widget commands (and sub- commands)
+ * and map the indexes into the string tables into enumerated types used to
+ * dispatch the listbox widget command.
*/
-static CONST char *commandNames[] = {
+
+static const char *commandNames[] = {
"activate", "bbox", "cget", "configure", "curselection", "delete", "get",
"index", "insert", "itemcget", "itemconfigure", "nearest", "scan",
- "see", "selection", "size", "xview", "yview",
- (char *) NULL
+ "see", "selection", "size", "xview", "yview", NULL
};
-
enum command {
COMMAND_ACTIVATE, COMMAND_BBOX, COMMAND_CGET, COMMAND_CONFIGURE,
COMMAND_CURSELECTION, COMMAND_DELETE, COMMAND_GET, COMMAND_INDEX,
@@ -351,99 +351,84 @@ enum command {
COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW
};
-static CONST char *selCommandNames[] = {
- "anchor", "clear", "includes", "set", (char *) NULL
+static const char *selCommandNames[] = {
+ "anchor", "clear", "includes", "set", NULL
};
-
enum selcommand {
SELECTION_ANCHOR, SELECTION_CLEAR, SELECTION_INCLUDES, SELECTION_SET
};
-static CONST char *scanCommandNames[] = {
- "mark", "dragto", (char *) NULL
+static const char *scanCommandNames[] = {
+ "mark", "dragto", NULL
};
-
enum scancommand {
SCAN_MARK, SCAN_DRAGTO
};
-static CONST char *indexNames[] = {
- "active", "anchor", "end", (char *)NULL
+static const char *indexNames[] = {
+ "active", "anchor", "end", NULL
};
-
enum indices {
INDEX_ACTIVE, INDEX_ANCHOR, INDEX_END
};
+/*
+ * Declarations for procedures defined later in this file.
+ */
-/* Declarations for procedures defined later in this file */
-static void ChangeListboxOffset _ANSI_ARGS_((Listbox *listPtr,
- int offset));
-static void ChangeListboxView _ANSI_ARGS_((Listbox *listPtr,
- int index));
-static int ConfigureListbox _ANSI_ARGS_((Tcl_Interp *interp,
- Listbox *listPtr, int objc, Tcl_Obj *CONST objv[],
- int flags));
-static int ConfigureListboxItem _ANSI_ARGS_ ((Tcl_Interp *interp,
+static void ChangeListboxOffset(Listbox *listPtr, int offset);
+static void ChangeListboxView(Listbox *listPtr, int index);
+static int ConfigureListbox(Tcl_Interp *interp, Listbox *listPtr,
+ int objc, Tcl_Obj *const objv[], int flags);
+static int ConfigureListboxItem(Tcl_Interp *interp,
Listbox *listPtr, ItemAttr *attrs, int objc,
- Tcl_Obj *CONST objv[], int index));
-static int ListboxDeleteSubCmd _ANSI_ARGS_((Listbox *listPtr,
- int first, int last));
-static void DestroyListbox _ANSI_ARGS_((char *memPtr));
-static void DestroyListboxOptionTables _ANSI_ARGS_ (
- (ClientData clientData, Tcl_Interp *interp));
-static void DisplayListbox _ANSI_ARGS_((ClientData clientData));
-static int GetListboxIndex _ANSI_ARGS_((Tcl_Interp *interp,
- Listbox *listPtr, Tcl_Obj *index, int endIsSize,
- int *indexPtr));
-static int ListboxInsertSubCmd _ANSI_ARGS_((Listbox *listPtr,
- int index, int objc, Tcl_Obj *CONST objv[]));
-static void ListboxCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void ListboxComputeGeometry _ANSI_ARGS_((Listbox *listPtr,
- int fontChanged, int maxIsStale, int updateGrid));
-static void ListboxEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static int ListboxFetchSelection _ANSI_ARGS_((
- ClientData clientData, int offset, char *buffer,
- int maxBytes));
-static void ListboxLostSelection _ANSI_ARGS_((
- ClientData clientData));
-static void EventuallyRedrawRange _ANSI_ARGS_((Listbox *listPtr,
- int first, int last));
-static void ListboxScanTo _ANSI_ARGS_((Listbox *listPtr,
- int x, int y));
-static int ListboxSelect _ANSI_ARGS_((Listbox *listPtr,
- int first, int last, int select));
-static void ListboxUpdateHScrollbar _ANSI_ARGS_(
- (Listbox *listPtr));
-static void ListboxUpdateVScrollbar _ANSI_ARGS_(
- (Listbox *listPtr));
-static int ListboxWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static int ListboxBboxSubCmd _ANSI_ARGS_ ((Tcl_Interp *interp,
- Listbox *listPtr, int index));
-static int ListboxSelectionSubCmd _ANSI_ARGS_ (
- (Tcl_Interp *interp, Listbox *listPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static int ListboxXviewSubCmd _ANSI_ARGS_ ((Tcl_Interp *interp,
- Listbox *listPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static int ListboxYviewSubCmd _ANSI_ARGS_ ((Tcl_Interp *interp,
- Listbox *listPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static ItemAttr * ListboxGetItemAttributes _ANSI_ARGS_ (
- (Tcl_Interp *interp, Listbox *listPtr, int index));
-static void ListboxWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static int NearestListboxElement _ANSI_ARGS_((Listbox *listPtr,
- int y));
-static char * ListboxListVarProc _ANSI_ARGS_ ((ClientData clientData,
- Tcl_Interp *interp, CONST char *name1,
- CONST char *name2, int flags));
-static void MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table,
- int first, int last, int offset));
+ Tcl_Obj *const objv[], int index);
+static int ListboxDeleteSubCmd(Listbox *listPtr,
+ int first, int last);
+static void DestroyListbox(char *memPtr);
+static void DestroyListboxOptionTables(ClientData clientData,
+ Tcl_Interp *interp);
+static void DisplayListbox(ClientData clientData);
+static int GetListboxIndex(Tcl_Interp *interp, Listbox *listPtr,
+ Tcl_Obj *index, int endIsSize, int *indexPtr);
+static int ListboxInsertSubCmd(Listbox *listPtr,
+ int index, int objc, Tcl_Obj *const objv[]);
+static void ListboxCmdDeletedProc(ClientData clientData);
+static void ListboxComputeGeometry(Listbox *listPtr,
+ int fontChanged, int maxIsStale, int updateGrid);
+static void ListboxEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static int ListboxFetchSelection(ClientData clientData,
+ int offset, char *buffer, int maxBytes);
+static void ListboxLostSelection(ClientData clientData);
+static void EventuallyRedrawRange(Listbox *listPtr,
+ int first, int last);
+static void ListboxScanTo(Listbox *listPtr, int x, int y);
+static int ListboxSelect(Listbox *listPtr,
+ int first, int last, int select);
+static void ListboxUpdateHScrollbar(Listbox *listPtr);
+static void ListboxUpdateVScrollbar(Listbox *listPtr);
+static int ListboxWidgetObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *const objv[]);
+static int ListboxBboxSubCmd(Tcl_Interp *interp,
+ Listbox *listPtr, int index);
+static int ListboxSelectionSubCmd(Tcl_Interp *interp,
+ Listbox *listPtr, int objc, Tcl_Obj *const objv[]);
+static int ListboxXviewSubCmd(Tcl_Interp *interp,
+ Listbox *listPtr, int objc, Tcl_Obj *const objv[]);
+static int ListboxYviewSubCmd(Tcl_Interp *interp,
+ Listbox *listPtr, int objc, Tcl_Obj *const objv[]);
+static ItemAttr * ListboxGetItemAttributes(Tcl_Interp *interp,
+ Listbox *listPtr, int index);
+static void ListboxWorldChanged(ClientData instanceData);
+static int NearestListboxElement(Listbox *listPtr, int y);
+static char * ListboxListVarProc(ClientData clientData,
+ Tcl_Interp *interp, const char *name1,
+ const char *name2, int flags);
+static void MigrateHashEntries(Tcl_HashTable *table,
+ int first, int last, int offset);
+
/*
* The structure below defines button class behavior by means of procedures
* that can be invoked from generic window code.
@@ -452,17 +437,17 @@ static void MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table,
static Tk_ClassProcs listboxClass = {
sizeof(Tk_ClassProcs), /* size */
ListboxWorldChanged, /* worldChangedProc */
+ NULL, /* createProc */
+ NULL /* modalProc */
};
-
/*
*--------------------------------------------------------------
*
* Tk_ListboxObjCmd --
*
- * This procedure is invoked to process the "listbox" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This procedure is invoked to process the "listbox" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -474,11 +459,11 @@ static Tk_ClassProcs listboxClass = {
*/
int
-Tk_ListboxObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_ListboxObjCmd(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
register Listbox *listPtr;
Tk_Window tkwin;
@@ -490,7 +475,7 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
}
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -499,56 +484,64 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
Tcl_GetAssocData(interp, "ListboxOptionTables", NULL);
if (optionTables == NULL) {
/*
- * We haven't created the option tables for this widget class yet.
- * Do it now and save the a pointer to them as the ClientData for
- * the command, so future invocations will have access to it.
+ * We haven't created the option tables for this widget class yet. Do
+ * it now and save the a pointer to them as the ClientData for the
+ * command, so future invocations will have access to it.
*/
optionTables = (ListboxOptionTables *)
- ckalloc(sizeof(ListboxOptionTables));
- /* Set up an exit handler to free the optionTables struct */
+ ckalloc(sizeof(ListboxOptionTables));
+
+ /*
+ * Set up an exit handler to free the optionTables struct.
+ */
+
Tcl_SetAssocData(interp, "ListboxOptionTables",
DestroyListboxOptionTables, (ClientData) optionTables);
- /* Create the listbox option table and the listbox item option table */
+ /*
+ * Create the listbox option table and the listbox item option table.
+ */
+
optionTables->listboxOptionTable =
- Tk_CreateOptionTable(interp, optionSpecs);
+ Tk_CreateOptionTable(interp, optionSpecs);
optionTables->itemAttrOptionTable =
- Tk_CreateOptionTable(interp, itemAttrOptionSpecs);
+ Tk_CreateOptionTable(interp, itemAttrOptionSpecs);
}
/*
- * Initialize the fields of the structure that won't be initialized
- * by ConfigureListbox, or that ConfigureListbox requires to be
- * initialized already (e.g. resource pointers).
+ * Initialize the fields of the structure that won't be initialized by
+ * ConfigureListbox, or that ConfigureListbox requires to be initialized
+ * already (e.g. resource pointers).
*/
- listPtr = (Listbox *) ckalloc(sizeof(Listbox));
- memset((void *) listPtr, 0, (sizeof(Listbox)));
- listPtr->tkwin = tkwin;
- listPtr->display = Tk_Display(tkwin);
- listPtr->interp = interp;
- listPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ listPtr = (Listbox *) 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);
- listPtr->optionTable = optionTables->listboxOptionTable;
- listPtr->itemAttrOptionTable = optionTables->itemAttrOptionTable;
- listPtr->selection =
- (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
+ listPtr->optionTable = optionTables->listboxOptionTable;
+ listPtr->itemAttrOptionTable = optionTables->itemAttrOptionTable;
+ listPtr->selection = (Tcl_HashTable *)
+ ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->selection, TCL_ONE_WORD_KEYS);
- listPtr->itemAttrTable =
- (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
+ listPtr->itemAttrTable = (Tcl_HashTable *)
+ ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->itemAttrTable, TCL_ONE_WORD_KEYS);
- listPtr->relief = TK_RELIEF_RAISED;
- listPtr->textGC = None;
- listPtr->selFgColorPtr = None;
- listPtr->selTextGC = None;
- listPtr->fullLines = 1;
- listPtr->xScrollUnit = 1;
- listPtr->exportSelection = 1;
- listPtr->cursor = None;
- listPtr->state = STATE_NORMAL;
- listPtr->gray = None;
+ listPtr->relief = TK_RELIEF_RAISED;
+ listPtr->textGC = None;
+ listPtr->selFgColorPtr = None;
+ listPtr->selTextGC = None;
+ listPtr->fullLines = 1;
+ listPtr->xScrollUnit = 1;
+ listPtr->exportSelection = 1;
+ listPtr->cursor = None;
+ listPtr->state = STATE_NORMAL;
+ listPtr->gray = None;
/*
* Keep a hold of the associated tkwin until we destroy the listbox,
@@ -585,8 +578,8 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
* ListboxWidgetObjCmd --
*
* This Tcl_Obj based procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module. See the user
- * documentation for details on what it does.
+ * that corresponds to a widget managed by this module. See the user
+ * documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -598,25 +591,26 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
*/
static int
-ListboxWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about listbox widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Arguments as Tcl_Obj's. */
+ListboxWidgetObjCmd(
+ ClientData clientData, /* Information about listbox widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const objv[]) /* Arguments as Tcl_Obj's. */
{
register Listbox *listPtr = (Listbox *) clientData;
int cmdIndex, index;
int result = TCL_OK;
-
+
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
return TCL_ERROR;
}
/*
- * Parse the command by looking up the second argument in the list
- * of valid subcommand names
+ * Parse the command by looking up the second argument in the list of
+ * valid subcommand names
*/
+
result = Tcl_GetIndexFromObj(interp, objv[1], commandNames,
"option", 0, &cmdIndex);
if (result != TCL_OK) {
@@ -624,448 +618,436 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
}
Tcl_Preserve((ClientData)listPtr);
- /* The subcommand was valid, so continue processing */
- switch (cmdIndex) {
- case COMMAND_ACTIVATE: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
- result = TCL_ERROR;
- break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
- if (result != TCL_OK) {
- break;
- }
- if (!(listPtr->state & STATE_NORMAL)) {
- break;
- }
+ /*
+ * The subcommand was valid, so continue processing.
+ */
- if (index >= listPtr->nElements) {
- index = listPtr->nElements-1;
- }
- if (index < 0) {
- index = 0;
- }
- listPtr->active = index;
- EventuallyRedrawRange(listPtr, listPtr->active, listPtr->active);
- result = TCL_OK;
+ switch (cmdIndex) {
+ case COMMAND_ACTIVATE:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ result = TCL_ERROR;
+ break;
+ }
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
+ if (result != TCL_OK) {
break;
}
- case COMMAND_BBOX: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
- result = TCL_ERROR;
- break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
- if (result != TCL_OK) {
- break;
- }
-
- result = ListboxBboxSubCmd(interp, listPtr, index);
+ if (!(listPtr->state & STATE_NORMAL)) {
break;
}
- case COMMAND_CGET: {
- Tcl_Obj *objPtr;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option");
- result = TCL_ERROR;
- break;
- }
+ if (index >= listPtr->nElements) {
+ index = listPtr->nElements-1;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ listPtr->active = index;
+ EventuallyRedrawRange(listPtr, listPtr->active, listPtr->active);
+ result = TCL_OK;
+ break;
- objPtr = Tk_GetOptionValue(interp, (char *)listPtr,
- listPtr->optionTable, objv[2], listPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- break;
- }
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
+ case COMMAND_BBOX:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ result = TCL_ERROR;
break;
}
-
- case COMMAND_CONFIGURE: {
- Tcl_Obj *objPtr;
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) listPtr,
- listPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- listPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- break;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- } else {
- result = ConfigureListbox(interp, listPtr, objc-2, objv+2, 0);
- }
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
+ if (result != TCL_OK) {
break;
}
- case COMMAND_CURSELECTION: {
- char indexStringRep[TCL_INTEGER_SPACE];
- int i;
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- result = TCL_ERROR;
- break;
- }
- /*
- * Of course, it would be more efficient to use the Tcl_HashTable
- * search functions (Tcl_FirstHashEntry, Tcl_NextHashEntry), but
- * then the result wouldn't be in sorted order. So instead we
- * loop through the indices in order, adding them to the result
- * if they are selected
- */
- for (i = 0; i < listPtr->nElements; i++) {
- if (Tcl_FindHashEntry(listPtr->selection, (char *)i) != NULL) {
- sprintf(indexStringRep, "%d", i);
- Tcl_AppendElement(interp, indexStringRep);
- }
- }
- result = TCL_OK;
+ result = ListboxBboxSubCmd(interp, listPtr, index);
+ break;
+
+ case COMMAND_CGET: {
+ Tcl_Obj *objPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ result = TCL_ERROR;
break;
}
-
- case COMMAND_DELETE: {
- int first, last;
- if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "firstIndex ?lastIndex?");
- result = TCL_ERROR;
- break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &first);
- if (result != TCL_OK) {
- break;
- }
+ objPtr = Tk_GetOptionValue(interp, (char *) listPtr,
+ listPtr->optionTable, objv[2], listPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ break;
+ }
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
+ break;
+ }
- if (!(listPtr->state & STATE_NORMAL)) {
- break;
- }
+ case COMMAND_CONFIGURE: {
+ Tcl_Obj *objPtr;
- if (first < listPtr->nElements) {
- /*
- * if a "last index" was given, get it now; otherwise, use the
- * first index as the last index
- */
- if (objc == 4) {
- result = GetListboxIndex(interp, listPtr,
- objv[3], 0, &last);
- if (result != TCL_OK) {
- break;
- }
- } else {
- last = first;
- }
- if (last >= listPtr->nElements) {
- last = listPtr->nElements - 1;
- }
- result = ListboxDeleteSubCmd(listPtr, first, last);
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) listPtr,
+ listPtr->optionTable,
+ (objc == 3) ? objv[2] : NULL, listPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ break;
} else {
+ Tcl_SetObjResult(interp, objPtr);
result = TCL_OK;
}
+ } else {
+ result = ConfigureListbox(interp, listPtr, objc-2, objv+2, 0);
+ }
+ break;
+ }
+
+ case COMMAND_CURSELECTION: {
+ char indexStringRep[TCL_INTEGER_SPACE];
+ int i;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ result = TCL_ERROR;
break;
}
- case COMMAND_GET: {
- int first, last;
- Tcl_Obj **elemPtrs;
- int listLen;
- if (objc != 3 && objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
- result = TCL_ERROR;
- break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &first);
- if (result != TCL_OK) {
- break;
+ /*
+ * Of course, it would be more efficient to use the Tcl_HashTable
+ * search functions (Tcl_FirstHashEntry, Tcl_NextHashEntry), but then
+ * the result wouldn't be in sorted order. So instead we loop through
+ * the indices in order, adding them to the result if they are
+ * selected.
+ */
+
+ for (i = 0; i < listPtr->nElements; i++) {
+ if (Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i))) {
+ sprintf(indexStringRep, "%d", i);
+ Tcl_AppendElement(interp, indexStringRep);
}
- last = first;
+ }
+ result = TCL_OK;
+ break;
+ }
+
+ case COMMAND_DELETE: {
+ int first, last;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ result = TCL_ERROR;
+ break;
+ }
+
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &first);
+ if (result != TCL_OK) {
+ break;
+ }
+
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
+
+ if (first < listPtr->nElements) {
+ /*
+ * if a "last index" was given, get it now; otherwise, use the
+ * first index as the last index.
+ */
+
if (objc == 4) {
result = GetListboxIndex(interp, listPtr, objv[3], 0, &last);
if (result != TCL_OK) {
break;
}
- }
- if (first >= listPtr->nElements) {
- result = TCL_OK;
- break;
+ } else {
+ last = first;
}
if (last >= listPtr->nElements) {
last = listPtr->nElements - 1;
}
- if (first < 0) {
- first = 0;
- }
- if (first > last) {
- result = TCL_OK;
- break;
- }
- result = Tcl_ListObjGetElements(interp, listPtr->listObj, &listLen,
- &elemPtrs);
- if (result != TCL_OK) {
- break;
- }
- if (objc == 3) {
- /*
- * One element request - we return a string
- */
- Tcl_SetObjResult(interp, elemPtrs[first]);
- } else {
- Tcl_SetListObj(Tcl_GetObjResult(interp), (last - first + 1),
- &(elemPtrs[first]));
- }
+ result = ListboxDeleteSubCmd(listPtr, first, last);
+ } else {
result = TCL_OK;
- break;
}
+ break;
+ }
- case COMMAND_INDEX:{
- char buf[TCL_INTEGER_SPACE];
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
- result = TCL_ERROR;
- break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 1, &index);
+ case COMMAND_GET: {
+ int first, last, listLen;
+ Tcl_Obj **elemPtrs;
+
+ if (objc != 3 && objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ result = TCL_ERROR;
+ break;
+ }
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &first);
+ if (result != TCL_OK) {
+ break;
+ }
+ last = first;
+ if (objc == 4) {
+ result = GetListboxIndex(interp, listPtr, objv[3], 0, &last);
if (result != TCL_OK) {
break;
}
- sprintf(buf, "%d", index);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ if (first >= listPtr->nElements) {
+ result = TCL_OK;
+ break;
+ }
+ if (last >= listPtr->nElements) {
+ last = listPtr->nElements - 1;
+ }
+ if (first < 0) {
+ first = 0;
+ }
+ if (first > last) {
result = TCL_OK;
break;
}
+ result = Tcl_ListObjGetElements(interp, listPtr->listObj, &listLen,
+ &elemPtrs);
+ if (result != TCL_OK) {
+ break;
+ }
+ if (objc == 3) {
+ /*
+ * One element request - we return a string
+ */
- case COMMAND_INSERT: {
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "index ?element element ...?");
- result = TCL_ERROR;
- break;
- }
+ Tcl_SetObjResult(interp, elemPtrs[first]);
+ } else {
+ Tcl_SetListObj(Tcl_GetObjResult(interp), (last - first + 1),
+ &(elemPtrs[first]));
+ }
+ result = TCL_OK;
+ break;
+ }
- result = GetListboxIndex(interp, listPtr, objv[2], 1, &index);
- if (result != TCL_OK) {
- break;
- }
+ case COMMAND_INDEX:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ result = TCL_ERROR;
+ break;
+ }
+ result = GetListboxIndex(interp, listPtr, objv[2], 1, &index);
+ if (result != TCL_OK) {
+ break;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
+ result = TCL_OK;
+ break;
- if (!(listPtr->state & STATE_NORMAL)) {
- break;
- }
+ case COMMAND_INSERT:
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index ?element element ...?");
+ result = TCL_ERROR;
+ break;
+ }
- result = ListboxInsertSubCmd(listPtr, index, objc-3, objv+3);
+ result = GetListboxIndex(interp, listPtr, objv[2], 1, &index);
+ if (result != TCL_OK) {
break;
}
- case COMMAND_ITEMCGET: {
- Tcl_Obj *objPtr;
- ItemAttr *attrPtr;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 2, objv, "index option");
- result = TCL_ERROR;
- break;
- }
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
- if (result != TCL_OK) {
- break;
- }
+ result = ListboxInsertSubCmd(listPtr, index, objc-3, objv+3);
+ break;
- if (index < 0 || index >= listPtr->nElements) {
- Tcl_AppendResult(interp, "item number \"",
- Tcl_GetString(objv[2]), "\" out of range",
- (char *)NULL);
- result = TCL_ERROR;
- break;
- }
-
- attrPtr = ListboxGetItemAttributes(interp, listPtr, index);
+ case COMMAND_ITEMCGET: {
+ Tcl_Obj *objPtr;
+ ItemAttr *attrPtr;
- objPtr = Tk_GetOptionValue(interp, (char *)attrPtr,
- listPtr->itemAttrOptionTable, objv[3], listPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- break;
- }
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index option");
+ result = TCL_ERROR;
break;
}
- case COMMAND_ITEMCONFIGURE: {
- Tcl_Obj *objPtr;
- ItemAttr *attrPtr;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "index ?option? ?value? ?option value ...?");
- result = TCL_ERROR;
- break;
- }
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
+ if (result != TCL_OK) {
+ break;
+ }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
- if (result != TCL_OK) {
- break;
- }
-
- if (index < 0 || index >= listPtr->nElements) {
- Tcl_AppendResult(interp, "item number \"",
- Tcl_GetString(objv[2]), "\" out of range",
- (char *)NULL);
- result = TCL_ERROR;
- break;
- }
-
- attrPtr = ListboxGetItemAttributes(interp, listPtr, index);
- if (objc <= 4) {
- objPtr = Tk_GetOptionInfo(interp, (char *)attrPtr,
- listPtr->itemAttrOptionTable,
- (objc == 4) ? objv[3] : (Tcl_Obj *) NULL,
- listPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- break;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
- } else {
- result = ConfigureListboxItem(interp, listPtr, attrPtr,
- objc-3, objv+3, index);
- }
+ if (index < 0 || index >= listPtr->nElements) {
+ Tcl_AppendResult(interp, "item number \"",
+ Tcl_GetString(objv[2]), "\" out of range", NULL);
+ result = TCL_ERROR;
break;
}
-
- case COMMAND_NEAREST: {
- char buf[TCL_INTEGER_SPACE];
- int y;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "y");
- result = TCL_ERROR;
- break;
- }
-
- result = Tcl_GetIntFromObj(interp, objv[2], &y);
- if (result != TCL_OK) {
- break;
- }
- index = NearestListboxElement(listPtr, y);
- sprintf(buf, "%d", index);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- result = TCL_OK;
+
+ attrPtr = ListboxGetItemAttributes(interp, listPtr, index);
+
+ objPtr = Tk_GetOptionValue(interp, (char *) attrPtr,
+ listPtr->itemAttrOptionTable, objv[3], listPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
break;
}
-
- case COMMAND_SCAN: {
- int x, y, scanCmdIndex;
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
+ break;
+ }
- if (objc != 5) {
- Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x y");
- result = TCL_ERROR;
- break;
- }
+ case COMMAND_ITEMCONFIGURE: {
+ Tcl_Obj *objPtr;
+ ItemAttr *attrPtr;
- if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK
- || Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) {
- result = TCL_ERROR;
- break;
- }
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "index ?option? ?value? ?option value ...?");
+ result = TCL_ERROR;
+ break;
+ }
- result = Tcl_GetIndexFromObj(interp, objv[2], scanCommandNames,
- "option", 0, &scanCmdIndex);
- if (result != TCL_OK) {
- break;
- }
- switch (scanCmdIndex) {
- case SCAN_MARK: {
- listPtr->scanMarkX = x;
- listPtr->scanMarkY = y;
- listPtr->scanMarkXOffset = listPtr->xOffset;
- listPtr->scanMarkYIndex = listPtr->topIndex;
- break;
- }
- case SCAN_DRAGTO: {
- ListboxScanTo(listPtr, x, y);
- break;
- }
- }
- result = TCL_OK;
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
+ if (result != TCL_OK) {
+ break;
+ }
+
+ if (index < 0 || index >= listPtr->nElements) {
+ Tcl_AppendResult(interp, "item number \"", Tcl_GetString(objv[2]),
+ "\" out of range", NULL);
+ result = TCL_ERROR;
break;
}
- case COMMAND_SEE: {
- int diff;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "index");
+ attrPtr = ListboxGetItemAttributes(interp, listPtr, index);
+ if (objc <= 4) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) attrPtr,
+ listPtr->itemAttrOptionTable,
+ (objc == 4) ? objv[3] : NULL, listPtr->tkwin);
+ if (objPtr == NULL) {
result = TCL_ERROR;
break;
- }
- result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
- if (result != TCL_OK) {
- break;
- }
- if (index >= listPtr->nElements) {
- index = listPtr->nElements - 1;
- }
- if (index < 0) {
- index = 0;
- }
- diff = listPtr->topIndex - index;
- if (diff > 0) {
- if (diff <= (listPtr->fullLines/3)) {
- ChangeListboxView(listPtr, index);
- } else {
- ChangeListboxView(listPtr,
- index - (listPtr->fullLines-1)/2);
- }
} else {
- diff = index - (listPtr->topIndex + listPtr->fullLines - 1);
- if (diff > 0) {
- if (diff <= (listPtr->fullLines/3)) {
- ChangeListboxView(listPtr, listPtr->topIndex + diff);
- } else {
- ChangeListboxView(listPtr,
- index - (listPtr->fullLines-1)/2);
- }
- }
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
}
- result = TCL_OK;
+ } else {
+ result = ConfigureListboxItem(interp, listPtr, attrPtr,
+ objc-3, objv+3, index);
+ }
+ break;
+ }
+
+ case COMMAND_NEAREST: {
+ int y;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "y");
+ result = TCL_ERROR;
break;
}
- case COMMAND_SELECTION: {
- result = ListboxSelectionSubCmd(interp, listPtr, objc, objv);
+ result = Tcl_GetIntFromObj(interp, objv[2], &y);
+ if (result != TCL_OK) {
break;
}
+ index = NearestListboxElement(listPtr, y);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
+ result = TCL_OK;
+ break;
+ }
- case COMMAND_SIZE: {
- char buf[TCL_INTEGER_SPACE];
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 2, objv, NULL);
- result = TCL_ERROR;
- break;
- }
- sprintf(buf, "%d", listPtr->nElements);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- result = TCL_OK;
+ case COMMAND_SCAN: {
+ int x, y, scanCmdIndex;
+
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x y");
+ result = TCL_ERROR;
+ break;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK
+ || Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) {
+ result = TCL_ERROR;
+ break;
+ }
+
+ result = Tcl_GetIndexFromObj(interp, objv[2], scanCommandNames,
+ "option", 0, &scanCmdIndex);
+ if (result != TCL_OK) {
break;
}
+ switch (scanCmdIndex) {
+ case SCAN_MARK:
+ listPtr->scanMarkX = x;
+ listPtr->scanMarkY = y;
+ listPtr->scanMarkXOffset = listPtr->xOffset;
+ listPtr->scanMarkYIndex = listPtr->topIndex;
+ break;
+ case SCAN_DRAGTO:
+ ListboxScanTo(listPtr, x, y);
+ break;
+ }
+ result = TCL_OK;
+ break;
+ }
- case COMMAND_XVIEW: {
- result = ListboxXviewSubCmd(interp, listPtr, objc, objv);
+ case COMMAND_SEE: {
+ int diff;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ result = TCL_ERROR;
+ break;
+ }
+ result = GetListboxIndex(interp, listPtr, objv[2], 0, &index);
+ if (result != TCL_OK) {
break;
}
-
- case COMMAND_YVIEW: {
- result = ListboxYviewSubCmd(interp, listPtr, objc, objv);
+ if (index >= listPtr->nElements) {
+ index = listPtr->nElements - 1;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ diff = listPtr->topIndex - index;
+ if (diff > 0) {
+ if (diff <= (listPtr->fullLines/3)) {
+ ChangeListboxView(listPtr, index);
+ } else {
+ ChangeListboxView(listPtr, index - (listPtr->fullLines-1)/2);
+ }
+ } else {
+ diff = index - (listPtr->topIndex + listPtr->fullLines - 1);
+ if (diff > 0) {
+ if (diff <= (listPtr->fullLines/3)) {
+ ChangeListboxView(listPtr, listPtr->topIndex + diff);
+ } else {
+ ChangeListboxView(listPtr, index-(listPtr->fullLines-1)/2);
+ }
+ }
+ }
+ result = TCL_OK;
+ break;
+ }
+
+ case COMMAND_SELECTION:
+ result = ListboxSelectionSubCmd(interp, listPtr, objc, objv);
+ break;
+ case COMMAND_SIZE:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ result = TCL_ERROR;
break;
}
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(listPtr->nElements));
+ result = TCL_OK;
+ break;
+ case COMMAND_XVIEW:
+ result = ListboxXviewSubCmd(interp, listPtr, objc, objv);
+ break;
+ case COMMAND_YVIEW:
+ result = ListboxYviewSubCmd(interp, listPtr, objc, objv);
+ break;
}
Tcl_Release((ClientData)listPtr);
return result;
@@ -1076,34 +1058,41 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
*
* ListboxBboxSubCmd --
*
- * This procedure is invoked to process a listbox bbox request.
- * See the user documentation for more information.
+ * This procedure is invoked to process a listbox bbox request. See the
+ * user documentation for more information.
*
* Results:
* A standard Tcl result.
*
* Side effects:
- * For valid indices, places the bbox of the requested element in
- * the interpreter's result.
+ * For valid indices, places the bbox of the requested element in the
+ * interpreter's result.
*
*----------------------------------------------------------------------
*/
static int
-ListboxBboxSubCmd(interp, listPtr, index)
- Tcl_Interp *interp; /* Pointer to the calling Tcl interpreter */
- Listbox *listPtr; /* Information about the listbox */
- int index; /* Index of the element to get bbox info on */
+ListboxBboxSubCmd(
+ Tcl_Interp *interp, /* Pointer to the calling Tcl interpreter */
+ Listbox *listPtr, /* Information about the listbox */
+ int index) /* Index of the element to get bbox info on */
{
int lastVisibleIndex;
- /* Determine the index of the last visible item in the listbox */
+
+ /*
+ * Determine the index of the last visible item in the listbox.
+ */
+
lastVisibleIndex = listPtr->topIndex + listPtr->fullLines
- + listPtr->partialLine;
+ + listPtr->partialLine;
if (listPtr->nElements < lastVisibleIndex) {
lastVisibleIndex = listPtr->nElements;
}
- /* Only allow bbox requests for indices that are visible */
+ /*
+ * Only allow bbox requests for indices that are visible.
+ */
+
if ((listPtr->topIndex <= index) && (index < lastVisibleIndex)) {
char buf[TCL_INTEGER_SPACE * 4];
Tcl_Obj *el;
@@ -1111,7 +1100,10 @@ ListboxBboxSubCmd(interp, listPtr, index)
int pixelWidth, stringLen, x, y, result;
Tk_FontMetrics fm;
- /* Compute the pixel width of the requested element */
+ /*
+ * Compute the pixel width of the requested element.
+ */
+
result = Tcl_ListObjIndex(interp, listPtr->listObj, index, &el);
if (result != TCL_OK) {
return result;
@@ -1123,7 +1115,7 @@ ListboxBboxSubCmd(interp, listPtr, index)
x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
y = ((index - listPtr->topIndex)*listPtr->lineHeight)
- + listPtr->inset + listPtr->selBorderWidth;
+ + listPtr->inset + listPtr->selBorderWidth;
sprintf(buf, "%d %d %d %d", x, y, pixelWidth, fm.linespace);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
@@ -1135,8 +1127,8 @@ ListboxBboxSubCmd(interp, listPtr, index)
*
* ListboxSelectionSubCmd --
*
- * This procedure is invoked to process the selection sub command
- * for listbox widgets.
+ * This procedure is invoked to process the selection sub command for
+ * listbox widgets.
*
* Results:
* Standard Tcl result.
@@ -1148,14 +1140,15 @@ ListboxBboxSubCmd(interp, listPtr, index)
*/
static int
-ListboxSelectionSubCmd(interp, listPtr, objc, objv)
- Tcl_Interp *interp; /* Pointer to the calling Tcl interpreter */
- Listbox *listPtr; /* Information about the listbox */
- int objc; /* Number of arguments in the objv array */
- Tcl_Obj *CONST objv[]; /* Array of arguments to the procedure */
+ListboxSelectionSubCmd(
+ Tcl_Interp *interp, /* Pointer to the calling Tcl interpreter */
+ Listbox *listPtr, /* Information about the listbox */
+ int objc, /* Number of arguments in the objv array */
+ Tcl_Obj *const objv[]) /* Array of arguments to the procedure */
{
int selCmdIndex, first, last;
int result = TCL_OK;
+
if (objc != 4 && objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "option index ?index?");
return TCL_ERROR;
@@ -1187,40 +1180,36 @@ ListboxSelectionSubCmd(interp, listPtr, objc, objv)
}
switch (selCmdIndex) {
- case SELECTION_ANCHOR: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- return TCL_ERROR;
- }
- if (first >= listPtr->nElements) {
- first = listPtr->nElements - 1;
- }
- if (first < 0) {
- first = 0;
- }
- listPtr->selectAnchor = first;
- result = TCL_OK;
- break;
+ case SELECTION_ANCHOR:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ return TCL_ERROR;
}
- case SELECTION_CLEAR: {
- result = ListboxSelect(listPtr, first, last, 0);
- break;
+ if (first >= listPtr->nElements) {
+ first = listPtr->nElements - 1;
}
- case SELECTION_INCLUDES: {
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 3, objv, "index");
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj((Tcl_FindHashEntry(listPtr->selection,
- (char *)first) != NULL)));
- result = TCL_OK;
- break;
+ if (first < 0) {
+ first = 0;
}
- case SELECTION_SET: {
- result = ListboxSelect(listPtr, first, last, 1);
- break;
+ listPtr->selectAnchor = first;
+ result = TCL_OK;
+ break;
+ case SELECTION_CLEAR:
+ result = ListboxSelect(listPtr, first, last, 0);
+ break;
+ case SELECTION_INCLUDES:
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ return TCL_ERROR;
}
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj((Tcl_FindHashEntry(listPtr->selection,
+ (char *) INT2PTR(first)) != NULL)));
+ result = TCL_OK;
+ break;
+ case SELECTION_SET:
+ result = ListboxSelect(listPtr, first, last, 1);
+ break;
}
return result;
}
@@ -1242,33 +1231,35 @@ ListboxSelectionSubCmd(interp, listPtr, objc, objv)
*/
static int
-ListboxXviewSubCmd(interp, listPtr, objc, objv)
- Tcl_Interp *interp; /* Pointer to the calling Tcl interpreter */
- Listbox *listPtr; /* Information about the listbox */
- int objc; /* Number of arguments in the objv array */
- Tcl_Obj *CONST objv[]; /* Array of arguments to the procedure */
+ListboxXviewSubCmd(
+ Tcl_Interp *interp, /* Pointer to the calling Tcl interpreter */
+ Listbox *listPtr, /* Information about the listbox */
+ int objc, /* Number of arguments in the objv array */
+ Tcl_Obj *const objv[]) /* Array of arguments to the procedure */
{
int index, count, type, windowWidth, windowUnits;
int offset = 0; /* Initialized to stop gcc warnings. */
double fraction, fraction2;
-
+
windowWidth = Tk_Width(listPtr->tkwin)
- - 2*(listPtr->inset + listPtr->selBorderWidth);
+ - 2*(listPtr->inset + listPtr->selBorderWidth);
if (objc == 2) {
if (listPtr->maxWidth == 0) {
- Tcl_SetResult(interp, "0 1", TCL_STATIC);
+ Tcl_SetResult(interp, "0.0 1.0", TCL_STATIC);
} else {
- char buf[TCL_DOUBLE_SPACE * 2];
-
+ char buf[TCL_DOUBLE_SPACE];
+
fraction = listPtr->xOffset/((double) listPtr->maxWidth);
fraction2 = (listPtr->xOffset + windowWidth)
- /((double) listPtr->maxWidth);
+ / ((double) listPtr->maxWidth);
if (fraction2 > 1.0) {
fraction2 = 1.0;
}
- sprintf(buf, "%g %g", fraction, fraction2);
+ Tcl_PrintDouble(NULL, fraction, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, fraction2, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
}
} else if (objc == 3) {
if (Tcl_GetIntFromObj(interp, objv[2], &index) != TCL_OK) {
@@ -1278,23 +1269,23 @@ ListboxXviewSubCmd(interp, listPtr, objc, objv)
} else {
type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count);
switch (type) {
- case TK_SCROLL_ERROR:
- return TCL_ERROR;
- case TK_SCROLL_MOVETO:
- offset = (int) (fraction*listPtr->maxWidth + 0.5);
- break;
- case TK_SCROLL_PAGES:
- windowUnits = windowWidth/listPtr->xScrollUnit;
- if (windowUnits > 2) {
- offset = listPtr->xOffset
+ case TK_SCROLL_ERROR:
+ return TCL_ERROR;
+ case TK_SCROLL_MOVETO:
+ offset = (int) (fraction*listPtr->maxWidth + 0.5);
+ break;
+ case TK_SCROLL_PAGES:
+ windowUnits = windowWidth/listPtr->xScrollUnit;
+ if (windowUnits > 2) {
+ offset = listPtr->xOffset
+ count*listPtr->xScrollUnit*(windowUnits-2);
- } else {
- offset = listPtr->xOffset + count*listPtr->xScrollUnit;
- }
- break;
- case TK_SCROLL_UNITS:
+ } else {
offset = listPtr->xOffset + count*listPtr->xScrollUnit;
- break;
+ }
+ break;
+ case TK_SCROLL_UNITS:
+ offset = listPtr->xOffset + count*listPtr->xScrollUnit;
+ break;
}
ChangeListboxOffset(listPtr, offset);
}
@@ -1318,29 +1309,31 @@ ListboxXviewSubCmd(interp, listPtr, objc, objv)
*/
static int
-ListboxYviewSubCmd(interp, listPtr, objc, objv)
- Tcl_Interp *interp; /* Pointer to the calling Tcl interpreter */
- Listbox *listPtr; /* Information about the listbox */
- int objc; /* Number of arguments in the objv array */
- Tcl_Obj *CONST objv[]; /* Array of arguments to the procedure */
+ListboxYviewSubCmd(
+ Tcl_Interp *interp, /* Pointer to the calling Tcl interpreter */
+ Listbox *listPtr, /* Information about the listbox */
+ int objc, /* Number of arguments in the objv array */
+ Tcl_Obj *const objv[]) /* Array of arguments to the procedure */
{
int index, count, type;
double fraction, fraction2;
-
+
if (objc == 2) {
if (listPtr->nElements == 0) {
- Tcl_SetResult(interp, "0 1", TCL_STATIC);
+ Tcl_SetResult(interp, "0.0 1.0", TCL_STATIC);
} else {
- char buf[TCL_DOUBLE_SPACE * 2];
-
+ char buf[TCL_DOUBLE_SPACE];
+
fraction = listPtr->topIndex/((double) listPtr->nElements);
fraction2 = (listPtr->topIndex+listPtr->fullLines)
- /((double) listPtr->nElements);
+ /((double) listPtr->nElements);
if (fraction2 > 1.0) {
fraction2 = 1.0;
}
- sprintf(buf, "%g %g", fraction, fraction2);
+ Tcl_PrintDouble(NULL, fraction, buf);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_PrintDouble(NULL, fraction2, buf);
+ Tcl_AppendResult(interp, " ", buf, NULL);
}
} else if (objc == 3) {
if (GetListboxIndex(interp, listPtr, objv[2], 0, &index) != TCL_OK) {
@@ -1350,22 +1343,22 @@ ListboxYviewSubCmd(interp, listPtr, objc, objv)
} else {
type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count);
switch (type) {
- case TK_SCROLL_ERROR:
- return TCL_ERROR;
- case TK_SCROLL_MOVETO:
- index = (int) (listPtr->nElements*fraction + 0.5);
- break;
- case TK_SCROLL_PAGES:
- if (listPtr->fullLines > 2) {
- index = listPtr->topIndex
- + count*(listPtr->fullLines-2);
- } else {
- index = listPtr->topIndex + count;
- }
- break;
- case TK_SCROLL_UNITS:
+ case TK_SCROLL_MOVETO:
+ index = (int) (listPtr->nElements*fraction + 0.5);
+ break;
+ case TK_SCROLL_PAGES:
+ if (listPtr->fullLines > 2) {
+ index = listPtr->topIndex + count*(listPtr->fullLines-2);
+ } else {
index = listPtr->topIndex + count;
- break;
+ }
+ break;
+ case TK_SCROLL_UNITS:
+ index = listPtr->topIndex + count;
+ break;
+ case TK_SCROLL_ERROR:
+ default:
+ return TCL_ERROR;
}
ChangeListboxView(listPtr, index);
}
@@ -1377,8 +1370,8 @@ ListboxYviewSubCmd(interp, listPtr, objc, objv)
*
* ListboxGetItemAttributes --
*
- * Returns a pointer to the ItemAttr record for a given index,
- * creating one if it does not already exist.
+ * Returns a pointer to the ItemAttr record for a given index, creating
+ * one if it does not already exist.
*
* Results:
* Pointer to an ItemAttr record.
@@ -1390,18 +1383,19 @@ ListboxYviewSubCmd(interp, listPtr, objc, objv)
*/
static ItemAttr *
-ListboxGetItemAttributes(interp, listPtr, index)
- Tcl_Interp *interp; /* Pointer to the calling Tcl interpreter */
- Listbox *listPtr; /* Information about the listbox */
- int index; /* Index of the item to retrieve attributes
- * for */
+ListboxGetItemAttributes(
+ Tcl_Interp *interp, /* Pointer to the calling Tcl interpreter */
+ Listbox *listPtr, /* Information about the listbox */
+ int index) /* Index of the item to retrieve attributes
+ * for. */
{
- int new;
+ int isNew;
Tcl_HashEntry *entry;
ItemAttr *attrs;
- entry = Tcl_CreateHashEntry(listPtr->itemAttrTable, (char *)index, &new);
- if (new) {
+ entry = Tcl_CreateHashEntry(listPtr->itemAttrTable,
+ (char *) INT2PTR(index), &isNew);
+ if (isNew) {
attrs = (ItemAttr *) ckalloc(sizeof(ItemAttr));
attrs->border = NULL;
attrs->selBorder = NULL;
@@ -1420,9 +1414,9 @@ ListboxGetItemAttributes(interp, listPtr, index)
*
* DestroyListbox --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a listbox at a safe time
- * (when no-one is using it anymore).
+ * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to
+ * clean up the internal structure of a listbox at a safe time (when
+ * no-one is using it anymore).
*
* Results:
* None.
@@ -1434,14 +1428,17 @@ ListboxGetItemAttributes(interp, listPtr, index)
*/
static void
-DestroyListbox(memPtr)
- char *memPtr; /* Info about listbox widget. */
+DestroyListbox(
+ char *memPtr) /* Info about listbox widget. */
{
register Listbox *listPtr = (Listbox *) memPtr;
Tcl_HashEntry *entry;
Tcl_HashSearch search;
- /* If we have an internal list object, free it */
+ /*
+ * If we have an internal list object, free it.
+ */
+
if (listPtr->listObj != NULL) {
Tcl_DecrRefCount(listPtr->listObj);
listPtr->listObj = NULL;
@@ -1452,23 +1449,28 @@ DestroyListbox(memPtr)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ListboxListVarProc, (ClientData) listPtr);
}
-
- /* Free the selection hash table */
+
+ /*
+ * Free the selection hash table.
+ */
+
Tcl_DeleteHashTable(listPtr->selection);
ckfree((char *)listPtr->selection);
- /* Free the item attribute hash table */
+ /*
+ * Free the item attribute hash table.
+ */
+
for (entry = Tcl_FirstHashEntry(listPtr->itemAttrTable, &search);
- entry != NULL; entry = Tcl_NextHashEntry(&search)) {
+ entry != NULL; entry = Tcl_NextHashEntry(&search)) {
ckfree((char *)Tcl_GetHashValue(entry));
}
Tcl_DeleteHashTable(listPtr->itemAttrTable);
ckfree((char *)listPtr->itemAttrTable);
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeOptions handle all the standard option-related stuff.
*/
if (listPtr->textGC != None) {
@@ -1494,7 +1496,7 @@ DestroyListbox(memPtr)
* DestroyListboxOptionTables --
*
* This procedure is registered as an exit callback when the listbox
- * command is first called. It cleans up the OptionTables structure
+ * command is first called. It cleans up the OptionTables structure
* allocated by that command.
*
* Results:
@@ -1507,11 +1509,11 @@ DestroyListbox(memPtr)
*/
static void
-DestroyListboxOptionTables(clientData, interp)
- ClientData clientData; /* Pointer to the OptionTables struct */
- Tcl_Interp *interp; /* Pointer to the calling interp */
+DestroyListboxOptionTables(
+ ClientData clientData, /* Pointer to the OptionTables struct */
+ Tcl_Interp *interp) /* Pointer to the calling interp */
{
- ckfree((char *)clientData);
+ ckfree((char *) clientData);
return;
}
@@ -1520,30 +1522,29 @@ DestroyListboxOptionTables(clientData, interp)
*
* ConfigureListbox --
*
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * a listbox widget.
+ * This procedure is called to process an objv/objc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a listbox
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as colors, border width,
- * etc. get set for listPtr; old resources get freed,
- * if there were any.
+ * Configuration information, such as colors, border width, etc. get set
+ * for listPtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureListbox(interp, listPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- register Listbox *listPtr; /* 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. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureListbox(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register Listbox *listPtr, /* 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *oldListObj = NULL;
@@ -1565,7 +1566,7 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
if (Tk_SetOptions(interp, (char *) listPtr,
listPtr->optionTable, objc, objv,
- listPtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ listPtr->tkwin, &savedOptions, NULL) != TCL_OK) {
continue;
}
} else {
@@ -1601,29 +1602,32 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
(ClientData) listPtr);
}
- /* Verify the current status of the list var.
+ /*
+ * Verify the current status of the list var.
* PREVIOUS STATE | NEW STATE | ACTION
* ---------------+------------+----------------------------------
- * no listvar | listvar | If listvar does not exist, create
- * it and copy the internal list obj's
- * content to the new var. If it does
- * exist, toss the internal list obj.
+ * no listvar | listvar | If listvar does not exist, create it
+ * and copy the internal list obj's
+ * content to the new var. If it does
+ * exist, toss the internal list obj.
*
- * listvar | no listvar | Copy old listvar content to the
- * internal list obj
+ * listvar | no listvar | Copy old listvar content to the
+ * internal list obj
*
- * listvar | listvar | no special action
+ * listvar | listvar | no special action
*
* no listvar | no listvar | no special action
*/
+
oldListObj = listPtr->listObj;
if (listPtr->listVarName != NULL) {
Tcl_Obj *listVarObj = Tcl_GetVar2Ex(interp, listPtr->listVarName,
- (char *) NULL, TCL_GLOBAL_ONLY);
+ NULL, TCL_GLOBAL_ONLY);
int dummy;
+
if (listVarObj == NULL) {
listVarObj = (oldListObj ? oldListObj : Tcl_NewObj());
- if (Tcl_SetVar2Ex(interp, listPtr->listVarName, (char *) NULL,
+ if (Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
listVarObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
== NULL) {
if (oldListObj == NULL) {
@@ -1632,11 +1636,15 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
continue;
}
}
- /* Make sure the object is a good list object */
+
+ /*
+ * Make sure the object is a good list object.
+ */
+
if (Tcl_ListObjLength(listPtr->interp, listVarObj, &dummy)
!= TCL_OK) {
Tcl_AppendResult(listPtr->interp,
- ": invalid -listvariable value", (char *) NULL);
+ ": invalid -listvariable value", NULL);
continue;
}
@@ -1657,11 +1665,14 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
Tk_FreeSavedOptions(&savedOptions);
}
- /* Make sure that the list length is correct */
+ /*
+ * Make sure that the list length is correct.
+ */
+
Tcl_ListObjLength(listPtr->interp, listPtr->listObj, &listPtr->nElements);
-
+
if (error) {
- Tcl_SetObjResult(interp, errorResult);
+ Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
return TCL_ERROR;
} else {
@@ -1675,45 +1686,46 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
*
* ConfigureListboxItem --
*
- * This procedure is called to process an objv/objc list, plus
- * the Tk option database, in order to configure (or reconfigure)
- * a listbox item.
+ * This procedure is called to process an objv/objc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a listbox
+ * item.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as colors, border width,
- * etc. get set for a listbox item; old resources get freed,
- * if there were any.
+ * Configuration information, such as colors, border width, etc. get set
+ * for a listbox item; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureListboxItem(interp, listPtr, attrs, objc, objv, index)
- Tcl_Interp *interp; /* Used for error reporting. */
- register Listbox *listPtr; /* Information about widget; may or may
- * not already have values for some fields. */
- ItemAttr *attrs; /* Information about the item to configure */
- int objc; /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[]; /* Arguments. */
- int index; /* Index of the listbox item being configure */
+ConfigureListboxItem(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register Listbox *listPtr, /* Information about widget; may or may not
+ * already have values for some fields. */
+ ItemAttr *attrs, /* Information about the item to configure */
+ int objc, /* Number of valid entries in argv. */
+ Tcl_Obj *const objv[], /* Arguments. */
+ int index) /* Index of the listbox item being configure */
{
Tk_SavedOptions savedOptions;
if (Tk_SetOptions(interp, (char *)attrs,
listPtr->itemAttrOptionTable, objc, objv, listPtr->tkwin,
- &savedOptions, (int *)NULL) != TCL_OK) {
+ &savedOptions, NULL) != TCL_OK) {
Tk_RestoreSavedOptions(&savedOptions);
return TCL_ERROR;
}
Tk_FreeSavedOptions(&savedOptions);
+
/*
- * Redraw this index - ListboxWorldChanged would need to be called
- * if item attributes were checked in the "world".
+ * Redraw this index - ListboxWorldChanged would need to be called if item
+ * attributes were checked in the "world".
*/
+
EventuallyRedrawRange(listPtr, index, index);
return TCL_OK;
}
@@ -1723,50 +1735,46 @@ ConfigureListboxItem(interp, listPtr, attrs, objc, objv, index)
*
* ListboxWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This procedure is called when the world has changed in some way and
+ * the widget needs to recompute all its graphics contexts and determine
+ * its new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Listbox will be relayed out and redisplayed.
+ * Listbox will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
static void
-ListboxWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+ListboxWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
GC gc;
unsigned long mask;
- Listbox *listPtr;
-
- listPtr = (Listbox *) instanceData;
+ Listbox *listPtr = (Listbox *) instanceData;
if (listPtr->state & STATE_NORMAL) {
gcValues.foreground = listPtr->fgColorPtr->pixel;
gcValues.graphics_exposures = False;
mask = GCForeground | GCFont | GCGraphicsExposures;
+ } else if (listPtr->dfgColorPtr != NULL) {
+ gcValues.foreground = listPtr->dfgColorPtr->pixel;
+ gcValues.graphics_exposures = False;
+ mask = GCForeground | GCFont | GCGraphicsExposures;
} else {
- if (listPtr->dfgColorPtr != NULL) {
- gcValues.foreground = listPtr->dfgColorPtr->pixel;
- gcValues.graphics_exposures = False;
- mask = GCForeground | GCFont | GCGraphicsExposures;
- } else {
- gcValues.foreground = listPtr->fgColorPtr->pixel;
- mask = GCForeground | GCFont;
- if (listPtr->gray == None) {
- listPtr->gray = Tk_GetBitmap(NULL, listPtr->tkwin, "gray50");
- }
- if (listPtr->gray != None) {
- gcValues.fill_style = FillStippled;
- gcValues.stipple = listPtr->gray;
- mask |= GCFillStyle | GCStipple;
- }
+ gcValues.foreground = listPtr->fgColorPtr->pixel;
+ mask = GCForeground | GCFont;
+ if (listPtr->gray == None) {
+ listPtr->gray = Tk_GetBitmap(NULL, listPtr->tkwin, "gray50");
+ }
+ if (listPtr->gray != None) {
+ gcValues.fill_style = FillStippled;
+ gcValues.stipple = listPtr->gray;
+ mask |= GCFillStyle | GCStipple;
}
}
@@ -1789,8 +1797,8 @@ ListboxWorldChanged(instanceData)
listPtr->selTextGC = gc;
/*
- * Register the desired geometry for the window and arrange for
- * the window to be redisplayed.
+ * Register the desired geometry for the window and arrange for the window
+ * to be redisplayed.
*/
ListboxComputeGeometry(listPtr, 1, 1, 1);
@@ -1815,25 +1823,24 @@ ListboxWorldChanged(instanceData)
*/
static void
-DisplayListbox(clientData)
- ClientData clientData; /* Information about window. */
+DisplayListbox(
+ ClientData clientData) /* Information about window. */
{
register Listbox *listPtr = (Listbox *) clientData;
register Tk_Window tkwin = listPtr->tkwin;
GC gc;
- int i, limit, x, y, width, prevSelected, freeGC;
+ int i, limit, x, y, prevSelected, freeGC, stringLen;
Tk_FontMetrics fm;
Tcl_Obj *curElement;
Tcl_HashEntry *entry;
char *stringRep;
- int stringLen;
ItemAttr *attrs;
Tk_3DBorder selectedBg;
XGCValues gcValues;
unsigned long mask;
- int left, right; /* Non-zero values here indicate
- * that the left or right edge of
- * the listbox is off-screen. */
+ int left, right; /* Non-zero values here indicate that the left
+ * or right edge of the listbox is
+ * off-screen. */
Pixmap pixmap;
listPtr->flags &= ~REDRAW_PENDING;
@@ -1867,11 +1874,11 @@ DisplayListbox(clientData)
#ifndef TK_NO_DOUBLE_BUFFERING
/*
- * Redrawing is done in a temporary pixmap that is allocated
- * here and freed at the end of the procedure. All drawing is
- * done to the pixmap, and the pixmap is copied to the screen
- * at the end of the procedure. This provides the smoothest
- * possible visual effects (no flashing on the screen).
+ * Redrawing is done in a temporary pixmap that is allocated here and
+ * freed at the end of the procedure. All drawing is done to the pixmap,
+ * and the pixmap is copied to the screen at the end of the procedure.
+ * This provides the smoothest possible visual effects (no flashing on the
+ * screen).
*/
pixmap = Tk_GetPixmap(listPtr->display, Tk_WindowId(tkwin),
@@ -1882,7 +1889,10 @@ DisplayListbox(clientData)
Tk_Fill3DRectangle(tkwin, pixmap, listPtr->normalBorder, 0, 0,
Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
- /* Display each item in the listbox */
+ /*
+ * Display each item in the listbox.
+ */
+
limit = listPtr->topIndex + listPtr->fullLines + listPtr->partialLine - 1;
if (limit >= listPtr->nElements) {
limit = listPtr->nElements-1;
@@ -1892,40 +1902,54 @@ DisplayListbox(clientData)
left = listPtr->selBorderWidth+1;
}
if ((listPtr->maxWidth - listPtr->xOffset) > (Tk_Width(listPtr->tkwin)
- - 2*(listPtr->inset + listPtr->selBorderWidth))) {
+ - 2*(listPtr->inset + listPtr->selBorderWidth))) {
right = listPtr->selBorderWidth+1;
}
prevSelected = 0;
-
+
for (i = listPtr->topIndex; i <= limit; i++) {
+ int width = Tk_Width(tkwin); /* zeroth approx to silence warning */
+
x = listPtr->inset;
- y = ((i - listPtr->topIndex) * listPtr->lineHeight)
- + listPtr->inset;
+ y = ((i - listPtr->topIndex) * listPtr->lineHeight) + listPtr->inset;
gc = listPtr->textGC;
freeGC = 0;
+
/*
* Lookup this item in the item attributes table, to see if it has
- * special foreground/background colors
+ * special foreground/background colors.
*/
- entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i);
+
+ entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *) INT2PTR(i));
/*
- * If the listbox is enabled, items may be drawn differently;
- * they may be drawn selected, or they may have special foreground
- * or background colors.
+ * If the listbox is enabled, items may be drawn differently; they may
+ * be drawn selected, or they may have special foreground or
+ * background colors.
*/
+
if (listPtr->state & STATE_NORMAL) {
- if (Tcl_FindHashEntry(listPtr->selection, (char *)i) != NULL) {
- /* Selected items are drawn differently. */
+ if (Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i))) {
+ /*
+ * Selected items are drawn differently.
+ */
+
gc = listPtr->selTextGC;
width = Tk_Width(tkwin) - 2*listPtr->inset;
selectedBg = listPtr->selBorder;
-
- /* If there is attribute information for this item,
- * adjust the drawing accordingly */
+
+ /*
+ * If there is attribute information for this item, adjust the
+ * drawing accordingly.
+ */
+
if (entry != NULL) {
attrs = (ItemAttr *)Tcl_GetHashValue(entry);
- /* Default GC has the values from the widget at large */
+
+ /*
+ * Default GC has the values from the widget at large.
+ */
+
if (listPtr->selFgColorPtr) {
gcValues.foreground = listPtr->selFgColorPtr->pixel;
} else {
@@ -1934,11 +1958,11 @@ DisplayListbox(clientData)
gcValues.font = Tk_FontId(listPtr->tkfont);
gcValues.graphics_exposures = False;
mask = GCForeground | GCFont | GCGraphicsExposures;
-
+
if (attrs->selBorder != NULL) {
selectedBg = attrs->selBorder;
}
-
+
if (attrs->selFgColor != NULL) {
gcValues.foreground = attrs->selFgColor->pixel;
gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
@@ -1988,7 +2012,7 @@ DisplayListbox(clientData)
/* Draw bottom bevel */
if (i + 1 == listPtr->nElements ||
Tcl_FindHashEntry(listPtr->selection,
- (char *)(i + 1)) == NULL ) {
+ (char *) INT2PTR(i + 1)) == NULL ) {
Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg, x-left,
y + listPtr->lineHeight - listPtr->selBorderWidth,
width+left+right, listPtr->selBorderWidth, 0, 0, 0,
@@ -2000,28 +2024,29 @@ DisplayListbox(clientData)
* If there is an item attributes record for this item, draw
* the background box and set the foreground color accordingly
*/
+
if (entry != NULL) {
attrs = (ItemAttr *)Tcl_GetHashValue(entry);
gcValues.foreground = listPtr->fgColorPtr->pixel;
gcValues.font = Tk_FontId(listPtr->tkfont);
gcValues.graphics_exposures = False;
mask = GCForeground | GCFont | GCGraphicsExposures;
-
+
/*
* If the item has its own background color, draw it now.
*/
-
+
if (attrs->border != NULL) {
width = Tk_Width(tkwin) - 2*listPtr->inset;
Tk_Fill3DRectangle(tkwin, pixmap, attrs->border, x, y,
width, listPtr->lineHeight, 0, TK_RELIEF_FLAT);
}
-
+
/*
* If the item has its own foreground, use it to override
* the value in the gcValues structure.
*/
-
+
if ((listPtr->state & STATE_NORMAL)
&& attrs->fgColor != NULL) {
gcValues.foreground = attrs->fgColor->pixel;
@@ -2033,7 +2058,10 @@ DisplayListbox(clientData)
}
}
- /* Draw the actual text of this item */
+ /*
+ * Draw the actual text of this item.
+ */
+
Tk_GetFontMetrics(listPtr->tkfont, &fm);
y += fm.ascent + listPtr->selBorderWidth;
x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset;
@@ -2042,10 +2070,16 @@ DisplayListbox(clientData)
Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont,
stringRep, stringLen, x, y);
- /* If this is the active element, apply the activestyle to it. */
+ /*
+ * If this is the active element, apply the activestyle to it.
+ */
+
if ((i == listPtr->active) && (listPtr->flags & GOT_FOCUS)) {
if (listPtr->activeStyle == ACTIVE_STYLE_UNDERLINE) {
- /* Underline the text. */
+ /*
+ * Underline the text.
+ */
+
Tk_UnderlineChars(listPtr->display, pixmap, gc,
listPtr->tkfont, stringRep, x, y, 0, stringLen);
} else if (listPtr->activeStyle == ACTIVE_STYLE_DOTBOX) {
@@ -2053,52 +2087,59 @@ DisplayListbox(clientData)
/*
* This provides for exact default look and feel on Windows.
*/
+
TkWinDCState state;
HDC dc;
RECT rect;
dc = TkWinGetDrawableDC(listPtr->display, pixmap, &state);
- rect.left = listPtr->inset;
- rect.top = ((i - listPtr->topIndex) * listPtr->lineHeight)
- + listPtr->inset;
- rect.right = rect.left + width;
+ rect.left = listPtr->inset;
+ rect.top = ((i - listPtr->topIndex) * listPtr->lineHeight)
+ + listPtr->inset;
+ rect.right = rect.left + width;
rect.bottom = rect.top + listPtr->lineHeight;
DrawFocusRect(dc, &rect);
TkWinReleaseDrawableDC(pixmap, dc, &state);
-#else
+#else /* !WIN32 */
/*
* Draw a dotted box around the text.
*/
+
x = listPtr->inset;
y = ((i - listPtr->topIndex) * listPtr->lineHeight)
- + listPtr->inset;
+ + listPtr->inset;
width = Tk_Width(tkwin) - 2*listPtr->inset - 1;
- gcValues.line_style = LineOnOffDash;
- gcValues.line_width = listPtr->selBorderWidth;
+ gcValues.line_style = LineOnOffDash;
+ gcValues.line_width = listPtr->selBorderWidth;
if (gcValues.line_width <= 0) {
gcValues.line_width = 1;
}
gcValues.dash_offset = 0;
- gcValues.dashes = 1;
+ gcValues.dashes = 1;
+
/*
* You would think the XSetDashes was necessary, but it
- * appears that the default dotting for just saying we
- * want dashes appears to work correctly.
+ * appears that the default dotting for just saying we want
+ * dashes appears to work correctly.
static char dashList[] = { 1 };
- static int dashLen = sizeof(dashList);
+ static int dashLen = sizeof(dashList);
XSetDashes(listPtr->display, gc, 0, dashList, dashLen);
*/
+
mask = GCLineWidth | GCLineStyle | GCDashList | GCDashOffset;
XChangeGC(listPtr->display, gc, mask, &gcValues);
XDrawRectangle(listPtr->display, pixmap, gc, x, y,
(unsigned) width, (unsigned) listPtr->lineHeight - 1);
if (!freeGC) {
- /* Don't bother changing if it is about to be freed. */
+ /*
+ * Don't bother changing if it is about to be freed.
+ */
+
gcValues.line_style = LineSolid;
XChangeGC(listPtr->display, gc, GCLineStyle, &gcValues);
}
-#endif
+#endif /* WIN32 */
}
}
@@ -2108,8 +2149,8 @@ DisplayListbox(clientData)
}
/*
- * Redraw the border for the listbox to make sure that it's on top
- * of any of the text of the listbox entries.
+ * Redraw the border for the listbox to make sure that it's on top of any
+ * of the text of the listbox entries.
*/
Tk_Draw3DRectangle(tkwin, pixmap, listPtr->normalBorder,
@@ -2123,11 +2164,11 @@ DisplayListbox(clientData)
bgGC = Tk_GCForColor(listPtr->highlightBgColorPtr, pixmap);
if (listPtr->flags & GOT_FOCUS) {
fgGC = Tk_GCForColor(listPtr->highlightColorPtr, pixmap);
- TkpDrawHighlightBorder(tkwin, fgGC, bgGC,
- listPtr->highlightWidth, pixmap);
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC,
+ listPtr->highlightWidth, pixmap);
} else {
- TkpDrawHighlightBorder(tkwin, bgGC, bgGC,
- listPtr->highlightWidth, pixmap);
+ TkpDrawHighlightBorder(tkwin, bgGC, bgGC,
+ listPtr->highlightWidth, pixmap);
}
}
#ifndef TK_NO_DOUBLE_BUFFERING
@@ -2143,51 +2184,51 @@ DisplayListbox(clientData)
*
* ListboxComputeGeometry --
*
- * This procedure is invoked to recompute geometry information
- * such as the sizes of the elements and the overall dimensions
- * desired for the listbox.
+ * This procedure is invoked to recompute geometry information such as
+ * the sizes of the elements and the overall dimensions desired for the
+ * listbox.
*
* Results:
* None.
*
* Side effects:
- * Geometry information is updated and a new requested size is
- * registered for the widget. Internal border and gridding
- * information is also set.
+ * Geometry information is updated and a new requested size is registered
+ * for the widget. Internal border and gridding information is also set.
*
*----------------------------------------------------------------------
*/
static void
-ListboxComputeGeometry(listPtr, fontChanged, maxIsStale, updateGrid)
- Listbox *listPtr; /* Listbox whose geometry is to be
+ListboxComputeGeometry(
+ Listbox *listPtr, /* Listbox whose geometry is to be
* recomputed. */
- int fontChanged; /* Non-zero means the font may have changed
- * so per-element width information also
- * has to be computed. */
- int maxIsStale; /* Non-zero means the "maxWidth" field may
- * no longer be up-to-date and must
- * be recomputed. If fontChanged is 1 then
- * this must be 1. */
- int updateGrid; /* Non-zero means call Tk_SetGrid or
- * Tk_UnsetGrid to update gridding for
- * the window. */
+ int fontChanged, /* Non-zero means the font may have changed so
+ * per-element width information also has to
+ * be computed. */
+ int maxIsStale, /* Non-zero means the "maxWidth" field may no
+ * longer be up-to-date and must be
+ * recomputed. If fontChanged is 1 then this
+ * must be 1. */
+ int updateGrid) /* Non-zero means call Tk_SetGrid or
+ * Tk_UnsetGrid to update gridding for the
+ * window. */
{
- int width, height, pixelWidth, pixelHeight;
+ int width, height, pixelWidth, pixelHeight, textLength, i, result;
Tk_FontMetrics fm;
Tcl_Obj *element;
- int textLength;
char *text;
- int i, result;
-
- if (fontChanged || maxIsStale) {
+
+ if (fontChanged || maxIsStale) {
listPtr->xScrollUnit = Tk_TextWidth(listPtr->tkfont, "0", 1);
if (listPtr->xScrollUnit == 0) {
listPtr->xScrollUnit = 1;
}
listPtr->maxWidth = 0;
for (i = 0; i < listPtr->nElements; i++) {
- /* Compute the pixel width of the current element */
+ /*
+ * Compute the pixel width of the current element.
+ */
+
result = Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i,
&element);
if (result != TCL_OK) {
@@ -2239,87 +2280,92 @@ ListboxComputeGeometry(listPtr, fontChanged, maxIsStale, updateGrid)
*
* ListboxInsertSubCmd --
*
- * This procedure is invoked to handle the listbox "insert"
- * subcommand.
+ * This procedure is invoked to handle the listbox "insert" subcommand.
*
* Results:
* Standard Tcl result.
*
* Side effects:
- * New elements are added to the listbox pointed to by listPtr;
- * a refresh callback is registered for the listbox.
+ * New elements are added to the listbox pointed to by listPtr; a refresh
+ * callback is registered for the listbox.
*
*----------------------------------------------------------------------
*/
static int
-ListboxInsertSubCmd(listPtr, index, objc, objv)
- register Listbox *listPtr; /* Listbox that is to get the new
- * elements. */
- int index; /* Add the new elements before this
+ListboxInsertSubCmd(
+ register Listbox *listPtr, /* Listbox that is to get the new elements. */
+ int index, /* Add the new elements before this
* element. */
- int objc; /* Number of new elements to add. */
- Tcl_Obj *CONST objv[]; /* New elements (one per entry). */
+ int objc, /* Number of new elements to add. */
+ Tcl_Obj *const objv[]) /* New elements (one per entry). */
{
- int i, oldMaxWidth;
+ int i, oldMaxWidth, pixelWidth, result, length;
Tcl_Obj *newListObj;
- int pixelWidth;
- int result;
char *stringRep;
- int length;
-
+
oldMaxWidth = listPtr->maxWidth;
for (i = 0; i < objc; i++) {
/*
* Check if any of the new elements are wider than the current widest;
* if so, update our notion of "widest."
*/
+
stringRep = Tcl_GetStringFromObj(objv[i], &length);
pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, length);
if (pixelWidth > listPtr->maxWidth) {
listPtr->maxWidth = pixelWidth;
}
}
-
- /* Adjust selection and attribute information for every index after
- * the first index */
+
+ /*
+ * Adjust selection and attribute information for every index after the
+ * first index.
+ */
+
MigrateHashEntries(listPtr->selection, index, listPtr->nElements-1, objc);
MigrateHashEntries(listPtr->itemAttrTable, index, listPtr->nElements-1,
objc);
-
- /* If the object is shared, duplicate it before writing to it */
+
+ /*
+ * If the object is shared, duplicate it before writing to it.
+ */
+
if (Tcl_IsShared(listPtr->listObj)) {
newListObj = Tcl_DuplicateObj(listPtr->listObj);
} else {
newListObj = listPtr->listObj;
}
- result =
- Tcl_ListObjReplace(listPtr->interp, newListObj, index, 0, objc, objv);
+ result = Tcl_ListObjReplace(listPtr->interp, newListObj, index, 0,
+ objc, objv);
if (result != TCL_OK) {
return result;
}
/*
- * Replace the current object and set attached listvar, if any.
- * This may error if listvar points to a var in a deleted namespace, but
- * we ignore those errors. If the namespace is recreated, it will
- * auto-sync with the current value. [Bug 1424513]
+ * Replace the current object and set attached listvar, if any. This may
+ * error if listvar points to a var in a deleted namespace, but we ignore
+ * those errors. If the namespace is recreated, it will auto-sync with the
+ * current value. [Bug 1424513]
*/
Tcl_IncrRefCount(newListObj);
Tcl_DecrRefCount(listPtr->listObj);
listPtr->listObj = newListObj;
if (listPtr->listVarName != NULL) {
- Tcl_SetVar2Ex(listPtr->interp, listPtr->listVarName,
- (char *) NULL, listPtr->listObj, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(listPtr->interp, listPtr->listVarName, NULL,
+ listPtr->listObj, TCL_GLOBAL_ONLY);
}
- /* Get the new list length */
+ /*
+ * Get the new list length.
+ */
+
Tcl_ListObjLength(listPtr->interp, listPtr->listObj, &listPtr->nElements);
/*
- * Update the "special" indices (anchor, topIndex, active) to account
- * for the renumbering that just occurred. Then arrange for the new
+ * Update the "special" indices (anchor, topIndex, active) to account for
+ * the renumbering that just occurred. Then arrange for the new
* information to be displayed.
*/
@@ -2350,8 +2396,8 @@ ListboxInsertSubCmd(listPtr, index, objc, objv)
*
* ListboxDeleteSubCmd --
*
- * Process a listbox "delete" subcommand by removing one or more
- * elements from a listbox widget.
+ * Process a listbox "delete" subcommand by removing one or more elements
+ * from a listbox widget.
*
* Results:
* Standard Tcl result.
@@ -2363,23 +2409,19 @@ ListboxInsertSubCmd(listPtr, index, objc, objv)
*/
static int
-ListboxDeleteSubCmd(listPtr, first, last)
- register Listbox *listPtr; /* Listbox widget to modify. */
- int first; /* Index of first element to delete. */
- int last; /* Index of last element to delete. */
+ListboxDeleteSubCmd(
+ register Listbox *listPtr, /* Listbox widget to modify. */
+ int first, /* Index of first element to delete. */
+ int last) /* Index of last element to delete. */
{
- int count, i, widthChanged;
- Tcl_Obj *newListObj;
- Tcl_Obj *element;
- int length;
+ int count, i, widthChanged, length, result, pixelWidth;
+ Tcl_Obj *newListObj, *element;
char *stringRep;
- int result;
- int pixelWidth;
Tcl_HashEntry *entry;
-
+
/*
- * Adjust the range to fit within the existing elements of the
- * listbox, and make sure there's something to delete.
+ * Adjust the range to fit within the existing elements of the listbox,
+ * and make sure there's something to delete.
*/
if (first < 0) {
@@ -2395,30 +2437,36 @@ ListboxDeleteSubCmd(listPtr, first, last)
/*
* Foreach deleted index we must:
- * a) remove selection information
+ * a) remove selection information,
* b) check the width of the element; if it is equal to the max, set
* widthChanged to 1, because it may be the only element with that
- * width
+ * width.
*/
+
widthChanged = 0;
for (i = first; i <= last; i++) {
- /* Remove selection information */
- entry = Tcl_FindHashEntry(listPtr->selection, (char *)i);
+ /*
+ * Remove selection information.
+ */
+
+ entry = Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i));
if (entry != NULL) {
listPtr->numSelected--;
Tcl_DeleteHashEntry(entry);
}
- entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i);
+ entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *) INT2PTR(i));
if (entry != NULL) {
ckfree((char *)Tcl_GetHashValue(entry));
Tcl_DeleteHashEntry(entry);
}
-
- /* Check width of the element. We only have to check if widthChanged
+
+ /*
+ * Check width of the element. We only have to check if widthChanged
* has not already been set to 1, because we only need one maxWidth
* element to disappear for us to have to recompute the width
*/
+
if (widthChanged == 0) {
Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &element);
stringRep = Tcl_GetStringFromObj(element, &length);
@@ -2429,13 +2477,19 @@ ListboxDeleteSubCmd(listPtr, first, last)
}
}
- /* Adjust selection and attribute info for indices after lastIndex */
+ /*
+ * Adjust selection and attribute info for indices after lastIndex.
+ */
+
MigrateHashEntries(listPtr->selection, last+1,
listPtr->nElements-1, count*-1);
MigrateHashEntries(listPtr->itemAttrTable, last+1,
listPtr->nElements-1, count*-1);
- /* Delete the requested elements */
+ /*
+ * Delete the requested elements.
+ */
+
if (Tcl_IsShared(listPtr->listObj)) {
newListObj = Tcl_DuplicateObj(listPtr->listObj);
} else {
@@ -2448,27 +2502,30 @@ ListboxDeleteSubCmd(listPtr, first, last)
}
/*
- * Replace the current object and set attached listvar, if any.
- * This may error if listvar points to a var in a deleted namespace, but
- * we ignore those errors. If the namespace is recreated, it will
- * auto-sync with the current value. [Bug 1424513]
+ * Replace the current object and set attached listvar, if any. This may
+ * error if listvar points to a var in a deleted namespace, but we ignore
+ * those errors. If the namespace is recreated, it will auto-sync with the
+ * current value. [Bug 1424513]
*/
Tcl_IncrRefCount(newListObj);
Tcl_DecrRefCount(listPtr->listObj);
listPtr->listObj = newListObj;
if (listPtr->listVarName != NULL) {
- Tcl_SetVar2Ex(listPtr->interp, listPtr->listVarName,
- (char *) NULL, listPtr->listObj, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(listPtr->interp, listPtr->listVarName, NULL,
+ listPtr->listObj, TCL_GLOBAL_ONLY);
}
- /* Get the new list length */
+ /*
+ * Get the new list length.
+ */
+
Tcl_ListObjLength(listPtr->interp, listPtr->listObj, &listPtr->nElements);
/*
- * Update the selection and viewing information to reflect the change
- * in the element numbering, and redisplay to slide information up over
- * the elements that were deleted.
+ * Update the selection and viewing information to reflect the change in
+ * the element numbering, and redisplay to slide information up over the
+ * elements that were deleted.
*/
if (first <= listPtr->selectAnchor) {
@@ -2512,26 +2569,26 @@ ListboxDeleteSubCmd(listPtr, first, last)
*
* ListboxEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on listboxes.
+ * This procedure is invoked by the Tk dispatcher for various events on
+ * listboxes.
*
* 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.
*
*--------------------------------------------------------------
*/
static void
-ListboxEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+ListboxEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
Listbox *listPtr = (Listbox *) clientData;
-
+
if (eventPtr->type == Expose) {
EventuallyRedrawRange(listPtr,
NearestListboxElement(listPtr, eventPtr->xexpose.y),
@@ -2564,10 +2621,9 @@ ListboxEventProc(clientData, eventPtr)
ChangeListboxOffset(listPtr, listPtr->xOffset);
/*
- * Redraw the whole listbox. It's hard to tell what needs
- * to be redrawn (e.g. if the listbox has shrunk then we
- * may only need to redraw the borders), so just redraw
- * everything for safety.
+ * Redraw the whole listbox. It's hard to tell what needs to be
+ * redrawn (e.g. if the listbox has shrunk then we may only need to
+ * redraw the borders), so just redraw everything for safety.
*/
EventuallyRedrawRange(listPtr, 0, listPtr->nElements-1);
@@ -2589,9 +2645,9 @@ ListboxEventProc(clientData, eventPtr)
*
* ListboxCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This procedure is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -2603,16 +2659,16 @@ ListboxEventProc(clientData, eventPtr)
*/
static void
-ListboxCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+ListboxCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
Listbox *listPtr = (Listbox *) clientData;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This procedure could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this procedure destroys the
+ * widget.
*/
if (!(listPtr->flags & LISTBOX_DELETED)) {
@@ -2625,13 +2681,12 @@ ListboxCmdDeletedProc(clientData)
*
* GetListboxIndex --
*
- * Parse an index into a listbox and return either its value
- * or an error.
+ * Parse an index into a listbox and return either its value or an error.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the index (into listPtr) corresponding to
- * string. Otherwise an error message is left in the interp's result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the index (into listPtr) corresponding to string. Otherwise an
+ * error message is left in the interp's result.
*
* Side effects:
* None.
@@ -2640,62 +2695,62 @@ ListboxCmdDeletedProc(clientData)
*/
static int
-GetListboxIndex(interp, listPtr, indexObj, endIsSize, indexPtr)
- Tcl_Interp *interp; /* For error messages. */
- Listbox *listPtr; /* Listbox for which the index is being
+GetListboxIndex(
+ Tcl_Interp *interp, /* For error messages. */
+ Listbox *listPtr, /* Listbox for which the index is being
* specified. */
- Tcl_Obj *indexObj; /* Specifies an element in the listbox. */
- int endIsSize; /* If 1, "end" refers to the number of
- * entries in the listbox. If 0, "end"
- * refers to 1 less than the number of
- * entries. */
- int *indexPtr; /* Where to store converted index. */
+ Tcl_Obj *indexObj, /* Specifies an element in the listbox. */
+ int endIsSize, /* If 1, "end" refers to the number of entries
+ * in the listbox. If 0, "end" refers to 1
+ * less than the number of entries. */
+ int *indexPtr) /* Where to store converted index. */
{
- int result;
- int index;
+ int result, index;
char *stringRep;
-
- /* First see if the index is one of the named indices */
+
+ /*
+ * First see if the index is one of the named indices.
+ */
+
result = Tcl_GetIndexFromObj(NULL, indexObj, indexNames, "", 0, &index);
if (result == TCL_OK) {
switch (index) {
- case INDEX_ACTIVE: {
- /* "active" index */
- *indexPtr = listPtr->active;
- break;
- }
-
- case INDEX_ANCHOR: {
- /* "anchor" index */
- *indexPtr = listPtr->selectAnchor;
- break;
- }
-
- case INDEX_END: {
- /* "end" index */
- if (endIsSize) {
- *indexPtr = listPtr->nElements;
- } else {
- *indexPtr = listPtr->nElements - 1;
- }
- break;
+ case INDEX_ACTIVE:
+ /* "active" index */
+ *indexPtr = listPtr->active;
+ break;
+ case INDEX_ANCHOR:
+ /* "anchor" index */
+ *indexPtr = listPtr->selectAnchor;
+ break;
+ case INDEX_END:
+ /* "end" index */
+ if (endIsSize) {
+ *indexPtr = listPtr->nElements;
+ } else {
+ *indexPtr = listPtr->nElements - 1;
}
+ break;
}
return TCL_OK;
}
- /* The index didn't match any of the named indices; maybe it's an @x,y */
+ /*
+ * The index didn't match any of the named indices; maybe it's an @x,y
+ */
+
stringRep = Tcl_GetString(indexObj);
if (stringRep[0] == '@') {
/* @x,y index */
int y;
char *start, *end;
+
start = stringRep + 1;
- strtol(start, &end, 0);
+ y = strtol(start, &end, 0);
if ((start == end) || (*end != ',')) {
Tcl_AppendResult(interp, "bad listbox index \"", stringRep,
"\": must be active, anchor, end, @x,y, or a number",
- (char *)NULL);
+ NULL);
return TCL_ERROR;
}
start = end+1;
@@ -2703,23 +2758,29 @@ GetListboxIndex(interp, listPtr, indexObj, endIsSize, indexPtr)
if ((start == end) || (*end != '\0')) {
Tcl_AppendResult(interp, "bad listbox index \"", stringRep,
"\": must be active, anchor, end, @x,y, or a number",
- (char *)NULL);
+ NULL);
return TCL_ERROR;
}
*indexPtr = NearestListboxElement(listPtr, y);
return TCL_OK;
}
-
- /* Maybe the index is just an integer */
+
+ /*
+ * Maybe the index is just an integer.
+ */
+
if (Tcl_GetIntFromObj(interp, indexObj, indexPtr) == TCL_OK) {
return TCL_OK;
}
- /* Everything failed, nothing matched. Throw up an error message */
+ /*
+ * Everything failed, nothing matched. Throw up an error message.
+ */
+
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad listbox index \"",
Tcl_GetString(indexObj), "\": must be active, anchor, ",
- "end, @x,y, or a number", (char *) NULL);
+ "end, @x,y, or a number", NULL);
return TCL_ERROR;
}
@@ -2728,26 +2789,25 @@ GetListboxIndex(interp, listPtr, indexObj, endIsSize, indexPtr)
*
* ChangeListboxView --
*
- * Change the view on a listbox widget so that a given element
- * is displayed at the top.
+ * Change the view on a listbox widget so that a given element is
+ * displayed at the top.
*
* Results:
* None.
*
* Side effects:
- * What's displayed on the screen is changed. If there is a
- * scrollbar associated with this widget, then the scrollbar
- * is instructed to change its display too.
+ * What's displayed on the screen is changed. If there is a scrollbar
+ * associated with this widget, then the scrollbar is instructed to
+ * change its display too.
*
*----------------------------------------------------------------------
*/
static void
-ChangeListboxView(listPtr, index)
- register Listbox *listPtr; /* Information about widget. */
- int index; /* Index of element in listPtr
- * that should now appear at the
- * top of the listbox. */
+ChangeListboxView(
+ register Listbox *listPtr, /* Information about widget. */
+ int index) /* Index of element in listPtr that should now
+ * appear at the top of the listbox. */
{
if (index >= (listPtr->nElements - listPtr->fullLines)) {
index = listPtr->nElements - listPtr->fullLines;
@@ -2773,26 +2833,24 @@ ChangeListboxView(listPtr, index)
* None.
*
* Side effects:
- * The listbox may be redrawn to reflect its new horizontal
- * offset.
+ * The listbox may be redrawn to reflect its new horizontal offset.
*
*----------------------------------------------------------------------
*/
static void
-ChangeListboxOffset(listPtr, offset)
- register Listbox *listPtr; /* Information about widget. */
- int offset; /* Desired new "xOffset" for
- * listbox. */
+ChangeListboxOffset(
+ register Listbox *listPtr, /* Information about widget. */
+ int offset) /* Desired new "xOffset" for listbox. */
{
int maxOffset;
-
+
/*
- * Make sure that the new offset is within the allowable range, and
- * round it off to an even multiple of xScrollUnit.
+ * Make sure that the new offset is within the allowable range, and round
+ * it off to an even multiple of xScrollUnit.
*
- * Add half a scroll unit to do entry/text-like synchronization.
- * [Bug #225025]
+ * Add half a scroll unit to do entry/text-like synchronization. [Bug
+ * #225025]
*/
offset += listPtr->xScrollUnit / 2;
@@ -2818,8 +2876,8 @@ ChangeListboxOffset(listPtr, offset)
*
* ListboxScanTo --
*
- * Given a point (presumably of the curent mouse location)
- * drag the view in the window to implement the scan operation.
+ * Given a point (presumably of the curent mouse location) drag the view
+ * in the window to implement the scan operation.
*
* Results:
* None.
@@ -2831,29 +2889,26 @@ ChangeListboxOffset(listPtr, offset)
*/
static void
-ListboxScanTo(listPtr, x, y)
- register Listbox *listPtr; /* Information about widget. */
- int x; /* X-coordinate to use for scan
- * operation. */
- int y; /* Y-coordinate to use for scan
- * operation. */
+ListboxScanTo(
+ register Listbox *listPtr, /* Information about widget. */
+ int x, /* X-coordinate to use for scan operation. */
+ int y) /* Y-coordinate to use for scan operation. */
{
int newTopIndex, newOffset, maxIndex, maxOffset;
-
+
maxIndex = listPtr->nElements - listPtr->fullLines;
maxOffset = listPtr->maxWidth + (listPtr->xScrollUnit - 1)
- (Tk_Width(listPtr->tkwin) - 2*listPtr->inset
- 2*listPtr->selBorderWidth - listPtr->xScrollUnit);
/*
- * Compute new top line for screen by amplifying the difference
- * between the current position and the place where the scan
- * started (the "mark" position). If we run off the top or bottom
- * of the list, then reset the mark point so that the current
- * position continues to correspond to the edge of the window.
- * This means that the picture will start dragging as soon as the
- * mouse reverses direction (without this reset, might have to slide
- * mouse a long ways back before the picture starts moving again).
+ * Compute new top line for screen by amplifying the difference between
+ * the current position and the place where the scan started (the "mark"
+ * position). If we run off the top or bottom of the list, then reset the
+ * mark point so that the current position continues to correspond to the
+ * edge of the window. This means that the picture will start dragging as
+ * soon as the mouse reverses direction (without this reset, might have to
+ * slide mouse a long ways back before the picture starts moving again).
*/
newTopIndex = listPtr->scanMarkYIndex
@@ -2873,7 +2928,7 @@ ListboxScanTo(listPtr, x, y)
* scan started.
*/
- newOffset = listPtr->scanMarkXOffset - (10*(x - listPtr->scanMarkX));
+ newOffset = listPtr->scanMarkXOffset - 10*(x - listPtr->scanMarkX);
if (newOffset > maxOffset) {
newOffset = listPtr->scanMarkXOffset = maxOffset;
listPtr->scanMarkX = x;
@@ -2889,13 +2944,12 @@ ListboxScanTo(listPtr, x, y)
*
* NearestListboxElement --
*
- * Given a y-coordinate inside a listbox, compute the index of
- * the element under that y-coordinate (or closest to that
- * y-coordinate).
+ * Given a y-coordinate inside a listbox, compute the index of the
+ * element under that y-coordinate (or closest to that y-coordinate).
*
* Results:
- * The return value is an index of an element of listPtr. If
- * listPtr has no elements, then 0 is always returned.
+ * The return value is an index of an element of listPtr. If listPtr has
+ * no elements, then 0 is always returned.
*
* Side effects:
* None.
@@ -2904,9 +2958,9 @@ ListboxScanTo(listPtr, x, y)
*/
static int
-NearestListboxElement(listPtr, y)
- register Listbox *listPtr; /* Information about widget. */
- int y; /* Y-coordinate in listPtr's window. */
+NearestListboxElement(
+ register Listbox *listPtr, /* Information about widget. */
+ int y) /* Y-coordinate in listPtr's window. */
{
int index;
@@ -2935,29 +2989,28 @@ NearestListboxElement(listPtr, y)
* Standard Tcl result.
*
* Side effects:
- * All of the elements in the range between first and last are
- * marked as either selected or deselected, depending on the
- * "select" argument. Any items whose state changes are redisplayed.
- * The selection is claimed from X when the number of selected
- * elements changes from zero to non-zero.
+ * All of the elements in the range between first and last are marked as
+ * either selected or deselected, depending on the "select" argument. Any
+ * items whose state changes are redisplayed. The selection is claimed
+ * from X when the number of selected elements changes from zero to
+ * non-zero.
*
*----------------------------------------------------------------------
*/
static int
-ListboxSelect(listPtr, first, last, select)
- register Listbox *listPtr; /* Information about widget. */
- int first; /* Index of first element to
- * select or deselect. */
- int last; /* Index of last element to
- * select or deselect. */
- int select; /* 1 means select items, 0 means
- * deselect them. */
+ListboxSelect(
+ register Listbox *listPtr, /* Information about widget. */
+ int first, /* Index of first element to select or
+ * deselect. */
+ int last, /* Index of last element to select or
+ * deselect. */
+ int select) /* 1 means select items, 0 means deselect
+ * them. */
{
- int i, firstRedisplay, oldCount;
+ int i, firstRedisplay, oldCount, isNew;
Tcl_HashEntry *entry;
- int new;
-
+
if (last < first) {
i = first;
first = last;
@@ -2976,12 +3029,13 @@ ListboxSelect(listPtr, first, last, select)
firstRedisplay = -1;
/*
- * For each index in the range, find it in our selection hash table.
- * If it's not there but should be, add it. If it's there but shouldn't
- * be, remove it.
+ * For each index in the range, find it in our selection hash table. If
+ * it's not there but should be, add it. If it's there but shouldn't be,
+ * remove it.
*/
+
for (i = first; i <= last; i++) {
- entry = Tcl_FindHashEntry(listPtr->selection, (char *)i);
+ entry = Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i));
if (entry != NULL) {
if (!select) {
Tcl_DeleteHashEntry(entry);
@@ -2993,7 +3047,7 @@ ListboxSelect(listPtr, first, last, select)
} else {
if (select) {
entry = Tcl_CreateHashEntry(listPtr->selection,
- (char *)i, &new);
+ (char *) INT2PTR(i), &isNew);
Tcl_SetHashValue(entry, (ClientData) NULL);
listPtr->numSelected++;
if (firstRedisplay < 0) {
@@ -3019,17 +3073,16 @@ ListboxSelect(listPtr, first, last, select)
*
* ListboxFetchSelection --
*
- * This procedure is called back by Tk when the selection is
- * requested by someone. It returns part or all of the selection
- * in a buffer provided by the caller.
+ * This procedure is called back by Tk when the selection is requested by
+ * someone. It returns part or all of the selection in a buffer provided
+ * by the caller.
*
* Results:
- * The return value is the number of non-NULL bytes stored
- * at buffer. Buffer is filled (or partially filled) with a
- * NULL-terminated string containing part or all of the selection,
- * as given by offset and maxBytes. The selection is returned
- * as a Tcl list with one list element for each element in the
- * listbox.
+ * The return value is the number of non-NULL bytes stored at buffer.
+ * Buffer is filled (or partially filled) with a NULL-terminated string
+ * containing part or all of the selection, as given by offset and
+ * maxBytes. The selection is returned as a Tcl list with one list
+ * element for each element in the listbox.
*
* Side effects:
* None.
@@ -3038,25 +3091,22 @@ ListboxSelect(listPtr, first, last, select)
*/
static int
-ListboxFetchSelection(clientData, offset, buffer, maxBytes)
- ClientData clientData; /* Information about listbox widget. */
- int offset; /* Offset within selection of first
- * byte to be returned. */
- char *buffer; /* Location in which to place
- * selection. */
- int maxBytes; /* Maximum number of bytes to place
- * at buffer, not including terminating
- * NULL character. */
+ListboxFetchSelection(
+ ClientData clientData, /* Information about listbox widget. */
+ int offset, /* Offset within selection of first byte to be
+ * returned. */
+ char *buffer, /* Location in which to place selection. */
+ int maxBytes) /* Maximum number of bytes to place at buffer,
+ * not including terminating NULL
+ * character. */
{
register Listbox *listPtr = (Listbox *) clientData;
Tcl_DString selection;
- int length, count, needNewline;
+ int length, count, needNewline, stringLen, i;
Tcl_Obj *curElement;
char *stringRep;
- int stringLen;
Tcl_HashEntry *entry;
- int i;
-
+
if (!listPtr->exportSelection) {
return -1;
}
@@ -3068,7 +3118,7 @@ ListboxFetchSelection(clientData, offset, buffer, maxBytes)
needNewline = 0;
Tcl_DStringInit(&selection);
for (i = 0; i < listPtr->nElements; i++) {
- entry = Tcl_FindHashEntry(listPtr->selection, (char *)i);
+ entry = Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i));
if (entry != NULL) {
if (needNewline) {
Tcl_DStringAppend(&selection, "\n", 1);
@@ -3097,9 +3147,7 @@ ListboxFetchSelection(clientData, offset, buffer, maxBytes)
if (count > maxBytes) {
count = maxBytes;
}
- memcpy((VOID *) buffer,
- (VOID *) (Tcl_DStringValue(&selection) + offset),
- (size_t) count);
+ memcpy(buffer, Tcl_DStringValue(&selection) + offset, (size_t) count);
}
buffer[count] = '\0';
Tcl_DStringFree(&selection);
@@ -3111,25 +3159,25 @@ ListboxFetchSelection(clientData, offset, buffer, maxBytes)
*
* ListboxLostSelection --
*
- * This procedure is called back by Tk when the selection is
- * grabbed away from a listbox widget.
+ * This procedure is called back by Tk when the selection is grabbed away
+ * from a listbox widget.
*
* Results:
* None.
*
* Side effects:
- * The existing selection is unhighlighted, and the window is
- * marked as not containing a selection.
+ * The existing selection is unhighlighted, and the window is marked as
+ * not containing a selection.
*
*----------------------------------------------------------------------
*/
static void
-ListboxLostSelection(clientData)
- ClientData clientData; /* Information about listbox widget. */
+ListboxLostSelection(
+ ClientData clientData) /* Information about listbox widget. */
{
register Listbox *listPtr = (Listbox *) clientData;
-
+
if ((listPtr->exportSelection) && (listPtr->nElements > 0)) {
ListboxSelect(listPtr, 0, listPtr->nElements-1, 0);
}
@@ -3140,8 +3188,8 @@ ListboxLostSelection(clientData)
*
* EventuallyRedrawRange --
*
- * Ensure that a given range of elements is eventually redrawn on
- * the display (if those elements in fact appear on the display).
+ * Ensure that a given range of elements is eventually redrawn on the
+ * display (if those elements in fact appear on the display).
*
* Results:
* None.
@@ -3153,17 +3201,19 @@ ListboxLostSelection(clientData)
*/
static void
-EventuallyRedrawRange(listPtr, first, last)
- register Listbox *listPtr; /* Information about widget. */
- int first; /* Index of first element in list
- * that needs to be redrawn. */
- int last; /* Index of last element in list
- * that needs to be redrawn. May
- * be less than first;
- * these just bracket a range. */
+EventuallyRedrawRange(
+ register Listbox *listPtr, /* Information about widget. */
+ int first, /* Index of first element in list that needs
+ * to be redrawn. */
+ int last) /* Index of last element in list that needs to
+ * be redrawn. May be less than first; these
+ * just bracket a range. */
{
- /* We don't have to register a redraw callback if one is already pending,
- * or if the window doesn't exist, or if the window isn't mapped */
+ /*
+ * We don't have to register a redraw callback if one is already pending,
+ * or if the window doesn't exist, or if the window isn't mapped.
+ */
+
if ((listPtr->flags & REDRAW_PENDING)
|| (listPtr->flags & LISTBOX_DELETED)
|| !Tk_IsMapped(listPtr->tkwin)) {
@@ -3178,30 +3228,30 @@ EventuallyRedrawRange(listPtr, first, last)
*
* ListboxUpdateVScrollbar --
*
- * This procedure is invoked whenever information has changed in
- * a listbox in a way that would invalidate a vertical scrollbar
- * display. If there is an associated scrollbar, then this command
- * updates it by invoking a Tcl command.
+ * This procedure is invoked whenever information has changed in a
+ * listbox in a way that would invalidate a vertical scrollbar display.
+ * If there is an associated scrollbar, then this command updates it by
+ * invoking a Tcl command.
*
* Results:
* None.
*
* Side effects:
- * A Tcl command is invoked, and an additional command may be
- * invoked to process errors in the command.
+ * A Tcl command is invoked, and an additional command may be invoked to
+ * process errors in the command.
*
*----------------------------------------------------------------------
*/
static void
-ListboxUpdateVScrollbar(listPtr)
- register Listbox *listPtr; /* Information about widget. */
+ListboxUpdateVScrollbar(
+ register Listbox *listPtr) /* Information about widget. */
{
- char string[TCL_DOUBLE_SPACE * 2];
+ char firstStr[TCL_DOUBLE_SPACE+1], lastStr[TCL_DOUBLE_SPACE+1];
double first, last;
int result;
Tcl_Interp *interp;
-
+
if (listPtr->yScrollCmd == NULL) {
return;
}
@@ -3209,30 +3259,32 @@ ListboxUpdateVScrollbar(listPtr)
first = 0.0;
last = 1.0;
} else {
- first = listPtr->topIndex/((double) listPtr->nElements);
- last = (listPtr->topIndex+listPtr->fullLines)
- /((double) listPtr->nElements);
+ first = listPtr->topIndex / (double) listPtr->nElements;
+ last = (listPtr->topIndex + listPtr->fullLines)
+ / (double) listPtr->nElements;
if (last > 1.0) {
last = 1.0;
}
}
- sprintf(string, " %g %g", first, last);
+ firstStr[0] = lastStr[0] = ' ';
+ Tcl_PrintDouble(NULL, first, firstStr+1);
+ Tcl_PrintDouble(NULL, last, lastStr+1);
/*
- * We must hold onto the interpreter from the listPtr because the data
- * at listPtr might be freed as a result of the Tcl_VarEval.
+ * We must hold onto the interpreter from the listPtr because the data at
+ * listPtr might be freed as a result of the Tcl_VarEval.
*/
-
+
interp = listPtr->interp;
- Tcl_Preserve((ClientData) interp);
- result = Tcl_VarEval(interp, listPtr->yScrollCmd, string,
- (char *) NULL);
+ Tcl_Preserve(interp);
+ 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_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -3240,26 +3292,26 @@ ListboxUpdateVScrollbar(listPtr)
*
* ListboxUpdateHScrollbar --
*
- * This procedure is invoked whenever information has changed in
- * a listbox in a way that would invalidate a horizontal scrollbar
- * display. If there is an associated horizontal scrollbar, then
- * this command updates it by invoking a Tcl command.
+ * This procedure is invoked whenever information has changed in a
+ * listbox in a way that would invalidate a horizontal scrollbar display.
+ * If there is an associated horizontal scrollbar, then this command
+ * updates it by invoking a Tcl command.
*
* Results:
* None.
*
* Side effects:
- * A Tcl command is invoked, and an additional command may be
- * invoked to process errors in the command.
+ * A Tcl command is invoked, and an additional command may be invoked to
+ * process errors in the command.
*
*----------------------------------------------------------------------
*/
static void
-ListboxUpdateHScrollbar(listPtr)
- register Listbox *listPtr; /* Information about widget. */
+ListboxUpdateHScrollbar(
+ register Listbox *listPtr) /* Information about widget. */
{
- char string[TCL_DOUBLE_SPACE * 2];
+ char firstStr[TCL_DOUBLE_SPACE+1], lastStr[TCL_DOUBLE_SPACE+1];
int result, windowWidth;
double first, last;
Tcl_Interp *interp;
@@ -3273,30 +3325,33 @@ ListboxUpdateHScrollbar(listPtr)
first = 0;
last = 1.0;
} else {
- first = listPtr->xOffset/((double) listPtr->maxWidth);
- last = (listPtr->xOffset + windowWidth)
- /((double) listPtr->maxWidth);
+ register double maxWide = (double) listPtr->maxWidth;
+
+ first = listPtr->xOffset / maxWide;
+ last = (listPtr->xOffset + windowWidth) / maxWide;
if (last > 1.0) {
last = 1.0;
}
}
- sprintf(string, " %g %g", first, last);
+ firstStr[0] = lastStr[0] = ' ';
+ Tcl_PrintDouble(NULL, first, firstStr+1);
+ Tcl_PrintDouble(NULL, last, lastStr+1);
/*
* We must hold onto the interpreter because the data referred to at
* listPtr might be freed as a result of the call to Tcl_VarEval.
*/
-
+
interp = listPtr->interp;
- Tcl_Preserve((ClientData) interp);
- result = Tcl_VarEval(interp, listPtr->xScrollCmd, string,
- (char *) NULL);
+ Tcl_Preserve(interp);
+ 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_Release((ClientData) interp);
+ Tcl_Release(interp);
}
/*
@@ -3304,60 +3359,72 @@ ListboxUpdateHScrollbar(listPtr)
*
* ListboxListVarProc --
*
- * Called whenever the trace on the listbox list var fires.
+ * Called whenever the trace on the listbox list var fires.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * None.
+ * None.
*
*----------------------------------------------------------------------
*/
static char *
-ListboxListVarProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Information about button. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Not used. */
- CONST char *name2; /* Not used. */
- int flags; /* Information about what happened. */
+ListboxListVarProc(
+ ClientData clientData, /* Information about button. */
+ Tcl_Interp *interp, /* Interpreter containing variable. */
+ const char *name1, /* Not used. */
+ const char *name2, /* Not used. */
+ int flags) /* Information about what happened. */
{
Listbox *listPtr = (Listbox *)clientData;
Tcl_Obj *oldListObj, *varListObj;
- int oldLength;
- int i;
+ int oldLength, i;
Tcl_HashEntry *entry;
-
- /* Bwah hahahaha -- puny mortal, you can't unset a -listvar'd variable! */
+
+ /*
+ * Bwah hahahaha! Puny mortal, you can't unset a -listvar'd variable!
+ */
+
if (flags & TCL_TRACE_UNSETS) {
if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
- Tcl_SetVar2Ex(interp, listPtr->listVarName,
- (char *)NULL, listPtr->listObj, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL,
+ listPtr->listObj, TCL_GLOBAL_ONLY);
Tcl_TraceVar(interp, listPtr->listVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ListboxListVarProc, clientData);
- return (char *)NULL;
+ return NULL;
}
} else {
oldListObj = listPtr->listObj;
varListObj = Tcl_GetVar2Ex(listPtr->interp, listPtr->listVarName,
- (char *)NULL, TCL_GLOBAL_ONLY);
+ NULL, TCL_GLOBAL_ONLY);
+
/*
- * Make sure the new value is a good list; if it's not, disallow
- * the change -- the fact that it is a listvar means that it must
- * always be a valid list -- and return an error message.
+ * Make sure the new value is a good list; if it's not, disallow the
+ * change - the fact that it is a listvar means that it must always be
+ * a valid list - and return an error message.
*/
+
if (Tcl_ListObjLength(listPtr->interp, varListObj, &i) != TCL_OK) {
- Tcl_SetVar2Ex(interp, listPtr->listVarName, (char *)NULL,
- oldListObj, TCL_GLOBAL_ONLY);
- return("invalid listvar value");
+ Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, oldListObj,
+ TCL_GLOBAL_ONLY);
+ return (char *) "invalid listvar value";
}
-
+
listPtr->listObj = varListObj;
- /* Incr the obj ref count so it doesn't vanish if the var is unset */
+
+ /*
+ * Incr the obj ref count so it doesn't vanish if the var is unset.
+ */
+
Tcl_IncrRefCount(listPtr->listObj);
- /* Clean up the ref to our old list obj */
+
+ /*
+ * Clean up the ref to our old list obj.
+ */
+
Tcl_DecrRefCount(oldListObj);
}
@@ -3365,21 +3432,29 @@ ListboxListVarProc(clientData, interp, name1, name2, flags)
* If the list length has decreased, then we should clean up selection and
* attributes information for elements past the end of the new list
*/
+
oldLength = listPtr->nElements;
Tcl_ListObjLength(listPtr->interp, listPtr->listObj, &listPtr->nElements);
if (listPtr->nElements < oldLength) {
for (i = listPtr->nElements; i < oldLength; i++) {
- /* Clean up selection */
- entry = Tcl_FindHashEntry(listPtr->selection, (char *)i);
+ /*
+ * Clean up selection.
+ */
+
+ entry = Tcl_FindHashEntry(listPtr->selection, (char *) INT2PTR(i));
if (entry != NULL) {
listPtr->numSelected--;
Tcl_DeleteHashEntry(entry);
}
- /* Clean up attributes */
- entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i);
+ /*
+ * Clean up attributes.
+ */
+
+ entry = Tcl_FindHashEntry(listPtr->itemAttrTable,
+ (char *) INT2PTR(i));
if (entry != NULL) {
- ckfree((char *)Tcl_GetHashValue(entry));
+ ckfree((char *) Tcl_GetHashValue(entry));
Tcl_DeleteHashEntry(entry);
}
}
@@ -3398,14 +3473,15 @@ ListboxListVarProc(clientData, interp, name1, name2, flags)
/*
* The computed maxWidth may have changed as a result of this operation.
* However, we don't want to recompute it every time this trace fires
- * (imagine the user doing 1000 lappends to the listvar). Therefore, set
+ * (imagine the user doing 1000 lappends to the listvar). Therefore, set
* the MAXWIDTH_IS_STALE flag, which will cause the width to be recomputed
* next time the list is redrawn.
*/
+
listPtr->flags |= MAXWIDTH_IS_STALE;
-
+
EventuallyRedrawRange(listPtr, 0, listPtr->nElements-1);
- return (char*)NULL;
+ return NULL;
}
/*
@@ -3413,10 +3489,10 @@ ListboxListVarProc(clientData, interp, name1, name2, flags)
*
* MigrateHashEntries --
*
- * Given a hash table with entries keyed by a single integer value,
- * move all entries in a given range by a fixed amount, so that
- * if in the original table there was an entry with key n and
- * the offset was i, in the new table that entry would have key n + i.
+ * Given a hash table with entries keyed by a single integer value, move
+ * all entries in a given range by a fixed amount, so that if in the
+ * original table there was an entry with key n and the offset was i, in
+ * the new table that entry would have key n + i.
*
* Results:
* None.
@@ -3428,39 +3504,45 @@ ListboxListVarProc(clientData, interp, name1, name2, flags)
*/
static void
-MigrateHashEntries(table, first, last, offset)
- Tcl_HashTable *table;
- int first;
- int last;
- int offset;
+MigrateHashEntries(
+ Tcl_HashTable *table,
+ int first,
+ int last,
+ int offset)
{
- int i, new;
+ int i, isNew;
Tcl_HashEntry *entry;
ClientData clientData;
if (offset == 0) {
return;
}
- /* It's more efficient to do one if/else and nest the for loops inside,
+
+ /*
+ * It's more efficient to do one if/else and nest the for loops inside,
* although we could avoid some code duplication if we nested the if/else
- * inside the for loops */
+ * inside the for loops.
+ */
+
if (offset > 0) {
for (i = last; i >= first; i--) {
- entry = Tcl_FindHashEntry(table, (char *)i);
+ entry = Tcl_FindHashEntry(table, (char *) INT2PTR(i));
if (entry != NULL) {
clientData = Tcl_GetHashValue(entry);
Tcl_DeleteHashEntry(entry);
- entry = Tcl_CreateHashEntry(table, (char *)(i + offset), &new);
+ entry = Tcl_CreateHashEntry(table,
+ (char *) INT2PTR(i + offset), &isNew);
Tcl_SetHashValue(entry, clientData);
}
}
} else {
for (i = first; i <= last; i++) {
- entry = Tcl_FindHashEntry(table, (char *)i);
+ entry = Tcl_FindHashEntry(table, (char *) INT2PTR(i));
if (entry != NULL) {
clientData = Tcl_GetHashValue(entry);
Tcl_DeleteHashEntry(entry);
- entry = Tcl_CreateHashEntry(table, (char *)(i + offset), &new);
+ entry = Tcl_CreateHashEntry(table,
+ (char *) INT2PTR(i + offset), &isNew);
Tcl_SetHashValue(entry, clientData);
}
}
@@ -3468,3 +3550,10 @@ MigrateHashEntries(table, first, last, offset)
return;
}
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c
index 7138c7d..9351de1 100644
--- a/generic/tkMacWinMenu.c
+++ b/generic/tkMacWinMenu.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkMacWinMenu.c --
*
* This module implements the common elements of the Mac and Windows
@@ -6,10 +6,11 @@
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkMenu.h"
typedef struct ThreadSpecificData {
@@ -17,9 +18,7 @@ typedef struct ThreadSpecificData {
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
-
-static int PreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
-
+static int PreprocessMenu(TkMenu *menuPtr);
/*
*----------------------------------------------------------------------
@@ -29,8 +28,8 @@ static int PreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
* The guts of the preprocessing. Recursive.
*
* Results:
- * The return value is a standard Tcl result (errors can occur
- * while the postcommands are being processed).
+ * The return value is a standard Tcl result (errors can occur while the
+ * postcommands are being processed).
*
* Side effects:
* Since commands can get executed while this routine is being executed,
@@ -40,61 +39,59 @@ static int PreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
*/
static int
-PreprocessMenu(menuPtr)
- TkMenu *menuPtr;
+PreprocessMenu(
+ TkMenu *menuPtr)
{
int index, result, finished;
- TkMenu *cascadeMenuPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
Tcl_Preserve((ClientData) menuPtr);
-
+
/*
* First, let's process the post command on ourselves. If this command
* destroys this menu, or if there was an error, we are done.
*/
-
+
result = TkPostCommand(menuPtr);
if ((result != TCL_OK) || (menuPtr->tkwin == NULL)) {
- goto done;
+ goto done;
}
-
+
/*
- * Now, we go through structure and process all of the commands.
- * Since the structure is changing, we stop after we do one command,
- * and start over. When we get through without doing any, we are done.
+ * Now, we go through structure and process all of the commands. Since the
+ * structure is changing, we stop after we do one command, and start over.
+ * When we get through without doing any, we are done.
*/
-
-
+
do {
- finished = 1;
- for (index = 0; index < menuPtr->numEntries; index++) {
- if ((menuPtr->entries[index]->type == CASCADE_ENTRY)
- && (menuPtr->entries[index]->namePtr != NULL)) {
- if ((menuPtr->entries[index]->childMenuRefPtr != NULL)
- && (menuPtr->entries[index]->childMenuRefPtr->menuPtr
- != NULL)) {
- cascadeMenuPtr =
- menuPtr->entries[index]->childMenuRefPtr->menuPtr;
- if (cascadeMenuPtr->postCommandGeneration !=
- tsdPtr->postCommandGeneration) {
- cascadeMenuPtr->postCommandGeneration =
- tsdPtr->postCommandGeneration;
- result = PreprocessMenu(cascadeMenuPtr);
- if (result != TCL_OK) {
- goto done;
- }
- finished = 0;
- break;
- }
- }
- }
- }
+ finished = 1;
+ for (index = 0; index < menuPtr->numEntries; index++) {
+ register TkMenuEntry *entryPtr = menuPtr->entries[index];
+
+ if ((entryPtr->type == CASCADE_ENTRY)
+ && (entryPtr->namePtr != NULL)
+ && (entryPtr->childMenuRefPtr != NULL)
+ && (entryPtr->childMenuRefPtr->menuPtr != NULL)) {
+ TkMenu *cascadeMenuPtr = entryPtr->childMenuRefPtr->menuPtr;
+
+ if (cascadeMenuPtr->postCommandGeneration !=
+ tsdPtr->postCommandGeneration) {
+ cascadeMenuPtr->postCommandGeneration =
+ tsdPtr->postCommandGeneration;
+ result = PreprocessMenu(cascadeMenuPtr);
+ if (result != TCL_OK) {
+ goto done;
+ }
+ finished = 0;
+ break;
+ }
+ }
+ }
} while (!finished);
-
- done:
- Tcl_Release((ClientData)menuPtr);
+
+ done:
+ Tcl_Release((ClientData) menuPtr);
return result;
}
@@ -103,23 +100,23 @@ PreprocessMenu(menuPtr)
*
* TkPreprocessMenu --
*
- * On the Mac and on Windows, all of the postcommand processing has
- * to be done on the entire tree underneath the main window to be
- * posted. This means that we have to traverse the menu tree and
- * issue the postcommands for all of the menus that have cascades
- * attached. Since the postcommands can change the menu structure while
- * we are traversing, we have to be extremely careful. Basically, the
- * idea is to traverse the structure until we succesfully process
- * one postcommand. Then we start over, and do it again until
- * we traverse the whole structure without processing any postcommands.
+ * On the Mac and on Windows, all of the postcommand processing has to be
+ * done on the entire tree underneath the main window to be posted. This
+ * means that we have to traverse the menu tree and issue the
+ * postcommands for all of the menus that have cascades attached. Since
+ * the postcommands can change the menu structure while we are
+ * traversing, we have to be extremely careful. Basically, the idea is to
+ * traverse the structure until we succesfully process one postcommand.
+ * Then we start over, and do it again until we traverse the whole
+ * structure without processing any postcommands.
*
- * We are also going to set up the cascade back pointers in here
- * since we have to traverse the entire structure underneath the menu
- * anyway, We can clear the postcommand marks while we do that.
+ * We are also going to set up the cascade back pointers in here since we
+ * have to traverse the entire structure underneath the menu anyway. We
+ * can clear the postcommand marks while we do that.
*
* Results:
- * The return value is a standard Tcl result (errors can occur
- * while the postcommands are being processed).
+ * The return value is a standard Tcl result (errors can occur while the
+ * postcommands are being processed).
*
* Side effects:
* Since commands can get executed while this routine is being executed,
@@ -129,13 +126,21 @@ PreprocessMenu(menuPtr)
*/
int
-TkPreprocessMenu(menuPtr)
- TkMenu *menuPtr;
+TkPreprocessMenu(
+ TkMenu *menuPtr)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->postCommandGeneration++;
menuPtr->postCommandGeneration = tsdPtr->postCommandGeneration;
return PreprocessMenu(menuPtr);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMain.c b/generic/tkMain.c
index 34f9054..39465c9 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -1,31 +1,21 @@
-/*
+/*
* tkMain.c --
*
* This file contains a generic main program for Tk-based applications.
* It can be used as-is for many applications, just by supplying a
- * different appInitProc procedure for each specific application.
- * Or, it can be used as a template for creating new main programs
- * for Tk applications.
+ * different appInitProc function for each specific application. Or, it
+ * can be used as a template for creating new main programs for Tk
+ * applications.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <tcl.h>
-#include <tclInt.h>
-#include <tk.h>
+#include "tclInt.h"
#include "tkInt.h"
-#ifdef NO_STDLIB_H
-# include "../compat/stdlib.h"
-#else
-# include <stdlib.h>
-#endif
#ifdef __WIN32__
#include "tkWinInt.h"
#endif
@@ -35,42 +25,36 @@
typedef struct ThreadSpecificData {
- Tcl_Interp *interp; /* Interpreter for this thread. */
- Tcl_DString command; /* Used to assemble lines of terminal input
+ 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
+ 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. */
+ int tty; /* Non-zero means standard input is a
+ * terminal-like device. Zero means it's a
+ * file. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * Declarations for various library procedures and variables (don't want
- * to include tkInt.h or tkPort.h here, because people might copy this
- * file out of the Tk source directory to make their own modified versions).
- * Note: don't declare "exit" here even though a declaration is really
- * needed, because it will conflict with a declaration elsewhere on
- * some systems.
+ * Declarations for various library functions and variables (don't want to
+ * include tkInt.h or tkPort.h here, because people might copy this file out
+ * of the Tk source directory to make their own modified versions). Note: do
+ * not declare "exit" here even though a declaration is really needed, because
+ * it will conflict with a declaration elsewhere on some systems.
*/
#if !defined(__WIN32__) && !defined(_WIN32)
-#if !defined(MAC_TCL)
-extern int isatty _ANSI_ARGS_((int fd));
-#else
-#include <unistd.h>
-#endif
-extern char * strrchr _ANSI_ARGS_((CONST char *string, int c));
+extern int isatty(int fd);
+extern char * strrchr(CONST char *string, int c);
#endif
/*
- * Forward declarations for procedures defined later in this file.
+ * Forward declarations for functions defined later in this file.
*/
-static void Prompt _ANSI_ARGS_((Tcl_Interp *interp, int partial));
-static void StdinProc _ANSI_ARGS_((ClientData clientData,
- int mask));
+static void Prompt(Tcl_Interp *interp, int partial);
+static void StdinProc(ClientData clientData, int mask);
/*
*----------------------------------------------------------------------
@@ -80,98 +64,113 @@ static void StdinProc _ANSI_ARGS_((ClientData clientData,
* Main program for Wish and most other Tk-based applications.
*
* Results:
- * None. This procedure never returns (it exits the process when
- * it's done.
+ * None. This function never returns (it exits the process when it's
+ * done.
*
* Side effects:
- * This procedure initializes the Tk world and then starts
- * interpreting commands; almost anything could happen, depending
- * on the script being interpreted.
+ * This function initializes the Tk world and then starts interpreting
+ * commands; almost anything could happen, depending on the script being
+ * interpreted.
*
*----------------------------------------------------------------------
*/
+
void
-Tk_MainEx(argc, argv, appInitProc, interp)
- int argc; /* Number of arguments. */
- char **argv; /* Array of argument strings. */
- Tcl_AppInitProc *appInitProc; /* Application-specific initialization
- * procedure to call after most
- * initialization but before starting
- * to execute commands. */
- Tcl_Interp *interp;
+Tk_MainEx(
+ int argc, /* Number of arguments. */
+ char **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 *argvPtr;
+ Tcl_Obj *path, *argvPtr;
+ CONST char *encodingName;
int code, nullStdin = 0;
- size_t length;
Tcl_Channel inChannel, outChannel;
- Tcl_DString appName;
ThreadSpecificData *tsdPtr;
#ifdef __WIN32__
HANDLE handle;
#endif
+ Tcl_DString appName;
/*
- * Ensure that we are getting the matching version of Tcl. This is
- * really only an issue when Tk is loaded dynamically.
+ * Ensure that we are getting the matching version of Tcl. This is really
+ * only an issue when Tk is loaded dynamically.
*/
- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
abort();
}
- tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
+ tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
Tcl_FindExecutable(argv[0]);
tsdPtr->interp = interp;
Tcl_Preserve((ClientData) interp);
-#if (defined(__WIN32__) || defined(MAC_TCL))
+#if defined(__WIN32__)
Tk_InitConsoleChannels(interp);
#endif
#ifdef MAC_OSX_TK
- if (TclGetStartupScriptFileName() == NULL) {
- TkMacOSXDefaultStartupScript();
+ if (Tcl_GetStartupScript(NULL) == NULL) {
+ TkMacOSXDefaultStartupScript();
}
#endif
-
+
#ifdef TCL_MEM_DEBUG
Tcl_InitMemory(interp);
#endif
/*
- * Parse command-line arguments. A leading "-file" argument is
- * ignored (a historical relic from the distant past). If the
- * next argument doesn't start with a "-" then strip it off and
- * use it as the name of a script file to process.
+ * If the application has not already set a startup script, parse the
+ * first few command line arguments to determine the script path and
+ * encoding.
*/
- if (argc > 1) {
- length = strlen(argv[1]);
- if ((length >= 2) && (strncmp(argv[1], "-file", length) == 0)) {
- argc--;
- argv++;
- }
- }
- if (TclGetStartupScriptFileName() == NULL) {
- if ((argc > 1) && (argv[1][0] != '-')) {
- TclSetStartupScriptFileName(argv[1]);
+ if (NULL == Tcl_GetStartupScript(NULL)) {
+ size_t length;
+
+ /*
+ * Check whether first 3 args (argv[1] - argv[3]) look like
+ * -encoding ENCODING FILENAME
+ * or like
+ * FILENAME
+ * or like
+ * -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]);
+ argc -= 3;
+ argv += 3;
+ } else if ((argc > 1) && ('-' != argv[1][0])) {
+ Tcl_SetStartupScript(Tcl_NewStringObj(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);
+ argc -= 2;
+ argv += 2;
}
}
-
- /*
- * Make command-line arguments available in the Tcl variables "argc"
- * and "argv".
- */
- if (TclGetStartupScriptFileName() == NULL) {
+ path = Tcl_GetStartupScript(&encodingName);
+ if (NULL == path) {
Tcl_ExternalToUtfDString(NULL, argv[0], -1, &appName);
} else {
- TclSetStartupScriptFileName(Tcl_ExternalToUtfDString(NULL,
- TclGetStartupScriptFileName(), -1, &appName));
+ 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);
}
Tcl_SetVar(interp, "argv0", Tcl_DStringValue(&appName), TCL_GLOBAL_ONLY);
Tcl_DStringFree(&appName);
@@ -183,6 +182,7 @@ Tk_MainEx(argc, argv, appInitProc, interp)
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)));
@@ -197,18 +197,18 @@ Tk_MainEx(argc, argv, appInitProc, interp)
#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.
+ * 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)
+ 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.
+ * If it's a bad or closed handle, then it's been connected to a wish
+ * console window.
*/
tsdPtr->tty = 1;
@@ -239,8 +239,8 @@ Tk_MainEx(argc, argv, appInitProc, interp)
}
#endif
Tcl_SetVar(interp, "tcl_interactive",
- ((TclGetStartupScriptFileName() == NULL) && (tsdPtr->tty
- || nullStdin)) ? "1" : "0", TCL_GLOBAL_ONLY);
+ ((path == NULL) && (tsdPtr->tty || nullStdin)) ? "1" : "0",
+ TCL_GLOBAL_ONLY);
/*
* Invoke application-specific initialization.
@@ -252,16 +252,18 @@ Tk_MainEx(argc, argv, appInitProc, interp)
}
/*
- * Invoke the script specified on the command line, if any.
+ * Invoke the script specified on the command line, if any. Must fetch it
+ * again, as the appInitProc might have reset it.
*/
- if (TclGetStartupScriptFileName() != NULL) {
+ path = Tcl_GetStartupScript(&encodingName);
+ if (path != NULL) {
Tcl_ResetResult(interp);
- code = Tcl_EvalFile(interp, TclGetStartupScriptFileName());
+ code = Tcl_FSEvalFileEx(interp, path, encodingName);
if (code != TCL_OK) {
/*
- * The following statement guarantees that the errorInfo
- * variable is set properly.
+ * The following statement guarantees that the errorInfo variable
+ * is set properly.
*/
Tcl_AddErrorInfo(interp, "");
@@ -302,13 +304,14 @@ Tk_MainEx(argc, argv, appInitProc, interp)
Tcl_ResetResult(interp);
/*
- * Loop infinitely, waiting for commands to execute. When there
- * are no windows left, Tk_MainLoop returns and we exit.
+ * Loop infinitely, waiting for commands to execute. When there are no
+ * windows left, Tk_MainLoop returns and we exit.
*/
Tk_MainLoop();
Tcl_DeleteInterp(interp);
Tcl_Release((ClientData) interp);
+ Tcl_SetStartupScript(NULL, NULL);
Tcl_Exit(0);
}
@@ -317,69 +320,65 @@ Tk_MainEx(argc, argv, appInitProc, interp)
*
* StdinProc --
*
- * This procedure is invoked by the event dispatcher whenever
- * standard input becomes readable. It grabs the next line of
- * input characters, adds them to a command being assembled, and
- * executes the command if it's complete.
+ * This function is invoked by the event dispatcher whenever standard
+ * input becomes readable. It grabs the next line of input characters,
+ * adds them to a command being assembled, and executes the command if
+ * it's complete.
*
* Results:
* None.
*
* Side effects:
- * Could be almost arbitrary, depending on the command that's
- * typed.
+ * Could be almost arbitrary, depending on the command that's typed.
*
*----------------------------------------------------------------------
*/
/* ARGSUSED */
static void
-StdinProc(clientData, mask)
- ClientData clientData; /* Not used. */
- int mask; /* Not used. */
+StdinProc(
+ ClientData clientData, /* Not used. */
+ 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));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Interp *interp = tsdPtr->interp;
count = Tcl_Gets(chan, &tsdPtr->line);
- if (count < 0) {
- if (!gotPartial) {
- if (tsdPtr->tty) {
- Tcl_Exit(0);
- } else {
- Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
- }
- return;
- }
+ if (count < 0 && !gotPartial) {
+ if (tsdPtr->tty) {
+ Tcl_Exit(0);
+ } else {
+ Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan);
+ }
+ return;
}
(void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue(
- &tsdPtr->line), -1);
+ &tsdPtr->line), -1);
cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1);
Tcl_DStringFree(&tsdPtr->line);
if (!Tcl_CommandComplete(cmd)) {
- gotPartial = 1;
- goto prompt;
+ gotPartial = 1;
+ goto prompt;
}
gotPartial = 0;
/*
* Disable the stdin channel handler while evaluating the command;
- * otherwise if the command re-enters the event loop we might
- * process commands from stdin before the current command is
- * finished. Among other things, this will trash the text of the
- * command being evaluated.
+ * otherwise if the command re-enters the event loop we might process
+ * commands from stdin before the current command is finished. Among other
+ * things, this will trash the text of the command being evaluated.
*/
Tcl_CreateChannelHandler(chan, 0, StdinProc, (ClientData) chan);
code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL);
-
+
chan = Tcl_GetStdChannel(TCL_STDIN);
if (chan) {
Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc,
@@ -400,7 +399,7 @@ StdinProc(clientData, mask)
* Output a prompt.
*/
- prompt:
+ prompt:
if (tsdPtr->tty) {
Prompt(interp, gotPartial);
}
@@ -412,25 +411,24 @@ StdinProc(clientData, mask)
*
* Prompt --
*
- * Issue a prompt on standard output, or invoke a script
- * to issue the prompt.
+ * Issue a prompt on standard output, or invoke a script to issue the
+ * prompt.
*
* Results:
* None.
*
* Side effects:
- * A prompt gets output, and a Tcl script may be evaluated
- * in interp.
+ * A prompt gets output, and a Tcl script may be evaluated in interp.
*
*----------------------------------------------------------------------
*/
static void
-Prompt(interp, partial)
- Tcl_Interp *interp; /* Interpreter to use for prompting. */
- int partial; /* Non-zero means there already
- * exists a partial command, so use
- * the secondary prompt. */
+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. */
{
Tcl_Obj *promptCmd;
int code;
@@ -439,41 +437,49 @@ Prompt(interp, partial)
promptCmd = Tcl_GetVar2Ex(interp,
partial ? "tcl_prompt2" : "tcl_prompt1", NULL, TCL_GLOBAL_ONLY);
if (promptCmd == NULL) {
-defaultPrompt:
+ 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".
- */
+ /*
+ * 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 (outChannel != (Tcl_Channel) NULL) {
+ Tcl_WriteChars(outChannel, "% ", 2);
+ }
}
} else {
code = Tcl_EvalObjEx(interp, promptCmd, 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".
- */
-
+
+ /*
+ * 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 (errChannel != (Tcl_Channel) NULL) {
+ Tcl_WriteObj(errChannel, Tcl_GetObjResult(interp));
+ Tcl_WriteChars(errChannel, "\n", 1);
+ }
goto defaultPrompt;
}
}
outChannel = Tcl_GetChannel(interp, "stdout", NULL);
if (outChannel != (Tcl_Channel) NULL) {
- Tcl_Flush(outChannel);
+ Tcl_Flush(outChannel);
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index c996df8..15af7a2 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -1,16 +1,16 @@
-/*
+/*
* tkMenu.c --
*
* This file contains most of the code for implementing menus in Tk. It takes
- * care of all of the generic (platform-independent) parts of menus, and
- * is supplemented by platform-specific files. The geometry calculation
- * and drawing code for menus is in the file tkMenuDraw.c
+ * care of all of the generic (platform-independent) parts of menus, and is
+ * supplemented by platform-specific files. The geometry calculation and
+ * drawing code for menus is in the file tkMenuDraw.c
*
* Copyright (c) 1990-1994 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.
*/
/*
@@ -18,52 +18,49 @@
*
* Menus can be used in three ways:
* - as a popup menu, either as part of a menubutton or standalone.
- * - as a menubar. The menu's cascade items are arranged according to
- * the specific platform to provide the user access to the menus at all
- * times
+ * - as a menubar. The menu's cascade items are arranged according to the
+ * specific platform to provide the user access to the menus at all times
* - as a tearoff palette. This is a window with the menu's items in it.
*
- * The goal is to provide the Tk developer with a way to use a common
- * set of menus for all of these tasks.
+ * The goal is to provide the Tk developer with a way to use a common set of
+ * menus for all of these tasks.
*
* In order to make the bindings for cascade menus work properly under Unix,
- * the cascade menus' pathnames must be proper children of the menu that
- * they are cascade from. So if there is a menu .m, and it has two
- * cascades labelled "File" and "Edit", the cascade menus might have
- * the pathnames .m.file and .m.edit. Another constraint is that the menus
- * used for menubars must be children of the toplevel widget that they
- * are attached to. And on the Macintosh, the platform specific menu handle
- * for cascades attached to a menu bar must have a title that matches the
- * label for the cascade menu.
+ * the cascade menus' pathnames must be proper children of the menu that they
+ * are cascade from. So if there is a menu .m, and it has two cascades
+ * labelled "File" and "Edit", the cascade menus might have the pathnames
+ * .m.file and .m.edit. Another constraint is that the menus used for menubars
+ * must be children of the toplevel widget that they are attached to. And on
+ * the Macintosh, the platform specific menu handle for cascades attached to a
+ * menu bar must have a title that matches the label for the cascade menu.
*
* To handle all of the constraints, Tk menubars and tearoff menus are
* implemented using menu clones. Menu clones are full menus in their own
- * right; they have a Tk window and pathname associated with them; they have
- * a TkMenu structure and array of entries. However, they are linked with the
- * original menu that they were cloned from. The reflect the attributes of
- * the original, or "master", menu. So if an item is added to a menu, and
- * that menu has clones, then the item must be added to all of its clones
- * also. Menus are cloned when a menu is torn-off or when a menu is assigned
- * as a menubar using the "-menu" option of the toplevel's pathname configure
+ * right; they have a Tk window and pathname associated with them; they have a
+ * TkMenu structure and array of entries. However, they are linked with the
+ * original menu that they were cloned from. The reflect the attributes of the
+ * original, or "master", menu. So if an item is added to a menu, and that
+ * menu has clones, then the item must be added to all of its clones also.
+ * Menus are cloned when a menu is torn-off or when a menu is assigned as a
+ * menubar using the "-menu" option of the toplevel's pathname configure
* subcommand. When a clone is destroyed, only the clone is destroyed, but
* when the master menu is destroyed, all clones are also destroyed. This
- * allows the developer to just deal with one set of menus when creating
- * and destroying.
+ * allows the developer to just deal with one set of menus when creating and
+ * destroying.
*
* Clones are rather tricky when a menu with cascade entries is cloned (such
* as a menubar). Not only does the menu have to be cloned, but each cascade
* entry's corresponding menu must also be cloned. This maintains the pathname
- * parent-child hierarchy necessary for menubars and toplevels to work.
- * This leads to several special cases:
+ * parent-child hierarchy necessary for menubars and toplevels to work. This
+ * leads to several special cases:
*
* 1. When a new menu is created, and it is pointed to by cascade entries in
* cloned menus, the new menu has to be cloned to parallel the cascade
* structure.
* 2. When a cascade item is added to a menu that has been cloned, and the
* menu that the cascade item points to exists, that menu has to be cloned.
- * 3. When the menu that a cascade entry points to is changed, the old
- * cloned cascade menu has to be discarded, and the new one has to be cloned.
- *
+ * 3. When the menu that a cascade entry points to is changed, the old cloned
+ * cascade menu has to be discarded, and the new one has to be cloned.
*/
#if 0
@@ -75,22 +72,21 @@
#define __NO_OLD_CONFIG
#endif
-#include "tkPort.h"
+#include "tkInt.h"
#include "tkMenu.h"
#define MENU_HASH_KEY "tkMenus"
typedef struct ThreadSpecificData {
- int menusInitialized; /* Flag indicates whether thread-specific
- * elements of the Windows Menu module
- * have been initialized. */
+ int menusInitialized; /* Flag indicates whether thread-specific
+ * elements of the Windows Menu module have
+ * been initialized. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
- * The following flag indicates whether the process-wide state for
- * the Menu module has been intialized. The Mutex protects access to
- * that flag.
+ * The following flag indicates whether the process-wide state for the Menu
+ * module has been intialized. The Mutex protects access to that flag.
*/
static int menusInitialized;
@@ -101,170 +97,171 @@ TCL_DECLARE_MUTEX(menuMutex)
* to update code in TkpMenuInit that changes the font string entry.
*/
-char *tkMenuStateStrings[] = {"active", "normal", "disabled", (char *) NULL};
+char *tkMenuStateStrings[] = {"active", "normal", "disabled", NULL};
static CONST char *menuEntryTypeStrings[] = {
- "cascade", "checkbutton", "command", "radiobutton", "separator",
- (char *) NULL
+ "cascade", "checkbutton", "command", "radiobutton", "separator", NULL
};
/*
- * The following table defines the legal values for the -compound option.
- * It is used with the "enum compound" declaration in tkMenu.h
+ * The following table defines the legal values for the -compound option. It
+ * is used with the "enum compound" declaration in tkMenu.h
*/
static char *compoundStrings[] = {
- "bottom", "center", "left", "none", "right", "top", (char *) NULL
+ "bottom", "center", "left", "none", "right", "top", NULL
};
-static Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
- {TK_OPTION_BORDER, "-activebackground", (char *) NULL, (char *) NULL,
- DEF_MENU_ENTRY_ACTIVE_BG, Tk_Offset(TkMenuEntry, activeBorderPtr), -1,
+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_COLOR, "-activeforeground", (char *) NULL, (char *) NULL,
+ {TK_OPTION_COLOR, "-activeforeground", NULL, NULL,
DEF_MENU_ENTRY_ACTIVE_FG,
Tk_Offset(TkMenuEntry, activeFgPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-accelerator", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-accelerator", NULL, NULL,
DEF_MENU_ENTRY_ACCELERATOR,
Tk_Offset(TkMenuEntry, accelPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_BORDER, "-background", (char *) NULL, (char *) NULL,
+ {TK_OPTION_BORDER, "-background", NULL, NULL,
DEF_MENU_ENTRY_BG,
Tk_Offset(TkMenuEntry, borderPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_BITMAP, "-bitmap", (char *) NULL, (char *) NULL,
+ {TK_OPTION_BITMAP, "-bitmap", NULL, NULL,
DEF_MENU_ENTRY_BITMAP,
Tk_Offset(TkMenuEntry, bitmapPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_BOOLEAN, "-columnbreak", (char *) NULL, (char *) NULL,
+ {TK_OPTION_BOOLEAN, "-columnbreak", NULL, NULL,
DEF_MENU_ENTRY_COLUMN_BREAK,
-1, Tk_Offset(TkMenuEntry, columnBreak)},
- {TK_OPTION_STRING, "-command", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-command", NULL, NULL,
DEF_MENU_ENTRY_COMMAND,
Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK},
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
- DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0,
+ DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0,
(ClientData) compoundStrings, 0},
- {TK_OPTION_FONT, "-font", (char *) NULL, (char *) NULL,
+ {TK_OPTION_FONT, "-font", NULL, NULL,
DEF_MENU_ENTRY_FONT,
Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_COLOR, "-foreground", (char *) NULL, (char *) NULL,
+ {TK_OPTION_COLOR, "-foreground", NULL, NULL,
DEF_MENU_ENTRY_FG,
Tk_Offset(TkMenuEntry, fgPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_BOOLEAN, "-hidemargin", (char *) NULL, (char *) NULL,
+ {TK_OPTION_BOOLEAN, "-hidemargin", NULL, NULL,
DEF_MENU_ENTRY_HIDE_MARGIN,
-1, Tk_Offset(TkMenuEntry, hideMargin)},
- {TK_OPTION_STRING, "-image", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-image", NULL, NULL,
DEF_MENU_ENTRY_IMAGE,
Tk_Offset(TkMenuEntry, imagePtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-label", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-label", NULL, NULL,
DEF_MENU_ENTRY_LABEL,
Tk_Offset(TkMenuEntry, labelPtr), -1, 0},
- {TK_OPTION_STRING_TABLE, "-state", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
DEF_MENU_ENTRY_STATE,
-1, Tk_Offset(TkMenuEntry, state), 0,
(ClientData) tkMenuStateStrings},
- {TK_OPTION_INT, "-underline", (char *) NULL, (char *) NULL,
+ {TK_OPTION_INT, "-underline", NULL, NULL,
DEF_MENU_ENTRY_UNDERLINE, -1, Tk_Offset(TkMenuEntry, underline)},
{TK_OPTION_END}
};
-static Tk_OptionSpec tkSeparatorEntryConfigSpecs[] = {
- {TK_OPTION_BORDER, "-background", (char *) NULL, (char *) NULL,
+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}
};
-static Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = {
- {TK_OPTION_BOOLEAN, "-indicatoron", (char *) NULL, (char *) NULL,
+static const Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = {
+ {TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
-1, Tk_Offset(TkMenuEntry, indicatorOn)},
- {TK_OPTION_STRING, "-offvalue", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-offvalue", NULL, NULL,
DEF_MENU_ENTRY_OFF_VALUE,
Tk_Offset(TkMenuEntry, offValuePtr), -1},
- {TK_OPTION_STRING, "-onvalue", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-onvalue", NULL, NULL,
DEF_MENU_ENTRY_ON_VALUE,
Tk_Offset(TkMenuEntry, onValuePtr), -1},
- {TK_OPTION_COLOR, "-selectcolor", (char *) NULL, (char *) NULL,
+ {TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-selectimage", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-selectimage", NULL, NULL,
DEF_MENU_ENTRY_SELECT_IMAGE,
Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-variable", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_CHECK_VARIABLE,
Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
};
-static Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = {
- {TK_OPTION_BOOLEAN, "-indicatoron", (char *) NULL, (char *) NULL,
+static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = {
+ {TK_OPTION_BOOLEAN, "-indicatoron", NULL, NULL,
DEF_MENU_ENTRY_INDICATOR,
-1, Tk_Offset(TkMenuEntry, indicatorOn)},
- {TK_OPTION_COLOR, "-selectcolor", (char *) NULL, (char *) NULL,
+ {TK_OPTION_COLOR, "-selectcolor", NULL, NULL,
DEF_MENU_ENTRY_SELECT,
Tk_Offset(TkMenuEntry, indicatorFgPtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-selectimage", (char *) NULL, (char *) NULL,
- DEF_MENU_ENTRY_SELECT_IMAGE,
+ {TK_OPTION_STRING, "-selectimage", NULL, NULL,
+ DEF_MENU_ENTRY_SELECT_IMAGE,
Tk_Offset(TkMenuEntry, selectImagePtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-value", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-value", NULL, NULL,
DEF_MENU_ENTRY_VALUE,
Tk_Offset(TkMenuEntry, onValuePtr), -1, TK_OPTION_NULL_OK},
- {TK_OPTION_STRING, "-variable", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING, "-variable", NULL, NULL,
DEF_MENU_ENTRY_RADIO_VARIABLE,
Tk_Offset(TkMenuEntry, namePtr), -1, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
};
-static Tk_OptionSpec tkCascadeEntryConfigSpecs[] = {
- {TK_OPTION_STRING, "-menu", (char *) NULL, (char *) NULL,
+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_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
+ {TK_OPTION_END, NULL, NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs}
};
-static Tk_OptionSpec tkTearoffEntryConfigSpecs[] = {
- {TK_OPTION_BORDER, "-background", (char *) NULL, (char *) NULL,
+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_OPTION_STRING_TABLE, "-state", (char *) NULL, (char *) NULL,
+ {TK_OPTION_STRING_TABLE, "-state", NULL, NULL,
DEF_MENU_ENTRY_STATE, -1, Tk_Offset(TkMenuEntry, state), 0,
(ClientData) tkMenuStateStrings},
{TK_OPTION_END}
};
-static Tk_OptionSpec *specsArray[] = {
+static const Tk_OptionSpec *specsArray[] = {
tkCascadeEntryConfigSpecs, tkCheckButtonEntryConfigSpecs,
tkBasicMenuEntryConfigSpecs, tkRadioButtonEntryConfigSpecs,
- tkSeparatorEntryConfigSpecs, tkTearoffEntryConfigSpecs};
-
+ tkSeparatorEntryConfigSpecs, tkTearoffEntryConfigSpecs
+};
+
/*
* Menu type strings for use with Tcl_GetIndexFromObj.
*/
-static CONST char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
- (char *) NULL};
+static const char *menuTypeStrings[] = {
+ "normal", "tearoff", "menubar", NULL
+};
-static Tk_OptionSpec tkMenuConfigSpecs[] = {
- {TK_OPTION_BORDER, "-activebackground", "activeBackground",
- "Foreground", DEF_MENU_ACTIVE_BG_COLOR,
+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},
{TK_OPTION_PIXELS, "-activeborderwidth", "activeBorderWidth",
- "BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
- Tk_Offset(TkMenu, activeBorderWidthPtr), -1},
- {TK_OPTION_COLOR, "-activeforeground", "activeForeground",
- "Background", DEF_MENU_ACTIVE_FG_COLOR,
+ "BorderWidth", DEF_MENU_ACTIVE_BORDER_WIDTH,
+ Tk_Offset(TkMenu, activeBorderWidthPtr), -1},
+ {TK_OPTION_COLOR, "-activeforeground", "activeForeground",
+ "Background", DEF_MENU_ACTIVE_FG_COLOR,
Tk_Offset(TkMenu, activeFgPtr), -1, 0,
(ClientData) DEF_MENU_ACTIVE_FG_MONO},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_MENU_BG_COLOR, Tk_Offset(TkMenu, borderPtr), -1, 0,
(ClientData) DEF_MENU_BG_MONO},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth"},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background"},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-borderwidth"},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-background"},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_MENU_BORDER_WIDTH,
Tk_Offset(TkMenu, borderWidthPtr), -1, 0},
@@ -275,14 +272,14 @@ static Tk_OptionSpec tkMenuConfigSpecs[] = {
"DisabledForeground", DEF_MENU_DISABLED_FG_COLOR,
Tk_Offset(TkMenu, disabledFgPtr), -1, TK_OPTION_NULL_OK,
(ClientData) DEF_MENU_DISABLED_FG_MONO},
- {TK_OPTION_SYNONYM, "-fg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground"},
+ {TK_OPTION_SYNONYM, "-fg", NULL, NULL,
+ NULL, 0, -1, 0, (ClientData) "-foreground"},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_MENU_FONT, Tk_Offset(TkMenu, fontPtr), -1},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
DEF_MENU_FG, Tk_Offset(TkMenu, fgPtr), -1},
{TK_OPTION_STRING, "-postcommand", "postCommand", "Command",
- DEF_MENU_POST_COMMAND,
+ DEF_MENU_POST_COMMAND,
Tk_Offset(TkMenu, postCommandPtr), -1, TK_OPTION_NULL_OK},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_MENU_RELIEF, Tk_Offset(TkMenu, reliefPtr), -1},
@@ -294,11 +291,11 @@ static Tk_OptionSpec tkMenuConfigSpecs[] = {
Tk_Offset(TkMenu, takeFocusPtr), -1, TK_OPTION_NULL_OK},
{TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff",
DEF_MENU_TEAROFF, -1, Tk_Offset(TkMenu, tearoff)},
- {TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand",
+ {TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand",
"TearOffCommand", DEF_MENU_TEAROFF_CMD,
Tk_Offset(TkMenu, tearoffCommandPtr), -1, TK_OPTION_NULL_OK},
{TK_OPTION_STRING, "-title", "title", "Title",
- DEF_MENU_TITLE, Tk_Offset(TkMenu, titlePtr), -1,
+ DEF_MENU_TITLE, Tk_Offset(TkMenu, titlePtr), -1,
TK_OPTION_NULL_OK},
{TK_OPTION_STRING_TABLE, "-type", "type", "Type",
DEF_MENU_TYPE, Tk_Offset(TkMenu, menuTypePtr), -1, TK_OPTION_NULL_OK,
@@ -307,73 +304,70 @@ static Tk_OptionSpec tkMenuConfigSpecs[] = {
};
/*
- * Command line options. Put here because MenuCmd has to look at them
- * along with MenuWidgetObjCmd.
+ * Command line options. Put here because MenuCmd has to look at them along
+ * with MenuWidgetObjCmd.
*/
static CONST char *menuOptions[] = {
"activate", "add", "cget", "clone", "configure", "delete", "entrycget",
"entryconfigure", "index", "insert", "invoke", "post", "postcascade",
- "type", "unpost", "yposition", (char *) NULL
+ "type", "unpost", "xposition", "yposition", NULL
};
enum options {
MENU_ACTIVATE, MENU_ADD, MENU_CGET, MENU_CLONE, MENU_CONFIGURE,
MENU_DELETE, MENU_ENTRYCGET, MENU_ENTRYCONFIGURE, MENU_INDEX,
MENU_INSERT, MENU_INVOKE, MENU_POST, MENU_POSTCASCADE, MENU_TYPE,
- MENU_UNPOST, MENU_YPOSITION
+ MENU_UNPOST, MENU_XPOSITION, MENU_YPOSITION
};
/*
- * Prototypes for static procedures in this file:
+ * Prototypes for static functions in this file:
*/
-static int CloneMenu _ANSI_ARGS_((TkMenu *menuPtr,
- Tcl_Obj *newMenuName, Tcl_Obj *newMenuTypeString));
-static int ConfigureMenu _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, int objc, Tcl_Obj *CONST objv[]));
-static int ConfigureMenuCloneEntries _ANSI_ARGS_((
- Tcl_Interp *interp, TkMenu *menuPtr, int index,
- int objc, Tcl_Obj *CONST objv[]));
-static int ConfigureMenuEntry _ANSI_ARGS_((TkMenuEntry *mePtr,
- int objc, Tcl_Obj *CONST objv[]));
-static void DeleteMenuCloneEntries _ANSI_ARGS_((TkMenu *menuPtr,
- int first, int last));
-static void DestroyMenuHashTable _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp));
-static void DestroyMenuInstance _ANSI_ARGS_((TkMenu *menuPtr));
-static void DestroyMenuEntry _ANSI_ARGS_((char *memPtr));
-static int GetIndexFromCoords
- _ANSI_ARGS_((Tcl_Interp *interp, TkMenu *menuPtr,
- char *string, int *indexPtr));
-static int MenuDoYPosition _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, Tcl_Obj *objPtr));
-static int MenuAddOrInsert _ANSI_ARGS_((Tcl_Interp *interp,
+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[]);
+static int ConfigureMenuCloneEntries(Tcl_Interp *interp,
+ TkMenu *menuPtr, int index,
+ int objc, Tcl_Obj *CONST objv[]);
+static int ConfigureMenuEntry(TkMenuEntry *mePtr,
+ 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 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[]));
-static int MenuCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static void MenuCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static TkMenuEntry * MenuNewEntry _ANSI_ARGS_((TkMenu *menuPtr, int index,
- int type));
-static char * MenuVarProc _ANSI_ARGS_((ClientData clientData,
+ Tcl_Obj *CONST objv[]);
+static int MenuCmd(ClientData clientData, Tcl_Interp *interp,
+ 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));
-static int MenuWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static void MenuWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static int PostProcessEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
-static void RecursivelyDeleteMenu _ANSI_ARGS_((TkMenu *menuPtr));
-static void UnhookCascadeEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
-static Tcl_ExitProc TkMenuCleanup;
+ CONST char *name2, int flags);
+static int MenuWidgetObjCmd(ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]);
+static void MenuWorldChanged(ClientData instanceData);
+static int PostProcessEntry(TkMenuEntry *mePtr);
+static void RecursivelyDeleteMenu(TkMenu *menuPtr);
+static void UnhookCascadeEntry(TkMenuEntry *mePtr);
+static void TkMenuCleanup(ClientData unused);
/*
* The structure below is a list of procs that respond to certain window
- * manager events. One of these includes a font change, which forces
- * the geometry proc to be called.
+ * manager events. One of these includes a font change, which forces the
+ * geometry proc to be called.
*/
static Tk_ClassProcs menuClass = {
@@ -386,8 +380,7 @@ static Tk_ClassProcs menuClass = {
*
* TkCreateMenuCmd --
*
- * Called by Tk at initialization time to create the menu
- * command.
+ * Called by Tk at initialization time to create the menu command.
*
* Results:
* A standard Tcl result.
@@ -407,14 +400,14 @@ FreeOptionTables(
}
int
-TkCreateMenuCmd(interp)
- Tcl_Interp *interp; /* Interpreter we are creating the
- * command in. */
+TkCreateMenuCmd(
+ Tcl_Interp *interp) /* Interpreter we are creating the command
+ * in. */
{
- TkMenuOptionTables *optionTablesPtr =
+ TkMenuOptionTables *optionTablesPtr =
(TkMenuOptionTables *) ckalloc(sizeof(TkMenuOptionTables));
- optionTablesPtr->menuOptionTable =
+ optionTablesPtr->menuOptionTable =
Tk_CreateOptionTable(interp, tkMenuConfigSpecs);
optionTablesPtr->entryOptionTables[TEAROFF_ENTRY] =
Tk_CreateOptionTable(interp, specsArray[TEAROFF_ENTRY]);
@@ -444,9 +437,8 @@ TkCreateMenuCmd(interp)
*
* MenuCmd --
*
- * This procedure is invoked to process the "menu" Tcl
- * command. See the user documentation for details on
- * what it does.
+ * This function is invoked to process the "menu" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -458,21 +450,19 @@ TkCreateMenuCmd(interp)
*/
static int
-MenuCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+MenuCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
Tk_Window tkwin = Tk_MainWindow(interp);
- Tk_Window new;
+ Tk_Window newWin;
register TkMenu *menuPtr;
TkMenuReferences *menuRefPtr;
- int i, index;
- int toplevel;
+ int i, index, toplevel;
char *windowName;
- static CONST char *typeStringList[] = {"-type", (char *) NULL};
+ static CONST char *typeStringList[] = {"-type", NULL};
TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData;
if (objc < 2) {
@@ -494,23 +484,23 @@ MenuCmd(clientData, interp, objc, objv)
}
}
- windowName = Tcl_GetStringFromObj(objv[1], NULL);
- new = Tk_CreateWindowFromPath(interp, tkwin, windowName, toplevel ? ""
- : NULL);
- if (new == NULL) {
+ windowName = Tcl_GetString(objv[1]);
+ newWin = Tk_CreateWindowFromPath(interp, tkwin, windowName,
+ toplevel ? "" : NULL);
+ if (newWin == NULL) {
return TCL_ERROR;
}
/*
- * Initialize the data structure for the menu. Note that the
- * menuPtr is eventually freed in 'TkMenuEventProc' in tkMenuDraw.c,
- * when Tcl_EventuallyFree is called.
+ * Initialize the data structure for the menu. Note that the menuPtr is
+ * eventually freed in 'TkMenuEventProc' in tkMenuDraw.c, when
+ * Tcl_EventuallyFree is called.
*/
menuPtr = (TkMenu *) ckalloc(sizeof(TkMenu));
memset(menuPtr, 0, sizeof(TkMenu));
- menuPtr->tkwin = new;
- menuPtr->display = Tk_Display(new);
+ menuPtr->tkwin = newWin;
+ menuPtr->display = Tk_Display(newWin);
menuPtr->interp = interp;
menuPtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd,
@@ -524,7 +514,8 @@ MenuCmd(clientData, interp, objc, objv)
Tk_SetClass(menuPtr->tkwin, "Menu");
Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
- Tk_CreateEventHandler(new, ExposureMask|StructureNotifyMask|ActivateMask,
+ Tk_CreateEventHandler(newWin,
+ ExposureMask|StructureNotifyMask|ActivateMask,
TkMenuEventProc, (ClientData) menuPtr);
if (Tk_InitOptions(interp, (char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin)
@@ -550,38 +541,36 @@ MenuCmd(clientData, interp, objc, objv)
/*
* If a menu has a parent menu pointing to it as a cascade entry, the
- * parent menu needs to be told that this menu now exists so that
- * the platform-part of the menu is correctly updated.
+ * parent menu needs to be told that this menu now exists so that the
+ * platform-part of the menu is correctly updated.
*
* If a menu has an instance and has cascade entries, then each cascade
- * menu must also have a parallel instance. This is especially true on
- * the Mac, where each menu has to have a separate title everytime it is in
- * a menubar. For instance, say you have a menu .m1 with a cascade entry
- * for .m2, where .m2 does not exist yet. You then put .m1 into a menubar.
+ * menu must also have a parallel instance. This is especially true on the
+ * Mac, where each menu has to have a separate title everytime it is in a
+ * menubar. For instance, say you have a menu .m1 with a cascade entry for
+ * .m2, where .m2 does not exist yet. You then put .m1 into a menubar.
* This creates a menubar instance for .m1, but since .m2 is not there,
* nothing else happens. When we go to create .m2, we hook it up properly
* with .m1. However, we now need to clone .m2 and assign the clone of .m2
- * to be the cascade entry for the clone of .m1. This is special case
- * #1 listed in the introductory comment.
+ * to be the cascade entry for the clone of .m1. This is special case #1
+ * listed in the introductory comment.
*/
if (menuRefPtr->parentEntryPtr != NULL) {
- TkMenuEntry *cascadeListPtr = menuRefPtr->parentEntryPtr;
- TkMenuEntry *nextCascadePtr;
- Tcl_Obj *newMenuName;
- Tcl_Obj *newObjv[2];
-
- while (cascadeListPtr != NULL) {
+ TkMenuEntry *cascadeListPtr = menuRefPtr->parentEntryPtr;
+ TkMenuEntry *nextCascadePtr;
+ Tcl_Obj *newMenuName, *newObjv[2];
+ while (cascadeListPtr != NULL) {
nextCascadePtr = cascadeListPtr->nextCascadePtr;
/*
- * If we have a new master menu, and an existing cloned menu
- * points to this menu in a cascade entry, we have to clone
- * the new menu and point the entry to the clone instead
- * of the menu we are creating. Otherwise, ConfigureMenuEntry
- * will hook up the platform-specific cascade linkages now
- * that the menu we are creating exists.
+ * If we have a new master menu, and an existing cloned menu
+ * points to this menu in a cascade entry, we have to clone the
+ * new menu and point the entry to the clone instead of the menu
+ * we are creating. Otherwise, ConfigureMenuEntry will hook up the
+ * platform-specific cascade linkages now that the menu we are
+ * creating exists.
*/
if ((menuPtr->masterMenuPtr != menuPtr)
@@ -602,50 +591,50 @@ MenuCmd(clientData, interp, objc, objv)
Tcl_IncrRefCount(normalPtr);
Tcl_IncrRefCount(windowNamePtr);
- newMenuName = TkNewMenuName(menuPtr->interp,
+ newMenuName = TkNewMenuName(menuPtr->interp,
windowNamePtr, menuPtr);
Tcl_IncrRefCount(newMenuName);
- CloneMenu(menuPtr, newMenuName, normalPtr);
+ CloneMenu(menuPtr, newMenuName, normalPtr);
- /*
- * Now we can set the new menu instance to be the cascade entry
- * of the parent's instance.
- */
+ /*
+ * Now we can set the new menu instance to be the cascade
+ * entry of the parent's instance.
+ */
newObjv[0] = Tcl_NewStringObj("-menu", -1);
newObjv[1] = newMenuName;
Tcl_IncrRefCount(newObjv[0]);
- ConfigureMenuEntry(cascadeListPtr, 2, newObjv);
+ ConfigureMenuEntry(cascadeListPtr, 2, newObjv);
Tcl_DecrRefCount(normalPtr);
Tcl_DecrRefCount(newObjv[0]);
Tcl_DecrRefCount(newObjv[1]);
Tcl_DecrRefCount(windowNamePtr);
- }
- cascadeListPtr = nextCascadePtr;
- }
+ }
+ cascadeListPtr = nextCascadePtr;
+ }
}
/*
- * If there already exist toplevel widgets that refer to this menu,
- * find them and notify them so that they can reconfigure their
- * geometry to reflect the menu.
+ * If there already exist toplevel widgets that refer to this menu, find
+ * them and notify them so that they can reconfigure their geometry to
+ * reflect the menu.
*/
if (menuRefPtr->topLevelListPtr != NULL) {
TkMenuTopLevelList *topLevelListPtr = menuRefPtr->topLevelListPtr;
TkMenuTopLevelList *nextPtr;
Tk_Window listtkwin;
- while (topLevelListPtr != NULL) {
+ while (topLevelListPtr != NULL) {
/*
- * Need to get the next pointer first. TkSetWindowMenuBar
- * changes the list, so that the next pointer is different
- * after calling it.
+ * Need to get the next pointer first. TkSetWindowMenuBar changes
+ * the list, so that the next pointer is different after calling
+ * it.
*/
nextPtr = topLevelListPtr->nextPtr;
listtkwin = topLevelListPtr->tkwin;
- TkSetWindowMenuBar(menuPtr->interp, listtkwin,
+ TkSetWindowMenuBar(menuPtr->interp, listtkwin,
Tk_PathName(menuPtr->tkwin), Tk_PathName(menuPtr->tkwin));
topLevelListPtr = nextPtr;
}
@@ -660,9 +649,9 @@ MenuCmd(clientData, interp, objc, objv)
*
* MenuWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -674,11 +663,11 @@ MenuCmd(clientData, interp, objc, objv)
*/
static int
-MenuWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about menu widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+MenuWidgetObjCmd(
+ ClientData clientData, /* Information about menu widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
register TkMenu *menuPtr = (TkMenu *) clientData;
register TkMenuEntry *mePtr;
@@ -696,335 +685,331 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
Tcl_Preserve((ClientData) menuPtr);
switch ((enum options) option) {
- case MENU_ACTIVATE: {
- int index;
+ case MENU_ACTIVATE: {
+ int index;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "activate index");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (menuPtr->active == index) {
- goto done;
- }
- if ((index >= 0)
- && ((menuPtr->entries[index]->type == SEPARATOR_ENTRY)
- || (menuPtr->entries[index]->state
- == ENTRY_DISABLED))) {
- index = -1;
- }
- result = TkActivateMenuEntry(menuPtr, index);
- break;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if (menuPtr->active == index) {
+ goto done;
+ }
+ if ((index >= 0) && ((menuPtr->entries[index]->type==SEPARATOR_ENTRY)
+ || (menuPtr->entries[index]->state == ENTRY_DISABLED))) {
+ index = -1;
+ }
+ result = TkActivateMenuEntry(menuPtr, index);
+ break;
+ }
+ case MENU_ADD:
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "type ?options?");
+ goto error;
}
- case MENU_ADD:
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "add type ?options?");
- goto error;
- }
- if (MenuAddOrInsert(interp, menuPtr, (Tcl_Obj *) NULL,
- objc - 2, objv + 2) != TCL_OK) {
- goto error;
- }
- break;
- case MENU_CGET: {
- Tcl_Obj *resultPtr;
+ if (MenuAddOrInsert(interp, menuPtr, NULL, objc-2, objv+2) != TCL_OK) {
+ goto error;
+ }
+ break;
+ case MENU_CGET: {
+ Tcl_Obj *resultPtr;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "cget option");
- goto error;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ goto error;
+ }
+ resultPtr = Tk_GetOptionValue(interp, (char *) menuPtr,
+ menuPtr->optionTablesPtr->menuOptionTable, objv[2],
+ menuPtr->tkwin);
+ if (resultPtr == NULL) {
+ goto error;
+ }
+ Tcl_SetObjResult(interp, resultPtr);
+ break;
+ }
+ case MENU_CLONE:
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "newMenuName ?menuType?");
+ goto error;
+ }
+ result = CloneMenu(menuPtr, objv[2], (objc == 3) ? NULL : objv[3]);
+ break;
+ case MENU_CONFIGURE: {
+ Tcl_Obj *resultPtr;
+
+ if (objc == 2) {
+ resultPtr = Tk_GetOptionInfo(interp, (char *) menuPtr,
+ menuPtr->optionTablesPtr->menuOptionTable, NULL,
+ menuPtr->tkwin);
+ if (resultPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ result = TCL_OK;
+ Tcl_SetObjResult(interp, resultPtr);
}
- resultPtr = Tk_GetOptionValue(interp, (char *) menuPtr,
+ } else if (objc == 3) {
+ resultPtr = Tk_GetOptionInfo(interp, (char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, objv[2],
menuPtr->tkwin);
if (resultPtr == NULL) {
- goto error;
- }
- Tcl_SetObjResult(interp, resultPtr);
- break;
- }
- case MENU_CLONE:
- if ((objc < 3) || (objc > 4)) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "clone newMenuName ?menuType?");
- goto error;
- }
- result = CloneMenu(menuPtr, objv[2], (objc == 3) ? NULL : objv[3]);
- break;
- case MENU_CONFIGURE: {
- Tcl_Obj *resultPtr;
-
- if (objc == 2) {
- resultPtr = Tk_GetOptionInfo(interp, (char *) menuPtr,
- menuPtr->optionTablesPtr->menuOptionTable,
- (Tcl_Obj *) NULL, menuPtr->tkwin);
- if (resultPtr == NULL) {
- result = TCL_ERROR;
- } else {
- result = TCL_OK;
- Tcl_SetObjResult(interp, resultPtr);
- }
- } else if (objc == 3) {
- resultPtr = Tk_GetOptionInfo(interp, (char *) menuPtr,
- menuPtr->optionTablesPtr->menuOptionTable,
- objv[2], menuPtr->tkwin);
- if (resultPtr == NULL) {
- result = TCL_ERROR;
- } else {
- result = TCL_OK;
- Tcl_SetObjResult(interp, resultPtr);
- }
+ result = TCL_ERROR;
} else {
- result = ConfigureMenu(interp, menuPtr, objc - 2, objv + 2);
+ result = TCL_OK;
+ Tcl_SetObjResult(interp, resultPtr);
}
- if (result != TCL_OK) {
- goto error;
- }
- break;
+ } else {
+ result = ConfigureMenu(interp, menuPtr, objc - 2, objv + 2);
}
- case MENU_DELETE: {
- int first, last;
-
- if ((objc != 3) && (objc != 4)) {
- Tcl_WrongNumArgs(interp, 1, objv, "delete first ?last?");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &first)
- != TCL_OK) {
- goto error;
- }
- if (objc == 3) {
- last = first;
- } else {
- if (TkGetMenuIndex(interp, menuPtr, objv[3], 0, &last)
- != TCL_OK) {
- goto error;
- }
- }
- if (menuPtr->tearoff && (first == 0)) {
+ if (result != TCL_OK) {
+ goto error;
+ }
+ break;
+ }
+ case MENU_DELETE: {
+ int first, last;
- /*
- * Sorry, can't delete the tearoff entry; must reconfigure
- * the menu.
- */
-
- first = 1;
- }
- if ((first < 0) || (last < first)) {
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "first ?last?");
+ goto error;
+ }
+
+ /*
+ * If 'first' explicitly refers to past the end of the menu, we don't
+ * do anything. [Bug 220950]
+ */
+
+ if (isdigit(UCHAR(Tcl_GetString(objv[2])[0]))
+ && Tcl_GetIntFromObj(NULL, objv[2], &first) == TCL_OK) {
+ if (first >= menuPtr->numEntries) {
goto done;
}
- DeleteMenuCloneEntries(menuPtr, first, last);
- break;
+ } else if (TkGetMenuIndex(interp,menuPtr,objv[2],0,&first) != TCL_OK){
+ goto error;
+ }
+ if (objc == 3) {
+ last = first;
+ } else if (TkGetMenuIndex(interp,menuPtr,objv[3],0,&last) != TCL_OK) {
+ goto error;
}
- case MENU_ENTRYCGET: {
- int index;
- Tcl_Obj *resultPtr;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 1, objv, "entrycget index option");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (index < 0) {
- goto done;
+ if (menuPtr->tearoff && (first == 0)) {
+ /*
+ * Sorry, can't delete the tearoff entry; must reconfigure the
+ * menu.
+ */
+
+ first = 1;
+ }
+ if ((first < 0) || (last < first)) {
+ goto done;
+ }
+ DeleteMenuCloneEntries(menuPtr, first, last);
+ break;
+ }
+ case MENU_ENTRYCGET: {
+ int index;
+ Tcl_Obj *resultPtr;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index option");
+ goto error;
+ }
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if (index < 0) {
+ goto done;
+ }
+ mePtr = menuPtr->entries[index];
+ Tcl_Preserve((ClientData) mePtr);
+ resultPtr = Tk_GetOptionValue(interp, (char *) mePtr,
+ mePtr->optionTable, objv[3], menuPtr->tkwin);
+ Tcl_Release((ClientData) mePtr);
+ if (resultPtr == NULL) {
+ goto error;
+ }
+ Tcl_SetObjResult(interp, resultPtr);
+ break;
+ }
+ case MENU_ENTRYCONFIGURE: {
+ int index;
+ Tcl_Obj *resultPtr;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index ?option value ...?");
+ goto error;
+ }
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if (index < 0) {
+ goto done;
+ }
+ mePtr = menuPtr->entries[index];
+ Tcl_Preserve((ClientData) mePtr);
+ if (objc == 3) {
+ resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr,
+ mePtr->optionTable, NULL, menuPtr->tkwin);
+ if (resultPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ result = TCL_OK;
+ Tcl_SetObjResult(interp, resultPtr);
}
- mePtr = menuPtr->entries[index];
- Tcl_Preserve((ClientData) mePtr);
- resultPtr = Tk_GetOptionValue(interp, (char *) mePtr,
+ } else if (objc == 4) {
+ resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr,
mePtr->optionTable, objv[3], menuPtr->tkwin);
- Tcl_Release((ClientData) mePtr);
if (resultPtr == NULL) {
- goto error;
+ result = TCL_ERROR;
+ } else {
+ result = TCL_OK;
+ Tcl_SetObjResult(interp, resultPtr);
}
- Tcl_SetObjResult(interp, resultPtr);
- break;
+ } else {
+ result = ConfigureMenuCloneEntries(interp, menuPtr, index,
+ objc-3, objv+3);
}
- case MENU_ENTRYCONFIGURE: {
- int index;
- Tcl_Obj *resultPtr;
+ Tcl_Release((ClientData) mePtr);
+ break;
+ }
+ case MENU_INDEX: {
+ int index;
- if (objc < 3) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "entryconfigure index ?option value ...?");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (index < 0) {
- goto done;
- }
- mePtr = menuPtr->entries[index];
- Tcl_Preserve((ClientData) mePtr);
- if (objc == 3) {
- resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr,
- mePtr->optionTable, (Tcl_Obj *) NULL, menuPtr->tkwin);
- if (resultPtr == NULL) {
- result = TCL_ERROR;
- } else {
- result = TCL_OK;
- Tcl_SetObjResult(interp, resultPtr);
- }
- } else if (objc == 4) {
- resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr,
- mePtr->optionTable, objv[3], menuPtr->tkwin);
- if (resultPtr == NULL) {
- result = TCL_ERROR;
- } else {
- result = TCL_OK;
- Tcl_SetObjResult(interp, resultPtr);
- }
- } else {
- result = ConfigureMenuCloneEntries(interp, menuPtr, index,
- objc - 3, objv + 3);
- }
- Tcl_Release((ClientData) mePtr);
- break;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "string");
+ goto error;
+ }
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
}
- case MENU_INDEX: {
- int index;
+ if (index < 0) {
+ Tcl_SetResult(interp, "none", TCL_STATIC);
+ } else {
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
+ }
+ break;
+ }
+ case MENU_INSERT:
+ if (objc < 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index type ?options?");
+ goto error;
+ }
+ if (MenuAddOrInsert(interp,menuPtr,objv[2],objc-3,objv+3) != TCL_OK) {
+ goto error;
+ }
+ break;
+ case MENU_INVOKE: {
+ int index;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "index string");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (index < 0) {
- Tcl_SetResult(interp, "none", TCL_STATIC);
- } else {
- Tcl_SetIntObj(Tcl_GetObjResult(interp), index);
- }
- break;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
}
- case MENU_INSERT:
- if (objc < 4) {
- Tcl_WrongNumArgs(interp, 1, objv,
- "insert index type ?options?");
- goto error;
- }
- if (MenuAddOrInsert(interp, menuPtr, objv[2], objc - 3,
- objv + 3) != TCL_OK) {
- goto error;
- }
- break;
- case MENU_INVOKE: {
- int index;
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if (index < 0) {
+ goto done;
+ }
+ result = TkInvokeMenu(interp, menuPtr, index);
+ break;
+ }
+ case MENU_POST: {
+ int x, y;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "invoke index");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (index < 0) {
- goto done;
- }
- result = TkInvokeMenu(interp, menuPtr, index);
- break;
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "x y");
+ goto error;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
+ goto error;
}
- case MENU_POST: {
- int x, y;
- if (objc != 4) {
- Tcl_WrongNumArgs(interp, 1, objv, "post x y");
- goto error;
- }
- if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
- goto error;
- }
+ /*
+ * Tearoff menus are posted differently on Mac and Windows than
+ * non-tearoffs. TkpPostMenu does not actually map the menu's window
+ * on those platforms, and popup menus have to be handled specially.
+ */
- /*
- * Tearoff menus are posted differently on Mac and Windows than
- * non-tearoffs. TkpPostMenu does not actually map the menu's
- * window on those platforms, and popup menus have to be
- * handled specially.
- */
-
- if (menuPtr->menuType != TEAROFF_MENU) {
- result = TkpPostMenu(interp, menuPtr, x, y);
- } else {
- result = TkPostTearoffMenu(interp, menuPtr, x, y);
- }
- break;
+ if (menuPtr->menuType != TEAROFF_MENU) {
+ result = TkpPostMenu(interp, menuPtr, x, y);
+ } else {
+ result = TkPostTearoffMenu(interp, menuPtr, x, y);
}
- case MENU_POSTCASCADE: {
- int index;
+ break;
+ }
+ case MENU_POSTCASCADE: {
+ int index;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "postcascade index");
- goto error;
- }
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if ((index < 0) || (menuPtr->entries[index]->type
- != CASCADE_ENTRY)) {
- result = TkPostSubmenu(interp, menuPtr, (TkMenuEntry *) NULL);
- } else {
- result = TkPostSubmenu(interp, menuPtr,
- menuPtr->entries[index]);
- }
- break;
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if ((index < 0) || (menuPtr->entries[index]->type != CASCADE_ENTRY)) {
+ result = TkPostSubmenu(interp, menuPtr, NULL);
+ } else {
+ result = TkPostSubmenu(interp, menuPtr, menuPtr->entries[index]);
}
- case MENU_TYPE: {
- int index;
+ break;
+ }
+ case MENU_TYPE: {
+ int index;
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "type index");
- goto error;
- }
- if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index)
- != TCL_OK) {
- goto error;
- }
- if (index < 0) {
- goto done;
- }
- 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);
- }
- break;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
}
- case MENU_UNPOST:
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "unpost");
- goto error;
- }
- Tk_UnmapWindow(menuPtr->tkwin);
- result = TkPostSubmenu(interp, menuPtr, (TkMenuEntry *) NULL);
- break;
- case MENU_YPOSITION:
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "yposition index");
- goto error;
- }
- result = MenuDoYPosition(interp, menuPtr, objv[2]);
- break;
+ if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
+ goto error;
+ }
+ if (index < 0) {
+ goto done;
+ }
+ 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);
+ }
+ break;
}
- done:
+ case MENU_UNPOST:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ goto error;
+ }
+ Tk_UnmapWindow(menuPtr->tkwin);
+ result = TkPostSubmenu(interp, menuPtr, NULL);
+ break;
+ case MENU_XPOSITION:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ result = MenuDoXPosition(interp, menuPtr, objv[2]);
+ break;
+ case MENU_YPOSITION:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ result = MenuDoYPosition(interp, menuPtr, objv[2]);
+ break;
+ }
+ done:
Tcl_Release((ClientData) menuPtr);
return result;
- error:
+ error:
Tcl_Release((ClientData) menuPtr);
return TCL_ERROR;
}
@@ -1034,29 +1019,29 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
*
* TkInvokeMenu --
*
- * Given a menu and an index, takes the appropriate action for the
- * entry associated with that index.
+ * Given a menu and an index, takes the appropriate action for the entry
+ * associated with that index.
*
* Results:
* Standard Tcl result.
*
* Side effects:
- * Commands may get excecuted; variables may get set; sub-menus may
- * get posted.
+ * Commands may get excecuted; variables may get set; sub-menus may get
+ * posted.
*
*----------------------------------------------------------------------
*/
int
-TkInvokeMenu(interp, menuPtr, index)
- Tcl_Interp *interp; /* The interp that the menu lives in. */
- TkMenu *menuPtr; /* The menu we are invoking. */
- int index; /* The zero based index of the item we
- * are invoking */
+TkInvokeMenu(
+ Tcl_Interp *interp, /* The interp that the menu lives in. */
+ TkMenu *menuPtr, /* The menu we are invoking. */
+ int index) /* The zero based index of the item we are
+ * invoking. */
{
int result = TCL_OK;
TkMenuEntry *mePtr;
-
+
if (index < 0) {
goto done;
}
@@ -1104,11 +1089,13 @@ TkInvokeMenu(interp, menuPtr, index)
}
Tcl_DecrRefCount(valuePtr);
}
+
/*
- * We check numEntries in addition to whether the menu entry
- * has a command because that goes to zero if the menu gets
- * deleted (e.g., during command evaluation).
+ * We check numEntries in addition to whether the menu entry has a command
+ * because that goes to zero if the menu gets deleted (e.g., during
+ * command evaluation).
*/
+
if ((menuPtr->numEntries != 0) && (result == TCL_OK)
&& (mePtr->commandPtr != NULL)) {
Tcl_Obj *commandPtr = mePtr->commandPtr;
@@ -1118,7 +1105,7 @@ TkInvokeMenu(interp, menuPtr, index)
Tcl_DecrRefCount(commandPtr);
}
Tcl_Release((ClientData) mePtr);
- done:
+ done:
return result;
}
@@ -1127,10 +1114,9 @@ TkInvokeMenu(interp, menuPtr, index)
*
* DestroyMenuInstance --
*
- * This procedure is invoked by TkDestroyMenu
- * to clean up the internal structure of a menu at a safe time
- * (when no-one is using it anymore). Only takes care of one instance
- * of the menu.
+ * This function is invoked by TkDestroyMenu to clean up the internal
+ * structure of a menu at a safe time (when no-one is using it anymore).
+ * Only takes care of one instance of the menu.
*
* Results:
* None.
@@ -1142,8 +1128,8 @@ TkInvokeMenu(interp, menuPtr, index)
*/
static void
-DestroyMenuInstance(menuPtr)
- TkMenu *menuPtr; /* Info about menu widget. */
+DestroyMenuInstance(
+ TkMenu *menuPtr) /* Info about menu widget. */
{
int i;
TkMenu *menuInstancePtr;
@@ -1151,19 +1137,19 @@ DestroyMenuInstance(menuPtr)
Tcl_Obj *newObjv[2];
TkMenu *parentMasterMenuPtr;
TkMenuEntry *parentMasterEntryPtr;
-
+
/*
* If the menu has any cascade menu entries pointing to it, the cascade
* entries need to be told that the menu is going away. We need to clear
- * the menu ptr field in the menu reference at this point in the code
- * so that everything else can forget about this menu properly. We also
- * need to reset -menu field of all entries that are not master menus
- * back to this entry name if this is a master menu pointed to by another
- * master menu. If there is a clone menu that points to this menu,
- * then this menu is itself a clone, so when this menu goes away,
- * the -menu field of the pointing entry must be set back to this
- * menu's master menu name so that later if another menu is created
- * the cascade hierarchy can be maintained.
+ * the menu ptr field in the menu reference at this point in the code so
+ * that everything else can forget about this menu properly. We also need
+ * to reset -menu field of all entries that are not master menus back to
+ * this entry name if this is a master menu pointed to by another master
+ * menu. If there is a clone menu that points to this menu, then this menu
+ * is itself a clone, so when this menu goes away, the -menu field of the
+ * pointing entry must be set back to this menu's master menu name so that
+ * later if another menu is created the cascade hierarchy can be
+ * maintained.
*/
TkpDestroyMenu(menuPtr);
@@ -1178,7 +1164,7 @@ DestroyMenuInstance(menuPtr)
for (; cascadePtr != NULL; cascadePtr = nextCascadePtr) {
nextCascadePtr = cascadePtr->nextCascadePtr;
-
+
if (menuPtr->masterMenuPtr != menuPtr) {
Tcl_Obj *menuNamePtr = Tcl_NewStringObj("-menu", -1);
@@ -1187,10 +1173,12 @@ DestroyMenuInstance(menuPtr)
parentMasterMenuPtr->entries[cascadePtr->index];
newObjv[0] = menuNamePtr;
newObjv[1] = parentMasterEntryPtr->namePtr;
+
/*
- * It is possible that the menu info is out of sync, and
- * these things point to NULL, so verify existence [Bug: 3402]
+ * It is possible that the menu info is out of sync, and these
+ * things point to NULL, so verify existence [Bug: 3402]
*/
+
if (newObjv[0] && newObjv[1]) {
Tcl_IncrRefCount(newObjv[0]);
Tcl_IncrRefCount(newObjv[1]);
@@ -1199,38 +1187,37 @@ DestroyMenuInstance(menuPtr)
Tcl_DecrRefCount(newObjv[1]);
}
} else {
- ConfigureMenuEntry(cascadePtr, 0, (Tcl_Obj **) NULL);
+ ConfigureMenuEntry(cascadePtr, 0, NULL);
}
}
-
+
if (menuPtr->masterMenuPtr != menuPtr) {
- for (menuInstancePtr = menuPtr->masterMenuPtr;
- menuInstancePtr != NULL;
- menuInstancePtr = menuInstancePtr->nextInstancePtr) {
- if (menuInstancePtr->nextInstancePtr == menuPtr) {
- menuInstancePtr->nextInstancePtr =
- menuInstancePtr->nextInstancePtr->nextInstancePtr;
- break;
- }
- }
- } else if (menuPtr->nextInstancePtr != NULL) {
- panic("Attempting to delete master menu when there are still clones.");
- }
+ for (menuInstancePtr = menuPtr->masterMenuPtr;
+ menuInstancePtr != NULL;
+ menuInstancePtr = menuInstancePtr->nextInstancePtr) {
+ if (menuInstancePtr->nextInstancePtr == menuPtr) {
+ menuInstancePtr->nextInstancePtr =
+ menuInstancePtr->nextInstancePtr->nextInstancePtr;
+ break;
+ }
+ }
+ } else if (menuPtr->nextInstancePtr != NULL) {
+ Tcl_Panic("Attempting to delete master menu when there are still clones.");
+ }
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeConfigOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeConfigOptions handle all the standard option-related stuff.
*/
for (i = menuPtr->numEntries; --i >= 0; ) {
/*
- * As each menu entry is deleted from the end of the array of
- * entries, decrement menuPtr->numEntries. Otherwise, the act of
- * deleting menu entry i will dereference freed memory attempting
- * to queue a redraw for menu entries (i+1)...numEntries.
+ * As each menu entry is deleted from the end of the array of entries,
+ * decrement menuPtr->numEntries. Otherwise, the act of deleting menu
+ * entry i will dereference freed memory attempting to queue a redraw
+ * for menu entries (i+1)...numEntries.
*/
-
+
DestroyMenuEntry((char *) menuPtr->entries[i]);
menuPtr->numEntries = i;
}
@@ -1238,7 +1225,7 @@ DestroyMenuInstance(menuPtr)
ckfree((char *) menuPtr->entries);
}
TkMenuFreeDrawOptions(menuPtr);
- Tk_FreeConfigOptions((char *) menuPtr,
+ Tk_FreeConfigOptions((char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin);
if (menuPtr->tkwin != NULL) {
Tk_Window tkwin = menuPtr->tkwin;
@@ -1252,11 +1239,11 @@ DestroyMenuInstance(menuPtr)
*
* TkDestroyMenu --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a menu at a safe time
- * (when no-one is using it anymore). If called on a master instance,
- * destroys all of the slave instances. If called on a non-master
- * instance, just destroys that instance.
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of a menu at a safe time (when no-one is
+ * using it anymore). If called on a master instance, destroys all of the
+ * slave instances. If called on a non-master instance, just destroys
+ * that instance.
*
* Results:
* None.
@@ -1268,8 +1255,8 @@ DestroyMenuInstance(menuPtr)
*/
void
-TkDestroyMenu(menuPtr)
- TkMenu *menuPtr; /* Info about menu widget. */
+TkDestroyMenu(
+ TkMenu *menuPtr) /* Info about menu widget. */
{
TkMenu *menuInstancePtr;
TkMenuTopLevelList *topLevelListPtr, *nextTopLevelPtr;
@@ -1279,20 +1266,21 @@ TkDestroyMenu(menuPtr)
}
Tcl_Preserve(menuPtr);
-
+
/*
- * Now destroy all non-tearoff instances of this menu if this is a
- * parent menu. Is this loop safe enough? Are there going to be
- * destroy bindings on child menus which kill the parent? If not,
- * we have to do a slightly more complex scheme.
+ * Now destroy all non-tearoff instances of this menu if this is a parent
+ * menu. Is this loop safe enough? Are there going to be destroy bindings
+ * on child menus which kill the parent? If not, we have to do a slightly
+ * more complex scheme.
*/
menuPtr->menuFlags |= MENU_DELETION_PENDING;
if (menuPtr->menuRefPtr != NULL) {
/*
- * If any toplevel widgets have this menu as their menubar,
- * the geometry of the window may have to be recalculated.
+ * If any toplevel widgets have this menu as their menubar, the
+ * geometry of the window may have to be recalculated.
*/
+
topLevelListPtr = menuPtr->menuRefPtr->topLevelListPtr;
while (topLevelListPtr != NULL) {
nextTopLevelPtr = topLevelListPtr->nextPtr;
@@ -1306,11 +1294,13 @@ TkDestroyMenu(menuPtr)
menuPtr->nextInstancePtr = menuInstancePtr->nextInstancePtr;
if (menuInstancePtr->tkwin != NULL) {
Tk_Window tkwin = menuInstancePtr->tkwin;
- /*
- * Note: it may be desirable to NULL out the tkwin
- * field of menuInstancePtr here:
+
+ /*
+ * Note: it may be desirable to NULL out the tkwin field of
+ * menuInstancePtr here:
* menuInstancePtr->tkwin = NULL;
*/
+
Tk_DestroyWindow(tkwin);
}
}
@@ -1327,12 +1317,12 @@ TkDestroyMenu(menuPtr)
* UnhookCascadeEntry --
*
* This entry is removed from the list of entries that point to the
- * cascade menu. This is done in preparation for changing the menu
- * that this entry points to.
- *
- * At the end of this function, the menu entry no longer contains
- * a reference to a 'TkMenuReferences' structure, and therefore
- * no such structure contains a reference to this menu entry either.
+ * cascade menu. This is done in preparation for changing the menu that
+ * this entry points to.
+ *
+ * At the end of this function, the menu entry no longer contains a
+ * reference to a 'TkMenuReferences' structure, and therefore no such
+ * structure contains a reference to this menu entry either.
*
* Results:
* None
@@ -1344,9 +1334,9 @@ TkDestroyMenu(menuPtr)
*/
static void
-UnhookCascadeEntry(mePtr)
- TkMenuEntry *mePtr; /* The cascade entry we are removing
- * from the cascade list. */
+UnhookCascadeEntry(
+ TkMenuEntry *mePtr) /* The cascade entry we are removing from the
+ * cascade list. */
{
TkMenuEntry *cascadeEntryPtr;
TkMenuEntry *prevCascadePtr;
@@ -1354,35 +1344,34 @@ UnhookCascadeEntry(mePtr)
menuRefPtr = mePtr->childMenuRefPtr;
if (menuRefPtr == NULL) {
- return;
+ return;
}
-
+
cascadeEntryPtr = menuRefPtr->parentEntryPtr;
if (cascadeEntryPtr == NULL) {
TkFreeMenuReferences(menuRefPtr);
mePtr->childMenuRefPtr = NULL;
return;
}
-
+
/*
- * Singularly linked list deletion. The two special cases are
- * 1. one element; 2. The first element is the one we want.
+ * Singularly linked list deletion. The two special cases are 1. one
+ * element; 2. The first element is the one we want.
*/
if (cascadeEntryPtr == mePtr) {
if (cascadeEntryPtr->nextCascadePtr == NULL) {
-
/*
- * This is the last menu entry which points to this
- * menu, so we need to clear out the list pointer in the
- * cascade itself.
+ * This is the last menu entry which points to this menu, so we
+ * need to clear out the list pointer in the cascade itself.
*/
menuRefPtr->parentEntryPtr = NULL;
- /*
- * The original field is set to zero below, after it is
- * freed.
+
+ /*
+ * The original field is set to zero below, after it is freed.
*/
+
TkFreeMenuReferences(menuRefPtr);
} else {
menuRefPtr->parentEntryPtr = cascadeEntryPtr->nextCascadePtr;
@@ -1392,15 +1381,15 @@ UnhookCascadeEntry(mePtr)
for (prevCascadePtr = cascadeEntryPtr,
cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr;
cascadeEntryPtr != NULL;
- prevCascadePtr = cascadeEntryPtr,
+ prevCascadePtr = cascadeEntryPtr,
cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
if (cascadeEntryPtr == mePtr){
prevCascadePtr->nextCascadePtr =
- cascadeEntryPtr->nextCascadePtr;
+ cascadeEntryPtr->nextCascadePtr;
cascadeEntryPtr->nextCascadePtr = NULL;
break;
}
- }
+ }
mePtr->nextCascadePtr = NULL;
}
mePtr->childMenuRefPtr = NULL;
@@ -1411,9 +1400,9 @@ UnhookCascadeEntry(mePtr)
*
* DestroyMenuEntry --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a menu entry at a safe time
- * (when no-one is using it anymore).
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of a menu entry at a safe time (when no-one
+ * is using it anymore).
*
* Results:
* None.
@@ -1425,56 +1414,57 @@ UnhookCascadeEntry(mePtr)
*/
static void
-DestroyMenuEntry(memPtr)
- char *memPtr; /* Pointer to entry to be freed. */
+DestroyMenuEntry(
+ char *memPtr) /* Pointer to entry to be freed. */
{
register TkMenuEntry *mePtr = (TkMenuEntry *) memPtr;
TkMenu *menuPtr = mePtr->menuPtr;
if (menuPtr->postedCascade == mePtr) {
/*
- * Ignore errors while unposting the menu, since it's possible
- * that the menu has already been deleted and the unpost will
- * generate an error.
+ * Ignore errors while unposting the menu, since it's possible that
+ * the menu has already been deleted and the unpost will generate an
+ * error.
*/
- TkPostSubmenu(menuPtr->interp, menuPtr, (TkMenuEntry *) NULL);
+ TkPostSubmenu(menuPtr->interp, menuPtr, NULL);
}
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeConfigOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeConfigOptions handle all the standard option-related stuff.
*/
if (mePtr->type == CASCADE_ENTRY) {
if (menuPtr->masterMenuPtr != menuPtr) {
TkMenu *destroyThis = NULL;
- /*
- * The menu as a whole is a clone. We must delete the clone
- * of the cascaded menu for the particular entry we are
- * destroying.
+ /*
+ * 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;
- /*
- * But only if it is a clone. What can happen is that
- * we are in the middle of deleting a menu and this
- * menu pointer has already been reset to point to the
- * original menu. In that case we have nothing special
- * to do.
+
+ /*
+ * But only if it is a clone. What can happen is that we are
+ * in the middle of deleting a menu and this menu pointer has
+ * already been reset to point to the original menu. In that
+ * case we have nothing special to do.
*/
- if ((destroyThis != NULL)
- && (destroyThis->masterMenuPtr == destroyThis)) {
+
+ if ((destroyThis != NULL)
+ && (destroyThis->masterMenuPtr == destroyThis)) {
destroyThis = NULL;
}
}
UnhookCascadeEntry(mePtr);
if (menuRefPtr != NULL) {
- if (menuRefPtr->menuPtr == destroyThis) {
- menuRefPtr->menuPtr = NULL;
- }
+ if (menuRefPtr->menuPtr == destroyThis) {
+ menuRefPtr->menuPtr = NULL;
+ }
if (destroyThis != NULL) {
TkDestroyMenu(destroyThis);
}
@@ -1489,10 +1479,11 @@ DestroyMenuEntry(memPtr)
if (mePtr->selectImage != NULL) {
Tk_FreeImage(mePtr->selectImage);
}
- if (((mePtr->type == CHECK_BUTTON_ENTRY)
+ if (((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY))
&& (mePtr->namePtr != NULL)) {
- char *varName = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ char *varName = Tcl_GetString(mePtr->namePtr);
+
Tcl_UntraceVar(menuPtr->interp, varName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuVarProc, (ClientData) mePtr);
@@ -1508,22 +1499,22 @@ DestroyMenuEntry(memPtr)
*
* MenuWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way (such as the fonts in the system changing) and the widget needs
- * to recompute all its graphics contexts and determine its new geometry.
+ * This function is called when the world has changed in some way (such
+ * as the fonts in the system changing) and the widget needs to recompute
+ * all its graphics contexts and determine its new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Menu will be relayed out and redisplayed.
+ * Menu will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
static void
-MenuWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+MenuWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
TkMenu *menuPtr = (TkMenu *) instanceData;
int i;
@@ -1542,40 +1533,39 @@ MenuWorldChanged(instanceData)
*
* ConfigureMenu --
*
- * This procedure is called to process an argv/argc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a menu widget.
+ * This function is called to process an argv/argc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a menu widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as colors, font, etc. get set
- * for menuPtr; old resources get freed, if there were any.
+ * Configuration information, such as colors, font, etc. get set for
+ * menuPtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureMenu(interp, menuPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- 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. */
+ConfigureMenu(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
{
int i;
TkMenu *menuListPtr, *cleanupPtr;
int result;
-
+
for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL;
menuListPtr = menuListPtr->nextInstancePtr) {
menuListPtr->errorStructPtr = (Tk_SavedOptions *)
ckalloc(sizeof(Tk_SavedOptions));
result = Tk_SetOptions(interp, (char *) menuListPtr,
- menuListPtr->optionTablesPtr->menuOptionTable, objc, objv,
- menuListPtr->tkwin, menuListPtr->errorStructPtr, (int *) NULL);
+ menuListPtr->optionTablesPtr->menuOptionTable, objc, objv,
+ menuListPtr->tkwin, menuListPtr->errorStructPtr, NULL);
if (result != TCL_OK) {
for (cleanupPtr = menuPtr->masterMenuPtr;
cleanupPtr != menuListPtr;
@@ -1593,25 +1583,24 @@ ConfigureMenu(interp, menuPtr, objc, objv)
}
/*
- * When a menu is created, the type is in all of the arguments
- * to the menu command. Let Tk_ConfigureWidget take care of
- * parsing them, and then set the type after we can look at
- * the type string. Once set, a menu's type cannot be changed
+ * When a menu is created, the type is in all of the arguments to the
+ * menu command. Let Tk_ConfigureWidget take care of parsing them, and
+ * then set the type after we can look at the type string. Once set, a
+ * menu's type cannot be changed
*/
-
+
if (menuListPtr->menuType == UNKNOWN_TYPE) {
Tcl_GetIndexFromObj(NULL, menuListPtr->menuTypePtr,
menuTypeStrings, NULL, 0, &menuListPtr->menuType);
/*
- * Configure the new window to be either a pop-up menu
- * or a tear-off menu.
- * We don't do this for menubars since they are not toplevel
- * windows. Also, since this gets called before CloneMenu has
- * a chance to set the menuType field, we have to look at the
+ * Configure the new window to be either a pop-up menu or a
+ * tear-off menu. We don't do this for menubars since they are not
+ * toplevel windows. Also, since this gets called before CloneMenu
+ * has a chance to set the menuType field, we have to look at the
* menuTypeName field to tell that this is a menu bar.
*/
-
+
if (menuListPtr->menuType == MASTER_MENU) {
TkpMakeMenuWindow(menuListPtr->tkwin, 1);
} else if (menuListPtr->menuType == TEAROFF_MENU) {
@@ -1621,10 +1610,10 @@ ConfigureMenu(interp, menuPtr, objc, objv)
/*
- * Depending on the -tearOff option, make sure that there is or
- * isn't an initial tear-off entry at the beginning of the menu.
+ * Depending on the -tearOff option, make sure that there is or isn't
+ * an initial tear-off entry at the beginning of the menu.
*/
-
+
if (menuListPtr->tearoff) {
if ((menuListPtr->numEntries == 0)
|| (menuListPtr->entries[0]->type != TEAROFF_ENTRY)) {
@@ -1647,7 +1636,7 @@ ConfigureMenu(interp, menuPtr, objc, objv)
} else if ((menuListPtr->numEntries > 0)
&& (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) {
int i;
-
+
Tcl_EventuallyFree((ClientData) menuListPtr->entries[0],
DestroyMenuEntry);
@@ -1663,21 +1652,21 @@ ConfigureMenu(interp, menuPtr, objc, objv)
}
TkMenuConfigureDrawOptions(menuListPtr);
-
+
/*
* After reconfiguring a menu, we need to reconfigure all of the
- * entries in the menu, since some of the things in the children
- * (such as graphics contexts) may have to change to reflect changes
- * in the parent.
+ * entries in the menu, since some of the things in the children (such
+ * as graphics contexts) may have to change to reflect changes in the
+ * parent.
*/
-
+
for (i = 0; i < menuListPtr->numEntries; i++) {
TkMenuEntry *mePtr;
-
+
mePtr = menuListPtr->entries[i];
- ConfigureMenuEntry(mePtr, 0, (Tcl_Obj **) NULL);
+ ConfigureMenuEntry(mePtr, 0, NULL);
}
-
+
TkEventuallyRecomputeMenu(menuListPtr);
}
@@ -1690,7 +1679,6 @@ ConfigureMenu(interp, menuPtr, objc, objv)
return TCL_OK;
}
-
/*
*----------------------------------------------------------------------
@@ -1698,23 +1686,23 @@ ConfigureMenu(interp, menuPtr, objc, objv)
* PostProcessEntry --
*
* This is called by ConfigureMenuEntry to do all of the configuration
- * after Tk_SetOptions is called. This is separate
- * so that error handling is easier.
+ * after Tk_SetOptions is called. This is separate so that error handling
+ * is easier.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information such as label and accelerator get
- * set for mePtr; old resources get freed, if there were any.
+ * Configuration information such as label and accelerator get set for
+ * mePtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-PostProcessEntry(mePtr)
- TkMenuEntry *mePtr; /* The entry we are configuring. */
+PostProcessEntry(
+ TkMenuEntry *mePtr) /* The entry we are configuring. */
{
TkMenu *menuPtr = mePtr->menuPtr;
int index = mePtr->index;
@@ -1722,9 +1710,9 @@ PostProcessEntry(mePtr)
Tk_Image image;
/*
- * The code below handles special configuration stuff not taken
- * care of by Tk_ConfigureWidget, such as special processing for
- * defaults, sizing strings, graphics contexts, etc.
+ * The code below handles special configuration stuff not taken care of by
+ * Tk_ConfigureWidget, such as special processing for defaults, sizing
+ * strings, graphics contexts, etc.
*/
if (mePtr->labelPtr == NULL) {
@@ -1752,16 +1740,15 @@ PostProcessEntry(mePtr)
* prevent compiler warning. */
/*
- * This is a cascade entry. If the menu that the cascade entry
- * is pointing to has changed, we need to remove this entry
- * from the list of entries pointing to the old menu, and add a
- * cascade reference to the list of entries pointing to the
- * new menu.
+ * This is a cascade entry. If the menu that the cascade entry is
+ * pointing to has changed, we need to remove this entry from the list
+ * of entries pointing to the old menu, and add a cascade reference to
+ * the list of entries pointing to the new menu.
*
* BUG: We are not recloning for special case #3 yet.
*/
-
- name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+
+ name = Tcl_GetString(mePtr->namePtr);
if (mePtr->childMenuRefPtr != NULL) {
oldHashKey = Tcl_GetHashKey(TkGetMenuHashTable(menuPtr->interp),
mePtr->childMenuRefPtr->hashEntryPtr);
@@ -1770,7 +1757,7 @@ PostProcessEntry(mePtr)
}
}
- if ((mePtr->childMenuRefPtr == NULL)
+ if ((mePtr->childMenuRefPtr == NULL)
|| (strcmp(oldHashKey, name) != 0)) {
menuRefPtr = TkCreateMenuReferences(menuPtr->interp, name);
mePtr->childMenuRefPtr = menuRefPtr;
@@ -1788,11 +1775,11 @@ PostProcessEntry(mePtr)
break;
}
}
-
+
/*
* Put the item at the front of the list.
*/
-
+
if (!alreadyThere) {
mePtr->nextCascadePtr = menuRefPtr->parentEntryPtr;
menuRefPtr->parentEntryPtr = mePtr;
@@ -1800,23 +1787,20 @@ PostProcessEntry(mePtr)
}
}
}
-
+
if (TkMenuConfigureEntryDrawOptions(mePtr, index) != TCL_OK) {
return TCL_ERROR;
}
- if (TkpConfigureMenuEntry(mePtr) != TCL_OK) {
- return TCL_ERROR;
- }
-
/*
- * Get the images for the entry, if there are any. Allocate the
- * new images before freeing the old ones, so that the reference
- * counts don't go to zero and cause image data to be discarded.
+ * Get the images for the entry, if there are any. Allocate the new images
+ * before freeing the old ones, so that the reference counts don't go to
+ * zero and cause image data to be discarded.
*/
if (mePtr->imagePtr != NULL) {
- char *imageString = Tcl_GetStringFromObj(mePtr->imagePtr, NULL);
+ char *imageString = Tcl_GetString(mePtr->imagePtr);
+
image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, imageString,
TkMenuImageProc, (ClientData) mePtr);
if (image == NULL) {
@@ -1830,8 +1814,8 @@ PostProcessEntry(mePtr)
}
mePtr->image = image;
if (mePtr->selectImagePtr != NULL) {
- char *selectImageString = Tcl_GetStringFromObj(
- mePtr->selectImagePtr, NULL);
+ char *selectImageString = Tcl_GetString(mePtr->selectImagePtr);
+
image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, selectImageString,
TkMenuSelectImageProc, (ClientData) mePtr);
if (image == NULL) {
@@ -1868,12 +1852,11 @@ PostProcessEntry(mePtr)
}
/*
- * Select the entry if the associated variable has the
- * appropriate value, initialize the variable if it doesn't
- * exist, then set a trace on the variable to monitor future
- * changes to its value.
+ * Select the entry if the associated variable has the appropriate
+ * value, initialize the variable if it doesn't exist, then set a
+ * trace on the variable to monitor future changes to its value.
*/
-
+
if (mePtr->namePtr != NULL) {
valuePtr = Tcl_ObjGetVar2(menuPtr->interp, mePtr->namePtr, NULL,
TCL_GLOBAL_ONLY);
@@ -1883,10 +1866,8 @@ PostProcessEntry(mePtr)
mePtr->entryFlags &= ~ENTRY_SELECTED;
if (valuePtr != NULL) {
if (mePtr->onValuePtr != NULL) {
- char *value = Tcl_GetStringFromObj(valuePtr, NULL);
- char *onValue = Tcl_GetStringFromObj(mePtr->onValuePtr,
- NULL);
-
+ char *value = Tcl_GetString(valuePtr);
+ char *onValue = Tcl_GetString(mePtr->onValuePtr);
if (strcmp(value, onValue) == 0) {
mePtr->entryFlags |= ENTRY_SELECTED;
@@ -1896,19 +1877,21 @@ PostProcessEntry(mePtr)
if (mePtr->namePtr != NULL) {
Tcl_ObjSetVar2(menuPtr->interp, mePtr->namePtr, NULL,
(mePtr->type == CHECK_BUTTON_ENTRY)
- ? mePtr->offValuePtr
- : Tcl_NewObj(),
- TCL_GLOBAL_ONLY);
+ ? mePtr->offValuePtr : Tcl_NewObj(), TCL_GLOBAL_ONLY);
}
}
if (mePtr->namePtr != NULL) {
- name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ name = Tcl_GetString(mePtr->namePtr);
Tcl_TraceVar(menuPtr->interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuVarProc, (ClientData) mePtr);
}
}
-
+
+ if (TkpConfigureMenuEntry(mePtr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
return TCL_OK;
}
@@ -1917,41 +1900,41 @@ PostProcessEntry(mePtr)
*
* ConfigureMenuEntry --
*
- * This procedure is called to process an argv/argc list in order
- * to configure (or reconfigure) one entry in a menu.
+ * This function is called to process an argv/argc list in order to
+ * configure (or reconfigure) one entry in a menu.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information such as label and accelerator get
- * set for mePtr; old resources get freed, if there were any.
+ * Configuration information such as label and accelerator get set for
+ * mePtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureMenuEntry(mePtr, objc, objv)
- 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. */
+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. */
{
TkMenu *menuPtr = mePtr->menuPtr;
Tk_SavedOptions errorStruct;
int result;
/*
- * If this entry is a check button or radio button, then remove
- * its old trace procedure.
+ * If this entry is a check button or radio button, then remove its old
+ * trace function.
*/
if ((mePtr->namePtr != NULL)
&& ((mePtr->type == CHECK_BUTTON_ENTRY)
|| (mePtr->type == RADIO_BUTTON_ENTRY))) {
- char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ char *name = Tcl_GetString(mePtr->namePtr);
+
Tcl_UntraceVar(menuPtr->interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuVarProc, (ClientData) mePtr);
@@ -1961,7 +1944,7 @@ ConfigureMenuEntry(mePtr, objc, objv)
if (menuPtr->tkwin != NULL) {
if (Tk_SetOptions(menuPtr->interp, (char *) mePtr,
mePtr->optionTable, objc, objv, menuPtr->tkwin,
- &errorStruct, (int *) NULL) != TCL_OK) {
+ &errorStruct, NULL) != TCL_OK) {
return TCL_ERROR;
}
result = PostProcessEntry(mePtr);
@@ -1973,7 +1956,7 @@ ConfigureMenuEntry(mePtr, objc, objv)
}
TkEventuallyRecomputeMenu(menuPtr);
-
+
return result;
}
@@ -1985,39 +1968,38 @@ ConfigureMenuEntry(mePtr, objc, objv)
* Calls ConfigureMenuEntry for each menu in the clone chain.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information such as label and accelerator get
- * set for mePtr; old resources get freed, if there were any.
+ * Configuration information such as label and accelerator get set for
+ * mePtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- 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. */
+ConfigureMenuCloneEntries(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
{
TkMenuEntry *mePtr;
TkMenu *menuListPtr;
int cascadeEntryChanged = 0;
- TkMenuReferences *oldCascadeMenuRefPtr, *cascadeMenuRefPtr = NULL;
+ TkMenuReferences *oldCascadeMenuRefPtr, *cascadeMenuRefPtr = NULL;
Tcl_Obj *oldCascadePtr = NULL;
char *newCascadeName;
/*
- * Cascades are kind of tricky here. This is special case #3 in the comment
- * at the top of this file. Basically, if a menu is the master menu of a
- * clone chain, and has an entry with a cascade menu, the clones of
- * the menu will point to clones of the cascade menu. We have
- * to destroy the clones of the cascades, clone the new cascade
- * menu, and configure the entry to point to the new clone.
+ * Cascades are kind of tricky here. This is special case #3 in the
+ * comment at the top of this file. Basically, if a menu is the master
+ * menu of a clone chain, and has an entry with a cascade menu, the clones
+ * of the menu will point to clones of the cascade menu. We have to
+ * destroy the clones of the cascades, clone the new cascade menu, and
+ * configure the entry to point to the new clone.
*/
mePtr = menuPtr->masterMenuPtr->entries[index];
@@ -2036,21 +2018,20 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
char *oldCascadeName;
if (mePtr->namePtr != NULL) {
- newCascadeName = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ newCascadeName = Tcl_GetString(mePtr->namePtr);
} else {
newCascadeName = NULL;
}
-
+
if ((oldCascadePtr == NULL) && (mePtr->namePtr == NULL)) {
cascadeEntryChanged = 0;
} else if (((oldCascadePtr == NULL) && (mePtr->namePtr != NULL))
- || ((oldCascadePtr != NULL)
+ || ((oldCascadePtr != NULL)
&& (mePtr->namePtr == NULL))) {
cascadeEntryChanged = 1;
} else {
- oldCascadeName = Tcl_GetStringFromObj(oldCascadePtr,
- NULL);
- cascadeEntryChanged = (strcmp(oldCascadeName, newCascadeName)
+ oldCascadeName = Tcl_GetString(oldCascadePtr);
+ cascadeEntryChanged = (strcmp(oldCascadeName, newCascadeName)
!= 0);
}
if (oldCascadePtr != NULL) {
@@ -2060,20 +2041,20 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
if (cascadeEntryChanged) {
if (mePtr->namePtr != NULL) {
- newCascadeName = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ newCascadeName = Tcl_GetString(mePtr->namePtr);
cascadeMenuRefPtr = TkFindMenuReferences(menuPtr->interp,
newCascadeName);
}
}
- for (menuListPtr = menuPtr->masterMenuPtr->nextInstancePtr;
+ for (menuListPtr = menuPtr->masterMenuPtr->nextInstancePtr;
menuListPtr != NULL;
menuListPtr = menuListPtr->nextInstancePtr) {
-
+
mePtr = menuListPtr->entries[index];
if (cascadeEntryChanged && (mePtr->namePtr != NULL)) {
- oldCascadeMenuRefPtr = TkFindMenuReferencesObj(menuPtr->interp,
+ oldCascadeMenuRefPtr = TkFindMenuReferencesObj(menuPtr->interp,
mePtr->namePtr);
if ((oldCascadeMenuRefPtr != NULL)
@@ -2085,7 +2066,7 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
if (ConfigureMenuEntry(mePtr, objc, objv) != TCL_OK) {
return TCL_ERROR;
}
-
+
if (cascadeEntryChanged && (mePtr->namePtr != NULL)) {
if (cascadeMenuRefPtr->menuPtr != NULL) {
Tcl_Obj *newObjv[2];
@@ -2097,7 +2078,7 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
Tcl_IncrRefCount(pathNamePtr);
newCloneNamePtr = TkNewMenuName(menuPtr->interp,
- pathNamePtr,
+ pathNamePtr,
cascadeMenuRefPtr->menuPtr);
Tcl_IncrRefCount(newCloneNamePtr);
Tcl_IncrRefCount(normalPtr);
@@ -2123,14 +2104,14 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
*
* TkGetMenuIndex --
*
- * Parse a textual index into a menu and return the numerical
- * index of the indicated entry.
+ * Parse a textual index into a menu and return the numerical index of
+ * the indicated entry.
*
* Results:
- * A standard Tcl result. If all went well, then *indexPtr is
- * filled in with the entry index corresponding to string
- * (ranges from -1 to the number of entries in the menu minus
- * one). Otherwise an error message is left in the interp's result.
+ * A standard Tcl result. If all went well, then *indexPtr is filled in
+ * with the entry index corresponding to string (ranges from -1 to the
+ * number of entries in the menu minus one). Otherwise an error message
+ * is left in the interp's result.
*
* Side effects:
* None.
@@ -2139,18 +2120,18 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
*/
int
-TkGetMenuIndex(interp, menuPtr, objPtr, lastOK, indexPtr)
- Tcl_Interp *interp; /* For error messages. */
- TkMenu *menuPtr; /* Menu for which the index is being
+TkGetMenuIndex(
+ Tcl_Interp *interp, /* For error messages. */
+ TkMenu *menuPtr, /* Menu for which the index is being
* specified. */
- Tcl_Obj *objPtr; /* Specification of an entry in menu. See
+ Tcl_Obj *objPtr, /* Specification of an entry in menu. See
* manual entry for valid .*/
- int lastOK; /* Non-zero means its OK to return index
- * just *after* last entry. */
- int *indexPtr; /* Where to store converted index. */
+ int lastOK, /* Non-zero means its OK to return index just
+ * *after* last entry. */
+ int *indexPtr) /* Where to store converted index. */
{
int i;
- char *string = Tcl_GetStringFromObj(objPtr, NULL);
+ char *string = Tcl_GetString(objPtr);
if ((string[0] == 'a') && (strcmp(string, "active") == 0)) {
*indexPtr = menuPtr->active;
@@ -2176,7 +2157,7 @@ TkGetMenuIndex(interp, menuPtr, objPtr, lastOK, indexPtr)
}
if (isdigit(UCHAR(string[0]))) {
- if (Tcl_GetInt(interp, string, &i) == TCL_OK) {
+ if (Tcl_GetInt(interp, string, &i) == TCL_OK) {
if (i >= menuPtr->numEntries) {
if (lastOK) {
i = menuPtr->numEntries;
@@ -2189,26 +2170,23 @@ TkGetMenuIndex(interp, menuPtr, objPtr, lastOK, indexPtr)
*indexPtr = i;
goto success;
}
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
}
for (i = 0; i < menuPtr->numEntries; i++) {
Tcl_Obj *labelPtr = menuPtr->entries[i]->labelPtr;
- char *label = (labelPtr == NULL) ? NULL
- : Tcl_GetStringFromObj(labelPtr, NULL);
-
- if ((label != NULL)
- && (Tcl_StringMatch(label, string))) {
+ char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr);
+
+ if ((label != NULL) && (Tcl_StringMatch(label, string))) {
*indexPtr = i;
goto success;
}
}
- Tcl_AppendResult(interp, "bad menu entry index \"",
- string, "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "bad menu entry index \"", string, "\"", NULL);
return TCL_ERROR;
-success:
+ success:
return TCL_OK;
}
@@ -2217,9 +2195,9 @@ success:
*
* MenuCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -2231,25 +2209,26 @@ success:
*/
static void
-MenuCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+MenuCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
TkMenu *menuPtr = (TkMenu *) clientData;
Tk_Window tkwin = menuPtr->tkwin;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (tkwin != NULL) {
- /*
- * Note: it may be desirable to NULL out the tkwin
- * field of menuPtr here:
+ /*
+ * Note: it may be desirable to NULL out the tkwin field of menuPtr
+ * here:
* menuPtr->tkwin = NULL;
*/
+
Tk_DestroyWindow(tkwin);
}
}
@@ -2259,12 +2238,12 @@ MenuCmdDeletedProc(clientData)
*
* MenuNewEntry --
*
- * This procedure allocates and initializes a new menu entry.
+ * This function allocates and initializes a new menu entry.
*
* Results:
- * The return value is a pointer to a new menu entry structure,
- * which has been malloc-ed, initialized, and entered into the
- * entry array for the menu.
+ * The return value is a pointer to a new menu entry structure, which has
+ * been malloc-ed, initialized, and entered into the entry array for the
+ * menu.
*
* Side effects:
* Storage gets allocated.
@@ -2273,19 +2252,18 @@ MenuCmdDeletedProc(clientData)
*/
static TkMenuEntry *
-MenuNewEntry(menuPtr, index, type)
- TkMenu *menuPtr; /* Menu that will hold the new entry. */
- int index; /* Where in the menu the new entry is to
+MenuNewEntry(
+ TkMenu *menuPtr, /* Menu that will hold the new entry. */
+ int index, /* Where in the menu the new entry is to
* go. */
- int type; /* The type of the new entry. */
+ int type) /* The type of the new entry. */
{
TkMenuEntry *mePtr;
TkMenuEntry **newEntries;
int i;
/*
- * Create a new array of entries with an empty slot for the
- * new entry.
+ * Create a new array of entries with an empty slot for the new entry.
*/
newEntries = (TkMenuEntry **) ckalloc((unsigned)
@@ -2293,7 +2271,7 @@ MenuNewEntry(menuPtr, index, type)
for (i = 0; i < index; i++) {
newEntries[i] = menuPtr->entries[i];
}
- for ( ; i < menuPtr->numEntries; i++) {
+ for (; i < menuPtr->numEntries; i++) {
newEntries[i+1] = menuPtr->entries[i];
newEntries[i+1]->index = i + 1;
}
@@ -2356,8 +2334,8 @@ MenuNewEntry(menuPtr, index, type)
*
* MenuAddOrInsert --
*
- * This procedure does all of the work of the "add" and "insert"
- * widget commands, allowing the code for these to be shared.
+ * This function does all of the work of the "add" and "insert" widget
+ * commands, allowing the code for these to be shared.
*
* Results:
* A standard Tcl return value.
@@ -2369,34 +2347,29 @@ MenuNewEntry(menuPtr, index, type)
*/
static int
-MenuAddOrInsert(interp, menuPtr, indexPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- TkMenu *menuPtr; /* Widget in which to create new
- * entry. */
- 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 entry, others are
- * config options. */
+MenuAddOrInsert(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ TkMenu *menuPtr, /* Widget in which to create new entry. */
+ 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
+ * entry, others are config options. */
{
int type, index;
TkMenuEntry *mePtr;
TkMenu *menuListPtr;
if (indexPtr != NULL) {
- if (TkGetMenuIndex(interp, menuPtr, indexPtr, 1, &index)
- != TCL_OK) {
+ if (TkGetMenuIndex(interp, menuPtr, indexPtr, 1, &index) != TCL_OK) {
return TCL_ERROR;
}
} else {
index = menuPtr->numEntries;
}
if (index < 0) {
- char *indexString = Tcl_GetStringFromObj(indexPtr, NULL);
- Tcl_AppendResult(interp, "bad index \"", indexString, "\"",
- (char *) NULL);
+ char *indexString = Tcl_GetString(indexPtr);
+ Tcl_AppendResult(interp, "bad index \"", indexString, "\"", NULL);
return TCL_ERROR;
}
if (menuPtr->tearoff && (index == 0)) {
@@ -2416,9 +2389,9 @@ MenuAddOrInsert(interp, menuPtr, indexPtr, objc, objv)
* Now we have to add an entry for every instance related to this menu.
*/
- for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL;
+ for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL;
menuListPtr = menuListPtr->nextInstancePtr) {
-
+
mePtr = MenuNewEntry(menuListPtr, index, type);
if (mePtr == NULL) {
return TCL_ERROR;
@@ -2447,48 +2420,46 @@ MenuAddOrInsert(interp, menuPtr, indexPtr, objc, objv)
}
return TCL_ERROR;
}
-
+
/*
- * If a menu has cascades, then every instance of the menu has
- * to have its own parallel cascade structure. So adding an
- * entry to a menu with clones means that the menu that the
- * entry points to has to be cloned for every clone the
- * master menu has. This is special case #2 in the comment
- * at the top of this file.
+ * If a menu has cascades, then every instance of the menu has to have
+ * its own parallel cascade structure. So adding an entry to a menu
+ * with clones means that the menu that the entry points to has to be
+ * cloned for every clone the master menu has. This is special case #2
+ * in the comment at the top of this file.
*/
-
- if ((menuPtr != menuListPtr) && (type == CASCADE_ENTRY)) {
+
+ if ((menuPtr != menuListPtr) && (type == CASCADE_ENTRY)) {
if ((mePtr->namePtr != NULL)
&& (mePtr->childMenuRefPtr != NULL)
&& (mePtr->childMenuRefPtr->menuPtr != NULL)) {
- TkMenu *cascadeMenuPtr =
+ TkMenu *cascadeMenuPtr =
mePtr->childMenuRefPtr->menuPtr->masterMenuPtr;
- Tcl_Obj *newCascadePtr;
+ Tcl_Obj *newCascadePtr, *newObjv[2];
Tcl_Obj *menuNamePtr = Tcl_NewStringObj("-menu", -1);
- Tcl_Obj *windowNamePtr =
+ Tcl_Obj *windowNamePtr =
Tcl_NewStringObj(Tk_PathName(menuListPtr->tkwin), -1);
Tcl_Obj *normalPtr = Tcl_NewStringObj("normal", -1);
- Tcl_Obj *newObjv[2];
TkMenuReferences *menuRefPtr;
-
+
Tcl_IncrRefCount(windowNamePtr);
newCascadePtr = TkNewMenuName(menuListPtr->interp,
windowNamePtr, cascadeMenuPtr);
Tcl_IncrRefCount(newCascadePtr);
Tcl_IncrRefCount(normalPtr);
CloneMenu(cascadeMenuPtr, newCascadePtr, normalPtr);
-
+
menuRefPtr = TkFindMenuReferencesObj(menuListPtr->interp,
newCascadePtr);
if (menuRefPtr == NULL) {
- panic("CloneMenu failed inside of MenuAddOrInsert.");
+ Tcl_Panic("CloneMenu failed inside of MenuAddOrInsert.");
}
newObjv[0] = menuNamePtr;
newObjv[1] = newCascadePtr;
Tcl_IncrRefCount(menuNamePtr);
Tcl_IncrRefCount(newCascadePtr);
- ConfigureMenuEntry(mePtr, 2, newObjv);
- Tcl_DecrRefCount(newCascadePtr);
+ ConfigureMenuEntry(mePtr, 2, newObjv);
+ Tcl_DecrRefCount(newCascadePtr);
Tcl_DecrRefCount(menuNamePtr);
Tcl_DecrRefCount(windowNamePtr);
Tcl_DecrRefCount(normalPtr);
@@ -2503,10 +2474,9 @@ MenuAddOrInsert(interp, menuPtr, indexPtr, objc, objv)
*
* MenuVarProc --
*
- * This procedure is invoked when someone changes the
- * state variable associated with a radiobutton or checkbutton
- * menu entry. The entry's selected state is set to match
- * the value of the variable.
+ * This function is invoked when someone changes the state variable
+ * associated with a radiobutton or checkbutton menu entry. The entry's
+ * selected state is set to match the value of the variable.
*
* Results:
* NULL is always returned.
@@ -2518,12 +2488,12 @@ MenuAddOrInsert(interp, menuPtr, indexPtr, objc, objv)
*/
static char *
-MenuVarProc(clientData, interp, name1, name2, flags)
- 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. */
- int flags; /* Describes what just happened. */
+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. */
+ int flags) /* Describes what just happened. */
{
TkMenuEntry *mePtr = (TkMenuEntry *) clientData;
TkMenu *menuPtr;
@@ -2536,11 +2506,11 @@ MenuVarProc(clientData, interp, name1, name2, flags)
* Do nothing if the interpreter is going away.
*/
- return (char *) NULL;
+ return NULL;
}
menuPtr = mePtr->menuPtr;
- name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ name = Tcl_GetString(mePtr->namePtr);
/*
* If the variable is being unset, then re-establish the trace.
@@ -2554,13 +2524,13 @@ MenuVarProc(clientData, interp, name1, name2, flags)
MenuVarProc, clientData);
}
TkpConfigureMenuEntry(mePtr);
- TkEventuallyRedrawMenu(menuPtr, (TkMenuEntry *) NULL);
- return (char *) NULL;
+ TkEventuallyRedrawMenu(menuPtr, NULL);
+ return NULL;
}
/*
- * Use the value of the variable to update the selected status of
- * the menu entry.
+ * Use the value of the variable to update the selected status of the menu
+ * entry.
*/
value = Tcl_GetVar(interp, name, TCL_GLOBAL_ONLY);
@@ -2568,23 +2538,23 @@ MenuVarProc(clientData, interp, name1, name2, flags)
value = "";
}
if (mePtr->onValuePtr != NULL) {
- onValue = Tcl_GetStringFromObj(mePtr->onValuePtr, NULL);
+ onValue = Tcl_GetString(mePtr->onValuePtr);
if (strcmp(value, onValue) == 0) {
if (mePtr->entryFlags & ENTRY_SELECTED) {
- return (char *) NULL;
+ return NULL;
}
mePtr->entryFlags |= ENTRY_SELECTED;
} else if (mePtr->entryFlags & ENTRY_SELECTED) {
mePtr->entryFlags &= ~ENTRY_SELECTED;
} else {
- return (char *) NULL;
+ return NULL;
}
} else {
- return (char *) NULL;
+ return NULL;
}
TkpConfigureMenuEntry(mePtr);
TkEventuallyRedrawMenu(menuPtr, mePtr);
- return (char *) NULL;
+ return NULL;
}
/*
@@ -2592,26 +2562,25 @@ MenuVarProc(clientData, interp, name1, name2, flags)
*
* TkActivateMenuEntry --
*
- * This procedure is invoked to make a particular menu entry
- * the active one, deactivating any other entry that might
- * currently be active.
+ * This function is invoked to make a particular menu entry the active
+ * one, deactivating any other entry that might currently be active.
*
* Results:
- * The return value is a standard Tcl result (errors can occur
- * while posting and unposting submenus).
+ * The return value is a standard Tcl result (errors can occur while
+ * posting and unposting submenus).
*
* Side effects:
- * Menu entries get redisplayed, and the active entry changes.
- * Submenus may get posted and unposted.
+ * Menu entries get redisplayed, and the active entry changes. Submenus
+ * may get posted and unposted.
*
*----------------------------------------------------------------------
*/
int
-TkActivateMenuEntry(menuPtr, index)
- register TkMenu *menuPtr; /* Menu in which to activate. */
- int index; /* Index of entry to activate, or
- * -1 to deactivate all entries. */
+TkActivateMenuEntry(
+ register TkMenu *menuPtr, /* Menu in which to activate. */
+ int index) /* Index of entry to activate, or -1 to
+ * deactivate all entries. */
{
register TkMenuEntry *mePtr;
int result = TCL_OK;
@@ -2620,8 +2589,8 @@ TkActivateMenuEntry(menuPtr, index)
mePtr = menuPtr->entries[menuPtr->active];
/*
- * Don't change the state unless it's currently active (state
- * might already have been changed to disabled).
+ * Don't change the state unless it's currently active (state might
+ * already have been changed to disabled).
*/
if (mePtr->state == ENTRY_ACTIVE) {
@@ -2646,8 +2615,8 @@ TkActivateMenuEntry(menuPtr, index)
* Execute the postcommand for the given menu.
*
* Results:
- * The return value is a standard Tcl result (errors can occur
- * while the postcommands are being processed).
+ * The return value is a standard Tcl result (errors can occur while the
+ * postcommands are being processed).
*
* Side effects:
* Since commands can get executed while this routine is being executed,
@@ -2655,17 +2624,17 @@ TkActivateMenuEntry(menuPtr, index)
*
*----------------------------------------------------------------------
*/
-
+
int
-TkPostCommand(menuPtr)
- TkMenu *menuPtr;
+TkPostCommand(
+ TkMenu *menuPtr)
{
int result;
/*
- * If there is a command for the menu, execute it. This
- * may change the size of the menu, so be sure to recompute
- * the menu's geometry if needed.
+ * If there is a command for the menu, execute it. This may change the
+ * size of the menu, so be sure to recompute the menu's geometry if
+ * needed.
*/
if (menuPtr->postCommandPtr != NULL) {
@@ -2688,37 +2657,36 @@ TkPostCommand(menuPtr)
*
* CloneMenu --
*
- * Creates a child copy of the menu. It will be inserted into
- * the menu's instance chain. All attributes and entry
- * attributes will be duplicated.
+ * Creates a child copy of the menu. It will be inserted into the menu's
+ * instance chain. All attributes and entry attributes will be
+ * duplicated.
*
* Results:
* A standard Tcl result.
*
* Side effects:
- * Allocates storage. After the menu is created, any
- * configuration done with this menu or any related one
- * will be reflected in all of them.
+ * Allocates storage. After the menu is created, any configuration done
+ * with this menu or any related one will be reflected in all of them.
*
*--------------------------------------------------------------
*/
static int
-CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
- TkMenu *menuPtr; /* The menu we are going to clone */
- Tcl_Obj *newMenuNamePtr; /* The name to give the new menu */
- Tcl_Obj *newMenuTypePtr; /* What kind of menu is this, a normal menu
- * a menubar, or a tearoff? */
+CloneMenu(
+ TkMenu *menuPtr, /* The menu we are going to clone. */
+ Tcl_Obj *newMenuNamePtr, /* The name to give the new menu. */
+ Tcl_Obj *newMenuTypePtr) /* What kind of menu is this, a normal menu a
+ * menubar, or a tearoff? */
{
int returnResult;
int menuType, i;
TkMenuReferences *menuRefPtr;
Tcl_Obj *menuDupCommandArray[4];
-
+
if (newMenuTypePtr == NULL) {
- menuType = MASTER_MENU;
+ menuType = MASTER_MENU;
} else {
- if (Tcl_GetIndexFromObj(menuPtr->interp, newMenuTypePtr,
+ if (Tcl_GetIndexFromObj(menuPtr->interp, newMenuTypePtr,
menuTypeStrings, "menu type", 0, &menuType) != TCL_OK) {
return TCL_ERROR;
}
@@ -2744,12 +2712,12 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
/*
* Make sure the tcl command actually created the clone.
*/
-
+
if ((returnResult == TCL_OK) &&
- ((menuRefPtr = TkFindMenuReferencesObj(menuPtr->interp,
- newMenuNamePtr)) != (TkMenuReferences *) NULL)
+ ((menuRefPtr = TkFindMenuReferencesObj(menuPtr->interp,
+ newMenuNamePtr)) != NULL)
&& (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) {
- TkMenu *newMenuPtr = menuRefPtr->menuPtr;
+ TkMenu *newMenuPtr = menuRefPtr->menuPtr;
Tcl_Obj *newObjv[3];
int i, numElements;
@@ -2763,83 +2731,85 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
newMenuPtr->masterMenuPtr = menuPtr->masterMenuPtr;
} else {
TkMenu *masterMenuPtr;
-
+
masterMenuPtr = menuPtr->masterMenuPtr;
newMenuPtr->nextInstancePtr = masterMenuPtr->nextInstancePtr;
masterMenuPtr->nextInstancePtr = newMenuPtr;
newMenuPtr->masterMenuPtr = masterMenuPtr;
}
-
- /*
- * Add the master menu's window to the bind tags for this window
- * after this window's tag. This is so the user can bind to either
- * this clone (which may not be easy to do) or the entire menu
- * clone structure.
- */
-
+
+ /*
+ * Add the master menu's window to the bind tags for this window after
+ * this window's tag. This is so the user can bind to either this
+ * clone (which may not be easy to do) or the entire menu clone
+ * structure.
+ */
+
newObjv[0] = Tcl_NewStringObj("bindtags", -1);
- newObjv[1] = Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin), -1);
+ newObjv[1] = Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin), -1);
Tcl_IncrRefCount(newObjv[0]);
Tcl_IncrRefCount(newObjv[1]);
- if (Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
- newMenuPtr->interp, 2, newObjv) == TCL_OK) {
- char *windowName;
- Tcl_Obj *bindingsPtr =
+ if (Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
+ newMenuPtr->interp, 2, newObjv) == TCL_OK) {
+ char *windowName;
+ Tcl_Obj *bindingsPtr =
Tcl_DuplicateObj(Tcl_GetObjResult(newMenuPtr->interp));
- Tcl_Obj *elementPtr;
-
+ Tcl_Obj *elementPtr;
+
Tcl_IncrRefCount(bindingsPtr);
- Tcl_ListObjLength(newMenuPtr->interp, bindingsPtr, &numElements);
- for (i = 0; i < numElements; i++) {
- Tcl_ListObjIndex(newMenuPtr->interp, bindingsPtr, i,
+ Tcl_ListObjLength(newMenuPtr->interp, bindingsPtr, &numElements);
+ for (i = 0; i < numElements; i++) {
+ Tcl_ListObjIndex(newMenuPtr->interp, bindingsPtr, i,
&elementPtr);
- windowName = Tcl_GetStringFromObj(elementPtr, NULL);
- if (strcmp(windowName, Tk_PathName(newMenuPtr->tkwin))
- == 0) {
- Tcl_Obj *newElementPtr = Tcl_NewStringObj(
- Tk_PathName(newMenuPtr->masterMenuPtr->tkwin), -1);
- /*
+ windowName = Tcl_GetString(elementPtr);
+ if (strcmp(windowName, Tk_PathName(newMenuPtr->tkwin))
+ == 0) {
+ Tcl_Obj *newElementPtr = Tcl_NewStringObj(
+ Tk_PathName(newMenuPtr->masterMenuPtr->tkwin), -1);
+
+ /*
* The newElementPtr will have its refCount incremented
* here, so we don't need to worry about it any more.
*/
- Tcl_ListObjReplace(menuPtr->interp, bindingsPtr,
- i + 1, 0, 1, &newElementPtr);
+
+ Tcl_ListObjReplace(menuPtr->interp, bindingsPtr,
+ i + 1, 0, 1, &newElementPtr);
newObjv[2] = bindingsPtr;
Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
menuPtr->interp, 3, newObjv);
- break;
- }
- }
- Tcl_DecrRefCount(bindingsPtr);
- }
+ break;
+ }
+ }
+ Tcl_DecrRefCount(bindingsPtr);
+ }
Tcl_DecrRefCount(newObjv[0]);
Tcl_DecrRefCount(newObjv[1]);
- Tcl_ResetResult(menuPtr->interp);
-
- /*
- * Clone all of the cascade menus that this menu points to.
- */
-
- for (i = 0; i < menuPtr->numEntries; i++) {
- TkMenuReferences *cascadeRefPtr;
- TkMenu *oldCascadePtr;
-
- if ((menuPtr->entries[i]->type == CASCADE_ENTRY)
+ Tcl_ResetResult(menuPtr->interp);
+
+ /*
+ * Clone all of the cascade menus that this menu points to.
+ */
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ TkMenuReferences *cascadeRefPtr;
+ TkMenu *oldCascadePtr;
+
+ if ((menuPtr->entries[i]->type == CASCADE_ENTRY)
&& (menuPtr->entries[i]->namePtr != NULL)) {
- cascadeRefPtr =
+ cascadeRefPtr =
TkFindMenuReferencesObj(menuPtr->interp,
menuPtr->entries[i]->namePtr);
- if ((cascadeRefPtr != NULL) && (cascadeRefPtr->menuPtr)) {
- Tcl_Obj *windowNamePtr =
+ if ((cascadeRefPtr != NULL) && (cascadeRefPtr->menuPtr)) {
+ Tcl_Obj *windowNamePtr =
Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin),
-1);
Tcl_Obj *newCascadePtr;
-
- oldCascadePtr = cascadeRefPtr->menuPtr;
+
+ oldCascadePtr = cascadeRefPtr->menuPtr;
Tcl_IncrRefCount(windowNamePtr);
- newCascadePtr = TkNewMenuName(menuPtr->interp,
- windowNamePtr, oldCascadePtr);
+ newCascadePtr = TkNewMenuName(menuPtr->interp,
+ windowNamePtr, oldCascadePtr);
Tcl_IncrRefCount(newCascadePtr);
CloneMenu(oldCascadePtr, newCascadePtr, NULL);
@@ -2850,13 +2820,13 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
Tcl_DecrRefCount(newObjv[0]);
Tcl_DecrRefCount(newCascadePtr);
Tcl_DecrRefCount(windowNamePtr);
- }
- }
- }
-
- returnResult = TCL_OK;
+ }
+ }
+ }
+
+ returnResult = TCL_OK;
} else {
- returnResult = TCL_ERROR;
+ returnResult = TCL_ERROR;
}
Tcl_Release((ClientData) menuPtr);
return returnResult;
@@ -2865,6 +2835,43 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
/*
*----------------------------------------------------------------------
*
+ * MenuDoXPosition --
+ *
+ * Given arguments from an option command line, returns the X position.
+ *
+ * Results:
+ * Returns TCL_OK or TCL_Error
+ *
+ * Side effects:
+ * xPosition is set to the X-position of the menu entry.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+MenuDoXPosition(
+ Tcl_Interp *interp,
+ TkMenu *menuPtr,
+ Tcl_Obj *objPtr)
+{
+ int index;
+
+ TkRecomputeMenu(menuPtr);
+ if (TkGetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp);
+ if (index < 0) {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
+ } else {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(menuPtr->entries[index]->x));
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* MenuDoYPosition --
*
* Given arguments from an option command line, returns the Y position.
@@ -2877,18 +2884,18 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
*
*----------------------------------------------------------------------
*/
-
+
static int
-MenuDoYPosition(interp, menuPtr, objPtr)
- Tcl_Interp *interp;
- TkMenu *menuPtr;
- Tcl_Obj *objPtr;
+MenuDoYPosition(
+ Tcl_Interp *interp,
+ TkMenu *menuPtr,
+ Tcl_Obj *objPtr)
{
int index;
-
+
TkRecomputeMenu(menuPtr);
if (TkGetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) {
- goto error;
+ goto error;
}
Tcl_ResetResult(interp);
if (index < 0) {
@@ -2898,8 +2905,8 @@ MenuDoYPosition(interp, menuPtr, objPtr)
}
return TCL_OK;
-
-error:
+
+ error:
return TCL_ERROR;
}
@@ -2908,36 +2915,39 @@ error:
*
* GetIndexFromCoords --
*
- * Given a string of the form "@int", return the menu item corresponding
- * to int.
+ * Given a string of the form "@integer", return the menu item
+ * corresponding to the provided y-coordinate in the menu window.
*
* Results:
- * If int is a valid number, *indexPtr will be the number of the menuentry
- * that is the correct height. If int is invaled, *indexPtr will be
- * unchanged. Returns appropriate Tcl error number.
+ * If int is a valid number, *indexPtr will be the number of the
+ * menuentry that is the correct height. If int is invalid, *indexPtr
+ * will be unchanged. Returns appropriate Tcl error number.
*
* Side effects:
- * If int is invalid, interp's result will set to NULL.
+ * If int is invalid, interp's result will be set to NULL.
*
*----------------------------------------------------------------------
*/
static int
-GetIndexFromCoords(interp, menuPtr, string, indexPtr)
- Tcl_Interp *interp; /* interp of menu */
- TkMenu *menuPtr; /* the menu we are searching */
- char *string; /* The @string we are parsing */
- int *indexPtr; /* The index of the item that matches */
+GetIndexFromCoords(
+ Tcl_Interp *interp, /* Interpreter of menu. */
+ TkMenu *menuPtr, /* The menu we are searching. */
+ char *string, /* The @string we are parsing. */
+ int *indexPtr) /* The index of the item that matches. */
{
int x, y, i;
char *p, *end;
-
+ int x2, borderwidth, max;
+
TkRecomputeMenu(menuPtr);
p = string + 1;
y = strtol(p, &end, 0);
if (end == p) {
goto error;
}
+ Tk_GetPixelsFromObj(interp, menuPtr->tkwin,
+ menuPtr->borderWidthPtr, &borderwidth);
if (*end == ',') {
x = y;
p = end + 1;
@@ -2946,27 +2956,36 @@ GetIndexFromCoords(interp, menuPtr, string, indexPtr)
goto error;
}
} else {
- Tk_GetPixelsFromObj(interp, menuPtr->tkwin,
- menuPtr->borderWidthPtr, &x);
+ x = borderwidth;
}
-
+
+ *indexPtr = -1;
+
+ /* set the width of the final column to the remainder of the window
+ * being aware of windows that may not be mapped yet.
+ */
+ max = Tk_IsMapped(menuPtr->tkwin)
+ ? Tk_Width(menuPtr->tkwin) : Tk_ReqWidth(menuPtr->tkwin);
+ max -= borderwidth;
+
for (i = 0; i < menuPtr->numEntries; i++) {
+ if (menuPtr->entries[i]->entryFlags & ENTRY_LAST_COLUMN) {
+ x2 = max;
+ } else {
+ x2 = menuPtr->entries[i]->x + menuPtr->entries[i]->width;
+ }
if ((x >= menuPtr->entries[i]->x) && (y >= menuPtr->entries[i]->y)
- && (x < (menuPtr->entries[i]->x + menuPtr->entries[i]->width))
+ && (x < x2)
&& (y < (menuPtr->entries[i]->y
+ menuPtr->entries[i]->height))) {
+ *indexPtr = i;
break;
}
}
- if (i >= menuPtr->numEntries) {
- /* i = menuPtr->numEntries - 1; */
- i = -1;
- }
- *indexPtr = i;
return TCL_OK;
- error:
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ error:
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
return TCL_ERROR;
}
@@ -2976,8 +2995,8 @@ GetIndexFromCoords(interp, menuPtr, string, indexPtr)
* RecursivelyDeleteMenu --
*
* Deletes a menu and any cascades underneath it. Used for deleting
- * instances when a menu is no longer being used as a menubar,
- * for instance.
+ * instances when a menu is no longer being used as a menubar, for
+ * instance.
*
* Results:
* None.
@@ -2989,19 +3008,19 @@ GetIndexFromCoords(interp, menuPtr, string, indexPtr)
*/
static void
-RecursivelyDeleteMenu(menuPtr)
- TkMenu *menuPtr; /* The menubar instance we are deleting */
+RecursivelyDeleteMenu(
+ TkMenu *menuPtr) /* The menubar instance we are deleting. */
{
int i;
TkMenuEntry *mePtr;
-
- /*
- * It is not 100% clear that this preserve/release pair is
- * required, but we have added them for safety in this
- * very complex code.
+
+ /*
+ * It is not 100% clear that this preserve/release pair is required, but
+ * we have added them for safety in this very complex code.
*/
+
Tcl_Preserve(menuPtr);
-
+
for (i = 0; i < menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
if ((mePtr->type == CASCADE_ENTRY)
@@ -3013,7 +3032,7 @@ RecursivelyDeleteMenu(menuPtr)
if (menuPtr->tkwin != NULL) {
Tk_DestroyWindow(menuPtr->tkwin);
}
-
+
Tcl_Release(menuPtr);
}
@@ -3022,8 +3041,7 @@ RecursivelyDeleteMenu(menuPtr)
*
* TkNewMenuName --
*
- * Makes a new unique name for a cloned menu. Will be a child
- * of oldName.
+ * Makes a new unique name for a cloned menu. Will be a child of oldName.
*
* Results:
* Returns a char * which has been allocated; caller must free.
@@ -3035,10 +3053,10 @@ RecursivelyDeleteMenu(menuPtr)
*/
Tcl_Obj *
-TkNewMenuName(interp, parentPtr, menuPtr)
- Tcl_Interp *interp; /* The interp the new name has to live in.*/
- Tcl_Obj *parentPtr; /* The prefix path of the new name. */
- TkMenu *menuPtr; /* The menu we are cloning. */
+TkNewMenuName(
+ Tcl_Interp *interp, /* The interp the new name has to live in.*/
+ Tcl_Obj *parentPtr, /* The prefix path of the new name. */
+ TkMenu *menuPtr) /* The menu we are cloning. */
{
Tcl_Obj *resultPtr = NULL; /* Initialization needed only to prevent
* compiler warning. */
@@ -3049,7 +3067,7 @@ TkNewMenuName(interp, parentPtr, menuPtr)
Tcl_CmdInfo cmdInfo;
Tcl_HashTable *nameTablePtr = NULL;
TkWindow *winPtr = (TkWindow *) menuPtr->tkwin;
- char *parentName = Tcl_GetStringFromObj(parentPtr, NULL);
+ char *parentName = Tcl_GetString(parentPtr);
if (winPtr->mainPtr != NULL) {
nameTablePtr = &(winPtr->mainPtr->nameTable);
@@ -3058,13 +3076,13 @@ TkNewMenuName(interp, parentPtr, menuPtr)
doDot = parentName[strlen(parentName) - 1] != '.';
childPtr = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin), -1);
- for (destString = Tcl_GetStringFromObj(childPtr, NULL);
+ for (destString = Tcl_GetString(childPtr);
*destString != '\0'; destString++) {
if (*destString == '.') {
*destString = '#';
}
}
-
+
for (i = 0; ; i++) {
if (i == 0) {
resultPtr = Tcl_DuplicateObj(parentPtr);
@@ -3085,7 +3103,7 @@ TkNewMenuName(interp, parentPtr, menuPtr)
Tcl_AppendObjToObj(resultPtr, intPtr);
Tcl_DecrRefCount(intPtr);
}
- destString = Tcl_GetStringFromObj(resultPtr, NULL);
+ destString = Tcl_GetString(resultPtr);
if ((Tcl_GetCommandInfo(interp, destString, &cmdInfo) == 0)
&& ((nameTablePtr == NULL)
|| (Tcl_FindHashEntry(nameTablePtr, destString) == NULL))) {
@@ -3101,76 +3119,73 @@ TkNewMenuName(interp, parentPtr, menuPtr)
*
* TkSetWindowMenuBar --
*
- * Associates a menu with a window. Called by ConfigureFrame in
- * in response to a "-menu .foo" configuration option for a top
- * level.
+ * Associates a menu with a window. Called by ConfigureFrame in in
+ * response to a "-menu .foo" configuration option for a top level.
*
* Results:
* None.
*
* Side effects:
- * The old menu clones for the menubar are thrown away, and a
- * handler is set up to allocate the new ones.
+ * The old menu clones for the menubar are thrown away, and a handler is
+ * set up to allocate the new ones.
*
*----------------------------------------------------------------------
*/
+
void
-TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
- 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
- * this toplevel. NULL means no menu was
- * set previously. */
- char *menuName; /* The name of the new menubar that the
+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
+ * this toplevel. NULL means no menu was set
+ * previously. */
+ char *menuName) /* The name of the new menubar that the
* toplevel needs to be set to. NULL means
* that their is no menu now. */
{
TkMenuTopLevelList *topLevelListPtr, *prevTopLevelPtr;
TkMenu *menuPtr;
TkMenuReferences *menuRefPtr;
-
- TkMenuInit();
/*
- * Destroy the menubar instances of the old menu. Take this window
- * out of the old menu's top level reference list.
+ * Destroy the menubar instances of the old menu. Take this window out of
+ * the old menu's top level reference list.
*/
-
- if (oldMenuName != NULL) {
- menuRefPtr = TkFindMenuReferences(interp, oldMenuName);
- if (menuRefPtr != NULL) {
+ if (oldMenuName != NULL) {
+ menuRefPtr = TkFindMenuReferences(interp, oldMenuName);
+ if (menuRefPtr != NULL) {
/*
- * Find the menubar instance that is to be removed. Destroy
- * it and all of the cascades underneath it.
+ * Find the menubar instance that is to be removed. Destroy it and
+ * all of the cascades underneath it.
*/
- if (menuRefPtr->menuPtr != NULL) {
- TkMenu *instancePtr;
-
- menuPtr = menuRefPtr->menuPtr;
-
- for (instancePtr = menuPtr->masterMenuPtr;
- instancePtr != NULL;
- instancePtr = instancePtr->nextInstancePtr) {
- if (instancePtr->menuType == MENUBAR
- && instancePtr->parentTopLevelPtr == tkwin) {
- RecursivelyDeleteMenu(instancePtr);
- break;
- }
- }
- }
-
- /*
- * Now we need to remove this toplevel from the list of toplevels
+ if (menuRefPtr->menuPtr != NULL) {
+ TkMenu *instancePtr;
+
+ menuPtr = menuRefPtr->menuPtr;
+
+ for (instancePtr = menuPtr->masterMenuPtr;
+ instancePtr != NULL;
+ instancePtr = instancePtr->nextInstancePtr) {
+ if (instancePtr->menuType == MENUBAR
+ && instancePtr->parentTopLevelPtr == tkwin) {
+ RecursivelyDeleteMenu(instancePtr);
+ break;
+ }
+ }
+ }
+
+ /*
+ * Now we need to remove this toplevel from the list of toplevels
* that reference this menu.
- */
-
+ */
+
topLevelListPtr = menuRefPtr->topLevelListPtr;
prevTopLevelPtr = NULL;
-
- while ((topLevelListPtr != NULL)
- && (topLevelListPtr->tkwin != tkwin)) {
+
+ while ((topLevelListPtr != NULL)
+ && (topLevelListPtr->tkwin != tkwin)) {
prevTopLevelPtr = topLevelListPtr;
topLevelListPtr = topLevelListPtr->nextPtr;
}
@@ -3181,54 +3196,54 @@ TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
*/
if (topLevelListPtr != NULL) {
- if (prevTopLevelPtr == NULL) {
+ if (prevTopLevelPtr == NULL) {
menuRefPtr->topLevelListPtr =
menuRefPtr->topLevelListPtr->nextPtr;
} else {
- prevTopLevelPtr->nextPtr = topLevelListPtr->nextPtr;
- }
- ckfree((char *) topLevelListPtr);
- TkFreeMenuReferences(menuRefPtr);
- }
- }
+ prevTopLevelPtr->nextPtr = topLevelListPtr->nextPtr;
+ }
+ ckfree((char *) topLevelListPtr);
+ TkFreeMenuReferences(menuRefPtr);
+ }
+ }
}
/*
* Now, add the clone references for the new menu.
*/
-
+
if (menuName != NULL && menuName[0] != 0) {
- TkMenu *menuBarPtr = NULL;
-
- menuRefPtr = TkCreateMenuReferences(interp, menuName);
-
- menuPtr = menuRefPtr->menuPtr;
- if (menuPtr != NULL) {
- Tcl_Obj *cloneMenuPtr;
- TkMenuReferences *cloneMenuRefPtr;
+ TkMenu *menuBarPtr = NULL;
+
+ menuRefPtr = TkCreateMenuReferences(interp, menuName);
+
+ menuPtr = menuRefPtr->menuPtr;
+ if (menuPtr != NULL) {
+ Tcl_Obj *cloneMenuPtr;
+ TkMenuReferences *cloneMenuRefPtr;
Tcl_Obj *newObjv[4];
- Tcl_Obj *windowNamePtr = Tcl_NewStringObj(Tk_PathName(tkwin),
+ Tcl_Obj *windowNamePtr = Tcl_NewStringObj(Tk_PathName(tkwin),
-1);
Tcl_Obj *menubarPtr = Tcl_NewStringObj("menubar", -1);
-
- /*
- * Clone the menu and all of the cascades underneath it.
- */
+
+ /*
+ * Clone the menu and all of the cascades underneath it.
+ */
Tcl_IncrRefCount(windowNamePtr);
- cloneMenuPtr = TkNewMenuName(interp, windowNamePtr,
- menuPtr);
+ cloneMenuPtr = TkNewMenuName(interp, windowNamePtr,
+ menuPtr);
Tcl_IncrRefCount(cloneMenuPtr);
Tcl_IncrRefCount(menubarPtr);
- CloneMenu(menuPtr, cloneMenuPtr, menubarPtr);
-
- cloneMenuRefPtr = TkFindMenuReferencesObj(interp, cloneMenuPtr);
- if ((cloneMenuRefPtr != NULL)
+ CloneMenu(menuPtr, cloneMenuPtr, menubarPtr);
+
+ cloneMenuRefPtr = TkFindMenuReferencesObj(interp, cloneMenuPtr);
+ if ((cloneMenuRefPtr != NULL)
&& (cloneMenuRefPtr->menuPtr != NULL)) {
Tcl_Obj *cursorPtr = Tcl_NewStringObj("-cursor", -1);
Tcl_Obj *nullPtr = Tcl_NewObj();
- cloneMenuRefPtr->menuPtr->parentTopLevelPtr = tkwin;
- menuBarPtr = cloneMenuRefPtr->menuPtr;
+ cloneMenuRefPtr->menuPtr->parentTopLevelPtr = tkwin;
+ menuBarPtr = cloneMenuRefPtr->menuPtr;
newObjv[0] = cursorPtr;
newObjv[1] = nullPtr;
Tcl_IncrRefCount(cursorPtr);
@@ -3237,27 +3252,26 @@ TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
2, newObjv);
Tcl_DecrRefCount(cursorPtr);
Tcl_DecrRefCount(nullPtr);
- }
+ }
TkpSetWindowMenuBar(tkwin, menuBarPtr);
Tcl_DecrRefCount(cloneMenuPtr);
Tcl_DecrRefCount(menubarPtr);
Tcl_DecrRefCount(windowNamePtr);
- } else {
- TkpSetWindowMenuBar(tkwin, NULL);
+ } else {
+ TkpSetWindowMenuBar(tkwin, NULL);
}
-
- /*
- * Add this window to the menu's list of windows that refer
- * to this menu.
- */
+ /*
+ * Add this window to the menu's list of windows that refer to this
+ * menu.
+ */
- topLevelListPtr = (TkMenuTopLevelList *)
+ topLevelListPtr = (TkMenuTopLevelList *)
ckalloc(sizeof(TkMenuTopLevelList));
- topLevelListPtr->tkwin = tkwin;
- topLevelListPtr->nextPtr = menuRefPtr->topLevelListPtr;
- menuRefPtr->topLevelListPtr = topLevelListPtr;
+ topLevelListPtr->tkwin = tkwin;
+ topLevelListPtr->nextPtr = menuRefPtr->topLevelListPtr;
+ menuRefPtr->topLevelListPtr = topLevelListPtr;
} else {
TkpSetWindowMenuBar(tkwin, NULL);
}
@@ -3269,8 +3283,8 @@ TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
*
* DestroyMenuHashTable --
*
- * Called when an interp is deleted and a menu hash table has
- * been set in it.
+ * Called when an interp is deleted and a menu hash table has been set in
+ * it.
*
* Results:
* None.
@@ -3282,9 +3296,9 @@ TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
*/
static void
-DestroyMenuHashTable(clientData, interp)
- ClientData clientData; /* The menu hash table we are destroying */
- Tcl_Interp *interp; /* The interpreter we are destroying */
+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);
@@ -3295,8 +3309,8 @@ DestroyMenuHashTable(clientData, interp)
*
* TkGetMenuHashTable --
*
- * For a given interp, give back the menu hash table that goes with
- * it. If the hash table does not exist, it is created.
+ * For a given interp, give back the menu hash table that goes with it.
+ * If the hash table does not exist, it is created.
*
* Results:
* Returns a hash table pointer.
@@ -3309,13 +3323,13 @@ DestroyMenuHashTable(clientData, interp)
*/
Tcl_HashTable *
-TkGetMenuHashTable(interp)
- Tcl_Interp *interp; /* The interp we need the hash table in.*/
+TkGetMenuHashTable(
+ Tcl_Interp *interp) /* The interp we need the hash table in.*/
{
Tcl_HashTable *menuTablePtr;
- menuTablePtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, MENU_HASH_KEY,
- NULL);
+ menuTablePtr = (Tcl_HashTable *)
+ Tcl_GetAssocData(interp, MENU_HASH_KEY, NULL);
if (menuTablePtr == NULL) {
menuTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(menuTablePtr, TCL_STRING_KEYS);
@@ -3330,25 +3344,26 @@ TkGetMenuHashTable(interp)
*
* TkCreateMenuReferences --
*
- * Given a pathname, gives back a pointer to a TkMenuReferences structure.
- * If a reference is not already in the hash table, one is created.
+ * Given a pathname, gives back a pointer to a TkMenuReferences
+ * structure. If a reference is not already in the hash table, one is
+ * created.
*
* Results:
- * Returns a pointer to a menu reference structure. Should not
- * be freed by calller; when a field of the reference is cleared,
+ * Returns a pointer to a menu reference structure. Should not be freed
+ * by calller; when a field of the reference is cleared,
* TkFreeMenuReferences should be called.
*
* Side effects:
- * A new hash table entry is created if there were no references
- * to the menu originally.
+ * A new hash table entry is created if there were no references to the
+ * menu originally.
*
*----------------------------------------------------------------------
*/
TkMenuReferences *
-TkCreateMenuReferences(interp, pathName)
- Tcl_Interp *interp;
- char *pathName; /* The path of the menu widget */
+TkCreateMenuReferences(
+ Tcl_Interp *interp,
+ char *pathName) /* The path of the menu widget. */
{
Tcl_HashEntry *hashEntryPtr;
TkMenuReferences *menuRefPtr;
@@ -3378,8 +3393,8 @@ TkCreateMenuReferences(interp, pathName)
* structure.
*
* Results:
- * Returns a pointer to a menu reference structure. Should not
- * be freed by calller; when a field of the reference is cleared,
+ * Returns a pointer to a menu reference structure. Should not be freed
+ * by calller; when a field of the reference is cleared,
* TkFreeMenuReferences should be called. Returns NULL if no reference
* with this pathname exists.
*
@@ -3390,9 +3405,9 @@ TkCreateMenuReferences(interp, pathName)
*/
TkMenuReferences *
-TkFindMenuReferences(interp, pathName)
- Tcl_Interp *interp; /* The interp the menu is living in. */
- char *pathName; /* The path of the menu widget */
+TkFindMenuReferences(
+ Tcl_Interp *interp, /* The interp the menu is living in. */
+ char *pathName) /* The path of the menu widget. */
{
Tcl_HashEntry *hashEntryPtr;
TkMenuReferences *menuRefPtr = NULL;
@@ -3415,8 +3430,8 @@ TkFindMenuReferences(interp, pathName)
* structure.
*
* Results:
- * Returns a pointer to a menu reference structure. Should not
- * be freed by calller; when a field of the reference is cleared,
+ * Returns a pointer to a menu reference structure. Should not be freed
+ * by calller; when a field of the reference is cleared,
* TkFreeMenuReferences should be called. Returns NULL if no reference
* with this pathname exists.
*
@@ -3427,11 +3442,11 @@ TkFindMenuReferences(interp, pathName)
*/
TkMenuReferences *
-TkFindMenuReferencesObj(interp, objPtr)
- Tcl_Interp *interp; /* The interp the menu is living in. */
- Tcl_Obj *objPtr; /* The path of the menu widget */
+TkFindMenuReferencesObj(
+ Tcl_Interp *interp, /* The interp the menu is living in. */
+ Tcl_Obj *objPtr) /* The path of the menu widget. */
{
- char *pathName = Tcl_GetStringFromObj(objPtr, NULL);
+ char *pathName = Tcl_GetString(objPtr);
return TkFindMenuReferences(interp, pathName);
}
@@ -3440,26 +3455,25 @@ TkFindMenuReferencesObj(interp, objPtr)
*
* TkFreeMenuReferences --
*
- * This is called after one of the fields in a menu reference
- * is cleared. It cleans up the ref if it is now empty.
+ * This is called after one of the fields in a menu reference is cleared.
+ * It cleans up the ref if it is now empty.
*
* Results:
- * Returns 1 if the references structure was freed, and 0
- * otherwise.
+ * Returns 1 if the references structure was freed, and 0 otherwise.
*
* Side effects:
- * If this is the last field to be cleared, the menu ref is
- * taken out of the hash table.
+ * If this is the last field to be cleared, the menu ref is taken out of
+ * the hash table.
*
*----------------------------------------------------------------------
*/
int
-TkFreeMenuReferences(menuRefPtr)
- TkMenuReferences *menuRefPtr; /* The menu reference to
- * free */
+TkFreeMenuReferences(
+ TkMenuReferences *menuRefPtr)
+ /* The menu reference to free. */
{
- if ((menuRefPtr->menuPtr == NULL)
+ if ((menuRefPtr->menuPtr == NULL)
&& (menuRefPtr->parentEntryPtr == NULL)
&& (menuRefPtr->topLevelListPtr == NULL)) {
Tcl_DeleteHashEntry(menuRefPtr->hashEntryPtr);
@@ -3474,8 +3488,8 @@ TkFreeMenuReferences(menuRefPtr)
*
* DeleteMenuCloneEntries --
*
- * For every clone in this clone chain, delete the menu entries
- * given by the parameters.
+ * For every clone in this clone chain, delete the menu entries given by
+ * the parameters.
*
* Results:
* None.
@@ -3487,13 +3501,12 @@ TkFreeMenuReferences(menuRefPtr)
*/
static void
-DeleteMenuCloneEntries(menuPtr, first, last)
- TkMenu *menuPtr; /* the menu the command was issued with */
- int first; /* the zero-based first entry in the set
- * of entries to delete. */
- int last; /* the zero-based last entry */
+DeleteMenuCloneEntries(
+ TkMenu *menuPtr, /* The menu the command was issued with. */
+ int first, /* The zero-based first entry in the set of
+ * entries to delete. */
+ int last) /* The zero-based last entry. */
{
-
TkMenu *menuListPtr;
int numDeleted, i, j;
@@ -3508,13 +3521,13 @@ DeleteMenuCloneEntries(menuPtr, first, last)
j = i - numDeleted;
menuListPtr->entries[j] = menuListPtr->entries[i];
menuListPtr->entries[j]->index = j;
- }
+ }
menuListPtr->numEntries -= numDeleted;
if (menuListPtr->numEntries == 0) {
ckfree((char *) menuListPtr->entries);
menuListPtr->entries = NULL;
}
- if ((menuListPtr->active >= first)
+ if ((menuListPtr->active >= first)
&& (menuListPtr->active <= last)) {
menuListPtr->active = -1;
} else if (menuListPtr->active > last) {
@@ -3524,28 +3537,29 @@ DeleteMenuCloneEntries(menuPtr, first, last)
}
}
-/*
- *----------------------------------------------------------------------
- *
- * TkMenuCleanup --
- *
- * Resets menusInitialized to allow Tk to be finalized and reused
- * without the DLL being unloaded.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-TkMenuCleanup(ClientData unused)
-{
- menusInitialized = 0;
-}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMenuCleanup --
+ *
+ * Resets menusInitialized to allow Tk to be finalized and reused without
+ * the DLL being unloaded.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkMenuCleanup(
+ ClientData unused)
+{
+ menusInitialized = 0;
+}
/*
*----------------------------------------------------------------------
@@ -3565,21 +3579,23 @@ TkMenuCleanup(ClientData unused)
*/
void
-TkMenuInit()
+TkMenuInit(void)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
+
if (!menusInitialized) {
Tcl_MutexLock(&menuMutex);
if (!menusInitialized) {
TkpMenuInit();
menusInitialized = 1;
}
- /*
- * Make sure we cleanup on finalize.
- */
- TkCreateExitHandler(TkMenuCleanup, NULL);
+
+ /*
+ * Make sure we cleanup on finalize.
+ */
+
+ TkCreateExitHandler((Tcl_ExitProc *) TkMenuCleanup, NULL);
Tcl_MutexUnlock(&menuMutex);
}
if (!tsdPtr->menusInitialized) {
@@ -3587,3 +3603,11 @@ TkMenuInit()
tsdPtr->menusInitialized = 1;
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 767e3fc..24f32e7 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -1,12 +1,13 @@
/*
* tkMenu.h --
*
- * Declarations shared among all of the files that implement menu widgets.
+ * Declarations shared among all of the files that implement menu
+ * widgets.
*
* Copyright (c) 1996-1998 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKMENU
@@ -37,26 +38,41 @@ typedef struct TkMenuPlatformData_ *TkMenuPlatformData;
typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData;
/*
- * Legal values for the "compound" field of TkMenuEntry and TkMenuButton records.
+ * Legal values for the "compound" field of TkMenuEntry and TkMenuButton
+ * records.
*/
enum compound {
COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
- COMPOUND_RIGHT, COMPOUND_TOP
+ COMPOUND_RIGHT, COMPOUND_TOP
};
/*
- * One of the following data structures is kept for each entry of each
- * menu managed by this file:
+ * Additional menu entry drawing parameters for Windows platform.
+ * DRAW_MENU_ENTRY_ARROW makes TkpDrawMenuEntry draw the arrow
+ * itself when cascade entry is disabled.
+ * DRAW_MENU_ENTRY_NOUNDERLINE forbids underline when ODS_NOACCEL
+ * is set, thus obeying the system-wide Windows UI setting.
+ */
+
+enum drawingParameters {
+ DRAW_MENU_ENTRY_ARROW = (1<<0),
+ DRAW_MENU_ENTRY_NOUNDERLINE = (1<<1)
+};
+
+/*
+ * One of the following data structures is kept for each entry of each menu
+ * managed by this file:
*/
typedef struct TkMenuEntry {
- int type; /* Type of menu entry; see below for
- * valid types. */
- struct TkMenu *menuPtr; /* Menu with which this entry is associated. */
+ int type; /* Type of menu entry; see below for valid
+ * types. */
+ struct TkMenu *menuPtr; /* Menu with which this entry is
+ * associated. */
Tk_OptionTable optionTable; /* Option table for this menu entry. */
- Tcl_Obj *labelPtr; /* Main text label displayed in entry (NULL
- * if no label). */
+ Tcl_Obj *labelPtr; /* Main text label displayed in entry (NULL if
+ * no label). */
int labelLength; /* Number of non-NULL characters in label. */
int state; /* State of button for display purposes:
* normal, active, or disabled. */
@@ -66,19 +82,18 @@ typedef struct TkMenuEntry {
Tcl_Obj *underlinePtr; /* Index of character to underline. */
Tcl_Obj *bitmapPtr; /* Bitmap to display in menu entry, or None.
* If not None then label is ignored. */
- Tcl_Obj *imagePtr; /* Name of image to display, or
- * NULL. If non-NULL, bitmap, text, and
- * textVarName are ignored. */
+ Tcl_Obj *imagePtr; /* Name of image to display, or NULL. If not
+ * NULL, bitmap, text, and textVarName are
+ * ignored. */
Tk_Image image; /* Image to display in menu entry, or NULL if
* none. */
- Tcl_Obj *selectImagePtr; /* Name of image to display when selected, or
+ Tcl_Obj *selectImagePtr; /* Name of image to display when selected, or
* NULL. */
- Tk_Image selectImage; /* Image to display in entry when selected,
- * or NULL if none. Ignored if image is
- * NULL. */
- Tcl_Obj *accelPtr; /* Accelerator string displayed at right
- * of menu entry. NULL means no such
- * accelerator. Malloc'ed. */
+ Tk_Image selectImage; /* Image to display in entry when selected, or
+ * NULL if none. Ignored if image is NULL. */
+ Tcl_Obj *accelPtr; /* Accelerator string displayed at right of
+ * menu entry. NULL means no such accelerator.
+ * Malloc'ed. */
int accelLength; /* Number of non-NULL characters in
* accelerator. */
int indicatorOn; /* True means draw indicator, false means
@@ -89,42 +104,43 @@ typedef struct TkMenuEntry {
*/
Tcl_Obj *borderPtr; /* Structure used to draw background for
- * entry. NULL means use overall border
- * for menu. */
- Tcl_Obj *fgPtr; /* Foreground color to use for entry. NULL
+ * entry. NULL means use overall border for
+ * menu. */
+ Tcl_Obj *fgPtr; /* Foreground color to use for entry. NULL
* means use foreground color from menu. */
Tcl_Obj *activeBorderPtr; /* Used to draw background and border when
- * element is active. NULL means use
+ * element is active. NULL means use
* activeBorder from menu. */
Tcl_Obj *activeFgPtr; /* Foreground color to use when entry is
- * active. NULL means use active foreground
+ * active. NULL means use active foreground
* from menu. */
Tcl_Obj *indicatorFgPtr; /* Color for indicators in radio and check
- * button entries. NULL means use indicatorFg
+ * button entries. NULL means use indicatorFg
* GC from menu. */
- Tcl_Obj *fontPtr; /* Text font for menu entries. NULL means
- * use overall font for menu. */
- int columnBreak; /* If this is 0, this item appears below
- * the item in front of it. If this is
- * 1, this item starts a new column. This
- * field is always 0 for tearoff and separator
+ Tcl_Obj *fontPtr; /* Text font for menu entries. NULL means use
+ * overall font for menu. */
+ int columnBreak; /* If this is 0, this item appears below the
+ * item in front of it. If this is 1, this
+ * item starts a new column. This field is
+ * always 0 for tearoff and separator
* entries. */
int hideMargin; /* If this is 0, then the item has enough
* margin to accomodate a standard check mark
* and a default right margin. If this is 1,
- * then the item has no such margins. and
+ * then the item has no such margins, and
* checkbuttons and radiobuttons with this set
- * will have a rectangle drawn in the indicator
- * around the item if the item is checked. This
- * is useful for palette menus. This field is
- * ignored for separators and tearoffs. */
+ * will have a rectangle drawn in the
+ * indicator around the item if the item is
+ * checked. This is useful for palette menus.
+ * This field is ignored for separators and
+ * tearoffs. */
int indicatorSpace; /* The width of the indicator space for this
* entry. */
int labelWidth; /* Number of pixels to allow for displaying
* labels in menu entries. */
- int compound; /* Value of -compound option; specifies whether
- * the entry should show both an image and
- * text, and, if so, how. */
+ int compound; /* Value of -compound option; specifies
+ * whether the entry should show both an image
+ * and text, and, if so, how. */
/*
* Information used to implement this entry's action:
@@ -134,78 +150,76 @@ typedef struct TkMenuEntry {
* Malloc'ed. */
Tcl_Obj *namePtr; /* Name of variable (for check buttons and
* radio buttons) or menu (for cascade
- * entries). Malloc'ed.*/
+ * entries). Malloc'ed. */
Tcl_Obj *onValuePtr; /* Value to store in variable when selected
* (only for radio and check buttons).
* Malloc'ed. */
Tcl_Obj *offValuePtr; /* Value to store in variable when not
* selected (only for check buttons).
* Malloc'ed. */
-
+
/*
* Information used for drawing this menu entry.
*/
-
+
int width; /* Number of pixels occupied by entry in
- * horizontal dimension. Not used except
- * in menubars. The width of norma menus
- * is dependent on the rest of the menu. */
- int x; /* X-coordinate of leftmost pixel in entry */
+ * horizontal dimension. Not used except in
+ * menubars. The width of norma menus is
+ * dependent on the rest of the menu. */
+ int x; /* X-coordinate of leftmost pixel in entry. */
int height; /* Number of pixels occupied by entry in
- * vertical dimension, including raised
- * border drawn around entry when active. */
+ * vertical dimension, including raised border
+ * drawn around entry when active. */
int y; /* Y-coordinate of topmost pixel in entry. */
- GC textGC; /* GC for drawing text in entry. NULL means
+ GC textGC; /* GC for drawing text in entry. NULL means
* use overall textGC for menu. */
GC activeGC; /* GC for drawing text in entry when active.
* NULL means use overall activeGC for
* menu. */
GC disabledGC; /* Used to produce disabled effect for entry.
- * NULL means use overall disabledGC from
- * menu structure. See comments for
- * disabledFg in menu structure for more
- * information. */
- GC indicatorGC; /* For drawing indicators. None means use
- * GC from menu. */
+ * NULL means use overall disabledGC from menu
+ * structure. See comments for disabledFg in
+ * menu structure for more information. */
+ GC indicatorGC; /* For drawing indicators. None means use GC
+ * from menu. */
/*
* Miscellaneous fields.
*/
-
- int entryFlags; /* Various flags. See below for
- definitions. */
- int index; /* Need to know which index we are. This
- * is zero-based. This is the top-left entry
- * of the menu. */
-
+
+ int entryFlags; /* Various flags. See below for
+ * definitions. */
+ int index; /* Need to know which index we are. This is
+ * zero-based. This is the top-left entry of
+ * the menu. */
+
/*
* Bookeeping for master menus and cascade menus.
*/
-
+
struct TkMenuReferences *childMenuRefPtr;
- /* A pointer to the hash table entry for
- * the child menu. Stored here when the menu
- * entry is configured so that a hash lookup
- * is not necessary later.*/
+ /* A pointer to the hash table entry for the
+ * child menu. Stored here when the menu entry
+ * is configured so that a hash lookup is not
+ * necessary later.*/
struct TkMenuEntry *nextCascadePtr;
/* The next cascade entry that is a parent of
- * this entry's child cascade menu. NULL
- * end of list, this is not a cascade entry,
- * or the menu that this entry point to
- * does not yet exist. */
+ * this entry's child cascade menu. NULL end
+ * of list, this is not a cascade entry, or
+ * the menu that this entry point to does not
+ * yet exist. */
TkMenuPlatformEntryData platformEntryData;
/* The data for the specific type of menu.
- * Depends on platform and menu type what
- * kind of options are in this structure.
- */
+ * Depends on platform and menu type what kind
+ * of options are in this structure. */
} TkMenuEntry;
/*
* Flag values defined for menu entries:
*
- * ENTRY_SELECTED: Non-zero means this is a radio or check
- * button and that it should be drawn in
- * the "selected" state.
+ * ENTRY_SELECTED: Non-zero means this is a radio or check button
+ * and that it should be drawn in the "selected"
+ * state.
* ENTRY_NEEDS_REDISPLAY: Non-zero means the entry should be redisplayed.
* ENTRY_LAST_COLUMN: Used by the drawing code. If the entry is in
* the last column, the space to its right needs
@@ -238,44 +252,43 @@ typedef struct TkMenuEntry {
* Menu states
*/
-EXTERN char *tkMenuStateStrings[];
+MODULE_SCOPE char *tkMenuStateStrings[];
#define ENTRY_ACTIVE 0
#define ENTRY_NORMAL 1
#define ENTRY_DISABLED 2
/*
- * A data structure of the following type is kept for each
- * menu widget:
+ * A data structure of the following type is kept for each menu widget:
*/
typedef struct TkMenu {
- Tk_Window tkwin; /* Window that embodies the pane. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Needed, among
+ Tk_Window tkwin; /* Window that embodies the pane. NULL means
+ * that the window has been destroyed but the
+ * data structures haven't yet been cleaned
+ * up. */
+ Display *display; /* Display containing widget. Needed, among
* other things, so that resources can be
* freed up even after tkwin has gone away. */
Tcl_Interp *interp; /* Interpreter associated with menu. */
Tcl_Command widgetCmd; /* Token for menu's widget command. */
- TkMenuEntry **entries; /* Array of pointers to all the entries
- * in the menu. NULL means no entries. */
+ TkMenuEntry **entries; /* Array of pointers to all the entries in the
+ * menu. NULL means no entries. */
int numEntries; /* Number of elements in entries. */
- int active; /* Index of active entry. -1 means
- * nothing active. */
- int menuType; /* MASTER_MENU, TEAROFF_MENU, or MENUBAR.
- * See below for definitions. */
- Tcl_Obj *menuTypePtr; /* Used to control whether created tkwin
- * is a toplevel or not. "normal", "menubar",
- * or "toplevel" */
+ int active; /* Index of active entry. -1 means nothing
+ * active. */
+ int menuType; /* MASTER_MENU, TEAROFF_MENU, or MENUBAR. See
+ * below for definitions. */
+ Tcl_Obj *menuTypePtr; /* Used to control whether created tkwin is a
+ * toplevel or not. "normal", "menubar", or
+ * "toplevel" */
/*
* Information used when displaying widget:
*/
- Tcl_Obj *borderPtr; /* Structure used to draw 3-D
- * border and background for menu. */
+ Tcl_Obj *borderPtr; /* Structure used to draw 3-D border and
+ * background for menu. */
Tcl_Obj *borderWidthPtr; /* Width of border around whole menu. */
Tcl_Obj *activeBorderPtr; /* Used to draw background and border for
* active element (if any). */
@@ -284,18 +297,17 @@ typedef struct TkMenu {
Tcl_Obj *reliefPtr; /* 3-d effect: TK_RELIEF_RAISED, etc. */
Tcl_Obj *fontPtr; /* Text font for menu entries. */
Tcl_Obj *fgPtr; /* Foreground color for entries. */
- Tcl_Obj *disabledFgPtr; /* Foreground color when disabled. NULL
- * means use normalFg with a 50% stipple
- * instead. */
+ Tcl_Obj *disabledFgPtr; /* Foreground color when disabled. NULL means
+ * use normalFg with a 50% stipple instead. */
Tcl_Obj *activeFgPtr; /* Foreground color for active entry. */
Tcl_Obj *indicatorFgPtr; /* Color for indicators in radio and check
* button entries. */
- Pixmap gray; /* Bitmap for drawing disabled entries in
- * a stippled fashion. None means not
- * allocated yet. */
- GC textGC; /* GC for drawing text and other features
- * of menu entries. */
- GC disabledGC; /* Used to produce disabled effect. If
+ Pixmap gray; /* Bitmap for drawing disabled entries in a
+ * stippled fashion. None means not allocated
+ * yet. */
+ GC textGC; /* GC for drawing text and other features of
+ * menu entries. */
+ GC disabledGC; /* Used to produce disabled effect. If
* disabledFg isn't NULL, this GC is used to
* draw text and icons for disabled entries.
* Otherwise text and icons are drawn with
@@ -303,52 +315,51 @@ typedef struct TkMenu {
* background across them. */
GC activeGC; /* GC for drawing active entry. */
GC indicatorGC; /* For drawing indicators. */
- GC disabledImageGC; /* Used for drawing disabled images. They
- * have to be stippled. This is created
- * when the image is about to be drawn the
- * first time. */
+ GC disabledImageGC; /* Used for drawing disabled images. They have
+ * to be stippled. This is created when the
+ * image is about to be drawn the first
+ * time. */
/*
* Information about geometry of menu.
*/
-
- int totalWidth; /* Width of entire menu */
- int totalHeight; /* Height of entire menu */
-
+
+ int totalWidth; /* Width of entire menu. */
+ int totalHeight; /* Height of entire menu. */
+
/*
* Miscellaneous information:
*/
int tearoff; /* 1 means this menu can be torn off. On some
- * platforms, the user can drag an outline
- * of the menu by just dragging outside of
- * the menu, and the tearoff is created where
- * the mouse is released. On others, an
- * indicator (such as a dashed stripe) is
- * drawn, and when the menu is selected, the
- * tearoff is created. */
+ * platforms, the user can drag an outline of
+ * the menu by just dragging outside of the
+ * menu, and the tearoff is created where the
+ * mouse is released. On others, an indicator
+ * (such as a dashed stripe) is drawn, and
+ * when the menu is selected, the tearoff is
+ * created. */
Tcl_Obj *titlePtr; /* The title to use when this menu is torn
- * off. If this is NULL, a default scheme
- * will be used to generate a title for
- * tearoff. */
- Tcl_Obj *tearoffCommandPtr; /* If non-NULL, points to a command to
- * run whenever the menu is torn-off. */
- Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * off. If this is NULL, a default scheme will
+ * be used to generate a title for tearoff. */
+ Tcl_Obj *tearoffCommandPtr; /* If non-NULL, points to a command to run
+ * whenever the menu is torn-off. */
+ Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
Tcl_Obj *cursorPtr; /* Current cursor for window, or None. */
Tcl_Obj *postCommandPtr; /* Used to detect cycles in cascade hierarchy
- * trees when preprocessing postcommands
- * on some platforms. See PostMenu for
- * more details. */
+ * trees when preprocessing postcommands on
+ * some platforms. See PostMenu for more
+ * details. */
int postCommandGeneration; /* Need to do pre-invocation post command
- * traversal */
+ * traversal. */
int menuFlags; /* Flags for use by X; see below for
- definition */
+ * definition. */
TkMenuEntry *postedCascade; /* Points to menu entry for cascaded submenu
* that is currently posted or NULL if no
* submenu posted. */
- struct TkMenu *nextInstancePtr;
+ struct TkMenu *nextInstancePtr;
/* The next instance of this menu in the
* chain. */
struct TkMenu *masterMenuPtr;
@@ -356,29 +367,26 @@ typedef struct TkMenu {
* clone chain. Points back to this structure
* if this menu is a master menu. */
struct TkMenuOptionTables *optionTablesPtr;
- /* A pointer to the collection of option tables
- * that work with menus and menu entries. */
+ /* A pointer to the collection of option
+ * tables that work with menus and menu
+ * entries. */
Tk_Window parentTopLevelPtr;/* If this menu is a menubar, this is the
- * toplevel that owns the menu. Only applicable
- * for menubar clones.
- */
- struct TkMenuReferences *menuRefPtr;
+ * toplevel that owns the menu. Only
+ * applicable for menubar clones. */
+ struct TkMenuReferences *menuRefPtr;
/* Each menu is hashed into a table with the
- * name of the menu's window as the key.
- * The information in this hash table includes
- * a pointer to the menu (so that cascades
- * can find this menu), a pointer to the
- * list of toplevel widgets that have this
- * menu as its menubar, and a list of menu
- * entries that have this menu specified
- * as a cascade. */
+ * name of the menu's window as the key. The
+ * information in this hash table includes a
+ * pointer to the menu (so that cascades can
+ * find this menu), a pointer to the list of
+ * toplevel widgets that have this menu as its
+ * menubar, and a list of menu entries that
+ * have this menu specified as a cascade. */
TkMenuPlatformData platformData;
/* The data for the specific type of menu.
- * Depends on platform and menu type what
- * kind of options are in this structure.
- */
- Tk_OptionSpec *extensionPtr;
- /* Needed by the configuration package for
+ * Depends on platform and menu type what kind
+ * of options are in this structure. */
+ Tk_OptionSpec *extensionPtr;/* Needed by the configuration package for
* this widget to be extended. */
Tk_SavedOptions *errorStructPtr;
/* We actually have to allocate these because
@@ -388,95 +396,94 @@ typedef struct TkMenu {
/*
* When the toplevel configure -menu command is executed, the menu may not
- * exist yet. We need to keep a linked list of windows that reference
- * a particular menu.
+ * exist yet. We need to keep a linked list of windows that reference a
+ * particular menu.
*/
typedef struct TkMenuTopLevelList {
struct TkMenuTopLevelList *nextPtr;
- /* The next window in the list */
+ /* The next window in the list. */
Tk_Window tkwin; /* The window that has this menu as its
* menubar. */
} TkMenuTopLevelList;
/*
- * The following structure is used to keep track of things which
- * reference a menu. It is created when:
+ * The following structure is used to keep track of things which reference a
+ * menu. It is created when:
* - a menu is created.
* - a cascade entry is added to a menu with a non-null name
- * - the "-menu" configuration option is used on a toplevel widget
- * with a non-null parameter.
+ * - the "-menu" configuration option is used on a toplevel widget with a
+ * non-null parameter.
*
- * One of these three fields must be non-NULL, but any of the fields may
- * be NULL. This structure makes it easy to determine whether or not
- * anything like recalculating platform data or geometry is necessary
- * when one of the three actions above is performed.
+ * One of these three fields must be non-NULL, but any of the fields may be
+ * NULL. This structure makes it easy to determine whether or not anything
+ * like recalculating platform data or geometry is necessary when one of the
+ * three actions above is performed.
*/
typedef struct TkMenuReferences {
- struct TkMenu *menuPtr; /* The menu data structure. This is NULL
- * if the menu does not exist. */
+ struct TkMenu *menuPtr; /* The menu data structure. This is NULL if
+ * the menu does not exist. */
TkMenuTopLevelList *topLevelListPtr;
- /* First in the list of all toplevels that
- * have this menu as its menubar. NULL if no
+ /* First in the list of all toplevels that
+ * have this menu as its menubar. NULL if no
* toplevel widgets have this menu as its
* menubar. */
- TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu
+ TkMenuEntry *parentEntryPtr;/* First in the list of all cascade menu
* entries that have this menu as their child.
* NULL means no cascade entries. */
Tcl_HashEntry *hashEntryPtr;/* This is needed because the pathname of the
* window (which is what we hash on) may not
- * be around when we are deleting.
- */
+ * be around when we are deleting. */
} TkMenuReferences;
/*
- * This structure contains all of the option tables that are needed
- * by menus.
+ * This structure contains all of the option tables that are needed by menus.
*/
typedef struct TkMenuOptionTables {
- Tk_OptionTable menuOptionTable; /* The option table for menus. */
- Tk_OptionTable entryOptionTables[6];/* The tables for menu entries. */
+ Tk_OptionTable menuOptionTable;
+ /* The option table for menus. */
+ Tk_OptionTable entryOptionTables[6];
+ /* The tables for menu entries. */
} TkMenuOptionTables;
/*
* Flag bits for menus:
*
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * already been queued to redraw this window.
* RESIZE_PENDING: Non-zero means a call to ComputeMenuGeometry
* has already been scheduled.
- * MENU_DELETION_PENDING Non-zero means that we are currently destroying
- * this menu's internal structures. This is useful
- * when we are in the middle of cleaning
- * this master menu's chain of menus up when
- * TkDestroyMenu was called again on this
+ * MENU_DELETION_PENDING Non-zero means that we are currently
+ * destroying this menu's internal structures.
+ * This is useful when we are in the middle of
+ * cleaning this master menu's chain of menus up
+ * when TkDestroyMenu was called again on this
* menu (via a destroy binding or somesuch).
- * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of
- * destroying this menu's Tk_Window.
+ * MENU_WIN_DESTRUCTION_PENDING Non-zero means we are in the middle of
+ * destroying this menu's Tk_Window.
* MENU_PLATFORM_FLAG1... Reserved for use by the platform-specific menu
* code.
*/
-#define REDRAW_PENDING 1
-#define RESIZE_PENDING 2
-#define MENU_DELETION_PENDING 4
+#define REDRAW_PENDING 1
+#define RESIZE_PENDING 2
+#define MENU_DELETION_PENDING 4
#define MENU_WIN_DESTRUCTION_PENDING 8
#define MENU_PLATFORM_FLAG1 (1 << 30)
#define MENU_PLATFORM_FLAG2 (1 << 29)
#define MENU_PLATFORM_FLAG3 (1 << 28)
/*
- * Each menu created by the user is a MASTER_MENU. When a menu is torn off,
- * a TEAROFF_MENU instance is created. When a menu is assigned to a toplevel
- * as a menu bar, a MENUBAR instance is created. All instances have the same
+ * Each menu created by the user is a MASTER_MENU. When a menu is torn off, a
+ * TEAROFF_MENU instance is created. When a menu is assigned to a toplevel as
+ * a menu bar, a MENUBAR instance is created. All instances have the same
* configuration information. If the master instance is deleted, all instances
* are deleted. If one of the other instances is deleted, only that instance
* is deleted.
*/
-
+
#define UNKNOWN_TYPE -1
#define MASTER_MENU 0
#define TEAROFF_MENU 1
@@ -486,101 +493,81 @@ typedef struct TkMenuOptionTables {
* Various geometry definitions:
*/
-#define CASCADE_ARROW_HEIGHT 10
-#define CASCADE_ARROW_WIDTH 8
-#define DECORATION_BORDER_WIDTH 2
+#define CASCADE_ARROW_HEIGHT 10
+#define CASCADE_ARROW_WIDTH 8
+#define DECORATION_BORDER_WIDTH 2
/*
- * Menu-related procedures that are shared among Tk modules but not exported
- * to the outside world:
+ * Menu-related functions that are shared among Tk modules but not exported to
+ * the outside world:
*/
-EXTERN int TkActivateMenuEntry _ANSI_ARGS_((TkMenu *menuPtr,
- int index));
-EXTERN void TkBindMenu _ANSI_ARGS_((
- Tk_Window tkwin, TkMenu *menuPtr));
-EXTERN TkMenuReferences *
- TkCreateMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
- char *name));
-EXTERN void TkDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN void TkEventuallyRecomputeMenu _ANSI_ARGS_((
- TkMenu *menuPtr));
-EXTERN void TkEventuallyRedrawMenu _ANSI_ARGS_((
- TkMenu *menuPtr, TkMenuEntry *mePtr));
-EXTERN TkMenuReferences *
- TkFindMenuReferences _ANSI_ARGS_((Tcl_Interp *interp,
- char *name));
-EXTERN TkMenuReferences *
- TkFindMenuReferencesObj _ANSI_ARGS_((
- Tcl_Interp *interp, Tcl_Obj *namePtr));
-EXTERN int TkFreeMenuReferences _ANSI_ARGS_((
- TkMenuReferences *menuRefPtr));
-EXTERN Tcl_HashTable * TkGetMenuHashTable _ANSI_ARGS_((Tcl_Interp *interp));
-EXTERN int TkGetMenuIndex _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, Tcl_Obj *objPtr, int lastOK,
- int *indexPtr));
-EXTERN void TkMenuInitializeDrawingFields _ANSI_ARGS_((
- TkMenu *menuPtr));
-EXTERN void TkMenuInitializeEntryDrawingFields _ANSI_ARGS_((
- TkMenuEntry *mePtr));
-EXTERN int TkInvokeMenu _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, int index));
-EXTERN void TkMenuConfigureDrawOptions _ANSI_ARGS_((
- TkMenu *menuPtr));
-EXTERN int TkMenuConfigureEntryDrawOptions _ANSI_ARGS_((
- TkMenuEntry *mePtr, int index));
-EXTERN void TkMenuFreeDrawOptions _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN void TkMenuEntryFreeDrawOptions _ANSI_ARGS_((
- TkMenuEntry *mePtr));
-EXTERN void TkMenuEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-EXTERN void TkMenuImageProc _ANSI_ARGS_((
- ClientData clientData, int x, int y, int width,
- int height, int imgWidth, int imgHeight));
-EXTERN void TkMenuInit _ANSI_ARGS_((void));
-EXTERN void TkMenuSelectImageProc _ANSI_ARGS_
- ((ClientData clientData, int x, int y,
+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);
+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*TkFindMenuReferencesObj(Tcl_Interp *interp,
+ Tcl_Obj *namePtr);
+MODULE_SCOPE int TkFreeMenuReferences(TkMenuReferences *menuRefPtr);
+MODULE_SCOPE Tcl_HashTable *TkGetMenuHashTable(Tcl_Interp *interp);
+MODULE_SCOPE int TkGetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr,
+ Tcl_Obj *objPtr, int lastOK, int *indexPtr);
+MODULE_SCOPE void TkMenuInitializeDrawingFields(TkMenu *menuPtr);
+MODULE_SCOPE void TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr);
+MODULE_SCOPE int TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr,
+ int index);
+MODULE_SCOPE void TkMenuConfigureDrawOptions(TkMenu *menuPtr);
+MODULE_SCOPE int TkMenuConfigureEntryDrawOptions(
+ TkMenuEntry *mePtr, int index);
+MODULE_SCOPE void TkMenuFreeDrawOptions(TkMenu *menuPtr);
+MODULE_SCOPE void TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr);
+MODULE_SCOPE void TkMenuEventProc(ClientData clientData,
+ XEvent *eventPtr);
+MODULE_SCOPE void TkMenuImageProc(ClientData clientData, int x, int y,
int width, int height, int imgWidth,
- int imgHeight));
-EXTERN Tcl_Obj * TkNewMenuName _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *parentNamePtr, TkMenu *menuPtr));
-EXTERN int TkPostCommand _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN int TkPostSubmenu _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, TkMenuEntry *mePtr));
-EXTERN int TkPostTearoffMenu _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, int x, int y));
-EXTERN int TkPreprocessMenu _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN void TkRecomputeMenu _ANSI_ARGS_((TkMenu *menuPtr));
+ int imgHeight);
+MODULE_SCOPE void TkMenuInit(void);
+MODULE_SCOPE void TkMenuSelectImageProc(ClientData clientData, int x,
+ int y, int width, int height, int imgWidth,
+ int imgHeight);
+MODULE_SCOPE Tcl_Obj * TkNewMenuName(Tcl_Interp *interp,
+ Tcl_Obj *parentNamePtr, TkMenu *menuPtr);
+MODULE_SCOPE int TkPostCommand(TkMenu *menuPtr);
+MODULE_SCOPE int TkPostSubmenu(Tcl_Interp *interp, TkMenu *menuPtr,
+ TkMenuEntry *mePtr);
+MODULE_SCOPE int TkPostTearoffMenu(Tcl_Interp *interp, TkMenu *menuPtr,
+ int x, int y);
+MODULE_SCOPE int TkPreprocessMenu(TkMenu *menuPtr);
+MODULE_SCOPE void TkRecomputeMenu(TkMenu *menuPtr);
/*
- * These routines are the platform-dependent routines called by the
- * common code.
+ * These routines are the platform-dependent routines called by the common
+ * code.
*/
-EXTERN void TkpComputeMenubarGeometry _ANSI_ARGS_((
- TkMenu *menuPtr));
-EXTERN void TkpComputeStandardMenuGeometry _ANSI_ARGS_
- ((TkMenu *menuPtr));
-EXTERN int TkpConfigureMenuEntry
- _ANSI_ARGS_((TkMenuEntry *mePtr));
-EXTERN void TkpDestroyMenu _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN void TkpDestroyMenuEntry
- _ANSI_ARGS_((TkMenuEntry *mEntryPtr));
-EXTERN void TkpDrawMenuEntry _ANSI_ARGS_((TkMenuEntry *mePtr,
- Drawable d, Tk_Font tkfont,
- CONST Tk_FontMetrics *menuMetricsPtr, int x,
+MODULE_SCOPE void TkpComputeMenubarGeometry(TkMenu *menuPtr);
+MODULE_SCOPE void TkpComputeStandardMenuGeometry(TkMenu *menuPtr);
+MODULE_SCOPE int TkpConfigureMenuEntry(TkMenuEntry *mePtr);
+MODULE_SCOPE void TkpDestroyMenu(TkMenu *menuPtr);
+MODULE_SCOPE void TkpDestroyMenuEntry(TkMenuEntry *mEntryPtr);
+MODULE_SCOPE void TkpDrawMenuEntry(TkMenuEntry *mePtr,
+ Drawable d, Tk_Font tkfont,
+ const Tk_FontMetrics *menuMetricsPtr, int x,
int y, int width, int height, int strictMotif,
- int drawArrow));
-EXTERN void TkpMenuInit _ANSI_ARGS_((void));
-EXTERN int TkpMenuNewEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
-EXTERN int TkpNewMenu _ANSI_ARGS_((TkMenu *menuPtr));
-EXTERN int TkpPostMenu _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenu *menuPtr, int x, int y));
-EXTERN void TkpSetWindowMenuBar _ANSI_ARGS_((Tk_Window tkwin,
- TkMenu *menuPtr));
+ int drawingParameters);
+MODULE_SCOPE void TkpMenuInit(void);
+MODULE_SCOPE int TkpMenuNewEntry(TkMenuEntry *mePtr);
+MODULE_SCOPE int TkpNewMenu(TkMenu *menuPtr);
+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 33dadc1..d2a66d3 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -1,35 +1,34 @@
-/*
+/*
* tkMenuDraw.c --
*
- * This module implements the platform-independent drawing and
- * geometry calculations of menu widgets.
+ * This module implements the platform-independent drawing and geometry
+ * calculations of menu widgets.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkMenu.h"
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static void AdjustMenuCoords _ANSI_ARGS_ ((TkMenu *menuPtr,
- TkMenuEntry *mePtr, int *xPtr, int *yPtr,
- char *string));
-static void ComputeMenuGeometry _ANSI_ARGS_((
- ClientData clientData));
-static void DisplayMenu _ANSI_ARGS_((ClientData clientData));
+static void AdjustMenuCoords(TkMenu *menuPtr, TkMenuEntry *mePtr,
+ int *xPtr, int *yPtr);
+static void ComputeMenuGeometry(ClientData clientData);
+static void DisplayMenu(ClientData clientData);
/*
*----------------------------------------------------------------------
*
* TkMenuInitializeDrawingFields --
*
- * Fills in drawing fields of a new menu. Called when new menu is
- * created by MenuCmd.
+ * Fills in drawing fields of a new menu. Called when new menu is created
+ * by MenuCmd.
*
* Results:
* None.
@@ -41,8 +40,8 @@ static void DisplayMenu _ANSI_ARGS_((ClientData clientData));
*/
void
-TkMenuInitializeDrawingFields(menuPtr)
- TkMenu *menuPtr; /* The menu we are initializing. */
+TkMenuInitializeDrawingFields(
+ TkMenu *menuPtr) /* The menu we are initializing. */
{
menuPtr->textGC = None;
menuPtr->gray = None;
@@ -58,8 +57,8 @@ TkMenuInitializeDrawingFields(menuPtr)
*
* TkMenuInitializeEntryDrawingFields --
*
- * Fills in drawing fields of a new menu entry. Called when an
- * entry is created.
+ * Fills in drawing fields of a new menu entry. Called when an entry is
+ * created.
*
* Results:
* None.
@@ -71,8 +70,8 @@ TkMenuInitializeDrawingFields(menuPtr)
*/
void
-TkMenuInitializeEntryDrawingFields(mePtr)
- TkMenuEntry *mePtr; /* The menu we are initializing. */
+TkMenuInitializeEntryDrawingFields(
+ TkMenuEntry *mePtr) /* The menu we are initializing. */
{
mePtr->width = 0;
mePtr->height = 0;
@@ -91,8 +90,8 @@ TkMenuInitializeEntryDrawingFields(mePtr)
*
* TkMenuFreeDrawOptions --
*
- * Frees up any structures allocated for the drawing of a menu.
- * Called when menu is deleted.
+ * Frees up any structures allocated for the drawing of a menu. Called
+ * when menu is deleted.
*
* Results:
* None.
@@ -104,8 +103,8 @@ TkMenuInitializeEntryDrawingFields(mePtr)
*/
void
-TkMenuFreeDrawOptions(menuPtr)
- TkMenu *menuPtr;
+TkMenuFreeDrawOptions(
+ TkMenu *menuPtr)
{
if (menuPtr->textGC != None) {
Tk_FreeGC(menuPtr->display, menuPtr->textGC);
@@ -132,8 +131,8 @@ TkMenuFreeDrawOptions(menuPtr)
*
* TkMenuEntryFreeDrawOptions --
*
- * Frees up drawing structures for a menu entry. Called when
- * menu entry is freed.
+ * Frees up drawing structures for a menu entry. Called when menu entry
+ * is freed.
*
* RESULTS:
* None.
@@ -145,8 +144,8 @@ TkMenuFreeDrawOptions(menuPtr)
*/
void
-TkMenuEntryFreeDrawOptions(mePtr)
- TkMenuEntry *mePtr;
+TkMenuEntryFreeDrawOptions(
+ TkMenuEntry *mePtr)
{
if (mePtr->textGC != None) {
Tk_FreeGC(mePtr->menuPtr->display, mePtr->textGC);
@@ -167,8 +166,8 @@ TkMenuEntryFreeDrawOptions(mePtr)
*
* TkMenuConfigureDrawOptions --
*
- * Sets the menu's drawing attributes in preparation for drawing
- * the menu.
+ * Sets the menu's drawing attributes in preparation for drawing the
+ * menu.
*
* RESULTS:
* None.
@@ -180,8 +179,8 @@ TkMenuEntryFreeDrawOptions(mePtr)
*/
void
-TkMenuConfigureDrawOptions(menuPtr)
- TkMenu *menuPtr; /* The menu we are configuring. */
+TkMenuConfigureDrawOptions(
+ TkMenu *menuPtr) /* The menu we are configuring. */
{
XGCValues gcValues;
GC newGC;
@@ -189,11 +188,11 @@ TkMenuConfigureDrawOptions(menuPtr)
Tk_3DBorder border, activeBorder;
Tk_Font tkfont;
XColor *fg, *activeFg, *indicatorFg;
-
+
/*
- * A few options need special processing, such as setting the
- * background from a 3-D border, or filling in complicated
- * defaults that couldn't be specified to Tk_ConfigureWidget.
+ * A few options need special processing, such as setting the background
+ * from a 3-D border, or filling in complicated defaults that couldn't be
+ * specified to Tk_ConfigureWidget.
*/
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
@@ -216,7 +215,7 @@ TkMenuConfigureDrawOptions(menuPtr)
if (menuPtr->disabledFgPtr != NULL) {
XColor *disabledFg;
- disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
+ disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
menuPtr->disabledFgPtr);
gcValues.foreground = disabledFg->pixel;
mask = GCForeground|GCBackground|GCFont;
@@ -247,7 +246,7 @@ TkMenuConfigureDrawOptions(menuPtr)
if (menuPtr->gray != None) {
gcValues.fill_style = FillStippled;
gcValues.stipple = menuPtr->gray;
- newGC = Tk_GetGC(menuPtr->tkwin,
+ newGC = Tk_GetGC(menuPtr->tkwin,
GCForeground|GCFillStyle|GCStipple, &gcValues);
}
if (menuPtr->disabledImageGC != None) {
@@ -258,7 +257,7 @@ TkMenuConfigureDrawOptions(menuPtr)
gcValues.font = Tk_FontId(tkfont);
activeFg = Tk_GetColorFromObj(menuPtr->tkwin, menuPtr->activeFgPtr);
gcValues.foreground = activeFg->pixel;
- activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
+ activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
menuPtr->activeBorderPtr);
gcValues.background = Tk_3DBorderColor(activeBorder)->pixel;
newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont,
@@ -268,7 +267,7 @@ TkMenuConfigureDrawOptions(menuPtr)
}
menuPtr->activeGC = newGC;
- indicatorFg = Tk_GetColorFromObj(menuPtr->tkwin,
+ indicatorFg = Tk_GetColorFromObj(menuPtr->tkwin,
menuPtr->indicatorFgPtr);
gcValues.foreground = indicatorFg->pixel;
gcValues.background = Tk_3DBorderColor(border)->pixel;
@@ -285,8 +284,7 @@ TkMenuConfigureDrawOptions(menuPtr)
*
* TkMenuConfigureEntryDrawOptions --
*
- * Calculates any entry-specific draw options for the given menu
- * entry.
+ * Calculates any entry-specific draw options for the given menu entry.
*
* Results:
* Returns a standard Tcl error.
@@ -298,11 +296,10 @@ TkMenuConfigureDrawOptions(menuPtr)
*/
int
-TkMenuConfigureEntryDrawOptions(mePtr, index)
- TkMenuEntry *mePtr;
- int index;
+TkMenuConfigureEntryDrawOptions(
+ TkMenuEntry *mePtr,
+ int index)
{
-
XGCValues gcValues;
GC newGC, newActiveGC, newDisabledGC, newIndicatorGC;
unsigned long mask;
@@ -311,7 +308,7 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
tkfont = Tk_GetFontFromObj(menuPtr->tkwin,
(mePtr->fontPtr != NULL) ? mePtr->fontPtr : menuPtr->fontPtr);
-
+
if (mePtr->state == ENTRY_ACTIVE) {
if (index != menuPtr->active) {
TkActivateMenuEntry(menuPtr, index);
@@ -330,21 +327,21 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
|| (mePtr->indicatorFgPtr != NULL)) {
XColor *fg, *indicatorFg, *activeFg;
Tk_3DBorder border, activeBorder;
-
+
fg = Tk_GetColorFromObj(menuPtr->tkwin, (mePtr->fgPtr != NULL)
? mePtr->fgPtr : menuPtr->fgPtr);
gcValues.foreground = fg->pixel;
- border = Tk_Get3DBorderFromObj(menuPtr->tkwin,
- (mePtr->borderPtr != NULL) ? mePtr->borderPtr
+ border = Tk_Get3DBorderFromObj(menuPtr->tkwin,
+ (mePtr->borderPtr != NULL) ? mePtr->borderPtr
: menuPtr->borderPtr);
gcValues.background = Tk_3DBorderColor(border)->pixel;
gcValues.font = Tk_FontId(tkfont);
/*
- * Note: disable GraphicsExpose events; we know there won't be
- * obscured areas when copying from an off-screen pixmap to the
- * screen and this gets rid of unnecessary events.
+ * Note: disable GraphicsExpose events; we know there won't be
+ * obscured areas when copying from an off-screen pixmap to the screen
+ * and this gets rid of unnecessary events.
*/
gcValues.graphics_exposures = False;
@@ -352,7 +349,7 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
GCForeground|GCBackground|GCFont|GCGraphicsExposures,
&gcValues);
- indicatorFg = Tk_GetColorFromObj(menuPtr->tkwin,
+ indicatorFg = Tk_GetColorFromObj(menuPtr->tkwin,
(mePtr->indicatorFgPtr != NULL) ? mePtr->indicatorFgPtr
: menuPtr->indicatorFgPtr);
gcValues.foreground = indicatorFg->pixel;
@@ -363,7 +360,7 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
if ((menuPtr->disabledFgPtr != NULL) || (mePtr->image != NULL)) {
XColor *disabledFg;
- disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
+ disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
menuPtr->disabledFgPtr);
gcValues.foreground = disabledFg->pixel;
mask = GCForeground|GCBackground|GCFont|GCGraphicsExposures;
@@ -375,13 +372,13 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
}
newDisabledGC = Tk_GetGC(menuPtr->tkwin, mask, &gcValues);
- activeFg = Tk_GetColorFromObj(menuPtr->tkwin,
+ activeFg = Tk_GetColorFromObj(menuPtr->tkwin,
(mePtr->activeFgPtr != NULL) ? mePtr->activeFgPtr
: menuPtr->activeFgPtr);
- activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
- (mePtr->activeBorderPtr != NULL) ? mePtr->activeBorderPtr
+ activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
+ (mePtr->activeBorderPtr != NULL) ? mePtr->activeBorderPtr
: menuPtr->activeBorderPtr);
-
+
gcValues.foreground = activeFg->pixel;
gcValues.background = Tk_3DBorderColor(activeBorder)->pixel;
newActiveGC = Tk_GetGC(menuPtr->tkwin,
@@ -394,15 +391,15 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
newIndicatorGC = None;
}
if (mePtr->textGC != None) {
- Tk_FreeGC(menuPtr->display, mePtr->textGC);
+ Tk_FreeGC(menuPtr->display, mePtr->textGC);
}
mePtr->textGC = newGC;
if (mePtr->activeGC != None) {
- Tk_FreeGC(menuPtr->display, mePtr->activeGC);
+ Tk_FreeGC(menuPtr->display, mePtr->activeGC);
}
mePtr->activeGC = newActiveGC;
if (mePtr->disabledGC != None) {
- Tk_FreeGC(menuPtr->display, mePtr->disabledGC);
+ Tk_FreeGC(menuPtr->display, mePtr->disabledGC);
}
mePtr->disabledGC = newDisabledGC;
if (mePtr->indicatorGC != None) {
@@ -430,8 +427,8 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
*/
void
-TkEventuallyRecomputeMenu(menuPtr)
- TkMenu *menuPtr;
+TkEventuallyRecomputeMenu(
+ TkMenu *menuPtr)
{
if (!(menuPtr->menuFlags & RESIZE_PENDING)) {
menuPtr->menuFlags |= RESIZE_PENDING;
@@ -444,8 +441,8 @@ TkEventuallyRecomputeMenu(menuPtr)
*
* TkRecomputeMenu --
*
- * Tells Tcl to redo the geometry because this menu has changed.
- * Does it now; removes any ComputeMenuGeometries from the idler.
+ * Tells Tcl to redo the geometry because this menu has changed. Does it
+ * now; removes any ComputeMenuGeometries from the idler.
*
* Results:
* None.
@@ -457,9 +454,9 @@ TkEventuallyRecomputeMenu(menuPtr)
*/
void
-TkRecomputeMenu(menuPtr)
- TkMenu *menuPtr;
-{
+TkRecomputeMenu(
+ TkMenu *menuPtr)
+{
if (menuPtr->menuFlags & RESIZE_PENDING) {
Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr);
ComputeMenuGeometry((ClientData) menuPtr);
@@ -471,27 +468,27 @@ TkRecomputeMenu(menuPtr)
*
* TkEventuallyRedrawMenu --
*
- * Arrange for an entry of a menu, or the whole menu, to be
- * redisplayed at some point in the future.
+ * Arrange for an entry of a menu, or the whole menu, to be redisplayed
+ * at some point in the future.
*
* Results:
* None.
*
* Side effects:
- * A when-idle hander is scheduled to do the redisplay, if there
- * isn't one already scheduled.
+ * A when-idle hander is scheduled to do the redisplay, if there isn't
+ * one already scheduled.
*
*----------------------------------------------------------------------
*/
void
-TkEventuallyRedrawMenu(menuPtr, mePtr)
- register TkMenu *menuPtr; /* Information about menu to redraw. */
- register TkMenuEntry *mePtr;/* Entry to redraw. NULL means redraw
- * all the entries in the menu. */
+TkEventuallyRedrawMenu(
+ register TkMenu *menuPtr, /* Information about menu to redraw. */
+ register TkMenuEntry *mePtr)/* Entry to redraw. NULL means redraw all the
+ * entries in the menu. */
{
int i;
-
+
if (menuPtr->tkwin == NULL) {
return;
}
@@ -515,25 +512,23 @@ TkEventuallyRedrawMenu(menuPtr, mePtr)
*
* ComputeMenuGeometry --
*
- * This procedure is invoked to recompute the size and
- * layout of a menu. It is called as a when-idle handler so
- * that it only gets done once, even if a group of changes is
- * made to the menu.
+ * This function is invoked to recompute the size and layout of a menu.
+ * It is called as a when-idle handler so that it only gets done once,
+ * even if a group of changes is made to the menu.
*
* 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.
*
*--------------------------------------------------------------
*/
static void
-ComputeMenuGeometry(clientData)
- ClientData clientData; /* Structure describing menu. */
+ComputeMenuGeometry(
+ ClientData clientData) /* Structure describing menu. */
{
TkMenu *menuPtr = (TkMenu *) clientData;
@@ -552,16 +547,15 @@ ComputeMenuGeometry(clientData)
Tk_GeometryRequest(menuPtr->tkwin, menuPtr->totalWidth,
menuPtr->totalHeight);
}
-
+
/*
- * Must always force a redisplay here if the window is mapped
- * (even if the size didn't change, something else might have
- * changed in the menu, such as a label or accelerator). The
- * resize will force a redisplay above.
+ * Must always force a redisplay here if the window is mapped (even if the
+ * size didn't change, something else might have changed in the menu, such
+ * as a label or accelerator). The resize will force a redisplay above.
*/
-
- TkEventuallyRedrawMenu(menuPtr, (TkMenuEntry *) NULL);
-
+
+ TkEventuallyRedrawMenu(menuPtr, NULL);
+
menuPtr->menuFlags &= ~RESIZE_PENDING;
}
@@ -570,9 +564,9 @@ ComputeMenuGeometry(clientData)
*
* TkMenuSelectImageProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size of contents
- * of an image displayed in a menu entry when it is selected.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size of contents of an image
+ * displayed in a menu entry when it is selected.
*
* Results:
* None.
@@ -584,20 +578,18 @@ ComputeMenuGeometry(clientData)
*/
void
-TkMenuSelectImageProc(clientData, x, y, width, height, imgWidth,
- imgHeight)
- ClientData clientData; /* Pointer to widget record. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+TkMenuSelectImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (may be
+ * <=0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
register TkMenuEntry *mePtr = (TkMenuEntry *) clientData;
if ((mePtr->entryFlags & ENTRY_SELECTED)
- && !(mePtr->menuPtr->menuFlags &
- REDRAW_PENDING)) {
+ && !(mePtr->menuPtr->menuFlags & REDRAW_PENDING)) {
mePtr->menuPtr->menuFlags |= REDRAW_PENDING;
Tcl_DoWhenIdle(DisplayMenu, (ClientData) mePtr->menuPtr);
}
@@ -608,21 +600,20 @@ TkMenuSelectImageProc(clientData, x, y, width, height, imgWidth,
*
* DisplayMenu --
*
- * This procedure is invoked to display a menu widget.
+ * This function is invoked to display a menu widget.
*
* Results:
* None.
*
* Side effects:
- * Commands are output to X to display the menu in its
- * current mode.
+ * Commands are output to X to display the menu in its current mode.
*
*----------------------------------------------------------------------
*/
static void
-DisplayMenu(clientData)
- ClientData clientData; /* Information about widget. */
+DisplayMenu(
+ ClientData clientData) /* Information about widget. */
{
register TkMenu *menuPtr = (TkMenu *) clientData;
register TkMenuEntry *mePtr;
@@ -649,8 +640,8 @@ DisplayMenu(clientData)
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
if (menuPtr->menuType == MENUBAR) {
- Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, borderWidth,
- borderWidth, Tk_Width(tkwin) - 2 * borderWidth,
+ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, borderWidth,
+ borderWidth, Tk_Width(tkwin) - 2 * borderWidth,
Tk_Height(tkwin) - 2 * borderWidth, 0, TK_RELIEF_FLAT);
}
@@ -688,15 +679,15 @@ DisplayMenu(clientData)
}
}
TkpDrawMenuEntry(mePtr, Tk_WindowId(menuPtr->tkwin), tkfont,
- &menuMetrics, mePtr->x, mePtr->y, width,
+ &menuMetrics, mePtr->x, mePtr->y, width,
mePtr->height, strictMotif, 1);
if ((index > 0) && (menuPtr->menuType != MENUBAR)
&& mePtr->columnBreak) {
mePtr = menuPtr->entries[index - 1];
Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border,
- mePtr->x, mePtr->y + mePtr->height,
+ mePtr->x, mePtr->y + mePtr->height,
mePtr->width,
- Tk_Height(tkwin) - mePtr->y - mePtr->height -
+ Tk_Height(tkwin) - mePtr->y - mePtr->height -
activeBorderWidth, 0,
TK_RELIEF_FLAT);
}
@@ -712,7 +703,7 @@ DisplayMenu(clientData)
} else {
mePtr = menuPtr->entries[menuPtr->numEntries - 1];
Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin),
- border, mePtr->x, mePtr->y + mePtr->height, mePtr->width,
+ border, mePtr->x, mePtr->y + mePtr->height, mePtr->width,
Tk_Height(tkwin) - mePtr->y - mePtr->height
- activeBorderWidth, 0,
TK_RELIEF_FLAT);
@@ -721,13 +712,13 @@ DisplayMenu(clientData)
width = Tk_Width(tkwin) - x - activeBorderWidth;
height = Tk_Height(tkwin) - y - activeBorderWidth;
}
- Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, x, y,
+ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, x, y,
width, height, 0, TK_RELIEF_FLAT);
}
Tk_GetReliefFromObj(NULL, menuPtr->reliefPtr, &relief);
Tk_Draw3DRectangle(menuPtr->tkwin, Tk_WindowId(tkwin),
- border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth,
+ border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth,
relief);
}
@@ -736,31 +727,31 @@ DisplayMenu(clientData)
*
* TkMenuEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on menus.
+ * This function is invoked by the Tk dispatcher for various events on
+ * menus.
*
* 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.
*
*--------------------------------------------------------------
*/
void
-TkMenuEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+TkMenuEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
TkMenu *menuPtr = (TkMenu *) clientData;
-
+
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
- TkEventuallyRedrawMenu(menuPtr, (TkMenuEntry *) NULL);
+ TkEventuallyRedrawMenu(menuPtr, NULL);
} else if (eventPtr->type == ConfigureNotify) {
TkEventuallyRecomputeMenu(menuPtr);
- TkEventuallyRedrawMenu(menuPtr, (TkMenuEntry *) NULL);
+ TkEventuallyRedrawMenu(menuPtr, NULL);
} else if (eventPtr->type == ActivateNotify) {
if (menuPtr->menuType == TEAROFF_MENU) {
TkpSetMainMenubar(menuPtr->interp, menuPtr->tkwin, NULL);
@@ -797,9 +788,9 @@ TkMenuEventProc(clientData, eventPtr)
*
* TkMenuImageProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size of contents
- * of an image displayed in a menu entry.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size of contents of an image
+ * displayed in a menu entry.
*
* Results:
* None.
@@ -811,19 +802,17 @@ TkMenuEventProc(clientData, eventPtr)
*/
void
-TkMenuImageProc(clientData, x, y, width, height, imgWidth,
- imgHeight)
- ClientData clientData; /* Pointer to widget record. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+TkMenuImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (may be
+ * <=0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
register TkMenu *menuPtr = ((TkMenuEntry *)clientData)->menuPtr;
- if ((menuPtr->tkwin != NULL) && !(menuPtr->menuFlags
- & RESIZE_PENDING)) {
+ if ((menuPtr->tkwin != NULL) && !(menuPtr->menuFlags & RESIZE_PENDING)) {
menuPtr->menuFlags |= RESIZE_PENDING;
Tcl_DoWhenIdle(ComputeMenuGeometry, (ClientData) menuPtr);
}
@@ -834,9 +823,9 @@ TkMenuImageProc(clientData, x, y, width, height, imgWidth,
*
* TkPostTearoffMenu --
*
- * Posts a menu on the screen. Used to post tearoff menus. On Unix,
- * all menus are posted this way. Adjusts the menu's position
- * so that it fits on the screen, and maps and raises the menu.
+ * Posts a menu on the screen. Used to post tearoff menus. On Unix, all
+ * menus are posted this way. Adjusts the menu's position so that it fits
+ * on the screen, and maps and raises the menu.
*
* Results:
* Returns a standard Tcl Error.
@@ -848,13 +837,11 @@ TkMenuImageProc(clientData, x, y, width, height, imgWidth,
*/
int
-TkPostTearoffMenu(interp, menuPtr, x, y)
- Tcl_Interp *interp; /* The interpreter of the menu */
- TkMenu *menuPtr; /* The menu we are posting */
- int x; /* The root X coordinate where we
- * are posting */
- int y; /* The root Y coordinate where we
- * are posting */
+TkPostTearoffMenu(
+ Tcl_Interp *interp, /* The interpreter of the menu */
+ TkMenu *menuPtr, /* The menu we are posting */
+ int x, int y) /* The root X,Y coordinates where we are
+ * posting */
{
int vRootX, vRootY, vRootWidth, vRootHeight;
int tmp, result;
@@ -867,8 +854,8 @@ TkPostTearoffMenu(interp, menuPtr, x, y)
}
/*
- * The post commands could have deleted the menu, which means
- * we are dead and should go away.
+ * The post commands could have deleted the menu, which means we are dead
+ * and should go away.
*/
if (menuPtr->tkwin == NULL) {
@@ -876,27 +863,24 @@ TkPostTearoffMenu(interp, menuPtr, x, y)
}
/*
- * Adjust the position of the menu if necessary to keep it
- * visible on the screen. There are two special tricks to
- * make this work right:
+ * Adjust the position of the menu if necessary to keep it visible on the
+ * screen. There are two special tricks to make this work right:
*
- * 1. If a virtual root window manager is being used then
- * the coordinates are in the virtual root window of
- * menuPtr's parent; since the menu uses override-redirect
- * mode it will be in the *real* root window for the screen,
- * so we have to map the coordinates from the virtual root
- * (if any) to the real root. Can't get the virtual root
- * from the menu itself (it will never be seen by the wm)
- * so use its parent instead (it would be better to have an
- * an option that names a window to use for this...).
- * 2. The menu may not have been mapped yet, so its current size
- * might be the default 1x1. To compute how much space it
- * needs, use its requested size, not its actual size.
+ * 1. If a virtual root window manager is being used then the coordinates
+ * are in the virtual root window of menuPtr's parent; since the menu
+ * uses override-redirect mode it will be in the *real* root window for
+ * the screen, so we have to map the coordinates from the virtual root
+ * (if any) to the real root. Can't get the virtual root from the menu
+ * itself (it will never be seen by the wm) so use its parent instead
+ * (it would be better to have an an option that names a window to use
+ * for this...).
+ * 2. The menu may not have been mapped yet, so its current size might be
+ * the default 1x1. To compute how much space it needs, use its
+ * requested size, not its actual size.
*
- * Note that this code assumes square screen regions and all
- * positive coordinates. This does not work on a Mac with
- * multiple monitors. But then again, Tk has other problems
- * with this.
+ * Note that this code assumes square screen regions and all positive
+ * coordinates. This does not work on a Mac with multiple monitors. But
+ * then again, Tk has other problems with this.
*/
Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY,
@@ -932,59 +916,58 @@ TkPostTearoffMenu(interp, menuPtr, x, y)
*
* TkPostSubmenu --
*
- * This procedure arranges for a particular submenu (i.e. the
- * menu corresponding to a given cascade entry) to be
- * posted.
+ * This function arranges for a particular submenu (i.e. the menu
+ * corresponding to a given cascade entry) to be posted.
*
* Results:
- * A standard Tcl return result. Errors may occur in the
- * Tcl commands generated to post and unpost submenus.
+ * A standard Tcl return result. Errors may occur in the Tcl commands
+ * generated to post and unpost submenus.
*
* Side effects:
- * If there is already a submenu posted, it is unposted.
- * The new submenu is then posted.
+ * If there is already a submenu posted, it is unposted. The new submenu
+ * is then posted.
*
*--------------------------------------------------------------
*/
int
-TkPostSubmenu(interp, menuPtr, mePtr)
- Tcl_Interp *interp; /* Used for invoking sub-commands and
+TkPostSubmenu(
+ Tcl_Interp *interp, /* Used for invoking sub-commands and
* reporting errors. */
- register TkMenu *menuPtr; /* Information about menu as a whole. */
- register TkMenuEntry *mePtr; /* Info about submenu that is to be
- * posted. NULL means make sure that
- * no submenu is posted. */
+ register TkMenu *menuPtr, /* Information about menu as a whole. */
+ register TkMenuEntry *mePtr)/* Info about submenu that is to be posted.
+ * NULL means make sure that no submenu is
+ * posted. */
{
int result, x, y;
+ Tcl_Obj *subary[4];
if (mePtr == menuPtr->postedCascade) {
return TCL_OK;
}
if (menuPtr->postedCascade != NULL) {
- char *name = Tcl_GetStringFromObj(menuPtr->postedCascade->namePtr,
- NULL);
-
/*
- * Note: when unposting a submenu, we have to redraw the entire
- * parent menu. This is because of a combination of the following
- * things:
+ * Note: when unposting a submenu, we have to redraw the entire parent
+ * menu. This is because of a combination of the following things:
* (a) the submenu partially overlaps the parent.
- * (b) the submenu specifies "save under", which causes the X
- * server to make a copy of the information under it when it
- * is posted. When the submenu is unposted, the X server
- * copies this data back and doesn't generate any Expose
- * events for the parent.
- * (c) the parent may have redisplayed itself after the submenu
- * was posted, in which case the saved information is no
- * longer correct.
- * The simplest solution is just force a complete redisplay of
- * the parent.
+ * (b) the submenu specifies "save under", which causes the X server
+ * to make a copy of the information under it when it is posted.
+ * When the submenu is unposted, the X server copies this data
+ * back and doesn't generate any Expose events for the parent.
+ * (c) the parent may have redisplayed itself after the submenu was
+ * posted, in which case the saved information is no longer
+ * correct.
+ * The simplest solution is just force a complete redisplay of the
+ * parent.
*/
- TkEventuallyRedrawMenu(menuPtr, (TkMenuEntry *) NULL);
- result = Tcl_VarEval(interp, "{", name, "} unpost", (char *) NULL);
+ subary[0] = menuPtr->postedCascade->namePtr;
+ subary[1] = Tcl_NewStringObj("unpost", -1);
+ Tcl_IncrRefCount(subary[1]);
+ TkEventuallyRedrawMenu(menuPtr, NULL);
+ result = Tcl_EvalObjv(interp, 2, subary, 0);
+ Tcl_DecrRefCount(subary[1]);
menuPtr->postedCascade = NULL;
if (result != TCL_OK) {
return result;
@@ -994,21 +977,31 @@ TkPostSubmenu(interp, menuPtr, mePtr)
if ((mePtr != NULL) && (mePtr->namePtr != NULL)
&& Tk_IsMapped(menuPtr->tkwin)) {
/*
- * Position the cascade with its upper left corner slightly
- * below and to the left of the upper right corner of the
- * menu entry (this is an attempt to match Motif behavior).
+ * Position the cascade with its upper left corner slightly below and
+ * to the left of the upper right corner of the menu entry (this is an
+ * attempt to match Motif behavior).
*
* The menu has to redrawn so that the entry can change relief.
+ *
+ * Set postedCascade early to ensure tear-off submenus work on
+ * Windows. [Bug 873613]
*/
- char string[TCL_INTEGER_SPACE * 2];
- char *name;
-
- name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
Tk_GetRootCoords(menuPtr->tkwin, &x, &y);
- AdjustMenuCoords(menuPtr, mePtr, &x, &y, string);
+ AdjustMenuCoords(menuPtr, mePtr, &x, &y);
+
menuPtr->postedCascade = mePtr;
- result = Tcl_VarEval(interp, "{", name, "} post ", string, (char *) NULL);
+ subary[0] = mePtr->namePtr;
+ subary[1] = Tcl_NewStringObj("post", -1);
+ subary[2] = Tcl_NewIntObj(x);
+ subary[3] = Tcl_NewIntObj(y);
+ Tcl_IncrRefCount(subary[1]);
+ Tcl_IncrRefCount(subary[2]);
+ Tcl_IncrRefCount(subary[3]);
+ result = Tcl_EvalObjv(interp, 4, subary, 0);
+ Tcl_DecrRefCount(subary[1]);
+ Tcl_DecrRefCount(subary[2]);
+ Tcl_DecrRefCount(subary[3]);
if (result != TCL_OK) {
menuPtr->postedCascade = NULL;
return result;
@@ -1023,8 +1016,7 @@ TkPostSubmenu(interp, menuPtr, mePtr)
*
* AdjustMenuCoords --
*
- * Adjusts the given coordinates down and the left to give a Motif
- * look.
+ * Adjusts the given coordinates down and the left to give a Motif look.
*
* Results:
* None.
@@ -1036,12 +1028,11 @@ TkPostSubmenu(interp, menuPtr, mePtr)
*/
static void
-AdjustMenuCoords(menuPtr, mePtr, xPtr, yPtr, string)
- TkMenu *menuPtr;
- TkMenuEntry *mePtr;
- int *xPtr;
- int *yPtr;
- char *string;
+AdjustMenuCoords(
+ TkMenu *menuPtr,
+ TkMenuEntry *mePtr,
+ int *xPtr,
+ int *yPtr)
{
if (menuPtr->menuType == MENUBAR) {
*xPtr += mePtr->x;
@@ -1051,11 +1042,18 @@ AdjustMenuCoords(menuPtr, mePtr, xPtr, yPtr, string)
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
&borderWidth);
- Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
+ Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
- *xPtr += Tk_Width(menuPtr->tkwin) - borderWidth - activeBorderWidth
+ *xPtr += Tk_Width(menuPtr->tkwin) - borderWidth - activeBorderWidth
- 2;
*yPtr += mePtr->y + activeBorderWidth + 2;
}
- sprintf(string, "%d %d", *xPtr, *yPtr);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index 8292b32..b19c7aa 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -1,115 +1,114 @@
-/*
+/*
* tkMenubutton.c --
*
- * This module implements button-like widgets that are used
- * to invoke pull-down menus.
+ * This module implements button-like widgets that are used to invoke
+ * pull-down menus.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * 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 "tkMenubutton.h"
-#include "tkPort.h"
#include "default.h"
/*
- * The following table defines the legal values for the -direction
- * option. It is used together with the "enum direction" declaration
- * in tkMenubutton.h.
+ * 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[] = {
- "above", "below", "flush", "left", "right", (char *) NULL
+ "above", "below", "flush", "left", "right", NULL
};
/*
- * The following table defines the legal values for the -state option.
- * It is used together with the "enum state" declaration in tkMenubutton.h.
+ * The following table defines the legal values for the -state option. It is
+ * used together with the "enum state" declaration in tkMenubutton.h.
*/
static char *stateStrings[] = {
- "active", "disabled", "normal", (char *) NULL
+ "active", "disabled", "normal", NULL
};
/*
- * The following table defines the legal values for the -compound option.
- * It is used with the "enum compound" declaration in tkMenuButton.h
+ * The following table defines the legal values for the -compound option. It
+ * is used with the "enum compound" declaration in tkMenuButton.h
*/
static char *compoundStrings[] = {
- "bottom", "center", "left", "none", "right", "top", (char *) NULL
+ "bottom", "center", "left", "none", "right", "top", NULL
};
/*
* Information used for parsing configuration specs:
*/
-static Tk_OptionSpec optionSpecs[] = {
+static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground",
- DEF_MENUBUTTON_ACTIVE_BG_COLOR, -1,
- Tk_Offset(TkMenuButton, activeBorder), 0,
- (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0},
+ DEF_MENUBUTTON_ACTIVE_BG_COLOR, -1,
+ Tk_Offset(TkMenuButton, activeBorder), 0,
+ (ClientData) DEF_MENUBUTTON_ACTIVE_BG_MONO, 0},
{TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background",
- DEF_MENUBUTTON_ACTIVE_FG_COLOR, -1,
- Tk_Offset(TkMenuButton, activeFg),
- 0, (ClientData) DEF_MENUBUTTON_ACTIVE_FG_MONO, 0},
+ DEF_MENUBUTTON_ACTIVE_FG_COLOR, -1,
+ Tk_Offset(TkMenuButton, activeFg),
+ 0, (ClientData) DEF_MENUBUTTON_ACTIVE_FG_MONO, 0},
{TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_MENUBUTTON_ANCHOR, -1,
- Tk_Offset(TkMenuButton, anchor), 0, 0, 0},
+ DEF_MENUBUTTON_ANCHOR, -1,
+ Tk_Offset(TkMenuButton, anchor), 0, 0, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_MENUBUTTON_BG_COLOR, -1, Tk_Offset(TkMenuButton, normalBorder),
- 0, (ClientData) DEF_MENUBUTTON_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ 0, (ClientData) DEF_MENUBUTTON_BG_MONO, 0},
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0,
+ (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0,
+ (ClientData) "-background", 0},
{TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap",
DEF_MENUBUTTON_BITMAP, -1, Tk_Offset(TkMenuButton, bitmap),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_MENUBUTTON_BORDER_WIDTH, -1,
- Tk_Offset(TkMenuButton, borderWidth), 0, 0, 0},
+ DEF_MENUBUTTON_BORDER_WIDTH, -1,
+ Tk_Offset(TkMenuButton, borderWidth), 0, 0, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_MENUBUTTON_CURSOR, -1, Tk_Offset(TkMenuButton, cursor),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction",
- DEF_MENUBUTTON_DIRECTION, -1, Tk_Offset(TkMenuButton, direction),
+ DEF_MENUBUTTON_DIRECTION, -1, Tk_Offset(TkMenuButton, direction),
0, (ClientData) directionStrings, 0},
{TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
"DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR,
-1, Tk_Offset(TkMenuButton, disabledFg), TK_OPTION_NULL_OK,
(ClientData) DEF_MENUBUTTON_DISABLED_FG_MONO, 0},
- {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0,
+ (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_MENUBUTTON_FONT, -1, Tk_Offset(TkMenuButton, tkfont), 0, 0, 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
DEF_MENUBUTTON_FG, -1, Tk_Offset(TkMenuButton, normalFg), 0, 0, 0},
{TK_OPTION_STRING, "-height", "height", "Height",
- DEF_MENUBUTTON_HEIGHT, -1, Tk_Offset(TkMenuButton, heightString),
- 0, 0, 0},
+ DEF_MENUBUTTON_HEIGHT, -1, Tk_Offset(TkMenuButton, heightString),
+ 0, 0, 0},
{TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
"HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR,
-1, Tk_Offset(TkMenuButton, highlightBgColorPtr), 0, 0, 0},
{TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_MENUBUTTON_HIGHLIGHT, -1,
- Tk_Offset(TkMenuButton, highlightColorPtr), 0, 0, 0},
+ DEF_MENUBUTTON_HIGHLIGHT, -1,
+ Tk_Offset(TkMenuButton, highlightColorPtr), 0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
"HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH,
-1, Tk_Offset(TkMenuButton, highlightWidth), 0, 0, 0},
{TK_OPTION_STRING, "-image", "image", "Image",
- DEF_MENUBUTTON_IMAGE, -1, Tk_Offset(TkMenuButton, imageString),
+ DEF_MENUBUTTON_IMAGE, -1, Tk_Offset(TkMenuButton, imageString),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn",
DEF_MENUBUTTON_INDICATOR, -1, Tk_Offset(TkMenuButton, indicatorOn),
- 0, 0, 0},
+ 0, 0, 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
- DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkMenuButton, justify), 0, 0, 0},
+ DEF_MENUBUTTON_JUSTIFY, -1, Tk_Offset(TkMenuButton, justify), 0, 0, 0},
{TK_OPTION_STRING, "-menu", "menu", "Menu",
- DEF_MENUBUTTON_MENU, -1, Tk_Offset(TkMenuButton, menuName),
+ DEF_MENUBUTTON_MENU, -1, Tk_Offset(TkMenuButton, menuName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
DEF_MENUBUTTON_PADX, -1, Tk_Offset(TkMenuButton, padX),
@@ -118,43 +117,42 @@ static Tk_OptionSpec optionSpecs[] = {
DEF_MENUBUTTON_PADY, -1, Tk_Offset(TkMenuButton, padY),
0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_MENUBUTTON_RELIEF, -1, Tk_Offset(TkMenuButton, relief),
- 0, 0, 0},
+ DEF_MENUBUTTON_RELIEF, -1, Tk_Offset(TkMenuButton, relief),
+ 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
- DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0,
- (ClientData) compoundStrings, 0},
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
DEF_MENUBUTTON_STATE, -1, Tk_Offset(TkMenuButton, state),
0, (ClientData) stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_MENUBUTTON_TAKE_FOCUS, -1,
- Tk_Offset(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0},
+ DEF_MENUBUTTON_TAKE_FOCUS, -1,
+ Tk_Offset(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_MENUBUTTON_TEXT, -1, Tk_Offset(TkMenuButton, text), 0, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
- DEF_MENUBUTTON_TEXT_VARIABLE, -1,
- Tk_Offset(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0},
+ DEF_MENUBUTTON_TEXT_VARIABLE, -1,
+ Tk_Offset(TkMenuButton, textVarName), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_INT, "-underline", "underline", "Underline",
DEF_MENUBUTTON_UNDERLINE, -1, Tk_Offset(TkMenuButton, underline),
- 0, 0, 0},
+ 0, 0, 0},
{TK_OPTION_STRING, "-width", "width", "Width",
- DEF_MENUBUTTON_WIDTH, -1, Tk_Offset(TkMenuButton, widthString),
- 0, 0, 0},
+ DEF_MENUBUTTON_WIDTH, -1, Tk_Offset(TkMenuButton, widthString),
+ 0, 0, 0},
{TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength",
DEF_MENUBUTTON_WRAP_LENGTH, -1, Tk_Offset(TkMenuButton, wrapLength),
- 0, 0, 0},
- {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+ 0, 0, 0},
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0}
};
/*
- * The following tables define the menubutton widget commands and map the
- * indexes into the string tables into a single enumerated type used
- * to dispatch the scale widget command.
+ * The following tables define the menubutton widget commands and map the
+ * indexes into the string tables into a single enumerated type used to
+ * dispatch the scale widget command.
*/
static CONST char *commandNames[] = {
- "cget", "configure", (char *) NULL
+ "cget", "configure", NULL
};
enum command {
@@ -162,35 +160,34 @@ enum command {
};
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static void MenuButtonCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void MenuButtonEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static void MenuButtonImageProc _ANSI_ARGS_((ClientData clientData,
+static void MenuButtonCmdDeletedProc(ClientData clientData);
+static void MenuButtonEventProc(ClientData clientData,
+ XEvent *eventPtr);
+static void MenuButtonImageProc(ClientData clientData,
int x, int y, int width, int height, int imgWidth,
- int imgHeight));
-static char * MenuButtonTextVarProc _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- CONST char *name1, CONST char *name2, int flags));
-static int MenuButtonWidgetObjCmd _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST objv[]));
-static int ConfigureMenuButton _ANSI_ARGS_((Tcl_Interp *interp,
- TkMenuButton *mbPtr, int objc,
- Tcl_Obj *CONST objv[]));
-static void DestroyMenuButton _ANSI_ARGS_((char *memPtr));
+ int imgHeight);
+static char * MenuButtonTextVarProc(ClientData clientData,
+ 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[]);
+static int ConfigureMenuButton(Tcl_Interp *interp,
+ TkMenuButton *mbPtr, int objc,
+ Tcl_Obj *CONST objv[]);
+static void DestroyMenuButton(char *memPtr);
/*
*--------------------------------------------------------------
*
* Tk_MenubuttonObjCmd --
*
- * This procedure is invoked to process the "button", "label",
- * "radiobutton", and "checkbutton" Tcl commands. See the
- * user documentation for details on what it does.
+ * This function is invoked to process the "button", "label",
+ * "radiobutton", and "checkbutton" Tcl commands. See the user
+ * documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -202,11 +199,11 @@ static void DestroyMenuButton _ANSI_ARGS_((char *memPtr));
*/
int
-Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_MenubuttonObjCmd(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
register TkMenuButton *mbPtr;
Tk_OptionTable optionTable;
@@ -222,14 +219,14 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
*/
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
/*
- * Create the option table for this widget class. If it has already
- * been created, the cached pointer will be returned.
+ * Create the option table for this widget class. If it has already been
+ * created, the cached pointer will be returned.
*/
optionTable = Tk_CreateOptionTable(interp, optionSpecs);
@@ -246,9 +243,9 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
mbPtr->tkwin = tkwin;
mbPtr->display = Tk_Display (tkwin);
mbPtr->interp = interp;
- mbPtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd,
- (ClientData) mbPtr, MenuButtonCmdDeletedProc);
+ mbPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd,
+ (ClientData) mbPtr, MenuButtonCmdDeletedProc);
mbPtr->optionTable = optionTable;
mbPtr->menuName = NULL;
mbPtr->text = NULL;
@@ -318,9 +315,9 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
*
* MenuButtonWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -332,66 +329,62 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
*/
static int
-MenuButtonWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about button widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+MenuButtonWidgetObjCmd(
+ ClientData clientData, /* Information about button widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) 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 arg ...?");
return TCL_ERROR;
}
- result = Tcl_GetIndexFromObj(interp, objv[1],
- commandNames, "option", 0, &index);
+ result = Tcl_GetIndexFromObj(interp, objv[1], commandNames, "option", 0,
+ &index);
if (result != TCL_OK) {
- return result;
+ return result;
}
Tcl_Preserve((ClientData) mbPtr);
switch (index) {
- case COMMAND_CGET: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "cget option");
+ case COMMAND_CGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "cget option");
goto error;
- }
+ }
- objPtr = Tk_GetOptionValue(interp, (char *) mbPtr,
- mbPtr->optionTable, objv[2], mbPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
- break;
+ objPtr = Tk_GetOptionValue(interp, (char *) mbPtr,
+ mbPtr->optionTable, objv[2], mbPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
}
+ break;
- case COMMAND_CONFIGURE: {
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) mbPtr,
- mbPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- mbPtr->tkwin);
- if (objPtr == NULL) {
- goto error;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- }
+ case COMMAND_CONFIGURE:
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) mbPtr,
+ mbPtr->optionTable, (objc == 3) ? objv[2] : NULL,
+ mbPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
} else {
- result = ConfigureMenuButton(interp, mbPtr, objc-2,
- objv+2);
+ Tcl_SetObjResult(interp, objPtr);
}
- break;
+ } else {
+ result = ConfigureMenuButton(interp, mbPtr, objc-2, objv+2);
}
+ break;
}
Tcl_Release((ClientData) mbPtr);
return result;
- error:
+ error:
Tcl_Release((ClientData) mbPtr);
return TCL_ERROR;
}
@@ -401,10 +394,10 @@ MenuButtonWidgetObjCmd(clientData, interp, objc, objv)
*
* DestroyMenuButton --
*
- * This procedure is invoked to recycle all of the resources
- * associated with a menubutton widget. It is invoked as a
- * when-idle handler in order to make sure that there is no
- * other use of the menubutton pending at the time of the deletion.
+ * This function is invoked to recycle all of the resources associated
+ * with a menubutton widget. It is invoked as a when-idle handler in
+ * order to make sure that there is no other use of the menubutton
+ * pending at the time of the deletion.
*
* Results:
* None.
@@ -416,20 +409,19 @@ MenuButtonWidgetObjCmd(clientData, interp, objc, objv)
*/
static void
-DestroyMenuButton(memPtr)
- char *memPtr; /* Info about button widget. */
+DestroyMenuButton(
+ char *memPtr) /* Info about button widget. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) memPtr;
TkpDestroyMenuButton(mbPtr);
if (mbPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(TkpDisplayMenuButton, (ClientData) mbPtr);
+ Tcl_CancelIdleCall(TkpDisplayMenuButton, (ClientData) mbPtr);
}
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeOptions handle all the standard option-related stuff.
*/
Tcl_DeleteCommandFromToken(mbPtr->interp, mbPtr->widgetCmd);
@@ -457,7 +449,7 @@ DestroyMenuButton(memPtr)
Tk_FreeBitmap(mbPtr->display, mbPtr->gray);
}
if (mbPtr->textLayout != NULL) {
- Tk_FreeTextLayout(mbPtr->textLayout);
+ Tk_FreeTextLayout(mbPtr->textLayout);
}
Tk_FreeConfigOptions((char *) mbPtr, mbPtr->optionTable, mbPtr->tkwin);
mbPtr->tkwin = NULL;
@@ -469,31 +461,30 @@ DestroyMenuButton(memPtr)
*
* ConfigureMenuButton --
*
- * This procedure is called to process an argv/argc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a menubutton widget.
+ * This function is called to process an argv/argc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a menubutton
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for mbPtr; old resources get freed, if there
- * were any. The menubutton is redisplayed.
+ * Configuration information, such as text string, colors, font, etc. get
+ * set for mbPtr; old resources get freed, if there were any. The
+ * menubutton is redisplayed.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureMenuButton(interp, mbPtr, objc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- register TkMenuButton *mbPtr;
- /* Information about widget; may or may
- * not already have values for some
- * fields. */
- int objc; /* Number of valid entries in objv. */
- Tcl_Obj *CONST objv[]; /* Arguments. */
+ConfigureMenuButton(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ register TkMenuButton *mbPtr,
+ /* Information about widget; may or may not
+ * already have values for some fields. */
+ int objc, /* Number of valid entries in objv. */
+ Tcl_Obj *CONST objv[]) /* Arguments. */
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
@@ -501,21 +492,20 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
Tk_Image image;
/*
- * Eliminate any existing trace on variables monitored by the
- * menubutton.
+ * Eliminate any existing trace on variables monitored by the menubutton.
*/
if (mbPtr->textVarName != NULL) {
- Tcl_UntraceVar(interp, mbPtr->textVarName,
+ Tcl_UntraceVar(interp, mbPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuButtonTextVarProc, (ClientData) mbPtr);
}
/*
- * The following loop is potentially executed twice. During the
- * first pass configuration options get set to their new values.
- * If there is an error in this pass, we execute a second pass
- * to restore all the options to their previous values.
+ * The following loop is potentially executed twice. During the first pass
+ * configuration options get set to their new values. If there is an error
+ * in this pass, we execute a second pass to restore all the options to
+ * their previous values.
*/
for (error = 0; error <= 1; error++) {
@@ -526,7 +516,7 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
if (Tk_SetOptions(interp, (char *) mbPtr,
mbPtr->optionTable, objc, objv,
- mbPtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ mbPtr->tkwin, &savedOptions, NULL) != TCL_OK) {
continue;
}
} else {
@@ -541,8 +531,8 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
/*
* A few options need special processing, such as setting the
- * background from a 3-D border, or filling in complicated
- * defaults that couldn't be specified to Tk_SetOptions.
+ * background from a 3-D border, or filling in complicated defaults
+ * that couldn't be specified to Tk_SetOptions.
*/
if ((mbPtr->state == STATE_ACTIVE)
@@ -564,17 +554,17 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
}
/*
- * Get the image for the widget, if there is one. Allocate the
- * new image before freeing the old one, so that the reference
- * count doesn't go to zero and cause image data to be discarded.
+ * Get the image for the widget, if there is one. Allocate the new
+ * image before freeing the old one, so that the reference count
+ * doesn't go to zero and cause image data to be discarded.
*/
if (mbPtr->imageString != NULL) {
image = Tk_GetImage(mbPtr->interp, mbPtr->tkwin,
- mbPtr->imageString, MenuButtonImageProc,
+ mbPtr->imageString, MenuButtonImageProc,
(ClientData) mbPtr);
if (image == NULL) {
- return TCL_ERROR;
+ return TCL_ERROR;
}
} else {
image = NULL;
@@ -590,32 +580,32 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
if ((mbPtr->bitmap != None) || (mbPtr->image != NULL)) {
if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString,
- &mbPtr->width) != TCL_OK) {
- widthError:
- Tcl_AddErrorInfo(interp, "\n (processing -width option)");
+ &mbPtr->width) != TCL_OK) {
+ widthError:
+ Tcl_AddErrorInfo(interp, "\n (processing -width option)");
continue;
}
if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->heightString,
&mbPtr->height) != TCL_OK) {
- heightError:
- Tcl_AddErrorInfo(interp, "\n (processing -height option)");
+ heightError:
+ Tcl_AddErrorInfo(interp, "\n (processing -height option)");
continue;
}
} else {
if (Tcl_GetInt(interp, mbPtr->widthString, &mbPtr->width)
!= TCL_OK) {
- goto widthError;
+ goto widthError;
}
if (Tcl_GetInt(interp, mbPtr->heightString, &mbPtr->height)
!= TCL_OK) {
- goto heightError;
+ goto heightError;
}
}
break;
}
if (!error) {
- Tk_FreeSavedOptions(&savedOptions);
+ Tk_FreeSavedOptions(&savedOptions);
}
if (mbPtr->textVarName != NULL) {
@@ -646,10 +636,9 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
if (error) {
Tcl_SetObjResult(interp, errorResult);
Tcl_DecrRefCount(errorResult);
- return TCL_ERROR;
- } else {
- return TCL_OK;
+ return TCL_ERROR;
}
+ return TCL_OK;
}
/*
@@ -657,22 +646,22 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
*
* TkMenuButtonWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * TkMenuButton will be relayed out and redisplayed.
+ * TkMenuButton will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
void
-TkMenuButtonWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+TkMenuButtonWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
GC gc;
@@ -686,9 +675,9 @@ TkMenuButtonWorldChanged(instanceData)
gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
/*
- * Note: GraphicsExpose events are disabled in GC's because they're
- * used to copy stuff from an off-screen pixmap onto the screen (we know
- * that there's no problem with obscured areas).
+ * Note: GraphicsExpose events are disabled in GC's because they're used
+ * to copy stuff from an off-screen pixmap onto the screen (we know that
+ * there's no problem with obscured areas).
*/
gcValues.graphics_exposures = False;
@@ -729,8 +718,8 @@ TkMenuButtonWorldChanged(instanceData)
}
/*
- * Allocate the disabled graphics context, for drawing text in
- * its disabled state.
+ * Allocate the disabled graphics context, for drawing text in its
+ * disabled state.
*/
mask = GCForeground | GCBackground | GCFont;
@@ -762,36 +751,36 @@ TkMenuButtonWorldChanged(instanceData)
*
* MenuButtonEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on buttons.
+ * This function is invoked by the Tk dispatcher for various events on
+ * buttons.
*
* Results:
* None.
*
* Side effects:
- * When the window gets deleted, internal structures get
- * cleaned up. When it gets exposed, it is redisplayed.
+ * When the window gets deleted, internal structures get cleaned up.
+ * When it gets exposed, it is redisplayed.
*
*--------------------------------------------------------------
*/
static void
-MenuButtonEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+MenuButtonEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
TkMenuButton *mbPtr = (TkMenuButton *) clientData;
if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
goto redraw;
} else if (eventPtr->type == ConfigureNotify) {
/*
- * Must redraw after size changes, since layout could have changed
- * and borders will need to be redrawn.
+ * Must redraw after size changes, since layout could have changed and
+ * borders will need to be redrawn.
*/
goto redraw;
} else if (eventPtr->type == DestroyNotify) {
- DestroyMenuButton((char *) mbPtr);
+ DestroyMenuButton((char *) mbPtr);
} else if (eventPtr->type == FocusIn) {
if (eventPtr->xfocus.detail != NotifyInferior) {
mbPtr->flags |= GOT_FOCUS;
@@ -809,7 +798,7 @@ MenuButtonEventProc(clientData, eventPtr)
}
return;
- redraw:
+ redraw:
if ((mbPtr->tkwin != NULL) && !(mbPtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
mbPtr->flags |= REDRAW_PENDING;
@@ -821,9 +810,9 @@ MenuButtonEventProc(clientData, eventPtr)
*
* MenuButtonCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -835,17 +824,17 @@ MenuButtonEventProc(clientData, eventPtr)
*/
static void
-MenuButtonCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+MenuButtonCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
TkMenuButton *mbPtr = (TkMenuButton *) clientData;
Tk_Window tkwin = mbPtr->tkwin;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (tkwin != NULL) {
@@ -858,8 +847,8 @@ MenuButtonCmdDeletedProc(clientData)
*
* MenuButtonTextVarProc --
*
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in a menu button.
+ * This function is invoked when someone changes the variable whose
+ * contents are to be displayed in a menu button.
*
* Results:
* NULL is always returned.
@@ -873,19 +862,20 @@ MenuButtonCmdDeletedProc(clientData)
/* ARGSUSED */
static char *
-MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
- ClientData clientData; /* Information about button. */
- Tcl_Interp *interp; /* Interpreter containing variable. */
- CONST char *name1; /* Name of variable. */
- CONST char *name2; /* Second part of variable name. */
- int flags; /* Information about what happened. */
+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. */
+ int flags) /* Information about what happened. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
CONST char *value;
+ unsigned len;
/*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
+ * If the variable is unset, then immediately recreate it unless the whole
+ * interpreter is going away.
*/
if (flags & TCL_TRACE_UNSETS) {
@@ -896,7 +886,7 @@ MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuButtonTextVarProc, clientData);
}
- return (char *) NULL;
+ return NULL;
}
value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY);
@@ -906,8 +896,9 @@ MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
if (mbPtr->text != NULL) {
ckfree(mbPtr->text);
}
- mbPtr->text = (char *) ckalloc((unsigned) (strlen(value) + 1));
- strcpy(mbPtr->text, value);
+ len = 1 + (unsigned) strlen(value);
+ mbPtr->text = (char *) ckalloc(len);
+ memcpy(mbPtr->text, value, len);
TkpComputeMenuButtonGeometry(mbPtr);
if ((mbPtr->tkwin != NULL) && Tk_IsMapped(mbPtr->tkwin)
@@ -915,7 +906,7 @@ MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr);
mbPtr->flags |= REDRAW_PENDING;
}
- return (char *) NULL;
+ return NULL;
}
/*
@@ -923,9 +914,9 @@ MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
*
* MenuButtonImageProc --
*
- * This procedure is invoked by the image code whenever the manager
- * for an image does something that affects the size of contents
- * of an image displayed in a button.
+ * This function is invoked by the image code whenever the manager for an
+ * image does something that affects the size of contents of an image
+ * displayed in a button.
*
* Results:
* None.
@@ -937,13 +928,13 @@ MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
*/
static void
-MenuButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
- ClientData clientData; /* Pointer to widget record. */
- int x, y; /* Upper left pixel (within image)
- * that must be redisplayed. */
- int width, height; /* Dimensions of area to redisplay
- * (may be <= 0). */
- int imgWidth, imgHeight; /* New dimensions of image. */
+MenuButtonImageProc(
+ ClientData clientData, /* Pointer to widget record. */
+ int x, int y, /* Upper left pixel (within image) that must
+ * be redisplayed. */
+ int width, int height, /* Dimensions of area to redisplay (may be <=
+ * 0). */
+ int imgWidth, int imgHeight)/* New dimensions of image. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
@@ -955,3 +946,11 @@ MenuButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
}
}
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h
index 7e36fe6..41af675 100644
--- a/generic/tkMenubutton.h
+++ b/generic/tkMenubutton.h
@@ -1,13 +1,13 @@
/*
* tkMenubutton.h --
*
- * Declarations of types and functions used to implement
- * the menubutton widget.
+ * Declarations of types and functions used to implement the menubutton
+ * widget.
*
* Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#ifndef _TKMENUBUTTON
@@ -31,7 +31,7 @@
*/
enum direction {
- DIRECTION_ABOVE, DIRECTION_BELOW, DIRECTION_FLUSH,
+ DIRECTION_ABOVE, DIRECTION_BELOW, DIRECTION_FLUSH,
DIRECTION_LEFT, DIRECTION_RIGHT
};
@@ -44,16 +44,16 @@ enum state {
};
/*
- * A data structure of the following type is kept for each
- * widget managed by this file:
+ * A data structure of the following type is kept for each widget managed by
+ * this file:
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the widget. NULL
- * means that the window has been destroyed
- * but the data structures haven't yet been
- * cleaned up.*/
- Display *display; /* Display containing widget. Needed, among
+ Tk_Window tkwin; /* Window that embodies the widget. NULL means
+ * that the window has been destroyed but the
+ * data structures haven't yet been cleaned
+ * up. */
+ Display *display; /* Display containing widget. Needed, among
* other things, so that resources can bee
* freed up even after tkwin has gone away. */
Tcl_Interp *interp; /* Interpreter associated with menubutton. */
@@ -67,17 +67,17 @@ typedef struct {
* Information about what's displayed in the menu button:
*/
- char *text; /* Text to display in button (malloc'ed)
- * or NULL. */
+ char *text; /* Text to display in button (malloc'ed) or
+ * NULL. */
int underline; /* Index of character to underline. */
- char *textVarName; /* Name of variable (malloc'ed) or NULL.
- * If non-NULL, button displays the contents
- * of this variable. */
- Pixmap bitmap; /* Bitmap to display or None. If not None
- * then text and textVar and underline
- * are ignored. */
+ char *textVarName; /* Name of variable (malloc'ed) or NULL. If
+ * non-NULL, button displays the contents of
+ * this variable. */
+ Pixmap bitmap; /* Bitmap to display or None. If not None then
+ * text and textVar and underline are
+ * ignored. */
char *imageString; /* Name of image to display (malloc'ed), or
- * NULL. If non-NULL, bitmap, text, and
+ * NULL. If non-NULL, bitmap, text, and
* textVarName are ignored. */
Tk_Image image; /* Image to display in window, or NULL if
* none. */
@@ -86,115 +86,113 @@ typedef struct {
* Information used when displaying widget:
*/
- enum state state; /* State of button for display purposes:
+ enum state state; /* State of button for display purposes:
* normal, active, or disabled. */
- Tk_3DBorder normalBorder; /* Structure used to draw 3-D
- * border and background when window
- * isn't active. NULL means no such
- * border exists. */
- Tk_3DBorder activeBorder; /* Structure used to draw 3-D
- * border and background when window
- * is active. NULL means no such
- * border exists. */
+ Tk_3DBorder normalBorder; /* Structure used to draw 3-D border and
+ * background when window isn't active. NULL
+ * means no such border exists. */
+ Tk_3DBorder activeBorder; /* Structure used to draw 3-D border and
+ * background when window is active. NULL
+ * means no such border exists. */
int borderWidth; /* Width of border. */
int relief; /* 3-d effect: TK_RELIEF_RAISED, etc. */
- int highlightWidth; /* Width in pixels of highlight to draw
- * around widget when it has the focus.
- * <= 0 means don't draw a highlight. */
- XColor *highlightBgColorPtr;
- /* Color for drawing traversal highlight
- * area when highlight is off. */
+ int highlightWidth; /* Width in pixels of highlight to draw around
+ * widget when it has the focus. <= 0 means
+ * don't draw a highlight. */
+ XColor *highlightBgColorPtr;/* Color for drawing traversal highlight area
+ * when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
int inset; /* Total width of all borders, including
* traversal highlight and 3-D border.
- * Indicates how much interior stuff must
- * be offset from outside edges to leave
- * room for borders. */
+ * Indicates how much interior stuff must be
+ * offset from outside edges to leave room for
+ * borders. */
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *normalFg; /* Foreground color in normal mode. */
- XColor *activeFg; /* Foreground color in active mode. NULL
- * means use normalFg instead. */
- XColor *disabledFg; /* Foreground color when disabled. NULL
- * means use normalFg with a 50% stipple
- * instead. */
+ XColor *activeFg; /* Foreground color in active mode. NULL means
+ * use normalFg instead. */
+ XColor *disabledFg; /* Foreground color when disabled. NULL means
+ * use normalFg with a 50% stipple instead. */
GC normalTextGC; /* GC for drawing text in normal mode. */
GC activeTextGC; /* GC for drawing text in active mode (NULL
* means use normalTextGC). */
Pixmap gray; /* Pixmap for displaying disabled text/icon if
* disabledFg is NULL. */
- GC disabledGC; /* Used to produce disabled effect for text. */
- GC stippleGC; /* Used to produce disabled stipple effect
- * for images when disabled. */
+ GC disabledGC; /* Used to produce disabled effect for
+ * text. */
+ GC stippleGC; /* Used to produce disabled stipple effect for
+ * images when disabled. */
int leftBearing; /* Distance from text origin to leftmost drawn
* pixel (positive means to right). */
- int rightBearing; /* Amount text sticks right from its origin. */
- char *widthString; /* Value of -width option. Malloc'ed. */
- char *heightString; /* Value of -height option. Malloc'ed. */
+ int rightBearing; /* Amount text sticks right from its
+ * origin. */
+ char *widthString; /* Value of -width option. Malloc'ed. */
+ char *heightString; /* Value of -height option. Malloc'ed. */
int width, height; /* If > 0, these specify dimensions to request
* for window, in characters for text and in
- * pixels for bitmaps. In this case the actual
+ * pixels for bitmaps. In this case the actual
* size of the text string or bitmap is
- * ignored in computing desired window size. */
+ * ignored in computing desired window
+ * size. */
int wrapLength; /* Line length (in pixels) at which to wrap
- * onto next line. <= 0 means don't wrap
+ * onto next line. <= 0 means don't wrap
* except at newlines. */
int padX, padY; /* Extra space around text or bitmap (pixels
* on each side). */
Tk_Anchor anchor; /* Where text/bitmap should be displayed
* inside window region. */
- Tk_Justify justify; /* Justification to use for multi-line text. */
+ Tk_Justify justify; /* Justification to use for multi-line
+ * text. */
int textWidth; /* Width needed to display text as requested,
* in pixels. */
int textHeight; /* Height needed to display text as requested,
* in pixels. */
Tk_TextLayout textLayout; /* Saved text layout information. */
- int indicatorOn; /* Non-zero means display indicator; 0 means
+ int indicatorOn; /* Non-zero means display indicator; 0 means
* don't display. */
- int indicatorHeight; /* Height of indicator in pixels. This same
+ int indicatorHeight; /* Height of indicator in pixels. This same
* amount of extra space is also left on each
- * side of the indicator. 0 if no indicator. */
+ * side of the indicator. 0 if no
+ * indicator. */
int indicatorWidth; /* Width of indicator in pixels, including
- * indicatorHeight in padding on each side.
- * 0 if no indicator. */
+ * indicatorHeight in padding on each side. 0
+ * if no indicator. */
/*
* Miscellaneous information:
*/
- int compound; /* Value of -compound option; specifies whether
- * the menubutton should show both an image and
- * text, and, if so, how. */
-
- enum direction direction; /* Direction for where to pop the menu.
- * Valid directions are "above", "below",
- * "left", "right", and "flush". "flush"
- * means that the upper left corner of the
- * menubutton is where the menu pops up.
- * "above" and "below" will attempt to pop
- * the menu compleletly above or below
- * the menu respectively.
- * "left" and "right" will pop the menu
- * left or right, and the active item
- * will be next to the button. */
+ int compound; /* Value of -compound option; specifies
+ * whether the menubutton should show both an
+ * image and text, and, if so, how. */
+ enum direction direction; /* Direction for where to pop the menu. Valid
+ * directions are "above", "below", "left",
+ * "right", and "flush". "flush" means that
+ * the upper left corner of the menubutton is
+ * where the menu pops up. "above" and "below"
+ * will attempt to pop the menu compleletly
+ * above or below the menu respectively.
+ * "left" and "right" will pop the menu left
+ * or right, and the active item will be next
+ * to the button. */
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int flags; /* Various flags; see below for
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
+ int flags; /* Various flags; see below for
* definitions. */
} TkMenuButton;
/*
* Flag bits for buttons:
*
- * REDRAW_PENDING: Non-zero means a DoWhenIdle handler
- * has already been queued to redraw
- * this window.
- * POSTED: Non-zero means that the menu associated
- * with this button has been posted (typically
- * because of an active button press).
- * GOT_FOCUS: Non-zero means this button currently
- * has the input focus.
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * already been queued to redraw this window.
+ * POSTED: Non-zero means that the menu associated with
+ * this button has been posted (typically because
+ * of an active button press).
+ * GOT_FOCUS: Non-zero means this button currently has the
+ * input focus.
*/
#define REDRAW_PENDING 1
@@ -203,7 +201,7 @@ typedef struct {
/*
* The following constants define the dimensions of the cascade indicator,
- * which is displayed if the "-indicatoron" option is true. The units for
+ * which is displayed if the "-indicatoron" option is true. The units for
* these options are 1/10 millimeters.
*/
@@ -214,22 +212,17 @@ typedef struct {
* Declaration of variables shared between the files in the button module.
*/
-extern Tk_ClassProcs tkpMenubuttonClass;
+MODULE_SCOPE Tk_ClassProcs tkpMenubuttonClass;
/*
- * Declaration of procedures used in the implementation of the button
- * widget.
+ * Declaration of procedures used in the implementation of the button widget.
*/
-EXTERN void TkpComputeMenuButtonGeometry _ANSI_ARGS_((
- TkMenuButton *mbPtr));
-EXTERN TkMenuButton * TkpCreateMenuButton _ANSI_ARGS_((Tk_Window tkwin));
-EXTERN void TkpDisplayMenuButton _ANSI_ARGS_((
- ClientData clientData));
-EXTERN void TkpDestroyMenuButton _ANSI_ARGS_((
- TkMenuButton *mbPtr));
-EXTERN void TkMenuButtonWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
+MODULE_SCOPE void TkpComputeMenuButtonGeometry(TkMenuButton *mbPtr);
+MODULE_SCOPE TkMenuButton *TkpCreateMenuButton(Tk_Window tkwin);
+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
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index 8fb5c36..0fd57a9 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -1,35 +1,34 @@
-/*
+/*
* tkMessage.c --
*
- * This module implements a message widgets for the Tk
- * toolkit. A message widget displays a multi-line string
- * in a window according to a particular aspect ratio.
+ * This module implements a message widgets for the Tk toolkit. A message
+ * widget displays a multi-line string in a window according to a
+ * particular aspect ratio.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 by Ajuba Solutions.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tkPort.h"
#include "default.h"
#include "tkInt.h"
/*
- * A data structure of the following type is kept for each message
- * widget managed by this file:
+ * A data structure of the following type is kept for each message widget
+ * managed by this file:
*/
typedef struct {
- Tk_Window tkwin; /* Window that embodies the message. NULL
+ Tk_Window tkwin; /* Window that embodies the message. NULL
* means that the window has been destroyed
* but the data structures haven't yet been
* cleaned up.*/
Tk_OptionTable optionTable; /* Table that defines options available for
* this widget. */
- Display *display; /* Display containing widget. Used, among
+ Display *display; /* Display containing widget. Used, among
* other things, so that resources can be
* freed even after tkwin has gone away. */
Tcl_Interp *interp; /* Interpreter associated with message. */
@@ -46,8 +45,8 @@ typedef struct {
* If non-NULL, message displays the contents
* of this variable. */
Tk_3DBorder border; /* Structure used to draw 3-D border and
- * background. NULL means a border hasn't
- * been created yet. */
+ * background. NULL means a border hasn't been
+ * created yet. */
int borderWidth; /* Width of border. */
int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
int highlightWidth; /* Width in pixels of highlight to draw
@@ -61,7 +60,7 @@ typedef struct {
XColor *fgColorPtr; /* Foreground color in normal mode. */
Tcl_Obj *padXPtr, *padYPtr; /* Tcl_Obj rep's of padX, padY values. */
int padX, padY; /* User-requested extra space around text. */
- int width; /* User-requested width, in pixels. 0 means
+ int width; /* User-requested width, in pixels. 0 means
* compute width using aspect ratio below. */
int aspect; /* Desired aspect ratio for window
* (100*width/height). */
@@ -82,10 +81,10 @@ typedef struct {
*/
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in
- * the C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
- int flags; /* Various flags; see below for
+ char *takeFocus; /* Value of -takefocus option; not used in the
+ * C code, but used by keyboard traversal
+ * scripts. Malloc'ed, but may be NULL. */
+ int flags; /* Various flags; see below for
* definitions. */
} Message;
@@ -108,7 +107,7 @@ typedef struct {
* Information used for argv parsing.
*/
-static Tk_OptionSpec optionSpecs[] = {
+static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR,
-1, Tk_Offset(Message, anchor), 0, 0, 0},
{TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT,
@@ -116,9 +115,9 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_MESSAGE_BG_COLOR, -1, Tk_Offset(Message, border), 0,
(ClientData) DEF_MESSAGE_BG_MONO, 0},
- {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL, (char *) NULL,
+ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL,
0, -1, 0, (ClientData) "-borderwidth", 0},
- {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL, (char *) NULL,
+ {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL,
0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_MESSAGE_BORDER_WIDTH, -1,
@@ -126,7 +125,7 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_MESSAGE_CURSOR, -1, Tk_Offset(Message, cursor),
TK_OPTION_NULL_OK, 0, 0},
- {TK_OPTION_SYNONYM, "-fg", (char *) NULL, (char *) NULL, (char *) NULL,
+ {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL,
0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_FONT, "-font", "font", "Font",
DEF_MESSAGE_FONT, -1, Tk_Offset(Message, tkfont), 0, 0, 0},
@@ -161,35 +160,31 @@ static 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, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0, 0, 0}
+ {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0}
};
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static void MessageCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-static void MessageEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
-static char * MessageTextVarProc _ANSI_ARGS_((ClientData clientData,
+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));
-static int MessageWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
+ CONST char *name2, int flags);
+static int MessageWidgetObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
- Tcl_Obj *CONST objv[]));
-static void MessageWorldChanged _ANSI_ARGS_((
- ClientData instanceData));
-static void ComputeMessageGeometry _ANSI_ARGS_((Message *msgPtr));
-static int ConfigureMessage _ANSI_ARGS_((Tcl_Interp *interp,
- Message *msgPtr, int objc, Tcl_Obj *CONST objv[],
- int flags));
-static void DestroyMessage _ANSI_ARGS_((char *memPtr));
-static void DisplayMessage _ANSI_ARGS_((ClientData clientData));
+ 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);
+static void DestroyMessage(char *memPtr);
+static void DisplayMessage(ClientData clientData);
/*
- * The structure below defines message class behavior by means of procedures
+ * The structure below defines message class behavior by means of functions
* that can be invoked from generic window code.
*/
@@ -197,16 +192,14 @@ static Tk_ClassProcs messageClass = {
sizeof(Tk_ClassProcs), /* size */
MessageWorldChanged, /* worldChangedProc */
};
-
/*
*--------------------------------------------------------------
*
* Tk_MessageObjCmd --
*
- * This procedure is invoked to process the "message" Tcl
- * command. See the user documentation for details on what
- * it does.
+ * This function is invoked to process the "message" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -218,11 +211,11 @@ static Tk_ClassProcs messageClass = {
*/
int
-Tk_MessageObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* NULL. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+Tk_MessageObjCmd(
+ ClientData clientData, /* NULL. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
register Message *msgPtr;
Tk_OptionTable optionTable;
@@ -234,14 +227,14 @@ Tk_MessageObjCmd(clientData, interp, objc, objv)
}
tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
+ Tcl_GetString(objv[1]), NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
/*
- * Create the option table for this widget class. If it has already
- * been created, the cached pointer will be returned.
+ * Create the option table for this widget class. If it has already been
+ * created, the cached pointer will be returned.
*/
optionTable = Tk_CreateOptionTable(interp, optionSpecs);
@@ -252,19 +245,20 @@ Tk_MessageObjCmd(clientData, interp, objc, objv)
/*
* Set values for those fields that don't take a 0 or NULL value.
*/
- msgPtr->tkwin = tkwin;
- msgPtr->display = Tk_Display(tkwin);
- msgPtr->interp = interp;
- msgPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+
+ msgPtr->tkwin = tkwin;
+ msgPtr->display = Tk_Display(tkwin);
+ msgPtr->interp = interp;
+ msgPtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd,
(ClientData) msgPtr, MessageCmdDeletedProc);
- msgPtr->optionTable = optionTable;
- msgPtr->relief = TK_RELIEF_FLAT;
- msgPtr->textGC = None;
- msgPtr->anchor = TK_ANCHOR_CENTER;
- msgPtr->aspect = 150;
- msgPtr->justify = TK_JUSTIFY_LEFT;
- msgPtr->cursor = None;
+ msgPtr->optionTable = optionTable;
+ msgPtr->relief = TK_RELIEF_FLAT;
+ msgPtr->textGC = None;
+ msgPtr->anchor = TK_ANCHOR_CENTER;
+ msgPtr->aspect = 150;
+ msgPtr->justify = TK_JUSTIFY_LEFT;
+ msgPtr->cursor = None;
Tk_SetClass(msgPtr->tkwin, "Message");
Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
@@ -290,9 +284,9 @@ Tk_MessageObjCmd(clientData, interp, objc, objv)
*
* MessageWidgetObjCmd --
*
- * This procedure is invoked to process the Tcl command
- * that corresponds to a widget managed by this module.
- * See the user documentation for details on what it does.
+ * This function is invoked to process the Tcl command that corresponds
+ * to a widget managed by this module. See the user documentation for
+ * details on what it does.
*
* Results:
* A standard Tcl result.
@@ -304,19 +298,19 @@ Tk_MessageObjCmd(clientData, interp, objc, objv)
*/
static int
-MessageWidgetObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Information about message widget. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings. */
+MessageWidgetObjCmd(
+ ClientData clientData, /* Information about message widget. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
register Message *msgPtr = (Message *) clientData;
- static CONST char *optionStrings[] = { "cget", "configure", (char *) NULL };
+ static CONST char *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 ...?");
return TCL_ERROR;
@@ -328,43 +322,40 @@ MessageWidgetObjCmd(clientData, interp, objc, objv)
}
Tcl_Preserve((ClientData) msgPtr);
-
+
switch ((enum options) index) {
- case MESSAGE_CGET: {
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option");
+ case MESSAGE_CGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ result = TCL_ERROR;
+ } else {
+ objPtr = Tk_GetOptionValue(interp, (char *) msgPtr,
+ msgPtr->optionTable, objv[2], msgPtr->tkwin);
+ if (objPtr == NULL) {
result = TCL_ERROR;
} else {
- objPtr = Tk_GetOptionValue(interp, (char *) msgPtr,
- msgPtr->optionTable, objv[2], msgPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
}
- break;
}
- case MESSAGE_CONFIGURE: {
- if (objc <= 3) {
- objPtr = Tk_GetOptionInfo(interp, (char *) msgPtr,
- msgPtr->optionTable,
- (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
- msgPtr->tkwin);
- if (objPtr == NULL) {
- result = TCL_ERROR;
- } else {
- Tcl_SetObjResult(interp, objPtr);
- result = TCL_OK;
- }
+ break;
+ case MESSAGE_CONFIGURE:
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) msgPtr,
+ msgPtr->optionTable, (objc == 3) ? objv[2] : NULL,
+ msgPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
} else {
- result = ConfigureMessage(interp, msgPtr, objc-2, objv+2, 0);
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
}
- break;
+ } else {
+ result = ConfigureMessage(interp, msgPtr, objc-2, objv+2, 0);
}
+ break;
}
-
+
Tcl_Release((ClientData) msgPtr);
return result;
}
@@ -374,9 +365,9 @@ MessageWidgetObjCmd(clientData, interp, objc, objv)
*
* DestroyMessage --
*
- * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
- * to clean up the internal structure of a message at a safe time
- * (when no-one is using it anymore).
+ * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean
+ * up the internal structure of a message at a safe time (when no-one is
+ * using it anymore).
*
* Results:
* None.
@@ -388,8 +379,8 @@ MessageWidgetObjCmd(clientData, interp, objc, objv)
*/
static void
-DestroyMessage(memPtr)
- char *memPtr; /* Info about message widget. */
+DestroyMessage(
+ char *memPtr) /* Info about message widget. */
{
register Message *msgPtr = (Message *) memPtr;
@@ -399,11 +390,10 @@ DestroyMessage(memPtr)
if (msgPtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(DisplayMessage, (ClientData) msgPtr);
}
-
+
/*
- * Free up all the stuff that requires special handling, then
- * let Tk_FreeConfigOptions handle all the standard option-related
- * stuff.
+ * Free up all the stuff that requires special handling, then let
+ * Tk_FreeConfigOptions handle all the standard option-related stuff.
*/
if (msgPtr->textGC != None) {
@@ -427,30 +417,29 @@ DestroyMessage(memPtr)
*
* ConfigureMessage --
*
- * This procedure is called to process an argv/argc list, plus
- * the Tk option database, in order to configure (or
- * reconfigure) a message widget.
+ * This function is called to process an argv/argc list, plus the Tk
+ * option database, in order to configure (or reconfigure) a message
+ * widget.
*
* Results:
- * The return value is a standard Tcl result. If TCL_ERROR is
- * returned, then the interp's result contains an error message.
+ * The return value is a standard Tcl result. If TCL_ERROR is returned,
+ * then the interp's result contains an error message.
*
* Side effects:
- * Configuration information, such as text string, colors, font,
- * etc. get set for msgPtr; old resources get freed, if there
- * were any.
+ * Configuration information, such as text string, colors, font, etc. get
+ * set for msgPtr; old resources get freed, if there were any.
*
*----------------------------------------------------------------------
*/
static int
-ConfigureMessage(interp, msgPtr, objc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- register Message *msgPtr; /* Information about widget; may or may
- * not already have values for some fields. */
- int objc; /* Number of valid entries in argv. */
- Tcl_Obj *CONST objv[]; /* Arguments. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ConfigureMessage(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ 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. */
+ int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
@@ -459,22 +448,21 @@ ConfigureMessage(interp, msgPtr, objc, objv, flags)
*/
if (msgPtr->textVarName != NULL) {
- Tcl_UntraceVar(interp, msgPtr->textVarName,
+ Tcl_UntraceVar(interp, msgPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MessageTextVarProc, (ClientData) msgPtr);
}
if (Tk_SetOptions(interp, (char *) msgPtr, msgPtr->optionTable, objc, objv,
- msgPtr->tkwin, &savedOptions, (int *)NULL) != TCL_OK) {
+ msgPtr->tkwin, &savedOptions, NULL) != TCL_OK) {
Tk_RestoreSavedOptions(&savedOptions);
return TCL_ERROR;
}
-
-
+
/*
- * If the message is to display the value of a variable, then set up
- * a trace on the variable's value, create the variable if it doesn't
- * exist, and fetch its current value.
+ * If the message is to display the value of a variable, then set up a
+ * trace on the variable's value, create the variable if it doesn't exist,
+ * and fetch its current value.
*/
if (msgPtr->textVarName != NULL) {
@@ -496,9 +484,9 @@ ConfigureMessage(interp, msgPtr, objc, objv, flags)
}
/*
- * A few other options need special processing, such as setting
- * the background from a 3-D border or handling special defaults
- * that couldn't be specified to Tk_ConfigureWidget.
+ * A few other options need special processing, such as setting the
+ * background from a 3-D border or handling special defaults that couldn't
+ * be specified to Tk_ConfigureWidget.
*/
msgPtr->numChars = Tcl_NumUtfChars(msgPtr->string, -1);
@@ -517,22 +505,22 @@ ConfigureMessage(interp, msgPtr, objc, objv, flags)
*
* MessageWorldChanged --
*
- * This procedure is called when the world has changed in some
- * way and the widget needs to recompute all its graphics contexts
- * and determine its new geometry.
+ * This function is called when the world has changed in some way and the
+ * widget needs to recompute all its graphics contexts and determine its
+ * new geometry.
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * Message will be relayed out and redisplayed.
+ * Message will be relayed out and redisplayed.
*
*---------------------------------------------------------------------------
*/
-
+
static void
-MessageWorldChanged(instanceData)
- ClientData instanceData; /* Information about widget. */
+MessageWorldChanged(
+ ClientData instanceData) /* Information about widget. */
{
XGCValues gcValues;
GC gc = None;
@@ -562,8 +550,8 @@ MessageWorldChanged(instanceData)
}
/*
- * Recompute the desired geometry for the window, and arrange for
- * the window to be redisplayed.
+ * Recompute the desired geometry for the window, and arrange for the
+ * window to be redisplayed.
*/
ComputeMessageGeometry(msgPtr);
@@ -579,23 +567,22 @@ MessageWorldChanged(instanceData)
*
* ComputeMessageGeometry --
*
- * Compute the desired geometry for a message window,
- * taking into account the desired aspect ratio for the
- * window.
+ * Compute the desired geometry for a message window, taking into account
+ * the desired aspect ratio for the window.
*
* Results:
* None.
*
* Side effects:
- * Tk_GeometryRequest is called to inform the geometry
- * manager of the desired geometry for this window.
+ * Tk_GeometryRequest is called to inform the geometry manager of the
+ * desired geometry for this window.
*
*--------------------------------------------------------------
*/
static void
-ComputeMessageGeometry(msgPtr)
- register Message *msgPtr; /* Information about window. */
+ComputeMessageGeometry(
+ register Message *msgPtr) /* Information about window. */
{
int width, inc, height;
int thisWidth, thisHeight, maxWidth;
@@ -617,12 +604,11 @@ ComputeMessageGeometry(msgPtr)
upperBound = msgPtr->aspect + aspect;
/*
- * Do the computation in multiple passes: start off with
- * a very wide window, and compute its height. Then change
- * the width and try again. Reduce the size of the change
- * and iterate until dimensions are found that approximate
- * the desired aspect ratio. Or, if the user gave an explicit
- * width then just use that.
+ * Do the computation in multiple passes: start off with a very wide
+ * window, and compute its height. Then change the width and try again.
+ * Reduce the size of the change and iterate until dimensions are found
+ * that approximate the desired aspect ratio. Or, if the user gave an
+ * explicit width then just use that.
*/
if (msgPtr->width > 0) {
@@ -665,7 +651,7 @@ ComputeMessageGeometry(msgPtr)
*
* DisplayMessage --
*
- * This procedure redraws the contents of a message window.
+ * This function redraws the contents of a message window.
*
* Results:
* None.
@@ -677,8 +663,8 @@ ComputeMessageGeometry(msgPtr)
*/
static void
-DisplayMessage(clientData)
- ClientData clientData; /* Information about window. */
+DisplayMessage(
+ ClientData clientData) /* Information about window. */
{
register Message *msgPtr = (Message *) clientData;
register Tk_Window tkwin = msgPtr->tkwin;
@@ -702,8 +688,8 @@ DisplayMessage(clientData)
0, TK_RELIEF_FLAT);
/*
- * Compute starting y-location for message based on message size
- * and anchor option.
+ * Compute starting y-location for message based on message size and
+ * anchor option.
*/
TkComputeAnchor(msgPtr->anchor, tkwin, msgPtr->padX, msgPtr->padY,
@@ -723,7 +709,7 @@ DisplayMessage(clientData)
bgGC = Tk_GCForColor(msgPtr->highlightBgColorPtr, Tk_WindowId(tkwin));
if (msgPtr->flags & GOT_FOCUS) {
- fgGC = Tk_GCForColor(msgPtr->highlightColorPtr, Tk_WindowId(tkwin));
+ fgGC = Tk_GCForColor(msgPtr->highlightColorPtr,Tk_WindowId(tkwin));
TkpDrawHighlightBorder(tkwin, fgGC, bgGC, msgPtr->highlightWidth,
Tk_WindowId(tkwin));
} else {
@@ -738,23 +724,23 @@ DisplayMessage(clientData)
*
* MessageEventProc --
*
- * This procedure is invoked by the Tk dispatcher for various
- * events on messages.
+ * This function is invoked by the Tk dispatcher for various events on
+ * messages.
*
* 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.
*
*--------------------------------------------------------------
*/
static void
-MessageEventProc(clientData, eventPtr)
- ClientData clientData; /* Information about window. */
- XEvent *eventPtr; /* Information about event. */
+MessageEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
{
Message *msgPtr = (Message *) clientData;
@@ -780,7 +766,7 @@ MessageEventProc(clientData, eventPtr)
}
return;
- redraw:
+ redraw:
if ((msgPtr->tkwin != NULL) && !(msgPtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr);
msgPtr->flags |= REDRAW_PENDING;
@@ -792,9 +778,9 @@ MessageEventProc(clientData, eventPtr)
*
* MessageCmdDeletedProc --
*
- * This procedure is invoked when a widget command is deleted. If
- * the widget isn't already in the process of being destroyed,
- * this command destroys it.
+ * This function is invoked when a widget command is deleted. If the
+ * widget isn't already in the process of being destroyed, this command
+ * destroys it.
*
* Results:
* None.
@@ -806,16 +792,16 @@ MessageEventProc(clientData, eventPtr)
*/
static void
-MessageCmdDeletedProc(clientData)
- ClientData clientData; /* Pointer to widget record for widget. */
+MessageCmdDeletedProc(
+ ClientData clientData) /* Pointer to widget record for widget. */
{
Message *msgPtr = (Message *) clientData;
/*
- * This procedure could be invoked either because the window was
- * destroyed and the command was then deleted (in which case tkwin
- * is NULL) or because the command was deleted, and then this procedure
- * destroys the widget.
+ * This function could be invoked either because the window was destroyed
+ * and the command was then deleted (in which case tkwin is NULL) or
+ * because the command was deleted, and then this function destroys the
+ * widget.
*/
if (!(msgPtr->flags & MESSAGE_DELETED)) {
@@ -828,34 +814,33 @@ MessageCmdDeletedProc(clientData)
*
* MessageTextVarProc --
*
- * This procedure is invoked when someone changes the variable
- * whose contents are to be displayed in a message.
+ * This function is invoked when someone changes the variable whose
+ * contents are to be displayed in a message.
*
* Results:
* NULL is always returned.
*
* Side effects:
- * The text displayed in the message will change to match the
- * variable.
+ * The text displayed in the message will change to match the variable.
*
*--------------------------------------------------------------
*/
/* ARGSUSED */
static char *
-MessageTextVarProc(clientData, interp, name1, name2, flags)
- 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. */
- int flags; /* Information about what happened. */
+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. */
+ int flags) /* Information about what happened. */
{
register Message *msgPtr = (Message *) clientData;
CONST char *value;
/*
- * If the variable is unset, then immediately recreate it unless
- * the whole interpreter is going away.
+ * If the variable is unset, then immediately recreate it unless the whole
+ * interpreter is going away.
*/
if (flags & TCL_TRACE_UNSETS) {
@@ -866,7 +851,7 @@ MessageTextVarProc(clientData, interp, name1, name2, flags)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MessageTextVarProc, clientData);
}
- return (char *) NULL;
+ return NULL;
}
value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY);
@@ -886,5 +871,13 @@ MessageTextVarProc(clientData, interp, name1, name2, flags)
Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr);
msgPtr->flags |= REDRAW_PENDING;
}
- return (char *) NULL;
+ return NULL;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 291c70d..d973bd4 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -1,13 +1,12 @@
-/*
+/*
* tkObj.c --
*
- * This file contains procedures that implement the common Tk object
- * types
+ * This file contains functions that implement the common Tk object types
*
* Copyright (c) 1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkInt.h"
@@ -15,7 +14,7 @@
/*
* The following structure is the internal representation for pixel objects.
*/
-
+
typedef struct PixelRep {
double value;
int units;
@@ -27,11 +26,11 @@ typedef struct PixelRep {
((objPtr)->internalRep.twoPtrValue.ptr2 == 0)
#define SET_SIMPLEPIXEL(objPtr, intval) \
- (objPtr)->internalRep.twoPtrValue.ptr1 = (VOID *) (intval); \
+ (objPtr)->internalRep.twoPtrValue.ptr1 = INT2PTR(intval); \
(objPtr)->internalRep.twoPtrValue.ptr2 = 0
#define GET_SIMPLEPIXEL(objPtr) \
- ((int) (objPtr)->internalRep.twoPtrValue.ptr1)
+ (PTR2INT((objPtr)->internalRep.twoPtrValue.ptr1))
#define SET_COMPLEXPIXEL(objPtr, repPtr) \
(objPtr)->internalRep.twoPtrValue.ptr1 = 0; \
@@ -44,7 +43,7 @@ typedef struct PixelRep {
/*
* The following structure is the internal representation for mm objects.
*/
-
+
typedef struct MMRep {
double value;
int units;
@@ -54,41 +53,36 @@ typedef struct MMRep {
/*
* The following structure is the internal representation for window objects.
- * A WindowRep caches name-to-window lookups. The cache is invalid
- * if tkwin is NULL or if mainPtr->deletionEpoch does not match epoch.
+ * A WindowRep caches name-to-window lookups. The cache is invalid if tkwin is
+ * NULL or if mainPtr->deletionEpoch does not match epoch.
*/
+
typedef struct WindowRep {
- Tk_Window tkwin; /* Cached window; NULL if not found */
- TkMainInfo *mainPtr; /* MainWindow associated with tkwin */
+ Tk_Window tkwin; /* Cached window; NULL if not found. */
+ TkMainInfo *mainPtr; /* MainWindow associated with tkwin. */
long epoch; /* Value of mainPtr->deletionEpoch at last
- * successful lookup. */
+ * successful lookup. */
} WindowRep;
/*
- * Prototypes for procedures defined later in this file:
+ * Prototypes for functions defined later in this file:
*/
-static void DupMMInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
- Tcl_Obj *copyPtr));
-static void DupPixelInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
- Tcl_Obj *copyPtr));
-static void DupWindowInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
- Tcl_Obj *copyPtr));
-static void FreeMMInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
-static void FreePixelInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
-static void FreeWindowInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
-static void UpdateStringOfMM _ANSI_ARGS_((Tcl_Obj *objPtr));
-static int SetMMFromAny _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr));
-static int SetPixelFromAny _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr));
-static int SetWindowFromAny _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *objPtr));
+static void DupMMInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr);
+static void DupPixelInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr);
+static void DupWindowInternalRep(Tcl_Obj *srcPtr,Tcl_Obj *copyPtr);
+static void FreeMMInternalRep(Tcl_Obj *objPtr);
+static void FreePixelInternalRep(Tcl_Obj *objPtr);
+static void FreeWindowInternalRep(Tcl_Obj *objPtr);
+static void UpdateStringOfMM(Tcl_Obj *objPtr);
+static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
+static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
+static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
/*
- * The following structure defines the implementation of the "pixel"
- * Tcl object, used for measuring distances. The pixel object remembers
- * its initial display-independant settings.
+ * The following structure defines the implementation of the "pixel" Tcl
+ * object, used for measuring distances. The pixel object remembers its
+ * initial display-independant settings.
*/
static Tcl_ObjType pixelObjType = {
@@ -100,9 +94,9 @@ static Tcl_ObjType pixelObjType = {
};
/*
- * The following structure defines the implementation of the "pixel"
- * Tcl object, used for measuring distances. The pixel object remembers
- * its initial display-independant settings.
+ * The following structure defines the implementation of the "pixel" Tcl
+ * object, used for measuring distances. The pixel object remembers its
+ * initial display-independant settings.
*/
static Tcl_ObjType mmObjType = {
@@ -119,23 +113,21 @@ static Tcl_ObjType mmObjType = {
*/
static Tcl_ObjType windowObjType = {
- "window", /* name */
- FreeWindowInternalRep, /* freeIntRepProc */
- DupWindowInternalRep, /* dupIntRepProc */
- NULL, /* updateStringProc */
- SetWindowFromAny /* setFromAnyProc */
+ "window", /* name */
+ FreeWindowInternalRep, /* freeIntRepProc */
+ DupWindowInternalRep, /* dupIntRepProc */
+ NULL, /* updateStringProc */
+ SetWindowFromAny /* setFromAnyProc */
};
-
-
/*
*----------------------------------------------------------------------
*
- * Tk_GetPixelsFromObj --
+ * GetPixelsFromObjEx --
*
* Attempt to return a pixel value from the Tcl object "objPtr". If the
- * object is not already a pixel value, an attempt will be made to convert
- * it to one.
+ * object is not already a pixel value, an attempt will be made to
+ * convert it to one.
*
* Results:
* The return value is a standard Tcl object result. If an error occurs
@@ -143,38 +135,56 @@ static Tcl_ObjType windowObjType = {
* result unless "interp" is NULL.
*
* Side effects:
- * If the object is not already a pixel, the conversion will free
- * any old internal representation.
+ * If the object is not already a pixel, the conversion will free any old
+ * internal representation.
*
*----------------------------------------------------------------------
*/
+static
int
-Tk_GetPixelsFromObj(interp, tkwin, objPtr, intPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tk_Window tkwin;
- Tcl_Obj *objPtr; /* The object from which to get pixels. */
- int *intPtr; /* Place to store resulting pixels. */
+GetPixelsFromObjEx(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr, /* The object from which to get pixels. */
+ int *intPtr,
+ double *dblPtr) /* Places to store resulting pixels. */
{
- int result;
+ int result,fresh;
double d;
PixelRep *pixelPtr;
static double bias[] = {
- 1.0, 10.0, 25.4, 25.4 / 72.0
+ 1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/
};
+ retry:
if (objPtr->typePtr != &pixelObjType) {
result = SetPixelFromAny(interp, objPtr);
if (result != TCL_OK) {
return result;
}
+ fresh=1;
+ } else {
+ fresh=0;
}
if (SIMPLE_PIXELREP(objPtr)) {
*intPtr = GET_SIMPLEPIXEL(objPtr);
+ if (dblPtr) {
+ *dblPtr=(double)(*intPtr);
+ }
} else {
pixelPtr = GET_COMPLEXPIXEL(objPtr);
- if (pixelPtr->tkwin != tkwin) {
+ if ((!fresh) && (pixelPtr->tkwin != tkwin))
+ {
+ /* in case of exo-screen conversions of non-pixels
+ * we force a recomputation from the string
+ */
+
+ FreePixelInternalRep(objPtr);
+ goto retry;
+ }
+ if ((pixelPtr->tkwin != tkwin)||dblPtr) {
d = pixelPtr->value;
if (pixelPtr->units >= 0) {
d *= bias[pixelPtr->units] * WidthOfScreen(Tk_Screen(tkwin));
@@ -186,9 +196,91 @@ Tk_GetPixelsFromObj(interp, tkwin, objPtr, intPtr)
pixelPtr->returnValue = (int) (d + 0.5);
}
pixelPtr->tkwin = tkwin;
+ if (dblPtr) {
+ *dblPtr=(double)d;
+ }
+ }
+ *intPtr = pixelPtr->returnValue;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetPixelsFromObj --
+ *
+ * Attempt to return a pixel value from the Tcl object "objPtr". If the
+ * object is not already a pixel value, an attempt will be made to
+ * convert it to one.
+ *
+ * Results:
+ * The return value is a standard Tcl object result. If an error occurs
+ * during conversion, an error message is left in the interpreter's
+ * result unless "interp" is NULL.
+ *
+ * Side effects:
+ * If the object is not already a pixel, the conversion will free any old
+ * internal representation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_GetPixelsFromObj(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr, /* The object from which to get pixels. */
+ int *intPtr) /* Place to store resulting pixels. */
+{
+ return GetPixelsFromObjEx(interp,tkwin,objPtr,intPtr,NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetDoublePixelsFromObj --
+ *
+ * Attempt to return a double pixel value from the Tcl object
+ * "objPtr". If the object is not already a pixel value, an attempt will
+ * be made to convert it to one, the internal unit being pixels.
+ *
+ * Results:
+ * The return value is a standard Tcl object result. If an error occurs
+ * during conversion, an error message is left in the interpreter's
+ * result unless "interp" is NULL.
+ *
+ * Side effects:
+ * If the object is not already a pixel, the conversion will free any old
+ * internal representation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_GetDoublePixelsFromObj(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr, /* The object from which to get pixels. */
+ double *doublePtr) /* Place to store resulting pixels. */
+{
+ double d;
+ int result,val;
+
+ result=GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d);
+ if (result != TCL_OK) {
+ return result;
+ }
+ if (!SIMPLE_PIXELREP(objPtr)) {
+ PixelRep *pixelPtr;
+ pixelPtr = GET_COMPLEXPIXEL(objPtr);
+ if (pixelPtr->units >= 0) {
+ /* internally "shimmer" to pixel units */
+ pixelPtr->units=-1;
+ pixelPtr->value=d;
}
- *intPtr = pixelPtr->returnValue;
}
+ *doublePtr = d;
return TCL_OK;
}
@@ -204,18 +296,18 @@ Tk_GetPixelsFromObj(interp, tkwin, objPtr, intPtr)
* None.
*
* Side effects:
- * Frees objPtr's internal representation and sets objPtr's
- * internalRep to NULL.
+ * Frees objPtr's internal representation and sets objPtr's internalRep
+ * to NULL.
*
*----------------------------------------------------------------------
*/
static void
-FreePixelInternalRep(objPtr)
- Tcl_Obj *objPtr; /* Pixel object with internal rep to free. */
+FreePixelInternalRep(
+ Tcl_Obj *objPtr) /* Pixel object with internal rep to free. */
{
PixelRep *pixelPtr;
-
+
if (!SIMPLE_PIXELREP(objPtr)) {
pixelPtr = GET_COMPLEXPIXEL(objPtr);
ckfree((char *) pixelPtr);
@@ -229,26 +321,26 @@ FreePixelInternalRep(objPtr)
*
* DupPixelInternalRep --
*
- * Initialize the internal representation of a pixel Tcl_Obj to a
- * copy of the internal representation of an existing pixel object.
+ * Initialize the internal representation of a pixel Tcl_Obj to a copy of
+ * the internal representation of an existing pixel object.
*
* Results:
* None.
*
* Side effects:
- * copyPtr's internal rep is set to the pixel corresponding to
- * srcPtr's internal rep.
+ * copyPtr's internal rep is set to the pixel corresponding to srcPtr's
+ * internal rep.
*
*----------------------------------------------------------------------
*/
static void
-DupPixelInternalRep(srcPtr, copyPtr)
- register Tcl_Obj *srcPtr; /* Object with internal rep to copy. */
- register Tcl_Obj *copyPtr; /* Object with internal rep to set. */
+DupPixelInternalRep(
+ register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
+ register Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
PixelRep *oldPtr, *newPtr;
-
+
copyPtr->typePtr = srcPtr->typePtr;
if (SIMPLE_PIXELREP(srcPtr)) {
@@ -269,8 +361,7 @@ DupPixelInternalRep(srcPtr, copyPtr)
*
* SetPixelFromAny --
*
- * Attempt to generate a pixel internal form for the Tcl object
- * "objPtr".
+ * Attempt to generate a pixel internal form for the Tcl object "objPtr".
*
* Results:
* The return value is a standard Tcl result. If an error occurs during
@@ -278,70 +369,54 @@ DupPixelInternalRep(srcPtr, copyPtr)
* unless "interp" is NULL.
*
* Side effects:
- * If no error occurs, a pixel representation of the object is
- * stored internally and the type of "objPtr" is set to pixel.
+ * If no error occurs, a pixel representation of the object is stored
+ * internally and the type of "objPtr" is set to pixel.
*
*----------------------------------------------------------------------
*/
static int
-SetPixelFromAny(interp, objPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tcl_Obj *objPtr; /* The object to convert. */
+SetPixelFromAny(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
char *string, *rest;
double d;
int i, units;
- PixelRep *pixelPtr;
string = Tcl_GetStringFromObj(objPtr, NULL);
d = strtod(string, &rest);
if (rest == string) {
- /*
- * Must copy string before resetting the result in case a caller
- * is trying to convert the interpreter's result to pixels.
- */
-
- char buf[100];
-
- error:
- sprintf(buf, "bad screen distance \"%.50s\"", string);
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, buf, NULL);
- return TCL_ERROR;
+ goto error;
}
while ((*rest != '\0') && isspace(UCHAR(*rest))) {
rest++;
}
- switch (*rest) {
- case '\0':
- units = -1;
- break;
-
- case 'm':
- units = 0;
- break;
-
- case 'c':
- units = 1;
- break;
- case 'i':
- units = 2;
- break;
-
- case 'p':
- units = 3;
- break;
-
- default:
- goto error;
+ switch (*rest) {
+ case '\0':
+ units = -1;
+ break;
+ case 'm':
+ units = 0;
+ break;
+ case 'c':
+ units = 1;
+ break;
+ case 'i':
+ units = 2;
+ break;
+ case 'p':
+ units = 3;
+ break;
+ default:
+ goto error;
}
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
typePtr = objPtr->typePtr;
@@ -355,7 +430,8 @@ SetPixelFromAny(interp, objPtr)
if ((units < 0) && (i == d)) {
SET_SIMPLEPIXEL(objPtr, i);
} else {
- pixelPtr = (PixelRep *) ckalloc(sizeof(PixelRep));
+ PixelRep *pixelPtr = (PixelRep *) ckalloc(sizeof(PixelRep));
+
pixelPtr->value = d;
pixelPtr->units = units;
pixelPtr->tkwin = NULL;
@@ -363,6 +439,21 @@ SetPixelFromAny(interp, objPtr)
SET_COMPLEXPIXEL(objPtr, pixelPtr);
}
return TCL_OK;
+
+ 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);
+ }
+ return TCL_ERROR;
}
/*
@@ -380,24 +471,24 @@ SetPixelFromAny(interp, objPtr)
* result unless "interp" is NULL.
*
* Side effects:
- * If the object is not already a pixel, the conversion will free
- * any old internal representation.
+ * If the object is not already a pixel, the conversion will free any old
+ * internal representation.
*
*----------------------------------------------------------------------
*/
int
-Tk_GetMMFromObj(interp, tkwin, objPtr, doublePtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tk_Window tkwin;
- Tcl_Obj *objPtr; /* The object from which to get mms. */
- double *doublePtr; /* Place to store resulting millimeters. */
+Tk_GetMMFromObj(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tk_Window tkwin,
+ Tcl_Obj *objPtr, /* The object from which to get mms. */
+ double *doublePtr) /* Place to store resulting millimeters. */
{
int result;
double d;
MMRep *mmPtr;
static double bias[] = {
- 10.0, 25.4, 1.0, 25.4 / 72.0
+ 10.0, 25.4, 1.0, 0.35278 /*25.4 / 72.0*/
};
if (objPtr->typePtr != &mmObjType) {
@@ -436,15 +527,15 @@ Tk_GetMMFromObj(interp, tkwin, objPtr, doublePtr)
* None.
*
* Side effects:
- * Frees objPtr's internal representation and sets objPtr's
- * internalRep to NULL.
+ * Frees objPtr's internal representation and sets objPtr's internalRep
+ * to NULL.
*
*----------------------------------------------------------------------
*/
static void
-FreeMMInternalRep(objPtr)
- Tcl_Obj *objPtr; /* MM object with internal rep to free. */
+FreeMMInternalRep(
+ Tcl_Obj *objPtr) /* MM object with internal rep to free. */
{
ckfree((char *) objPtr->internalRep.otherValuePtr);
objPtr->internalRep.otherValuePtr = NULL;
@@ -456,26 +547,26 @@ FreeMMInternalRep(objPtr)
*
* DupMMInternalRep --
*
- * Initialize the internal representation of a pixel Tcl_Obj to a
- * copy of the internal representation of an existing pixel object.
+ * Initialize the internal representation of a pixel Tcl_Obj to a copy of
+ * the internal representation of an existing pixel object.
*
* Results:
* None.
*
* Side effects:
- * copyPtr's internal rep is set to the pixel corresponding to
- * srcPtr's internal rep.
+ * copyPtr's internal rep is set to the pixel corresponding to srcPtr's
+ * internal rep.
*
*----------------------------------------------------------------------
*/
static void
-DupMMInternalRep(srcPtr, copyPtr)
- register Tcl_Obj *srcPtr; /* Object with internal rep to copy. */
- register Tcl_Obj *copyPtr; /* Object with internal rep to set. */
+DupMMInternalRep(
+ register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */
+ register Tcl_Obj *copyPtr) /* Object with internal rep to set. */
{
MMRep *oldPtr, *newPtr;
-
+
copyPtr->typePtr = srcPtr->typePtr;
oldPtr = (MMRep *) srcPtr->internalRep.otherValuePtr;
newPtr = (MMRep *) ckalloc(sizeof(MMRep));
@@ -491,24 +582,23 @@ DupMMInternalRep(srcPtr, copyPtr)
*
* UpdateStringOfMM --
*
- * Update the string representation for a pixel Tcl_Obj
- * this function is only called, if the pixel Tcl_Obj has no unit,
- * because with units the string representation is created by
- * SetMMFromAny
+ * Update the string representation for a pixel Tcl_Obj this function is
+ * only called, if the pixel Tcl_Obj has no unit, because with units the
+ * string representation is created by SetMMFromAny
*
* Results:
- * None.
+ * None.
*
* Side effects:
- * The object's string is set to a valid string that results from
- * the double-to-string conversion.
+ * The object's string is set to a valid string that results from the
+ * double-to-string conversion.
*
*----------------------------------------------------------------------
*/
static void
-UpdateStringOfMM(objPtr)
- register Tcl_Obj *objPtr; /* pixel obj with string rep to update. */
+UpdateStringOfMM(
+ register Tcl_Obj *objPtr) /* pixel obj with string rep to update. */
{
MMRep *mmPtr;
char buffer[TCL_DOUBLE_SPACE];
@@ -517,11 +607,11 @@ UpdateStringOfMM(objPtr)
mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr;
/* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */
if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) {
- panic("UpdateStringOfMM: false precondition");
+ Tcl_Panic("UpdateStringOfMM: false precondition");
}
- Tcl_PrintDouble((Tcl_Interp *) NULL, mmPtr->value, buffer);
- len = strlen(buffer);
+ Tcl_PrintDouble(NULL, mmPtr->value, buffer);
+ len = (int)strlen(buffer);
objPtr->bytes = (char *) ckalloc((unsigned) len + 1);
strcpy(objPtr->bytes, buffer);
@@ -533,8 +623,7 @@ UpdateStringOfMM(objPtr)
*
* SetMMFromAny --
*
- * Attempt to generate a mm internal form for the Tcl object
- * "objPtr".
+ * Attempt to generate a mm internal form for the Tcl object "objPtr".
*
* Results:
* The return value is a standard Tcl result. If an error occurs during
@@ -542,30 +631,30 @@ UpdateStringOfMM(objPtr)
* unless "interp" is NULL.
*
* Side effects:
- * If no error occurs, a mm representation of the object is
- * stored internally and the type of "objPtr" is set to mm.
+ * If no error occurs, a mm representation of the object is stored
+ * internally and the type of "objPtr" is set to mm.
*
*----------------------------------------------------------------------
*/
static int
-SetMMFromAny(interp, objPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tcl_Obj *objPtr; /* The object to convert. */
+SetMMFromAny(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
char *string, *rest;
double d;
int units;
MMRep *mmPtr;
- static Tcl_ObjType *tclDoubleObjType = NULL;
- static Tcl_ObjType *tclIntObjType = NULL;
+ static const Tcl_ObjType *tclDoubleObjType = NULL;
+ static const Tcl_ObjType *tclIntObjType = NULL;
if (tclDoubleObjType == NULL) {
/*
- * Cache the object types for comaprison below.
- * This allows optimized checks for standard cases.
+ * Cache the object types for comaprison below. This allows optimized
+ * checks for standard cases.
*/
tclDoubleObjType = Tcl_GetObjType("double");
@@ -581,10 +670,11 @@ SetMMFromAny(interp, objPtr)
units = -1;
/*
- * In the case of ints, we need to ensure that a valid
- * string exists in order for int-but-not-string objects
- * to be converted back to ints again from mm obj types.
+ * In the case of ints, we need to ensure that a valid string exists
+ * in order for int-but-not-string objects to be converted back to
+ * ints again from mm obj types.
*/
+
(void) Tcl_GetStringFromObj(objPtr, NULL);
} else {
/*
@@ -600,42 +690,38 @@ SetMMFromAny(interp, objPtr)
* is trying to convert the interpreter's result to mms.
*/
- error:
- Tcl_AppendResult(interp, "bad screen distance \"", string,
- "\"", (char *) NULL);
- return TCL_ERROR;
- }
- while ((*rest != '\0') && isspace(UCHAR(*rest))) {
- rest++;
- }
- switch (*rest) {
- case '\0':
- units = -1;
- break;
-
- case 'c':
- units = 0;
- break;
-
- case 'i':
- units = 1;
- break;
-
- case 'm':
- units = 2;
- break;
-
- case 'p':
- units = 3;
- break;
-
- default:
- goto error;
+ error:
+ Tcl_AppendResult(interp, "bad screen distance \"", string,
+ "\"", NULL);
+ return TCL_ERROR;
+ }
+ while ((*rest != '\0') && isspace(UCHAR(*rest))) {
+ rest++;
+ }
+
+ switch (*rest) {
+ case '\0':
+ units = -1;
+ break;
+ case 'c':
+ units = 0;
+ break;
+ case 'i':
+ units = 1;
+ break;
+ case 'm':
+ units = 2;
+ break;
+ case 'p':
+ units = 3;
+ break;
+ default:
+ goto error;
}
}
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
typePtr = objPtr->typePtr;
@@ -671,18 +757,18 @@ SetMMFromAny(interp, objPtr)
* result unless "interp" is NULL.
*
* Side effects:
- * If the object is not already a Tk_Window, the conversion will free
- * any old internal representation.
+ * If the object is not already a Tk_Window, the conversion will free any
+ * old internal representation.
*
*----------------------------------------------------------------------
*/
int
-TkGetWindowFromObj(interp, tkwin, objPtr, windowPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- Tk_Window tkwin; /* A token to get the main window from. */
- Tcl_Obj *objPtr; /* The object from which to get window. */
- Tk_Window *windowPtr; /* Place to store resulting window. */
+TkGetWindowFromObj(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ Tk_Window tkwin, /* A token to get the main window from. */
+ Tcl_Obj *objPtr, /* The object from which to get window. */
+ Tk_Window *windowPtr) /* Place to store resulting window. */
{
TkMainInfo *mainPtr = ((TkWindow *)tkwin)->mainPtr;
register WindowRep *winPtr;
@@ -696,8 +782,8 @@ TkGetWindowFromObj(interp, tkwin, objPtr, windowPtr)
winPtr = (WindowRep *) objPtr->internalRep.otherValuePtr;
if ( winPtr->tkwin == NULL
|| winPtr->mainPtr == NULL
- || winPtr->mainPtr != mainPtr
- || winPtr->epoch != mainPtr->deletionEpoch)
+ || winPtr->mainPtr != mainPtr
+ || winPtr->epoch != mainPtr->deletionEpoch)
{
/* Cache is invalid.
*/
@@ -720,14 +806,15 @@ TkGetWindowFromObj(interp, tkwin, objPtr, windowPtr)
*----------------------------------------------------------------------
*
* SetWindowFromAny --
+ *
* Generate a windowObj internal form for the Tcl object "objPtr".
*
* Results:
- * Always returns TCL_OK.
+ * Always returns TCL_OK.
*
* Side effects:
- * Sets objPtr's internal representation to an uninitialized
- * windowObj. Frees the old internal representation, if any.
+ * Sets objPtr's internal representation to an uninitialized windowObj.
+ * Frees the old internal representation, if any.
*
* See also:
* TkGetWindowFromObj, which initializes the WindowRep cache.
@@ -736,15 +823,15 @@ TkGetWindowFromObj(interp, tkwin, objPtr, windowPtr)
*/
static int
-SetWindowFromAny(interp, objPtr)
- Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- register Tcl_Obj *objPtr; /* The object to convert. */
+SetWindowFromAny(
+ Tcl_Interp *interp, /* Used for error reporting if not NULL. */
+ register Tcl_Obj *objPtr) /* The object to convert. */
{
- Tcl_ObjType *typePtr;
+ const Tcl_ObjType *typePtr;
WindowRep *winPtr;
/*
- * Free the old internalRep before setting the new one.
+ * Free the old internalRep before setting the new one.
*/
Tcl_GetStringFromObj(objPtr, NULL);
@@ -769,23 +856,23 @@ SetWindowFromAny(interp, objPtr)
*
* DupWindowInternalRep --
*
- * Initialize the internal representation of a window Tcl_Obj to a
- * copy of the internal representation of an existing window object.
+ * Initialize the internal representation of a window Tcl_Obj to a copy
+ * of the internal representation of an existing window object.
*
* Results:
* None.
*
* Side effects:
- * copyPtr's internal rep is set to refer to the same window as
- * srcPtr's internal rep.
+ * copyPtr's internal rep is set to refer to the same window as srcPtr's
+ * internal rep.
*
*----------------------------------------------------------------------
*/
static void
-DupWindowInternalRep(srcPtr, copyPtr)
- register Tcl_Obj *srcPtr;
- register Tcl_Obj *copyPtr;
+DupWindowInternalRep(
+ register Tcl_Obj *srcPtr,
+ register Tcl_Obj *copyPtr)
{
register WindowRep *oldPtr, *newPtr;
@@ -810,15 +897,15 @@ DupWindowInternalRep(srcPtr, copyPtr)
* None.
*
* Side effects:
- * Frees objPtr's internal representation and sets objPtr's
- * internalRep to NULL.
+ * Frees objPtr's internal representation and sets objPtr's internalRep
+ * to NULL.
*
*----------------------------------------------------------------------
*/
static void
-FreeWindowInternalRep(objPtr)
- Tcl_Obj *objPtr; /* Window object with internal rep to free. */
+FreeWindowInternalRep(
+ Tcl_Obj *objPtr) /* Window object with internal rep to free. */
{
ckfree((char *) objPtr->internalRep.otherValuePtr);
objPtr->internalRep.otherValuePtr = NULL;
@@ -830,31 +917,31 @@ FreeWindowInternalRep(objPtr)
*
* TkParsePadAmount --
*
- * This procedure parses a padding specification and returns
- * the appropriate padding values. A padding specification can
- * be either a single pixel width, or a list of two pixel widths.
- * If a single pixel width, the amount specified is used for
- * padding on both sides. If two amounts are specified, then
- * they specify the left/right or top/bottom padding.
+ * This function parses a padding specification and returns the
+ * appropriate padding values. A padding specification can be either a
+ * single pixel width, or a list of two pixel widths. If a single pixel
+ * width, the amount specified is used for padding on both sides. If two
+ * amounts are specified, then they specify the left/right or top/bottom
+ * padding.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * An error message is written to the interpreter is something
- * is not right.
+ * An error message is written to the interpreter if something is not
+ * right.
*
*--------------------------------------------------------------
*/
int
-TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* A window. Needed by Tk_GetPixels() */
- Tcl_Obj *specObj; /* The argument to "-padx", "-pady", "-ipadx",
- * or "-ipady". The thing to be parsed. */
- int *halfPtr; /* Write the left/top part of padding here */
- int *allPtr; /* Write the total padding here */
+TkParsePadAmount(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Window tkwin, /* A window. Needed by Tk_GetPixels() */
+ Tcl_Obj *specObj, /* The argument to "-padx", "-pady", "-ipadx",
+ * or "-ipady". The thing to be parsed. */
+ int *halfPtr, /* Write the left/top part of padding here */
+ int *allPtr) /* Write the total padding here */
{
int firstInt, secondInt; /* The two components of the padding */
int objc; /* The length of the list (should be 1 or 2) */
@@ -870,7 +957,7 @@ TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad pad value \"",
Tcl_GetString(specObj),
- "\": must be positive screen distance", (char *) NULL);
+ "\": must be positive screen distance", NULL);
return TCL_ERROR;
}
secondInt = firstInt;
@@ -878,8 +965,8 @@ TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
}
/*
- * Pad specifications are a list of one or two elements, each of
- * which is a pixel specification.
+ * Pad specifications are a list of one or two elements, each of which is
+ * a pixel specification.
*/
if (Tcl_ListObjGetElements(interp, specObj, &objc, &objv) != TCL_OK) {
@@ -899,13 +986,13 @@ TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
(firstInt < 0)) {
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad pad value \"", Tcl_GetString(objv[0]),
- "\": must be positive screen distance", (char *) NULL);
+ "\": must be positive screen distance", NULL);
return TCL_ERROR;
}
/*
- * Parse the second part if it exists, otherwise it is as if it
- * was the same as the first part.
+ * Parse the second part if it exists, otherwise it is as if it was the
+ * same as the first part.
*/
if (objc == 1) {
@@ -915,7 +1002,7 @@ TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad 2nd pad value \"",
Tcl_GetString(objv[1]),
- "\": must be positive screen distance", (char *) NULL);
+ "\": must be positive screen distance", NULL);
return TCL_ERROR;
}
@@ -942,14 +1029,14 @@ TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
* None
*
* Side effects:
- * All instances of Tcl_ObjType structues used in Tk are registered
- * with Tcl.
+ * All instances of Tcl_ObjType structues used in Tk are registered with
+ * Tcl.
*
*----------------------------------------------------------------------
*/
void
-TkRegisterObjTypes()
+TkRegisterObjTypes(void)
{
Tcl_RegisterObjType(&tkBorderObjType);
Tcl_RegisterObjType(&tkBitmapObjType);
@@ -961,4 +1048,13 @@ TkRegisterObjTypes()
Tcl_RegisterObjType(&pixelObjType);
Tcl_RegisterObjType(&tkStateKeyObjType);
Tcl_RegisterObjType(&windowObjType);
+ Tcl_RegisterObjType(&tkTextIndexType);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index bbb673f..97ad5cb 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -1,106 +1,101 @@
-/*
+/*
* tkOldConfig.c --
*
- * This file contains the Tk_ConfigureWidget procedure. THIS FILE
- * IS HERE FOR BACKWARD COMPATIBILITY; THE NEW CONFIGURATION
- * PACKAGE SHOULD BE USED FOR NEW PROJECTS.
+ * This file contains the Tk_ConfigureWidget function. THIS FILE IS HERE
+ * FOR BACKWARD COMPATIBILITY; THE NEW CONFIGURATION PACKAGE SHOULD BE
+ * USED FOR NEW PROJECTS.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tkPort.h"
-#include "tk.h"
/*
- * Values for "flags" field of Tk_ConfigSpec structures. Be sure
- * to coordinate these values with those defined in tk.h
- * (TK_CONFIG_COLOR_ONLY, etc.). There must not be overlap!
+ * Values for "flags" field of Tk_ConfigSpec structures. Be sure to coordinate
+ * these values with those defined in tk.h (TK_CONFIG_COLOR_ONLY, etc.) There
+ * must not be overlap!
*
- * INIT - Non-zero means (char *) things have been
- * converted to Tk_Uid's.
+ * INIT - Non-zero means (char *) things have been converted to
+ * Tk_Uid's.
*/
#define INIT 0x20
/*
- * Forward declarations for procedures defined later in this file:
+ * Forward declarations for functions defined later in this file:
*/
-static int DoConfig _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specPtr,
- Tk_Uid value, int valueIsUid, char *widgRec));
-static Tk_ConfigSpec * FindConfigSpec _ANSI_ARGS_((Tcl_Interp *interp,
+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,
- int needFlags, int hateFlags));
-static char * FormatConfigInfo _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specPtr,
- char *widgRec));
-static CONST char * FormatConfigValue _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, Tk_ConfigSpec *specPtr,
- char *widgRec, char *buffer,
- Tcl_FreeProc **freeProcPtr));
-static Tk_ConfigSpec * GetCachedSpecs _ANSI_ARGS_((Tcl_Interp *interp,
- const Tk_ConfigSpec *staticSpecs));
-static void DeleteSpecCacheTable _ANSI_ARGS_((
- ClientData clientData, Tcl_Interp *interp));
+ 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,
+ char *buffer, Tcl_FreeProc **freeProcPtr);
+static Tk_ConfigSpec * GetCachedSpecs(Tcl_Interp *interp,
+ const Tk_ConfigSpec *staticSpecs);
+static void DeleteSpecCacheTable(ClientData clientData,
+ Tcl_Interp *interp);
/*
*--------------------------------------------------------------
*
* Tk_ConfigureWidget --
*
- * Process command-line options and database options to
- * fill in fields of a widget record with resources and
- * other parameters.
+ * Process command-line options and database options to fill in fields of
+ * a widget record with resources and other parameters.
*
* Results:
- * A standard Tcl return value. In case of an error,
- * the interp's result will hold an error message.
+ * A standard Tcl return value. In case of an error, the interp's result
+ * will hold an error message.
*
* Side effects:
- * The fields of widgRec get filled in with information from
- * argc/argv and the option database. Old information in
- * widgRec's fields gets recycled. A copy of the spec-table is
- * taken with (some of) the char* *fields converted into Tk_Uid
- * fields; this copy will be released when *the interpreter
- * terminates.
+ * The fields of widgRec get filled in with information from argc/argv
+ * and the option database. Old information in widgRec's fields gets
+ * recycled. A copy of the spec-table is taken with (some of) the char*
+ * fields converted into Tk_Uid fields; this copy will be released when
+ * the interpreter terminates.
*
*--------------------------------------------------------------
*/
int
-Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* Window containing widget (needed to
- * set up X resources). */
- Tk_ConfigSpec *origSpecs; /* Describes legal options. */
- int argc; /* Number of elements in argv. */
- 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 be present in config specs
- * for them to be considered. Also,
- * may have TK_CONFIG_ARGV_ONLY set. */
+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. */
+ int argc, /* Number of elements in argv. */
+ 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
+ * be present in config specs for them to be
+ * considered. Also, may have
+ * TK_CONFIG_ARGV_ONLY set. */
{
- register Tk_ConfigSpec *specs, *specPtr, *origSpecPtr;
+ register Tk_ConfigSpec *specPtr;
Tk_Uid value; /* Value of option from database. */
- int needFlags; /* Specs must contain this set of flags
- * or else they are not considered. */
- int hateFlags; /* If a spec contains any bits here, it's
- * not considered. */
+ int needFlags; /* Specs must contain this set of flags or
+ * else they are not considered. */
+ int hateFlags; /* If a spec contains any bits here, it's not
+ * considered. */
if (tkwin == NULL) {
/*
* Either we're not really in Tk, or the main window was destroyed and
* we're on our way out of the application
*/
- Tcl_AppendResult(interp, "NULL main window", (char *)NULL);
+
+ Tcl_AppendResult(interp, "NULL main window", NULL);
return TCL_ERROR;
}
@@ -112,19 +107,14 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
}
/*
- * Get the build of the config for this interpreter and reset any
- * indication of changed options.
+ * Get the build of the config for this interpreter.
*/
- specs = GetCachedSpecs(interp, origSpecs);
-
- for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) {
- specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED;
- }
+ specs = GetCachedSpecs(interp, specs);
/*
- * Pass one: scan through all of the arguments, processing those
- * that match entries in the specs.
+ * Pass one: scan through all of the arguments, processing those that
+ * match entries in the specs.
*/
for ( ; argc > 0; argc -= 2, argv += 2) {
@@ -145,8 +135,7 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
*/
if (argc < 2) {
- Tcl_AppendResult(interp, "value for \"", arg,
- "\" missing", (char *) NULL);
+ Tcl_AppendResult(interp, "value for \"", arg, "\" missing", NULL);
return TCL_ERROR;
}
if (flags & TK_CONFIG_OBJS) {
@@ -162,25 +151,15 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
Tcl_AddErrorInfo(interp, msg);
return TCL_ERROR;
}
- specPtr->specFlags |= TK_CONFIG_OPTION_SPECIFIED;
- }
-
- /*
- * Thread Unsafe! For compatibility through 8.4.x, we set the original
- * specPtr flags to indicate changed options. This has been removed
- * from 8.5. Switch to Tcl_Obj-based options instead. [Bug 749908]
- */
-
- for (origSpecPtr = origSpecs, specPtr = specs;
- specPtr->type != TK_CONFIG_END; origSpecPtr++, specPtr++) {
- origSpecPtr->specFlags = specPtr->specFlags;
+ if (!(flags & TK_CONFIG_ARGV_ONLY)) {
+ specPtr->specFlags |= TK_CONFIG_OPTION_SPECIFIED;
+ }
}
/*
- * Pass two: scan through all of the specs again; if no
- * command-line argument matched a spec, then check for info
- * in the option database. If there was nothing in the
- * database, then use the default.
+ * Pass two: scan through all of the specs again; if no command-line
+ * argument matched a spec, then check for info in the option database.
+ * If there was nothing in the database, then use the default.
*/
if (!(flags & TK_CONFIG_ARGV_ONLY)) {
@@ -188,6 +167,7 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
if ((specPtr->specFlags & TK_CONFIG_OPTION_SPECIFIED)
|| (specPtr->argvName == NULL)
|| (specPtr->type == TK_CONFIG_SYNONYM)) {
+ specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED;
continue;
}
if (((specPtr->specFlags & needFlags) != needFlags)
@@ -241,13 +221,13 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
*
* FindConfigSpec --
*
- * Search through a table of configuration specs, looking for
- * one that matches a given argvName.
+ * Search through a table of configuration specs, looking for one that
+ * matches a given argvName.
*
* Results:
- * The return value is a pointer to the matching entry, or NULL
- * if nothing matched. In that case an error message is left
- * in the interp's result.
+ * The return value is a pointer to the matching entry, or NULL if
+ * nothing matched. In that case an error message is left in the interp's
+ * result.
*
* Side effects:
* None.
@@ -256,16 +236,16 @@ Tk_ConfigureWidget(interp, tkwin, origSpecs, argc, argv, widgRec, flags)
*/
static Tk_ConfigSpec *
-FindConfigSpec(interp, specs, argvName, needFlags, hateFlags)
- Tcl_Interp *interp; /* Used for reporting errors. */
- Tk_ConfigSpec *specs; /* Pointer to table of configuration
+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
+ int needFlags, /* Flags that must be present in matching
+ * entry. */
+ int hateFlags) /* Flags that must NOT be present in matching
* entry. */
- int hateFlags; /* Flags that must NOT be present in
- * matching entry. */
{
register Tk_ConfigSpec *specPtr;
register char c; /* First character of current argument. */
@@ -293,34 +273,32 @@ FindConfigSpec(interp, specs, argvName, needFlags, hateFlags)
}
if (matchPtr != NULL) {
Tcl_AppendResult(interp, "ambiguous option \"", argvName,
- "\"", (char *) NULL);
- return (Tk_ConfigSpec *) NULL;
+ "\"", NULL);
+ return NULL;
}
matchPtr = specPtr;
}
if (matchPtr == NULL) {
- Tcl_AppendResult(interp, "unknown option \"", argvName,
- "\"", (char *) NULL);
- return (Tk_ConfigSpec *) NULL;
+ Tcl_AppendResult(interp, "unknown option \"", argvName, "\"", NULL);
+ return NULL;
}
/*
- * Found a matching entry. If it's a synonym, then find the
- * entry that it's a synonym for.
+ * Found a matching entry. If it's a synonym, then find the entry that
+ * it's a synonym for.
*/
- gotMatch:
+ gotMatch:
specPtr = matchPtr;
if (specPtr->type == TK_CONFIG_SYNONYM) {
for (specPtr = specs; ; specPtr++) {
if (specPtr->type == TK_CONFIG_END) {
- Tcl_AppendResult(interp,
- "couldn't find synonym for option \"",
- argvName, "\"", (char *) NULL);
- return (Tk_ConfigSpec *) NULL;
+ Tcl_AppendResult(interp, "couldn't find synonym for option \"",
+ argvName, "\"", NULL);
+ return NULL;
}
- if ((specPtr->dbName == matchPtr->dbName)
+ if ((specPtr->dbName == matchPtr->dbName)
&& (specPtr->type != TK_CONFIG_SYNONYM)
&& ((specPtr->specFlags & needFlags) == needFlags)
&& !(specPtr->specFlags & hateFlags)) {
@@ -336,32 +314,30 @@ FindConfigSpec(interp, specs, argvName, needFlags, hateFlags)
*
* DoConfig --
*
- * This procedure applies a single configuration option
- * to a widget record.
+ * This function applies a single configuration option to a widget
+ * record.
*
* Results:
* A standard Tcl return value.
*
* Side effects:
- * WidgRec is modified as indicated by specPtr and value.
- * The old value is recycled, if that is appropriate for
- * the value type.
+ * WidgRec is modified as indicated by specPtr and value. The old value
+ * is recycled, if that is appropriate for the value type.
*
*--------------------------------------------------------------
*/
static int
-DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* Window containing widget (needed to
- * set up X resources). */
- Tk_ConfigSpec *specPtr; /* Specifier to apply. */
- Tk_Uid value; /* Value to use to fill in widgRec. */
- int valueIsUid; /* Non-zero means value is a Tk_Uid;
- * zero means it's an ordinary string. */
- char *widgRec; /* Record whose fields are to be
- * modified. Values must be properly
- * initialized. */
+DoConfig(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Window tkwin, /* Window containing widget (needed to set up
+ * X resources). */
+ Tk_ConfigSpec *specPtr, /* Specifier to apply. */
+ Tk_Uid value, /* Value to use to fill in widgRec. */
+ int valueIsUid, /* Non-zero means value is a Tk_Uid; zero
+ * means it's an ordinary string. */
+ char *widgRec) /* Record whose fields are to be modified.
+ * Values must be properly initialized. */
{
char *ptr;
Tk_Uid uid;
@@ -375,211 +351,209 @@ DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
do {
ptr = widgRec + specPtr->offset;
switch (specPtr->type) {
- case TK_CONFIG_BOOLEAN:
- if (Tcl_GetBoolean(interp, value, (int *) ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TK_CONFIG_INT:
- if (Tcl_GetInt(interp, value, (int *) ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TK_CONFIG_DOUBLE:
- if (Tcl_GetDouble(interp, value, (double *) ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TK_CONFIG_STRING: {
- char *old, *new;
-
- if (nullValue) {
- new = NULL;
- } else {
- new = (char *) ckalloc((unsigned) (strlen(value) + 1));
- strcpy(new, value);
- }
- old = *((char **) ptr);
- if (old != NULL) {
- ckfree(old);
- }
- *((char **) ptr) = new;
- break;
+ case TK_CONFIG_BOOLEAN:
+ if (Tcl_GetBoolean(interp, value, (int *) ptr) != TCL_OK) {
+ return TCL_ERROR;
}
- case TK_CONFIG_UID:
- if (nullValue) {
- *((Tk_Uid *) ptr) = NULL;
- } else {
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- *((Tk_Uid *) ptr) = uid;
- }
- break;
- case TK_CONFIG_COLOR: {
- XColor *newPtr, *oldPtr;
-
- if (nullValue) {
- newPtr = NULL;
- } else {
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- newPtr = Tk_GetColor(interp, tkwin, uid);
- if (newPtr == NULL) {
- return TCL_ERROR;
- }
- }
- oldPtr = *((XColor **) ptr);
- if (oldPtr != NULL) {
- Tk_FreeColor(oldPtr);
- }
- *((XColor **) ptr) = newPtr;
- break;
+ break;
+ case TK_CONFIG_INT:
+ if (Tcl_GetInt(interp, value, (int *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_DOUBLE:
+ if (Tcl_GetDouble(interp, value, (double *) ptr) != TCL_OK) {
+ return TCL_ERROR;
}
- case TK_CONFIG_FONT: {
- Tk_Font new;
+ break;
+ case TK_CONFIG_STRING: {
+ char *oldStr, *newStr;
- if (nullValue) {
- new = NULL;
- } else {
- new = Tk_GetFont(interp, tkwin, value);
- if (new == NULL) {
- return TCL_ERROR;
- }
- }
- Tk_FreeFont(*((Tk_Font *) ptr));
- *((Tk_Font *) ptr) = new;
- break;
+ if (nullValue) {
+ newStr = NULL;
+ } else {
+ newStr = (char *) ckalloc((unsigned) (strlen(value) + 1));
+ strcpy(newStr, value);
}
- case TK_CONFIG_BITMAP: {
- Pixmap new, old;
-
- if (nullValue) {
- new = None;
- } else {
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- new = Tk_GetBitmap(interp, tkwin, uid);
- if (new == None) {
- return TCL_ERROR;
- }
- }
- old = *((Pixmap *) ptr);
- if (old != None) {
- Tk_FreeBitmap(Tk_Display(tkwin), old);
- }
- *((Pixmap *) ptr) = new;
- break;
+ oldStr = *((char **) ptr);
+ if (oldStr != NULL) {
+ ckfree(oldStr);
}
- case TK_CONFIG_BORDER: {
- Tk_3DBorder new, old;
-
- if (nullValue) {
- new = NULL;
- } else {
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- new = Tk_Get3DBorder(interp, tkwin, uid);
- if (new == NULL) {
- return TCL_ERROR;
- }
- }
- old = *((Tk_3DBorder *) ptr);
- if (old != NULL) {
- Tk_Free3DBorder(old);
- }
- *((Tk_3DBorder *) ptr) = new;
- break;
+ *((char **) ptr) = newStr;
+ break;
+ }
+ case TK_CONFIG_UID:
+ if (nullValue) {
+ *((Tk_Uid *) ptr) = NULL;
+ } else {
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ *((Tk_Uid *) ptr) = uid;
}
- case TK_CONFIG_RELIEF:
+ break;
+ case TK_CONFIG_COLOR: {
+ XColor *newPtr, *oldPtr;
+
+ if (nullValue) {
+ newPtr = NULL;
+ } else {
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetRelief(interp, uid, (int *) ptr) != TCL_OK) {
+ newPtr = Tk_GetColor(interp, tkwin, uid);
+ if (newPtr == NULL) {
return TCL_ERROR;
}
- break;
- case TK_CONFIG_CURSOR:
- case TK_CONFIG_ACTIVE_CURSOR: {
- Tk_Cursor new, old;
-
- if (nullValue) {
- new = None;
- } else {
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- new = Tk_GetCursor(interp, tkwin, uid);
- if (new == None) {
- return TCL_ERROR;
- }
- }
- old = *((Tk_Cursor *) ptr);
- if (old != None) {
- Tk_FreeCursor(Tk_Display(tkwin), old);
- }
- *((Tk_Cursor *) ptr) = new;
- if (specPtr->type == TK_CONFIG_ACTIVE_CURSOR) {
- Tk_DefineCursor(tkwin, new);
- }
- break;
}
- case TK_CONFIG_JUSTIFY:
- uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetJustify(interp, uid, (Tk_Justify *) ptr) != TCL_OK) {
+ oldPtr = *((XColor **) ptr);
+ if (oldPtr != NULL) {
+ Tk_FreeColor(oldPtr);
+ }
+ *((XColor **) ptr) = newPtr;
+ break;
+ }
+ case TK_CONFIG_FONT: {
+ Tk_Font newFont;
+
+ if (nullValue) {
+ newFont = NULL;
+ } else {
+ newFont = Tk_GetFont(interp, tkwin, value);
+ if (newFont == NULL) {
return TCL_ERROR;
}
- break;
- case TK_CONFIG_ANCHOR:
+ }
+ Tk_FreeFont(*((Tk_Font *) ptr));
+ *((Tk_Font *) ptr) = newFont;
+ break;
+ }
+ case TK_CONFIG_BITMAP: {
+ Pixmap newBmp, oldBmp;
+
+ if (nullValue) {
+ newBmp = None;
+ } else {
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetAnchor(interp, uid, (Tk_Anchor *) ptr) != TCL_OK) {
+ newBmp = Tk_GetBitmap(interp, tkwin, uid);
+ if (newBmp == None) {
return TCL_ERROR;
}
- break;
- case TK_CONFIG_CAP_STYLE:
+ }
+ oldBmp = *((Pixmap *) ptr);
+ if (oldBmp != None) {
+ Tk_FreeBitmap(Tk_Display(tkwin), oldBmp);
+ }
+ *((Pixmap *) ptr) = newBmp;
+ break;
+ }
+ case TK_CONFIG_BORDER: {
+ Tk_3DBorder newBorder, oldBorder;
+
+ if (nullValue) {
+ newBorder = NULL;
+ } else {
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetCapStyle(interp, uid, (int *) ptr) != TCL_OK) {
+ newBorder = Tk_Get3DBorder(interp, tkwin, uid);
+ if (newBorder == NULL) {
return TCL_ERROR;
}
- break;
- case TK_CONFIG_JOIN_STYLE:
+ }
+ oldBorder = *((Tk_3DBorder *) ptr);
+ if (oldBorder != NULL) {
+ Tk_Free3DBorder(oldBorder);
+ }
+ *((Tk_3DBorder *) ptr) = newBorder;
+ break;
+ }
+ case TK_CONFIG_RELIEF:
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ if (Tk_GetRelief(interp, uid, (int *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_CURSOR:
+ case TK_CONFIG_ACTIVE_CURSOR: {
+ Tk_Cursor newCursor, oldCursor;
+
+ if (nullValue) {
+ newCursor = None;
+ } else {
uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
- if (Tk_GetJoinStyle(interp, uid, (int *) ptr) != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TK_CONFIG_PIXELS:
- if (Tk_GetPixels(interp, tkwin, value, (int *) ptr)
- != TCL_OK) {
- return TCL_ERROR;
- }
- break;
- case TK_CONFIG_MM:
- if (Tk_GetScreenMM(interp, tkwin, value, (double *) ptr)
- != TCL_OK) {
+ newCursor = Tk_GetCursor(interp, tkwin, uid);
+ if (newCursor == None) {
return TCL_ERROR;
}
- break;
- case TK_CONFIG_WINDOW: {
- Tk_Window tkwin2;
-
- if (nullValue) {
- tkwin2 = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, value, tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- }
- *((Tk_Window *) ptr) = tkwin2;
- break;
}
- case TK_CONFIG_CUSTOM:
- if ((*specPtr->customPtr->parseProc)(
- specPtr->customPtr->clientData, interp, tkwin,
- value, widgRec, specPtr->offset) != TCL_OK) {
+ oldCursor = *((Tk_Cursor *) ptr);
+ if (oldCursor != None) {
+ Tk_FreeCursor(Tk_Display(tkwin), oldCursor);
+ }
+ *((Tk_Cursor *) ptr) = newCursor;
+ if (specPtr->type == TK_CONFIG_ACTIVE_CURSOR) {
+ Tk_DefineCursor(tkwin, newCursor);
+ }
+ break;
+ }
+ case TK_CONFIG_JUSTIFY:
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ if (Tk_GetJustify(interp, uid, (Tk_Justify *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_ANCHOR:
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ if (Tk_GetAnchor(interp, uid, (Tk_Anchor *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_CAP_STYLE:
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ if (Tk_GetCapStyle(interp, uid, (int *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_JOIN_STYLE:
+ uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value);
+ if (Tk_GetJoinStyle(interp, uid, (int *) ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_PIXELS:
+ if (Tk_GetPixels(interp, tkwin, value, (int *) ptr)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_MM:
+ if (Tk_GetScreenMM(interp, tkwin, value, (double*)ptr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_CONFIG_WINDOW: {
+ Tk_Window tkwin2;
+
+ if (nullValue) {
+ tkwin2 = NULL;
+ } else {
+ tkwin2 = Tk_NameToWindow(interp, value, tkwin);
+ if (tkwin2 == NULL) {
return TCL_ERROR;
}
- break;
- default: {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "bad config table: unknown type %d",
- specPtr->type);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ *((Tk_Window *) ptr) = tkwin2;
+ break;
+ }
+ case TK_CONFIG_CUSTOM:
+ if ((*specPtr->customPtr->parseProc)(
+ specPtr->customPtr->clientData, interp, tkwin, value,
+ widgRec, specPtr->offset) != TCL_OK) {
return TCL_ERROR;
}
+ break;
+ default: {
+ char buf[64 + TCL_INTEGER_SPACE];
+
+ sprintf(buf, "bad config table: unknown type %d", specPtr->type);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_ERROR;
+ }
}
specPtr++;
} while ((specPtr->argvName == NULL) && (specPtr->type != TK_CONFIG_END));
@@ -591,24 +565,22 @@ DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
*
* Tk_ConfigureInfo --
*
- * Return information about the configuration options
- * for a window, and their current values.
+ * Return information about the configuration options for a window, and
+ * their current values.
*
* Results:
- * Always returns TCL_OK. The interp's result will be modified
- * hold a description of either a single configuration option
- * available for "widgRec" via "specs", or all the configuration
- * options available. In the "all" case, the result will
- * available for "widgRec" via "specs". The result will
- * be a list, each of whose entries describes one option.
- * Each entry will itself be a list containing the option's
- * name for use on command lines, database name, database
- * class, default value, and current value (empty string
- * if none). For options that are synonyms, the list will
- * contain only two values: name and synonym name. If the
- * "name" argument is non-NULL, then the only information
- * returned is that for the named argument (i.e. the corresponding
- * entry in the overall list is returned).
+ * Always returns TCL_OK. The interp's result will be modified hold a
+ * description of either a single configuration option available for
+ * "widgRec" via "specs", or all the configuration options available. In
+ * the "all" case, the result will available for "widgRec" via "specs".
+ * The result will be a list, each of whose entries describes one option.
+ * Each entry will itself be a list containing the option's name for use
+ * on command lines, database name, database class, default value, and
+ * current value (empty string if none). For options that are synonyms,
+ * the list will contain only two values: name and synonym name. If the
+ * "name" argument is non-NULL, then the only information returned is
+ * that for the named argument (i.e. the corresponding entry in the
+ * overall list is returned).
*
* Side effects:
* None.
@@ -617,18 +589,18 @@ DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
*/
int
-Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* Window corresponding to widgRec. */
- 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
- * whose info is to be returned. Otherwise
+Tk_ConfigureInfo(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Window tkwin, /* Window corresponding to widgRec. */
+ 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
+ * 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. */
+ int flags) /* Used to specify additional flags that must
+ * be present in config specs for them to be
+ * considered. */
{
register Tk_ConfigSpec *specPtr;
int needFlags, hateFlags;
@@ -649,11 +621,11 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
specs = GetCachedSpecs(interp, specs);
/*
- * If information is only wanted for a single configuration
- * spec, then handle that one spec specially.
+ * If information is only wanted for a single configuration spec, then
+ * handle that one spec specially.
*/
- Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ Tcl_SetResult(interp, NULL, TCL_STATIC);
if (argvName != NULL) {
specPtr = FindConfigSpec(interp, specs, argvName, needFlags,hateFlags);
if (specPtr == NULL) {
@@ -666,8 +638,8 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
}
/*
- * Loop through all the specs, creating a big list with all
- * their information.
+ * Loop through all the specs, creating a big list with all their
+ * information.
*/
for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) {
@@ -682,7 +654,7 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
continue;
}
list = FormatConfigInfo(interp, tkwin, specPtr, widgRec);
- Tcl_AppendResult(interp, leader, list, "}", (char *) NULL);
+ Tcl_AppendResult(interp, leader, list, "}", NULL);
ckfree(list);
leader = " {";
}
@@ -694,12 +666,12 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
*
* FormatConfigInfo --
*
- * Create a valid Tcl list holding the configuration information
- * for a single configuration option.
+ * Create a valid Tcl list holding the configuration information for a
+ * single configuration option.
*
* Results:
- * A Tcl list, dynamically allocated. The caller is expected to
- * arrange for this list to be freed eventually.
+ * A Tcl list, dynamically allocated. The caller is expected to arrange
+ * for this list to be freed eventually.
*
* Side effects:
* Memory is allocated.
@@ -708,19 +680,20 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
*/
static char *
-FormatConfigInfo(interp, tkwin, specPtr, widgRec)
- Tcl_Interp *interp; /* Interpreter to use for things
- * like floating-point precision. */
- Tk_Window tkwin; /* Window corresponding to widget. */
- register Tk_ConfigSpec *specPtr; /* Pointer to information describing
- * option. */
- char *widgRec; /* Pointer to record holding current
- * values of info for widget. */
+FormatConfigInfo(
+ Tcl_Interp *interp, /* Interpreter to use for things like
+ * floating-point precision. */
+ Tk_Window tkwin, /* Window corresponding to widget. */
+ register Tk_ConfigSpec *specPtr,
+ /* Pointer to information describing
+ * option. */
+ char *widgRec) /* Pointer to record holding current values of
+ * info for widget. */
{
CONST char *argv[6];
char *result;
char buffer[200];
- Tcl_FreeProc *freeProc = (Tcl_FreeProc *) NULL;
+ Tcl_FreeProc *freeProc = NULL;
argv[0] = specPtr->argvName;
argv[1] = specPtr->dbName;
@@ -759,16 +732,14 @@ FormatConfigInfo(interp, tkwin, specPtr, widgRec)
*
* FormatConfigValue --
*
- * This procedure formats the current value of a configuration
- * option.
+ * This function formats the current value of a configuration option.
*
* Results:
- * The return value is the formatted value of the option given
- * by specPtr and widgRec. If the value is static, so that it
- * need not be freed, *freeProcPtr will be set to NULL; otherwise
- * *freeProcPtr will be set to the address of a procedure to
- * free the result, and the caller must invoke this procedure
- * when it is finished with the result.
+ * The return value is the formatted value of the option given by specPtr
+ * and widgRec. If the value is static, so that it need not be freed,
+ * *freeProcPtr will be set to NULL; otherwise *freeProcPtr will be set
+ * to the address of a function to free the result, and the caller must
+ * invoke this function when it is finished with the result.
*
* Side effects:
* None.
@@ -777,18 +748,18 @@ FormatConfigInfo(interp, tkwin, specPtr, widgRec)
*/
static CONST char *
-FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
- Tcl_Interp *interp; /* Interpreter for use in real conversions. */
- Tk_Window tkwin; /* Window corresponding to widget. */
- Tk_ConfigSpec *specPtr; /* Pointer to information describing option.
+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.
* Must not point to a synonym option. */
- char *widgRec; /* Pointer to record holding current
- * values of info for widget. */
- char *buffer; /* Static buffer to use for small values.
+ char *widgRec, /* Pointer to record holding current values of
+ * info for widget. */
+ char *buffer, /* Static buffer to use for small values.
* Must have at least 200 bytes of storage. */
- Tcl_FreeProc **freeProcPtr; /* Pointer to word to fill in with address
- * of procedure to free the result, or NULL
- * if result is static. */
+ Tcl_FreeProc **freeProcPtr) /* Pointer to word to fill in with address of
+ * function to free the result, or NULL if
+ * result is static. */
{
CONST char *ptr, *result;
@@ -796,109 +767,115 @@ FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
ptr = widgRec + specPtr->offset;
result = "";
switch (specPtr->type) {
- case TK_CONFIG_BOOLEAN:
- if (*((int *) ptr) == 0) {
- result = "0";
- } else {
- result = "1";
- }
- break;
- case TK_CONFIG_INT:
- sprintf(buffer, "%d", *((int *) ptr));
- result = buffer;
- break;
- case TK_CONFIG_DOUBLE:
- Tcl_PrintDouble(interp, *((double *) ptr), buffer);
- result = buffer;
- break;
- case TK_CONFIG_STRING:
- result = (*(char **) ptr);
- if (result == NULL) {
- result = "";
- }
- break;
- case TK_CONFIG_UID: {
- Tk_Uid uid = *((Tk_Uid *) ptr);
- if (uid != NULL) {
- result = uid;
- }
- break;
+ case TK_CONFIG_BOOLEAN:
+ if (*((int *) ptr) == 0) {
+ result = "0";
+ } else {
+ result = "1";
}
- case TK_CONFIG_COLOR: {
- XColor *colorPtr = *((XColor **) ptr);
- if (colorPtr != NULL) {
- result = Tk_NameOfColor(colorPtr);
- }
- break;
+ break;
+ case TK_CONFIG_INT:
+ sprintf(buffer, "%d", *((int *) ptr));
+ result = buffer;
+ break;
+ case TK_CONFIG_DOUBLE:
+ Tcl_PrintDouble(interp, *((double *) ptr), buffer);
+ result = buffer;
+ break;
+ case TK_CONFIG_STRING:
+ result = (*(char **) ptr);
+ if (result == NULL) {
+ result = "";
}
- case TK_CONFIG_FONT: {
- Tk_Font tkfont = *((Tk_Font *) ptr);
- if (tkfont != NULL) {
- result = Tk_NameOfFont(tkfont);
- }
- break;
+ break;
+ case TK_CONFIG_UID: {
+ Tk_Uid uid = *((Tk_Uid *) ptr);
+
+ if (uid != NULL) {
+ result = uid;
}
- case TK_CONFIG_BITMAP: {
- Pixmap pixmap = *((Pixmap *) ptr);
- if (pixmap != None) {
- result = Tk_NameOfBitmap(Tk_Display(tkwin), pixmap);
- }
- break;
+ break;
+ }
+ case TK_CONFIG_COLOR: {
+ XColor *colorPtr = *((XColor **) ptr);
+
+ if (colorPtr != NULL) {
+ result = Tk_NameOfColor(colorPtr);
}
- case TK_CONFIG_BORDER: {
- Tk_3DBorder border = *((Tk_3DBorder *) ptr);
- if (border != NULL) {
- result = Tk_NameOf3DBorder(border);
- }
- break;
+ break;
+ }
+ case TK_CONFIG_FONT: {
+ Tk_Font tkfont = *((Tk_Font *) ptr);
+
+ if (tkfont != NULL) {
+ result = Tk_NameOfFont(tkfont);
}
- case TK_CONFIG_RELIEF:
- result = Tk_NameOfRelief(*((int *) ptr));
- break;
- case TK_CONFIG_CURSOR:
- case TK_CONFIG_ACTIVE_CURSOR: {
- Tk_Cursor cursor = *((Tk_Cursor *) ptr);
- if (cursor != None) {
- result = Tk_NameOfCursor(Tk_Display(tkwin), cursor);
- }
- break;
+ break;
+ }
+ case TK_CONFIG_BITMAP: {
+ Pixmap pixmap = *((Pixmap *) ptr);
+
+ if (pixmap != None) {
+ result = Tk_NameOfBitmap(Tk_Display(tkwin), pixmap);
}
- case TK_CONFIG_JUSTIFY:
- result = Tk_NameOfJustify(*((Tk_Justify *) ptr));
- break;
- case TK_CONFIG_ANCHOR:
- result = Tk_NameOfAnchor(*((Tk_Anchor *) ptr));
- break;
- case TK_CONFIG_CAP_STYLE:
- result = Tk_NameOfCapStyle(*((int *) ptr));
- break;
- case TK_CONFIG_JOIN_STYLE:
- result = Tk_NameOfJoinStyle(*((int *) ptr));
- break;
- case TK_CONFIG_PIXELS:
- sprintf(buffer, "%d", *((int *) ptr));
- result = buffer;
- break;
- case TK_CONFIG_MM:
- Tcl_PrintDouble(interp, *((double *) ptr), buffer);
- result = buffer;
- break;
- case TK_CONFIG_WINDOW: {
- Tk_Window tkwin;
+ break;
+ }
+ case TK_CONFIG_BORDER: {
+ Tk_3DBorder border = *((Tk_3DBorder *) ptr);
- tkwin = *((Tk_Window *) ptr);
- if (tkwin != NULL) {
- result = Tk_PathName(tkwin);
- }
- break;
+ if (border != NULL) {
+ result = Tk_NameOf3DBorder(border);
}
- case TK_CONFIG_CUSTOM:
- result = (*specPtr->customPtr->printProc)(
- specPtr->customPtr->clientData, tkwin, widgRec,
- specPtr->offset, freeProcPtr);
- break;
- default:
- result = "?? unknown type ??";
+ break;
+ }
+ case TK_CONFIG_RELIEF:
+ result = Tk_NameOfRelief(*((int *) ptr));
+ break;
+ case TK_CONFIG_CURSOR:
+ case TK_CONFIG_ACTIVE_CURSOR: {
+ Tk_Cursor cursor = *((Tk_Cursor *) ptr);
+
+ if (cursor != None) {
+ result = Tk_NameOfCursor(Tk_Display(tkwin), cursor);
+ }
+ break;
+ }
+ case TK_CONFIG_JUSTIFY:
+ result = Tk_NameOfJustify(*((Tk_Justify *) ptr));
+ break;
+ case TK_CONFIG_ANCHOR:
+ result = Tk_NameOfAnchor(*((Tk_Anchor *) ptr));
+ break;
+ case TK_CONFIG_CAP_STYLE:
+ result = Tk_NameOfCapStyle(*((int *) ptr));
+ break;
+ case TK_CONFIG_JOIN_STYLE:
+ result = Tk_NameOfJoinStyle(*((int *) ptr));
+ break;
+ case TK_CONFIG_PIXELS:
+ sprintf(buffer, "%d", *((int *) ptr));
+ result = buffer;
+ break;
+ case TK_CONFIG_MM:
+ Tcl_PrintDouble(interp, *((double *) ptr), buffer);
+ result = buffer;
+ break;
+ case TK_CONFIG_WINDOW: {
+ Tk_Window tkwin;
+
+ tkwin = *((Tk_Window *) ptr);
+ if (tkwin != NULL) {
+ result = Tk_PathName(tkwin);
+ }
+ break;
+ }
+ case TK_CONFIG_CUSTOM:
+ result = (*specPtr->customPtr->printProc)(
+ specPtr->customPtr->clientData, tkwin, widgRec,
+ specPtr->offset, freeProcPtr);
+ break;
+ default:
+ result = "?? unknown type ??";
}
return result;
}
@@ -908,14 +885,14 @@ FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
*
* Tk_ConfigureValue --
*
- * This procedure returns the current value of a configuration
- * option for a widget.
+ * This function returns the current value of a configuration option for
+ * a widget.
*
* Results:
* The return value is a standard Tcl completion code (TCL_OK or
- * TCL_ERROR). The interp's result will be set to hold either the value
- * of the option given by argvName (if TCL_OK is returned) or
- * an error message (if TCL_ERROR is returned).
+ * TCL_ERROR). The interp's result will be set to hold either the value
+ * of the option given by argvName (if TCL_OK is returned) or an error
+ * message (if TCL_ERROR is returned).
*
* Side effects:
* None.
@@ -924,17 +901,17 @@ FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
*/
int
-Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Window tkwin; /* Window corresponding to widgRec. */
- 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 whose value is to be returned. */
- int flags; /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. */
+Tk_ConfigureValue(
+ Tcl_Interp *interp, /* Interpreter for error reporting. */
+ Tk_Window tkwin, /* Window corresponding to widgRec. */
+ 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
+ * whose value is to be returned. */
+ int flags) /* Used to specify additional flags that must
+ * be present in config specs for them to be
+ * considered. */
{
Tk_ConfigSpec *specPtr;
int needFlags, hateFlags;
@@ -959,7 +936,8 @@ Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
if (specPtr == NULL) {
return TCL_ERROR;
}
- result = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, &freeProc);
+ result = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer,
+ &freeProc);
Tcl_SetResult(interp, (char *) result, TCL_VOLATILE);
if (freeProc != NULL) {
if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
@@ -982,24 +960,27 @@ Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
* None.
*
* Side effects:
- * Any resource in widgRec that is controlled by a configuration
- * option (e.g. a Tk_3DBorder or XColor) is freed in the appropriate
- * fashion.
+ * Any resource in widgRec that is controlled by a configuration option
+ * (e.g. a Tk_3DBorder or XColor) is freed in the appropriate fashion.
+ *
+ * Notes:
+ * Since this is not looking anything up, this uses the static version of
+ * the config specs.
*
*----------------------------------------------------------------------
*/
/* ARGSUSED */
void
-Tk_FreeOptions(specs, widgRec, display, needFlags)
- Tk_ConfigSpec *specs; /* Describes legal options. */
- char *widgRec; /* Record whose fields contain current
- * values for options. */
- Display *display; /* X display; needed for freeing some
+Tk_FreeOptions(
+ Tk_ConfigSpec *specs, /* Describes legal options. */
+ char *widgRec, /* Record whose fields contain current values
+ * for options. */
+ Display *display, /* X display; needed for freeing some
* resources. */
- int needFlags; /* Used to specify additional flags
- * that must be present in config specs
- * for them to be considered. */
+ int needFlags) /* Used to specify additional flags that must
+ * be present in config specs for them to be
+ * considered. */
{
register Tk_ConfigSpec *specPtr;
char *ptr;
@@ -1010,40 +991,40 @@ Tk_FreeOptions(specs, widgRec, display, needFlags)
}
ptr = widgRec + specPtr->offset;
switch (specPtr->type) {
- case TK_CONFIG_STRING:
- if (*((char **) ptr) != NULL) {
- ckfree(*((char **) ptr));
- *((char **) ptr) = NULL;
- }
- break;
- case TK_CONFIG_COLOR:
- if (*((XColor **) ptr) != NULL) {
- Tk_FreeColor(*((XColor **) ptr));
- *((XColor **) ptr) = NULL;
- }
- break;
- case TK_CONFIG_FONT:
- Tk_FreeFont(*((Tk_Font *) ptr));
- *((Tk_Font *) ptr) = NULL;
- break;
- case TK_CONFIG_BITMAP:
- if (*((Pixmap *) ptr) != None) {
- Tk_FreeBitmap(display, *((Pixmap *) ptr));
- *((Pixmap *) ptr) = None;
- }
- break;
- case TK_CONFIG_BORDER:
- if (*((Tk_3DBorder *) ptr) != NULL) {
- Tk_Free3DBorder(*((Tk_3DBorder *) ptr));
- *((Tk_3DBorder *) ptr) = NULL;
- }
- break;
- case TK_CONFIG_CURSOR:
- case TK_CONFIG_ACTIVE_CURSOR:
- if (*((Tk_Cursor *) ptr) != None) {
- Tk_FreeCursor(display, *((Tk_Cursor *) ptr));
- *((Tk_Cursor *) ptr) = None;
- }
+ case TK_CONFIG_STRING:
+ if (*((char **) ptr) != NULL) {
+ ckfree(*((char **) ptr));
+ *((char **) ptr) = NULL;
+ }
+ break;
+ case TK_CONFIG_COLOR:
+ if (*((XColor **) ptr) != NULL) {
+ Tk_FreeColor(*((XColor **) ptr));
+ *((XColor **) ptr) = NULL;
+ }
+ break;
+ case TK_CONFIG_FONT:
+ Tk_FreeFont(*((Tk_Font *) ptr));
+ *((Tk_Font *) ptr) = NULL;
+ break;
+ case TK_CONFIG_BITMAP:
+ if (*((Pixmap *) ptr) != None) {
+ Tk_FreeBitmap(display, *((Pixmap *) ptr));
+ *((Pixmap *) ptr) = None;
+ }
+ break;
+ case TK_CONFIG_BORDER:
+ if (*((Tk_3DBorder *) ptr) != NULL) {
+ Tk_Free3DBorder(*((Tk_3DBorder *) ptr));
+ *((Tk_3DBorder *) ptr) = NULL;
+ }
+ break;
+ case TK_CONFIG_CURSOR:
+ case TK_CONFIG_ACTIVE_CURSOR:
+ if (*((Tk_Cursor *) ptr) != None) {
+ Tk_FreeCursor(display, *((Tk_Cursor *) ptr));
+ *((Tk_Cursor *) ptr) = None;
+ }
}
}
}
@@ -1053,28 +1034,28 @@ Tk_FreeOptions(specs, widgRec, display, needFlags)
*
* GetCachedSpecs --
*
- *Returns a writable per-interpreter (and hence thread-local) copy of
- *the given spec-table with (some of) the char* fields converted into
- *Tk_Uid fields; this copy will be released when the interpreter
- *terminates (during AssocData cleanup).
+ * Returns a writable per-interpreter (and hence thread-local) copy of
+ * the given spec-table with (some of) the char* fields converted into
+ * Tk_Uid fields; this copy will be released when the interpreter
+ * terminates (during AssocData cleanup).
*
* Results:
- *A pointer to the copied table.
+ * A pointer to the copied table.
*
* Notes:
- *The conversion to Tk_Uid is only done the first time, when the table
- *copy is taken. After that, the table is assumed to have Tk_Uids where
- *they are needed. The time of deletion of the caches isn't very
- *important unless you've got a lot of code that uses Tk_ConfigureWidget
- *(or *Info or *Value} when the interpreter is being deleted.
+ * The conversion to Tk_Uid is only done the first time, when the table
+ * copy is taken. After that, the table is assumed to have Tk_Uids where
+ * they are needed. The time of deletion of the caches isn't very
+ * important unless you've got a lot of code that uses Tk_ConfigureWidget
+ * (or *Info or *Value} when the interpreter is being deleted.
*
*--------------------------------------------------------------
*/
static Tk_ConfigSpec *
-GetCachedSpecs(interp, staticSpecs)
- Tcl_Interp *interp; /* Interpreter in which to store the cache. */
- const Tk_ConfigSpec *staticSpecs;
+GetCachedSpecs(
+ Tcl_Interp *interp, /* Interpreter in which to store the cache. */
+ const Tk_ConfigSpec *staticSpecs)
/* Value to cache a copy of; it is also used
* as a key into the cache. */
{
@@ -1126,7 +1107,7 @@ GetCachedSpecs(interp, staticSpecs)
*/
cachedSpecs = (Tk_ConfigSpec *) ckalloc(entrySpace);
- memcpy((void *) cachedSpecs, (void *) staticSpecs, entrySpace);
+ memcpy(cachedSpecs, staticSpecs, entrySpace);
Tcl_SetHashValue(entryPtr, (ClientData) cachedSpecs);
/*
@@ -1147,6 +1128,7 @@ GetCachedSpecs(interp, staticSpecs)
specPtr->defValue = Tk_GetUid(specPtr->defValue);
}
}
+ specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED;
}
} else {
cachedSpecs = (Tk_ConfigSpec *) Tcl_GetHashValue(entryPtr);
@@ -1167,15 +1149,15 @@ GetCachedSpecs(interp, staticSpecs)
* None
*
* Side effects:
- * None
+ * None (does *not* use any Tk API).
*
*--------------------------------------------------------------
*/
static void
-DeleteSpecCacheTable(clientData, interp)
- ClientData clientData;
- Tcl_Interp *interp;
+DeleteSpecCacheTable(
+ ClientData clientData,
+ Tcl_Interp *interp)
{
Tcl_HashTable *tablePtr = (Tcl_HashTable *) clientData;
Tcl_HashEntry *entryPtr;
@@ -1192,3 +1174,11 @@ DeleteSpecCacheTable(clientData, interp)
Tcl_DeleteHashTable(tablePtr);
ckfree((char *) tablePtr);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c
new file mode 100644