diff options
-rw-r--r-- | ChangeLog | 46 | ||||
-rw-r--r-- | generic/tkEntry.c | 10 | ||||
-rw-r--r-- | generic/tkText.c | 4 | ||||
-rw-r--r-- | generic/tkTextBTree.c | 9 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 11 | ||||
-rw-r--r-- | library/text.tcl | 11 | ||||
-rw-r--r-- | macosx/GNUmakefile | 9 | ||||
-rw-r--r-- | macosx/Wish.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 61 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 14 | ||||
-rw-r--r-- | macosx/tkMacOSXEntry.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 11 | ||||
-rw-r--r-- | macosx/tkMacOSXPort.h | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 7 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 31 | ||||
-rwxr-xr-x | unix/configure | 2 | ||||
-rw-r--r-- | unix/tcl.m4 | 382 |
18 files changed, 579 insertions, 44 deletions
@@ -1,3 +1,49 @@ +2006-09-10 Daniel Steffen <das@users.sourceforge.net> + + * macosx/tkMacOSXColor.c (TkSetMacColor, TkpGetColor): use AppearanceMgr + * macosx/tkMacOSXDefault.h: to retrieve platform std colors for text + * macosx/tkMacOSXPort.h: selections, add "systemHighlightSecondary" + color name for standard color of inactive selections, use this color as + default for text widget -inactiveselectbackground to implement platform + standard look for inactive text selections. + + * library/text.tcl (aqua): remove focus bindings to set selection color. + + * generic/tkTextBTree.c (TkTextIsElided): on TkAqua, don't show inactive + * generic/tkTextDisp.c (GetStyle): text selection when text + widget is in disabled state. + + * generic/tkEntry.c (DisplayEntry): change default TkAqua selection + * macosx/tkMacOSXDefault.h: relief to "flat" (platform std). + + * generic/tkText.c (CreateWidget): fix bug leading to default text + selection relief string DEF_TEXT_SELECT_RELIEF being ignored. + + * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): allow mouse + event delivery to background windows with kWindowNoActivatesAttribute + (e.g. overrideredirect windows), as these never come to the foreground + they would not receive any mouse events otherwise. [Bug 1472624] + + * macosx/tkMacOSXWindowEvent.c (TkMacOSXGenerateFocusEvent): do not + send focus events to any windows with kWindowNoActivatesAttribute. + + * macosx/tkMacOSXXStubs.c (XQueryColor, XQueryColors): implement basic + XColor computation from pixel values, enough to make tkImg's window.c + happy, fixes img::window failures reported on tcl-mac. + + * macosx/tkMacOSXMenu.c (DrawMenuEntryLabel): fix leak. [Bug 1554672] + + * macosx/GNUmakefile: workaround bug in 'cp -pRH' on Darwin 6 and + earlier, fixes 'make embedded' failure reported on tcl-mac; fix error + from 'make deploy' with same build tree as previous 'make embedded'. + + * macosx/Wish.xcodeproj/project.pbxproj: add new tclUnixCompat.c file. + + * macosx/tkMacOSXEntry.c (TkpDrawEntryBorderAndFocus): fix typo. + + * unix/tcl.m4: sync with tcl/unix/tcl.m4. + * unix/configure: autoconf-2.59 + 2006-09-06 Jeff Hobbs <jeffh@ActiveState.com> * generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 1d9d084..ff5ef12 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.40 2006/09/06 22:39:28 hobbs Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.41 2006/09/10 17:06:31 das Exp $ */ #include "tkInt.h" @@ -1647,7 +1647,13 @@ DisplayEntry( baseY - fm.ascent - entryPtr->selBorderWidth, (selEndX - selStartX) + 2*entryPtr->selBorderWidth, (fm.ascent + fm.descent) + 2*entryPtr->selBorderWidth, - entryPtr->selBorderWidth, TK_RELIEF_RAISED); + entryPtr->selBorderWidth, +#ifndef MAC_OSX_TK + TK_RELIEF_RAISED +#else + MAC_OSX_ENTRY_SELECT_RELIEF +#endif + ); } } diff --git a/generic/tkText.c b/generic/tkText.c index 56e016f..93b8925 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.69 2006/09/06 22:39:28 hobbs Exp $ + * RCS: @(#) $Id: tkText.c,v 1.70 2006/09/10 17:06:32 das Exp $ */ #include "default.h" @@ -614,7 +614,7 @@ CreateWidget(sharedPtr, tkwin, interp, parent, objc, objv) textPtr->selTagPtr->reliefString = (char *) ckalloc(sizeof(DEF_TEXT_SELECT_RELIEF)); strcpy(textPtr->selTagPtr->reliefString, DEF_TEXT_SELECT_RELIEF); - textPtr->selTagPtr->relief = TK_RELIEF_RAISED; + Tk_GetRelief(interp, DEF_TEXT_SELECT_RELIEF, &(textPtr->selTagPtr->relief)); textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &startIndex); textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex); diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 908a557..95a7fad 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.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: tkTextBTree.c,v 1.21 2006/03/26 17:52:40 vincentdarley Exp $ + * RCS: @(#) $Id: tkTextBTree.c,v 1.22 2006/09/10 17:06:32 das Exp $ */ #include "tkInt.h" @@ -3597,7 +3597,12 @@ TkTextIsElided(textPtr, indexPtr, elideInfo) if ((tagPtr == textPtr->selTagPtr) && !(textPtr->flags & GOT_FOCUS) - && (textPtr->inactiveSelBorder == NULL)) { + && (textPtr->inactiveSelBorder == NULL +#ifdef MAC_OSX_TK + /* Don't show inactive selection in disabled widgets. */ + || textPtr->state == TK_TEXT_STATE_DISABLED +#endif + )) { continue; } infoPtr->elide = infoPtr->tagPtrs[i]->elide; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d330e1d..9dda358 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.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: tkTextDisp.c,v 1.58 2006/03/27 13:43:15 cc_benny Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.59 2006/09/10 17:06:32 das Exp $ */ #include "tkPort.h" @@ -815,12 +815,17 @@ GetStyle( /* * If this is the selection tag, and inactiveSelBorder is NULL (the - * default on Windows and Mac), then we need to skip it if we don't + * default on Windows), then we need to skip it if we don't * have focus. */ if ((tagPtr == textPtr->selTagPtr) && !(textPtr->flags & GOT_FOCUS)) { - if (textPtr->inactiveSelBorder == NULL) { + if (textPtr->inactiveSelBorder == NULL +#ifdef MAC_OSX_TK + /* Don't show inactive selection in disabled widgets. */ + || textPtr->state == TK_TEXT_STATE_DISABLED +#endif + ) { continue; } border = textPtr->inactiveSelBorder; diff --git a/library/text.tcl b/library/text.tcl index 22d96d7..36a15c2 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.40 2005/09/10 14:53:20 das Exp $ +# RCS: @(#) $Id: text.tcl,v 1.41 2006/09/10 17:06:32 das Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -386,16 +386,7 @@ bind Text <Meta-Delete> { # Macintosh only bindings: -# if text black & highlight black -> text white, other text the same if {[tk windowingsystem] eq "aqua"} { -bind Text <FocusIn> { - %W tag configure sel -borderwidth 0 - %W configure -selectbackground systemHighlight -selectforeground systemHighlightText -} -bind Text <FocusOut> { - %W tag configure sel -borderwidth 1 - %W configure -selectbackground white -selectforeground black -} bind Text <Option-Left> { tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index ce9d159..2f88506 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -4,7 +4,7 @@ # uses the standard unix build system in tk/unix (which can be used directly instead of this # if you are not using the tk/macosx projects). # -# RCS: @(#) $Id: GNUmakefile,v 1.5 2006/07/20 06:25:18 das Exp $ +# RCS: @(#) $Id: GNUmakefile,v 1.6 2006/09/10 17:06:32 das Exp $ # ######################################################################################################## @@ -204,6 +204,11 @@ ifeq (${EMBEDDED_BUILD},1) @rm -rf "${INSTALL_ROOT}/${LIBDIR}/Tk.framework" endif ${DO_MAKE} +ifeq (${EMBEDDED_BUILD}_${TK_X11},1_) +# workaround bug with 'cp -pRH' on Darwin 6 and earlier + @if [ "`uname -r | awk -F. '{print $$1}'`" -lt 7 ]; then \ + mkdir -p ${TOP_DIR}/{"${TCL_FMWK_DIR}","${TK_FMWK_DIR}"}/PrivateHeaders; fi +endif ifeq (${INSTALL_BUILD},1) ifeq (${EMBEDDED_BUILD},1) # if we are embedding frameworks, don't install wish @@ -238,7 +243,7 @@ endif ifeq (${TK_X11},) ifeq (${EMBEDDED_BUILD},) # install Wish.app link in APPLICATION_INSTALL_PATH and setup 'Wish Shell' compatibility links - @cd ${TOP_DIR} && if [ -n "${APP_DIR}" ]; then mkdir -p "./${APP_DIR}" && \ + @cd ${TOP_DIR} && if [ -n "${APP_DIR}" ]; then mkdir -p "./${APP_DIR}" && rm -rf "./${APP_DIR}/Wish.app" && \ ln -fsh "./$$(echo ${APP_DIR} | sed -e 's#/[^/][^/]*#/..#g')/${FMWK_DIR}/${PRODUCT_NAME}.framework/Resources/Wish.app" "./${APP_DIR}" && \ ln -fsh Wish.app "./${APP_DIR}/Wish Shell.app"; fi && \ ln -fsh Wish.app "./${TK_FMWK_DIR}/Resources/Wish Shell.app" && \ diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 31ae02d..6ad7390 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -281,6 +281,7 @@ F9EA4AF208FA3BD800B1F5F0 /* tkMacOSXCursors.r in Rez */ = {isa = PBXBuildFile; fileRef = F966BBCC08F27A3B005CB29B /* tkMacOSXCursors.r */; }; F9EA4AF308FA3BDA00B1F5F0 /* tkMacOSXAETE.r in Rez */ = {isa = PBXBuildFile; fileRef = F966BBC408F27A3B005CB29B /* tkMacOSXAETE.r */; }; F9EA4AF408FA3BDB00B1F5F0 /* tkAboutDlg.r in Rez */ = {isa = PBXBuildFile; fileRef = F966BBC108F27A3B005CB29B /* tkAboutDlg.r */; }; + F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -1621,6 +1622,7 @@ F9A3082D08F2D4AB00BAE1AB /* Tk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tk.framework; path = ../Tk.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F9A3084B08F2D4CE00BAE1AB /* Wish.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = Wish.app; path = ../Wish.app; sourceTree = BUILT_PRODUCTS_DIR; }; F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = ../Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixCompat.c; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -3165,6 +3167,7 @@ F96D445D08F272B9004A47F5 /* tclLoadOSF.c */, F96D445E08F272B9004A47F5 /* tclLoadShl.c */, F96D445F08F272B9004A47F5 /* tclUnixChan.c */, + F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */, F96D446008F272B9004A47F5 /* tclUnixEvent.c */, F96D446108F272B9004A47F5 /* tclUnixFCmd.c */, F96D446208F272B9004A47F5 /* tclUnixFile.c */, @@ -3525,6 +3528,7 @@ F96D49AE08F272C4004A47F5 /* tclMacOSXNotify.c in Sources */, F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */, F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */, + F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */, F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */, F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */, F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */, diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 78d80e1..b69354a 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.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: tkMacOSXColor.c,v 1.4 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXColor.c,v 1.5 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" @@ -58,12 +58,36 @@ TkSetMacColor( unsigned long pixel, /* Pixel value to convert. */ RGBColor *macColor) /* Mac color struct to modify. */ { + OSStatus err; + switch (pixel >> 24) { case HIGHLIGHT_PIXEL: - LMGetHiliteRGB(macColor); + err = GetThemeBrushAsColor(kThemeBrushPrimaryHighlightColor, + 32, true, macColor); + if (err != noErr) { + LMGetHiliteRGB(macColor); + } + return true; + case HIGHLIGHT_SECONDARY_PIXEL: + err = GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, + 32, true, macColor); + if (err != noErr) { + LMGetHiliteRGB(macColor); + } + return true; + case HIGHLIGHT_ALTERNATE_PIXEL: + err = GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, + 32, true, macColor); + if (err != noErr) { + LMGetHiliteRGB(macColor); + } return true; case HIGHLIGHT_TEXT_PIXEL: - LMGetHiliteRGB(macColor); + err = GetThemeBrushAsColor(kThemeBrushPrimaryHighlightColor, + 32, true, macColor); + if (err != noErr) { + LMGetHiliteRGB(macColor); + } if ((macColor->red == 0) && (macColor->green == 0) && (macColor->blue == 0)) { macColor->red = macColor->green = macColor->blue = 0xFFFF; @@ -228,16 +252,41 @@ TkpGetColor( * will do all the work. */ if (strncasecmp(name, "system", 6) == 0) { - int foundSystemColor = false; + OSStatus err; + int foundSystemColor = false; RGBColor rgbValue; char pixelCode = 0; if (!strcasecmp(name+6, "Highlight")) { - LMGetHiliteRGB(&rgbValue); + err = GetThemeBrushAsColor(kThemeBrushPrimaryHighlightColor, + 32, true, &rgbValue); + if (err != noErr) { + LMGetHiliteRGB(&rgbValue); + } pixelCode = HIGHLIGHT_PIXEL; foundSystemColor = true; + } else if (!strcasecmp(name+6, "HighlightSecondary")) { + err = GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, + 32, true, &rgbValue); + if (err != noErr) { + LMGetHiliteRGB(&rgbValue); + } + pixelCode = HIGHLIGHT_SECONDARY_PIXEL; + foundSystemColor = true; + } else if (!strcasecmp(name+6, "HighlightAlternate")) { + err = GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, + 32, true, &rgbValue); + if (err != noErr) { + LMGetHiliteRGB(&rgbValue); + } + pixelCode = HIGHLIGHT_ALTERNATE_PIXEL; + foundSystemColor = true; } else if (!strcasecmp(name+6, "HighlightText")) { - LMGetHiliteRGB(&rgbValue); + err = GetThemeBrushAsColor(kThemeBrushPrimaryHighlightColor, + 32, true, &rgbValue); + if (err != noErr) { + LMGetHiliteRGB(&rgbValue); + } if ((rgbValue.red == 0) && (rgbValue.green == 0) && (rgbValue.blue == 0)) { rgbValue.red = rgbValue.green = rgbValue.blue = 0xFFFF; diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index dc8b07d..54f5f66 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.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: tkMacOSXDefault.h,v 1.10 2006/09/06 22:39:28 hobbs Exp $ + * RCS: @(#) $Id: tkMacOSXDefault.h,v 1.11 2006/09/10 17:06:32 das Exp $ */ #ifndef _TKMACDEFAULT @@ -35,6 +35,7 @@ #define ACTIVE_BG "#ececec" #define SELECT_BG "systemHighlight" #define SELECT_FG "systemHighlightText" +#define INACTIVE_SELECT_BG "systemHighlightSecondary" #define TROUGH "#c3c3c3" #define INDICATOR "#b03060" #define DISABLED "#a3a3a3" @@ -146,9 +147,10 @@ * won't get the native widget by default. */ -#define MAC_OSX_FOCUS_WIDTH 3 -#define MAC_OSX_ENTRY_BORDER 2 -#define MAC_OSX_ENTRY_RELEIF TK_RELIEF_SUNKEN +#define MAC_OSX_FOCUS_WIDTH 3 +#define MAC_OSX_ENTRY_BORDER 2 +#define MAC_OSX_ENTRY_RELIEF TK_RELIEF_SUNKEN +#define MAC_OSX_ENTRY_SELECT_RELIEF TK_RELIEF_FLAT #define DEF_ENTRY_BG_COLOR NORMAL_BG #define DEF_ENTRY_BG_MONO WHITE @@ -511,14 +513,14 @@ #define DEF_TEXT_PADX "1" #define DEF_TEXT_PADY "1" #define DEF_TEXT_RELIEF "flat" -#define DEF_TEXT_INACTIVE_SELECT_COLOR NULL +#define DEF_TEXT_INACTIVE_SELECT_COLOR INACTIVE_SELECT_BG #define DEF_TEXT_SELECT_COLOR SELECT_BG #define DEF_TEXT_SELECT_MONO BLACK #define DEF_TEXT_SELECT_BD_COLOR "1" #define DEF_TEXT_SELECT_BD_MONO "0" #define DEF_TEXT_SELECT_FG_COLOR SELECT_FG #define DEF_TEXT_SELECT_FG_MONO WHITE -#define DEF_TEXT_SELECT_RELIEF "solid" +#define DEF_TEXT_SELECT_RELIEF "flat" #define DEF_TEXT_SET_GRID "0" #define DEF_TEXT_SPACING1 "0" #define DEF_TEXT_SPACING2 "0" diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c index c8f047a..bc9a181 100644 --- a/macosx/tkMacOSXEntry.c +++ b/macosx/tkMacOSXEntry.c @@ -50,7 +50,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXEntry.c,v 1.6 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXEntry.c,v 1.7 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" @@ -161,7 +161,7 @@ TkpDrawEntryBorderAndFocus(Entry *entryPtr, Drawable d, int isSpinbox) if (entryPtr->borderWidth != MAC_OSX_ENTRY_BORDER || entryPtr->highlightWidth != MAC_OSX_FOCUS_WIDTH - ||entryPtr->relief != MAC_OSX_ENTRY_RELEIF) { + || entryPtr->relief != MAC_OSX_ENTRY_RELIEF) { return 0; } diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 8ac888d..d16d23c 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.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: tkMacOSXMenu.c,v 1.31 2006/08/18 07:47:10 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.32 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" @@ -3561,6 +3561,7 @@ DrawMenuEntryLabel( Tcl_DStringLength(&itemTextDString), leftEdge, baseline); */ + Tcl_DStringFree(&convertedTextDString); Tcl_DStringFree(&itemTextDString); } } diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 2f9e4ba..0fc3473 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -54,10 +54,11 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.24 2006/08/18 07:47:11 das Exp $ + * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.25 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" +#include "tkMacOSXWm.h" #include "tkMacOSXEvent.h" #include "tkMacOSXDebug.h" @@ -315,7 +316,13 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr) */ if ((result = HandleWindowTitlebarMouseDown(medPtr, tkwin)) != -1) { return result; - } else { + } else + /* + * Only windows with the kWindowNoActivatesAttribute can + * receive mouse events in the background. + */ + if (!(((TkWindow *)tkwin)->wmInfoPtr->attributes & + kWindowNoActivatesAttribute)) { /* * Allow background window dragging & growing with Command down */ diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index cfabc15..ef276b6 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.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: tkMacOSXPort.h,v 1.8 2006/03/13 18:19:18 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXPort.h,v 1.9 2006/09/10 17:06:32 das Exp $ */ #ifndef _TKMACPORT @@ -189,7 +189,9 @@ extern int strncasecmp _ANSI_ARGS_((CONST char *s1, */ #define HIGHLIGHT_PIXEL 31 +#define HIGHLIGHT_SECONDARY_PIXEL 32 #define HIGHLIGHT_TEXT_PIXEL 33 +#define HIGHLIGHT_ALTERNATE_PIXEL 34 #define CONTROL_TEXT_PIXEL 35 #define CONTROL_BODY_PIXEL 37 #define CONTROL_FRAME_PIXEL 39 diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index ee56ffc..6547f38 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.15 2006/07/24 04:45:23 das Exp $ + * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.16 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" @@ -467,10 +467,11 @@ TkMacOSXGenerateFocusEvent( /* * Don't send focus events to windows of class help or to - * overrideredirect windows. + * windows with the kWindowNoActivatesAttribute. */ if (((TkWindow *)tkwin)->wmInfoPtr->macClass == kHelpWindowClass || - Tk_Attributes(tkwin)->override_redirect) { + ((TkWindow *)tkwin)->wmInfoPtr->attributes & + kWindowNoActivatesAttribute) { return false; } diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index a556531..ab81fb3 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.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: tkMacOSXXStubs.c,v 1.15 2006/03/24 14:58:01 das Exp $ + * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.16 2006/09/10 17:06:32 das Exp $ */ #include "tkMacOSXInt.h" @@ -656,6 +656,19 @@ XQueryColor( Colormap colormap, XColor* def_in_out) { + unsigned long p; + unsigned char r, g, b; + XColor *d = def_in_out; + + p = d->pixel; + r = (p & 0x00FF0000) >> 16; + g = (p & 0x0000FF00) >> 8; + b = (p & 0x000000FF); + d->red = (r << 8) | r; + d->green = (g << 8) | g; + d->blue = (b << 8) | b; + d->flags = DoRed|DoGreen|DoBlue; + d->pad = 0; } void @@ -665,6 +678,22 @@ XQueryColors( XColor* defs_in_out, int ncolors) { + int i; + unsigned long p; + unsigned char r, g, b; + XColor *d = defs_in_out; + + for (i = 0; i < ncolors; i++, d++) { + p = d->pixel; + r = (p & 0x00FF0000) >> 16; + g = (p & 0x0000FF00) >> 8; + b = (p & 0x000000FF); + d->red = (r << 8) | r; + d->green = (g << 8) | g; + d->blue = (b << 8) | b; + d->flags = DoRed|DoGreen|DoBlue; + d->pad = 0; + } } int diff --git a/unix/configure b/unix/configure index 93e19e5..bed4016 100755 --- a/unix/configure +++ b/unix/configure @@ -8203,7 +8203,7 @@ echo "$as_me: WARNING: Aqua requires Mac OS X 10.2 or later" >&2;} echo "$as_me:$LINENO: result: $tk_aqua" >&5 echo "${ECHO_T}$tk_aqua" >&6 # remove 64-bit arch flags from CFLAGS for combined 32-bit and 64-bit fat - # builds as neither TkAqua nor TkX11 can be built for 64-bit at present. + # builds, as neither TkAqua nor TkX11 can be built for 64-bit at present. test "$fat_32_64" = yes && \ CFLAGS="`echo "$CFLAGS " | sed -e 's/-arch ppc64 / /g' -e 's/-arch x86_64 / /g'`" if test $tk_aqua = no; then diff --git a/unix/tcl.m4 b/unix/tcl.m4 index e1ef439..6f67011 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2785,6 +2785,388 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[ fi ]) +#-------------------------------------------------------------------- +# SC_TCL_GETHOSTBYADDR_R +# +# Check if we have MT-safe variant of gethostbyaddr(). +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETHOSTBYADDR_R +# HAVE_GETHOSTBYADDR_R_7 +# HAVE_GETHOSTBYADDR_R_8 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [ + AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [ + AC_TRY_COMPILE([ + #include <netdb.h> + ], [ + char *addr; + int length; + int type; + struct hostent *result; + char buffer[2048]; + int buflen = 2048; + int h_errnop; + + (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, + &h_errnop); + ], tcl_cv_api_gethostbyaddr_r_7=yes, tcl_cv_api_gethostbyaddr_r_7=no)]) + tcl_ok=$tcl_cv_api_gethostbyaddr_r_7 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, + [Define to 1 if gethostbyaddr_r takes 7 args.]) + else + AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [ + AC_TRY_COMPILE([ + #include <netdb.h> + ], [ + char *addr; + int length; + int type; + struct hostent *result, *resultp; + char buffer[2048]; + int buflen = 2048; + int h_errnop; + + (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen, + &resultp, &h_errnop); + ], tcl_cv_api_gethostbyaddr_r_8=yes, tcl_cv_api_gethostbyaddr_r_8=no)]) + tcl_ok=$tcl_cv_api_gethostbyaddr_r_8 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, + [Define to 1 if gethostbyaddr_r takes 8 args.]) + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1, + [Define to 1 if gethostbyaddr_r is available.]) + fi +])]) + +#-------------------------------------------------------------------- +# SC_TCL_GETHOSTBYNAME_R +# +# Check to see what variant of gethostbyname_r() we have. +# Based on David Arnold's example from the comp.programming.threads +# FAQ Q213 +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETHOSTBYADDR_R +# HAVE_GETHOSTBYADDR_R_3 +# HAVE_GETHOSTBYADDR_R_5 +# HAVE_GETHOSTBYADDR_R_6 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [ + AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [ + AC_TRY_COMPILE([ + #include <netdb.h> + ], [ + char *name; + struct hostent *he, *res; + char buffer[2048]; + int buflen = 2048; + int h_errnop; + + (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop); + ], tcl_cv_api_gethostbyname_r_6=yes, tcl_cv_api_gethostbyname_r_6=no)]) + tcl_ok=$tcl_cv_api_gethostbyname_r_6 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, + [Define to 1 if gethostbyname_r takes 6 args.]) + else + AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [ + AC_TRY_COMPILE([ + #include <netdb.h> + ], [ + char *name; + struct hostent *he; + char buffer[2048]; + int buflen = 2048; + int h_errnop; + + (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop); + ], tcl_cv_api_gethostbyname_r_5=yes, tcl_cv_api_gethostbyname_r_5=no)]) + tcl_ok=$tcl_cv_api_gethostbyname_r_5 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, + [Define to 1 if gethostbyname_r takes 5 args.]) + else + AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [ + AC_TRY_COMPILE([ + #include <netdb.h> + ], [ + char *name; + struct hostent *he; + struct hostent_data data; + + (void) gethostbyname_r(name, he, &data); + ], tcl_cv_api_gethostbyname_r_3=yes, tcl_cv_api_gethostbyname_r_3=no)]) + tcl_ok=$tcl_cv_api_gethostbyname_r_3 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, + [Define to 1 if gethostbyname_r takes 3 args.]) + fi + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, + [Define to 1 if gethostbyname_r is available.]) + fi +])]) + +#-------------------------------------------------------------------- +# SC_TCL_GETPWUID_R +# +# Check if we have MT-safe variant of getpwuid() and if yes, +# which one exactly. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETPWUID_R +# HAVE_GETPWUID_R_4 +# HAVE_GETPWUID_R_5 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [ + AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <pwd.h> + ], [ + uid_t uid; + struct passwd pw, *pwp; + char buf[512]; + int buflen = 512; + + (void) getpwuid_r(uid, &pw, buf, buflen, &pwp); + ], tcl_cv_api_getpwuid_r_5=yes, tcl_cv_api_getpwuid_r_5=no)]) + tcl_ok=$tcl_cv_api_getpwuid_r_5 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWUID_R_5, 1, + [Define to 1 if getpwuid_r takes 5 args.]) + else + AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <pwd.h> + ], [ + uid_t uid; + struct passwd pw; + char buf[512]; + int buflen = 512; + + (void)getpwnam_r(uid, &pw, buf, buflen); + ], tcl_cv_api_getpwuid_r_4=yes, tcl_cv_api_getpwuid_r_4=no)]) + tcl_ok=$tcl_cv_api_getpwuid_r_4 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWUID_R_4, 1, + [Define to 1 if getpwuid_r takes 4 args.]) + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWUID_R, 1, + [Define to 1 if getpwuid_r is available.]) + fi +])]) + +#-------------------------------------------------------------------- +# SC_TCL_GETPWNAM_R +# +# Check if we have MT-safe variant of getpwnam() and if yes, +# which one exactly. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETPWNAM_R +# HAVE_GETPWNAM_R_4 +# HAVE_GETPWNAM_R_5 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [ + AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <pwd.h> + ], [ + char *name; + struct passwd pw, *pwp; + char buf[512]; + int buflen = 512; + + (void) getpwnam_r(name, &pw, buf, buflen, &pwp); + ], tcl_cv_api_getpwnam_r_5=yes, tcl_cv_api_getpwnam_r_5=no)]) + tcl_ok=$tcl_cv_api_getpwnam_r_5 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWNAM_R_5, 1, + [Define to 1 if getpwnam_r takes 5 args.]) + else + AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <pwd.h> + ], [ + char *name; + struct passwd pw; + char buf[512]; + int buflen = 512; + + (void)getpwnam_r(name, &pw, buf, buflen); + ], tcl_cv_api_getpwnam_r_4=yes, tcl_cv_api_getpwnam_r_4=no)]) + tcl_ok=$tcl_cv_api_getpwnam_r_4 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWNAM_R_4, 1, + [Define to 1 if getpwnam_r takes 4 args.]) + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETPWNAM_R, 1, + [Define to 1 if getpwnam_r is available.]) + fi +])]) + +#-------------------------------------------------------------------- +# SC_TCL_GETGRGID_R +# +# Check if we have MT-safe variant of getgrgid() and if yes, +# which one exactly. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETGRGID_R +# HAVE_GETGRGID_R_4 +# HAVE_GETGRGID_R_5 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [ + AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <grp.h> + ], [ + gid_t gid; + struct group gr, *grp; + char buf[512]; + int buflen = 512; + + (void) getgrgid_r(gid, &gr, buf, buflen, &grp); + ], tcl_cv_api_getgrgid_r_5=yes, tcl_cv_api_getgrgid_r_5=no)]) + tcl_ok=$tcl_cv_api_getgrgid_r_5 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRGID_R_5, 1, + [Define to 1 if getgrgid_r takes 5 args.]) + else + AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <grp.h> + ], [ + gid_t gid; + struct group gr; + char buf[512]; + int buflen = 512; + + (void)getgrgid_r(gid, &gr, buf, buflen); + ], tcl_cv_api_getgrgid_r_4=yes, tcl_cv_api_getgrgid_r_4=no)]) + tcl_ok=$tcl_cv_api_getgrgid_r_4 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRGID_R_4, 1, + [Define to 1 if getgrgid_r takes 4 args.]) + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRGID_R, 1, + [Define to 1 if getgrgid_r is available.]) + fi +])]) + +#-------------------------------------------------------------------- +# SC_TCL_GETGRNAM_R +# +# Check if we have MT-safe variant of getgrnam() and if yes, +# which one exactly. +# +# Arguments: +# None +# +# Results: +# +# Might define the following vars: +# HAVE_GETGRNAM_R +# HAVE_GETGRNAM_R_4 +# HAVE_GETGRNAM_R_5 +# +#-------------------------------------------------------------------- + +AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [ + AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <grp.h> + ], [ + char *name; + struct group gr, *grp; + char buf[512]; + int buflen = 512; + + (void) getgrnam_r(name, &gr, buf, buflen, &grp); + ], tcl_cv_api_getgrnam_r_5=yes, tcl_cv_api_getgrnam_r_5=no)]) + tcl_ok=$tcl_cv_api_getgrnam_r_5 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRNAM_R_5, 1, + [Define to 1 if getgrnam_r takes 5 args.]) + else + AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <grp.h> + ], [ + char *name; + struct group gr; + char buf[512]; + int buflen = 512; + + (void)getgrnam_r(name, &gr, buf, buflen); + ], tcl_cv_api_getgrnam_r_4=yes, tcl_cv_api_getgrnam_r_4=no)]) + tcl_ok=$tcl_cv_api_getgrnam_r_4 + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRNAM_R_4, 1, + [Define to 1 if getgrnam_r takes 4 args.]) + fi + fi + if test "$tcl_ok" = yes; then + AC_DEFINE(HAVE_GETGRNAM_R, 1, + [Define to 1 if getgrnam_r is available.]) + fi +])]) # Local Variables: # mode: autoconf |