summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2008-06-25 16:46:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2008-06-25 16:46:00 (GMT)
commit89cb99e8a67eef86e5ecfe8c9ac050f3e8cb8b95 (patch)
tree49b461af0f9432284a15e6d52e2374debeebcedb
parent48d36d84da43edda59be1a5d12734a121b31c0de (diff)
downloadtk-89cb99e8a67eef86e5ecfe8c9ac050f3e8cb8b95.zip
tk-89cb99e8a67eef86e5ecfe8c9ac050f3e8cb8b95.tar.gz
tk-89cb99e8a67eef86e5ecfe8c9ac050f3e8cb8b95.tar.bz2
merge updates from 8.5 branch
-rw-r--r--ChangeLog122
-rw-r--r--changes24
-rw-r--r--doc/button.n8
-rw-r--r--doc/ttk_button.n15
-rw-r--r--doc/ttk_checkbutton.n4
-rw-r--r--doc/ttk_combobox.n6
-rw-r--r--doc/ttk_frame.n4
-rw-r--r--doc/ttk_label.n14
-rw-r--r--doc/ttk_labelframe.n4
-rw-r--r--doc/ttk_menubutton.n4
-rw-r--r--doc/ttk_notebook.n6
-rw-r--r--doc/ttk_panedwindow.n10
-rw-r--r--doc/ttk_progressbar.n6
-rw-r--r--doc/ttk_radiobutton.n4
-rw-r--r--doc/ttk_scale.n12
-rw-r--r--doc/ttk_scrollbar.n12
-rw-r--r--doc/ttk_separator.n4
-rw-r--r--doc/ttk_sizegrip.n4
-rw-r--r--doc/ttk_widget.n8
-rw-r--r--generic/tk.h6
-rw-r--r--generic/tkArgv.c13
-rw-r--r--generic/tkCanvas.c9
-rw-r--r--generic/tkInt.h4
-rw-r--r--generic/tkPointer.c10
-rw-r--r--generic/tkStubLib.c5
-rw-r--r--generic/tkWindow.c5
-rw-r--r--generic/ttk/ttkLabel.c8
-rw-r--r--library/tk.tcl12
-rw-r--r--library/ttk/treeview.tcl4
-rw-r--r--library/ttk/xpTheme.tcl4
-rw-r--r--macosx/GNUmakefile4
-rw-r--r--macosx/README32
-rw-r--r--macosx/Wish.xcode/default.pbxuser2
-rw-r--r--macosx/Wish.xcode/project.pbxproj580
-rw-r--r--macosx/Wish.xcodeproj/default.pbxuser2
-rw-r--r--macosx/Wish.xcodeproj/project.pbxproj774
-rw-r--r--macosx/tkMacOSXBitmap.c8
-rw-r--r--macosx/tkMacOSXCarbonEvents.c90
-rw-r--r--macosx/tkMacOSXCursor.c158
-rw-r--r--macosx/tkMacOSXDebug.c5
-rw-r--r--macosx/tkMacOSXDebug.h6
-rw-r--r--macosx/tkMacOSXDialog.c812
-rw-r--r--macosx/tkMacOSXEmbed.c512
-rw-r--r--macosx/tkMacOSXFont.c99
-rw-r--r--macosx/tkMacOSXInit.c176
-rw-r--r--macosx/tkMacOSXPrivate.h3
-rw-r--r--macosx/tkMacOSXSend.c391
-rw-r--r--macosx/tkMacOSXSubwindows.c59
-rw-r--r--macosx/tkMacOSXWindowEvent.c4
-rw-r--r--macosx/tkMacOSXWm.c1636
-rw-r--r--macosx/tkMacOSXXStubs.c273
-rw-r--r--macosx/ttkMacOSXTheme.c4
-rw-r--r--tests/main.test26
-rw-r--r--tests/winDialog.test80
-rwxr-xr-xunix/configure240
-rw-r--r--unix/configure.in4
-rw-r--r--unix/tcl.m462
-rw-r--r--unix/tk.spec4
-rw-r--r--unix/tkUnixKey.c103
-rwxr-xr-xwin/configure14
-rw-r--r--win/configure.in16
-rw-r--r--win/tkWinDialog.c6
-rw-r--r--win/tkWinTest.c5
63 files changed, 3776 insertions, 2765 deletions
diff --git a/ChangeLog b/ChangeLog
index a779bd6..b9c4101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,123 @@
+2008-06-20 Joe English <jenglish@users.sourceforge.net>
+
+ * library/ttk/treeview.tcl: Backport fix for [Bug 1951733]
+
+2008-06-19 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Updates for 8.5.3 release.
+
+2008-06-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing;
+ (InstallStandardApplicationEventHandler): replace needless use of
+ TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol().
+
+ * macosx/tkMacOSXDebug.c: revert 2007-11-09 commit making
+ * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol()
+ available outside of debug builds.
+
+ * macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing
+ * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by
+ only sending VisibilityNotify events once windows are mapped (rather
+ than when they are created).
+
+ * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): fix
+ return value.
+
+ * macosx/tkMacOSXInit.c: add helper to efficiently convert from
+ * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj.
+
+ * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): fix
+ incorrect conversion to points of font sizes already in points; factor
+ out retrieval of font family name from font family ID.
+
+2008-06-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure, win/configure.in (TK_WIN_VERSION): fix handling
+ of interim a/b versioning for manifest usage.
+
+2008-06-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a
+ global grab capture and to release the restrict window capture when
+ releasing a button grab. Fixes segfault due to dangling reference to
+ restrict window inside TkpSetCapture() implementation. [Bug 1991932]
+
+ * unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
+ * unix/configure: autoconf-2.59
+
+ * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use UsrActivity
+ instead of OverallAct (which may be ignored in some circumstances).
+
+ * macosx/Wish.xcodeproj/project.pbxproj: add debug configs for 64bit,
+ * macosx/Wish.xcodeproj/default.pbxuser: with gcov, and with
+ corefoundation disabled; updates & cleanup for Xcode 3.1 and for
+ Leopard; sync with Tcl.xcodeproj.
+ * macosx/Wish.xcode/project.pbxproj: sync Wish.xcodeproj changes.
+ * macosx/Wish.xcode/default.pbxuser:
+ * macosx/README: document new build configs.
+
+2008-06-10 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixKey.c: tkUnixKey.c: Use Xutf8LookupString if available
+ [Patch #1986818]. This should fix problems (like #1908443) where
+ Xlib's idea of the system encoding does not match Tcl's.
+
+2008-05-23 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to
+ Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576]
+
+2008-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/tk.tcl: Support for ttk widgets in AmpWidget
+
+ * doc/button.n: Note negative widths for button [Patch #1883418]
+ * doc/ttk_*: 'identify' widget command is on all ttk widgets.
+
+2008-05-04 Joe English <jenglish@users.sourceforge.net>
+
+ * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments
+ should not be disjoint [Bug 1942785]
+
+2008-04-17 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkCanvas.c: Fix logic that determines when canvas item
+ <Enter> event should fire. Thanks to Sebastian Wangnick. [Bug 1327482]
+
+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]
+
+ * 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
+
+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>
* changes: Updates for 8.5.2 release.
@@ -85,7 +205,7 @@
* library/demos/widget:
* macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1 and
- * macosx/Wish.xcodeproj/default.pbxuser: targets for building with
+ * 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.
diff --git a/changes b/changes
index 31bf414..de4fe95 100644
--- a/changes
+++ b/changes
@@ -2,7 +2,7 @@ This 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.
-RCS: @(#) $Id: changes,v 1.107.2.13 2008/03/28 17:57:03 dgp Exp $
+RCS: @(#) $Id: changes,v 1.107.2.14 2008/06/25 16:46:00 dgp Exp $
3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from
the interpreter when the main window is deleted (otherwise there will
@@ -6501,3 +6501,25 @@ Several documentation and release notes improvements
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-16 (interface)[1938497] make stubs tables 'static const' (steffen)
+
+2008-04-17 (bug fix)[1327482] canvas item <Enter> events (wangnick)
+
+2008-05-23 (bug fix)[1967576] ttk::label height or width 0 panic (lawlor)
+
+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 ??, 2008 --- See ChangeLog for details ---
diff --git a/doc/button.n b/doc/button.n
index 9202150..20e1e18 100644
--- a/doc/button.n
+++ b/doc/button.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: button.n,v 1.11.2.2 2007/11/01 16:37:14 dgp Exp $
+'\" RCS: @(#) $Id: button.n,v 1.11.2.3 2008/06/25 16:46:01 dgp Exp $
'\"
.so man.macros
.TH button n 4.4 Tk "Tk Built-In Commands"
@@ -70,8 +70,10 @@ 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.
+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
diff --git a/doc/ttk_button.n b/doc/ttk_button.n
index 0fb4f44..f7fc782 100644
--- a/doc/ttk_button.n
+++ b/doc/ttk_button.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_button.n,v 1.3.2.4 2008/01/29 17:35:47 dgp Exp $
+'\" RCS: @(#) $Id: ttk_button.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::button n 8.5 Tk "Tk Themed Widget"
@@ -56,18 +56,13 @@ in the style.
.\" .OP \-padding padding Padding
.\" .OP \-relief relief Relief
.SH "WIDGET COMMAND"
+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 \fBinvoke\fR
Invokes the command associated with the button.
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-.TP
-\fIpathName \fBinstate \fIstateSpec\fR ?\fIscript\fR?
-.TP
-\fIpathName \fBstate\fR ?\fIstateSpec\fR?
-See \fIttk::widget(n)\fR
.SH "COMPATIBILITY OPTIONS"
.OP \-state state State
May be set to \fBnormal\fR or \fBdisabled\fR to control the
diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n
index 3f64533..1ffe7fe 100644
--- a/doc/ttk_checkbutton.n
+++ b/doc/ttk_checkbutton.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.4.2.4 2008/01/29 17:35:48 dgp Exp $
+'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.4.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::checkbutton n 8.5 Tk "Tk Themed Widget"
@@ -38,7 +38,7 @@ The name of a global variable whose value is linked to the widget.
Defaults to the widget pathname if not specified.
.SH "WIDGET COMMAND"
In addition to the standard
-\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
commands, checkbuttons support the following additional
widget commands:
.TP
diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n
index 28557c6..3c90bdc 100644
--- a/doc/ttk_combobox.n
+++ b/doc/ttk_combobox.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_combobox.n,v 1.4.2.8 2008/03/07 22:03:48 dgp Exp $
+'\" RCS: @(#) $Id: ttk_combobox.n,v 1.4.2.9 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::combobox n 8.5 Tk "Tk Themed Widget"
@@ -74,8 +74,8 @@ Otherwise, returns the index of the current value in the list of
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,
-or the empty string if the coordinates are outside the window.
+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.
diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n
index b9fbaad..fbbf0e7 100644
--- a/doc/ttk_frame.n
+++ b/doc/ttk_frame.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_frame.n,v 1.3.2.4 2008/01/29 17:35:48 dgp Exp $
+'\" RCS: @(#) $Id: ttk_frame.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::frame n 8.5 Tk "Tk Themed Widget"
@@ -37,7 +37,7 @@ If specified, the widget's requested width in pixels.
If specified, the widget's requested height in pixels.
.SH "WIDGET COMMAND"
Supports the standard widget commands
-\fBconfigure\fR, \fBcget\fR, \fBinstate\fR, and \fBstate\fR;
+\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR;
see \fIttk::widget(n)\fR.
.SH "NOTES"
Note that if the \fBpack\fR, \fBgrid\fR, or other geometry managers
diff --git a/doc/ttk_label.n b/doc/ttk_label.n
index 133405d..5f3dab6 100644
--- a/doc/ttk_label.n
+++ b/doc/ttk_label.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_label.n,v 1.3.2.4 2008/01/29 17:35:48 dgp Exp $
+'\" RCS: @(#) $Id: ttk_label.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::label n 8.5 Tk "Tk Themed Widget"
@@ -68,14 +68,8 @@ 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"
-.TP
-\fIpathName \fBcget\fR \fIoption\fR
-.TP
-\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
-.TP
-\fIpathName \fBinstate \fIstateSpec\fR ?\fIscript\fR?
-.TP
-\fIpathName \fBstate\fR ?\fIstateSpec\fR?
-See \fIttk::widget(n)\fR
+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)
diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n
index eb3d89a..4fffacd 100644
--- a/doc/ttk_labelframe.n
+++ b/doc/ttk_labelframe.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.3.2.4 2008/01/29 17:35:48 dgp Exp $
+'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::labelframe n 8.5 Tk "Tk Themed Widget"
@@ -65,7 +65,7 @@ If specified, the widget's requested height in pixels.
\fB\-height\fR).
.SH "WIDGET COMMAND"
Supports the standard widget commands
-\fBconfigure\fR, \fBcget\fR, \fBinstate\fR, and \fBstate\fR;
+\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)
diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n
index d80a28e..3720848 100644
--- a/doc/ttk_menubutton.n
+++ b/doc/ttk_menubutton.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.3.2.4 2008/01/29 17:35:50 dgp Exp $
+'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::menubutton n 8.5 Tk "Tk Themed Widget"
@@ -39,7 +39,7 @@ menubutton.
.\" .OP \-padding padding Pad
.SH "WIDGET COMMAND"
Menubutton widgets support the standard
-\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
methods. No other widget methods are used.
.SH "SEE ALSO"
ttk::widget(n), menu(n), menubutton(n)
diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n
index d20c497..39f02cf 100644
--- a/doc/ttk_notebook.n
+++ b/doc/ttk_notebook.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_notebook.n,v 1.3.2.6 2008/03/07 22:03:49 dgp Exp $
+'\" RCS: @(#) $Id: ttk_notebook.n,v 1.3.2.7 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::notebook n 8.5 Tk "Tk Themed Widget"
@@ -124,6 +124,10 @@ 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 \fIx y\fR
+Returns the name of the element at position \fIx\fR, \fIy\fR.
+See \fIttk::widget(n)\fR.
+.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
diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n
index 46130f2..b8ec987 100644
--- a/doc/ttk_panedwindow.n
+++ b/doc/ttk_panedwindow.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.4.2.6 2008/01/29 17:35:50 dgp Exp $
+'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.4.2.7 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::panedwindow n 8.5 Tk "Tk Themed Widget"
@@ -62,6 +62,10 @@ See \fBPANE OPTIONS\fR for the list of available options.
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 \fIx y\fR
+Returns the index of the sash at point \fIx,y\fR,
+or the empty string if \fIx,y\fR is not over a sash.
+.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,
@@ -90,9 +94,5 @@ and the total size of the widget.
.\" 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.
-.TP
-\fIpathname\fR \fBidentify\fR \fIx y\fR
-Returns the index of the sash at point \fIx,y\fR,
-or the empty string if \fIx,y\fR is not over a sash.
.SH "SEE ALSO"
ttk::widget(n), ttk::notebook(n), panedwindow(n)
diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n
index 86bcf86..a090295 100644
--- a/doc/ttk_progressbar.n
+++ b/doc/ttk_progressbar.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.3.2.4 2008/01/29 17:35:51 dgp Exp $
+'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::progressbar n 8.5 Tk "Tk Themed Widget"
@@ -63,6 +63,10 @@ Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\f
\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
diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n
index 0fce698..ea308d9 100644
--- a/doc/ttk_radiobutton.n
+++ b/doc/ttk_radiobutton.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.3.2.4 2008/01/29 17:35:51 dgp Exp $
+'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::radiobutton n 8.5 Tk "Tk Themed Widget"
@@ -37,7 +37,7 @@ The name of a global variable whose value is linked to the widget.
Default value is \fB::selectedButton\fR.
.SH "WIDGET COMMAND"
In addition to the standard
-\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
commands, radiobuttons support the following additional
widget commands:
.TP
diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n
index e2667c7..d7de34d 100644
--- a/doc/ttk_scale.n
+++ b/doc/ttk_scale.n
@@ -4,7 +4,7 @@
.\" See the file "license.terms" for information on usage and redistribution
.\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
.\"
-.\" CVS: @(#) $Id: ttk_scale.n,v 1.1.2.2 2008/03/07 22:03:49 dgp Exp $
+.\" CVS: @(#) $Id: ttk_scale.n,v 1.1.2.3 2008/06/25 16:46:02 dgp Exp $
.\"
.so man.macros
.TH ttk::scale n 8.5 Tk "Tk Themed Widget"
@@ -65,6 +65,10 @@ 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.
@@ -86,12 +90,6 @@ Modify or query the widget state; see \fIttk::widget(n)\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.
-.TP
-\fIpathName \fBidentify \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 in any element of the scale.
-\fIX\fR and \fIy\fR are pixel coordinates relative to the scale widget origin.
.SH "SEE ALSO"
ttk::widget(n), scale(n)
.SH KEYWORDS
diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n
index 00db842..e5b9187 100644
--- a/doc/ttk_scrollbar.n
+++ b/doc/ttk_scrollbar.n
@@ -6,7 +6,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" SOURCE: tk/doc/scrollbar.n, r1.4
-'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.3.2.5 2008/01/29 17:35:51 dgp Exp $
+'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.3.2.6 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::scrollbar n 8.5 Tk "Tk Themed Widget"
@@ -59,6 +59,10 @@ Modify or query widget options; see \fIttk::widget(n)\fR.
Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent \fBset\fR widget command.
.TP
+\fIpathName \fBidentify\fR \fIx y\fR
+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
@@ -94,12 +98,6 @@ and 1.0 corresponds to the bottom or right.
widget.
If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest
point in the trough is used.
-.TP
-\fIpathName \fBidentify\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 in any element of the scrollbar.
-\fIX\fR and \fIy\fR are pixel coordinates relative to the scrollbar widget.
.SH "SCROLLING COMMANDS"
When the user interacts with the scrollbar, for example by dragging
the thumb, the scrollbar notifies the associated widget that it
diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n
index 5f51151..7cde671 100644
--- a/doc/ttk_separator.n
+++ b/doc/ttk_separator.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_separator.n,v 1.3.2.4 2008/01/29 17:35:51 dgp Exp $
+'\" RCS: @(#) $Id: ttk_separator.n,v 1.3.2.5 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::separator n 8.5 Tk "Tk Themed Widget"
@@ -27,7 +27,7 @@ One of \fBhorizontal\fR or \fBvertical\fR.
Specifies the orientation of the separator.
.SH "WIDGET COMMAND"
Separator widgets support the standard
-\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
methods. No other widget methods are used.
.SH "SEE ALSO"
ttk::widget(n)
diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n
index 28ad32c..bf74c6c 100644
--- a/doc/ttk_sizegrip.n
+++ b/doc/ttk_sizegrip.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.3.2.6 2008/01/29 17:35:51 dgp Exp $
+'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.3.2.7 2008/06/25 16:46:02 dgp Exp $
'\"
.so man.macros
.TH ttk::sizegrip n 8.5 Tk "Tk Themed Widget"
@@ -24,7 +24,7 @@ by pressing and dragging the grip.
.SE
.SH "WIDGET COMMAND"
Sizegrip widgets support the standard
-\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR
+\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR
methods. No other widget methods are used.
.SH "PLATFORM-SPECIFIC NOTES"
On Mac OSX, toplevel windows automatically include a built-in
diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n
index 42ba755..1bf65d8 100644
--- a/doc/ttk_widget.n
+++ b/doc/ttk_widget.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_widget.n,v 1.3.2.4 2007/12/13 06:28:47 dgp Exp $
+'\" RCS: @(#) $Id: ttk_widget.n,v 1.3.2.5 2008/06/25 16:46:03 dgp Exp $
'\"
.so man.macros
.TH ttk::widget n 8.5 Tk "Tk Themed Widget"
@@ -144,6 +144,12 @@ 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 \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.
.TP
\fIpathName \fBinstate\fR \fIstatespec\fR ?\fIscript\fR?
Test the widget's state.
diff --git a/generic/tk.h b/generic/tk.h
index ac1daba..1919a24 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tk.h,v 1.98.2.9 2008/03/07 22:15:10 dgp Exp $
+ * RCS: @(#) $Id: tk.h,v 1.98.2.10 2008/06/25 16:46:03 dgp Exp $
*/
#ifndef _TK
@@ -53,10 +53,10 @@ extern "C" {
#define TK_MAJOR_VERSION 8
#define TK_MINOR_VERSION 5
#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
-#define TK_RELEASE_SERIAL 2
+#define TK_RELEASE_SERIAL 3
#define TK_VERSION "8.5"
-#define TK_PATCH_LEVEL "8.5.2"
+#define TK_PATCH_LEVEL "8.5.3b1"
/*
* A special definition used to allow this header file to be included from
diff --git a/generic/tkArgv.c b/generic/tkArgv.c
index 77d4dd4..2c5c2d6 100644
--- a/generic/tkArgv.c
+++ b/generic/tkArgv.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkArgv.c,v 1.5.2.4 2007/11/21 16:46:26 dgp Exp $
+ * RCS: @(#) $Id: tkArgv.c,v 1.5.2.5 2008/06/25 16:46:03 dgp Exp $
*/
#include "tkInt.h"
@@ -338,8 +338,6 @@ PrintUsage(
{
register Tk_ArgvInfo *infoPtr;
size_t width, i, numSpaces;
-#define NUM_SPACES 20
- static char spaces[] = " ";
char tmp[TCL_DOUBLE_SPACE];
/*
@@ -372,13 +370,8 @@ PrintUsage(
}
Tcl_AppendResult(interp, "\n ", infoPtr->key, ":", NULL);
numSpaces = width + 1 - strlen(infoPtr->key);
- while (numSpaces > 0) {
- if (numSpaces >= NUM_SPACES) {
- Tcl_AppendResult(interp, spaces, NULL);
- } else {
- Tcl_AppendResult(interp, spaces+NUM_SPACES-numSpaces,NULL);
- }
- numSpaces -= NUM_SPACES;
+ while (numSpaces-- > 0) {
+ Tcl_AppendResult(interp, " ", NULL);
}
Tcl_AppendResult(interp, infoPtr->help, NULL);
switch (infoPtr->type) {
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index c381ef6..0d40d2a 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvas.c,v 1.43.2.2 2007/10/15 18:38:32 dgp Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.43.2.3 2008/06/25 16:46:04 dgp Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -4483,9 +4483,6 @@ PickCurrentItem(
buttonDown = canvasPtr->state
& (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask);
- if (!buttonDown) {
- canvasPtr->flags &= ~LEFT_GRABBED_ITEM;
- }
/*
* Save information about this event in the canvas. The event in the
@@ -4560,6 +4557,10 @@ PickCurrentItem(
return;
}
+ 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
diff --git a/generic/tkInt.h b/generic/tkInt.h
index db5643a..fb02a82 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: $Id: tkInt.h,v 1.77.2.4 2008/03/26 20:09:32 dgp Exp $
+ * RCS: $Id: tkInt.h,v 1.77.2.5 2008/06/25 16:46:04 dgp Exp $
*/
#ifndef _TKINT
@@ -43,7 +43,7 @@
# ifdef BIG_ENDIAN
# if BYTE_ORDER == BIG_ENDIAN
# undef WORDS_BIGENDIAN
-# define WORDS_BIGENDIAN
+# define WORDS_BIGENDIAN 1
# endif
# endif
# ifdef LITTLE_ENDIAN
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index 3b38cbe..2d2b62a 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPointer.c,v 1.10 2005/11/15 15:18:22 dkf Exp $
+ * RCS: @(#) $Id: tkPointer.c,v 1.10.2.1 2008/06/25 16:46:04 dgp Exp $
*/
#include "tkInt.h"
@@ -309,14 +309,12 @@ Tk_UpdatePointer(
/*
* ButtonRelease - Release the mouse capture and clear the
- * restrict window when the last button is released and we
- * aren't in a global grab.
+ * restrict window when the last button is released. If we
+ * are in a global grab, restore the grab window capture.
*/
if ((tsdPtr->lastState & ALL_BUTTONS) == mask) {
- if (!tsdPtr->grabWinPtr) {
- TkpSetCapture(NULL);
- }
+ TkpSetCapture(tsdPtr->grabWinPtr);
}
/*
diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c
index 76ae4e3..6103ff5 100644
--- a/generic/tkStubLib.c
+++ b/generic/tkStubLib.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkStubLib.c,v 1.14.2.4 2008/03/26 20:09:32 dgp Exp $
+ * RCS: @(#) $Id: tkStubLib.c,v 1.14.2.5 2008/06/25 16:46:04 dgp Exp $
*/
/*
@@ -114,7 +114,10 @@ Tk_InitStubs(
p++; q++;
}
if (*p) {
+ /* Construct error message */
+ Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
return NULL;
+
}
} else {
actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 0ad9bbe..6753905 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.80.2.5 2007/11/21 16:46:26 dgp Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.80.2.6 2008/06/25 16:46:04 dgp Exp $
*/
#include "tkInt.h"
@@ -3080,7 +3080,6 @@ Initialize(
if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv,
argTable, TK_ARGV_DONT_SKIP_FIRST_ARG|TK_ARGV_NO_DEFAULTS)
!= TCL_OK) {
- ckfree((char *) argv);
goto argError;
}
p = Tcl_Merge(argc, argv);
@@ -3308,6 +3307,8 @@ Tk_PkgInitStubsCheck(
}
if (count == 1) {
if (0 != strncmp(version, actualVersion, strlen(version))) {
+ /* Construct error message */
+ Tcl_PkgPresent(interp, "Tk", version, 1);
return NULL;
}
} else {
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 51bb36e..e555daf 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -1,4 +1,4 @@
-/* $Id: ttkLabel.c,v 1.8.2.1 2007/11/21 16:46:27 dgp Exp $
+/* $Id: ttkLabel.c,v 1.8.2.2 2008/06/25 16:46:05 dgp Exp $
*
* text, image, and label elements.
*
@@ -314,6 +314,12 @@ static void ImageDraw(
height = Tk_Height(tkwin) - b.y;
}
+ if (height <= 0 || width <= 0) {
+ /* Completely clipped - bail out.
+ */
+ return;
+ }
+
Tk_RedrawImage(image->tkimg, 0,0, width, height, d, b.x, b.y);
/* If we're disabled there's no state-specific 'disabled' image,
diff --git a/library/tk.tcl b/library/tk.tcl
index f92987b..78a8a1b 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,7 +3,7 @@
# Initialization script normally executed in the interpreter for each
# Tk-based application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.63.2.8 2008/03/07 22:15:10 dgp Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.63.2.9 2008/06/25 16:46:05 dgp Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -17,7 +17,7 @@ package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp
# Insist on running with compatible version of Tcl
package require Tcl 8.5.0-8.6
# Verify that we have Tk binary and script components from the same release
-package require -exact Tk 8.5.2
+package require -exact Tk 8.5.3b1
# Create a ::tk namespace
namespace eval ::tk {
@@ -355,7 +355,7 @@ if {![llength [info command tk_chooseDirectory]]} {
# Define the set of common virtual events.
#----------------------------------------------------------------------
-switch -- [tk windowingsystem] {
+switch -exact -- [tk windowingsystem] {
"x11" {
event add <<Cut>> <Control-Key-x> <Key-F20>
event add <<Copy>> <Control-Key-c> <Key-F16>
@@ -510,7 +510,7 @@ proc ::tk::AmpWidget {class path args} {
}
}
set result [$class $path {*}$options]
- if {$class eq "button"} {
+ if {[string match "*button" $class]} {
bind $path <<AltUnderlined>> [list $path invoke]
}
return $result
@@ -539,8 +539,8 @@ proc ::tk::AmpMenuArgs {widget add type args} {
#
proc ::tk::FindAltKeyTarget {path char} {
switch -- [winfo class $path] {
- Button -
- Label {
+ Button - Label -
+ TButton - TLabel - TCheckbutton {
if {[string equal -nocase $char \
[string index [$path cget -text] [$path cget -underline]]]} {
return $path
diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl
index ec653b0..a36c2de 100644
--- a/library/ttk/treeview.tcl
+++ b/library/ttk/treeview.tcl
@@ -1,4 +1,4 @@
-# $Id: treeview.tcl,v 1.2.2.2 2008/01/31 02:59:18 dgp Exp $
+# $Id: treeview.tcl,v 1.2.2.3 2008/06/25 16:46:05 dgp Exp $
#
# ttk::treeview widget bindings and utilities.
#
@@ -280,7 +280,7 @@ proc ttk::treeview::select.choose.extended {w item} {
BrowseTo $w $item
}
proc ttk::treeview::select.toggle.extended {w item} {
- $w selection toggle $item
+ $w selection toggle [list $item]
}
proc ttk::treeview::select.extend.extended {w item} {
if {[set anchor [$w focus]] ne ""} {
diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl
index eba4676..3ba93a9 100644
--- a/library/ttk/xpTheme.tcl
+++ b/library/ttk/xpTheme.tcl
@@ -1,5 +1,5 @@
#
-# $Id: xpTheme.tcl,v 1.3.2.2 2007/11/21 16:46:27 dgp Exp $
+# $Id: xpTheme.tcl,v 1.3.2.3 2008/06/25 16:46:06 dgp Exp $
#
# Settings for 'xpnative' theme
#
@@ -43,7 +43,7 @@ namespace eval ttk::theme::xpnative {
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- ttk::style configure TLabelframe -foreground "#0046d5"
+ ttk::style configure TLabelframe.Label -foreground "#0046d5"
# OR: -padding {3 3 3 6}, which some apps seem to use.
ttk::style configure TEntry -padding {2 2 2 4}
diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile
index f98627c..6def6b2 100644
--- a/macosx/GNUmakefile
+++ b/macosx/GNUmakefile
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: GNUmakefile,v 1.8.2.1 2008/03/13 14:57:33 dgp Exp $
+# RCS: @(#) $Id: GNUmakefile,v 1.8.2.2 2008/06/25 16:46:06 dgp Exp $
#
########################################################################################################
@@ -86,7 +86,7 @@ OBJ_DIR = ${OBJROOT}/${BUILD_STYLE}
empty :=
space := ${empty} ${empty}
-objdir := $(subst ${space},\ ,${OBJ_DIR})
+objdir = $(subst ${space},\ ,${OBJ_DIR})
develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols
deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip
diff --git a/macosx/README b/macosx/README
index 13b3fe7..7e90cee 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
Tcl/Tk Mac OS X README
----------------------
-RCS: @(#) $Id: README,v 1.23.2.2 2007/09/06 18:23:54 dgp Exp $
+RCS: @(#) $Id: README,v 1.23.2.3 2008/06/25 16:46:06 dgp Exp $
This is the README file for the Mac OS X/Darwin version of Tcl/Tk.
@@ -170,14 +170,19 @@ take care to only use the project matching your DevTools and OS version:
'Tk' target that simply calls through to the tcl/macosx/GNUMakefile. It
requires a build of the 'Tcl' target of tcl/macosx/Tcl.pbproj.
* Wish.xcode Xcode 2.4 on 10.4 and Xcode 2.5 on 10.4 and later, which
- additionally has a native 'tktest' target useful for debugging, this
- target's 'Debug' build configuration has ZeroLink and Fix&Continue
- enabled, use the 'DebugNoFixZL' build configuration if you need a debug
- build without these features. The following additional build
- configurations are available for the 'Tk' and 'tktest' targets:
+ additionally has native 'tktest' and 'tktest-X11' targets for
+ debugging, these targets' 'Debug' build configuration has ZeroLink and
+ Fix&Continue enabled, use the 'DebugNoFixZL' build configuration if you
+ need a debug build without these features. The following build
+ configurations are available:
'DebugUnthreaded': debug build with threading turned off.
+ 'DebugNoCF': debug build with corefoundation turned off
+ (for 'tktest-X11' only).
+ 'DebugNoCFUnthreaded': debug build with corefoundation turned off
+ (for 'tktest-X11' only) and with threading turned off.
'DebugMemCompile': debug build with memory and bytecode debugging on.
'DebugLeaks': debug build with PURIFY defined.
+ 'DebugGCov': debug build with generation of gcov data files enabled.
'ReleaseUniversal': builds the targets as universal binaries for the
ppc and i386 architectures.
'ReleaseUniversal10.4uSDK': same as 'ReleaseUniversal' but builds
@@ -188,10 +193,21 @@ take care to only use the project matching your DevTools and OS version:
'ReleasePPC10.2.8SDK': builds for PowerPC with gcc-3.3 against the
10.2.8 SDK, useful to verify on Tiger that building on Jaguar
would succeed.
- * Wish.xcodeproj for Xcode 3.0 on 10.5 and later, which has the following
- additional build configuration:
+ * Wish.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following
+ additional build configurations:
'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds
against the 10.5 SDK on Leopard (with 10.5 deployment target).
+ 'Debug gcc42': same as 'Debug' but builds with gcc 4.2.
+ 'Debug llvmgcc42': same as 'Debug' but builds with llvm-gcc 4.2.
+ 'ReleaseUniversal gcc42': same as 'ReleaseUniversal' but builds with
+ gcc 4.2.
+ 'ReleaseUniversal llvmgcc42': same as 'ReleaseUniversal' but builds
+ with llvm-gcc 4.2.
+ 'Debug64bit': builds the 'tktest-X11' target as 64bit with debugging
+ enabled (requires a 64bit capable processor).
+ Note that all non-SDK configurations have 10.5 deployment target and
+ that all Universal configurations build the 'tktest-X11' target
+ also for the ppc64 and x86_64 architectures.
Notes about the native targets of the Xcode projects:
* the Xcode projects refer to the toplevel tcl and tk source dirs through
diff --git a/macosx/Wish.xcode/default.pbxuser b/macosx/Wish.xcode/default.pbxuser
index 2972778..c832f6b 100644
--- a/macosx/Wish.xcode/default.pbxuser
+++ b/macosx/Wish.xcode/default.pbxuser
@@ -214,7 +214,7 @@
sourceDirectories = (
);
};
- F9FD30B30CC1AD070073837D /* tktest-X11 */ = {
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
activeExec = 0;
executables = (
F9FD31F50CC1AD070073837D /* tktest-X11 */,
diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj
index 4737c43..efcf867 100644
--- a/macosx/Wish.xcode/project.pbxproj
+++ b/macosx/Wish.xcode/project.pbxproj
@@ -598,6 +598,7 @@
F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = "<group>"; };
F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = "<group>"; };
F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = "<group>"; };
+ F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = "<group>"; };
F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = "<group>"; };
F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = "<group>"; };
F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = "<group>"; };
@@ -605,6 +606,7 @@
F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
+ F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
@@ -2093,7 +2095,7 @@
F966C06F08F281DC005CB29B /* Frameworks */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
- comments = "Copyright (c) 2004-2007 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.13.2.7 2007/11/16 07:14:35 dgp Exp $\n";
+ comments = "Copyright (c) 2004-2007 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.13.2.8 2008/06/25 16:46:10 dgp Exp $\n";
name = Wish;
path = .;
sourceTree = SOURCE_ROOT;
@@ -2487,6 +2489,7 @@
F966BB3508F27A39005CB29B /* image2.tcl */,
F966BB4208F27A3A005CB29B /* items.tcl */,
F966BB4308F27A3A005CB29B /* ixset */,
+ F92240290D7C620F005EC715 /* knightstour.tcl */,
F966BB4408F27A3A005CB29B /* label.tcl */,
F966BB4508F27A3A005CB29B /* labelframe.tcl */,
F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */,
@@ -2948,6 +2951,7 @@
F96888610AF7880C000797B5 /* treeview.test */,
F96888620AF7880C000797B5 /* ttk.test */,
F96888630AF7880C000797B5 /* validate.test */,
+ F962F7C60DADC26200648DB8 /* vsapi.test */,
);
path = ttk;
sourceTree = "<group>";
@@ -3864,7 +3868,7 @@
F9EA4ADE08FA3B7F00B1F5F0 /* Rez */,
8DD76FAB0486AB0100D96B5E /* Sources */,
8DD76FAD0486AB0100D96B5E /* Frameworks */,
- F975AC0108F824170068008A /* ShellScript */,
+ F95FA74C0B32CE190072E431 /* ShellScript */,
);
buildRules = (
);
@@ -3876,24 +3880,9 @@
productReference = 8DD76FB20486AB0100D96B5E /* tktest */;
productType = "com.apple.product-type.tool";
};
- F9E61D16090A3E94002B3151 /* Tk */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
- buildPhases = (
- F97AF02F0B665DA900310EA2 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Tk;
- productName = Wish;
- productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
- productType = "com.apple.product-type.application";
- };
- F9FD30B30CC1AD070073837D /* tktest-X11 */ = {
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
isa = PBXNativeTarget;
- buildConfigurationList = F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */;
+ buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */;
buildPhases = (
F9FD30B40CC1AD070073837D /* ShellScript */,
F9FD30B50CC1AD070073837D /* ShellScript */,
@@ -3910,6 +3899,21 @@
productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */;
productType = "com.apple.product-type.tool";
};
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
+ buildPhases = (
+ F97AF02F0B665DA900310EA2 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Tk;
+ productName = Wish;
+ productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
+ productType = "com.apple.product-type.application";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -3923,7 +3927,7 @@
targets = (
F9E61D16090A3E94002B3151 /* Tk */,
8DD76FA90486AB0100D96B5E /* tktest */,
- F9FD30B30CC1AD070073837D /* tktest-X11 */,
+ F97258A50A86873C00096C78 /* tktest-X11 */,
);
};
/* End PBXProject section */
@@ -3943,7 +3947,7 @@
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- F975AC0108F824170068008A /* ShellScript */ = {
+ F95FA74C0B32CE190072E431 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -3965,12 +3969,14 @@
files = (
);
inputPaths = (
+ "${TARGET_TEMP_DIR}/.none",
);
outputPaths = (
+ "${TARGET_BUILD_DIR}/${WRAPPER_NAME}",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nexit ${result}\n";
+ shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n";
};
F9A5C5F508F651A2008AE941 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -4031,7 +4037,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
};
F9FD30B50CC1AD070073837D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -4050,7 +4056,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
};
/* End PBXShellScriptBuildPhase section */
@@ -4646,6 +4652,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = ReleaseUniversal;
};
@@ -4678,6 +4685,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = DebugMemCompile;
};
@@ -4692,6 +4700,22 @@
};
name = DebugMemCompile;
};
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugMemCompile;
+ };
F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
@@ -4702,10 +4726,61 @@
};
name = DebugMemCompile;
};
+ F9359B250DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.2;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS)",
+ "-lgcov",
+ );
+ PREBINDING = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B260DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B270DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugGCov;
+ };
+ F9359B280DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugGCov;
+ };
F95CC8AC09158F3100EA5ACE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = Debug;
};
@@ -4713,6 +4788,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = Release;
};
@@ -4720,6 +4796,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = DebugNoFixZL;
};
@@ -4792,10 +4869,226 @@
};
name = DebugNoFixZL;
};
+ F97258A90A86873D00096C78 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ ZERO_LINK = YES;
+ };
+ name = Debug;
+ };
+ F97258AA0A86873D00096C78 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Release;
+ };
+ F97258AB0A86873D00096C78 /* DebugNoFixZL */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoFixZL;
+ };
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal;
+ };
+ F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal10.4uSDK;
+ };
+ F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleasePPC10.3.9SDK;
+ };
+ F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleasePPC10.2.8SDK;
+ };
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation";
+ MACOSX_DEPLOYMENT_TARGET = 10.2;
+ PREBINDING = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCF;
+ };
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCF;
+ };
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation";
+ MACOSX_DEPLOYMENT_TARGET = 10.2;
+ PREBINDING = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCFUnthreaded;
+ };
F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = DebugUnthreaded;
};
@@ -4803,6 +5096,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = DebugLeaks;
};
@@ -4828,6 +5122,38 @@
};
name = DebugLeaks;
};
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7400BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugLeaks;
+ };
F99EE7410BE835310060D4AF /* DebugUnthreaded */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
@@ -4855,6 +5181,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = ReleaseUniversal10.4uSDK;
};
@@ -4890,6 +5217,7 @@
buildSettings = {
LDFLAGS = "-force_cpusubtype_ALL $(LDFLAGS)";
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = ReleasePPC10.3.9SDK;
};
@@ -4921,6 +5249,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
};
name = ReleasePPC10.2.8SDK;
};
@@ -4956,175 +5285,6 @@
};
name = ReleasePPC10.2.8SDK;
};
- F9FD31E90CC1AD070073837D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "__private_extern__=extern",
- "$(GCC_PREPROCESSOR_DEFINITIONS)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- F9FD31EA0CC1AD070073837D /* DebugNoFixZL */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugNoFixZL;
- };
- F9FD31EB0CC1AD070073837D /* DebugUnthreaded */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugUnthreaded;
- };
- F9FD31EC0CC1AD070073837D /* DebugMemCompile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugMemCompile;
- };
- F9FD31ED0CC1AD070073837D /* DebugLeaks */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugLeaks;
- };
- F9FD31EE0CC1AD070073837D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = Release;
- };
- F9FD31EF0CC1AD070073837D /* ReleaseUniversal */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleaseUniversal;
- };
- F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleaseUniversal10.4uSDK;
- };
- F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleasePPC10.3.9SDK;
- };
- F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleasePPC10.2.8SDK;
- };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -5134,8 +5294,11 @@
F95CC8AC09158F3100EA5ACE /* Debug */,
F95CC8AE09158F3100EA5ACE /* DebugNoFixZL */,
F99EE73B0BE835310060D4AF /* DebugUnthreaded */,
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F93084370BB93D2800CD0B9E /* DebugMemCompile */,
F99EE73C0BE835310060D4AF /* DebugLeaks */,
+ F9359B260DF212DA00E04F67 /* DebugGCov */,
F95CC8AD09158F3100EA5ACE /* Release */,
F91BCC4F093152310042A6BF /* ReleaseUniversal */,
F9DB62080B65ADA800A370FB /* ReleaseUniversal10.4uSDK */,
@@ -5151,8 +5314,11 @@
F95CC8B109158F3100EA5ACE /* Debug */,
F95CC8B309158F3100EA5ACE /* DebugNoFixZL */,
F99EE73D0BE835310060D4AF /* DebugUnthreaded */,
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F93084380BB93D2800CD0B9E /* DebugMemCompile */,
F99EE73E0BE835310060D4AF /* DebugLeaks */,
+ F9359B270DF212DA00E04F67 /* DebugGCov */,
F95CC8B209158F3100EA5ACE /* Release */,
F91BCC50093152310042A6BF /* ReleaseUniversal */,
F9DB62090B65ADA800A370FB /* ReleaseUniversal10.4uSDK */,
@@ -5168,8 +5334,11 @@
F95CC8B609158F3100EA5ACE /* Debug */,
F95CC8B809158F3100EA5ACE /* DebugNoFixZL */,
F99EE7410BE835310060D4AF /* DebugUnthreaded */,
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F930843A0BB93D2800CD0B9E /* DebugMemCompile */,
F99EE7420BE835310060D4AF /* DebugLeaks */,
+ F9359B250DF212DA00E04F67 /* DebugGCov */,
F95CC8B709158F3100EA5ACE /* Release */,
F91BCC51093152310042A6BF /* ReleaseUniversal */,
F9DB620A0B65ADA800A370FB /* ReleaseUniversal10.4uSDK */,
@@ -5179,19 +5348,22 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
- F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
+ F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- F9FD31E90CC1AD070073837D /* Debug */,
- F9FD31EA0CC1AD070073837D /* DebugNoFixZL */,
- F9FD31EB0CC1AD070073837D /* DebugUnthreaded */,
- F9FD31EC0CC1AD070073837D /* DebugMemCompile */,
- F9FD31ED0CC1AD070073837D /* DebugLeaks */,
- F9FD31EE0CC1AD070073837D /* Release */,
- F9FD31EF0CC1AD070073837D /* ReleaseUniversal */,
- F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */,
- F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */,
- F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */,
+ F97258A90A86873D00096C78 /* Debug */,
+ F97258AB0A86873D00096C78 /* DebugNoFixZL */,
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */,
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7400BE835310060D4AF /* DebugLeaks */,
+ F9359B280DF212DA00E04F67 /* DebugGCov */,
+ F97258AA0A86873D00096C78 /* Release */,
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */,
+ F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */,
+ F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */,
+ F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
diff --git a/macosx/Wish.xcodeproj/default.pbxuser b/macosx/Wish.xcodeproj/default.pbxuser
index 0495782..cd9a9a6 100644
--- a/macosx/Wish.xcodeproj/default.pbxuser
+++ b/macosx/Wish.xcodeproj/default.pbxuser
@@ -216,7 +216,7 @@
sourceDirectories = (
);
};
- F9FD30B30CC1AD070073837D /* tktest-X11 */ = {
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
activeExec = 0;
executables = (
F9FD31F50CC1AD070073837D /* tktest-X11 */,
diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj
index 58b51e3..096280a 100644
--- a/macosx/Wish.xcodeproj/project.pbxproj
+++ b/macosx/Wish.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 42;
+ objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
@@ -608,6 +608,7 @@
F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = "<group>"; };
F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = "<group>"; };
F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = "<group>"; };
+ F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = "<group>"; };
F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = "<group>"; };
F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = "<group>"; };
F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = "<group>"; };
@@ -2097,7 +2098,7 @@
F966C06F08F281DC005CB29B /* Frameworks */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
- comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.21.2.12 2008/03/13 14:57:33 dgp Exp $\n";
+ comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.21.2.13 2008/06/25 16:46:12 dgp Exp $\n";
name = Wish;
path = .;
sourceTree = SOURCE_ROOT;
@@ -2953,6 +2954,7 @@
F96888610AF7880C000797B5 /* treeview.test */,
F96888620AF7880C000797B5 /* ttk.test */,
F96888630AF7880C000797B5 /* validate.test */,
+ F962F7C60DADC26200648DB8 /* vsapi.test */,
);
path = ttk;
sourceTree = "<group>";
@@ -3870,7 +3872,7 @@
F9EA4ADE08FA3B7F00B1F5F0 /* Rez */,
8DD76FAB0486AB0100D96B5E /* Sources */,
8DD76FAD0486AB0100D96B5E /* Frameworks */,
- F975AC0108F824170068008A /* ShellScript */,
+ F95FA74C0B32CE190072E431 /* ShellScript */,
);
buildRules = (
);
@@ -3882,24 +3884,9 @@
productReference = 8DD76FB20486AB0100D96B5E /* tktest */;
productType = "com.apple.product-type.tool";
};
- F9E61D16090A3E94002B3151 /* Tk */ = {
+ F97258A50A86873C00096C78 /* tktest-X11 */ = {
isa = PBXNativeTarget;
- buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
- buildPhases = (
- F97AF02F0B665DA900310EA2 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Tk;
- productName = Wish;
- productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
- productType = "com.apple.product-type.application";
- };
- F9FD30B30CC1AD070073837D /* tktest-X11 */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */;
+ buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */;
buildPhases = (
F9FD30B40CC1AD070073837D /* ShellScript */,
F9FD30B50CC1AD070073837D /* ShellScript */,
@@ -3916,16 +3903,31 @@
productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */;
productType = "com.apple.product-type.tool";
};
+ F9E61D16090A3E94002B3151 /* Tk */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */;
+ buildPhases = (
+ F97AF02F0B665DA900310EA2 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Tk;
+ productName = Wish;
+ productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */;
+ productType = "com.apple.product-type.application";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- BuildIndependentTargetsInParallel = NO;
+ BuildIndependentTargetsInParallel = YES;
};
buildConfigurationList = F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Wish" */;
- compatibilityVersion = "Xcode 2.4";
+ compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* Wish */;
projectDirPath = "";
@@ -3933,7 +3935,7 @@
targets = (
F9E61D16090A3E94002B3151 /* Tk */,
8DD76FA90486AB0100D96B5E /* tktest */,
- F9FD30B30CC1AD070073837D /* tktest-X11 */,
+ F97258A50A86873C00096C78 /* tktest-X11 */,
);
};
/* End PBXProject section */
@@ -3953,7 +3955,7 @@
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- F975AC0108F824170068008A /* ShellScript */ = {
+ F95FA74C0B32CE190072E431 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -3967,7 +3969,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TARGET_TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/..namedfork/rsrc\"\nfi\n";
+ shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TARGET_TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n";
showEnvVarsInLog = 0;
};
F97AF02F0B665DA900310EA2 /* ShellScript */ = {
@@ -4047,7 +4049,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
+ shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n";
showEnvVarsInLog = 0;
};
F9FD30B50CC1AD070073837D /* ShellScript */ = {
@@ -4067,7 +4069,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
+ shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -4224,6 +4226,7 @@
F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */,
F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */,
F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */,
+ F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */,
F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */,
F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */,
F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */,
@@ -4371,7 +4374,6 @@
F966C02C08F27A42005CB29B /* xgc.c in Sources */,
F966C02D08F27A42005CB29B /* ximage.c in Sources */,
F966C02E08F27A42005CB29B /* xutil.c in Sources */,
- F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4526,6 +4528,7 @@
F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */,
F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */,
F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */,
+ F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */,
F9FD314F0CC1AD070073837D /* tk3d.c in Sources */,
F9FD31500CC1AD070073837D /* tkArgv.c in Sources */,
F9FD31510CC1AD070073837D /* tkAtom.c in Sources */,
@@ -4655,7 +4658,6 @@
F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */,
F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */,
F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */,
- F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4685,11 +4687,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- CFLAGS = "-arch ppc -arch i386 $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CFLAGS = "-arch i386 -arch ppc $(CFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
};
@@ -4714,6 +4713,22 @@
};
name = DebugMemCompile;
};
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugMemCompile;
+ };
F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
@@ -4724,6 +4739,56 @@
};
name = DebugMemCompile;
};
+ F9359B250DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS)",
+ "-lgcov",
+ );
+ PREBINDING = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B260DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugGCov;
+ };
+ F9359B270DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugGCov;
+ };
+ F9359B280DF212DA00E04F67 /* DebugGCov */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugGCov;
+ };
F95CC8AC09158F3100EA5ACE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -4764,7 +4829,6 @@
"$(OTHER_LDFLAGS)",
);
PRODUCT_NAME = tktest;
- ZERO_LINK = YES;
};
name = Debug;
};
@@ -4804,7 +4868,7 @@
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.5;
- PREBINDING = YES;
+ PREBINDING = NO;
};
name = Release;
};
@@ -4817,7 +4881,7 @@
};
name = DebugNoFixZL;
};
- F98A2A230D85F1CB002A40A7 /* Debug gcc42 */ = {
+ F97258A90A86873D00096C78 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
@@ -4838,21 +4902,28 @@
"$(LIBRARY_SEARCH_PATHS)",
);
PRODUCT_NAME = "tktest-X11";
- ZERO_LINK = YES;
};
- name = "Debug gcc42";
+ name = Debug;
};
- F98A2A270D85F1DB002A40A7 /* Debug llvmgcc42 */ = {
+ F97258AA0A86873D00096C78 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "__private_extern__=extern",
- "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
);
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Release;
+ };
+ F97258AB0A86873D00096C78 /* DebugNoFixZL */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
HEADER_SEARCH_PATHS = (
/usr/X11R6/include,
/usr/X11R6/include/freetype2,
@@ -4863,20 +4934,30 @@
"$(LIBRARY_SEARCH_PATHS)",
);
PRODUCT_NAME = "tktest-X11";
- ZERO_LINK = YES;
};
- name = "Debug llvmgcc42";
+ name = DebugNoFixZL;
};
- F98A2A2B0D85F1E7002A40A7 /* ReleaseUniversal gcc42 */ = {
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc,
- ppc64,
- i386,
- x86_64,
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)";
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
);
- CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)";
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleaseUniversal;
+ };
+ F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
HEADER_SEARCH_PATHS = (
/usr/X11R6/include,
/usr/X11R6/include/freetype2,
@@ -4888,17 +4969,27 @@
);
PRODUCT_NAME = "tktest-X11";
};
- name = "ReleaseUniversal gcc42";
+ name = ReleaseUniversal10.4uSDK;
};
- F98A2A2F0D85F1EC002A40A7 /* ReleaseUniversal llvmgcc42 */ = {
+ F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- x86_64,
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
);
- CFLAGS = "-arch ppc -arch i386 -arch x86_64 $(CFLAGS)";
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = ReleasePPC10.3.9SDK;
+ };
+ F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
HEADER_SEARCH_PATHS = (
/usr/X11R6/include,
/usr/X11R6/include/freetype2,
@@ -4910,7 +5001,148 @@
);
PRODUCT_NAME = "tktest-X11";
};
- name = "ReleaseUniversal llvmgcc42";
+ name = ReleasePPC10.2.8SDK;
+ };
+ F97AED1B0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = Debug64bit;
+ };
+ F97AED1C0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = Debug64bit;
+ };
+ F97AED1D0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = Debug64bit;
+ };
+ F97AED1E0B660B2100310EA2 /* Debug64bit */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_64_BIT)";
+ CONFIGURE_ARGS = "--enable-64bit $(CONFIGURE_ARGS)";
+ CPPFLAGS = "-arch $(NATIVE_ARCH_64_BIT) $(CPPFLAGS)";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = Debug64bit;
+ };
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCF;
+ };
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCF;
+ };
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCF;
+ };
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ PRODUCT_NAME = Wish;
+ SKIP_INSTALL = NO;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation";
+ OTHER_LDFLAGS = (
+ "$(OTHER_LDFLAGS_AQUA)",
+ "$(OTHER_LDFLAGS)",
+ );
+ PRODUCT_NAME = tktest;
+ };
+ name = DebugNoCFUnthreaded;
+ };
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugNoCFUnthreaded;
};
F9988AB10D814C6500B6B03B /* Debug gcc42 */ = {
isa = XCBuildConfiguration;
@@ -4946,7 +5178,30 @@
"$(OTHER_LDFLAGS)",
);
PRODUCT_NAME = tktest;
- ZERO_LINK = YES;
+ };
+ name = "Debug gcc42";
+ };
+ F9988AB40D814C6500B6B03B /* Debug gcc42 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
};
name = "Debug gcc42";
};
@@ -4954,8 +5209,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
buildSettings = {
- GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc";
- GCC_VERSION = 4.2;
+ CC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc-4.2";
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
};
@@ -4985,7 +5240,30 @@
"$(OTHER_LDFLAGS)",
);
PRODUCT_NAME = tktest;
- ZERO_LINK = YES;
+ };
+ name = "Debug llvmgcc42";
+ };
+ F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "__private_extern__=extern",
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
};
name = "Debug llvmgcc42";
};
@@ -4993,11 +5271,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- CFLAGS = "-arch ppc -arch i386 $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CFLAGS = "-arch i386 -arch ppc $(CFLAGS)";
GCC_VERSION = 4.2;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
@@ -5023,21 +5298,39 @@
};
name = "ReleaseUniversal gcc42";
};
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)";
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal gcc42";
+ };
F9988BB50D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- CFLAGS = "-arch ppc -arch i386 $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc-4.2";
+ CFLAGS = "-arch i386 -arch ppc $(CFLAGS)";
DEBUG_INFORMATION_FORMAT = dwarf;
- GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc";
GCC_OPTIMIZATION_LEVEL = 4;
- GCC_VERSION = 4.2;
+ GCC_VERSION = com.apple.compilers.llvmgcc42;
MACOSX_DEPLOYMENT_TARGET = 10.5;
- OTHER_CFLAGS = "-emit-llvm";
+ OTHER_CFLAGS = (
+ "$(OTHER_CFLAGS)",
+ "-emit-llvm",
+ );
PREBINDING = NO;
TCL_CONFIGURE_ARGS = "$(TCL_CONFIGURE_ARGS) --disable-dtrace";
};
@@ -5062,6 +5355,24 @@
};
name = "ReleaseUniversal llvmgcc42";
};
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)";
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = "ReleaseUniversal llvmgcc42";
+ };
F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -5100,6 +5411,38 @@
};
name = DebugLeaks;
};
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugUnthreaded;
+ };
+ F99EE7400BE835310060D4AF /* DebugLeaks */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ /usr/X11R6/include,
+ /usr/X11R6/include/freetype2,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ /usr/X11R6/lib,
+ "$(LIBRARY_SEARCH_PATHS)",
+ );
+ PRODUCT_NAME = "tktest-X11";
+ };
+ name = DebugLeaks;
+ };
F99EE7410BE835310060D4AF /* DebugUnthreaded */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */;
@@ -5146,15 +5489,12 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- CFLAGS = "-arch ppc -arch i386 $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CFLAGS = "-arch i386 -arch ppc $(CFLAGS)";
CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.4;
PREBINDING = NO;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ SDKROOT = macosx10.4;
};
name = ReleaseUniversal10.4uSDK;
};
@@ -5187,7 +5527,7 @@
CPPFLAGS = "-arch ppc -isysroot $(SDKROOT) $(CPPFLAGS)";
MACOSX_DEPLOYMENT_TARGET = 10.3;
PREBINDING = YES;
- SDKROOT = /Developer/SDKs/MacOSX10.3.9.sdk;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk";
};
name = ReleasePPC10.3.9SDK;
};
@@ -5223,7 +5563,7 @@
LDFLAGS = "-L$(SDKROOT)/usr/lib/gcc/darwin/$(GCC_VERSION) -Wl,-syslibroot,$(SDKROOT)";
MACOSX_DEPLOYMENT_TARGET = 10.2;
PREBINDING = YES;
- SDKROOT = /Developer/SDKs/MacOSX10.2.8.sdk;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.2.8.sdk";
WARNING_CFLAGS = (
"$(WARNING_CFLAGS_GCC3)",
"-Wno-long-double",
@@ -5250,160 +5590,11 @@
};
name = ReleaseUniversal10.5SDK;
};
- F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
- buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
- CFLAGS = "-arch ppc -arch i386 $(CFLAGS)";
- CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
- MACOSX_DEPLOYMENT_TARGET = 10.5;
- PREBINDING = NO;
- SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
- };
- name = ReleaseUniversal10.5SDK;
- };
- F9FD31E90CC1AD070073837D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)";
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "__private_extern__=extern",
- "$(GCC_PREPROCESSOR_DEFINITIONS)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- F9FD31EA0CC1AD070073837D /* DebugNoFixZL */ = {
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
isa = XCBuildConfiguration;
buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugNoFixZL;
- };
- F9FD31EB0CC1AD070073837D /* DebugUnthreaded */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugUnthreaded;
- };
- F9FD31EC0CC1AD070073837D /* DebugMemCompile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugMemCompile;
- };
- F9FD31ED0CC1AD070073837D /* DebugLeaks */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = DebugLeaks;
- };
- F9FD31EE0CC1AD070073837D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = Release;
- };
- F9FD31EF0CC1AD070073837D /* ReleaseUniversal */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = (
- ppc,
- ppc64,
- i386,
- x86_64,
- );
- CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)";
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleaseUniversal;
- };
- F9FD31F00CC1AD070073837D /* ReleaseUniversal10.5SDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = (
- ppc,
- ppc64,
- i386,
- x86_64,
- );
- CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)";
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)";
HEADER_SEARCH_PATHS = (
/usr/X11R6/include,
/usr/X11R6/include/freetype2,
@@ -5417,53 +5608,18 @@
};
name = ReleaseUniversal10.5SDK;
};
- F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleaseUniversal10.4uSDK;
- };
- F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
- };
- name = ReleasePPC10.3.9SDK;
- };
- F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */ = {
+ F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = {
isa = XCBuildConfiguration;
+ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */;
buildSettings = {
- HEADER_SEARCH_PATHS = (
- /usr/X11R6/include,
- /usr/X11R6/include/freetype2,
- "$(HEADER_SEARCH_PATHS)",
- );
- LIBRARY_SEARCH_PATHS = (
- /usr/X11R6/lib,
- "$(LIBRARY_SEARCH_PATHS)",
- );
- PRODUCT_NAME = "tktest-X11";
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CFLAGS = "-arch i386 -arch ppc $(CFLAGS)";
+ CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)";
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ PREBINDING = NO;
+ SDKROOT = macosx10.5;
};
- name = ReleasePPC10.2.8SDK;
+ name = ReleaseUniversal10.5SDK;
};
/* End XCBuildConfiguration section */
@@ -5476,8 +5632,12 @@
F9988AB60D814C7500B6B03B /* Debug llvmgcc42 */,
F95CC8AE09158F3100EA5ACE /* DebugNoFixZL */,
F99EE73B0BE835310060D4AF /* DebugUnthreaded */,
+ F98751300DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F93084370BB93D2800CD0B9E /* DebugMemCompile */,
F99EE73C0BE835310060D4AF /* DebugLeaks */,
+ F9359B260DF212DA00E04F67 /* DebugGCov */,
+ F97AED1B0B660B2100310EA2 /* Debug64bit */,
F95CC8AD09158F3100EA5ACE /* Release */,
F91BCC4F093152310042A6BF /* ReleaseUniversal */,
F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc42 */,
@@ -5498,8 +5658,12 @@
F9988AB70D814C7500B6B03B /* Debug llvmgcc42 */,
F95CC8B309158F3100EA5ACE /* DebugNoFixZL */,
F99EE73D0BE835310060D4AF /* DebugUnthreaded */,
+ F98751310DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F93084380BB93D2800CD0B9E /* DebugMemCompile */,
F99EE73E0BE835310060D4AF /* DebugLeaks */,
+ F9359B270DF212DA00E04F67 /* DebugGCov */,
+ F97AED1C0B660B2100310EA2 /* Debug64bit */,
F95CC8B209158F3100EA5ACE /* Release */,
F91BCC50093152310042A6BF /* ReleaseUniversal */,
F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc42 */,
@@ -5520,8 +5684,12 @@
F9988AB50D814C7500B6B03B /* Debug llvmgcc42 */,
F95CC8B809158F3100EA5ACE /* DebugNoFixZL */,
F99EE7410BE835310060D4AF /* DebugUnthreaded */,
+ F987512F0DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
F930843A0BB93D2800CD0B9E /* DebugMemCompile */,
F99EE7420BE835310060D4AF /* DebugLeaks */,
+ F9359B250DF212DA00E04F67 /* DebugGCov */,
+ F97AED1E0B660B2100310EA2 /* Debug64bit */,
F95CC8B709158F3100EA5ACE /* Release */,
F91BCC51093152310042A6BF /* ReleaseUniversal */,
F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc42 */,
@@ -5534,24 +5702,28 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
};
- F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
+ F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- F9FD31E90CC1AD070073837D /* Debug */,
- F98A2A230D85F1CB002A40A7 /* Debug gcc42 */,
- F98A2A270D85F1DB002A40A7 /* Debug llvmgcc42 */,
- F9FD31EA0CC1AD070073837D /* DebugNoFixZL */,
- F9FD31EB0CC1AD070073837D /* DebugUnthreaded */,
- F9FD31EC0CC1AD070073837D /* DebugMemCompile */,
- F9FD31ED0CC1AD070073837D /* DebugLeaks */,
- F9FD31EE0CC1AD070073837D /* Release */,
- F9FD31EF0CC1AD070073837D /* ReleaseUniversal */,
- F98A2A2B0D85F1E7002A40A7 /* ReleaseUniversal gcc42 */,
- F98A2A2F0D85F1EC002A40A7 /* ReleaseUniversal llvmgcc42 */,
- F9FD31F00CC1AD070073837D /* ReleaseUniversal10.5SDK */,
- F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */,
- F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */,
- F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */,
+ F97258A90A86873D00096C78 /* Debug */,
+ F9988AB40D814C6500B6B03B /* Debug gcc42 */,
+ F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */,
+ F97258AB0A86873D00096C78 /* DebugNoFixZL */,
+ F99EE73F0BE835310060D4AF /* DebugUnthreaded */,
+ F98751320DE7B57E00B1C9EC /* DebugNoCF */,
+ F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */,
+ F93084390BB93D2800CD0B9E /* DebugMemCompile */,
+ F99EE7400BE835310060D4AF /* DebugLeaks */,
+ F9359B280DF212DA00E04F67 /* DebugGCov */,
+ F97AED1D0B660B2100310EA2 /* Debug64bit */,
+ F97258AA0A86873D00096C78 /* Release */,
+ F97258AC0A86873D00096C78 /* ReleaseUniversal */,
+ F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */,
+ F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */,
+ F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */,
+ F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */,
+ F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */,
+ F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug;
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 7b66a38..c13cdef 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.7 2007/04/23 21:24:32 das Exp $
+ * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.7.2.1 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXInt.h"
@@ -249,9 +249,9 @@ TkpGetNativeAppBitmap(
Str255 dummy;
/*
- * We need to first paint the background white. Also, for
- * some reason we *must* use GetCIcon instead of GetNamedResource
- * for PlotCIcon to work - so we use GetResInfo to get the id.
+ * We need to first paint the background white. Also, for some reason
+ * we *must* use GetCIcon instead of GetNamedResource for PlotCIcon to
+ * work - so we use GetResInfo to get the id.
*/
RGBForeColor(&white);
diff --git a/macosx/tkMacOSXCarbonEvents.c b/macosx/tkMacOSXCarbonEvents.c
index ccc39c5..2304c72 100644
--- a/macosx/tkMacOSXCarbonEvents.c
+++ b/macosx/tkMacOSXCarbonEvents.c
@@ -11,7 +11,7 @@
* application event target.
*
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2005-2008 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -60,7 +60,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.16.2.2 2007/11/12 19:22:38 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.16.2.3 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -224,46 +224,21 @@ TkMacOSXInitCarbonEvents(
applicationEventTypes, (void *) carbonEventInterp, NULL);
#ifdef TK_MAC_DEBUG_CARBON_EVENTS
- TkMacOSXInitNamedDebugSymbol(HIToolbox, void, _TraceEventByName,
- CFStringRef);
- if (_TraceEventByName) {
- /* Carbon-internal event debugging (c.f. Technote 2124) */
- _TraceEventByName(CFSTR("kEventRawKeyDown"));
- _TraceEventByName(CFSTR("kEventRawKeyRepeat"));
- _TraceEventByName(CFSTR("kEventRawKeyUp"));
- _TraceEventByName(CFSTR("kEventRawKeyModifiersChanged"));
- _TraceEventByName(CFSTR("kEventRawKeyRepeat"));
- _TraceEventByName(CFSTR("kEventMenuBeginTracking"));
- _TraceEventByName(CFSTR("kEventMenuEndTracking"));
- _TraceEventByName(CFSTR("kEventMenuOpening"));
- _TraceEventByName(CFSTR("kEventMenuTargetItem"));
- _TraceEventByName(CFSTR("kEventCommandProcess"));
- _TraceEventByName(CFSTR("kEventCommandUpdateStatus"));
- _TraceEventByName(CFSTR("kEventAppActivated"));
- _TraceEventByName(CFSTR("kEventAppDeactivated"));
- _TraceEventByName(CFSTR("kEventAppQuit"));
- _TraceEventByName(CFSTR("kEventAppHidden"));
- _TraceEventByName(CFSTR("kEventAppShown"));
- _TraceEventByName(CFSTR("kEventAppAvailableWindowBoundsChanged"));
- _TraceEventByName(CFSTR("kEventAppearanceScrollBarVariantChanged"));
- _TraceEventByName(CFSTR("kEventMouseDown"));
- _TraceEventByName(CFSTR("kEventMouseUp"));
-#if 0
- _TraceEventByName(CFSTR("kEventMouseMoved"));
- _TraceEventByName(CFSTR("kEventMouseDragged"));
-#endif
- _TraceEventByName(CFSTR("kEventMouseWheelMoved"));
- _TraceEventByName(CFSTR("kEventMouseScroll"));
- _TraceEventByName(CFSTR("kEventWindowActivated"));
- _TraceEventByName(CFSTR("kEventWindowDeactivated"));
- _TraceEventByName(CFSTR("kEventWindowUpdate"));
- _TraceEventByName(CFSTR("kEventWindowExpanding"));
- _TraceEventByName(CFSTR("kEventWindowBoundsChanged"));
- _TraceEventByName(CFSTR("kEventWindowDragStarted"));
- _TraceEventByName(CFSTR("kEventWindowDragCompleted"));
- _TraceEventByName(CFSTR("kEventWindowConstrain"));
- _TraceEventByName(CFSTR("kEventWindowGetRegion"));
- _TraceEventByName(CFSTR("kEventWindowDrawContent"));
+ TkMacOSXInitNamedSymbol(HIToolbox, void, DebugTraceEvent, OSType, UInt32,
+ Boolean);
+ if (DebugTraceEvent) {
+ unsigned int i;
+ const EventTypeSpec *e;
+
+ for (i = 0, e = dispatcherEventTypes;
+ i < GetEventTypeCount(dispatcherEventTypes); i++, e++) {
+ DebugTraceEvent(e->eventClass, e->eventKind, 1);
+ }
+ for (i = 0, e = applicationEventTypes;
+ i < GetEventTypeCount(applicationEventTypes); i++, e++) {
+ DebugTraceEvent(e->eventClass, e->eventKind, 1);
+ }
+ DebugTraceEvent = NULL; /* Only enable tracing once. */
}
#endif /* TK_MAC_DEBUG_CARBON_EVENTS */
}
@@ -310,6 +285,24 @@ TkMacOSXInstallWindowCarbonEventHandler(
carbonEventHandlerUPP, GetEventTypeCount(windowEventTypes),
windowEventTypes, (void *) (interp ? interp : carbonEventInterp),
NULL);
+
+#ifdef TK_MAC_DEBUG_CARBON_EVENTS
+ TkMacOSXInitNamedSymbol(HIToolbox, void, DebugTraceEvent, OSType, UInt32,
+ Boolean);
+ if (DebugTraceEvent) {
+ unsigned int i;
+ const EventTypeSpec *e;
+
+ for (i = 0, e = windowEventTypes;
+ i < GetEventTypeCount(windowEventTypes); i++, e++) {
+ if (!(e->eventClass == kEventClassMouse && (
+ e->eventKind == kEventMouseMoved ||
+ e->eventKind == kEventMouseDragged))) {
+ DebugTraceEvent(e->eventClass, e->eventKind, 1);
+ }
+ }
+ }
+#endif /* TK_MAC_DEBUG_CARBON_EVENTS */
}
/*
@@ -344,11 +337,11 @@ InstallStandardApplicationEventHandler(void)
* to be installed. Unfortunately there appears to be no public API to
* obtain the menubar event target. As a workaround, for now we resort
* to calling the HIToolbox-internal GetMenuBarEventTarget() directly
- * (symbol acquired via TkMacOSXInitNamedDebugSymbol() from HIToolbox
+ * (symbol acquired via TkMacOSXInitNamedSymbol() from HIToolbox
* version 343, may not exist in later versions).
*/
err = ChkErr(InstallStandardEventHandler, GetApplicationEventTarget());
- TkMacOSXInitNamedDebugSymbol(HIToolbox, EventTargetRef,
+ TkMacOSXInitNamedSymbol(HIToolbox, EventTargetRef,
GetMenuBarEventTarget, void);
if (GetMenuBarEventTarget) {
ChkErr(InstallStandardEventHandler, GetMenuBarEventTarget());
@@ -688,3 +681,12 @@ TkMacOSXReceiveAndDispatchEvent(void)
}
return err;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c
index ba3402b..29affa8 100644
--- a/macosx/tkMacOSXCursor.c
+++ b/macosx/tkMacOSXCursor.c
@@ -7,18 +7,18 @@
* Copyright 2001, Apple Computer, Inc.
* Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.11.2.1 2007/07/01 17:31:32 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.11.2.2 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
/*
- * There are three different ways to set the cursor on the Mac.
- * The default theme cursors (listed in cursorNames below),
- * color resource cursors, & normal cursors.
+ * There are three different ways to set the cursor on the Mac. The default
+ * theme cursors (listed in cursorNames below), color resource cursors, &
+ * normal cursors.
*/
#define NONE -1 /* Hidden cursor */
@@ -28,17 +28,17 @@
#define NORMAL 3 /* Cursors of type CURS. */
/*
- * The following data structure contains the system specific data
- * necessary to control Windows cursors.
+ * The following data structure contains the system specific data necessary to
+ * control Windows cursors.
*/
typedef struct {
TkCursor info; /* Generic cursor info used by tkCursor.c */
- Handle macCursor; /* Resource containing Macintosh cursor.
- * For theme cursors, this is -1. */
- int type; /* Type of Mac cursor: for theme cursors
- * this is the theme cursor constant,
- * otherwise one of crsr or CURS */
+ Handle macCursor; /* Resource containing Macintosh cursor. For
+ * theme cursors, this is -1. */
+ int type; /* Type of Mac cursor: for theme cursors this
+ * is the theme cursor constant, otherwise one
+ * of crsr or CURS. */
int count; /* For animating cursors, the count for the
* cursor. */
} TkMacOSXCursor;
@@ -94,25 +94,23 @@ static struct CursorName animatedThemeCursorNames[] = {
* Declarations of static variables used in this file.
*/
-static TkMacOSXCursor * gCurrentCursor = NULL; /* A pointer to the current
- * cursor. */
-static int gResizeOverride = false; /* A boolean indicating whether
- * we should use the resize
- * cursor during installations. */
-static int gTkOwnsCursor = true; /* A boolean indicating whether
- * Tk owns the cursor. If not (for
- * instance, in the case where a Tk
- * window is embedded in another app's
- * window, and the cursor is out of
- * the tk window, we will not attempt
- * to adjust the cursor */
+static TkMacOSXCursor * gCurrentCursor = NULL;
+ /* A pointer to the current cursor. */
+static int gResizeOverride = false;
+ /* A boolean indicating whether we should use
+ * the resize cursor during installations. */
+static int gTkOwnsCursor = true;/* A boolean indicating whether Tk owns the
+ * cursor. If not (for instance, in the case
+ * where a Tk window is embedded in another
+ * app's window, and the cursor is out of the
+ * tk window, we will not attempt to adjust
+ * the cursor. */
/*
* Declarations of procedures local to this file
*/
static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string);
-
/*
*----------------------------------------------------------------------
@@ -120,10 +118,9 @@ static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string);
* FindCursorByName --
*
* Retrieve a system cursor by name, and fill the macCursorPtr
- * structure. If the cursor cannot be found, the macCursor field
- * will be NULL. The function first attempts to load a color
- * cursor. If that fails it will attempt to load a black & white
- * cursor.
+ * structure. If the cursor cannot be found, the macCursor field will be
+ * NULL. The function first attempts to load a color cursor. If that
+ * fails it will attempt to load a black & white cursor.
*
* Results:
* Fills the macCursorPtr record.
@@ -205,9 +202,9 @@ TkGetCursorByName(
macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr;
/*
- * To find a cursor we must first determine if it is one of the
- * builtin cursors or the standard arrow cursor. Otherwise, we
- * attempt to load the cursor as a named Mac resource.
+ * To find a cursor we must first determine if it is one of the builtin
+ * cursors or the standard arrow cursor. Otherwise, we attempt to load the
+ * cursor as a named Mac resource.
*/
if (strcmp(noneCursorName.name, string) == 0) {
@@ -225,11 +222,14 @@ TkGetCursorByName(
if (namePtr->name == NULL) {
for (namePtr = animatedThemeCursorNames;
namePtr->name != NULL; namePtr++) {
- int namelen = strlen (namePtr->name);
+ int namelen = strlen(namePtr->name);
+
if (strncmp(namePtr->name, string, namelen) == 0) {
const char *numPtr = string + namelen;
+
if (*numPtr) {
int result = Tcl_GetInt(NULL, numPtr, &count);
+
if (result != TCL_OK) {
continue;
}
@@ -251,9 +251,9 @@ TkGetCursorByName(
int argc;
/*
- * The user may be trying to specify an XCursor with fore
- * & back colors. We don't want this to be an error, so pick
- * off the first word, and try again.
+ * The user may be trying to specify an XCursor with fore & back
+ * colors. We don't want this to be an error, so pick off the
+ * first word, and try again.
*/
if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK ) {
@@ -269,9 +269,8 @@ TkGetCursorByName(
ckfree((char *)macCursorPtr);
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
return NULL;
- } else {
- return (TkCursor *) macCursorPtr;
}
+ return (TkCursor *) macCursorPtr;
}
/*
@@ -327,12 +326,12 @@ TkpFreeCursor(
TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr;
switch (macCursorPtr->type) {
- case COLOR:
- DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor);
- break;
- case NORMAL:
- ReleaseResource(macCursorPtr->macCursor);
- break;
+ case COLOR:
+ DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor);
+ break;
+ case NORMAL:
+ ReleaseResource(macCursorPtr->macCursor);
+ break;
}
if (macCursorPtr == gCurrentCursor) {
@@ -345,9 +344,8 @@ TkpFreeCursor(
*
* TkMacOSXInstallCursor --
*
- * Installs either the current cursor as defined by TkpSetCursor
- * or a resize cursor as the cursor the Macintosh should currently
- * display.
+ * Installs either the current cursor as defined by TkpSetCursor or a
+ * resize cursor as the cursor the Macintosh should currently display.
*
* Results:
* None.
@@ -382,35 +380,35 @@ TkMacOSXInstallCursor(
SetThemeCursor(kThemeArrowCursor);
} else {
struct CursorName *namePtr;
+
switch (macCursorPtr->type) {
- case NONE:
- if (!cursorHidden) {
- cursorHidden = 1;
- HideCursor();
- }
- cursorNone = 1;
- break;
- case THEME:
- namePtr = (struct CursorName *) macCursorPtr->macCursor;
- SetThemeCursor(
- namePtr->id);
- break;
- case ANIMATED:
- namePtr = (struct CursorName *) macCursorPtr->macCursor;
- if (macCursorPtr->count == -1) {
- SetAnimatedThemeCursor(namePtr->id, cursorStep++);
- } else {
- SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count);
- }
- break;
- case COLOR:
- ccursor = (CCrsrHandle) macCursorPtr->macCursor;
- SetCCursor(ccursor);
- break;
- case NORMAL:
- cursor = (CursHandle) macCursorPtr->macCursor;
- SetCursor(*cursor);
- break;
+ case NONE:
+ if (!cursorHidden) {
+ cursorHidden = 1;
+ HideCursor();
+ }
+ cursorNone = 1;
+ break;
+ case THEME:
+ namePtr = (struct CursorName *) macCursorPtr->macCursor;
+ SetThemeCursor(namePtr->id);
+ break;
+ case ANIMATED:
+ namePtr = (struct CursorName *) macCursorPtr->macCursor;
+ if (macCursorPtr->count == -1) {
+ SetAnimatedThemeCursor(namePtr->id, cursorStep++);
+ } else {
+ SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count);
+ }
+ break;
+ case COLOR:
+ ccursor = (CCrsrHandle) macCursorPtr->macCursor;
+ SetCCursor(ccursor);
+ break;
+ case NORMAL:
+ cursor = (CursHandle) macCursorPtr->macCursor;
+ SetCursor(*cursor);
+ break;
}
}
if (cursorHidden && !cursorNone) {
@@ -448,10 +446,10 @@ TkpSetCursor(
if (cursor == None) {
/*
* This is a little tricky. We can't really tell whether
- * gCurrentCursor is NULL because it was NULL last time around
- * or because we just freed the current cursor. So if the input
- * cursor is NULL, we always need to reset it, we can't trust the
- * cursorChanged logic.
+ * gCurrentCursor is NULL because it was NULL last time around or
+ * because we just freed the current cursor. So if the input cursor is
+ * NULL, we always need to reset it, we can't trust the cursorChanged
+ * logic.
*/
gCurrentCursor = NULL;
diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c
index 8f0ef98..ff020c1 100644
--- a/macosx/tkMacOSXDebug.c
+++ b/macosx/tkMacOSXDebug.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.12.2.4 2007/11/12 19:22:38 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.12.2.5 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -478,7 +478,6 @@ TkMacOSXDebugFlashRegion(
}
}
}
-#endif /* TK_MAC_DEBUG */
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
@@ -616,3 +615,5 @@ TkMacOSXGetNamedDebugSymbol(
#endif /* __LP64__ */
return addr;
}
+
+#endif /* TK_MAC_DEBUG */
diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h
index 111c752..80c6711 100644
--- a/macosx/tkMacOSXDebug.h
+++ b/macosx/tkMacOSXDebug.h
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.10.2.4 2007/11/12 19:22:38 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.10.2.5 2008/06/25 16:46:07 dgp Exp $
*/
#ifndef _TKMACDEBUG
@@ -84,8 +84,6 @@ MODULE_SCOPE char* TkMacOSXMouseTrackingResultToAscii(MouseTrackingResult r, cha
MODULE_SCOPE void TkMacOSXDebugFlashRegion(Drawable d, HIShapeRef rgn);
-#endif /* TK_MAC_DEBUG */
-
MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol);
/* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */
@@ -95,4 +93,6 @@ MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* s
symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\
}
+#endif /* TK_MAC_DEBUG */
+
#endif
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 22b0f57..ed2fc4f 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.25.2.6 2007/11/12 19:22:38 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.25.2.7 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -104,16 +104,14 @@ static int fileDlgInited = 0;
static NavObjectFilterUPP openFileFilterUPP;
static NavEventUPP openFileEventUPP;
-
/*
*----------------------------------------------------------------------
*
* Tk_ChooseColorObjCmd --
*
- * This procedure implements the color dialog box for the Mac
- * platform. See the user documentation for details on what it
- * does.
+ * This procedure implements the color dialog box for the Mac platform.
+ * See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -133,7 +131,7 @@ Tk_ChooseColorObjCmd(
{
OSStatus err;
int result = TCL_ERROR;
- Tk_Window parent, tkwin = (Tk_Window) clientData;
+ Tk_Window parent, tkwin = clientData;
const char *title;
int i, srcRead, dstWrote;
CMError cmerr;
@@ -204,7 +202,7 @@ Tk_ChooseColorObjCmd(
cpinfo.placeWhere = kCenterOnMainScreen;
/* Currently, this does not actually change the colorpicker title */
Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, title, -1, 0, NULL,
- StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL);
+ StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL);
StrLength(cpinfo.prompt) = (unsigned char) dstWrote;
TkMacOSXTrackingLoop(1);
@@ -225,7 +223,7 @@ Tk_ChooseColorObjCmd(
}
result = TCL_OK;
-end:
+ end:
return result;
}
@@ -234,9 +232,8 @@ end:
*
* Tk_GetOpenFileObjCmd --
*
- * This procedure implements the "open file" dialog box for the
- * Mac platform. See the user documentation for details on what
- * it does.
+ * This procedure implements the "open file" dialog box for the Mac
+ * platform. See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -301,51 +298,54 @@ Tk_GetOpenFileObjCmd(
}
switch (index) {
- case OPEN_DEFAULT:
- break;
- case OPEN_FILETYPES:
- types = objv[i + 1];
- if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
- goto end;
- }
- break;
- case OPEN_INITDIR:
- initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) { initialDir = NULL; }
- break;
- case OPEN_INITFILE:
- initialFile = Tcl_GetString(objv[i + 1]);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) { initialFile = NULL; }
- break;
- case OPEN_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- message = CFStringCreateWithBytes(NULL, (unsigned char*)
- choice, choiceLen, kCFStringEncodingUTF8, false);
- break;
- case OPEN_MULTIPLE:
- if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &multiple)
- != TCL_OK) {
- goto end;
- }
- break;
- case OPEN_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice,
- (Tk_Window) clientData);
- if (parent == NULL) {
- goto end;
- }
- break;
- case OPEN_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- title = CFStringCreateWithBytes(NULL, (unsigned char*)
- choice, choiceLen, kCFStringEncodingUTF8, false);
- break;
- case OPEN_TYPEVARIABLE:
- typeVariablePtr = objv[i + 1];
- break;
+ case OPEN_DEFAULT:
+ break;
+ case OPEN_FILETYPES:
+ types = objv[i + 1];
+ if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case OPEN_INITDIR:
+ initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialDir = NULL;
+ }
+ break;
+ case OPEN_INITFILE:
+ initialFile = Tcl_GetString(objv[i + 1]);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialFile = NULL;
+ }
+ break;
+ case OPEN_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case OPEN_MULTIPLE:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
+ &multiple) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case OPEN_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case OPEN_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case OPEN_TYPEVARIABLE:
+ typeVariablePtr = objv[i + 1];
+ break;
}
}
@@ -372,7 +372,7 @@ Tk_GetOpenFileObjCmd(
Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr->name, 0);
}
-end:
+ end:
TkFreeFileFilters(&ofd.fl);
if (initialDesc.dataHandle) {
ChkErr(AEDisposeDesc, &initialDesc);
@@ -394,8 +394,7 @@ end:
*
* Tk_GetSaveFileObjCmd --
*
- * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box
- * instead
+ * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box instead.
*
* Results:
* A standard Tcl result.
@@ -453,47 +452,46 @@ Tk_GetSaveFileObjCmd(
goto end;
}
switch (index) {
- case SAVE_DEFAULT:
- break;
- case SAVE_FILETYPES:
- types = objv[i + 1];
- if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
- goto end;
- }
- break;
- case SAVE_INITDIR:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
- &dirRef, NULL, &initialDesc) != TCL_OK) {
- goto end;
- }
- break;
- case SAVE_INITFILE:
- initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- /* empty strings should be like no selection given */
- if (choiceLen == 0) {
- initialFile = NULL;
- }
- break;
- case SAVE_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- message = CFStringCreateWithBytes(NULL, (unsigned char*)
- choice, choiceLen, kCFStringEncodingUTF8, false);
- break;
- case SAVE_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice,
- (Tk_Window) clientData);
- if (parent == NULL) {
- goto end;
- }
- break;
- case SAVE_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- title = CFStringCreateWithBytes(NULL, (unsigned char*)
- choice, choiceLen, kCFStringEncodingUTF8, false);
- break;
+ case SAVE_DEFAULT:
+ break;
+ case SAVE_FILETYPES:
+ types = objv[i + 1];
+ if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case SAVE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
+ &dirRef, NULL, &initialDesc) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case SAVE_INITFILE:
+ initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ /* empty strings should be like no selection given */
+ if (choiceLen == 0) {
+ initialFile = NULL;
+ }
+ break;
+ case SAVE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case SAVE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, (Tk_Window) clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case SAVE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
}
}
@@ -503,7 +501,7 @@ Tk_GetSaveFileObjCmd(
result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL,
title, message, NULL, false, SAVE_FILE, parent);
TkFreeFileFilters(&ofd.fl);
-end:
+ end:
if (initialDesc.dataHandle) {
ChkErr(AEDisposeDesc, &initialDesc);
}
@@ -521,9 +519,9 @@ end:
*
* Tk_ChooseDirectoryObjCmd --
*
- * This procedure implements the "tk_chooseDirectory" dialog box
- * for the Windows platform. See the user documentation for details
- * on what it does.
+ * This procedure implements the "tk_chooseDirectory" dialog box for the
+ * MacOS X platform. See the user documentation for details on what it
+ * does.
*
* Results:
* See user documentation.
@@ -535,11 +533,11 @@ end:
*/
int
-Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with interpreter. */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+Tk_ChooseDirectoryObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int i, result = TCL_ERROR;
Tk_Window parent = NULL;
@@ -560,9 +558,8 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
}
for (i = 1; i < objc; i += 2) {
- char *choice;
+ char *string, *choice;
int index, choiceLen;
- char *string;
if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
@@ -575,31 +572,30 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
goto end;
}
switch (index) {
- case CHOOSE_INITDIR:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
- &dirRef, NULL, &initialDesc) != TCL_OK) {
- goto end;
- }
- break;
- case CHOOSE_MESSAGE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- message = CFStringCreateWithBytes(NULL, (unsigned char*)
- choice, choiceLen, kCFStringEncodingUTF8, false);
- break;
- case CHOOSE_PARENT:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- parent = Tk_NameToWindow(interp, choice,
- (Tk_Window) clientData);
- if (parent == NULL) {
- goto end;
- }
- break;
- case CHOOSE_TITLE:
- choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
- title = CFStringCreateWithBytes(NULL, (unsigned char*) choice,
- choiceLen, kCFStringEncodingUTF8, false);
- break;
+ case CHOOSE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (choiceLen && HandleInitialDirectory(interp, NULL, choice,
+ &dirRef, NULL, &initialDesc) != TCL_OK) {
+ goto end;
+ }
+ break;
+ case CHOOSE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ message = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
+ case CHOOSE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, clientData);
+ if (parent == NULL) {
+ goto end;
+ }
+ break;
+ case CHOOSE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ title = CFStringCreateWithBytes(NULL, (unsigned char *) choice,
+ choiceLen, kCFStringEncodingUTF8, false);
+ break;
}
}
@@ -611,7 +607,7 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL, title,
message, NULL, false, CHOOSE_FOLDER, parent);
TkFreeFileFilters(&ofd.fl);
-end:
+ end:
if (initialDesc.dataHandle) {
ChkErr(AEDisposeDesc, &initialDesc);
}
@@ -660,16 +656,16 @@ HandleInitialDirectory(
if (dirName == NULL) {
goto end;
}
- err = ChkErr(FSPathMakeRef, (unsigned char*) dirName,
- dirRef, &isDirectory);
+ err = ChkErr(FSPathMakeRef, (unsigned char *) dirName, dirRef,
+ &isDirectory);
if (err != noErr) {
Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"",
NULL);
goto end;
}
if (!isDirectory) {
- Tcl_AppendResult(interp, "-intialdir \"",
- initialDir, " is a file, not a directory.\"", NULL);
+ Tcl_AppendResult(interp, "-intialdir \"", initialDir, "\""
+ " is a file, not a directory.", NULL);
goto end;
}
ChkErr(AECreateDesc, typeFSRef, dirRef, sizeof(*dirRef), dirDescPtr);
@@ -690,7 +686,7 @@ HandleInitialDirectory(
ChkErr(AECreateList, NULL, 0, false, selectDescPtr);
- err = ChkErr(FSPathMakeRef, (unsigned char*) namePtr, &fileRef,
+ err = ChkErr(FSPathMakeRef, (unsigned char *) namePtr, &fileRef,
&isDirectory);
if (err != noErr) {
Tcl_AppendResult(interp, "bad initialfile \"", initialFile,
@@ -702,7 +698,7 @@ HandleInitialDirectory(
ChkErr(AEDisposeDesc, &fileDesc);
}
result = TCL_OK;
-end:
+ end:
if (dirName) {
Tcl_DStringFree(&ds);
}
@@ -766,7 +762,7 @@ NavServicesGetFile(
NavHandlerUserData data;
NavDialogCreationOptions options;
NavDialogRef dialogRef = NULL;
- CFStringRef * menuItemNames = NULL;
+ CFStringRef *menuItemNames = NULL;
OSStatus err;
Tcl_Obj *theResult = NULL;
int result = TCL_ERROR;
@@ -782,7 +778,7 @@ NavServicesGetFile(
options.optionFlags |= kNavAllowMultipleFiles;
}
options.modality = kWindowModalityAppModal;
- if (parent && ((TkWindow*)parent)->window != None &&
+ if (parent && ((TkWindow *) parent)->window != None &&
TkMacOSXHostToplevelExists(parent)) {
options.parentWindow = TkMacOSXDrawableWindow(Tk_WindowId(parent));
TK_IF_HI_TOOLBOX (5,
@@ -802,10 +798,10 @@ NavServicesGetFile(
* Now process the selection list. We have to use the popupExtension
* to fill the menu.
*/
+
if (ofdPtr && ofdPtr->usePopup) {
- FileFilter *filterPtr;
+ FileFilter *filterPtr = ofdPtr->fl.filters;
- filterPtr = ofdPtr->fl.filters;
if (filterPtr == NULL) {
ofdPtr->usePopup = 0;
}
@@ -815,8 +811,8 @@ NavServicesGetFile(
int index = 0;
ofdPtr->curType = 0;
- menuItemNames = (CFStringRef *) ckalloc(ofdPtr->fl.numFilters
- * sizeof(CFStringRef));
+ menuItemNames = (CFStringRef *)
+ ckalloc(ofdPtr->fl.numFilters * sizeof(CFStringRef));
for (filterPtr = ofdPtr->fl.filters; filterPtr != NULL;
filterPtr = filterPtr->next, index++) {
@@ -836,8 +832,8 @@ NavServicesGetFile(
options.message = message;
options.windowTitle = title;
if (initialFile) {
- options.saveFileName = CFStringCreateWithCString(NULL,
- initialFile, kCFStringEncodingUTF8);
+ options.saveFileName = CFStringCreateWithCString(NULL, initialFile,
+ kCFStringEncodingUTF8);
} else {
options.saveFileName = NULL;
}
@@ -878,9 +874,10 @@ NavServicesGetFile(
}
/*
- * Most commands assume that the file dialogs return a single
- * item, not a list. So only build a list if multiple is true...
+ * Most commands assume that the file dialogs return a single item, not a
+ * list. So only build a list if multiple is true...
*/
+
if (err == noErr) {
if (multiple) {
theResult = Tcl_NewListObj(0, NULL);
@@ -893,67 +890,89 @@ NavServicesGetFile(
}
if (err == noErr && data.reply.validRecord) {
AEDesc resultDesc;
- long count;
+ long count, i;
FSRef fsRef;
char pathPtr[PATH_MAX + 1];
+ char saveName[PATH_MAX + 1];
err = ChkErr(AECountItems, &data.reply.selection, &count);
- if (err == noErr) {
- long i;
+ if (err != noErr) {
+ /*
+ * There was an error when counting the items? Treat as if no
+ * items were chosen.
+ */
- for (i = 1; i <= count; i++) {
- err = ChkErr(AEGetNthDesc, &data.reply.selection, i,
- typeFSRef, NULL, &resultDesc);
- if (err == noErr) {
- err = ChkErr(AEGetDescData, &resultDesc, &fsRef,
- sizeof(fsRef));
- if (err == noErr) {
- err = ChkErr(FSRefMakePath, &fsRef, (unsigned char*)
- pathPtr, PATH_MAX + 1);
- if (err == noErr) {
- int pathValid = 0;
-
- if (isOpen == SAVE_FILE) {
- if (data.saveNameRef) {
- char saveName [PATH_MAX + 1];
-
- if (CFStringGetCString(data.saveNameRef,
- saveName, PATH_MAX + 1,
- kCFStringEncodingUTF8)) {
- if (strlen(pathPtr) + strlen(saveName)
- < PATH_MAX) {
- strcat(pathPtr, "/");
- strcat(pathPtr, saveName);
- pathValid = 1;
- } else {
- TkMacOSXDbgMsg("Path name too "
- "long");
- }
- } else {
- TkMacOSXDbgMsg("CFStringGetCString "
- "failed");
- }
- } else {
- TkMacOSXDbgMsg("NavDialogGetSaveFileName "
- "failed");
- }
- } else {
- pathValid = 1;
- }
- if (pathValid) {
- if (multiple) {
- Tcl_ListObjAppendElement(interp, theResult,
- Tcl_NewStringObj(pathPtr, -1));
- } else {
- Tcl_SetStringObj(theResult, pathPtr, -1);
- }
- }
- }
- }
- ChkErr(AEDisposeDesc, &resultDesc);
+ goto installResult;
+ }
+
+ /*
+ * Process the chosen files. This will be one unless -multiple was
+ * specified.
+ */
+
+ for (i = 1; i <= count; i++) {
+ /*
+ * Get the name of the selected file.
+ */
+
+ err = ChkErr(AEGetNthDesc, &data.reply.selection, i,
+ typeFSRef, NULL, &resultDesc);
+ if (err != noErr) {
+ continue;
+ }
+ err = ChkErr(AEGetDescData, &resultDesc, &fsRef, sizeof(fsRef));
+ if (err != noErr) {
+ goto nextFilename;
+ }
+ err = ChkErr(FSRefMakePath, &fsRef, (unsigned char *) pathPtr,
+ PATH_MAX + 1);
+ if (err != noErr) {
+ goto nextFilename;
+ }
+
+ /*
+ * If we're saving the file, we're creating a new filename and
+ * must therefore check whether it is a legal filename (not
+ * exceeding path length limits, etc.)
+ */
+
+ if (isOpen == SAVE_FILE) {
+ if (!data.saveNameRef) {
+ TkMacOSXDbgMsg("NavDialogGetSaveFileName failed");
+ goto nextFilename;
}
+
+ if (!CFStringGetCString(data.saveNameRef, saveName,
+ PATH_MAX + 1, kCFStringEncodingUTF8)) {
+ TkMacOSXDbgMsg("CFStringGetCString failed");
+ goto nextFilename;
+ }
+
+ if (strlen(pathPtr) + strlen(saveName) >= PATH_MAX) {
+ TkMacOSXDbgMsg("Path name too long");
+ goto nextFilename;
+ }
+
+ strcat(pathPtr, "/");
+ strcat(pathPtr, saveName);
}
+
+ /*
+ * Got a valid file name; put it in the result object.
+ */
+
+ if (multiple) {
+ Tcl_ListObjAppendElement(interp, theResult,
+ Tcl_NewStringObj(pathPtr, -1));
+ } else {
+ Tcl_SetStringObj(theResult, pathPtr, -1);
+ }
+
+ nextFilename:
+ ChkErr(AEDisposeDesc, &resultDesc);
}
+
+ installResult:
Tcl_SetObjResult(interp, theResult);
result = TCL_OK;
} else if (err == userCanceledErr) {
@@ -979,10 +998,11 @@ NavServicesGetFile(
}
if (menuItemNames) {
int i;
+
for (i = 0; i < ofdPtr->fl.numFilters; i++) {
CFRelease(menuItemNames[i]);
}
- ckfree((void *)menuItemNames);
+ ckfree((void *) menuItemNames);
}
if (options.popupExtension) {
CFRelease(options.popupExtension);
@@ -1032,7 +1052,7 @@ OpenEventProc(
selectItem.menuCreator = 0;
selectItem.menuType = ofd->initialType;
selectItem.menuItemName[0] = strlen(filterPtr->name);
- strncpy((char*) &selectItem.menuItemName[1],
+ strncpy((char *) &selectItem.menuItemName[1],
filterPtr->name, 255);
ChkErr(NavCustomControl, callBackParams->context,
kNavCtlSelectCustomType, &selectItem);
@@ -1093,85 +1113,80 @@ OpenEventProc(
pascal Boolean
OpenFileFilterProc(
- AEDesc* theItem, void* info,
+ AEDesc *theItem,
+ void *info,
NavCallBackUserData callBackUD,
NavFilterModes filterMode)
{
- OpenFileData *ofdPtr = ((NavHandlerUserData*) callBackUD)->ofdPtr;
+ OpenFileData *ofdPtr = ((NavHandlerUserData *) callBackUD)->ofdPtr;
int result = MATCHED;
- if (ofdPtr && ofdPtr->usePopup) {
- if (ofdPtr->fl.numFilters > 0) {
- if ((theItem->descriptorType == typeFSS)
- || (theItem->descriptorType == typeFSRef)) {
- NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo *) info;
- char fileName[256];
-
- if (!theInfo->isFolder) {
- OSType fileType;
- StringPtr fileNamePtr = NULL;
- Tcl_DString fileNameDString;
- int i;
- FileFilter *filterPtr;
-
- fileType =
- theInfo->fileAndFolder.fileInfo.finderInfo.fdType;
- Tcl_DStringInit (&fileNameDString);
-
- if (theItem->descriptorType == typeFSS) {
- int len;
- fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name;
- len = fileNamePtr[0];
- strncpy(fileName, (char*) fileNamePtr + 1, len);
- fileName[len] = '\0';
- fileNamePtr = (unsigned char*) fileName;
- } else if ((theItem->descriptorType == typeFSRef)) {
- OSStatus err;
- FSRef *theRef = (FSRef *) *theItem->dataHandle;
- HFSUniStr255 uniFileName;
- err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone,
- NULL, &uniFileName, NULL, NULL);
-
- if (err == noErr) {
- Tcl_UniCharToUtfDString (
- (Tcl_UniChar *) uniFileName.unicode,
- uniFileName.length, &fileNameDString);
- fileNamePtr = (unsigned char*)
- Tcl_DStringValue(&fileNameDString);
- }
- }
- if (ofdPtr->usePopup) {
- i = ofdPtr->curType;
- for (filterPtr = ofdPtr->fl.filters;
- filterPtr && i > 0; i--) {
- filterPtr = filterPtr->next;
- }
- if (filterPtr) {
- result = MatchOneType(fileNamePtr, fileType,
- ofdPtr, filterPtr);
- } else {
- result = UNMATCHED;
- }
- } else {
- /*
- * We are not using the popup menu. In this case, the
- * file is considered matched if it matches any of
- * the file filters.
- */
-
- result = UNMATCHED;
- for (filterPtr = ofdPtr->fl.filters; filterPtr;
- filterPtr = filterPtr->next) {
- if (MatchOneType(fileNamePtr, fileType,
- ofdPtr, filterPtr) == MATCHED) {
- result = MATCHED;
- break;
- }
- }
+ if (ofdPtr && ofdPtr->usePopup && ofdPtr->fl.numFilters > 0 &&
+ ((theItem->descriptorType == typeFSS)
+ || (theItem->descriptorType == typeFSRef))) {
+ NavFileOrFolderInfo *theInfo = info;
+ char fileName[256];
+ OSType fileType;
+ StringPtr fileNamePtr = NULL;
+ Tcl_DString fileNameDString;
+ int i;
+ FileFilter *filterPtr;
+
+ if (!theInfo->isFolder) {
+ fileType = theInfo->fileAndFolder.fileInfo.finderInfo.fdType;
+ Tcl_DStringInit(&fileNameDString);
+
+ if (theItem->descriptorType == typeFSS) {
+ int len;
+
+ fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name;
+ len = fileNamePtr[0];
+ strncpy(fileName, (char *) fileNamePtr + 1, len);
+ fileName[len] = '\0';
+ fileNamePtr = (unsigned char *) fileName;
+ } else if ((theItem->descriptorType == typeFSRef)) {
+ OSStatus err;
+ FSRef *theRef = (FSRef *) *theItem->dataHandle;
+ HFSUniStr255 uniFileName;
+
+ err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone,
+ NULL, &uniFileName, NULL, NULL);
+
+ if (err == noErr) {
+ Tcl_UniCharToUtfDString((Tcl_UniChar *)uniFileName.unicode,
+ uniFileName.length, &fileNameDString);
+ fileNamePtr = (unsigned char *)
+ Tcl_DStringValue(&fileNameDString);
+ }
+ }
+ if (ofdPtr->usePopup) {
+ i = ofdPtr->curType;
+ for (filterPtr = ofdPtr->fl.filters; filterPtr && i>0; i--) {
+ filterPtr = filterPtr->next;
+ }
+ if (filterPtr) {
+ result = MatchOneType(fileNamePtr, fileType, ofdPtr,
+ filterPtr);
+ } else {
+ result = UNMATCHED;
+ }
+ } else {
+ /*
+ * We are not using the popup menu. In this case, the file is
+ * considered matched if it matches any of the file filters.
+ */
+
+ result = UNMATCHED;
+ for (filterPtr = ofdPtr->fl.filters; filterPtr;
+ filterPtr = filterPtr->next) {
+ if (MatchOneType(fileNamePtr, fileType, ofdPtr,
+ filterPtr) == MATCHED) {
+ result = MATCHED;
+ break;
}
- Tcl_DStringFree (&fileNameDString);
}
}
+ Tcl_DStringFree(&fileNameDString);
}
}
return (result == MATCHED);
@@ -1206,20 +1221,20 @@ MatchOneType(
FileFilterClause *clausePtr;
/*
- * A file matches with a file type if it matches with at least one
- * clause of the type.
+ * A file matches with a file type if it matches with at least one clause
+ * of the type.
*
- * If the clause has both glob patterns and ostypes, the file must
- * match with at least one pattern AND at least one ostype.
+ * If the clause has both glob patterns and ostypes, the file must match
+ * with at least one pattern AND at least one ostype.
*
* If the clause has glob patterns only, the file must match with at least
* one pattern.
*
- * If the clause has mac types only, the file must match with at least
- * one mac type.
+ * If the clause has mac types only, the file must match with at least one
+ * mac type.
*
- * If the clause has neither glob patterns nor mac types, it's
- * considered an error.
+ * If the clause has neither glob patterns nor mac types, it's considered
+ * an error.
*/
for (clausePtr = filterPtr->clauses; clausePtr;
@@ -1261,10 +1276,7 @@ MatchOneType(
if (Tcl_StringMatch((char*) fileNamePtr, ext)) {
goto glob_matched;
- } else {
- goto glob_unmatched;
}
-
glob_unmatched:
continue;
@@ -1281,13 +1293,12 @@ MatchOneType(
}
/*
- * On Mac OS X, it is not uncommon for files to have NO
- * file type. But folks with Tcl code on Classic MacOS pretty
- * much assume that a generic file will have type TEXT. So
- * if we were strict about matching types when the source file
- * had NO type set, they would have to add another rule always
- * with no fileType. To avoid that, we pass the macMatch side
- * of the test if no fileType is set.
+ * On Mac OS X, it is not uncommon for files to have NO file type. But
+ * folks with Tcl code on Classic MacOS pretty much assume that a
+ * generic file will have type TEXT. So if we were strict about
+ * matching types when the source file had NO type set, they would
+ * have to add another rule always with no fileType. To avoid that, we
+ * pass the macMatch side of the test if no fileType is set.
*/
if (globMatched && (macMatched || (fileType == 0))) {
@@ -1303,8 +1314,8 @@ MatchOneType(
*
* TkAboutDlg --
*
- * Displays the default Tk About box. This code uses Macintosh
- * resources to define the content of the About Box.
+ * Displays the default Tk About box. This code uses Macintosh resources
+ * to define the content of the About Box.
*
* Results:
* None.
@@ -1360,7 +1371,7 @@ Tk_MessageBoxObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[]) /* Argument objects. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
AlertStdCFStringAlertParamRec paramCFStringRec;
AlertType alertType;
DialogRef dialogRef;
@@ -1459,107 +1470,103 @@ Tk_MessageBoxObjCmd(
}
switch (index) {
- case ALERT_DEFAULT:
- /*
- * Need to postpone processing of this option until we are
- * sure to know the '-type' as well.
- */
- haveDefaultOption = true;
- indexDefaultOption = i;
- break;
+ case ALERT_DEFAULT:
+ /*
+ * Need to postpone processing of this option until we are sure to
+ * know the '-type' as well.
+ */
- case ALERT_DETAIL:
- str = Tcl_GetString(objv[i + 1]);
- finemessageTextCF = CFStringCreateWithCString(NULL, str,
- kCFStringEncodingUTF8);
- break;
+ haveDefaultOption = true;
+ indexDefaultOption = i;
+ break;
- case ALERT_ICON:
- if (Tcl_GetIndexFromObj(interp, objv[i + 1],
- movableIconStrings, "value", TCL_EXACT, &iconIndex)
- != TCL_OK) {
- goto end;
- }
- switch (iconIndex) {
- case ICON_ERROR:
- alertType = kAlertStopAlert;
- break;
- case ICON_INFO:
- alertType = kAlertNoteAlert;
- break;
- case ICON_QUESTION:
- alertType = kAlertCautionAlert;
- break;
- case ICON_WARNING:
- alertType = kAlertCautionAlert;
- break;
- }
- break;
+ case ALERT_DETAIL:
+ str = Tcl_GetString(objv[i + 1]);
+ finemessageTextCF = CFStringCreateWithCString(NULL, str,
+ kCFStringEncodingUTF8);
+ break;
- case ALERT_MESSAGE:
- str = Tcl_GetString(objv[i + 1]);
- messageTextCF = CFStringCreateWithCString(NULL, str,
- kCFStringEncodingUTF8);
+ case ALERT_ICON:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableIconStrings,
+ "value", TCL_EXACT, &iconIndex) != TCL_OK) {
+ goto end;
+ }
+ switch (iconIndex) {
+ case ICON_ERROR:
+ alertType = kAlertStopAlert;
break;
-
- case ALERT_PARENT:
- str = Tcl_GetString(objv[i + 1]);
- tkwin = Tk_NameToWindow(interp, str, tkwin);
- if (tkwin == NULL) {
- goto end;
- }
- if (((TkWindow*)tkwin)->window != None &&
- TkMacOSXHostToplevelExists(tkwin)) {
- haveParentOption = true;
- }
+ case ICON_INFO:
+ alertType = kAlertNoteAlert;
break;
-
- case ALERT_TITLE:
+ case ICON_QUESTION:
+ alertType = kAlertCautionAlert;
+ break;
+ case ICON_WARNING:
+ alertType = kAlertCautionAlert;
break;
+ }
+ break;
- case ALERT_TYPE:
- if (Tcl_GetIndexFromObj(interp, objv[i + 1],\
- movableTypeStrings, "value", TCL_EXACT, &typeIndex)
- != TCL_OK) {
- goto end;
- }
- switch (typeIndex) {
- case TYPE_ABORTRETRYIGNORE:
- paramCFStringRec.defaultText = CFSTR("Abort");
- paramCFStringRec.cancelText = CFSTR("Retry");
- paramCFStringRec.otherText = CFSTR("Ignore");
- paramCFStringRec.cancelButton =
- kAlertStdAlertOtherButton;
- break;
- case TYPE_OK:
- paramCFStringRec.defaultText = CFSTR("OK");
- break;
- case TYPE_OKCANCEL:
- paramCFStringRec.defaultText = CFSTR("OK");
- paramCFStringRec.cancelText = CFSTR("Cancel");
- break;
- case TYPE_RETRYCANCEL:
- paramCFStringRec.defaultText = CFSTR("Retry");
- paramCFStringRec.cancelText = CFSTR("Cancel");
- break;
- case TYPE_YESNO:
- paramCFStringRec.defaultText = CFSTR("Yes");
- paramCFStringRec.cancelText = CFSTR("No");
- break;
- case TYPE_YESNOCANCEL:
- paramCFStringRec.defaultText = CFSTR("Yes");
- paramCFStringRec.cancelText = CFSTR("No");
- paramCFStringRec.otherText = CFSTR("Cancel");
- paramCFStringRec.cancelButton =
- kAlertStdAlertOtherButton;
- break;
- }
+ case ALERT_MESSAGE:
+ str = Tcl_GetString(objv[i + 1]);
+ messageTextCF = CFStringCreateWithCString(NULL, str,
+ kCFStringEncodingUTF8);
+ break;
+
+ case ALERT_PARENT:
+ str = Tcl_GetString(objv[i + 1]);
+ tkwin = Tk_NameToWindow(interp, str, tkwin);
+ if (tkwin == NULL) {
+ goto end;
+ }
+ if (((TkWindow *) tkwin)->window != None &&
+ TkMacOSXHostToplevelExists(tkwin)) {
+ haveParentOption = true;
+ }
+ break;
+
+ case ALERT_TITLE:
+ break;
+
+ case ALERT_TYPE:
+ if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableTypeStrings,
+ "value", TCL_EXACT, &typeIndex) != TCL_OK) {
+ goto end;
+ }
+ switch (typeIndex) {
+ case TYPE_ABORTRETRYIGNORE:
+ paramCFStringRec.defaultText = CFSTR("Abort");
+ paramCFStringRec.cancelText = CFSTR("Retry");
+ paramCFStringRec.otherText = CFSTR("Ignore");
+ paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
+ break;
+ case TYPE_OK:
+ paramCFStringRec.defaultText = CFSTR("OK");
break;
+ case TYPE_OKCANCEL:
+ paramCFStringRec.defaultText = CFSTR("OK");
+ paramCFStringRec.cancelText = CFSTR("Cancel");
+ break;
+ case TYPE_RETRYCANCEL:
+ paramCFStringRec.defaultText = CFSTR("Retry");
+ paramCFStringRec.cancelText = CFSTR("Cancel");
+ break;
+ case TYPE_YESNO:
+ paramCFStringRec.defaultText = CFSTR("Yes");
+ paramCFStringRec.cancelText = CFSTR("No");
+ break;
+ case TYPE_YESNOCANCEL:
+ paramCFStringRec.defaultText = CFSTR("Yes");
+ paramCFStringRec.cancelText = CFSTR("No");
+ paramCFStringRec.otherText = CFSTR("Cancel");
+ paramCFStringRec.cancelButton = kAlertStdAlertOtherButton;
+ break;
+ }
+ break;
}
}
if (haveDefaultOption) {
-
/*
* Any '-default' option needs to know the '-type' option, which is why
* we do this here.
@@ -1642,19 +1649,18 @@ Tk_MessageBoxObjCmd(
}
}
if (err == noErr) {
- int ind;
-
/*
* Map 'itemHit' (1, 2, 3) to descriptive text string.
*/
- ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit];
+ int ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit];
+
Tcl_SetObjResult(interp, Tcl_NewStringObj(movableButtonStrings[ind],
-1));
result = TCL_OK;
}
-end:
+ end:
if (finemessageTextCF) {
CFRelease(finemessageTextCF);
}
@@ -1686,21 +1692,21 @@ AlertHandler(
EventRef eventRef,
void *userData)
{
- AlertHandlerUserData *data = (AlertHandlerUserData *) userData;
+ AlertHandlerUserData *data = userData;
HICommand cmd;
ChkErr(GetEventParameter,eventRef, kEventParamDirectObject, typeHICommand,
NULL, sizeof(cmd), NULL, &cmd);
switch (cmd.commandID) {
- case kHICommandOK:
- data->buttonIndex = 1;
- break;
- case kHICommandCancel:
- data->buttonIndex = 2;
- break;
- case kHICommandOther:
- data->buttonIndex = 3;
- break;
+ case kHICommandOK:
+ data->buttonIndex = 1;
+ break;
+ case kHICommandCancel:
+ data->buttonIndex = 2;
+ break;
+ case kHICommandOther:
+ data->buttonIndex = 3;
+ break;
}
if (data->buttonIndex) {
ChkErr(QuitAppModalLoopForWindow, data->dialogWindow);
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 74ea734..6fb11c8 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -3,52 +3,49 @@
*
* This file contains platform-specific procedures for theMac to provide
* basic operations needed for application embedding (where one
- * application can use as its main window an internal window from
- * some other application).
- * Currently only Toplevel embedding within the same Tk application is
- * allowed on the Macintosh.
+ * application can use as its main window an internal window from some
+ * other application). Currently only Toplevel embedding within the same
+ * Tk application is allowed on the Macintosh.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.12.2.3 2007/11/12 19:22:38 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.12.2.4 2008/06/25 16:46:07 dgp Exp $
*/
#include "tkMacOSXInt.h"
/*
* One of the following structures exists for each container in this
- * application. It keeps track of the container window and its
- * associated embedded window.
+ * application. It keeps track of the container window and its associated
+ * embedded window.
*/
typedef struct Container {
- Window parent; /* The Mac Drawable for the parent of
- * the pair (the container). */
- TkWindow *parentPtr; /* Tk's information about the container,
- * or NULL if the container isn't
+ Window parent; /* The Mac Drawable for the parent of the pair
+ * (the container). */
+ TkWindow *parentPtr; /* Tk's information about the container, or
+ * NULL if the container isn't in this
+ * process. */
+ Window embedded; /* The MacDrawable for the embedded window.
+ * Starts off as None, but gets filled in when
+ * the window is eventually created. */
+ TkWindow *embeddedPtr; /* Tk's information about the embedded window,
+ * or NULL if the embedded application isn't
* in this process. */
- Window embedded; /* The MacDrawable for the embedded
- * window. Starts off as None, but
- * gets filled in when the window is
- * eventually created. */
- TkWindow *embeddedPtr; /* Tk's information about the embedded
- * window, or NULL if the
- * embedded application isn't in
- * this process. */
- struct Container *nextPtr; /* Next in list of all containers in
- * this process. */
+ struct Container *nextPtr; /* Next in list of all containers in this
+ * process. */
} Container;
static Container *firstContainerPtr = NULL;
- /* First in list of all containers
- * managed by this process. */
+ /* First in list of all containers managed by
+ * this process. */
/*
- * Globals defined in this file
+ * Globals defined in this file:
*/
TkMacOSXEmbedHandler *tkMacOSXEmbedHandler = NULL;
@@ -57,25 +54,24 @@ TkMacOSXEmbedHandler *tkMacOSXEmbedHandler = NULL;
* Prototypes for static procedures defined in this file:
*/
-static void ContainerEventProc(ClientData clientData, XEvent *eventPtr);
-static void EmbeddedEventProc(ClientData clientData, XEvent *eventPtr);
-static void EmbedActivateProc(ClientData clientData, XEvent *eventPtr);
-static void EmbedFocusProc(ClientData clientData, XEvent *eventPtr);
-static void EmbedGeometryRequest(Container * containerPtr, int width,
- int height);
-static void EmbedSendConfigure(Container *containerPtr);
-static void EmbedStructureProc(ClientData clientData, XEvent *eventPtr);
-static void EmbedWindowDeleted(TkWindow *winPtr);
-
+static void ContainerEventProc(ClientData clientData, XEvent *eventPtr);
+static void EmbeddedEventProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedActivateProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedFocusProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedGeometryRequest(Container *containerPtr, int width,
+ int height);
+static void EmbedSendConfigure(Container *containerPtr);
+static void EmbedStructureProc(ClientData clientData, XEvent *eventPtr);
+static void EmbedWindowDeleted(TkWindow *winPtr);
/*
*----------------------------------------------------------------------
*
* Tk_MacOSXSetEmbedHandler --
*
- * Registers a handler for an in process form of embedding, like
- * Netscape plugins, where Tk is loaded into the process, but does
- * not control the main window
+ * Registers a handler for an in process form of embedding, like Netscape
+ * plugins, where Tk is loaded into the process, but does not control the
+ * main window
*
* Results:
* None
@@ -95,7 +91,8 @@ Tk_MacOSXSetEmbedHandler(
Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
{
if (tkMacOSXEmbedHandler == NULL) {
- tkMacOSXEmbedHandler = (TkMacOSXEmbedHandler *) ckalloc(sizeof(TkMacOSXEmbedHandler));
+ tkMacOSXEmbedHandler = (TkMacOSXEmbedHandler *)
+ ckalloc(sizeof(TkMacOSXEmbedHandler));
}
tkMacOSXEmbedHandler->registerWinProc = registerWinProc;
tkMacOSXEmbedHandler->getPortProc = getPortProc;
@@ -126,12 +123,10 @@ TkpMakeWindow(
Window parent)
{
MacDrawable *macWin;
- XEvent event;
/*
- * If this window is marked as embedded then
- * the window structure should have already been
- * created in the TkpUseWindow function.
+ * If this window is marked as embedded then the window structure should
+ * have already been created in the TkpUseWindow function.
*/
if (Tk_IsEmbedded(winPtr)) {
@@ -158,35 +153,23 @@ TkpMakeWindow(
macWin->size = CGSizeZero;
if (Tk_IsTopLevel(macWin->winPtr)) {
/*
- *This will be set when we are mapped.
+ * This will be set when we are mapped.
*/
+
macWin->xOff = 0;
macWin->yOff = 0;
macWin->toplevel = macWin;
} else {
macWin->xOff = winPtr->parentPtr->privatePtr->xOff +
- winPtr->parentPtr->changes.border_width +
- winPtr->changes.x;
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.x;
macWin->yOff = winPtr->parentPtr->privatePtr->yOff +
- winPtr->parentPtr->changes.border_width +
- winPtr->changes.y;
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.y;
macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
}
macWin->toplevel->referenceCount++;
}
- /*
- * TODO: need general solution for visibility events.
- */
-
- event.xany.serial = Tk_Display(winPtr)->request;
- event.xany.send_event = False;
- event.xany.display = Tk_Display(winPtr);
-
- event.xvisibility.type = VisibilityNotify;
- event.xvisibility.window = (Window) macWin;
- event.xvisibility.state = VisibilityUnobscured;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
-
return (Window) macWin;
}
@@ -195,15 +178,15 @@ TkpMakeWindow(
*
* TkpUseWindow --
*
- * This procedure causes a Tk window to use a given X window as
- * its parent window, rather than the root window for the screen.
- * It is invoked by an embedded application to specify the window
- * in which it is embedded.
+ * This procedure causes a Tk window to use a given X window as its
+ * parent window, rather than the root window for the screen. It is
+ * invoked by an embedded application to specify the window in which it
+ * is embedded.
*
* Results:
- * The return value is normally TCL_OK. If an error occurs (such
- * as string not being a valid window spec), then the return value
- * is TCL_ERROR and an error message is left in the interp's result if
+ * The return value is normally TCL_OK. If an error occurs (such as
+ * string not being a valid window spec), then the return value is
+ * TCL_ERROR and an error message is left in the interp's result if
* interp is non-NULL.
*
* Side effects:
@@ -214,12 +197,12 @@ TkpMakeWindow(
int
TkpUseWindow(
- Tcl_Interp *interp, /* If not NULL, used for error reporting
- * if string is bogus. */
+ Tcl_Interp *interp, /* If not NULL, used for error reporting if
+ * string is bogus. */
Tk_Window tkwin, /* Tk window that does not yet have an
* associated X window. */
- CONST char *string) /* String identifying an X window to use
- * for tkwin; must be an integer value. */
+ CONST char *string) /* String identifying an X window to use for
+ * tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
TkWindow *usePtr;
@@ -233,13 +216,12 @@ TkpUseWindow(
}
/*
- * Decode the container pointer, and look for it among the
- * list of available containers.
+ * Decode the container pointer, and look for it among the list of
+ * available containers.
*
* N.B. For now, we are limiting the containers to be in the same Tk
- * application as tkwin, since otherwise they would not be in our list
- * of containers.
- *
+ * application as tkwin, since otherwise they would not be in our list of
+ * containers.
*/
if (Tcl_GetInt(interp, string, (int*) &parent) != TCL_OK) {
@@ -261,8 +243,8 @@ TkpUseWindow(
*/
/*
- * Save information about the container and the embedded window
- * in a Container structure. Currently, there must already be an existing
+ * Save information about the container and the embedded window in a
+ * Container structure. Currently, there must already be an existing
* Container structure, since we only allow the case where both container
* and embedded app. are in the same process.
*/
@@ -290,11 +272,11 @@ TkpUseWindow(
winPtr->privatePtr = macWin;
/*
- * The grafPtr will be NULL for a Tk in Tk embedded window.
- * It is none of our business what it is for a Tk not in Tk embedded window,
- * but we will initialize it to NULL, and let the registerWinProc
- * set it. In any case, you must always use TkMacOSXGetDrawablePort
- * to get the portPtr. It will correctly find the container's port.
+ * The grafPtr will be NULL for a Tk in Tk embedded window. It is none of
+ * our business what it is for a Tk not in Tk embedded window, but we will
+ * initialize it to NULL, and let the registerWinProc set it. In any case,
+ * you must always use TkMacOSXGetDrawablePort to get the portPtr. It will
+ * correctly find the container's port.
*/
macWin->grafPtr = NULL;
@@ -310,19 +292,17 @@ TkpUseWindow(
winPtr->flags |= TK_EMBEDDED;
-
/*
- * Make a copy of the TK_EMBEDDED flag, since sometimes
- * we need this to get the port after the TkWindow structure
- * has been freed.
+ * Make a copy of the TK_EMBEDDED flag, since sometimes we need this to
+ * get the port after the TkWindow structure has been freed.
*/
macWin->flags |= TK_EMBEDDED;
/*
- * Now check whether it is embedded in another Tk widget. If not (the first
- * case below) we see if there is an in-process embedding handler registered,
- * and if so, let that fill in the rest of the macWin.
+ * Now check whether it is embedded in another Tk widget. If not (the
+ * first case below) we see if there is an in-process embedding handler
+ * registered, and if so, let that fill in the rest of the macWin.
*/
if (containerPtr == NULL) {
@@ -345,10 +325,8 @@ TkpUseWindow(
containerPtr->embeddedPtr = macWin->winPtr;
containerPtr->nextPtr = firstContainerPtr;
firstContainerPtr = containerPtr;
-
}
} else {
-
/*
* The window is embedded in another Tk window.
*/
@@ -360,10 +338,9 @@ TkpUseWindow(
parent->winPtr->changes.border_width +
winPtr->changes.y;
-
/*
- * Finish filling up the container structure with the embedded window's
- * information.
+ * Finish filling up the container structure with the embedded
+ * window's information.
*/
containerPtr->embedded = (Window) macWin;
@@ -375,8 +352,7 @@ TkpUseWindow(
*/
Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbeddedEventProc,
- (ClientData) winPtr);
-
+ winPtr);
}
return TCL_OK;
@@ -387,10 +363,10 @@ TkpUseWindow(
*
* TkpMakeContainer --
*
- * This procedure is called to indicate that a particular window
- * will be a container for an embedded application. This changes
- * certain aspects of the window's behavior, such as whether it
- * will receive events anymore.
+ * This procedure is called to indicate that a particular window will be
+ * a container for an embedded application. This changes certain aspects
+ * of the window's behavior, such as whether it will receive events
+ * anymore.
*
* Results:
* None.
@@ -403,18 +379,17 @@ TkpUseWindow(
void
TkpMakeContainer(
- Tk_Window tkwin) /* Token for a window that is about to
- * become a container. */
+ Tk_Window tkwin) /* Token for a window that is about to become
+ * a container. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
Container *containerPtr;
/*
- * Register the window as a container so that, for example, we can
- * make sure the argument to -use is valid.
+ * Register the window as a container so that, for example, we can make
+ * sure the argument to -use is valid.
*/
-
Tk_MakeWindowExist(tkwin);
containerPtr = (Container *) ckalloc(sizeof(Container));
containerPtr->parent = Tk_WindowId(tkwin);
@@ -426,23 +401,22 @@ TkpMakeContainer(
winPtr->flags |= TK_CONTAINER;
/*
- * Request SubstructureNotify events so that we can find out when
- * the embedded application creates its window or attempts to
- * resize it. Also watch Configure events on the container so that
- * we can resize the child to match. Also, pass activate events from
- * the container down to the embedded toplevel.
+ * Request SubstructureNotify events so that we can find out when the
+ * embedded application creates its window or attempts to resize it. Also
+ * watch Configure events on the container so that we can resize the child
+ * to match. Also, pass activate events from the container down to the
+ * embedded toplevel.
*/
Tk_CreateEventHandler(tkwin,
SubstructureNotifyMask|SubstructureRedirectMask,
- ContainerEventProc, (ClientData) winPtr);
+ ContainerEventProc, winPtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbedStructureProc,
- (ClientData) containerPtr);
+ containerPtr);
Tk_CreateEventHandler(tkwin, ActivateMask, EmbedActivateProc,
- (ClientData) containerPtr);
+ containerPtr);
Tk_CreateEventHandler(tkwin, FocusChangeMask, EmbedFocusProc,
- (ClientData) containerPtr);
-
+ containerPtr);
}
/*
@@ -454,8 +428,7 @@ TkpMakeContainer(
* identifier for the associated container window.
*
* Results:
- * The return value is the MacDrawable for winPtr's
- * container window.
+ * The return value is the MacDrawable for winPtr's container window.
*
* Side effects:
* None.
@@ -464,8 +437,8 @@ TkpMakeContainer(
*/
MacDrawable *
-TkMacOSXContainerId(winPtr)
- TkWindow *winPtr; /* Tk's structure for an embedded window. */
+TkMacOSXContainerId(
+ TkWindow *winPtr) /* Tk's structure for an embedded window. */
{
Container *containerPtr;
@@ -484,8 +457,8 @@ TkMacOSXContainerId(winPtr)
*
* TkMacOSXGetHostToplevel --
*
- * Given the TkWindow, return the MacDrawable for the outermost
- * toplevel containing it. This will be a real Macintosh window.
+ * Given the TkWindow, return the MacDrawable for the outermost toplevel
+ * containing it. This will be a real Macintosh window.
*
* Results:
* Returns a MacDrawable corresponding to a Macintosh Toplevel
@@ -504,20 +477,18 @@ TkMacOSXGetHostToplevel(
topWinPtr = winPtr->privatePtr->toplevel->winPtr;
if (!Tk_IsEmbedded(topWinPtr)) {
- return winPtr->privatePtr->toplevel;
- } else {
- contWinPtr = TkpGetOtherWindow(topWinPtr);
+ return winPtr->privatePtr->toplevel;
+ }
+ contWinPtr = TkpGetOtherWindow(topWinPtr);
- /*
- * TODO: Here we should handle out of process embedding.
- */
+ /*
+ * TODO: Here we should handle out of process embedding.
+ */
- if (contWinPtr != NULL) {
- return TkMacOSXGetHostToplevel(contWinPtr);
- } else {
- return None;
- }
+ if (contWinPtr == NULL) {
+ return None;
}
+ return TkMacOSXGetHostToplevel(contWinPtr);
}
/*
@@ -525,10 +496,10 @@ TkMacOSXGetHostToplevel(
*
* TkpClaimFocus --
*
- * This procedure is invoked when someone asks for the input focus
- * to be put on a window in an embedded application, but the
- * application doesn't currently have the focus. It requests the
- * input focus from the container application.
+ * This procedure is invoked when someone asks for the input focus to be
+ * put on a window in an embedded application, but the application
+ * doesn't currently have the focus. It requests the input focus from the
+ * container application.
*
* Results:
* None.
@@ -541,11 +512,11 @@ TkMacOSXGetHostToplevel(
void
TkpClaimFocus(
- TkWindow *topLevelPtr, /* Top-level window containing desired
- * focus window; should be embedded. */
- int force) /* One means that the container should
- * claim the focus if it doesn't
- * currently have it. */
+ TkWindow *topLevelPtr, /* Top-level window containing desired focus
+ * window; should be embedded. */
+ int force) /* One means that the container should claim
+ * the focus if it doesn't currently have
+ * it. */
{
XEvent event;
Container *containerPtr;
@@ -560,7 +531,6 @@ TkpClaimFocus(
/* Empty loop body. */
}
-
event.xfocus.type = FocusIn;
event.xfocus.serial = LastKnownRequestProcessed(topLevelPtr->display);
event.xfocus.send_event = 1;
@@ -576,9 +546,8 @@ TkpClaimFocus(
*
* TkpTestembedCmd --
*
- * This procedure implements the "testembed" command. It returns
- * some or all of the information in the list pointed to by
- * firstContainerPtr.
+ * This procedure implements the "testembed" command. It returns some or
+ * all of the information in the list pointed to by firstContainerPtr.
*
* Results:
* A standard Tcl result.
@@ -612,13 +581,11 @@ TkpTestembedCmd(
Tcl_DStringStartSublist(&dString);
if (containerPtr->parent == None) {
Tcl_DStringAppendElement(&dString, "");
+ } else if (all) {
+ sprintf(buffer, "0x%x", (int) containerPtr->parent);
+ Tcl_DStringAppendElement(&dString, buffer);
} else {
- if (all) {
- sprintf(buffer, "0x%x", (int) containerPtr->parent);
- Tcl_DStringAppendElement(&dString, buffer);
- } else {
- Tcl_DStringAppendElement(&dString, "XXX");
- }
+ Tcl_DStringAppendElement(&dString, "XXX");
}
if (containerPtr->parentPtr == NULL) {
Tcl_DStringAppendElement(&dString, "");
@@ -628,13 +595,11 @@ TkpTestembedCmd(
}
if (containerPtr->embedded == None) {
Tcl_DStringAppendElement(&dString, "");
+ } else if (all) {
+ sprintf(buffer, "0x%x", (int) containerPtr->embedded);
+ Tcl_DStringAppendElement(&dString, buffer);
} else {
- if (all) {
- sprintf(buffer, "0x%x", (int) containerPtr->embedded);
- Tcl_DStringAppendElement(&dString, buffer);
- } else {
- Tcl_DStringAppendElement(&dString, "XXX");
- }
+ Tcl_DStringAppendElement(&dString, "XXX");
}
if (containerPtr->embeddedPtr == NULL) {
Tcl_DStringAppendElement(&dString, "");
@@ -653,13 +618,13 @@ TkpTestembedCmd(
*
* TkpRedirectKeyEvent --
*
- * This procedure is invoked when a key press or release event
- * arrives for an application that does not believe it owns the
- * input focus. This can happen because of embedding; for example,
- * X can send an event to an embedded application when the real
- * focus window is in the container application and is an ancestor
- * of the container. This procedure's job is to forward the event
- * back to the application where it really belongs.
+ * This procedure is invoked when a key press or release event arrives
+ * for an application that does not believe it owns the input focus. This
+ * can happen because of embedding; for example, X can send an event to
+ * an embedded application when the real focus window is in the container
+ * application and is an ancestor of the container. This procedure's job
+ * is to forward the event back to the application where it really
+ * belongs.
*
* Results:
* None.
@@ -674,8 +639,8 @@ void
TkpRedirectKeyEvent(
TkWindow *winPtr, /* Window to which the event was originally
* reported. */
- XEvent *eventPtr) /* X event to redirect (should be KeyPress
- * or KeyRelease). */
+ XEvent *eventPtr) /* X event to redirect (should be KeyPress or
+ * KeyRelease). */
{
}
@@ -684,13 +649,13 @@ TkpRedirectKeyEvent(
*
* TkpGetOtherWindow --
*
- * If both the container and embedded window are in the same
- * process, this procedure will return either one, given the other.
+ * If both the container and embedded window are in the same process,
+ * this procedure will return either one, given the other.
*
* Results:
* If winPtr is a container, the return value is the token for the
- * embedded window, and vice versa. If the "other" window isn't in
- * this process, NULL is returned.
+ * embedded window, and vice versa. If the "other" window isn't in this
+ * process, NULL is returned.
*
* Side effects:
* None.
@@ -700,14 +665,14 @@ TkpRedirectKeyEvent(
TkWindow *
TkpGetOtherWindow(
- TkWindow *winPtr) /* Tk's structure for a container or
- * embedded window. */
+ TkWindow *winPtr) /* Tk's structure for a container or embedded
+ * window. */
{
Container *containerPtr;
/*
- * TkpGetOtherWindow returns NULL if both windows are not
- * in the same process...
+ * TkpGetOtherWindow returns NULL if both windows are not in the same
+ * process...
*/
if (!(winPtr->flags & TK_BOTH_HALVES)) {
@@ -749,7 +714,7 @@ EmbeddedEventProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
if (eventPtr->type == DestroyNotify) {
EmbedWindowDeleted(winPtr);
@@ -762,19 +727,19 @@ EmbeddedEventProc(
* ContainerEventProc --
*
* This procedure is invoked by the Tk event dispatcher when various
- * useful events are received for the children of a container
- * window. It forwards relevant information, such as geometry
- * requests, from the events into the container's application.
+ * useful events are received for the children of a container window. It
+ * forwards relevant information, such as geometry requests, from the
+ * events into the container's application.
*
- * NOTE: on the Mac, only the DestroyNotify branch is ever taken.
- * We don't synthesize the other events.
+ * NOTE: on the Mac, only the DestroyNotify branch is ever taken. We
+ * don't synthesize the other events.
*
* Results:
* None.
*
* Side effects:
- * Depends on the event. For example, when ConfigureRequest events
- * occur, geometry information gets set for the container window.
+ * Depends on the event. For example, when ConfigureRequest events occur,
+ * geometry information gets set for the container window.
*
*----------------------------------------------------------------------
*/
@@ -784,18 +749,18 @@ ContainerEventProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
Container *containerPtr;
Tk_ErrorHandler errHandler;
/*
- * Ignore any X protocol errors that happen in this procedure
- * (almost any operation could fail, for example, if the embedded
- * application has deleted its window).
+ * Ignore any X protocol errors that happen in this procedure (almost any
+ * operation could fail, for example, if the embedded application has
+ * deleted its window).
*/
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
- -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ -1, -1, NULL, NULL);
/*
* Find the Container structure associated with the parent window.
@@ -811,10 +776,9 @@ ContainerEventProc(
if (eventPtr->type == CreateNotify) {
/*
- * A new child window has been created in the container. Record
- * its id in the Container structure (if more than one child is
- * created, just remember the last one and ignore the earlier
- * ones).
+ * A new child window has been created in the container. Record its id
+ * in the Container structure (if more than one child is created, just
+ * remember the last one and ignore the earlier ones).
*/
containerPtr->embedded = eventPtr->xcreatewindow.window;
@@ -822,14 +786,13 @@ ContainerEventProc(
if ((eventPtr->xconfigurerequest.x != 0)
|| (eventPtr->xconfigurerequest.y != 0)) {
/*
- * The embedded application is trying to move itself, which
- * isn't legal. At this point, the window hasn't actually
- * moved, but we need to send it a ConfigureNotify event to
- * let it know that its request has been denied. If the
- * embedded application was also trying to resize itself, a
- * ConfigureNotify will be sent by the geometry management
- * code below, so we don't need to do anything. Otherwise,
- * generate a synthetic event.
+ * The embedded application is trying to move itself, which isn't
+ * legal. At this point, the window hasn't actually moved, but we
+ * need to send it a ConfigureNotify event to let it know that its
+ * request has been denied. If the embedded application was also
+ * trying to resize itself, a ConfigureNotify will be sent by the
+ * geometry management code below, so we don't need to do
+ * anything. Otherwise, generate a synthetic event.
*/
if ((eventPtr->xconfigurerequest.width == winPtr->changes.width)
@@ -844,8 +807,8 @@ ContainerEventProc(
} else if (eventPtr->type == MapRequest) {
/*
* The embedded application's map request was ignored and simply
- * passed on to us, so we have to map the window for it to appear
- * on the screen.
+ * passed on to us, so we have to map the window for it to appear on
+ * the screen.
*/
XMapWindow(eventPtr->xmaprequest.display,
@@ -865,11 +828,10 @@ ContainerEventProc(
*
* EmbedStructureProc --
*
- * This procedure is invoked by the Tk event dispatcher when
- * a container window owned by this application gets resized
- * (and also at several other times that we don't care about).
- * This procedure reflects the size change in the embedded
- * window that corresponds to the container.
+ * This procedure is invoked by the Tk event dispatcher when a container
+ * window owned by this application gets resized (and also at several
+ * other times that we don't care about). This procedure reflects the
+ * size change in the embedded window that corresponds to the container.
*
* Results:
* None.
@@ -885,7 +847,7 @@ EmbedStructureProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- Container *containerPtr = (Container *) clientData;
+ Container *containerPtr = clientData;
Tk_ErrorHandler errHandler;
if (eventPtr->type == ConfigureNotify) {
@@ -896,12 +858,10 @@ EmbedStructureProc(
*/
errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
- -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ -1, -1, NULL, NULL);
Tk_MoveResizeWindow((Tk_Window) containerPtr->embeddedPtr, 0, 0,
- (unsigned int) Tk_Width(
- (Tk_Window) containerPtr->parentPtr),
- (unsigned int) Tk_Height(
- (Tk_Window) containerPtr->parentPtr));
+ (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr),
+ (unsigned) Tk_Height((Tk_Window)containerPtr->parentPtr));
Tk_DeleteErrorHandler(errHandler);
}
} else if (eventPtr->type == DestroyNotify) {
@@ -914,10 +874,10 @@ EmbedStructureProc(
*
* EmbedActivateProc --
*
- * This procedure is invoked by the Tk event dispatcher when
- * Activate and Deactivate events occur for a container window owned
- * by this application. It is responsible for forwarding an activate
- * event down into the embedded toplevel.
+ * This procedure is invoked by the Tk event dispatcher when Activate and
+ * Deactivate events occur for a container window owned by this
+ * application. It is responsible for forwarding an activate event down
+ * into the embedded toplevel.
*
* Results:
* None.
@@ -933,7 +893,7 @@ EmbedActivateProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- Container *containerPtr = (Container *) clientData;
+ Container *containerPtr = clientData;
if (containerPtr->embeddedPtr != NULL) {
if (eventPtr->type == ActivateNotify) {
@@ -949,11 +909,10 @@ EmbedActivateProc(
*
* EmbedFocusProc --
*
- * This procedure is invoked by the Tk event dispatcher when
- * FocusIn and FocusOut events occur for a container window owned
- * by this application. It is responsible for moving the focus
- * back and forth between a container application and an embedded
- * application.
+ * This procedure is invoked by the Tk event dispatcher when FocusIn and
+ * FocusOut events occur for a container window owned by this
+ * application. It is responsible for moving the focus back and forth
+ * between a container application and an embedded application.
*
* Results:
* None.
@@ -969,37 +928,37 @@ EmbedFocusProc(
ClientData clientData, /* Token for container window. */
XEvent *eventPtr) /* ResizeRequest event. */
{
- Container *containerPtr = (Container *) clientData;
+ Container *containerPtr = clientData;
Display *display;
XEvent event;
if (containerPtr->embeddedPtr != NULL) {
- display = Tk_Display(containerPtr->parentPtr);
+ display = Tk_Display(containerPtr->parentPtr);
event.xfocus.serial = LastKnownRequestProcessed(display);
event.xfocus.send_event = false;
event.xfocus.display = display;
event.xfocus.mode = NotifyNormal;
event.xfocus.window = containerPtr->embedded;
- if (eventPtr->type == FocusIn) {
- /*
- * The focus just arrived at the container. Change the X focus
- * to move it to the embedded application, if there is one.
- * Ignore X errors that occur during this operation (it's
- * possible that the new focus window isn't mapped).
- */
+ if (eventPtr->type == FocusIn) {
+ /*
+ * The focus just arrived at the container. Change the X focus to
+ * move it to the embedded application, if there is one. Ignore X
+ * errors that occur during this operation (it's possible that the
+ * new focus window isn't mapped).
+ */
event.xfocus.detail = NotifyNonlinear;
event.xfocus.type = FocusIn;
-
} else if (eventPtr->type == FocusOut) {
- /* When the container gets a FocusOut event, it has to tell the embedded app
- * that it has lost the focus.
- */
+ /*
+ * When the container gets a FocusOut event, it has to tell the
+ * embedded app that it has lost the focus.
+ */
event.xfocus.type = FocusOut;
event.xfocus.detail = NotifyNonlinear;
- }
+ }
Tk_QueueWindowEvent(&event, TCL_QUEUE_MARK);
}
@@ -1010,10 +969,10 @@ EmbedFocusProc(
*
* EmbedGeometryRequest --
*
- * This procedure is invoked when an embedded application requests
- * a particular size. It processes the request (which may or may
- * not actually honor the request) and reflects the results back
- * to the embedded application.
+ * This procedure is invoked when an embedded application requests a
+ * particular size. It processes the request (which may or may not
+ * actually honor the request) and reflects the results back to the
+ * embedded application.
*
* NOTE: On the Mac, this is a stub, since we don't synthesize
* ConfigureRequest events.
@@ -1022,10 +981,10 @@ EmbedFocusProc(
* None.
*
* Side effects:
- * If we deny the child's size change request, a Configure event
- * is synthesized to let the child know how big it ought to be.
- * Events get processed while we're waiting for the geometry
- * managers to do their thing.
+ * If we deny the child's size change request, a Configure event is
+ * synthesized to let the child know how big it ought to be. Events get
+ * processed while we're waiting for the geometry managers to do their
+ * thing.
*
*----------------------------------------------------------------------
*/
@@ -1038,13 +997,13 @@ EmbedGeometryRequest(
TkWindow *winPtr = containerPtr->parentPtr;
/*
- * Forward the requested size into our geometry management hierarchy
- * via the container window. We need to send a Configure event back
- * to the embedded application if we decide not to honor its
- * request; to make this happen, process all idle event handlers
- * synchronously here (so that the geometry managers have had a
- * chance to do whatever they want to do), and if the window's size
- * didn't change then generate a configure event.
+ * Forward the requested size into our geometry management hierarchy via
+ * the container window. We need to send a Configure event back to the
+ * embedded application if we decide not to honor its request; to make
+ * this happen, process all idle event handlers synchronously here (so
+ * that the geometry managers have had a chance to do whatever they want
+ * to do), and if the window's size didn't change then generate a
+ * configure event.
*/
Tk_GeometryRequest((Tk_Window) winPtr, width, height);
@@ -1062,13 +1021,12 @@ EmbedGeometryRequest(
*
* EmbedSendConfigure --
*
- * This is currently a stub. It is called to notify an
- * embedded application of its current size and location. This
- * procedure is called when the embedded application made a
- * geometry request that we did not grant, so that the embedded
- * application knows that its geometry didn't change after all.
- * It is a response to ConfigureRequest events, which we do not
- * currently synthesize on the Mac
+ * This is currently a stub. It is called to notify an embedded
+ * application of its current size and location. This procedure is called
+ * when the embedded application made a geometry request that we did not
+ * grant, so that the embedded application knows that its geometry didn't
+ * change after all. It is a response to ConfigureRequest events, which
+ * we do not currently synthesize on the Mac
*
* Results:
* None.
@@ -1090,9 +1048,9 @@ EmbedSendConfigure(
*
* EmbedWindowDeleted --
*
- * This procedure is invoked when a window involved in embedding
- * (as either the container or the embedded application) is
- * destroyed. It cleans up the Container structure for the window.
+ * This procedure is invoked when a window involved in embedding (as
+ * either the container or the embedded application) is destroyed. It
+ * cleans up the Container structure for the window.
*
* Results:
* None.
@@ -1111,16 +1069,14 @@ EmbedWindowDeleted(
Container *containerPtr, *prevPtr;
/*
- * Find the Container structure for this window. Delete the
- * information about the embedded application and free the container's
- * record.
+ * Find the Container structure for this window. Delete the information
+ * about the embedded application and free the container's record.
*/
prevPtr = NULL;
containerPtr = firstContainerPtr;
while (1) {
if (containerPtr->embeddedPtr == winPtr) {
-
/*
* We also have to destroy our parent, to clean up the container.
* Fabricate an event to do this.
@@ -1131,20 +1087,18 @@ EmbedWindowDeleted(
XEvent event;
event.xany.serial =
- Tk_Display(containerPtr->parentPtr)->request;
- event.xany.send_event = False;
- event.xany.display = Tk_Display(containerPtr->parentPtr);
-
- event.xany.type = DestroyNotify;
- event.xany.window = containerPtr->parent;
- event.xdestroywindow.event = containerPtr->parent;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_HEAD);
-
+ Tk_Display(containerPtr->parentPtr)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(containerPtr->parentPtr);
+
+ event.xany.type = DestroyNotify;
+ event.xany.window = containerPtr->parent;
+ event.xdestroywindow.event = containerPtr->parent;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_HEAD);
}
containerPtr->embedded = None;
containerPtr->embeddedPtr = NULL;
-
break;
}
if (containerPtr->parentPtr == winPtr) {
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 34128e9..72929c0 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -5,7 +5,7 @@
* font package interface. This version uses ATSU instead of Quickdraw.
*
* Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
*
* Some functions were originally copied verbatim from the QuickDraw version
* of tkMacOSXFont.c, which had these copyright notices:
@@ -35,7 +35,7 @@
* that such fonts can not be used for controls, because controls
* definitely require a family id (this assertion needs testing).
*
- * RCS: @(#) $Id: tkMacOSXFont.c,v 1.24.2.10 2007/11/21 16:46:27 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXFont.c,v 1.24.2.11 2008/06/25 16:46:08 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -213,8 +213,9 @@ static const Tcl_UniChar *UpdateLineBuffer(const MacFont *fontPtr,
* Initialization and setup of a font data structure.
*/
-static void InitFont(Tk_Window tkwin, FMFontFamily familyId,
- const char *familyName, int size, int qdStyle, MacFont *fontPtr);
+static const char *FamilyNameForFamilyID(FMFontFamily familyId);
+static void InitFont(FMFontFamily familyId, const char *familyName,
+ int size, int qdStyle, MacFont *fontPtr);
static void InitATSUObjects(FMFontFamily familyId, short qdsize, short qdStyle,
ATSUFontID *fontIdPtr, ATSUTextLayout *layoutPtr, ATSUStyle *stylePtr);
static void InitATSUStyle(ATSUFontID fontId, short ptSize, short qdStyle,
@@ -470,7 +471,7 @@ TkpGetNativeFont(
CopyPascalStringToC(fontName, (char*)fontName);
fontPtr = (MacFont *) ckalloc(sizeof(MacFont));
- InitFont(tkwin, fontFamily, (char*)fontName, fontSize, fontStyle, fontPtr);
+ InitFont(fontFamily, (char*)fontName, fontSize, fontStyle, fontPtr);
return (TkFont *) fontPtr;
}
@@ -549,7 +550,8 @@ TkpGetFontFromAttributes(
fontPtr = (MacFont *) tkFontPtr;
ReleaseFont(fontPtr);
}
- InitFont(tkwin, familyId, name, faPtr->size, qdStyle, fontPtr);
+ InitFont(familyId, name, TkFontGetPoints(tkwin, faPtr->size),
+ qdStyle, fontPtr);
return (TkFont *) fontPtr;
}
@@ -1372,6 +1374,48 @@ UpdateLineBuffer(
/*
*---------------------------------------------------------------------------
*
+ * FamilyNameForFamilyID --
+ *
+ * Helper for InitFont() and TkMacOSXFontDescriptionForFMFontInfo().
+ * Retrieves font family names for a given font family ID.
+ *
+ * Results:
+ * Font family name or NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static const char *
+FamilyNameForFamilyID(
+ FMFontFamily familyId)
+{
+ OSStatus err;
+ char name[256] = "";
+ const MacFontFamily * familyPtr = NULL;
+
+ err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name));
+ if (err == noErr) {
+ /*
+ * We find the canonical font name, so we can avoid unnecessary
+ * memory management.
+ */
+
+ familyPtr = FindFontFamily(name);
+#ifdef TK_MAC_DEBUG_FONTS
+ if (!familyPtr) {
+ TkMacOSXDbgMsg("Font family '%s' not found", name);
+ }
+#endif
+ }
+ return familyPtr ? familyPtr->name : NULL;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
* InitFont --
*
* Helper for TkpGetNativeFont() and TkpGetFontFromAttributes().
@@ -1393,7 +1437,6 @@ UpdateLineBuffer(
static void
InitFont(
- Tk_Window tkwin, /* For display where font will be used. */
FMFontFamily familyId, /* The font family to initialize for. */
const char * familyName, /* The font family name, if known. Otherwise
* this can be NULL. */
@@ -1402,45 +1445,24 @@ InitFont(
MacFont * fontPtr) /* Filled with information constructed from the
* above arguments. */
{
- OSStatus err;
FontInfo fi;
TkFontAttributes * faPtr;
TkFontMetrics * fmPtr;
- short points;
int periodWidth, wWidth;
if (size == 0) {
size = GetDefFontSize();
}
- points = (short) TkFontGetPoints(tkwin, size);
- ChkErr(FetchFontInfo, familyId, points, qdStyle, &fi);
- if (familyName == NULL) {
- char name[256] = "";
- const MacFontFamily * familyPtr;
-
- err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name));
- if (err == noErr) {
- /*
- * We find the canonical font name, so we can avoid unnecessary
- * memory management.
- */
-
- familyPtr = FindFontFamily(name);
- if (familyPtr != NULL) {
- familyName = familyPtr->name;
- } else {
-#ifdef TK_MAC_DEBUG_FONTS
- TkMacOSXDbgMsg("Font family '%s' not found", name);
-#endif
- }
- }
+ ChkErr(FetchFontInfo, familyId, size, qdStyle, &fi);
+ if (!familyName) {
+ familyName = FamilyNameForFamilyID(familyId);
}
fontPtr->font.fid = (Font) fontPtr;
faPtr = &fontPtr->font.fa;
faPtr->family = familyName;
- faPtr->size = points;
+ faPtr->size = size;
faPtr->weight = (qdStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
faPtr->slant = (qdStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
faPtr->underline = ((qdStyle & underline) != 0);
@@ -1461,10 +1483,10 @@ InitFont(
fmPtr->maxWidth = fi.widMax;
fontPtr->qdFont = familyId;
- fontPtr->qdSize = points;
+ fontPtr->qdSize = size;
fontPtr->qdStyle = (short) qdStyle;
- InitATSUObjects(familyId, points, qdStyle, &fontPtr->atsuFontId,
+ InitATSUObjects(familyId, size, qdStyle, &fontPtr->atsuFontId,
&fontPtr->atsuLayout, &fontPtr->atsuStyle);
Tk_MeasureChars((Tk_Font)fontPtr, ".", 1, -1, 0, &periodWidth);
@@ -2462,3 +2484,12 @@ TkMacOSXUseAntialiasedText(
antialiasedTextEnabled = enable;
return TCL_OK;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index ed06f25..1af15de 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -6,12 +6,12 @@
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2005-2008 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.28.2.4 2007/09/07 01:25:37 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.28.2.5 2008/06/25 16:46:08 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -24,19 +24,20 @@
#include <mach-o/getsect.h>
/*
- * Define the following to 0 to not attempt to use an undocumented SPI
- * to notify the window server that an unbundled executable is a full
- * GUI application after loading Tk.
+ * Define the following to 0 to not attempt to use an undocumented SPI to
+ * notify the window server that an unbundled executable is a full GUI
+ * application after loading Tk.
*/
+
#ifndef MAC_OSX_TK_USE_CPS_SPI
#define MAC_OSX_TK_USE_CPS_SPI 1
#endif
/*
* The following structures are used to map the script/language codes of a
- * font to the name that should be passed to Tcl_GetEncoding() to obtain
- * the encoding for that font. The set of numeric constants is fixed and
- * defined by Apple.
+ * font to the name that should be passed to Tcl_GetEncoding() to obtain the
+ * encoding for that font. The set of numeric constants is fixed and defined
+ * by Apple.
*/
typedef struct Map {
@@ -83,13 +84,13 @@ static Map scriptMap[] = {
Tcl_Encoding TkMacOSXCarbonEncoding = NULL;
/*
- * If the App is in an App package, then we want to add the Scripts
- * directory to the auto_path.
+ * If the App is in an App package, then we want to add the Scripts directory
+ * to the auto_path.
*/
+
static char scriptPath[PATH_MAX + 1] = "";
float tkMacOSXToolboxVersionNumber = 0;
-
/*
*----------------------------------------------------------------------
@@ -100,8 +101,8 @@ float tkMacOSXToolboxVersionNumber = 0;
* tk_library variable.
*
* Results:
- * Returns a standard Tcl result. Leaves an error message or result
- * in the interp's result.
+ * Returns a standard Tcl result. Leaves an error message or result in
+ * the interp's result.
*
* Side effects:
* Sets "tk_library" Tcl variable, runs "tk.tcl" script.
@@ -119,9 +120,9 @@ TkpInit(
Tk_MacOSXSetupTkNotifier();
/*
- * Since it is possible for TkInit to be called multiple times
- * and we don't want to do the following initialization multiple times
- * we protect against doing it more than once.
+ * Since it is possible for TkInit to be called multiple times and we
+ * don't want to do the following initialization multiple times we protect
+ * against doing it more than once.
*/
if (!initialized) {
@@ -130,7 +131,7 @@ TkpInit(
CFURLRef bundleUrl = NULL;
CFStringEncoding encoding;
const char *encodingStr = NULL;
- int i;
+ int i;
struct utsname name;
long osVersion = 0;
@@ -145,7 +146,7 @@ TkpInit(
}
if (osVersion && osVersion < (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10) {
Tcl_Panic("Mac OS X 10.%d or later required !",
- (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10);
+ (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10);
}
TK_IF_MAC_OS_X_API (3, &kHIToolboxVersionNumber,
tkMacOSXToolboxVersionNumber = kHIToolboxVersionNumber;
@@ -174,7 +175,7 @@ TkpInit(
"com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 1, PATH_MAX,
tkLibPath) != TCL_OK)
#endif
- {
+ {
/* Tk.framework not found, check if resource file is open */
Handle rsrc = Get1NamedResource('CURS', "\phand");
if (rsrc) {
@@ -194,7 +195,7 @@ TkpInit(
image = _dyld_get_image_header(i);
if (image) {
data = getsectdatafromheader(image, SEG_TEXT,
- "__tk_rsrc", (void*)&size);
+ "__tk_rsrc", (void *) &size);
if (data) {
data += _dyld_get_image_vmaddr_slide(i);
break;
@@ -222,7 +223,7 @@ TkpInit(
if (write(fd, data, size) == -1) {
break;
}
- if(ChkErr(FSPathMakeRef, (unsigned char*)fileName, &ref,
+ if(ChkErr(FSPathMakeRef, (unsigned char *) fileName, &ref,
NULL) != noErr) {
break;
}
@@ -260,11 +261,14 @@ TkpInit(
* executable's url and compare the resulting url with the main
* bundle url.
*/
+
int j = 3;
CFURLRef url = CFBundleCopyExecutableURL(bundleRef);
+
while (url && j--) {
- CFURLRef parent = CFURLCreateCopyDeletingLastPathComponent(NULL,
- url);
+ CFURLRef parent =
+ CFURLCreateCopyDeletingLastPathComponent(NULL, url);
+
CFRelease(url);
url = parent;
}
@@ -275,8 +279,11 @@ TkpInit(
CFRelease(bundleUrl);
}
- /* If we are not a bundled executable, notify the window server that
- * we are a foregroundable app. */
+ /*
+ * If we are not a bundled executable, notify the window server that
+ * we are a foregroundable app.
+ */
+
if (!bundledExecutable) {
OSStatus err = procNotFound;
ProcessSerialNumber psn = { 0, kCurrentProcess };
@@ -293,6 +300,7 @@ TkpInit(
* server. Load the SPI symbol dynamically, so that we don't
* break if it ever disappears or changes its name.
*/
+
TkMacOSXInitNamedSymbol(CoreGraphics, OSStatus,
CPSEnableForegroundOperation, ProcessSerialNumberPtr);
if (CPSEnableForegroundOperation) {
@@ -327,8 +335,8 @@ TkpInit(
}
/*
- * FIXME: Close stdin & stdout for remote debugging otherwise we
- * will fight with gdb for stdin & stdout
+ * FIXME: Close stdin & stdout for remote debugging otherwise we will
+ * fight with gdb for stdin & stdout
*/
if (getenv("XCNOSTDIN") != NULL) {
@@ -389,9 +397,9 @@ TkpInit(
*
* TkpGetAppName --
*
- * Retrieves the name of the current application from a platform
- * specific location. For Unix, the application name is the tail
- * of the path contained in the tcl variable argv0.
+ * Retrieves the name of the current application from a platform specific
+ * location. For Unix, the application name is the tail of the path
+ * contained in the tcl variable argv0.
*
* Results:
* Returns the application name in the given Tcl_DString.
@@ -426,8 +434,8 @@ TkpGetAppName(
*
* TkpDisplayWarning --
*
- * This routines is called from Tk_Main to display warning
- * messages that occur during startup.
+ * This routines is called from Tk_Main to display warning messages that
+ * occur during startup.
*
* Results:
* None.
@@ -444,6 +452,7 @@ TkpDisplayWarning(
CONST char *title) /* Title of warning. */
{
Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR);
+
if (errChannel) {
Tcl_WriteChars(errChannel, title, -1);
Tcl_WriteChars(errChannel, ": ", 2);
@@ -457,13 +466,11 @@ TkpDisplayWarning(
*
* TkMacOSXDefaultStartupScript --
*
- *
- * On MacOS X, we look for a file in the Resources/Scripts
- * directory called AppMain.tcl and if found, we set argv[1] to
- * that, so that the rest of the code will find it, and add the
- * Scripts folder to the auto_path. If we don't find the startup
- * script, we just bag it, assuming the user is starting up some
- * other way.
+ * On MacOS X, we look for a file in the Resources/Scripts directory
+ * called AppMain.tcl and if found, we set argv[1] to that, so that the
+ * rest of the code will find it, and add the Scripts folder to the
+ * auto_path. If we don't find the startup script, we just bag it,
+ * assuming the user is starting up some other way.
*
* Results:
* None.
@@ -482,24 +489,21 @@ TkMacOSXDefaultStartupScript(void)
bundleRef = CFBundleGetMainBundle();
if (bundleRef != NULL) {
- CFURLRef appMainURL;
- appMainURL = CFBundleCopyResourceURL(bundleRef,
- CFSTR("AppMain"),
- CFSTR("tcl"),
- CFSTR("Scripts"));
+ CFURLRef appMainURL = CFBundleCopyResourceURL(bundleRef,
+ CFSTR("AppMain"), CFSTR("tcl"), CFSTR("Scripts"));
if (appMainURL != NULL) {
CFURLRef scriptFldrURL;
char startupScript[PATH_MAX + 1];
if (CFURLGetFileSystemRepresentation (appMainURL, true,
- (unsigned char*) startupScript, PATH_MAX)) {
- Tcl_SetStartupScript(Tcl_NewStringObj(startupScript, -1), NULL);
- scriptFldrURL = CFURLCreateCopyDeletingLastPathComponent(
- NULL, appMainURL);
+ (unsigned char *) startupScript, PATH_MAX)) {
+ Tcl_SetStartupScript(Tcl_NewStringObj(startupScript,-1), NULL);
+ scriptFldrURL = CFURLCreateCopyDeletingLastPathComponent(NULL,
+ appMainURL);
if (scriptFldrURL != NULL) {
- CFURLGetFileSystemRepresentation(scriptFldrURL,
- true, (unsigned char*) scriptPath, PATH_MAX);
+ CFURLGetFileSystemRepresentation(scriptFldrURL, true,
+ (unsigned char *) scriptPath, PATH_MAX);
CFRelease(scriptFldrURL);
}
}
@@ -513,11 +517,9 @@ TkMacOSXDefaultStartupScript(void)
*
* TkMacOSXGetNamedSymbol --
*
- *
- * Dynamically acquire address of a named symbol from a loaded
- * dynamic library, so that we can use API that may not be
- * available on all OS versions.
- * If module is non-NULL and not the empty string, use twolevel
+ * Dynamically acquire address of a named symbol from a loaded dynamic
+ * library, so that we can use API that may not be available on all OS
+ * versions. If module is non-NULL and not the empty string, use twolevel
* namespace lookup.
*
* Results:
@@ -535,18 +537,68 @@ TkMacOSXGetNamedSymbol(
const char* symbol)
{
NSSymbol nsSymbol = NULL;
+
if (module && *module) {
- if(NSIsSymbolNameDefinedWithHint(symbol, module)) {
+ if (NSIsSymbolNameDefinedWithHint(symbol, module)) {
nsSymbol = NSLookupAndBindSymbolWithHint(symbol, module);
}
} else {
- if(NSIsSymbolNameDefined(symbol)) {
+ if (NSIsSymbolNameDefined(symbol)) {
nsSymbol = NSLookupAndBindSymbol(symbol);
}
}
- if (nsSymbol) {
- return NSAddressOfSymbol(nsSymbol);
- } else {
+
+ if (!nsSymbol) {
return NULL;
}
+ return NSAddressOfSymbol(nsSymbol);
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetStringObjFromCFString --
+ *
+ * Get a string object from a CFString as efficiently as possible.
+ *
+ * Results:
+ * New string object or NULL if conversion failed.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MODULE_SCOPE Tcl_Obj*
+TkMacOSXGetStringObjFromCFString(
+ CFStringRef str)
+{
+ Tcl_Obj *obj = NULL;
+ const char *c = CFStringGetCStringPtr(str, kCFStringEncodingUTF8);
+
+ if (c) {
+ obj = Tcl_NewStringObj(c, -1);
+ } else {
+ CFRange all = CFRangeMake(0, CFStringGetLength(str));
+ CFIndex len;
+
+ if (CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false, NULL,
+ 0, &len) > 0) {
+ obj = Tcl_NewObj();
+ Tcl_SetObjLength(obj, len);
+ CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false,
+ (UInt8*) obj->bytes, len, NULL);
+ }
+ }
+ return obj;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h
index ea5bed6..e324db0 100644
--- a/macosx/tkMacOSXPrivate.h
+++ b/macosx/tkMacOSXPrivate.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.1.4.6 2008/01/23 16:39:12 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.1.4.7 2008/06/25 16:46:08 dgp Exp $
*/
#ifndef _TKMACPRIV
@@ -335,5 +335,6 @@ MODULE_SCOPE void TkMacOSXBringWindowForward(WindowRef wRef);
MODULE_SCOPE WindowRef TkMacOSXDrawableWindow(Drawable drawable);
MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds);
MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable);
+MODULE_SCOPE Tcl_Obj* TkMacOSXGetStringObjFromCFString(CFStringRef str);
#endif /* _TKMACPRIV */
diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c
index 076418d..3a2f961 100644
--- a/macosx/tkMacOSXSend.c
+++ b/macosx/tkMacOSXSend.c
@@ -1,175 +1,171 @@
/*
* tkMacOSXSend.c --
*
- * This file provides procedures that implement the "send"
- * command, allowing commands to be passed from interpreter
- * to interpreter. This current implementation for the Mac
- * has most functionality stubed out.
- *
- * The current plan, which we have not had time to implement, is
- * for the first Wish app to create a gestalt of type 'WIsH'.
- * This gestalt will point to a table, in system memory, of
- * Tk apps. Each Tk app, when it starts up, will register their
- * name, and process ID, in this table. This will allow us to
- * implement "tk appname".
- *
- * Then the send command will look up the process id of the target
- * app in this table, and send an AppleEvent to that process. The
- * AppleEvent handler is much like the do script handler, except that
- * you have to specify the name of the tk app as well, since there may
- * be many interps in one wish app, and you need to send it to the
- * right one.
- *
- * Implementing this has been on our list of things to do, but what
- * with the demise of Tcl at Sun, and the lack of resources at
- * Scriptics it may not get done for awhile. So this sketch is
- * offered for the brave to attempt if they need the functionality...
+ * This file provides procedures that implement the "send" command,
+ * allowing commands to be passed from interpreter to interpreter. This
+ * current implementation for the Mac has most functionality stubed out.
+ *
+ * The current plan, which we have not had time to implement, is for the
+ * first Wish app to create a gestalt of type 'WIsH'. This gestalt will
+ * point to a table, in system memory, of Tk apps. Each Tk app, when it
+ * starts up, will register their name, and process ID, in this table.
+ * This will allow us to implement "tk appname".
+ *
+ * Then the send command will look up the process id of the target app in
+ * this table, and send an AppleEvent to that process. The AppleEvent
+ * handler is much like the do script handler, except that you have to
+ * specify the name of the tk app as well, since there may be many
+ * interps in one wish app, and you need to send it to the right one.
+ *
+ * Implementing this has been on our list of things to do, but what with
+ * the demise of Tcl at Sun, and the lack of resources at Scriptics it
+ * may not get done for awhile. So this sketch is offered for the brave
+ * to attempt if they need the functionality...
*
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994-1998 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
* Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXSend.c,v 1.6.2.1 2007/06/04 15:19:00 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXSend.c,v 1.6.2.2 2008/06/25 16:46:08 dgp Exp $
*/
#include "tkMacOSXInt.h"
/*
- * The following structure is used to keep track of the
- * interpreters registered by this process.
+ * The following structure is used to keep track of the interpreters
+ * registered by this process.
*/
typedef struct RegisteredInterp {
char *name; /* Interpreter's name (malloc-ed). */
- Tcl_Interp *interp; /* Interpreter associated with
- * name. */
+ Tcl_Interp *interp; /* Interpreter associated with name. */
struct RegisteredInterp *nextPtr;
- /* Next in list of names associated
- * with interps in this process.
- * NULL means end of list. */
+ /* Next in list of names associated with
+ * interps in this process. NULL means end of
+ * list. */
} RegisteredInterp;
/*
- * A registry of all interpreters for a display is kept in a
- * property "InterpRegistry" on the root window of the display.
- * It is organized as a series of zero or more concatenated strings
- * (in no particular order), each of the form
+ * A registry of all interpreters for a display is kept in a property
+ * "InterpRegistry" on the root window of the display. It is organized as a
+ * series of zero or more concatenated strings (in no particular order), each
+ * of the form
* window space name '\0'
- * where "window" is the hex id of the comm. window to use to talk
- * to an interpreter named "name".
+ * where "window" is the hex id of the comm. window to use to talk to an
+ * interpreter named "name".
*
- * When the registry is being manipulated by an application (e.g. to
- * add or remove an entry), it is loaded into memory using a structure
- * of the following type:
+ * When the registry is being manipulated by an application (e.g. to add or
+ * remove an entry), it is loaded into memory using a structure of the
+ * following type:
*/
typedef struct NameRegistry {
TkDisplay *dispPtr; /* Display from which the registry was
* read. */
- int locked; /* Non-zero means that the display was
- * locked when the property was read in. */
- int modified; /* Non-zero means that the property has
- * been modified, so it needs to be written
- * out when the NameRegistry is closed. */
+ int locked; /* Non-zero means that the display was locked
+ * when the property was read in. */
+ int modified; /* Non-zero means that the property has been
+ * modified, so it needs to be written out
+ * when the NameRegistry is closed. */
unsigned long propLength; /* Length of the property, in bytes. */
- char *property; /* The contents of the property, or NULL
- * if none. See format description above;
- * this is *not* terminated by the first
- * null character. Dynamically allocated. */
+ char *property; /* The contents of the property, or NULL if
+ * none. See format description above; this is
+ * *not* terminated by the first null
+ * character. Dynamically allocated. */
int allocedByX; /* Non-zero means must free property with
* XFree; zero means use ckfree. */
} NameRegistry;
-static int initialized = false; /* A flag to denote if we have initialized yet. */
+static int initialized = false; /* A flag to denote if we have initialized
+ * yet. */
static RegisteredInterp *interpListPtr = NULL;
-/* List of all interpreters
- * registered by this process. */
-
- /*
- * The information below is used for communication between processes
- * during "send" commands. Each process keeps a private window, never
- * even mapped, with one property, "Comm". When a command is sent to
- * an interpreter, the command is appended to the comm property of the
- * communication window associated with the interp's process. Similarly,
- * when a result is returned from a sent command, it is also appended
- * to the comm property.
- *
- * Each command and each result takes the form of ASCII text. For a
- * command, the text consists of a zero character followed by several
- * null-terminated ASCII strings. The first string consists of the
- * single letter "c". Subsequent strings have the form "option value"
- * where the following options are supported:
- *
- * -r commWindow serial
- *
- * This option means that a response should be sent to the window
- * whose X identifier is "commWindow" (in hex), and the response should
- * be identified with the serial number given by "serial" (in decimal).
- * If this option isn't specified then the send is asynchronous and
- * no response is sent.
- *
- * -n name
- * "Name" gives the name of the application for which the command is
- * intended. This option must be present.
- *
- * -s script
- *
- * "Script" is the script to be executed. This option must be present.
- *
- * The options may appear in any order. The -n and -s options must be
- * present, but -r may be omitted for asynchronous RPCs. For compatibility
- * with future releases that may add new features, there may be additional
- * options present; as long as they start with a "-" character, they will
- * be ignored.
- *
- * A result also consists of a zero character followed by several null-
- * terminated ASCII strings. The first string consists of the single
- * letter "r". Subsequent strings have the form "option value" where
- * the following options are supported:
- *
- * -s serial
- *
- * Identifies the command for which this is the result. It is the
- * same as the "serial" field from the -s option in the command. This
- * option must be present.
- *
- * -c code
- *
- * "Code" is the completion code for the script, in decimal. If the
- * code is omitted it defaults to TCL_OK.
- *
- * -r result
- *
- * "Result" is the result string for the script, which may be either
- * a result or an error message. If this field is omitted then it
- * defaults to an empty string.
- *
- * -i errorInfo
- *
- * "ErrorInfo" gives a string with which to initialize the errorInfo
- * variable. This option may be omitted; it is ignored unless the
- * completion code is TCL_ERROR.
- *
- * -e errorCode
- *
- * "ErrorCode" gives a string with with to initialize the errorCode
- * variable. This option may be omitted; it is ignored unless the
- * completion code is TCL_ERROR.
- *
- * Options may appear in any order, and only the -s option must be
- * present. As with commands, there may be additional options besides
- * these; unknown options are ignored.
- */
-
- /*
- * Maximum size property that can be read at one time by
- * this module:
- */
+ /* List of all interpreters registered by this
+ * process. */
+
+/*
+ * The information below is used for communication between processes during
+ * "send" commands. Each process keeps a private window, never even mapped,
+ * with one property, "Comm". When a command is sent to an interpreter, the
+ * command is appended to the comm property of the communication window
+ * associated with the interp's process. Similarly, when a result is returned
+ * from a sent command, it is also appended to the comm property.
+ *
+ * Each command and each result takes the form of ASCII text. For a command,
+ * the text consists of a zero character followed by several null-terminated
+ * ASCII strings. The first string consists of the single letter "c".
+ * Subsequent strings have the form "option value" where the following options
+ * are supported:
+ *
+ * -r commWindow serial
+ *
+ * This option means that a response should be sent to the window whose X
+ * identifier is "commWindow" (in hex), and the response should be
+ * identified with the serial number given by "serial" (in decimal). If
+ * this option isn't specified then the send is asynchronous and no
+ * response is sent.
+ *
+ * -n name
+ *
+ * "Name" gives the name of the application for which the command is
+ * intended. This option must be present.
+ *
+ * -s script
+ *
+ * "Script" is the script to be executed. This option must be present.
+ *
+ * The options may appear in any order. The -n and -s options must be present,
+ * but -r may be omitted for asynchronous RPCs. For compatibility with future
+ * releases that may add new features, there may be additional options
+ * present; as long as they start with a "-" character, they will be ignored.
+ *
+ *
+ * A result also consists of a zero character followed by several null-
+ * terminated ASCII strings. The first string consists of the single letter
+ * "r". Subsequent strings have the form "option value" where the following
+ * options are supported:
+ *
+ * -s serial
+ *
+ * Identifies the command for which this is the result. It is the same as
+ * the "serial" field from the -s option in the command. This option must
+ * be present.
+ *
+ * -c code
+ *
+ * "Code" is the completion code for the script, in decimal. If the code
+ * is omitted it defaults to TCL_OK.
+ *
+ * -r result
+ *
+ * "Result" is the result string for the script, which may be either a
+ * result or an error message. If this field is omitted then it defaults
+ * to an empty string.
+ *
+ * -i errorInfo
+ *
+ * "ErrorInfo" gives a string with which to initialize the errorInfo
+ * variable. This option may be omitted; it is ignored unless the
+ * completion code is TCL_ERROR.
+ *
+ * -e errorCode
+ *
+ * "ErrorCode" gives a string with with to initialize the errorCode
+ * variable. This option may be omitted; it is ignored unless the
+ * completion code is TCL_ERROR.
+ *
+ * Options may appear in any order, and only the -s option must be present. As
+ * with commands, there may be additional options besides these; unknown
+ * options are ignored.
+ */
+
+/*
+ * Maximum size property that can be read at one time by this module:
+ */
#define MAX_PROP_WORDS 100000
@@ -178,7 +174,6 @@ static RegisteredInterp *interpListPtr = NULL;
*/
static int SendInit(Tcl_Interp *interp);
-
/*
*--------------------------------------------------------------
@@ -186,34 +181,33 @@ static int SendInit(Tcl_Interp *interp);
* Tk_SetAppName --
*
* This procedure is called to associate an ASCII name with a Tk
- * application. If the application has already been named, the
- * name replaces the old one.
+ * application. If the application has already been named, the name
+ * replaces the old one.
*
* Results:
- * The return value is the name actually given to the application.
- * This will normally be the same as name, but if name was already
- * in use for an application then a name of the form "name #2" will
- * be chosen, with a high enough number to make the name unique.
+ * The return value is the name actually given to the application. This
+ * will normally be the same as name, but if name was already in use for
+ * an application then a name of the form "name #2" will be chosen, with
+ * a high enough number to make the name unique.
*
* Side effects:
- * Registration info is saved, thereby allowing the "send" command
- * to be used later to invoke commands in the application. In
- * addition, the "send" command is created in the application's
- * interpreter. The registration will be removed automatically
- * if the interpreter is deleted or the "send" command is removed.
+ * Registration info is saved, thereby allowing the "send" command to be
+ * used later to invoke commands in the application. In addition, the
+ * "send" command is created in the application's interpreter. The
+ * registration will be removed automatically if the interpreter is
+ * deleted or the "send" command is removed.
*
*--------------------------------------------------------------
*/
CONST char *
Tk_SetAppName(
- Tk_Window tkwin, /* Token for any window in the application
- * to be named: it is just used to identify
- * the application and the display. */
- CONST char *name) /* The name that will be used to
- * refer to the interpreter in later
- * "send" commands. Must be globally
- * unique. */
+ Tk_Window tkwin, /* Token for any window in the application to
+ * be named: it is just used to identify the
+ * application and the display. */
+ CONST char *name) /* The name that will be used to refer to the
+ * interpreter in later "send" commands. Must
+ * be globally unique. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
Tcl_Interp *interp = winPtr->mainPtr->interp;
@@ -229,9 +223,9 @@ Tk_SetAppName(
}
/*
- * See if the application is already registered; if so, remove its
- * current name from the registry. The deletion of the command
- * will take care of disposing of this entry.
+ * See if the application is already registered; if so, remove its current
+ * name from the registry. The deletion of the command will take care of
+ * disposing of this entry.
*/
for (riPtr = interpListPtr, prevPtr = NULL; riPtr != NULL;
@@ -247,10 +241,9 @@ Tk_SetAppName(
}
/*
- * Pick a name to use for the application. Use "name" if it's not
- * already in use. Otherwise add a suffix such as " #2", trying
- * larger and larger numbers until we eventually find one that is
- * unique.
+ * Pick a name to use for the application. Use "name" if it's not already
+ * in use. Otherwise add a suffix such as " #2", trying larger and larger
+ * numbers until we eventually find one that is unique.
*/
actualName = name;
@@ -301,8 +294,7 @@ Tk_SetAppName(
* TODO: DeleteProc
*/
- Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd,
- (ClientData) riPtr, NULL);
+ Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd, riPtr, NULL);
if (Tcl_IsSafe(interp)) {
Tcl_HideCommand(interp, "send", "send");
}
@@ -316,8 +308,8 @@ Tk_SetAppName(
*
* Tk_SendObjCmd --
*
- * This procedure is invoked to process the "send" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "send" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -375,11 +367,10 @@ Tk_SendObjCmd(
resultPtr = Tcl_GetObjResult(interp);
/*
- * See if the target interpreter is local. If so, execute
- * the command directly without going through the DDE server.
- * The only tricky thing is passing the result from the target
- * interpreter to the invoking interpreter. Watch out: they
- * could be the same!
+ * See if the target interpreter is local. If so, execute the command
+ * directly without going through the DDE server. The only tricky thing is
+ * passing the result from the target interpreter to the invoking
+ * interpreter. Watch out: they could be the same!
*/
for (riPtr = interpListPtr; (riPtr != NULL)
@@ -387,29 +378,29 @@ Tk_SendObjCmd(
/*
* Empty loop body.
*/
-
}
if (riPtr != NULL) {
/*
- * This command is to a local interp. No need to go through
- * the server.
+ * This command is to a local interp. No need to go through the
+ * server.
*/
Tcl_Interp *localInterp;
- Tcl_Preserve((ClientData) riPtr);
+ Tcl_Preserve(riPtr);
localInterp = riPtr->interp;
- Tcl_Preserve((ClientData) localInterp);
+ Tcl_Preserve(localInterp);
if (firstArg == (objc - 1)) {
/*
- * This might be one of those cases where the new
- * parser is faster.
+ * This might be one of those cases where the new parser is
+ * faster.
*/
- result = Tcl_EvalObjEx(localInterp, objv[firstArg], TCL_EVAL_DIRECT);
+ result = Tcl_EvalObjEx(localInterp, objv[firstArg],
+ TCL_EVAL_DIRECT);
} else {
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ listObjPtr = Tcl_NewListObj(0, NULL);
for (i = firstArg; i < objc; i++) {
Tcl_ListObjAppendList(interp, listObjPtr, objv[i]);
}
@@ -425,9 +416,9 @@ Tk_SendObjCmd(
* An error occurred, so transfer error information from the
* destination interpreter back to our interpreter. Must clear
* interp's result before calling Tcl_AddErrorInfo, since
- * Tcl_AddErrorInfo will store the interp's result in errorInfo
- * before appending riPtr's $errorInfo; we've already got
- * everything we need in riPtr's $errorInfo.
+ * Tcl_AddErrorInfo will store the interp's result in
+ * errorInfo before appending riPtr's $errorInfo; we've
+ * already got everything we need in riPtr's $errorInfo.
*/
Tcl_ResetResult(interp);
@@ -439,12 +430,12 @@ Tk_SendObjCmd(
}
Tcl_SetObjResult(interp, Tcl_GetObjResult(localInterp));
}
- Tcl_Release((ClientData) riPtr);
- Tcl_Release((ClientData) localInterp);
+ Tcl_Release(riPtr);
+ Tcl_Release(localInterp);
} else {
/*
- * TODO: This is a non-local request. Send the script to the server and
- * poll it for a result.
+ * TODO: This is a non-local request. Send the script to the server
+ * and poll it for a result.
*/
}
@@ -456,15 +447,14 @@ Tk_SendObjCmd(
*
* TkGetInterpNames --
*
- * This procedure is invoked to fetch a list of all the
- * interpreter names currently registered for the display
- * of a particular window.
+ * This procedure is invoked to fetch a list of all the interpreter names
+ * currently registered for the display of a particular window.
*
* Results:
- * A standard Tcl return value. Interp->result will be set
- * to hold a list of all the interpreter names defined for
- * tkwin's display. If an error occurs, then TCL_ERROR
- * is returned and interp->result will hold an error message.
+ * A standard Tcl return value. Interp->result will be set to hold a list
+ * of all the interpreter names defined for tkwin's display. If an error
+ * occurs, then TCL_ERROR is returned and interp->result will hold an
+ * error message.
*
* Side effects:
* None.
@@ -475,13 +465,13 @@ Tk_SendObjCmd(
int
TkGetInterpNames(
Tcl_Interp *interp, /* Interpreter for returning a result. */
- Tk_Window tkwin) /* Window whose display is to be used
- * for the lookup. */
+ Tk_Window tkwin) /* Window whose display is to be used for the
+ * lookup. */
{
Tcl_Obj *listObjPtr;
RegisteredInterp *riPtr;
- listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ listObjPtr = Tcl_NewListObj(0, NULL);
riPtr = interpListPtr;
while (riPtr != NULL) {
Tcl_ListObjAppendElement(interp, listObjPtr,
@@ -498,9 +488,8 @@ TkGetInterpNames(
*
* SendInit --
*
- * This procedure is called to initialize the
- * communication channels for sending commands and
- * receiving results.
+ * This procedure is called to initialize the communication channels for
+ * sending commands and receiving results.
*
* Results:
* None.
@@ -513,8 +502,8 @@ TkGetInterpNames(
static int
SendInit(
- Tcl_Interp *interp) /* Interpreter to use for error reporting
- * (no errors are ever returned, but the
+ Tcl_Interp *interp) /* Interpreter to use for error reporting (no
+ * errors are ever returned, but the
* interpreter is needed anyway). */
{
return TCL_OK;
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index d0435c5..836636d 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -5,12 +5,12 @@
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2008 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.18.2.8 2007/12/13 06:28:48 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.18.2.9 2008/06/25 16:46:09 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -30,6 +30,7 @@
static void MoveResizeWindow(MacDrawable *macWin);
static void GenerateConfigureNotify(TkWindow *winPtr, int includeWin);
static void UpdateOffsets(TkWindow *winPtr, int deltaX, int deltaY);
+static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr);
/*
@@ -252,6 +253,7 @@ XMapWindow(
* We only need to send the MapNotify event
* for toplevel windows.
*/
+
event.xany.serial = display->request;
event.xany.send_event = False;
event.xany.display = display;
@@ -269,6 +271,50 @@ XMapWindow(
TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr);
TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
}
+
+ /*
+ * Generate VisibilityNotify events for window and all mapped children.
+ */
+
+ event.xany.send_event = False;
+ event.xany.display = display;
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.state = VisibilityUnobscured;
+ NotifyVisibility(macWin->winPtr, &event);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NotifyVisibility --
+ *
+ * Recursively called helper proc for XMapWindow().
+
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * VisibilityNotify events are queued.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+NotifyVisibility(
+ TkWindow *winPtr,
+ XEvent *eventPtr)
+{
+ if (winPtr->atts.event_mask & VisibilityChangeMask) {
+ eventPtr->xany.serial = LastKnownRequestProcessed(winPtr->display);
+ eventPtr->xvisibility.window = winPtr->window;
+ Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL);
+ }
+ for (winPtr = winPtr->childList; winPtr != NULL;
+ winPtr = winPtr->nextPtr) {
+ if (winPtr->flags & TK_MAPPED) {
+ NotifyVisibility(winPtr, eventPtr);
+ }
+ }
}
/*
@@ -1397,3 +1443,12 @@ Tk_FreePixmap(
}
ckfree((char *) macPix);
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 79
+ * coding: utf-8
+ * End:
+ */
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index e8b1e88..3553f2d 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.22.2.8 2007/11/12 19:22:39 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.22.2.9 2008/06/25 16:46:09 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -418,7 +418,7 @@ TkMacOSXProcessWindowEvent(
break;
}
- return 0;
+ return eventFound;
}
/*
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index bb89bdc..c30102a 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -2,18 +2,18 @@
* tkMacOSXWm.c --
*
* This module takes care of the interactions between a Tk-based
- * application and the window manager. Among other things, it
- * implements the "wm" command and passes geometry information
- * to the window manager.
+ * application and the window manager. Among other things, it implements
+ * the "wm" command and passes geometry information to the window
+ * manager.
*
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
* Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXWm.c,v 1.49.2.12 2007/12/13 06:28:48 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.49.2.13 2008/06/25 16:46:09 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -52,25 +52,24 @@ static const char *WmAttributeNames[] = {
TkMacOSXWindowList *tkMacOSXWindowListPtr = NULL;
/*
- * The variable below is used to enable or disable tracing in this
- * module. If tracing is enabled, then information is printed on
- * standard output about interesting interactions with the window
- * manager.
+ * The variable below is used to enable or disable tracing in this module. If
+ * tracing is enabled, then information is printed on standard output about
+ * interesting interactions with the window manager.
*/
static int wmTracing = 0;
/*
- * The following structure is the official type record for geometry
- * management of top-level windows.
+ * The following structure is the official type record for geometry management
+ * of top-level windows.
*/
static void TopLevelReqProc(ClientData dummy, Tk_Window tkwin);
static const Tk_GeomMgr wmMgrType = {
- "wm", /* name */
- TopLevelReqProc, /* requestProc */
- (Tk_GeomLostSlaveProc *) NULL, /* lostSlaveProc */
+ "wm", /* name */
+ TopLevelReqProc, /* requestProc */
+ NULL, /* lostSlaveProc */
};
/*
@@ -174,16 +173,14 @@ static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr);
static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr);
static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr);
static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin);
-
/*
*----------------------------------------------------------------------
*
* TkWmNewWindow --
*
- * This procedure is invoked whenever a new top-level
- * window is created. Its job is to initialize the WmInfo
- * structure for the window.
+ * This procedure is invoked whenever a new top-level window is created.
+ * Its job is to initialize the WmInfo structure for the window.
*
* Results:
* None.
@@ -198,9 +195,8 @@ void
TkWmNewWindow(
TkWindow *winPtr) /* Newly-created top-level window. */
{
- WmInfo *wmPtr;
+ WmInfo *wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
- wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
wmPtr->titleUid = NULL;
@@ -233,9 +229,9 @@ TkWmNewWindow(
wmPtr->x = winPtr->changes.x;
wmPtr->y = winPtr->changes.y;
wmPtr->parentWidth = winPtr->changes.width
- + 2*winPtr->changes.border_width;
+ + 2*winPtr->changes.border_width;
wmPtr->parentHeight = winPtr->changes.height
- + 2*winPtr->changes.border_width;
+ + 2*winPtr->changes.border_width;
wmPtr->xInParent = 0;
wmPtr->yInParent = 0;
wmPtr->cmapList = NULL;
@@ -259,16 +255,16 @@ TkWmNewWindow(
UpdateVRootGeometry(wmPtr);
/*
- * Tk must monitor structure events for top-level windows, in order
- * to detect size and position changes caused by window managers.
+ * Tk must monitor structure events for top-level windows, in order to
+ * detect size and position changes caused by window managers.
*/
Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask,
- TopLevelEventProc, (ClientData) winPtr);
+ TopLevelEventProc, winPtr);
/*
- * Arrange for geometry requests to be reflected from the window
- * to the window manager.
+ * Arrange for geometry requests to be reflected from the window to the
+ * window manager.
*/
Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0);
@@ -279,28 +275,28 @@ TkWmNewWindow(
*
* TkWmMapWindow --
*
- * This procedure is invoked to map a top-level window. This
- * module gets a chance to update all window-manager-related
- * information in properties before the window manager sees
- * the map event and checks the properties. It also gets to
- * decide whether or not to even map the window after all.
+ * This procedure is invoked to map a top-level window. This module gets
+ * a chance to update all window-manager-related information in
+ * properties before the window manager sees the map event and checks the
+ * properties. It also gets to decide whether or not to even map the
+ * window after all.
*
* Results:
* None.
*
* Side effects:
- * Properties of winPtr may get updated to provide up-to-date
- * information to the window manager. The window may also get
- * mapped, but it may not be if this procedure decides that
- * isn't appropriate (e.g. because the window is withdrawn).
+ * Properties of winPtr may get updated to provide up-to-date information
+ * to the window manager. The window may also get mapped, but it may not
+ * be if this procedure decides that isn't appropriate (e.g. because the
+ * window is withdrawn).
*
*----------------------------------------------------------------------
*/
void
TkWmMapWindow(
- TkWindow *winPtr) /* Top-level window that's about to
- * be mapped. */
+ TkWindow *winPtr) /* Top-level window that's about to be
+ * mapped. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -310,6 +306,7 @@ TkWmMapWindow(
/*
* Create the underlying Mac window for this Tk window.
*/
+
if (!TkMacOSXHostToplevelExists(winPtr)) {
TkMacOSXMakeRealWindowExist(winPtr);
}
@@ -321,9 +318,8 @@ TkWmMapWindow(
TK_LOCATION_CHANGED);
/*
- * This is the first time this window has ever been mapped.
- * Store all the window-manager-related information for the
- * window.
+ * This is the first time this window has ever been mapped. Store all
+ * the window-manager-related information for the window.
*/
if (wmPtr->titleUid == NULL) {
@@ -357,11 +353,12 @@ TkWmMapWindow(
/*
* Update geometry information.
*/
+
wmPtr->flags |= WM_ABOUT_TO_MAP;
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tk_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
wmPtr->flags &= ~WM_ABOUT_TO_MAP;
/*
@@ -376,8 +373,8 @@ TkWmMapWindow(
*
* TkWmUnmapWindow --
*
- * This procedure is invoked to unmap a top-level window.
- * On the Macintosh all we do is call XUnmapWindow.
+ * This procedure is invoked to unmap a top-level window. On the
+ * Macintosh all we do is call XUnmapWindow.
*
* Results:
* None.
@@ -390,8 +387,8 @@ TkWmMapWindow(
void
TkWmUnmapWindow(
- TkWindow *winPtr) /* Top-level window that's about to
- * be mapped. */
+ TkWindow *winPtr) /* Top-level window that's about to be
+ * mapped. */
{
XUnmapWindow(winPtr->display, winPtr->window);
}
@@ -401,9 +398,8 @@ TkWmUnmapWindow(
*
* TkWmDeadWindow --
*
- * This procedure is invoked when a top-level window is
- * about to be deleted. It cleans up the wm-related data
- * structures for the window.
+ * This procedure is invoked when a top-level window is about to be
+ * deleted. It cleans up the wm-related data structures for the window.
*
* Results:
* None.
@@ -450,7 +446,7 @@ TkWmDeadWindow(
protPtr = wmPtr->protPtr;
wmPtr->protPtr = protPtr->nextPtr;
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
}
if (wmPtr->cmdArgv != NULL) {
ckfree((char *) wmPtr->cmdArgv);
@@ -459,7 +455,7 @@ TkWmDeadWindow(
ckfree((char *) wmPtr->clientMachine);
}
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tk_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
ckfree((char *) wmPtr);
winPtr->wmInfoPtr = NULL;
@@ -470,11 +466,10 @@ TkWmDeadWindow(
*
* TkWmSetClass --
*
- * This procedure is invoked whenever a top-level window's
- * class is changed. If the window has been mapped then this
- * procedure updates the window manager property for the
- * class. If the window hasn't been mapped, the update is
- * deferred until just before the first mapping.
+ * This procedure is invoked whenever a top-level window's class is
+ * changed. If the window has been mapped then this procedure updates the
+ * window manager property for the class. If the window hasn't been
+ * mapped, the update is deferred until just before the first mapping.
*
* Results:
* None.
@@ -497,8 +492,8 @@ TkWmSetClass(
*
* Tk_WmObjCmd --
*
- * This procedure is invoked to process the "wm" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm" Tcl command. See the
+ * user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -543,7 +538,7 @@ Tk_WmObjCmd(
TkWindow *winPtr;
if (objc < 2) {
-wrongNumArgs:
+ wrongNumArgs:
Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
return TCL_ERROR;
}
@@ -563,7 +558,7 @@ wrongNumArgs:
}
if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
- &index) != TCL_OK) {
+ &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -576,78 +571,77 @@ wrongNumArgs:
return TCL_ERROR;
}
if (!Tk_IsTopLevel(winPtr)
- && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)
- ) {
+ && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", NULL);
return TCL_ERROR;
}
switch ((enum options) index) {
- case WMOPT_ASPECT:
- return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ATTRIBUTES:
- return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_CLIENT:
- return WmClientCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_COLORMAPWINDOWS:
- return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_COMMAND:
- return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_DEICONIFY:
- return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_FOCUSMODEL:
- return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_FORGET:
- return WmForgetCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_FRAME:
- return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_GEOMETRY:
- return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_GRID:
- return WmGridCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_GROUP:
- return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONBITMAP:
- return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONIFY:
- return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONMASK:
- return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONNAME:
- return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONPHOTO:
- return WmIconphotoCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONPOSITION:
- return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_ICONWINDOW:
- return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_MANAGE:
- return WmManageCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_MAXSIZE:
- return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_MINSIZE:
- return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_OVERRIDEREDIRECT:
- return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_POSITIONFROM:
- return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_PROTOCOL:
- return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_RESIZABLE:
- return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_SIZEFROM:
- return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_STACKORDER:
- return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_STATE:
- return WmStateCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_TITLE:
- return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_TRANSIENT:
- return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
- case WMOPT_WITHDRAW:
- return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ASPECT:
+ return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ATTRIBUTES:
+ return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_CLIENT:
+ return WmClientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COLORMAPWINDOWS:
+ return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COMMAND:
+ return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_DEICONIFY:
+ return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FOCUSMODEL:
+ return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FORGET:
+ return WmForgetCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FRAME:
+ return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GEOMETRY:
+ return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GRID:
+ return WmGridCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GROUP:
+ return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONBITMAP:
+ return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONIFY:
+ return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONMASK:
+ return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONNAME:
+ return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPHOTO:
+ return WmIconphotoCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPOSITION:
+ return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONWINDOW:
+ return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MANAGE:
+ return WmManageCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MAXSIZE:
+ return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MINSIZE:
+ return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_OVERRIDEREDIRECT:
+ return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_POSITIONFROM:
+ return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_PROTOCOL:
+ return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_RESIZABLE:
+ return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_SIZEFROM:
+ return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STACKORDER:
+ return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STATE:
+ return WmStateCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TITLE:
+ return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TRANSIENT:
+ return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_WITHDRAW:
+ return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
}
/* This should not happen */
@@ -659,8 +653,8 @@ wrongNumArgs:
*
* WmAspectCmd --
*
- * This procedure is invoked to process the "wm aspect" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm aspect" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -702,15 +696,14 @@ WmAspectCmd(
wmPtr->sizeHintsFlags &= ~PAspect;
} else {
if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
+ || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
return TCL_ERROR;
}
if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
- (denom2 <= 0)) {
- Tcl_SetResult(interp, "aspect number can't be <= 0",
- TCL_STATIC);
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0", TCL_STATIC);
return TCL_ERROR;
}
wmPtr->minAspect.x = numer1;
@@ -729,17 +722,19 @@ WmAspectCmd(
*
* WmSetAttribute --
*
- * Helper routine for WmAttributesCmd. Sets the value
- * of the specified attribute.
+ * Helper routine for WmAttributesCmd. Sets the value of the specified
+ * attribute.
*
* Returns:
*
- * TCL_OK if successful, TCL_ERROR otherwise. In case of an
- * error, leaves a message in the interpreter's result.
+ * TCL_OK if successful, TCL_ERROR otherwise. In case of an error, leaves
+ * a message in the interpreter's result.
*
*----------------------------------------------------------------------
*/
-static int WmSetAttribute(
+
+static int
+WmSetAttribute(
TkWindow *winPtr, /* Toplevel to work with */
WindowRef macWindow,
Tcl_Interp *interp, /* Current interpreter */
@@ -750,152 +745,150 @@ static int WmSetAttribute(
int boolean;
switch (attribute) {
- case WMATT_ALPHA: {
- double dval;
+ case WMATT_ALPHA: {
+ double dval;
- if (Tcl_GetDoubleFromObj(interp, value, &dval) != TCL_OK) {
- return TCL_ERROR;
- }
- /*
- * The user should give (transparent) 0 .. 1.0 (opaque)
- */
- if (dval < 0.0) {
- dval = 0.0;
- } else if (dval > 1.0) {
- dval = 1.0;
- }
- ChkErr(SetWindowAlpha, macWindow, dval);
- break;
+ if (Tcl_GetDoubleFromObj(interp, value, &dval) != TCL_OK) {
+ return TCL_ERROR;
}
- case WMATT_FULLSCREEN:
- if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
- return TCL_ERROR;
- }
- if (boolean != ((wmPtr->flags & WM_FULLSCREEN) != 0)) {
- if(TkMacOSXMakeFullscreen(winPtr, macWindow, boolean, interp)
- != TCL_OK) {
- return TCL_ERROR;
- }
- }
- break;
- case WMATT_MODIFIED:
- if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
- return TCL_ERROR;
- }
- if (boolean != IsWindowModified(macWindow)) {
- ChkErr(SetWindowModified, macWindow, boolean);
- }
- break;
- case WMATT_NOTIFY:
- if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+
+ /*
+ * The user should give (transparent) 0 .. 1.0 (opaque)
+ */
+
+ if (dval < 0.0) {
+ dval = 0.0;
+ } else if (dval > 1.0) {
+ dval = 1.0;
+ }
+ ChkErr(SetWindowAlpha, macWindow, dval);
+ break;
+ }
+ case WMATT_FULLSCREEN:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_FULLSCREEN) != 0)) {
+ if (TkMacOSXMakeFullscreen(winPtr, macWindow, boolean, interp)
+ != TCL_OK) {
return TCL_ERROR;
}
- if (boolean == !tkMacOSXWmAttrNotifyVal) {
- static NMRec notifyRec;
-
- if (boolean) {
- bzero(&notifyRec, sizeof(notifyRec));
- notifyRec.qType = nmType;
- notifyRec.nmMark = 1;
- ChkErr(NMInstall, &notifyRec);
- } else {
- ChkErr(NMRemove, &notifyRec);
- }
- tkMacOSXWmAttrNotifyVal = boolean;
- }
- break;
- case WMATT_TITLEPATH: {
- const char *path;
- OSStatus err;
-
- path = Tcl_FSGetNativePath(value);
- if (path && *path) {
- FSRef ref;
- Boolean d;
-
- err = ChkErr(FSPathMakeRef, (const unsigned char*) path, &ref,
- &d);
- if (err == noErr) {
- TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
- err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref);
- ) TK_ELSE_MAC_OS_X (4,
- AliasHandle alias;
-
- err = ChkErr(FSNewAlias, NULL, &ref, &alias);
- if (err == noErr) {
- err = ChkErr(SetWindowProxyAlias, macWindow,
- alias);
- DisposeHandle((Handle) alias);
- }
- ) TK_ENDIF
- }
- } else {
- int len;
+ }
+ break;
+ case WMATT_MODIFIED:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != IsWindowModified(macWindow)) {
+ ChkErr(SetWindowModified, macWindow, boolean);
+ }
+ break;
+ case WMATT_NOTIFY:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean == !tkMacOSXWmAttrNotifyVal) {
+ static NMRec notifyRec;
- Tcl_GetStringFromObj(value, &len);
- if (!len) {
- err = ChkErr(RemoveWindowProxy, macWindow);
- } else {
- err = fnfErr;
- }
- }
- if (err != noErr) {
- return TCL_ERROR;
+ if (boolean) {
+ bzero(&notifyRec, sizeof(notifyRec));
+ notifyRec.qType = nmType;
+ notifyRec.nmMark = 1;
+ ChkErr(NMInstall, &notifyRec);
+ } else {
+ ChkErr(NMRemove, &notifyRec);
}
- break;
+ tkMacOSXWmAttrNotifyVal = boolean;
}
- case WMATT_TOPMOST: {
- if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
- return TCL_ERROR;
+ break;
+ case WMATT_TITLEPATH: {
+ const char *path = Tcl_FSGetNativePath(value);
+ OSStatus err;
+
+ if (path && *path) {
+ FSRef ref;
+ Boolean d;
+
+ err = ChkErr(FSPathMakeRef, (const unsigned char*)path, &ref, &d);
+ if (err == noErr) {
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
+ err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref);
+ ) TK_ELSE_MAC_OS_X (4,
+ AliasHandle alias;
+
+ err = ChkErr(FSNewAlias, NULL, &ref, &alias);
+ if (err == noErr) {
+ err = ChkErr(SetWindowProxyAlias, macWindow, alias);
+ DisposeHandle((Handle) alias);
+ }
+ ) TK_ENDIF
}
- if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) {
- WindowGroupRef group;
+ } else {
+ int len;
- if (boolean) {
- wmPtr->flags |= WM_TOPMOST;
- } else {
- wmPtr->flags &= ~WM_TOPMOST;
- }
- group = WmGetWindowGroup(winPtr);
- if (group && group != GetWindowGroup(macWindow)) {
- ChkErr(SetWindowGroup, macWindow, group);
- }
+ Tcl_GetStringFromObj(value, &len);
+ if (!len) {
+ err = ChkErr(RemoveWindowProxy, macWindow);
+ } else {
+ err = fnfErr;
}
- break;
}
- case WMATT_TRANSPARENT:
- if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
- return TCL_ERROR;
+ if (err != noErr) {
+ return TCL_ERROR;
+ }
+ break;
+ }
+ case WMATT_TOPMOST:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) {
+ WindowGroupRef group;
+
+ if (boolean) {
+ wmPtr->flags |= WM_TOPMOST;
+ } else {
+ wmPtr->flags &= ~WM_TOPMOST;
}
- if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
- WindowAttributes oldAttributes = wmPtr->attributes;
-
- if (boolean) {
- wmPtr->flags |= WM_TRANSPARENT;
- wmPtr->attributes |= kWindowNoShadowAttribute;
- TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures,
- UInt32 features;
-
- ChkErr(GetWindowFeatures, macWindow, &features);
- if (features & kWindowIsOpaque) {
- ChkErr(HIWindowChangeFeatures, macWindow, 0,
- kWindowIsOpaque);
- }
- ) TK_ENDIF
- } else {
- wmPtr->flags &= ~WM_TRANSPARENT;
- wmPtr->attributes &= ~kWindowNoShadowAttribute;
- }
- ApplyWindowClassAttributeChanges(winPtr, macWindow,
- wmPtr->macClass, oldAttributes, 1);
- ChkErr(ReshapeCustomWindow, macWindow);
- TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window),
- TK_PARENT_WINDOW);
+ group = WmGetWindowGroup(winPtr);
+ if (group && group != GetWindowGroup(macWindow)) {
+ ChkErr(SetWindowGroup, macWindow, group);
}
- break;
- case _WMATT_LAST_ATTRIBUTE:
- default:
+ }
+ break;
+ case WMATT_TRANSPARENT:
+ if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) {
return TCL_ERROR;
+ }
+ if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) {
+ WindowAttributes oldAttributes = wmPtr->attributes;
+
+ if (boolean) {
+ wmPtr->flags |= WM_TRANSPARENT;
+ wmPtr->attributes |= kWindowNoShadowAttribute;
+ TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures,
+ UInt32 features;
+
+ ChkErr(GetWindowFeatures, macWindow, &features);
+ if (features & kWindowIsOpaque) {
+ ChkErr(HIWindowChangeFeatures, macWindow, 0,
+ kWindowIsOpaque);
+ }
+ ) TK_ENDIF
+ } else {
+ wmPtr->flags &= ~WM_TRANSPARENT;
+ wmPtr->attributes &= ~kWindowNoShadowAttribute;
+ }
+ ApplyWindowClassAttributeChanges(winPtr, macWindow,
+ wmPtr->macClass, oldAttributes, 1);
+ ChkErr(ReshapeCustomWindow, macWindow);
+ TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
+ TK_PARENT_WINDOW);
+ }
+ break;
+ case _WMATT_LAST_ATTRIBUTE:
+ default:
+ return TCL_ERROR;
}
return TCL_OK;
}
@@ -905,12 +898,14 @@ static int WmSetAttribute(
*
* WmGetAttribute --
*
- * Helper routine for WmAttributesCmd. Returns the current value
- * of the specified attribute.
+ * Helper routine for WmAttributesCmd. Returns the current value of the
+ * specified attribute.
*
*----------------------------------------------------------------------
*/
-static Tcl_Obj *WmGetAttribute(
+
+static Tcl_Obj *
+WmGetAttribute(
TkWindow *winPtr, /* Toplevel to work with */
WindowRef macWindow,
WmAttribute attribute) /* Code of attribute to get */
@@ -919,57 +914,56 @@ static Tcl_Obj *WmGetAttribute(
Tcl_Obj *result = NULL;
switch (attribute) {
- case WMATT_ALPHA: {
- float fval = 1.0;
-
- ChkErr(GetWindowAlpha, macWindow, &fval);
- result = Tcl_NewDoubleObj(fval);
- break;
- }
- case WMATT_FULLSCREEN:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN);
- break;
- case WMATT_MODIFIED:
- result = Tcl_NewBooleanObj(IsWindowModified(macWindow));
- break;
- case WMATT_NOTIFY:
- result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal);
- break;
- case WMATT_TITLEPATH: {
- FSRef ref;
- UInt8 path[PATH_MAX+1];
- OSStatus err;
-
- TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
- err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref);
- ) TK_ELSE_MAC_OS_X (4,
- Boolean wasChanged;
- AliasHandle alias;
-
- err = ChkErr(GetWindowProxyAlias, macWindow, &alias);
- if (err == noErr) {
- err = ChkErr(FSResolveAlias, NULL, alias, &ref,
- &wasChanged);
- }
- ) TK_ENDIF
+ case WMATT_ALPHA: {
+ float fval = 1.0;
+
+ ChkErr(GetWindowAlpha, macWindow, &fval);
+ result = Tcl_NewDoubleObj(fval);
+ break;
+ }
+ case WMATT_FULLSCREEN:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN);
+ break;
+ case WMATT_MODIFIED:
+ result = Tcl_NewBooleanObj(IsWindowModified(macWindow));
+ break;
+ case WMATT_NOTIFY:
+ result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal);
+ break;
+ case WMATT_TITLEPATH: {
+ FSRef ref;
+ UInt8 path[PATH_MAX+1];
+ OSStatus err;
+
+ TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef,
+ err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref);
+ ) TK_ELSE_MAC_OS_X (4,
+ Boolean wasChanged;
+ AliasHandle alias;
+
+ err = ChkErr(GetWindowProxyAlias, macWindow, &alias);
if (err == noErr) {
- err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX);
+ err = ChkErr(FSResolveAlias, NULL, alias, &ref, &wasChanged);
}
- if (err != noErr) {
- *path = 0;
- }
- result = Tcl_NewStringObj((char*) path, -1);
- break;
+ ) TK_ENDIF
+ if (err == noErr) {
+ err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX);
}
- case WMATT_TOPMOST:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST);
- break;
- case WMATT_TRANSPARENT:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT);
- break;
- case _WMATT_LAST_ATTRIBUTE:
- default:
- break;
+ if (err != noErr) {
+ *path = 0;
+ }
+ result = Tcl_NewStringObj((char*) path, -1);
+ break;
+ }
+ case WMATT_TOPMOST:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST);
+ break;
+ case WMATT_TRANSPARENT:
+ result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT);
+ break;
+ case _WMATT_LAST_ATTRIBUTE:
+ default:
+ break;
}
return result;
}
@@ -1051,8 +1045,8 @@ WmAttributesCmd(
*
* WmClientCmd --
*
- * This procedure is invoked to process the "wm client" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm client" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1096,8 +1090,7 @@ WmClientCmd(
if (wmPtr->clientMachine != NULL) {
ckfree((char *) wmPtr->clientMachine);
}
- wmPtr->clientMachine = (char *)
- ckalloc((unsigned) (length + 1));
+ wmPtr->clientMachine = ckalloc((unsigned) length + 1);
strcpy(wmPtr->clientMachine, argv3);
return TCL_OK;
}
@@ -1107,9 +1100,8 @@ WmClientCmd(
*
* WmColormapwindowsCmd --
*
- * This procedure is invoked to process the "wm colormapwindows"
- * Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm colormapwindows" Tcl
+ * command. See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1154,11 +1146,10 @@ WmColormapwindowsCmd(
return TCL_ERROR;
}
cmapList = (TkWindow **) ckalloc((unsigned)
- ((windowObjc+1)*sizeof(TkWindow*)));
+ ((windowObjc+1) * sizeof(TkWindow*)));
for (i = 0; i < windowObjc; i++) {
if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
- (Tk_Window *) &winPtr2) != TCL_OK)
- {
+ (Tk_Window *) &winPtr2) != TCL_OK) {
ckfree((char *) cmapList);
return TCL_ERROR;
}
@@ -1185,9 +1176,8 @@ WmColormapwindowsCmd(
wmPtr->cmapCount = windowObjc;
/*
- * On the Macintosh all of this is just an excercise
- * in compatability as we don't support colormaps. If
- * we did they would be installed here.
+ * On the Macintosh all of this is just an excercise in compatability as
+ * we don't support colormaps. If we did they would be installed here.
*/
return TCL_OK;
@@ -1229,8 +1219,7 @@ WmCommandCmd(
}
if (objc == 3) {
if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
+ Tcl_SetResult(interp, Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
TCL_DYNAMIC);
}
return TCL_OK;
@@ -1280,6 +1269,7 @@ WmDeiconifyCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
@@ -1342,7 +1332,7 @@ WmFocusmodelCmd(
}
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
- &index) != TCL_OK) {
+ &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ACTIVE) {
@@ -1371,15 +1361,15 @@ WmFocusmodelCmd(
*/
static int
-WmForgetCmd(tkwin, winPtr, interp, objc, objv)
- Tk_Window tkwin; /* Main window of the application. */
- TkWindow *winPtr; /* Toplevel or Frame to work with */
- Tcl_Interp *interp; /* Current interpreter. */
- int objc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument objects. */
+WmForgetCmd(
+ Tk_Window tkwin, /* Main window of the application. */
+ TkWindow *winPtr, /* Toplevel or Frame to work with */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
#if 1
- Tcl_AppendResult(interp, "wm forget is not yet supported", (char*)NULL);
+ Tcl_AppendResult(interp, "wm forget is not yet supported", NULL);
return TCL_ERROR;
#else
register Tk_Window frameWin = (Tk_Window)winPtr;
@@ -1393,8 +1383,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv)
Tk_UnmapWindow(frameWin);
if (destPort != NULL) {
- WindowRef winRef;
- winRef = GetWindowFromPort(destPort);
+ WindowRef winRef = GetWindowFromPort(destPort);
+
TkMacOSXUnregisterMacWindow(winRef);
DisposeWindow(winRef);
}
@@ -1404,7 +1394,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv)
RemapWindows(winPtr, macWin);
TkWmDeadWindow(winPtr);
- winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+ winPtr->flags &=
+ ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
TkMapTopFrame(frameWin);
} else {
@@ -1419,8 +1410,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv)
*
* WmFrameCmd --
*
- * This procedure is invoked to process the "wm frame" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm frame" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1504,8 +1495,8 @@ WmGeometryCmd(
width = winPtr->changes.width;
height = winPtr->changes.height;
}
- sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
- ySign, wmPtr->y);
+ sprintf(buf, "%dx%d%c%d%c%d",
+ width, height, xSign, wmPtr->x, ySign, wmPtr->y);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_OK;
}
@@ -1524,8 +1515,8 @@ WmGeometryCmd(
*
* WmGridCmd --
*
- * This procedure is invoked to process the "wm grid" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm grid" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1565,8 +1556,8 @@ WmGridCmd(
}
if (*Tcl_GetString(objv[3]) == '\0') {
/*
- * Turn off gridding and reset the width and height
- * to make sense as ungridded numbers.
+ * Turn off gridding and reset the width and height to make sense as
+ * ungridded numbers.
*/
wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
@@ -1580,9 +1571,9 @@ WmGridCmd(
wmPtr->heightInc = 1;
} else {
if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) {
+ || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &heightInc)!=TCL_OK)) {
return TCL_ERROR;
}
if (reqWidth < 0) {
@@ -1614,8 +1605,8 @@ WmGridCmd(
*
* WmGroupCmd --
*
- * This procedure is invoked to process the "wm group" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm group" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -1829,8 +1820,7 @@ WmIconmaskCmd(
}
if (objc == 3) {
if (wmPtr->hints.flags & IconMaskHint) {
- Tcl_SetResult(interp,
- (char*)Tk_NameOfBitmap(winPtr->display,
+ Tcl_SetResult(interp, (char *) Tk_NameOfBitmap(winPtr->display,
wmPtr->hints.icon_mask), TCL_STATIC);
}
return TCL_OK;
@@ -1886,8 +1876,7 @@ WmIconnameCmd(
return TCL_ERROR;
}
if (objc == 3) {
- Tcl_SetResult(interp,
- (char*)((wmPtr->iconName != NULL) ?
+ Tcl_SetResult(interp, (char *) ((wmPtr->iconName != NULL) ?
wmPtr->iconName : ""), TCL_STATIC);
return TCL_OK;
} else {
@@ -1895,7 +1884,7 @@ WmIconnameCmd(
ckfree((char *) wmPtr->iconName);
}
argv3 = Tcl_GetStringFromObj(objv[3], &length);
- wmPtr->iconName = ckalloc((unsigned) (length + 1));
+ wmPtr->iconName = ckalloc((unsigned) length + 1);
strcpy(wmPtr->iconName, argv3);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
@@ -1909,10 +1898,9 @@ WmIconnameCmd(
*
* WmIconphotoCmd --
*
- * This procedure is invoked to process the "wm iconphoto"
- * Tcl command.
- * See the user documentation for details on what it does.
- * Not yet implemented for OS X.
+ * This procedure is invoked to process the "wm iconphoto" Tcl command.
+ * See the user documentation for details on what it does. Not yet
+ * implemented for OS X.
*
* Results:
* A standard Tcl result.
@@ -1947,10 +1935,12 @@ WmIconphotoCmd(
return TCL_ERROR;
}
}
+
/*
* Iterate over all images to retrieve their sizes, in order to allocate a
* buffer large enough to hold all images.
*/
+
for (i = 3 + isDefault; i < objc; i++) {
photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i]));
if (photo == NULL) {
@@ -1960,10 +1950,12 @@ WmIconphotoCmd(
}
Tk_PhotoGetSize(photo, &width, &height);
}
+
/*
- * This requires implementation for OS X, but we silently return
- * for now.
+ * TODO: This requires implementation for OS X, but we silently return for
+ * now.
*/
+
return TCL_OK;
}
@@ -1972,9 +1964,8 @@ WmIconphotoCmd(
*
* WmIconpositionCmd --
*
- * This procedure is invoked to process the "wm iconposition"
- * Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm iconposition" Tcl
+ * command. See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2112,8 +2103,8 @@ WmIconwindowCmd(
*
* WmManageCmd --
*
- * This procedure is invoked to process the "wm manage" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm manage" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2133,7 +2124,7 @@ WmManageCmd(
Tcl_Obj *CONST objv[]) /* Argument objects. */
{
#if 1
- Tcl_AppendResult(interp, "wm manage is not yet supported", (char*)NULL);
+ Tcl_AppendResult(interp, "wm manage is not yet supported", NULL);
return TCL_ERROR;
#else
register Tk_Window frameWin = (Tk_Window)winPtr;
@@ -2159,8 +2150,9 @@ WmManageCmd(
macWin->grafPtr = NULL;
macWin->toplevel = macWin;
RemapWindows(winPtr, macWin);
- winPtr->flags |= (TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
- TkMapTopFrame (frameWin);
+ winPtr->flags |=
+ (TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
+ TkMapTopFrame(frameWin);
} else if (Tk_IsTopLevel(frameWin)) {
/* Already managed by wm - ignore it */
}
@@ -2260,7 +2252,7 @@ WmMinsizeCmd(
return TCL_OK;
}
if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
- || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
return TCL_ERROR;
}
wmPtr->minWidth = width;
@@ -2275,9 +2267,8 @@ WmMinsizeCmd(
*
* WmOverrideredirectCmd --
*
- * This procedure is invoked to process the "wm overrideredirect"
- * Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm overrideredirect" Tcl
+ * command. See the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2366,7 +2357,7 @@ WmPositionfromCmd(
wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
} else {
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
- &index) != TCL_OK) {
+ &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -2421,6 +2412,7 @@ WmProtocolCmd(
/*
* Return a list of all defined protocols for the window.
*/
+
for (protPtr = wmPtr->protPtr; protPtr != NULL;
protPtr = protPtr->nextPtr) {
Tcl_AppendElement(interp,
@@ -2445,9 +2437,8 @@ WmProtocolCmd(
}
/*
- * Delete any current protocol handler, then create a new
- * one with the specified command, unless the command is
- * empty.
+ * Delete any current protocol handler, then create a new one with the
+ * specified command, unless the command is empty.
*/
for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
@@ -2458,7 +2449,7 @@ WmProtocolCmd(
} else {
prevPtr->nextPtr = protPtr->nextPtr;
}
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ Tcl_EventuallyFree(protPtr, TCL_DYNAMIC);
break;
}
}
@@ -2546,7 +2537,7 @@ WmResizableCmd(
}
WmUpdateGeom(wmPtr, winPtr);
ApplyWindowClassAttributeChanges(winPtr, NULL, wmPtr->macClass,
- oldAttributes, 1);
+ oldAttributes, 1);
return TCL_OK;
}
@@ -2599,7 +2590,7 @@ WmSizefromCmd(
wmPtr->sizeHintsFlags &= ~(USSize|PSize);
} else {
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
- &index) != TCL_OK) {
+ &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -2656,13 +2647,13 @@ WmStackorderCmd(
windows = TkWmStackorderToplevel(winPtr);
if (windows == NULL) {
Tcl_Panic("TkWmStackorderToplevel failed");
- } else {
- for (window_ptr = windows; *window_ptr ; window_ptr++) {
- Tcl_AppendElement(interp, (*window_ptr)->pathName);
- }
- ckfree((char *) windows);
- return TCL_OK;
}
+
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree((char *) windows);
+ return TCL_OK;
} else {
TkWindow *winPtr2;
int index1=-1, index2=-1, result;
@@ -2691,9 +2682,8 @@ WmStackorderCmd(
}
/*
- * Lookup stacking order of all toplevels that are children
- * of "." and find the position of winPtr and winPtr2
- * in the stacking order.
+ * Lookup stacking order of all toplevels that are children of "." and
+ * find the position of winPtr and winPtr2 in the stacking order.
*/
windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
@@ -2703,21 +2693,25 @@ WmStackorderCmd(
return TCL_ERROR;
} else {
for (window_ptr = windows; *window_ptr ; window_ptr++) {
- if (*window_ptr == winPtr)
+ if (*window_ptr == winPtr) {
index1 = (window_ptr - windows);
- if (*window_ptr == winPtr2)
+ }
+ if (*window_ptr == winPtr2) {
index2 = (window_ptr - windows);
+ }
}
- if (index1 == -1)
+ if (index1 == -1) {
Tcl_Panic("winPtr window not found");
- if (index2 == -1)
+ }
+ if (index2 == -1) {
Tcl_Panic("winPtr2 window not found");
+ }
ckfree((char *) windows);
}
if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
- &index) != TCL_OK) {
+ &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ISABOVE) {
@@ -2736,8 +2730,8 @@ WmStackorderCmd(
*
* WmStateCmd --
*
- * This procedure is invoked to process the "wm state" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm state" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -2818,18 +2812,18 @@ WmStateCmd(
ZoomState : NormalState);
}
switch (wmPtr->hints.initial_state) {
- case NormalState:
- Tcl_SetResult(interp, "normal", TCL_STATIC);
- break;
- case IconicState:
- Tcl_SetResult(interp, "iconic", TCL_STATIC);
- break;
- case WithdrawnState:
- Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
- break;
- case ZoomState:
- Tcl_SetResult(interp, "zoomed", TCL_STATIC);
- break;
+ case NormalState:
+ Tcl_SetResult(interp, "normal", TCL_STATIC);
+ break;
+ case IconicState:
+ Tcl_SetResult(interp, "iconic", TCL_STATIC);
+ break;
+ case WithdrawnState:
+ Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
+ break;
+ case ZoomState:
+ Tcl_SetResult(interp, "zoomed", TCL_STATIC);
+ break;
}
}
}
@@ -2841,8 +2835,8 @@ WmStateCmd(
*
* WmTitleCmd --
*
- * This procedure is invoked to process the "wm title" Tcl command.
- * See the user documentation for details on what it does.
+ * This procedure is invoked to process the "wm title" Tcl command. See
+ * the user documentation for details on what it does.
*
* Results:
* A standard Tcl result.
@@ -3017,7 +3011,7 @@ WmInfo *wmPtr;
TkWindow *winPtr;
{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3028,33 +3022,33 @@ TkWindow *winPtr;
* Tk_SetGrid --
*
* This procedure is invoked by a widget when it wishes to set a grid
- * coordinate system that controls the size of a top-level window.
- * It provides a C interface equivalent to the "wm grid" command and
- * is usually asscoiated with the -setgrid option.
+ * coordinate system that controls the size of a top-level window. It
+ * provides a C interface equivalent to the "wm grid" command and is
+ * usually asscoiated with the -setgrid option.
*
* Results:
* None.
*
* Side effects:
- * Grid-related information will be passed to the window manager, so
- * that the top-level window associated with tkwin will resize on
- * even grid units. If some other window already controls gridding
- * for the top-level window then this procedure call has no effect.
+ * Grid-related information will be passed to the window manager, so that
+ * the top-level window associated with tkwin will resize on even grid
+ * units. If some other window already controls gridding for the
+ * top-level window then this procedure call has no effect.
*
*----------------------------------------------------------------------
*/
void
Tk_SetGrid(
- Tk_Window tkwin, /* Token for window. New window mgr info
- * will be posted for the top-level window
+ Tk_Window tkwin, /* Token for window. New window mgr info will
+ * be posted for the top-level window
* associated with this window. */
- int reqWidth, /* Width (in grid units) corresponding to
- * the requested geometry for tkwin. */
- int reqHeight, /* Height (in grid units) corresponding to
- * the requested geometry for tkwin. */
- int widthInc, int heightInc)/* Pixel increments corresponding to a
- * change of one grid unit. */
+ int reqWidth, /* Width (in grid units) corresponding to the
+ * requested geometry for tkwin. */
+ int reqHeight, /* Height (in grid units) corresponding to the
+ * requested geometry for tkwin. */
+ int widthInc, int heightInc)/* Pixel increments corresponding to a change
+ * of one grid unit. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
WmInfo *wmPtr;
@@ -3094,15 +3088,15 @@ Tk_SetGrid(
}
/*
- * If gridding was previously off, then forget about any window
- * size requests made by the user or via "wm geometry": these are
- * in pixel units and there's no easy way to translate them to
- * grid units since the new requested size of the top-level window in
- * pixels may not yet have been registered yet (it may filter up
- * the hierarchy in DoWhenIdle handlers). However, if the window
- * has never been mapped yet then just leave the window size alone:
- * assume that it is intended to be in grid units but just happened
- * to have been specified before this procedure was called.
+ * If gridding was previously off, then forget about any window size
+ * requests made by the user or via "wm geometry": these are in pixel
+ * units and there's no easy way to translate them to grid units since the
+ * new requested size of the top-level window in pixels may not yet have
+ * been registered yet (it may filter up the hierarchy in DoWhenIdle
+ * handlers). However, if the window has never been mapped yet then just
+ * leave the window size alone: assume that it is intended to be in grid
+ * units but just happened to have been specified before this procedure
+ * was called.
*/
if ((wmPtr->gridWin == NULL) && !(wmPtr->flags & WM_NEVER_MAPPED)) {
@@ -3111,8 +3105,8 @@ Tk_SetGrid(
}
/*
- * Set the new gridding information, and start the process of passing
- * all of this information to the window manager.
+ * Set the new gridding information, and start the process of passing all
+ * of this information to the window manager.
*/
wmPtr->gridWin = tkwin;
@@ -3123,7 +3117,7 @@ Tk_SetGrid(
wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc;
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3133,16 +3127,15 @@ Tk_SetGrid(
*
* Tk_UnsetGrid --
*
- * This procedure cancels the effect of a previous call
- * to Tk_SetGrid.
+ * This procedure cancels the effect of a previous call to Tk_SetGrid.
*
* Results:
* None.
*
* Side effects:
* If tkwin currently controls gridding for its top-level window,
- * gridding is cancelled for that top-level window; if some other
- * window controls gridding then this procedure has no effect.
+ * gridding is cancelled for that top-level window; if some other window
+ * controls gridding then this procedure has no effect.
*
*----------------------------------------------------------------------
*/
@@ -3181,7 +3174,7 @@ Tk_UnsetGrid(
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3198,8 +3191,8 @@ Tk_UnsetGrid(
* None.
*
* Side effects:
- * Tk's internal data structures for the window get modified to
- * reflect the structural change.
+ * Tk's internal data structures for the window get modified to reflect
+ * the structural change.
*
*----------------------------------------------------------------------
*/
@@ -3209,7 +3202,7 @@ TopLevelEventProc(
ClientData clientData, /* Window for which event occurred. */
XEvent *eventPtr) /* Event that just happened. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
winPtr->wmInfoPtr->flags |= WM_VROOT_OFFSET_STALE;
if (eventPtr->type == DestroyNotify) {
@@ -3223,7 +3216,7 @@ TopLevelEventProc(
*/
Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display,
- -1, -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ -1, -1, -1, NULL, NULL);
Tk_DestroyWindow((Tk_Window) winPtr);
Tk_DeleteErrorHandler(handler);
}
@@ -3240,15 +3233,15 @@ TopLevelEventProc(
*
* TopLevelReqProc --
*
- * This procedure is invoked by the geometry manager whenever
- * the requested size for a top-level window is changed.
+ * This procedure is invoked by the geometry manager whenever the
+ * requested size for a top-level window is changed.
*
* Results:
* None.
*
* Side effects:
- * Arrange for the window to be resized to satisfy the request
- * (this happens as a when-idle action).
+ * Arrange for the window to be resized to satisfy the request (this
+ * happens as a when-idle action).
*
*----------------------------------------------------------------------
*/
@@ -3265,7 +3258,7 @@ TopLevelReqProc(
wmPtr = winPtr->wmInfoPtr;
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
}
@@ -3275,19 +3268,18 @@ TopLevelReqProc(
*
* UpdateGeometryInfo --
*
- * This procedure is invoked when a top-level window is first
- * mapped, and also as a when-idle procedure, to bring the
- * geometry and/or position of a top-level window back into
- * line with what has been requested by the user and/or widgets.
- * This procedure doesn't return until the window manager has
- * responded to the geometry change.
+ * This procedure is invoked when a top-level window is first mapped, and
+ * also as a when-idle procedure, to bring the geometry and/or position
+ * of a top-level window back into line with what has been requested by
+ * the user and/or widgets. This procedure doesn't return until the
+ * window manager has responded to the geometry change.
*
* Results:
* None.
*
* Side effects:
- * The window's size and location may change, unless the WM prevents
- * that from happening.
+ * The window's size and location may change, unless the WM prevents that
+ * from happening.
*
*----------------------------------------------------------------------
*/
@@ -3296,7 +3288,7 @@ static void
UpdateGeometryInfo(
ClientData clientData) /* Pointer to the window's record. */
{
- TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *winPtr = clientData;
WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, min, max;
unsigned long serial;
@@ -3308,14 +3300,12 @@ UpdateGeometryInfo(
}
/*
- * Compute the new size for the top-level window. See the
- * user documentation for details on this, but the size
- * requested depends on (a) the size requested internally
- * by the window's widgets, (b) the size requested by the
- * user in a "wm geometry" command or via wm-based interactive
- * resizing (if any), and (c) whether or not the window is
- * gridded. Don't permit sizes <= 0 because this upsets
- * the X server.
+ * Compute the new size for the top-level window. See the user
+ * documentation for details on this, but the size requested depends on
+ * (a) the size requested internally by the window's widgets, (b) the size
+ * requested by the user in a "wm geometry" command or via wm-based
+ * interactive resizing (if any), and (c) whether or not the window is
+ * gridded. Don't permit sizes <= 0 because this upsets the X server.
*/
if (wmPtr->width == -1) {
@@ -3390,10 +3380,10 @@ UpdateGeometryInfo(
/*
* Compute the new position for the upper-left pixel of the window's
- * decorative frame. This is tricky, because we need to include the
- * border widths supplied by a reparented parent in this calculation,
- * but can't use the parent's current overall size since that may
- * change as a result of this code.
+ * decorative frame. This is tricky, because we need to include the border
+ * widths supplied by a reparented parent in this calculation, but can't
+ * use the parent's current overall size since that may change as a result
+ * of this code.
*/
if (wmPtr->flags & WM_NEGATIVE_X) {
@@ -3410,10 +3400,10 @@ UpdateGeometryInfo(
}
/*
- * If the window's size is going to change and the window is
- * supposed to not be resizable by the user, then we have to
- * update the size hints. There may also be a size-hint-update
- * request pending from somewhere else, too.
+ * If the window's size is going to change and the window is supposed to
+ * not be resizable by the user, then we have to update the size hints.
+ * There may also be a size-hint-update request pending from somewhere
+ * else, too.
*/
if (((width != winPtr->changes.width)
@@ -3427,22 +3417,21 @@ UpdateGeometryInfo(
}
/*
- * Reconfigure the window if it isn't already configured correctly.
- * A few tricky points:
+ * Reconfigure the window if it isn't already configured correctly. A few
+ * tricky points:
*
- * 1. If the window is embedded and the container is also in this
- * process, don't actually reconfigure the window; just pass the
- * desired size on to the container. Also, zero out any position
- * information, since embedded windows are not allowed to move.
- * 2. Sometimes the window manager will give us a different size
- * than we asked for (e.g. mwm has a minimum size for windows), so
- * base the size check on what we *asked for* last time, not what we
- * got.
- * 3. Don't move window unless a new position has been requested for
- * it. This is because of "features" in some window managers (e.g.
- * twm, as of 4/24/91) where they don't interpret coordinates
- * according to ICCCM. Moving a window to its current location may
- * cause it to shift position on the screen.
+ * 1. If the window is embedded and the container is also in this process,
+ * don't actually reconfigure the window; just pass the desired size on
+ * to the container. Also, zero out any position information, since
+ * embedded windows are not allowed to move.
+ * 2. Sometimes the window manager will give us a different size than we
+ * asked for (e.g. mwm has a minimum size for windows), so base the
+ * size check on what we *asked for* last time, not what we got.
+ * 3. Don't move window unless a new position has been requested for it.
+ * This is because of "features" in some window managers (e.g. twm, as
+ * of 4/24/91) where they don't interpret coordinates according to
+ * ICCCM. Moving a window to its current location may cause it to shift
+ * position on the screen.
*/
if (Tk_IsEmbedded(winPtr)) {
@@ -3456,9 +3445,9 @@ UpdateGeometryInfo(
/*
* This window is embedded and the container is also in this
* process, so we don't need to do anything special about the
- * geometry, except to make sure that the desired size is known
- * by the container. Also, zero out any position information,
- * since embedded windows are not allowed to move.
+ * geometry, except to make sure that the desired size is known by
+ * the container. Also, zero out any position information, since
+ * embedded windows are not allowed to move.
*/
wmPtr->x = wmPtr->y = 0;
@@ -3498,9 +3487,8 @@ UpdateGeometryInfo(
*
* UpdateSizeHints --
*
- * This procedure is called to update the window manager's
- * size hints information from the information in a WmInfo
- * structure.
+ * This procedure is called to update the window manager's size hints
+ * information from the information in a WmInfo structure.
*
* Results:
* None.
@@ -3518,8 +3506,6 @@ UpdateSizeHints(
WmInfo *wmPtr = winPtr->wmInfoPtr;
wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS;
-
- return;
}
/*
@@ -3527,13 +3513,12 @@ UpdateSizeHints(
*
* ParseGeometry --
*
- * This procedure parses a geometry string and updates
- * information used to control the geometry of a top-level
- * window.
+ * This procedure parses a geometry string and updates information used
+ * to control the geometry of a top-level window.
*
* Results:
- * A standard Tcl return value, plus an error message in
- * the interp's result if an error occurs.
+ * A standard Tcl return value, plus an error message in the interp's
+ * result if an error occurs.
*
* Side effects:
* The size and/or location of winPtr may change.
@@ -3546,8 +3531,8 @@ ParseGeometry(
Tcl_Interp *interp, /* Used for error reporting. */
char *string, /* String containing new geometry. Has the
* standard form "=wxh+x+y". */
- TkWindow *winPtr) /* Pointer to top-level window whose
- * geometry is to be changed. */
+ TkWindow *winPtr) /* Pointer to top-level window whose geometry
+ * is to be changed. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int x, y, width, height, flags;
@@ -3563,9 +3548,9 @@ ParseGeometry(
}
/*
- * Parse the width and height, if they are present. Don't
- * actually update any of the fields of wmPtr until we've
- * successfully parsed the entire geometry string.
+ * Parse the width and height, if they are present. Don't actually update
+ * any of the fields of wmPtr until we've successfully parsed the entire
+ * geometry string.
*/
width = wmPtr->width;
@@ -3619,10 +3604,10 @@ ParseGeometry(
}
/*
- * Assume that the geometry information came from the user,
- * unless an explicit source has been specified. Otherwise
- * most window managers assume that the size hints were
- * program-specified and they ignore them.
+ * Assume that the geometry information came from the user, unless an
+ * explicit source has been specified. Otherwise most window managers
+ * assume that the size hints were program-specified and they ignore
+ * them.
*/
if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) {
@@ -3632,9 +3617,9 @@ ParseGeometry(
}
/*
- * Everything was parsed OK. Update the fields of *wmPtr and
- * arrange for the appropriate information to be percolated out
- * to the window manager at the next idle moment.
+ * Everything was parsed OK. Update the fields of *wmPtr and arrange for
+ * the appropriate information to be percolated out to the window manager
+ * at the next idle moment.
*/
wmPtr->width = width;
@@ -3654,12 +3639,12 @@ ParseGeometry(
wmPtr->flags = flags;
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
- Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
return TCL_OK;
-error:
+ error:
Tcl_AppendResult(interp, "bad geometry specifier \"", string, "\"", NULL);
return TCL_ERROR;
}
@@ -3669,15 +3654,15 @@ error:
*
* Tk_GetRootCoords --
*
- * Given a token for a window, this procedure traces through the
- * window's lineage to find the (virtual) root-window coordinates
- * corresponding to point (0,0) in the window.
+ * Given a token for a window, this procedure traces through the window's
+ * lineage to find the (virtual) root-window coordinates corresponding to
+ * point (0,0) in the window.
*
* Results:
- * The locations pointed to by xPtr and yPtr are filled in with
- * the root coordinates of the (0,0) point in tkwin. If a virtual
- * root window is in effect for the window, then the coordinates
- * in the virtual root are returned.
+ * The locations pointed to by xPtr and yPtr are filled in with the root
+ * coordinates of the (0,0) point in tkwin. If a virtual root window is
+ * in effect for the window, then the coordinates in the virtual root are
+ * returned.
*
* Side effects:
* None.
@@ -3695,9 +3680,8 @@ Tk_GetRootCoords(
TkWindow *winPtr = (TkWindow *) tkwin;
/*
- * Search back through this window's parents all the way to a
- * top-level window, combining the offsets of each window within
- * its parent.
+ * Search back through this window's parents all the way to a top-level
+ * window, combining the offsets of each window within its parent.
*/
x = y = 0;
@@ -3714,15 +3698,16 @@ Tk_GetRootCoords(
if (otherPtr != NULL) {
/*
- * The container window is in the same application.
- * Query its coordinates.
+ * The container window is in the same application. Query
+ * its coordinates.
*/
+
winPtr = otherPtr;
/*
- * Remember to offset by the container window here,
- * since at the end of this if branch, we will
- * pop out to the container's parent...
+ * Remember to offset by the container window here, since
+ * at the end of this if branch, we will pop out to the
+ * container's parent...
*/
x += winPtr->changes.x + winPtr->changes.border_width;
@@ -3733,12 +3718,12 @@ Tk_GetRootCoords(
if (tkMacOSXEmbedHandler->getOffsetProc != NULL) {
/*
- * We do not require that the changes.x & changes.y for
- * a non-Tk master window be kept up to date. So we
- * first subtract off the possibly bogus values that
- * have been added on at the top of this pass through
- * the loop, and then call out to the getOffsetProc to
- * give us the correct offset.
+ * We do not require that the changes.x & changes.y
+ * for a non-Tk master window be kept up to date. So
+ * we first subtract off the possibly bogus values
+ * that have been added on at the top of this pass
+ * through the loop, and then call out to the
+ * getOffsetProc to give us the correct offset.
*/
x -= winPtr->changes.x + winPtr->changes.border_width;
@@ -3765,14 +3750,14 @@ Tk_GetRootCoords(
*
* Tk_CoordsToWindow --
*
- * This is a Macintosh specific implementation of this function.
- * Given the root coordinates of a point, this procedure returns
- * the token for the top-most window covering that point, if
- * there exists such a window in this application.
+ * This is a Macintosh specific implementation of this function. Given
+ * the root coordinates of a point, this procedure returns the token for
+ * the top-most window covering that point, if there exists such a window
+ * in this application.
*
* Results:
- * The return result is either a token for the window corresponding
- * to rootX and rootY, or else NULL to indicate that there is no such
+ * The return result is either a token for the window corresponding to
+ * rootX and rootY, or else NULL to indicate that there is no such
* window.
*
* Side effects:
@@ -3783,19 +3768,19 @@ Tk_GetRootCoords(
Tk_Window
Tk_CoordsToWindow(
- int rootX, int rootY, /* Coordinates of point in root window. If
- * a virtual-root window manager is in use,
+ int rootX, int rootY, /* Coordinates of point in root window. If a
+ * virtual-root window manager is in use,
* these coordinates refer to the virtual
* root, not the real root. */
- Tk_Window tkwin) /* Token for any window in application;
- * used to identify the display. */
+ Tk_Window tkwin) /* Token for any window in application; used
+ * to identify the display. */
{
WindowPtr whichWin;
Point where;
Window rootChild;
TkWindow *winPtr, *childPtr;
- TkWindow *nextPtr; /* Coordinates of highest child found so
- * far that contains point. */
+ TkWindow *nextPtr; /* Coordinates of highest child found so far
+ * that contains point. */
int x, y; /* Coordinates in winPtr. */
int tmpx, tmpy, bd;
TkDisplay *dispPtr;
@@ -3818,10 +3803,10 @@ Tk_CoordsToWindow(
}
/*
- * Step 2: work down through the hierarchy underneath this window.
- * At each level, scan through all the children to find the highest
- * one in the stacking order that contains the point. Then repeat
- * the whole process on that child.
+ * Step 2: work down through the hierarchy underneath this window. At each
+ * level, scan through all the children to find the highest one in the
+ * stacking order that contains the point. Then repeat the whole process
+ * on that child.
*/
x = rootX - winPtr->wmInfoPtr->xInParent;
@@ -3888,13 +3873,12 @@ Tk_CoordsToWindow(
* Given a Tk Window, and coordinates of a point relative to that window
* this procedure returns the top-most child of the window (excluding
* toplevels) covering that point, if there exists such a window in this
- * application.
- * It also sets newX, and newY to the coords of the point relative to the
- * window returned.
+ * application. It also sets newX, and newY to the coords of the point
+ * relative to the window returned.
*
* Results:
- * The return result is either a token for the window corresponding
- * to rootX and rootY, or else NULL to indicate that there is no such
+ * The return result is either a token for the window corresponding to
+ * rootX and rootY, or else NULL to indicate that there is no such
* window. newX and newY are also set to the coords of the point relative
* to the returned window.
*
@@ -3906,15 +3890,15 @@ Tk_CoordsToWindow(
Tk_Window
Tk_TopCoordsToWindow(
- Tk_Window tkwin, /* Token for a Tk Window which defines the;
+ Tk_Window tkwin, /* Token for a Tk Window which defines the
* coordinates for rootX & rootY */
int rootX, int rootY, /* Coordinates of a point in tkWin. */
int *newX, int *newY) /* Coordinates of point in the upperMost child
* of tkWin containing (rootX,rootY) */
{
TkWindow *winPtr, *childPtr;
- TkWindow *nextPtr; /* Coordinates of highest child found so
- * far that contains point. */
+ TkWindow *nextPtr; /* Coordinates of highest child found so far
+ * that contains point. */
int x, y; /* Coordinates in winPtr. */
Window *children; /* Children of winPtr, or NULL. */
@@ -3979,24 +3963,23 @@ Tk_TopCoordsToWindow(
*
* UpdateVRootGeometry --
*
- * This procedure is called to update all the virtual root
- * geometry information in wmPtr.
+ * This procedure is called to update all the virtual root geometry
+ * information in wmPtr.
*
* Results:
* None.
*
* Side effects:
- * The vRootX, vRootY, vRootWidth, and vRootHeight fields in
- * wmPtr are filled with the most up-to-date information.
+ * The vRootX, vRootY, vRootWidth, and vRootHeight fields in wmPtr are
+ * filled with the most up-to-date information.
*
*----------------------------------------------------------------------
*/
static void
UpdateVRootGeometry(
- WmInfo *wmPtr) /* Window manager information to be
- * updated. The wmPtr->vRoot field must
- * be valid. */
+ WmInfo *wmPtr) /* Window manager information to be updated.
+ * The wmPtr->vRoot field must be valid. */
{
TkWindow *winPtr = wmPtr->winPtr;
unsigned int bd, dummy;
@@ -4022,8 +4005,7 @@ UpdateVRootGeometry(
* Refresh the virtual root information if it's out of date.
*/
- handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, NULL, NULL);
status = XGetGeometry(winPtr->display, wmPtr->vRoot,
&dummy2, &wmPtr->vRootX, &wmPtr->vRootY,
&wmPtr->vRootWidth, &wmPtr->vRootHeight, &bd, &dummy);
@@ -4035,7 +4017,7 @@ UpdateVRootGeometry(
Tk_DeleteErrorHandler(handler);
if (status == 0) {
/*
- * The virtual root is gone! Pretend that it never existed.
+ * The virtual root is gone! Pretend that it never existed.
*/
wmPtr->vRoot = None;
@@ -4048,16 +4030,15 @@ UpdateVRootGeometry(
*
* Tk_GetVRootGeometry --
*
- * This procedure returns information about the virtual root
- * window corresponding to a particular Tk window.
+ * This procedure returns information about the virtual root window
+ * corresponding to a particular Tk window.
*
* Results:
- * The values at xPtr, yPtr, widthPtr, and heightPtr are set
- * with the offset and dimensions of the root window corresponding
- * to tkwin. If tkwin is being managed by a virtual root window
- * manager these values correspond to the virtual root window being
- * used for tkwin; otherwise the offsets will be 0 and the
- * dimensions will be those of the screen.
+ * The values at xPtr, yPtr, widthPtr, and heightPtr are set with the
+ * offset and dimensions of the root window corresponding to tkwin. If
+ * tkwin is being managed by a virtual root window manager these values
+ * correspond to the virtual root window being used for tkwin; otherwise
+ * the offsets will be 0 and the dimensions will be those of the screen.
*
* Side effects:
* Vroot window information is refreshed if it is out of date.
@@ -4088,8 +4069,8 @@ Tk_GetVRootGeometry(
wmPtr = winPtr->wmInfoPtr;
/*
- * Make sure that the geometry information is up-to-date, then copy
- * it out to the caller.
+ * Make sure that the geometry information is up-to-date, then copy it out
+ * to the caller.
*/
if (wmPtr->flags & WM_VROOT_OFFSET_STALE) {
@@ -4106,18 +4087,17 @@ Tk_GetVRootGeometry(
*
* Tk_MoveToplevelWindow --
*
- * This procedure is called instead of Tk_MoveWindow to adjust
- * the x-y location of a top-level window. It delays the actual
- * move to a later time and keeps window-manager information
- * up-to-date with the move
+ * This procedure is called instead of Tk_MoveWindow to adjust the x-y
+ * location of a top-level window. It delays the actual move to a later
+ * time and keeps window-manager information up-to-date with the move.
*
* Results:
* None.
*
* Side effects:
* The window is eventually moved so that its upper-left corner
- * (actually, the upper-left corner of the window's decorative
- * frame, if there is one) is at (x,y).
+ * (actually, the upper-left corner of the window's decorative frame, if
+ * there is one) is at (x,y).
*
*----------------------------------------------------------------------
*/
@@ -4125,8 +4105,7 @@ Tk_GetVRootGeometry(
void
Tk_MoveToplevelWindow(
Tk_Window tkwin, /* Window to move. */
- int x, int y) /* New location for window (within
- * parent). */
+ int x, int y) /* New location for window (within parent). */
{
TkWindow *winPtr = (TkWindow *) tkwin;
WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -4145,16 +4124,15 @@ Tk_MoveToplevelWindow(
/*
* If the window has already been mapped, must bring its geometry
- * up-to-date immediately, otherwise an event might arrive from the
- * server that would overwrite wmPtr->x and wmPtr->y and lose the
- * new position.
+ * up-to-date immediately, otherwise an event might arrive from the server
+ * that would overwrite wmPtr->x and wmPtr->y and lose the new position.
*/
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ Tk_CancelIdleCall(UpdateGeometryInfo, winPtr);
}
- UpdateGeometryInfo((ClientData) winPtr);
+ UpdateGeometryInfo(winPtr);
}
}
@@ -4169,9 +4147,9 @@ Tk_MoveToplevelWindow(
* None.
*
* Side effects:
- * WinPtr gets restacked as specified by aboveBelow and otherPtr.
- * This procedure doesn't return until the restack has taken
- * effect and the ConfigureNotify event for it has been received.
+ * WinPtr gets restacked as specified by aboveBelow and otherPtr. This
+ * procedure doesn't return until the restack has taken effect and the
+ * ConfigureNotify event for it has been received.
*
*----------------------------------------------------------------------
*/
@@ -4181,9 +4159,9 @@ TkWmRestackToplevel(
TkWindow *winPtr, /* Window to restack. */
int aboveBelow, /* Gives relative position for restacking;
* must be Above or Below. */
- TkWindow *otherPtr) /* Window relative to which to restack;
- * if NULL, then winPtr gets restacked
- * above or below *all* siblings. */
+ TkWindow *otherPtr) /* Window relative to which to restack; if
+ * NULL, then winPtr gets restacked above or
+ * below *all* siblings. */
{
WmInfo *wmPtr;
@@ -4194,15 +4172,15 @@ TkWmRestackToplevel(
/*
* Get the mac window. Make sure it exists & is mapped.
*/
+
if (winPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
-
/*
- * Can't set stacking order properly until the window is on the
- * screen (mapping it may give it a reparent window), so make sure
- * it's on the screen.
+ * Can't set stacking order properly until the window is on the screen
+ * (mapping it may give it a reparent window), so make sure it's on
+ * the screen.
*/
TkWmMapWindow(winPtr);
@@ -4212,6 +4190,7 @@ TkWmRestackToplevel(
/*
* Get the window in which a raise or lower is in relation to.
*/
+
if (otherPtr != NULL) {
if (otherPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) otherPtr);
@@ -4233,8 +4212,8 @@ TkWmRestackToplevel(
*/
} else if (otherMacWindow == frontWindow || otherMacWindow == NULL) {
/*
- * Raise the window to the top. If the window is visible then
- * we also make it the active window.
+ * Raise the window to the top. If the window is visible then we
+ * also make it the active window.
*/
if (wmPtr->hints.initial_state == WithdrawnState) {
@@ -4277,27 +4256,26 @@ TkWmRestackToplevel(
* TkWmAddToColormapWindows --
*
* This procedure is called to add a given window to the
- * WM_COLORMAP_WINDOWS property for its top-level, if it
- * isn't already there. It is invoked by the Tk code that
- * creates a new colormap, in order to make sure that colormap
- * information is propagated to the window manager by default.
+ * WM_COLORMAP_WINDOWS property for its top-level, if it isn't already
+ * there. It is invoked by the Tk code that creates a new colormap, in
+ * order to make sure that colormap information is propagated to the
+ * window manager by default.
*
* Results:
* None.
*
* Side effects:
- * WinPtr's window gets added to the WM_COLORMAP_WINDOWS
- * property of its nearest top-level ancestor, unless the
- * colormaps have been set explicitly with the
- * "wm colormapwindows" command.
+ * WinPtr's window gets added to the WM_COLORMAP_WINDOWS property of its
+ * nearest top-level ancestor, unless the colormaps have been set
+ * explicitly with the "wm colormapwindows" command.
*
*----------------------------------------------------------------------
*/
void
TkWmAddToColormapWindows(
- TkWindow *winPtr) /* Window with a non-default colormap.
- * Should not be a top-level window. */
+ TkWindow *winPtr) /* Window with a non-default colormap. Should
+ * not be a top-level window. */
{
TkWindow *topPtr;
TkWindow **oldPtr, **newPtr;
@@ -4337,14 +4315,13 @@ TkWmAddToColormapWindows(
}
/*
- * Make a new bigger array and use it to reset the property.
- * Automatically add the toplevel itself as the last element
- * of the list.
+ * Make a new bigger array and use it to reset the property. Automatically
+ * add the toplevel itself as the last element of the list.
*/
- newPtr = (TkWindow **) ckalloc((unsigned) ((count+2)*sizeof(TkWindow*)));
+ newPtr = (TkWindow **) ckalloc((unsigned) (count+2)*sizeof(TkWindow *));
if (count > 0) {
- memcpy(newPtr, oldPtr, count * sizeof(TkWindow*));
+ memcpy(newPtr, oldPtr, count * sizeof(TkWindow *));
}
if (count == 0) {
count++;
@@ -4359,9 +4336,8 @@ TkWmAddToColormapWindows(
topPtr->wmInfoPtr->cmapCount = count+1;
/*
- * On the Macintosh all of this is just an excercise
- * in compatability as we don't support colormaps. If
- * we did they would be installed here.
+ * On the Macintosh all of this is just an excercise in compatability as
+ * we don't support colormaps. If we did they would be installed here.
*/
}
@@ -4371,16 +4347,16 @@ TkWmAddToColormapWindows(
* TkWmRemoveFromColormapWindows --
*
* This procedure is called to remove a given window from the
- * WM_COLORMAP_WINDOWS property for its top-level. It is invoked
- * when windows are deleted.
+ * WM_COLORMAP_WINDOWS property for its top-level. It is invoked when
+ * windows are deleted.
*
* Results:
* None.
*
* Side effects:
- * WinPtr's window gets removed from the WM_COLORMAP_WINDOWS
- * property of its nearest top-level ancestor, unless the
- * top-level itself is being deleted too.
+ * WinPtr's window gets removed from the WM_COLORMAP_WINDOWS property of
+ * its nearest top-level ancestor, unless the top-level itself is being
+ * deleted too.
*
*----------------------------------------------------------------------
*/
@@ -4398,8 +4374,8 @@ TkWmRemoveFromColormapWindows(
for (topPtr = winPtr->parentPtr; ; topPtr = topPtr->parentPtr) {
if (topPtr == NULL) {
/*
- * Ancestors have been deleted, so skip the whole operation.
- * Seems like this can't ever happen?
+ * Ancestors have been deleted, so skip the whole operation. Seems
+ * like this can't ever happen?
*/
return;
@@ -4410,16 +4386,15 @@ TkWmRemoveFromColormapWindows(
}
if (topPtr->flags & TK_ALREADY_DEAD) {
/*
- * Top-level is being deleted, so there's no need to cleanup
- * the WM_COLORMAP_WINDOWS property.
+ * Top-level is being deleted, so there's no need to cleanup the
+ * WM_COLORMAP_WINDOWS property.
*/
return;
}
/*
- * Find the window and slide the following ones down to cover
- * it up.
+ * Find the window and slide the following ones down to cover it up.
*/
count = topPtr->wmInfoPtr->cmapCount;
@@ -4443,10 +4418,10 @@ TkWmRemoveFromColormapWindows(
* Fetch the position of the mouse pointer.
*
* Results:
- * *xPtr and *yPtr are filled in with the (virtual) root coordinates
- * of the mouse pointer for tkwin's display. If the pointer isn't
- * on tkwin's screen, then -1 values are returned for both
- * coordinates. The argument tkwin must be a toplevel window.
+ * *xPtr and *yPtr are filled in with the (virtual) root coordinates of
+ * the mouse pointer for tkwin's display. If the pointer isn't on tkwin's
+ * screen, then -1 values are returned for both coordinates. The argument
+ * tkwin must be a toplevel window.
*
* Side effects:
* None.
@@ -4456,8 +4431,8 @@ TkWmRemoveFromColormapWindows(
void
TkGetPointerCoords(
- Tk_Window tkwin, /* Toplevel window that identifies screen
- * on which lookup is to be done. */
+ Tk_Window tkwin, /* Toplevel window that identifies screen on
+ * which lookup is to be done. */
int *xPtr, int *yPtr) /* Store pointer coordinates here. */
{
XQueryPointer(NULL, None, NULL, NULL, xPtr, yPtr, NULL, NULL, NULL);
@@ -4468,10 +4443,10 @@ TkGetPointerCoords(
*
* InitialWindowBounds --
*
- * This function calculates the initial bounds for a new Mac
- * toplevel window. Unless the geometry is specified by the user
- * this code will auto place the windows in a cascade diagonially
- * across the main monitor of the Mac.
+ * This function calculates the initial bounds for a new Mac toplevel
+ * window. Unless the geometry is specified by the user this code will
+ * auto place the windows in a cascade diagonially across the main
+ * monitor of the Mac.
*
* Results:
* The bounds are returned in geometry.
@@ -4527,9 +4502,9 @@ InitialWindowBounds(
*
* TkMacOSXResizable --
*
- * This function determines if the passed in window is part of
- * a toplevel window that is resizable. If the window is
- * resizable in the x, y or both directions, true is returned.
+ * This function determines if the passed in window is part of a toplevel
+ * window that is resizable. If the window is resizable in the x, y or
+ * both directions, true is returned.
*
* Results:
* True if resizable, false otherwise.
@@ -4567,10 +4542,10 @@ TkMacOSXResizable(
*
* TkMacOSXGrowToplevel --
*
- * The function is invoked when the user clicks in the grow region
- * of a Tk window. The function will handle the dragging
- * procedure and not return until completed. Finally, the function
- * may place information Tk's event queue is the window was resized.
+ * The function is invoked when the user clicks in the grow region of a
+ * Tk window. The function will handle the dragging procedure and not
+ * return until completed. Finally, the function may place information
+ * Tk's event queue is the window was resized.
*
* Results:
* True if events were placed on event queue, false otherwise.
@@ -4689,8 +4664,8 @@ TkMacOSXGrowToplevel(
*
* TkSetWMName --
*
- * Set the title for a toplevel window. If the window is embedded,
- * do not change the window title.
+ * Set the title for a toplevel window. If the window is embedded, do not
+ * change the window title.
*
* Results:
* None.
@@ -4712,7 +4687,7 @@ TkSetWMName(
return;
}
- title = CFStringCreateWithBytes(NULL, (const unsigned char*) titleUid,
+ title = CFStringCreateWithBytes(NULL, (const unsigned char *) titleUid,
strlen(titleUid), kCFStringEncodingUTF8, false);
if (title) {
WindowRef macWin = TkMacOSXDrawableWindow(winPtr->window);
@@ -4727,8 +4702,8 @@ TkSetWMName(
*
* TkGetTransientMaster --
*
- * If the passed window has the TRANSIENT_FOR property set this
- * will return the master window. Otherwise it will return None.
+ * If the passed window has the TRANSIENT_FOR property set this will
+ * return the master window. Otherwise it will return None.
*
* Results:
* The master window or None.
@@ -4786,10 +4761,9 @@ TkMacOSXGetXWindow(
*
* TkMacOSXIsWindowZoomed --
*
- * Ask Carbon if the given window is in the zoomed out state.
- * Because dragging & growing a window can change the Carbon
- * zoom state, we cannot rely on wmInfoPtr->hints.initial_state
- * for this information.
+ * Ask Carbon if the given window is in the zoomed out state. Because
+ * dragging & growing a window can change the Carbon zoom state, we
+ * cannot rely on wmInfoPtr->hints.initial_state for this information.
*
* Results:
* True if window is zoomed out, false otherwise.
@@ -4846,11 +4820,10 @@ TkMacOSXIsWindowZoomed(
*
* TkMacOSXZoomToplevel --
*
- * The function is invoked when the user clicks in the zoom region
- * of a Tk window or when the window state is set/unset to "zoomed"
- * manually. If the window is to be zoomed (in or out), the window
- * size is changed and events are generated to let Tk know what
- * happened.
+ * The function is invoked when the user clicks in the zoom region of a
+ * Tk window or when the window state is set/unset to "zoomed" manually.
+ * If the window is to be zoomed (in or out), the window size is changed
+ * and events are generated to let Tk know what happened.
*
* Results:
* True if events were placed on event queue, false otherwise.
@@ -4915,13 +4888,12 @@ TkMacOSXZoomToplevel(
}
err = ChkErr(ZoomWindowIdeal, whichWindow, zoomPart, &idealSize);
- if (err == noErr) {
- wmPtr->hints.initial_state =
- (zoomPart == inZoomIn ? NormalState : ZoomState);
- return true;
- } else {
+ if (err != noErr) {
return false;
}
+ wmPtr->hints.initial_state =
+ (zoomPart == inZoomIn ? NormalState : ZoomState);
+ return true;
}
/*
@@ -4930,9 +4902,8 @@ TkMacOSXZoomToplevel(
* TkUnsupported1Cmd --
*
* This procedure is invoked to process the
- * "::tk::unsupported::MacWindowStyle" Tcl command.
- * This command allows you to set the style of decoration
- * for a Macintosh window.
+ * "::tk::unsupported::MacWindowStyle" Tcl command. This command allows
+ * you to set the style of decoration for a Macintosh window.
*
* Results:
* A standard Tcl result.
@@ -4946,11 +4917,10 @@ TkMacOSXZoomToplevel(
/* ARGSUSED */
int
TkUnsupported1ObjCmd(
- ClientData clientData, /* Main window associated with
- * interpreter. */
+ ClientData clientData, /* Main window associated with interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj * const objv[]) /* Argument objects. */
+ Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *subcmds[] = {
"style", NULL
@@ -4958,7 +4928,7 @@ TkUnsupported1ObjCmd(
enum SubCmds {
TKMWS_STYLE
};
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin = clientData;
TkWindow *winPtr;
int index;
@@ -4967,8 +4937,8 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp,
- Tcl_GetString(objv[2]), tkwin);
+ winPtr = (TkWindow *)
+ Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
if (winPtr == NULL) {
return TCL_ERROR;
}
@@ -5000,9 +4970,8 @@ TkUnsupported1ObjCmd(
* WmWinStyle --
*
* This procedure is invoked to process the
- * "::tk::unsupported::MacWindowStyle style" subcommand.
- * This command allows you to set the style of decoration
- * for a Macintosh window.
+ * "::tk::unsupported::MacWindowStyle style" subcommand. This command
+ * allows you to set the style of decoration for a Macintosh window.
*
* Results:
* A standard Tcl result.
@@ -5012,6 +4981,7 @@ TkUnsupported1ObjCmd(
*
*----------------------------------------------------------------------
*/
+
static int
WmWinStyle(
Tcl_Interp *interp, /* Current interpreter. */
@@ -5100,7 +5070,7 @@ WmWinStyle(
if (objc == 3) {
if (wmPtr->style != -1) {
for (i = 0; styleMap[i].strValue != NULL; i++) {
- if (wmPtr->style == (short)(styleMap[i].intValue)) {
+ if (wmPtr->style == (short) styleMap[i].intValue) {
Tcl_SetObjResult(interp,
Tcl_NewStringObj(styleMap[i].strValue, -1));
return TCL_OK;
@@ -5201,8 +5171,8 @@ WmWinStyle(
*
* TkpMakeMenuWindow --
*
- * Configure the window to be either a undecorated pull-down
- * (or pop-up) menu, or as a toplevel floating menu (palette).
+ * Configure the window to be either a undecorated pull-down (or pop-up)
+ * menu, or as a toplevel floating menu (palette).
*
* Results:
* None.
@@ -5216,10 +5186,10 @@ WmWinStyle(
void
TkpMakeMenuWindow(
Tk_Window tkwin, /* New window. */
- int transient) /* 1 means menu is only posted briefly as
- * a popup or pulldown or cascade. 0 means
- * menu is always visible, e.g. as a
- * floating menu. */
+ int transient) /* 1 means menu is only posted briefly as a
+ * popup or pulldown or cascade. 0 means menu
+ * is always visible, e.g. as a floating
+ * menu. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -5239,8 +5209,8 @@ TkpMakeMenuWindow(
*
* TkMacOSXMakeRealWindowExist --
*
- * This function finally creates the real Macintosh window that
- * the Mac actually understands.
+ * This function finally creates the real Macintosh window that the Mac
+ * actually understands.
*
* Results:
* None.
@@ -5390,8 +5360,8 @@ TkMacOSXMakeRealWindowExist(
*
* TkMacOSXRegisterOffScreenWindow --
*
- * This function adds the passed in Off Screen Port to the
- * hash table that maps Mac windows to root X windows.
+ * This function adds the passed in Off Screen Port to the hash table
+ * that maps Mac windows to root X windows.
*
* Results:
* None.
@@ -5426,9 +5396,8 @@ TkMacOSXRegisterOffScreenWindow(
*
* TkMacOSXUnregisterMacWindow --
*
- * Given a macintosh port window, this function removes the
- * association between this window and the root X window that
- * Tk cares about.
+ * Given a macintosh port window, this function removes the association
+ * between this window and the root X window that Tk cares about.
*
* Results:
* None.
@@ -5461,9 +5430,8 @@ TkMacOSXUnregisterMacWindow(
*
* TkMacOSXSetScrollbarGrow --
*
- * Sets a flag for a toplevel window indicating that the passed
- * Tk scrollbar window will display the grow region for the
- * toplevel window.
+ * Sets a flag for a toplevel window indicating that the passed Tk
+ * scrollbar window will display the grow region for the toplevel window.
*
* Results:
* None.
@@ -5495,15 +5463,15 @@ TkMacOSXSetScrollbarGrow(
* TkWmFocusToplevel --
*
* This is a utility procedure invoked by focus-management code. It
- * exists because of the extra wrapper windows that exist under
- * Unix; its job is to map from wrapper windows to the
- * corresponding toplevel windows. On PCs and Macs there are no
- * wrapper windows so no mapping is necessary; this procedure just
- * determines whether a window is a toplevel or not.
+ * exists because of the extra wrapper windows that exist under Unix; its
+ * job is to map from wrapper windows to the corresponding toplevel
+ * windows. On PCs and Macs there are no wrapper windows so no mapping is
+ * necessary; this procedure just determines whether a window is a
+ * toplevel or not.
*
* Results:
- * If winPtr is a toplevel window, returns the pointer to the
- * window; otherwise returns NULL.
+ * If winPtr is a toplevel window, returns the pointer to the window;
+ * otherwise returns NULL.
*
* Side effects:
* None.
@@ -5527,13 +5495,13 @@ TkWmFocusToplevel(
*
* TkpGetWrapperWindow --
*
- * This is a utility procedure invoked by focus-management code. It
- * maps to the wrapper for a top-level, which is just the same
- * as the top-level on Macs and PCs.
+ * This is a utility procedure invoked by focus-management code. It maps
+ * to the wrapper for a top-level, which is just the same as the
+ * top-level on Macs and PCs.
*
* Results:
- * If winPtr is a toplevel window, returns the pointer to the
- * window; otherwise returns NULL.
+ * If winPtr is a toplevel window, returns the pointer to the window;
+ * otherwise returns NULL.
*
* Side effects:
* None.
@@ -5557,8 +5525,8 @@ TkpGetWrapperWindow(
*
* TkpWmSetState --
*
- * Sets the window manager state for the wrapper window of a
- * given toplevel window.
+ * Sets the window manager state for the wrapper window of a given
+ * toplevel window.
*
* Results:
* None.
@@ -5570,9 +5538,9 @@ TkpGetWrapperWindow(
*/
void
-TkpWmSetState(winPtr, state)
- TkWindow *winPtr; /* Toplevel window to operate on. */
- int state; /* One of IconicState, ZoomState, NormalState,
+TkpWmSetState(
+ TkWindow *winPtr, /* Toplevel window to operate on. */
+ int state) /* One of IconicState, ZoomState, NormalState,
* or WithdrawnState. */
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -5589,9 +5557,10 @@ TkpWmSetState(winPtr, state)
Tk_UnmapWindow((Tk_Window) winPtr);
} else if (state == IconicState) {
/*
- * The window always gets unmapped. If we can show the
- * icon version of the window we also collapse it.
+ * The window always gets unmapped. If we can show the icon version of
+ * the window we also collapse it.
*/
+
if (IsWindowCollapsable(macWin) && !IsWindowCollapsed(macWin)) {
CollapseWindow(macWin, true);
}
@@ -5669,9 +5638,9 @@ TkMacOSXWindowClass(
*
* TkMacOSXWindowOffset --
*
- * Determines the x and y offset from the orgin of the toplevel
- * window dressing (the structure region, ie. title bar) and the
- * orgin of the content area.
+ * Determines the x and y offset from the orgin of the toplevel window
+ * dressing (the structure region, i.e. title bar) and the orgin of the
+ * content area.
*
* Results:
* The x & y offset in pixels.
@@ -5704,8 +5673,8 @@ TkMacOSXWindowOffset(
*
* TkpGetMS --
*
- * Return a relative time in milliseconds. It doesn't matter
- * when the epoch was.
+ * Return a relative time in milliseconds. It doesn't matter when the
+ * epoch was.
*
* Results:
* Number of milliseconds.
@@ -5758,15 +5727,14 @@ XSetInputFocus(
*
* TkpChangeFocus --
*
- * This procedure is a stub on the Mac because we always own the
- * focus if we are a front most application.
+ * This procedure is a stub on the Mac because we always own the focus if
+ * we are a front most application.
*
* Results:
- * The return value is the serial number of the command that
- * changed the focus. It may be needed by the caller to filter
- * out focus change events that were queued before the command.
- * If the procedure doesn't actually change the focus then
- * it returns 0.
+ * The return value is the serial number of the command that changed the
+ * focus. It may be needed by the caller to filter out focus change
+ * events that were queued before the command. If the procedure doesn't
+ * actually change the focus then it returns 0.
*
* Side effects:
* None.
@@ -5775,15 +5743,15 @@ XSetInputFocus(
*/
int
-TkpChangeFocus(winPtr, force)
- TkWindow *winPtr; /* Window that is to receive the X focus. */
- int force; /* Non-zero means claim the focus even
- * if it didn't originally belong to
- * topLevelPtr's application. */
+TkpChangeFocus(
+ TkWindow *winPtr, /* Window that is to receive the X focus. */
+ int force) /* Non-zero means claim the focus even if it
+ * didn't originally belong to topLevelPtr's
+ * application. */
{
/*
- * We don't really need to do anything on the Mac. Tk will
- * keep all this state for us.
+ * We don't really need to do anything on the Mac. Tk will keep all this
+ * state for us.
*/
if (winPtr->atts.override_redirect) {
@@ -5791,10 +5759,10 @@ TkpChangeFocus(winPtr, force)
}
/*
- * Remember the current serial number for the X server and issue
- * a dummy server request. This marks the position at which we
- * changed the focus, so we can distinguish FocusIn and FocusOut
- * events on either side of the mark.
+ * Remember the current serial number for the X server and issue a dummy
+ * server request. This marks the position at which we changed the focus,
+ * so we can distinguish FocusIn and FocusOut events on either side of the
+ * mark.
*/
return NextRequest(winPtr->display);
@@ -5805,13 +5773,12 @@ TkpChangeFocus(winPtr, force)
*
* WmStackorderToplevelWrapperMap --
*
- * This procedure will create a table that maps the reparent wrapper
- * X id for a toplevel to the TkWindow structure that is wraps.
- * Tk keeps track of a mapping from the window X id to the TkWindow
- * structure but that does us no good here since we only get the X
- * id of the wrapper window. Only those toplevel windows that are
- * mapped have a position in the stacking order.
- *
+ * This procedure will create a table that maps the reparent wrapper X id
+ * for a toplevel to the TkWindow structure that is wraps. Tk keeps track
+ * of a mapping from the window X id to the TkWindow structure but that
+ * does us no good here since we only get the X id of the wrapper window.
+ * Only those toplevel windows that are mapped have a position in the
+ * stacking order.
*
* Results:
* None.
@@ -5838,7 +5805,7 @@ WmStackorderToplevelWrapperMap(
macWindow = TkMacOSXDrawableWindow(winPtr->window);
hPtr = Tcl_CreateHashEntry(table,
- (const char *) macWindow, &newEntry);
+ (const char *) macWindow, &newEntry);
Tcl_SetHashValue(hPtr, winPtr);
}
@@ -5856,8 +5823,8 @@ WmStackorderToplevelWrapperMap(
* This procedure returns the stack order of toplevel windows.
*
* Results:
- * An array of pointers to tk window objects in stacking order
- * or else NULL if there was an error.
+ * An array of pointers to tk window objects in stacking order or else
+ * NULL if there was an error.
*
* Side effects:
* None.
@@ -5866,8 +5833,8 @@ WmStackorderToplevelWrapperMap(
*/
TkWindow **
-TkWmStackorderToplevel(parentPtr)
- TkWindow *parentPtr; /* Parent toplevel window. */
+TkWmStackorderToplevel(
+ TkWindow *parentPtr) /* Parent toplevel window. */
{
WindowRef frontWindow;
TkWindow *childWinPtr, **windows, **window_ptr;
@@ -5882,12 +5849,12 @@ TkWmStackorderToplevel(parentPtr)
Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
WmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table);
- windows = (TkWindow **) ckalloc((table.numEntries+1)
- * sizeof(TkWindow *));
+ windows = (TkWindow **)
+ ckalloc((table.numEntries+1) * sizeof(TkWindow *));
/*
- * Special cases: If zero or one toplevels were mapped
- * there is no need to enumerate Windows.
+ * Special cases: If zero or one toplevels were mapped there is no need to
+ * enumerate Windows.
*/
switch (table.numEntries) {
@@ -5896,7 +5863,7 @@ TkWmStackorderToplevel(parentPtr)
goto done;
case 1:
hPtr = Tcl_FirstHashEntry(&table, &search);
- windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[0] = Tcl_GetHashValue(hPtr);
windows[1] = NULL;
goto done;
}
@@ -5908,20 +5875,21 @@ TkWmStackorderToplevel(parentPtr)
} else {
window_ptr = windows + table.numEntries;
*window_ptr-- = NULL;
- while (frontWindow != NULL) {
- hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow);
- if (hPtr != NULL) {
- childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
- *window_ptr-- = childWinPtr;
- }
- frontWindow = GetNextWindow(frontWindow);
+ while (frontWindow != NULL) {
+ hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
}
- if (window_ptr != (windows-1))
+ frontWindow = GetNextWindow(frontWindow);
+ }
+ if (window_ptr != (windows-1)) {
Tcl_Panic("num matched toplevel windows does not equal num "
"children");
+ }
}
- done:
+ done:
Tcl_DeleteHashTable(&table);
return windows;
}
@@ -5998,7 +5966,7 @@ ApplyWindowClassAttributeChanges(
}
}
TkMacOSXInvalClipRgns((Tk_Window) winPtr);
- TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window),
+ TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window,
TK_PARENT_WINDOW);
}
@@ -6006,6 +5974,7 @@ ApplyWindowClassAttributeChanges(
* The change of window class/attributes might have changed the window
* structure widths:
*/
+
GetWindowStructureWidths(macWindow, &strWidths);
wmPtr->xInParent = strWidths.left;
wmPtr->yInParent = strWidths.top;
@@ -6068,7 +6037,7 @@ ApplyMasterOverrideChanges(
WindowGroupRef group;
ApplyWindowClassAttributeChanges(winPtr, macWindow, oldClass,
- oldAttributes, 0);
+ oldAttributes, 0);
if (winPtr->atts.override_redirect && wmPtr->master != None) {
wmPtr->flags |= WM_TOPMOST;
@@ -6109,8 +6078,8 @@ WmGetWindowGroup(
group = GetWindowGroupOfClass(kUtilityWindowClass);
} else if (wmPtr->master != None) {
TkDisplay *dispPtr = TkGetDisplayList();
- TkWindow *masterWinPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display,
- wmPtr->master);
+ TkWindow *masterWinPtr = (TkWindow *)
+ Tk_IdToWindow(dispPtr->display, wmPtr->master);
if (masterWinPtr && masterWinPtr->window != None &&
TkMacOSXHostToplevelExists(masterWinPtr)) {
@@ -6165,9 +6134,11 @@ TkMacOSXMakeFullscreen(
if (fullscreen) {
int screenWidth = WidthOfScreen(Tk_Screen(winPtr));
int screenHeight = HeightOfScreen(Tk_Screen(winPtr));
+
/*
* Check max width and height if set by the user.
*/
+
if ((wmPtr->maxWidth > 0 && wmPtr->maxWidth < screenWidth)
|| (wmPtr->maxHeight > 0 && wmPtr->maxHeight < screenHeight)) {
if (interp) {
@@ -6272,8 +6243,8 @@ TkMacOSXEnterExitFullscreen(
*
* GetMinSize --
*
- * This function computes the current minWidth and minHeight values for
- * a window, taking into account the possibility that they may be
+ * This function computes the current minWidth and minHeight values for a
+ * window, taking into account the possibility that they may be
* defaulted.
*
* Results:
@@ -6307,41 +6278,43 @@ GetMinSize(
*/
switch (wmPtr->macClass) {
- case kDocumentWindowClass:
- case kMovableAlertWindowClass:
- case kMovableModalWindowClass:
- minWidth = 72;
- if (wmPtr->attributes & kWindowResizableAttribute) {
- minHeight = 15;
- }
- if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
- minWidth += 29;
- }
- break;
- case kFloatingWindowClass:
- case kUtilityWindowClass:
- minWidth = 59;
- if (wmPtr->attributes & kWindowResizableAttribute) {
- minHeight = 11;
- }
- if (wmPtr->attributes & kWindowSideTitlebarAttribute) {
- int tmp = minWidth;
- minWidth = minHeight;
- minHeight = tmp;
- } else if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
- minWidth += 29;
- }
- break;
- default:
- if (wmPtr->attributes & kWindowResizableAttribute) {
- minWidth = 15;
- minHeight = 15;
- }
- break;
+ case kDocumentWindowClass:
+ case kMovableAlertWindowClass:
+ case kMovableModalWindowClass:
+ minWidth = 72;
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minHeight = 15;
+ }
+ if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
+ minWidth += 29;
+ }
+ break;
+ case kFloatingWindowClass:
+ case kUtilityWindowClass:
+ minWidth = 59;
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minHeight = 11;
+ }
+ if (wmPtr->attributes & kWindowSideTitlebarAttribute) {
+ int tmp = minWidth;
+
+ minWidth = minHeight;
+ minHeight = tmp;
+ } else if (wmPtr->attributes & kWindowToolbarButtonAttribute) {
+ minWidth += 29;
+ }
+ break;
+ default:
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ minWidth = 15;
+ minHeight = 15;
+ }
+ break;
}
if (wmPtr->gridWin != NULL) {
int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc);
+
if (base < 0) {
base = 0;
}
@@ -6367,8 +6340,8 @@ GetMinSize(
*
* GetMaxSize --
*
- * This function computes the current maxWidth and maxHeight values for
- * a window, taking into account the possibility that they may be
+ * This function computes the current maxWidth and maxHeight values for a
+ * window, taking into account the possibility that they may be
* defaulted.
*
* Results:
@@ -6398,6 +6371,7 @@ GetMaxSize(
*maxWidthPtr = wmPtr->maxWidth;
} else {
int maxWidth = maxBounds->right - maxBounds->left - wmPtr->xInParent;
+
if (wmPtr->gridWin != NULL) {
maxWidth = wmPtr->reqGridWidth
+ (maxWidth - winPtr->reqWidth)/wmPtr->widthInc;
@@ -6408,6 +6382,7 @@ GetMaxSize(
*maxHeightPtr = wmPtr->maxHeight;
} else {
int maxHeight = maxBounds->bottom - maxBounds->top - wmPtr->yInParent;
+
if (wmPtr->gridWin != NULL) {
maxHeight = wmPtr->reqGridHeight
+ (maxHeight - winPtr->reqHeight)/wmPtr->heightInc;
@@ -6421,8 +6396,7 @@ GetMaxSize(
*
* RemapWindows
*
- * Adjust parent/child relation ships of
- * the given window hierarchy.
+ * Adjust parent/child relation ships of the given window hierarchy.
*
* Results:
* none
@@ -6432,16 +6406,22 @@ GetMaxSize(
*
*----------------------------------------------------------------------
*/
+
static void
-RemapWindows(TkWindow *winPtr, MacDrawable *parentWin)
+RemapWindows(
+ TkWindow *winPtr,
+ MacDrawable *parentWin)
{
TkWindow *childPtr;
- /* Remove the OS specific window.
- * It will get rebuilt when the window gets Mapped.
+ /*
+ * Remove the OS specific window. It will get rebuilt when the window gets
+ * Mapped.
*/
+
if (winPtr->window != None) {
MacDrawable *macWin = (MacDrawable *) winPtr->window;
+
macWin->grafPtr = NULL;
macWin->toplevel = parentWin->toplevel;
winPtr->flags &= ~TK_MAPPED;
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 181053b..6904d0d 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -1,19 +1,19 @@
/*
* tkMacOSXXStubs.c --
*
- * This file contains most of the X calls called by Tk. Many of
- * these calls are just stubs and either don't make sense on the
- * Macintosh or thier implamentation just doesn't do anything. Other
- * calls will eventually be moved into other files.
+ * This file contains most of the X calls called by Tk. Many of these
+ * calls are just stubs and either don't make sense on the Macintosh or
+ * their implamentation just doesn't do anything. Other calls will
+ * eventually be moved into other files.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright 2001, Apple Computer, Inc.
* Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.17.2.7 2007/10/15 18:38:36 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.17.2.8 2008/06/25 16:46:09 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -23,8 +23,8 @@
/*
* Because this file is still under major development Debugger statements are
- * used through out this file. The define TCL_DEBUG will decide whether
- * the debugger statements actually call the debugger or not.
+ * used through out this file. The define TCL_DEBUG will decide whether the
+ * debugger statements actually call the debugger or not.
*/
#ifndef TCL_DEBUG
@@ -37,29 +37,32 @@
* Declarations of static variables used in this file.
*/
-static TkDisplay *gMacDisplay = NULL; /* Macintosh display. */
-static const char *macScreenName = ":0"; /* Default name of macintosh display. */
+static TkDisplay *gMacDisplay = NULL;
+ /* Macintosh display. */
+static const char *macScreenName = ":0";
+ /* Default name of macintosh display. */
/*
* Forward declarations of procedures used in this file.
*/
-static XID MacXIdAlloc(Display *display);
-static int DefaultErrorHandler(Display* display, XErrorEvent* err_evt);
+static XID MacXIdAlloc(Display *display);
+static int DefaultErrorHandler(Display *display,
+ XErrorEvent *err_evt);
/*
* Other declarations
*/
-static int DestroyImage(XImage *image);
-static unsigned long ImageGetPixel(XImage *image, int x, int y);
-static int PutPixel(XImage *image, int x, int y, unsigned long pixel);
+static int DestroyImage(XImage *image);
+static unsigned long ImageGetPixel(XImage *image, int x, int y);
+static int PutPixel(XImage *image, int x, int y,
+ unsigned long pixel);
#if 0
-static XImage *SubImage(XImage *image, int x, int y,
- unsigned int width, unsigned int height);
-static int AddPixel(XImage *image, long value);
+static XImage * SubImage(XImage *image, int x, int y,
+ unsigned int width, unsigned int height);
+static int AddPixel(XImage *image, long value);
#endif
-
/*
*----------------------------------------------------------------------
@@ -79,7 +82,8 @@ static int AddPixel(XImage *image, long value);
*/
void
-TkMacOSXDisplayChanged(Display *display)
+TkMacOSXDisplayChanged(
+ Display *display)
{
GDHandle graphicsDevice;
Screen *screen;
@@ -91,17 +95,17 @@ TkMacOSXDisplayChanged(Display *display)
screen = display->screens;
graphicsDevice = GetMainDevice();
- screen->root_depth = (*(*graphicsDevice)->gdPMap)->cmpSize *
- (*(*graphicsDevice)->gdPMap)->cmpCount;
- screen->height = (*graphicsDevice)->gdRect.bottom -
- (*graphicsDevice)->gdRect.top;
- screen->width = (*graphicsDevice)->gdRect.right -
- (*graphicsDevice)->gdRect.left;
+ screen->root_depth = (*(*graphicsDevice)->gdPMap)->cmpSize *
+ (*(*graphicsDevice)->gdPMap)->cmpCount;
+ screen->height = (*graphicsDevice)->gdRect.bottom -
+ (*graphicsDevice)->gdRect.top;
+ screen->width = (*graphicsDevice)->gdRect.right -
+ (*graphicsDevice)->gdRect.left;
- screen->mwidth = (screen->width * 254 + 360) / 720;
- screen->mheight = (screen->height * 254 + 360) / 720;
+ screen->mwidth = (screen->width * 254 + 360) / 720;
+ screen->mheight = (screen->height * 254 + 360) / 720;
- maxBounds = (Rect*) screen->ext_data;
+ maxBounds = (Rect *) screen->ext_data;
*maxBounds = bounds;
graphicsDevice = GetDeviceList();
while (graphicsDevice) {
@@ -121,8 +125,8 @@ TkMacOSXDisplayChanged(Display *display)
*
* TkpOpenDisplay --
*
- * Create the Display structure and fill it with device
- * specific information.
+ * Create the Display structure and fill it with device specific
+ * information.
*
* Results:
* Returns a Display structure on success or NULL on failure.
@@ -162,13 +166,13 @@ TkpOpenDisplay(
display->screens = screen;
display->nscreens = 1;
display->default_screen = 0;
- display->display_name = (char*)macScreenName;
+ display->display_name = (char *) macScreenName;
- Gestalt(gestaltQuickdrawVersion, (long*)&display->proto_minor_version);
+ Gestalt(gestaltQuickdrawVersion, (long *) &display->proto_minor_version);
display->proto_major_version = 10;
display->proto_minor_version -= gestaltMacOSXQD;
display->vendor = "Apple";
- Gestalt(gestaltSystemVersion, (long*)&display->release);
+ Gestalt(gestaltSystemVersion, (long *) &display->release);
/*
* These screen bits never change
@@ -177,7 +181,7 @@ TkpOpenDisplay(
screen->display = display;
screen->black_pixel = 0x00000000 | PIXEL_MAGIC << 24;
screen->white_pixel = 0x00FFFFFF | PIXEL_MAGIC << 24;
- screen->ext_data = (XExtData*) &maxBounds;
+ screen->ext_data = (XExtData *) &maxBounds;
screen->root_visual = (Visual *) ckalloc(sizeof(Visual));
screen->root_visual->visualid = 0;
@@ -191,13 +195,14 @@ TkpOpenDisplay(
/*
* Initialize screen bits that may change
*/
+
TkMacOSXDisplayChanged(display);
gMacDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
/*
- * This is the quickest way to make sure that all the *Init
- * flags get properly initialized
+ * This is the quickest way to make sure that all the *Init flags get
+ * properly initialized
*/
bzero(gMacDisplay, sizeof(TkDisplay));
@@ -226,13 +231,14 @@ TkpCloseDisplay(
TkDisplay *displayPtr)
{
Display *display = displayPtr->display;
+
if (gMacDisplay != displayPtr) {
Tcl_Panic("TkpCloseDisplay: tried to call TkpCloseDisplay on bad display");
}
gMacDisplay = NULL;
- if (display->screens != (Screen *) NULL) {
- if (display->screens->root_visual != (Visual *) NULL) {
+ if (display->screens != NULL) {
+ if (display->screens->root_visual != NULL) {
ckfree((char *) display->screens->root_visual);
}
ckfree((char *) display->screens);
@@ -245,11 +251,10 @@ TkpCloseDisplay(
*
* TkClipCleanup --
*
- * This procedure is called to cleanup resources associated with
- * claiming clipboard ownership and for receiving selection get
- * results. This function is called in tkWindow.c. This has to be
- * called by the display cleanup function because we still need the
- * access display elements.
+ * This procedure is called to cleanup resources associated with claiming
+ * clipboard ownership and for receiving selection get results. This
+ * function is called in tkWindow.c. This has to be called by the display
+ * cleanup function because we still need the access display elements.
*
* Results:
* None.
@@ -261,12 +266,12 @@ TkpCloseDisplay(
*/
void
-TkClipCleanup(dispPtr)
- TkDisplay *dispPtr; /* display associated with clipboard */
+TkClipCleanup(
+ TkDisplay *dispPtr) /* display associated with clipboard */
{
/*
- * Make sure that the local scrap is transfered to the global
- * scrap if needed.
+ * Make sure that the local scrap is transfered to the global scrap if
+ * needed.
*/
TkSuspendClipboard();
@@ -278,7 +283,7 @@ TkClipCleanup(dispPtr)
dispPtr->windowAtom);
Tk_DestroyWindow(dispPtr->clipWindow);
- Tcl_Release((ClientData) dispPtr->clipWindow);
+ Tcl_Release(dispPtr->clipWindow);
dispPtr->clipWindow = NULL;
}
}
@@ -288,31 +293,31 @@ TkClipCleanup(dispPtr)
*
* MacXIdAlloc --
*
- * This procedure is invoked by Xlib as the resource allocator
- * for a display.
+ * This procedure is invoked by Xlib as the resource allocator for a
+ * display.
*
* Results:
- * The return value is an X resource identifier that isn't currently
- * in use.
+ * The return value is an X resource identifier that isn't currently in
+ * use.
*
* Side effects:
- * The identifier is removed from the stack of free identifiers,
- * if it was previously on the stack.
+ * The identifier is removed from the stack of free identifiers, if it
+ * was previously on the stack.
*
*----------------------------------------------------------------------
*/
static XID
MacXIdAlloc(
- Display *display) /* Display for which to allocate. */
+ Display *display) /* Display for which to allocate. */
{
- static long int cur_id = 100;
- /*
- * Some special XIds are reserved
- * - this is why we start at 100
- */
+ static long int cur_id = 100;
+ /*
+ * Some special XIds are reserved
+ * - this is why we start at 100
+ */
- return ++cur_id;
+ return ++cur_id;
}
/*
@@ -347,8 +352,8 @@ TkpWindowWasRecentlyDeleted(
*
* DefaultErrorHandler --
*
- * This procedure is the default X error handler. Tk uses it's
- * own error handler so this call should never be called.
+ * This procedure is the default X error handler. Tk uses it's own error
+ * handler so this call should never be called.
*
* Results:
* None.
@@ -365,14 +370,14 @@ DefaultErrorHandler(
XErrorEvent* err_evt)
{
/*
- * This call should never be called. Tk replaces
- * it with its own error handler.
+ * This call should never be called. Tk replaces it with its own error
+ * handler.
*/
+
Tcl_Panic("Warning hit bogus error handler!");
return 0;
}
-
char *
XGetAtomName(
Display * display,
@@ -383,7 +388,8 @@ XGetAtomName(
}
int
-_XInitImageFuncPtrs(XImage *image)
+_XInitImageFuncPtrs(
+ XImage *image)
{
return 0;
}
@@ -396,24 +402,25 @@ XSetErrorHandler(
}
Window
-XRootWindow(Display *display, int screen_number)
+XRootWindow(
+ Display *display,
+ int screen_number)
{
display->request++;
return ROOT_ID;
}
int
-XGetGeometry(display, d, root_return, x_return, y_return, width_return,
- height_return, border_width_return, depth_return)
- Display* display;
- Drawable d;
- Window* root_return;
- int* x_return;
- int* y_return;
- unsigned int* width_return;
- unsigned int* height_return;
- unsigned int* border_width_return;
- unsigned int* depth_return;
+XGetGeometry(
+ Display *display,
+ Drawable d,
+ Window *root_return,
+ int *x_return,
+ int *y_return,
+ unsigned int *width_return,
+ unsigned int *height_return,
+ unsigned int *border_width_return,
+ unsigned int *depth_return)
{
TkWindow *winPtr = ((MacDrawable *) d)->winPtr;
@@ -488,8 +495,8 @@ XSizeHints *
XAllocSizeHints(void)
{
/*
- * Always return NULL. Tk code checks to see if NULL
- * is returned & does nothing if it is.
+ * Always return NULL. Tk code checks to see if NULL is returned & does
+ * nothing if it is.
*/
return NULL;
@@ -670,10 +677,11 @@ XForceScreenSaver(
int mode)
{
/*
- * This function is just a no-op. It is defined to
- * reset the screen saver. However, there is no real
- * way to do this on a Mac. Let me know if there is!
+ * This function is just a no-op. It is defined to reset the screen saver.
+ * However, there is no real way to do this on a Mac. Let me know if there
+ * is!
*/
+
display->request++;
}
@@ -727,9 +735,9 @@ XSetClipRectangles(
*
* TkGetServerInfo --
*
- * Given a window, this procedure returns information about
- * the window server for that window. This procedure provides
- * the guts of the "winfo server" command.
+ * Given a window, this procedure returns information about the window
+ * server for that window. This procedure provides the guts of the "winfo
+ * server" command.
*
* Results:
* None.
@@ -742,10 +750,10 @@ XSetClipRectangles(
void
TkGetServerInfo(
- Tcl_Interp *interp, /* The server information is returned in
- * this interpreter's result. */
- Tk_Window tkwin) /* Token for window; this selects a
- * particular display and server. */
+ Tcl_Interp *interp, /* The server information is returned in this
+ * interpreter's result. */
+ Tk_Window tkwin) /* Token for window; this selects a particular
+ * display and server. */
{
char buffer[8 + TCL_INTEGER_SPACE * 2];
char buffer2[TCL_INTEGER_SPACE];
@@ -880,11 +888,15 @@ XGetImage(
if (TkMacOSXGetDrawablePort(d)) {
if (format == ZPixmap) {
if (width > 0 && height > 0) {
- /* Tk_GetPixmap fails for zero width or height */
+ /*
+ * Tk_GetPixmap fails for zero width or height.
+ */
+
pixmap = Tk_GetPixmap(display, d, width, height, depth);
}
if (win) {
XGCValues values;
+
gc = Tk_GetGC(win, 0, &values);
} else {
gc = XCreateGC(display, pixmap, 0, NULL);
@@ -893,18 +905,22 @@ XGetImage(
XCopyArea(display, d, pixmap, gc, x, y, width, height, 0, 0);
}
imagePtr = XCreateImage(display, NULL, depth, format, offset,
- (char*)TkMacOSXGetDrawablePort(pixmap),
- width, height, bitmap_pad, bytes_per_line);
- /* Track Pixmap underlying the XImage in the unused obdata field *
- * so that we can treat XImages coming from XGetImage specially. */
+ (char *) TkMacOSXGetDrawablePort(pixmap),
+ width, height, bitmap_pad, bytes_per_line);
+
+ /*
+ * Track Pixmap underlying the XImage in the unused obdata field
+ * so that we can treat XImages coming from XGetImage specially.
+ */
+
imagePtr->obdata = (XPointer) pixmap;
if (!win) {
XFreeGC(display, gc);
}
} else {
TkpDisplayWarning(
- "XGetImage: only ZPixmap types are implemented",
- "XGetImage Failure");
+ "XGetImage: only ZPixmap types are implemented",
+ "XGetImage Failure");
}
}
return imagePtr;
@@ -968,11 +984,14 @@ ImageGetPixel(
RGBColor cPix;
unsigned long r, g, b, c;
- destPort = (CGrafPtr)image->data;
+ destPort = (CGrafPtr) image->data;
portChanged = QDSwapPort(destPort, &savePort);
GetCPixel(x, y, &cPix);
if (image->obdata) {
- /* Image from XGetImage, 16 bit color values */
+ /*
+ * Image from XGetImage, 16 bit color values.
+ */
+
r = (cPix . red) >> 8;
g = (cPix . green) >> 8;
b = (cPix . blue) >> 8;
@@ -1018,18 +1037,21 @@ PutPixel(
destPort = (CGrafPtr)image->data;
portChanged = QDSwapPort(destPort, &savePort);
- r = (pixel & image->red_mask)>>16;
- g = (pixel & image->green_mask)>>8;
- b = (pixel & image->blue_mask);
+ r = (pixel & image->red_mask)>>16;
+ g = (pixel & image->green_mask)>>8;
+ b = (pixel & image->blue_mask);
if (image->obdata) {
- /* Image from XGetImage, 16 bit color values */
- cPix . red = r << 8;
- cPix . green = g << 8;
- cPix . blue = b << 8;
+ /*
+ * Image from XGetImage, 16 bit color values.
+ */
+
+ cPix.red = r << 8;
+ cPix.green = g << 8;
+ cPix.blue = b << 8;
} else {
- cPix . red = r;
- cPix . green = g;
- cPix . blue = b;
+ cPix.red = r;
+ cPix.green = g;
+ cPix.blue = b;
}
SetCPixel(x, y, &cPix);
if (portChanged) {
@@ -1068,8 +1090,8 @@ AddPixel(
* XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap,
* XSetWindowBorderWidth, XSetWindowColormap
*
- * These functions are all no-ops. They all have equivilent
- * Tk calls that should always be used instead.
+ * These functions are all no-ops. They all have equivalent Tk calls that
+ * should always be used instead.
*
* Results:
* None.
@@ -1202,8 +1224,8 @@ TkGetDefaultScreenName(
* Return the number of milliseconds the user was inactive.
*
* Results:
- * The number of milliseconds the user has been inactive,
- * or -1 if querying the inactive time is not supported.
+ * The number of milliseconds the user has been inactive, or -1 if
+ * querying the inactive time is not supported.
*
* Side effects:
* None.
@@ -1211,13 +1233,15 @@ TkGetDefaultScreenName(
*/
long
-Tk_GetUserInactiveTime(Display *dpy)
+Tk_GetUserInactiveTime(
+ Display *dpy)
{
io_registry_entry_t regEntry;
CFMutableDictionaryRef props = NULL;
CFTypeRef timeObj;
long ret = -1l;
uint64_t time;
+ IOReturn result;
regEntry = IOServiceGetMatchingService(kIOMasterPortDefault,
IOServiceMatching("IOHIDSystem"));
@@ -1226,7 +1250,7 @@ Tk_GetUserInactiveTime(Display *dpy)
return -1l;
}
- IOReturn result = IORegistryEntryCreateCFProperties(regEntry, &props,
+ result = IORegistryEntryCreateCFProperties(regEntry, &props,
kCFAllocatorDefault, 0);
IOObjectRelease(regEntry);
@@ -1244,13 +1268,13 @@ Tk_GetUserInactiveTime(Display *dpy)
CFRangeMake(0, sizeof(time)), (UInt8 *) &time);
/* Convert nanoseconds to milliseconds. */
/* ret /= kMillisecondScale; */
- ret = (long)(time/kMillisecondScale);
+ ret = (long) (time/kMillisecondScale);
} else if (type == CFNumberGetTypeID()) { /* Panther+ */
CFNumberGetValue((CFNumberRef)timeObj,
kCFNumberSInt64Type, &time);
/* Convert nanoseconds to milliseconds. */
/* ret /= kMillisecondScale; */
- ret = (long)(time/kMillisecondScale);
+ ret = (long) (time/kMillisecondScale);
} else {
ret = -1l;
}
@@ -1272,14 +1296,15 @@ Tk_GetUserInactiveTime(Display *dpy)
* none
*
* Side effects:
- * The user inactivity timer of the underlaying windowing system
- * is reset to zero.
+ * The user inactivity timer of the underlaying windowing system is reset
+ * to zero.
*
*----------------------------------------------------------------------
*/
void
-Tk_ResetUserInactiveTime(Display *dpy)
+Tk_ResetUserInactiveTime(
+ Display *dpy)
{
- UpdateSystemActivity(OverallAct);
+ UpdateSystemActivity(UsrActivity);
}
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index d324eb5..8f59c08 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -27,7 +27,7 @@
* top-level window, not to the Tk_Window. BoxToRect()
* accounts for this.
*
- * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.7.2.9 2007/12/10 18:39:31 dgp Exp $
+ * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.7.2.10 2008/06/25 16:46:09 dgp Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -160,6 +160,8 @@ static Ttk_StateTable ButtonValueTable[] = {
};
static Ttk_StateTable ButtonAdornmentTable[] = {
+ { kThemeAdornmentDefault| kThemeAdornmentFocus,
+ TTK_STATE_ALTERNATE| TTK_STATE_FOCUS, 0 },
{ kThemeAdornmentDefault, TTK_STATE_ALTERNATE, 0 },
{ kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 },
{ kThemeAdornmentNone, 0, 0 }
diff --git a/tests/main.test b/tests/main.test
index d37240f..44f2119 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -8,7 +8,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: main.test,v 1.10 2004/12/08 03:03:06 dgp Exp $
+# RCS: @(#) $Id: main.test,v 1.10.2.1 2008/06/25 16:46:12 dgp Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -99,6 +99,30 @@ test main-2.3 {Tk_MainEx: -encoding option} -constraints {
removeFile script
} -result {0 {-enc utf-8 script}}
+test main-3.1 {Tk_ParseArgv: -help option} -constraints unix -body {
+ # Run only on unix as Win32 pops up native dialog
+ list [catch {exec [interpreter] -help} msg] $msg
+} -match glob -result {1 {% Application initialization failed: Command-specific options:*}}
+
+test main-3.2 {Tk_ParseArgv: -help option} -setup {
+ set maininterp [interp create]
+} -body {
+ $maininterp eval { set argc 1 ; set argv -help }
+ list [catch {load {} Tk $maininterp} msg] $msg
+} -cleanup {
+ interp delete $maininterp
+} -match glob -result {1 {Command-specific options:*}}
+
+test main-3.3 {Tk_ParseArgv: -help option} -setup {
+ set maininterp [interp create]
+} -body {
+ # Repeat of 3.2 to catch cleanup, eg Bug 1927135
+ $maininterp eval { set argc 1 ; set argv -help }
+ list [catch {load {} Tk $maininterp} msg] $msg
+} -cleanup {
+ interp delete $maininterp
+} -match glob -result {1 {Command-specific options:*}}
+
# cleanup
cleanupTests
return
diff --git a/tests/winDialog.test b/tests/winDialog.test
index b80274f..fa30df8 100644
--- a/tests/winDialog.test
+++ b/tests/winDialog.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 1998-1999 ActiveState Corporation.
#
-# RCS: @(#) $Id: winDialog.test,v 1.13.2.1 2007/10/27 04:23:17 dgp Exp $
+# RCS: @(#) $Id: winDialog.test,v 1.13.2.2 2008/06/25 16:46:13 dgp Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -57,10 +57,80 @@ proc SetText {button text} {
return [testwinevent $::tk_dialog $button WM_SETTEXT $text]
}
-test winDialog-1.1 {Tk_ChooseColorObjCmd} {nt} {
-} {}
-
-test winDialog-2.1 {ColorDlgHookProc} {nt} {
+test winDialog-1.1.0 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {tk_chooseColor}
+ then {
+ Click cancel
+ }
+} -result {0}
+test winDialog-1.1.1 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
+ then {
+ set x [Click cancel]
+ }
+ list $x $clr
+} -result {0 {}}
+test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933"]}
+ then {
+ set x [Click 1]
+ }
+ list $x $clr
+} -result [list 0 "#ff9933"]
+test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints {
+ testwinevent
+} -body {
+ set x {}
+ start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]}
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(text)]} {lappend x $a(text)}
+ lappend x [Click 1]
+ }
+ lappend x $clr
+} -result [list Hello 0 "#ff9933"]
+test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints {
+ testwinevent
+} -body {
+ set x {}
+ start {
+ set clr [tk_chooseColor -initialcolor "#ff9933" \
+ -title "\u041f\u0440\u0438\u0432\u0435\u0442"]
+ }
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(text)]} {lappend x $a(text)}
+ lappend x [Click 1]
+ }
+ lappend x $clr
+} -result [list "\u041f\u0440\u0438\u0432\u0435\u0442" 0 "#ff9933"]
+test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints {
+ testwinevent
+} -body {
+ start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]}
+ set x {}
+ then {
+ array set a [testgetwindowinfo $::tk_dialog]
+ if {[info exists a(parent)]} {
+ append x [expr {$a(parent) == [wm frame .]}]
+ }
+ Click 1
+ }
+ list $x $clr
+} -result [list 1 "#ff9933"]
+test winDialog-1.1.6 {Tk_ChooseColorObjCmd: -parent} -constraints {
+ testwinevent
+} -body {
+ tk_chooseColor -initialcolor "#ff9933" -parent .xyzzy12
+} -returnCodes error -match glob -result {bad window path name*}
+
+test winDialog-2.1 {ColorDlgHookProc} {emptyTest nt} {
} {}
test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt testwinevent} {
diff --git a/unix/configure b/unix/configure
index 71b4a73..a9bf9b0 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1337,7 +1337,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
TK_VERSION=8.5
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".2"
+TK_PATCH_LEVEL=".3b1"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -6625,14 +6625,27 @@ else
if test "$GCC" = yes; then
- { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
-echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5
+echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
+ esac
else
do64bit_ok=yes
- CFLAGS="$CFLAGS -xarch=amd64"
- LDFLAGS="$LDFLAGS -xarch=amd64"
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
fi
@@ -6648,6 +6661,175 @@ fi
fi
+ #--------------------------------------------------------------------
+ # On Solaris 5.x i386 with the sunpro compiler we need to link
+ # with sunmath to get floating point rounding control
+ #--------------------------------------------------------------------
+ if test "$GCC" = yes; then
+ use_sunmath=no
+else
+
+ arch=`isainfo`
+ echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5
+echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6
+ if test "$arch" = "amd64 i386"; then
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ MATH_LIBS="-lsunmath $MATH_LIBS"
+ if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for sunmath.h" >&5
+echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6
+if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5
+echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking sunmath.h usability" >&5
+echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <sunmath.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sunmath.h presence" >&5
+echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sunmath.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ----------------------------- ##
+## Report this to the tk lists. ##
+## ----------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for sunmath.h" >&5
+echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6
+if test "${ac_cv_header_sunmath_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_sunmath_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5
+echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6
+
+fi
+
+
+ use_sunmath=yes
+
+else
+
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ use_sunmath=no
+
+fi
+
+
+fi
+
+
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
@@ -6662,24 +6844,42 @@ fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "$do64bit_ok" = yes; then
- # We need to specify -static-libgcc or we need to
- # add the path to the sparv9 libgcc.
- SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
- # for finding sparcv9 libgcc, get the regular libgcc
- # path, remove so name and append 'sparcv9'
- #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
- #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ if test "$arch" = "sparcv9 sparc"; then
+
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+
+else
+ if test "$arch" = "amd64 i386"; then
+
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
fi
+fi
+
+
+fi
+
+else
+
+ if test "$use_sunmath" = yes; then
+ textmode=textoff
else
+ textmode=text
+fi
case $system in
SunOS-5.[1-9][0-9]*)
- SHLIB_LD='${CC} -G -z text ${LDFLAGS}';;
+ SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";;
*)
- SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
esac
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
@@ -9398,7 +9598,7 @@ ac_x_header_dirs='
/usr/openwin/share/include'
if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
+ # Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -9406,7 +9606,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9433,7 +9633,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
+ if test -r "$ac_dir/X11/Intrinsic.h"; then
ac_x_includes=$ac_dir
break
fi
@@ -9447,18 +9647,18 @@ if test "$ac_x_libraries" = no; then
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
+ LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
int
main ()
{
-XrmInitialize ()
+XtMalloc (0)
;
return 0;
}
diff --git a/unix/configure.in b/unix/configure.in
index 24b764f..93647b7 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.134.2.16 2008/03/13 20:34:31 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.134.2.17 2008/06/25 16:46:14 dgp Exp $
AC_INIT([tk],[8.5])
AC_PREREQ(2.59)
@@ -27,7 +27,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
TK_VERSION=8.5
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".2"
+TK_PATCH_LEVEL=".3b1"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6270d24..1659a12 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1918,15 +1918,46 @@ dnl AC_CHECK_TOOL(AR, ar)
])
], [AS_IF([test "$arch" = "amd64 i386"], [
AS_IF([test "$GCC" = yes], [
- AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
+ esac
], [
do64bit_ok=yes
- CFLAGS="$CFLAGS -xarch=amd64"
- LDFLAGS="$LDFLAGS -xarch=amd64"
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
])
], [AC_MSG_WARN([64bit mode not supported for $arch])])])
])
-
+
+ #--------------------------------------------------------------------
+ # On Solaris 5.x i386 with the sunpro compiler we need to link
+ # with sunmath to get floating point rounding control
+ #--------------------------------------------------------------------
+ AS_IF([test "$GCC" = yes],[use_sunmath=no],[
+ arch=`isainfo`
+ AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control])
+ AS_IF([test "$arch" = "amd64 i386"], [
+ AC_MSG_RESULT([yes])
+ MATH_LIBS="-lsunmath $MATH_LIBS"
+ AC_CHECK_HEADER(sunmath.h)
+ use_sunmath=yes
+ ], [
+ AC_MSG_RESULT([no])
+ use_sunmath=no
+ ])
+ ])
+
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
@@ -1939,20 +1970,25 @@ dnl AC_CHECK_TOOL(AR, ar)
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
AS_IF([test "$do64bit_ok" = yes], [
- # We need to specify -static-libgcc or we need to
- # add the path to the sparv9 libgcc.
- SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
- # for finding sparcv9 libgcc, get the regular libgcc
- # path, remove so name and append 'sparcv9'
- #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
- #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+ ])])
])
], [
+ AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text])
case $system in
SunOS-5.[[1-9]][[0-9]]*)
- SHLIB_LD='${CC} -G -z text ${LDFLAGS}';;
+ SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";;
*)
- SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
esac
CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
diff --git a/unix/tk.spec b/unix/tk.spec
index 9813b38..70ce873 100644
--- a/unix/tk.spec
+++ b/unix/tk.spec
@@ -1,11 +1,11 @@
-# $Id: tk.spec,v 1.25.2.7 2008/03/07 22:15:13 dgp Exp $
+# $Id: tk.spec,v 1.25.2.8 2008/06/25 16:46:15 dgp Exp $
# This file is the basis for a binary Tk Linux RPM.
%{!?directory:%define directory /usr/local}
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
-Version: 8.5.2
+Version: 8.5.3b1
Release: 2
License: BSD
Group: Development/Languages
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index 5e2c0ca..6a3e3a2 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixKey.c,v 1.12.2.1 2008/03/26 20:09:33 dgp Exp $
+ * RCS: @(#) $Id: tkUnixKey.c,v 1.12.2.2 2008/06/25 16:46:16 dgp Exp $
*/
#include "tkInt.h"
@@ -78,6 +78,48 @@ Tk_SetCaretPos(
/*
*----------------------------------------------------------------------
*
+ * TkpGetChar --
+ *
+ * Convert a keyboard event to a UTF-8 string using XLookupString.
+ *
+ * This is used as a fallback instead of Xutf8LookupString
+ * or XmbLookupString if input methods are turned off
+ * and for KeyRelease events.
+ *
+ * Notes:
+ * XLookupString() normally returns a single ISO Latin 1
+ * or ASCII control character.
+ *
+ *----------------------------------------------------------------------
+ */
+static char *
+TkpGetChar(
+ XEvent *eventPtr, /* KeyPress or KeyRelease event */
+ Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */
+{
+ int len;
+ char buf[TCL_DSTRING_STATIC_SIZE];
+
+ len = XLookupString(&eventPtr->xkey, buf, TCL_DSTRING_STATIC_SIZE, 0, 0);
+ buf[len] = '\0';
+
+ if (len == 1) {
+ len = Tcl_UniCharToUtf((unsigned char)buf[0], Tcl_DStringValue(dsPtr));
+ Tcl_DStringSetLength(dsPtr, len);
+ } else {
+ /*
+ * len > 1 should only happen if someone has called XRebindKeysym().
+ * Assume UTF-8.
+ */
+ Tcl_DStringSetLength(dsPtr, len);
+ strncpy(Tcl_DStringValue(dsPtr), buf, len);
+ }
+ return Tcl_DStringValue(dsPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkpGetString --
*
* Retrieve the UTF string associated with a keyboard event.
@@ -95,11 +137,42 @@ Tk_SetCaretPos(
char *
TkpGetString(
- TkWindow *winPtr, /* Window where event occurred: needed to get
- * input context. */
+ TkWindow *winPtr, /* Window where event occurred */
XEvent *eventPtr, /* X keyboard event. */
- Tcl_DString *dsPtr) /* Uninitialized or empty string to hold
- * result. */
+ Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */
+#ifdef TK_USE_INPUT_METHODS
+#if X_HAVE_UTF8_STRING
+{
+ if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
+ && (winPtr->inputContext != NULL)
+ && (eventPtr->type == KeyPress))
+ {
+ int len;
+ Status status;
+
+ Tcl_DStringSetLength(dsPtr, TCL_DSTRING_STATIC_SIZE-1);
+ len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey,
+ Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),
+ NULL, &status);
+
+ if (status == XBufferOverflow) { /* Expand buffer and try again */
+ Tcl_DStringSetLength(dsPtr, len);
+ len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey,
+ Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr),
+ NULL, &status);
+ }
+ if ((status != XLookupChars) && (status != XLookupBoth)) {
+ Tcl_DStringSetLength(dsPtr, 0);
+ len = 0;
+ }
+ Tcl_DStringSetLength(dsPtr, len);
+
+ return Tcl_DStringValue(dsPtr);
+ } else {
+ return TkpGetChar(eventPtr, dsPtr);
+ }
+}
+#else /* !X_HAVE_UTF8_STRING */
{
int len;
Tcl_DString buf;
@@ -112,7 +185,6 @@ TkpGetString(
Tcl_DStringInit(&buf);
Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1);
-#ifdef TK_USE_INPUT_METHODS
if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
&& (winPtr->inputContext != NULL)
&& (eventPtr->type == KeyPress)) {
@@ -120,6 +192,7 @@ TkpGetString(
len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey,
Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), NULL,
&status);
+
/*
* If the buffer wasn't big enough, grow the buffer and try again.
*/
@@ -132,22 +205,24 @@ TkpGetString(
if ((status != XLookupChars) && (status != XLookupBoth)) {
len = 0;
}
-
} else {
- len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf),
- Tcl_DStringLength(&buf), NULL, NULL);
+ return TkpGetChar(eventPtr, dsPtr);
}
-#else /* TK_USE_INPUT_METHODS */
- len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf),
- Tcl_DStringLength(&buf), NULL, NULL);
-#endif /* TK_USE_INPUT_METHODS */
- Tcl_DStringSetLength(&buf, len);
+ Tcl_DStringSetLength(&buf, len);
Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&buf), len, dsPtr);
Tcl_DStringFree(&buf);
return Tcl_DStringValue(dsPtr);
}
+
+#endif /* X_HAVE_UTF8_STRING */
+#else /* !TK_USE_INPUT_METHODS */
+{
+ return TkpGetChar(eventPtr, dsPtr);
+}
+#endif
+
/*
* When mapping from a keysym to a keycode, need information about the
diff --git a/win/configure b/win/configure
index 5932de2..7e028bf 100755
--- a/win/configure
+++ b/win/configure
@@ -1309,7 +1309,7 @@ SHELL=/bin/sh
TK_VERSION=8.5
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".2"
+TK_PATCH_LEVEL=".3b1"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -4068,14 +4068,14 @@ else
fi
# The wish.exe.manifest requires these
-# TK_WIN_VERSION is the 4 dotted pair Windows version format
-# Make sure the patch level doesn't contain extra dotted pairs (interim rel)
-AB_PATCH_LEVEL="`echo $TK_PATCH_LEVEL | sed -e 's/\..*//'`"
+# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs
+# the release level, and must account for interim release versioning
case "$TK_PATCH_LEVEL" in
- a*) TK_WIN_VERSION="$TK_VERSION.0.`echo $AB_PATCH_LEVEL | tr -d a`" ;;
- b*) TK_WIN_VERSION="$TK_VERSION.1.`echo $AB_PATCH_LEVEL | tr -d b`" ;;
- .*) TK_WIN_VERSION="$TK_VERSION.2$TK_PATCH_LEVEL" ;;
+ *a*) TK_RELEASE_LEVEL=0 ;;
+ *b*) TK_RELEASE_LEVEL=1 ;;
+ *) TK_RELEASE_LEVEL=2 ;;
esac
+TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`"
# X86|AMD64|IA64 for manifest
diff --git a/win/configure.in b/win/configure.in
index 299e081..73e0d05 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -3,7 +3,7 @@
# generate the file "configure", which is run during Tk installation
# to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.66.2.9 2008/03/07 22:15:16 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.66.2.10 2008/06/25 16:46:20 dgp Exp $
AC_INIT(../generic/tk.h)
AC_PREREQ(2.59)
@@ -16,7 +16,7 @@ SHELL=/bin/sh
TK_VERSION=8.5
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=5
-TK_PATCH_LEVEL=".2"
+TK_PATCH_LEVEL=".3b1"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
@@ -230,14 +230,14 @@ else
fi
# The wish.exe.manifest requires these
-# TK_WIN_VERSION is the 4 dotted pair Windows version format
-# Make sure the patch level doesn't contain extra dotted pairs (interim rel)
-AB_PATCH_LEVEL="`echo $TK_PATCH_LEVEL | sed -e 's/\..*//'`"
+# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs
+# the release level, and must account for interim release versioning
case "$TK_PATCH_LEVEL" in
- a*) TK_WIN_VERSION="$TK_VERSION.0.`echo $AB_PATCH_LEVEL | tr -d a`" ;;
- b*) TK_WIN_VERSION="$TK_VERSION.1.`echo $AB_PATCH_LEVEL | tr -d b`" ;;
- .*) TK_WIN_VERSION="$TK_VERSION.2$TK_PATCH_LEVEL" ;;
+ *a*) TK_RELEASE_LEVEL=0 ;;
+ *b*) TK_RELEASE_LEVEL=1 ;;
+ *) TK_RELEASE_LEVEL=2 ;;
esac
+TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`"
AC_SUBST(TK_WIN_VERSION)
# X86|AMD64|IA64 for manifest
AC_SUBST(MACHINE)
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 28a2346..4924bc8 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDialog.c,v 1.44.2.5 2008/02/01 16:09:26 dgp Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.44.2.6 2008/06/25 16:46:20 dgp Exp $
*
*/
@@ -455,13 +455,15 @@ ColorDlgHookProc(
const char *title;
CHOOSECOLOR *ccPtr;
- switch (uMsg) {
+ if (WM_INITDIALOG == uMsg) {
+
/*
* Set the title string of the dialog.
*/
ccPtr = (CHOOSECOLOR *) lParam;
title = (const char *) ccPtr->lCustData;
+
if ((title != NULL) && (title[0] != '\0')) {
Tcl_DString ds;
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index 444094c..60ffe3f 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinTest.c,v 1.12.2.1 2007/09/04 17:44:26 dgp Exp $
+ * RCS: @(#) $Id: tkWinTest.c,v 1.12.2.2 2008/06/25 16:46:20 dgp Exp $
*/
#include "tkWinInt.h"
@@ -466,6 +466,9 @@ TestgetwindowinfoObjCmd(
Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("text", -1));
Tcl_ListObjAppendElement(interp, resObj, textObj);
+ Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("parent", -1));
+ Tcl_ListObjAppendElement(interp, resObj,
+ Tcl_NewLongObj((long)GetParent(hwnd)));
childrenObj = Tcl_NewListObj(0, NULL);
EnumChildWindows(hwnd, EnumChildrenProc, (LPARAM)childrenObj);