diff options
Diffstat (limited to 'mac')
43 files changed, 740 insertions, 350 deletions
diff --git a/mac/MW_TkHeader.pch b/mac/MW_TkHeader.pch index a049f62..5cf03fb 100644 --- a/mac/MW_TkHeader.pch +++ b/mac/MW_TkHeader.pch @@ -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. * - * SCCS: @(#) MW_TkHeader.pch 1.29 98/02/18 16:23:13 + * RCS: @(#) $Id: MW_TkHeader.pch,v 1.1.4.2 1998/09/30 02:17:58 stanton Exp $ */ /* @@ -1,11 +1,14 @@ Tk 8.1 for Macintosh -by Ray Johnson and Jim Ingham -Sun Microsystems Laboratories -rjohnson@eng.sun.com -jim.ingham@sun.com +by Ray Johnson +Scriptics Corporation +rjohnson@scriptics.com +with major help from +Jim Ingham +Cygnus Solutions +jingham@cygnus.com -SCCS: @(#) README 1.33 98/02/18 11:23:12 +RCS: @(#) $Id: README,v 1.1.4.2 1998/09/30 02:17:59 stanton Exp $ 1. Introduction --------------- @@ -93,10 +96,16 @@ mactk-source-8.1.sea.hqx are included. However, you must already have the More Files package to compile this code. +UNIX Tar file distribution. + The standard Tcl/Tk source distribution has Mac project files + in it. Be warned that the Tk project file is lacking one minor + change compared to the ones in the installers listed above + having to do with locking down the MDEF resource. + 5. Documentation ---------------- -Two books are currently available for Tcl. Both provide a good +There are now many books available for Tcl. These two provide a good introduction to the language. It is a good way to get started if you haven't used the language before: @@ -110,6 +119,9 @@ if you haven't used the language before: Publisher: Prentice Hall ISBN: 0-13-182007-9 +More books are listed at + http://www.scriptics.com/resource/doc/books/ + The "doc" subdirectory contains reference in documentation in the "man" format found on most UNIX machines. Unfortunately, there is not a suitable way to view these pages on the Macintosh. @@ -118,7 +130,7 @@ developed. We are working are having better documentation for the Macintosh platform in the future. However, if you have WWW access you may access the Man pages at the following URL: - http://sunscript.sun.com/man/tcl8.0/contents.html + http://www.scriptics.com/man/tcl8.0/contents.html Other documentation and sample Tcl scripts can be found at the Tcl ftp site: @@ -135,7 +147,7 @@ available (see below). In order to compile Macintosh Tk you must have the following items: - CodeWarrior Pro 2 or higher + CodeWarrior Pro 3 or higher Mac Tcl 8.1 (source) (which requires More Files 1.4.2 or 1.4.3) Mac Tk 8.1 (source) @@ -150,13 +162,8 @@ Special notes: * Check out the file bugs.doc for information about known bugs. * We are starting to support the new Appearance Manager that shipped - with MacOS 8. wm iconify uses it, and the coloring of the - backgrounds of radiobuttons & checkbuttons now works under - Appearance. Tk correctly checks the Gestalt for Appearance, so you - do not have to install it on your target machines. However, you do - have to have the header and stub files to build it. These come with - CWPro 2, and are also available now from Apple. - + with MacOS 8.0. The Tk 8.0.3 release is the first Tk release + that supports the Appearance Manager well. 7. About Dialog --------------- @@ -251,4 +258,4 @@ future. If you have comments or Bug reports send them to: Jim Ingham -jingham@eng.sun.com +jingham@cygnus.com diff --git a/mac/bugs.doc b/mac/bugs.doc index 5e5a3e8..d51afc8 100644 --- a/mac/bugs.doc +++ b/mac/bugs.doc @@ -4,7 +4,7 @@ by Ray Johnson Sun Microsystems Laboratories rjohnson@eng.sun.com -SCCS: @(#) bugs.doc 1.11 98/02/18 13:24:41 +RCS: @(#) $Id: bugs.doc,v 1.1.4.2 1998/09/30 02:17:59 stanton Exp $ We are now very close to passing the test suite for Tk. We are very interested in finding remaining bugs that still linger. Please let us diff --git a/mac/tclets.tcl b/mac/tclets.tcl index c8726a8..764a307 100644 --- a/mac/tclets.tcl +++ b/mac/tclets.tcl @@ -7,7 +7,7 @@ # into a copy of a stub application (the user can pick). The file is placed into the # TEXT resource named "tclshrc" which is automatically executed on startup. # -# SCCS: @(#) tclets.tcl 1.2 97/08/15 09:25:56 +# RCS: @(#) $Id: tclets.tcl,v 1.1.4.1 1998/09/30 02:18:00 stanton Exp $ # # Copyright (c) 1997 Sun Microsystems, Inc. # diff --git a/mac/tkMac.h b/mac/tkMac.h index 87c005a..7633a03 100644 --- a/mac/tkMac.h +++ b/mac/tkMac.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. * - * SCCS: %Z% %M% %I% %E% %U% + * RCS: @(#) $Id: tkMac.h,v 1.1.4.2 1998/09/30 02:18:00 stanton Exp $ */ #ifndef _TKMAC @@ -73,6 +73,8 @@ EXTERN int TkMacConvertTkEvent _ANSI_ARGS_((EventRecord *eventPtr, EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); EXTERN void TkMacInvalClipRgns _ANSI_ARGS_((TkWindow *winPtr)); +EXTERN int TkMacHaveAppearance _ANSI_ARGS_((void)); +EXTERN GWorldPtr TkMacGetDrawablePort _ANSI_ARGS_((Drawable drawable)); #pragma export reset diff --git a/mac/tkMacAppInit.c b/mac/tkMacAppInit.c index 226127f..c254835 100644 --- a/mac/tkMacAppInit.c +++ b/mac/tkMacAppInit.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. * - * SCCS: @(#) tkMacAppInit.c 1.36 97/11/07 21:20:46 + * RCS: @(#) $Id: tkMacAppInit.c,v 1.1.4.2 1998/09/30 02:18:01 stanton Exp $ */ #include <Gestalt.h> @@ -18,6 +18,7 @@ #include <Dialogs.h> #include <SegLoad.h> #include <Traps.h> +#include <Appearance.h> #include "tk.h" #include "tkInt.h" @@ -221,6 +222,17 @@ MacintoshInit() */ tcl_macQdPtr = &qd; + /* + * If appearance is present, then register Tk as an Appearance client + * This means that the mapping from non-Appearance to Appearance cdefs + * will be done for Tk regardless of the setting in the Appearance + * control panel. + */ + + if (TkMacHaveAppearance()) { + RegisterAppearanceClient(); + } + InitGraf(&tcl_macQdPtr->thePort); InitFonts(); InitWindows(); diff --git a/mac/tkMacApplication.r b/mac/tkMacApplication.r index 365035d..715d609 100644 --- a/mac/tkMacApplication.r +++ b/mac/tkMacApplication.r @@ -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. * - * SCCS: @(#) tkMacApplication.r 1.3 97/11/03 17:16:24 + * RCS: @(#) $Id: tkMacApplication.r,v 1.1.4.1 1998/09/30 02:18:01 stanton Exp $ */ #include <Types.r> diff --git a/mac/tkMacBitmap.c b/mac/tkMacBitmap.c index 6571d43..26c55ef 100644 --- a/mac/tkMacBitmap.c +++ b/mac/tkMacBitmap.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. * - * SCCS: @(#) tkMacBitmap.c 1.7 98/01/22 17:00:58 + * RCS: @(#) $Id: tkMacBitmap.c,v 1.1.4.2 1998/09/30 02:18:02 stanton Exp $ */ #include "tkPort.h" diff --git a/mac/tkMacButton.c b/mac/tkMacButton.c index 287c2ef..40114ca 100644 --- a/mac/tkMacButton.c +++ b/mac/tkMacButton.c @@ -2,14 +2,14 @@ * tkMacButton.c -- * * This file implements the Macintosh specific portion of the - * button widgets. + * button widgets. * * Copyright (c) 1996-1997 by Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tkMacButton.c 1.20 98/02/18 10:48:42 + * RCS: @(#) $Id: tkMacButton.c,v 1.1.4.2 1998/09/30 02:18:02 stanton Exp $ */ #include "tkButton.h" @@ -18,6 +18,9 @@ #include <LowMem.h> #include <Appearance.h> + +#include <ToolUtils.h> + /* * Some defines used to control what type of control is drawn. */ @@ -25,6 +28,7 @@ #define DRAW_LABEL 0 /* Labels are treated genericly. */ #define DRAW_CONTROL 1 /* Draw using the Native control. */ #define DRAW_CUSTOM 2 /* Make our own button drawing. */ +#define DRAW_BEVEL 3 /* * The following structures are used to draw our controls. Rather than @@ -38,6 +42,21 @@ static CWindowRecord windowRecord; static ControlRef buttonHandle; static ControlRef checkHandle; static ControlRef radioHandle; +static ControlRef smallBevelHandle; +static ControlRef smallStickyBevelHandle; +static ControlRef medBevelHandle; +static ControlRef medStickyBevelHandle; +static ControlRef largeBevelHandle; +static ControlRef largeStickyBevelHandle; + +/* + * These are used to store the image content for + * beveled buttons - i.e. buttons with images. + */ + +static ControlButtonContentInfo bevelButtonContent; +static OpenCPicParams picParams; + static CCTabHandle buttonTabHandle; static CCTabHandle checkTabHandle; static CCTabHandle radioTabHandle; @@ -66,13 +85,17 @@ static pascal void UserPaneBackgroundProc(ControlHandle, */ static int UpdateControlColors _ANSI_ARGS_((TkButton *butPtr, - ControlRef controlHandle, CCTabHandle ccTabHandle, - RGBColor *saveColorPtr)); + ControlRef controlHandle, CCTabHandle ccTabHandle, + RGBColor *saveColorPtr)); static void DrawBufferedControl _ANSI_ARGS_((TkButton *butPtr, - GWorldPtr destPort)); + GWorldPtr destPort, GC gc, Pixmap pixmap)); +static void InitSampleControls(); +static void SetupBevelButton _ANSI_ARGS_((TkButton *butPtr, + ControlRef controlHandle, + GWorldPtr destPort, GC gc, Pixmap pixmap)); static void ChangeBackgroundWindowColor _ANSI_ARGS_(( - WindowRef macintoshWindow, RGBColor rgbColor, - RGBColor *oldColor)); + WindowRef macintoshWindow, RGBColor rgbColor, + RGBColor *oldColor)); static void ButtonExitProc _ANSI_ARGS_((ClientData clientData)); /* @@ -143,6 +166,7 @@ TkpDisplayButton( * it is an image button, so we offset the * image to make the button appear to move * up and down as the relief changes. */ + int hasImageOrBitmap; CGrafPtr saveWorld; GDHandle saveDevice; GWorldPtr destPort; @@ -155,6 +179,19 @@ TkpDisplayButton( return; } + /* + * In order to avoid screen flashes, this procedure redraws + * the button in a pixmap, then copies the pixmap to the + * screen in a single operation. This means that there's no + * point in time where the on-sreen image has been cleared. + */ + + pixmap = Tk_GetPixmap(butPtr->display, Tk_WindowId(tkwin), + Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); + + hasImageOrBitmap = ((butPtr->image != NULL) || (butPtr->bitmap != None)); + offset = (butPtr->type == TYPE_BUTTON) && hasImageOrBitmap; + border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; @@ -165,6 +202,7 @@ TkpDisplayButton( } else { gc = butPtr->normalTextGC; } + if ((butPtr->flags & SELECTED) && (butPtr->state != STATE_ACTIVE) && (butPtr->selectBorder != NULL) && !butPtr->indicatorOn) { border = butPtr->selectBorder; @@ -173,62 +211,91 @@ TkpDisplayButton( /* * Override the relief specified for the button if this is a * checkbutton or radiobutton and there's no indicator. + * However, don't do this in the presence of Appearance, since + * then the bevel button will take care of the relief. */ relief = butPtr->relief; - if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) { - relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN + + if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) { + if (!TkMacHaveAppearance() || !hasImageOrBitmap) { + relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED; + } } - offset = ((butPtr->type == TYPE_BUTTON) && - ((butPtr->image != NULL) || (butPtr->bitmap != None))); - - /* - * In order to avoid screen flashes, this procedure redraws - * the button in a pixmap, then copies the pixmap to the - * screen in a single operation. This means that there's no - * point in time where the on-sreen image has been cleared. - */ - - pixmap = Tk_GetPixmap(butPtr->display, Tk_WindowId(tkwin), - Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); /* * See the comment in UpdateControlColors as to why we use the * highlightbackground for the border of Macintosh buttons. */ if (butPtr->type == TYPE_BUTTON) { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } if (butPtr->type == TYPE_LABEL) { drawType = DRAW_LABEL; } else if (butPtr->type == TYPE_BUTTON) { - if ((butPtr->image == None) && (butPtr->bitmap == None)) { + if (!hasImageOrBitmap) { drawType = DRAW_CONTROL; + } else if (butPtr->image != None) { + drawType = DRAW_BEVEL; } else { - drawType = DRAW_CUSTOM; + /* + * TO DO - The current way the we draw bitmaps (XCopyPlane) + * uses CopyDeepMask in this one case. The Picture recording + * does not record this call, and so we can't use the + * Appearance bevel button here. The only case that would + * exercise this is if you use a bitmap, with + * -data & -mask specified. We should probably draw the + * appearance button and overprint the image in this case. + * This just punts and draws the old-style, ugly, button. + */ + + if (gc->clip_mask == 0) { + drawType = DRAW_BEVEL; + } else { + TkpClipMask *clipPtr = (TkpClipMask*) gc->clip_mask; + if ((clipPtr->type == TKP_CLIP_PIXMAP) && + (clipPtr->value.pixmap != butPtr->bitmap)) { + drawType = DRAW_CUSTOM; + } else { + drawType = DRAW_BEVEL; + } + } } } else { if (butPtr->indicatorOn) { drawType = DRAW_CONTROL; + } else if (hasImageOrBitmap) { + if (gc->clip_mask == 0) { + drawType = DRAW_BEVEL; + } else { + TkpClipMask *clipPtr = (TkpClipMask*) gc->clip_mask; + if ((clipPtr->type == TKP_CLIP_PIXMAP) && + (clipPtr->value.pixmap != butPtr->bitmap)) { + drawType = DRAW_CUSTOM; + } else { + drawType = DRAW_BEVEL; + } + } } else { drawType = DRAW_CUSTOM; } } /* - * Draw the native portion of the buttons. Start by creating the control + * Draw the native portion of the buttons. Start by creating the control * if it doesn't already exist. Then configure the Macintosh control from * the Tk info. Finally, we call Draw1Control to draw to the screen. */ - if (drawType == DRAW_CONTROL) { + if ((drawType == DRAW_CONTROL) || + ((drawType == DRAW_BEVEL) && TkMacHaveAppearance())) { borderWidth = 0; /* @@ -238,7 +305,7 @@ TkpDisplayButton( destPort = TkMacGetDrawablePort(pixmap); SetGWorld(destPort, NULL); - DrawBufferedControl(butPtr, destPort); + DrawBufferedControl(butPtr, destPort, gc, pixmap); } if ((drawType == DRAW_CUSTOM) || (drawType == DRAW_LABEL)) { @@ -246,10 +313,14 @@ TkpDisplayButton( } /* - * Display image or bitmap or text for button. + * Display image or bitmap or text for button. This has + * already been done under Appearance with the Bevel + * button types. */ - if (butPtr->image != None) { + if ((drawType == DRAW_BEVEL) && TkMacHaveAppearance()) { + /* Empty Body */ + } else if (butPtr->image != None) { Tk_SizeOfImage(butPtr->image, &width, &height); imageOrBitmap: @@ -298,7 +369,7 @@ TkpDisplayButton( /* * If the button is disabled with a stipple rather than a special - * foreground color, generate the stippled effect. If the widget + * foreground color, generate the stippled effect. If the widget * is selected and we use a different background color when selected, * must temporarily modify the GC. */ @@ -371,28 +442,11 @@ TkpComputeButtonGeometry( int width, height, avgWidth; Tk_FontMetrics fm; - if (butPtr->highlightWidth < 0) { - butPtr->highlightWidth = 0; - } - if ((butPtr->type == TYPE_BUTTON) && (butPtr->image == None) - && (butPtr->bitmap == None)) { - butPtr->inset = 0; - } else if ((butPtr->type != TYPE_LABEL) && butPtr->indicatorOn) { - butPtr->inset = 0; - } else { - butPtr->inset = butPtr->borderWidth; - } /* - * The highlight width corresponds to the default ring on the Macintosh. - * As such, the highlight width is only added if the button is the default - * button. The actual width of the default ring is one less than the - * highlight width as there is also one pixel of spacing. + * First figure out the size of the contents of the button. */ - - if (butPtr->defaultState != DEFAULT_DISABLED) { - butPtr->inset += butPtr->highlightWidth; - } + butPtr->indicatorSpace = 0; if (butPtr->image != NULL) { Tk_SizeOfImage(butPtr->image, &width, &height); @@ -417,7 +471,7 @@ TkpComputeButtonGeometry( } else { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, - Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, + Tcl_GetString(butPtr->text), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); width = butPtr->textWidth; @@ -441,21 +495,87 @@ TkpComputeButtonGeometry( } /* + * Now figure out the size of the border decorations for the button. + */ + + if (butPtr->highlightWidth < 0) { + butPtr->highlightWidth = 0; + } + + /* + * The width and height calculation for Appearance buttons with images & + * non-Appearance buttons with images is different. In the latter case, + * we add the borderwidth to the inset, since we are going to stamp a + * 3-D border over the image. In the former, we add it to the height, + * directly, since Appearance will draw the border as part of our control. + * * When issuing the geometry request, add extra space for the indicator, * if any, and for the border and padding, plus if this is an image two * extra pixels so the display can be offset by 1 pixel in either * direction for the raised or lowered effect. + * + * The highlight width corresponds to the default ring on the Macintosh. + * As such, the highlight width is only added if the button is the default + * button. The actual width of the default ring is one less than the + * highlight width as there is also one pixel of spacing. + * Appearance buttons with images do not have a highlight ring, because the + * Bevel button type does not support one. */ - if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { + if ((butPtr->image == None) && (butPtr->bitmap == None)) { width += 2*butPtr->padX; height += 2*butPtr->padY; } - if ((butPtr->type == TYPE_BUTTON) && - ((butPtr->image != NULL) || (butPtr->bitmap != None))) { - width += 2; - height += 2; + + if ((butPtr->type == TYPE_BUTTON)) { + if ((butPtr->image == None) && (butPtr->bitmap == None)) { + butPtr->inset = 0; + if (butPtr->defaultState != STATE_DISABLED) { + butPtr->inset += butPtr->highlightWidth; + } + } else if (TkMacHaveAppearance()) { + butPtr->inset = 0; + width += (2 * butPtr->borderWidth + 4); + height += (2 * butPtr->borderWidth + 4); + } else { + butPtr->inset = butPtr->borderWidth; + width += 2; + height += 2; + if (butPtr->defaultState != STATE_DISABLED) { + butPtr->inset += butPtr->highlightWidth; + } + } + } else if ((butPtr->type != TYPE_LABEL)) { + if (butPtr->indicatorOn) { + butPtr->inset = 0; + } else { + /* + * Under Appearance, the Checkbutton or radiobutton with an image + * is represented by a BevelButton with the Sticky defProc... + * So we must set its height in the same way as the Button + * with an image or bitmap. + */ + if (((butPtr->image != None) || (butPtr->bitmap != None)) + && TkMacHaveAppearance()) { + int border; + butPtr->inset = 0; + if ( butPtr->borderWidth <= 2 ) { + border = 6; + } else { + border = 2 * butPtr->borderWidth + 2; + } + width += border; + height += border; + } else { + butPtr->inset = butPtr->borderWidth; + } + } + } else { + butPtr->inset = butPtr->borderWidth; } + + + Tk_GeometryRequest(butPtr->tkwin, (int) (width + butPtr->indicatorSpace + 2*butPtr->inset), (int) (height + 2*butPtr->inset)); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); @@ -507,131 +627,33 @@ TkpDestroyButton( static void DrawBufferedControl( TkButton *butPtr, /* Tk button. */ - GWorldPtr destPort) /* Off screen GWorld. */ + GWorldPtr destPort, /* Off screen GWorld. */ + GC gc, /* The GC we are drawing into - needed for + * the bevel button */ + Pixmap pixmap /* The pixmap we are drawing into - needed + for the bevel button */ + ) { ControlRef controlHandle; CCTabHandle ccTabHandle; int windowColorChanged = false; RGBColor saveBackColor; - + int isBevel = 0; + if (windowRef == NULL) { - Rect geometry = {0, 0, 10, 10}; - CWindowPeek windowList; - - /* - * Create a dummy window that we can draw to. We will - * actually replace this window's bitmap with the one - * we want to draw to at a later time. This window and - * the data structures attached to it are only deallocated - * on exit of the application. - */ - - windowRef = NewCWindow(NULL, &geometry, "\pempty", false, - zoomDocProc, (WindowRef) -1, true, 0); - if (windowRef == NULL) { - panic("Can't allocate buffer window."); - } - - /* - * Now add the three standard controls to hidden window. We - * only create one of each and reuse them for every widget in - * Tk. - * Under Appearance, we have to embed the controls in a UserPane - * control, so that we can color the background text in - * radiobuttons and checkbuttons. - */ - - SetPort(windowRef); - - if (TkMacHaveAppearance()) { - - OSErr err; - ControlRef dontCare; - - /* Adding UserPaneBackgroundProcs to the root control does - * not seem to work, so we have to add another UserPane to - * the root control. - */ - - err = CreateRootControl(windowRef, &dontCare); - if (err != noErr) { - panic("Can't create root control in DrawBufferedControl"); - } - - userPaneHandle = NewControl(windowRef, &geometry, "\p", - true, kControlSupportsEmbedding|kControlHasSpecialBackground, - 0, 1, kControlUserPaneProc, (SInt32) 5); - SetUserPaneSetUpSpecialBackgroundProc(userPaneHandle, - UserPaneBackgroundProc); - SetUserPaneDrawProc(userPaneHandle, UserPaneDraw); - - buttonHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, kControlPushButtonProc, (SInt32) 6); - EmbedControl(buttonHandle, userPaneHandle); - checkHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, kControlCheckBoxProc, (SInt32) 7); - EmbedControl(checkHandle, userPaneHandle); - radioHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, kControlRadioButtonProc, (SInt32) 8); - EmbedControl(radioHandle, userPaneHandle); - ((CWindowPeek) windowRef)->visible = true; - } else { - buttonHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, pushButProc, (SInt32) 0); - checkHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, checkBoxProc, (SInt32) 0); - radioHandle = NewControl(windowRef, &geometry, "\p", - false, 1, 0, 1, radioButProc, (SInt32) 0); - ((CWindowPeek) windowRef)->visible = true; - - buttonTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); - checkTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); - radioTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); - } - - /* - * Remove our window from the window list. This way our - * applications and others will not be confused that this - * window exists - but no one knows about it. - */ - - windowList = (CWindowPeek) LMGetWindowList(); - if (windowList == (CWindowPeek) windowRef) { - LMSetWindowList((WindowRef) windowList->nextWindow); - } else { - while ((windowList != NULL) - && (windowList->nextWindow != (CWindowPeek) windowRef)) { - windowList = windowList->nextWindow; - } - if (windowList != NULL) { - windowList->nextWindow = windowList->nextWindow->nextWindow; - } - } - ((CWindowPeek) windowRef)->nextWindow = NULL; - - /* - * Create an exit handler to clean up this mess if we our - * unloaded etc. We need to remember the windows portPixMap - * so it isn't leaked. - * - * TODO: The ButtonExitProc doesn't currently work and the - * code it includes will crash the Mac on exit from Tk. - - oldPixPtr = ((CWindowPeek) windowRef)->port.portPixMap; - Tcl_CreateExitHandler(ButtonExitProc, (ClientData) NULL); - */ + InitSampleControls(); } /* * Now swap in the passed in GWorld for the portBits of our fake - * window. We also adjust various fields in the WindowRecord to make + * window. We also adjust various fields in the WindowRecord to make * the system think this is a normal window. * Note, we can use DrawControlInCurrentPort under Appearance, so we don't * need to swap pixmaps. */ if (!TkMacHaveAppearance()) { - ((CWindowPeek) windowRef)->port.portPixMap = destPort->portPixMap; + ((CWindowPeek) windowRef)->port.portPixMap = destPort->portPixMap; } ((CWindowPeek) windowRef)->port.portRect = destPort->portRect; @@ -643,30 +665,90 @@ DrawBufferedControl( /* * Set up control in hidden window to match what we need - * to draw in the buffered window. + * to draw in the buffered window. */ - + + isBevel = 0; switch (butPtr->type) { case TYPE_BUTTON: - controlHandle = buttonHandle; - ccTabHandle = buttonTabHandle; + if (TkMacHaveAppearance()) { + if ((butPtr->image == None) && (butPtr->bitmap == None)) { + controlHandle = buttonHandle; + ccTabHandle = buttonTabHandle; + } else { + if (butPtr->borderWidth <= 2) { + controlHandle = smallBevelHandle; + } else if (butPtr->borderWidth == 3) { + controlHandle = medBevelHandle; + } else { + controlHandle = largeBevelHandle; + } + ccTabHandle = buttonTabHandle; + SetupBevelButton(butPtr, controlHandle, destPort, + gc, pixmap); + isBevel = 1; + } + } else { + controlHandle = buttonHandle; + ccTabHandle = buttonTabHandle; + } break; case TYPE_RADIO_BUTTON: - controlHandle = radioHandle; - ccTabHandle = radioTabHandle; + if (TkMacHaveAppearance()) { + if (((butPtr->image == None) && (butPtr->bitmap == None)) + || (butPtr->indicatorOn)) { + controlHandle = radioHandle; + ccTabHandle = radioTabHandle; + } else { + if (butPtr->borderWidth <= 2) { + controlHandle = smallStickyBevelHandle; + } else if (butPtr->borderWidth == 3) { + controlHandle = medStickyBevelHandle; + } else { + controlHandle = largeStickyBevelHandle; + } + ccTabHandle = radioTabHandle; + SetupBevelButton(butPtr, controlHandle, destPort, + gc, pixmap); + isBevel = 1; + } + } else { + controlHandle = radioHandle; + ccTabHandle = radioTabHandle; + } break; case TYPE_CHECK_BUTTON: - controlHandle = checkHandle; - ccTabHandle = checkTabHandle; + if (TkMacHaveAppearance()) { + if (((butPtr->image == None) && (butPtr->bitmap == None)) + || (butPtr->indicatorOn)) { + controlHandle = checkHandle; + ccTabHandle = checkTabHandle; + } else { + if (butPtr->borderWidth <= 2) { + controlHandle = smallStickyBevelHandle; + } else if (butPtr->borderWidth == 3) { + controlHandle = medStickyBevelHandle; + } else { + controlHandle = largeStickyBevelHandle; + } + ccTabHandle = checkTabHandle; + SetupBevelButton(butPtr, controlHandle, destPort, + gc, pixmap); + isBevel = 1; + } + } else { + controlHandle = checkHandle; + ccTabHandle = checkTabHandle; + } break; } (**controlHandle).contrlRect.left = butPtr->inset; (**controlHandle).contrlRect.top = butPtr->inset; (**controlHandle).contrlRect.right = Tk_Width(butPtr->tkwin) - - butPtr->inset; + - butPtr->inset; (**controlHandle).contrlRect.bottom = Tk_Height(butPtr->tkwin) - - butPtr->inset; + - butPtr->inset; /* * Setting the control visibility by hand does not @@ -674,16 +756,16 @@ DrawBufferedControl( */ if (TkMacHaveAppearance()) { - SetControlVisibility(controlHandle, true, false); - (**userPaneHandle).contrlRect.left = 0; - (**userPaneHandle).contrlRect.top = 0; - (**userPaneHandle).contrlRect.right = Tk_Width(butPtr->tkwin); - (**userPaneHandle).contrlRect.bottom = Tk_Height(butPtr->tkwin); - } else { - (**controlHandle).contrlVis = 255; - } + SetControlVisibility(controlHandle, true, false); + (**userPaneHandle).contrlRect.left = 0; + (**userPaneHandle).contrlRect.top = 0; + (**userPaneHandle).contrlRect.right = Tk_Width(butPtr->tkwin); + (**userPaneHandle).contrlRect.bottom = Tk_Height(butPtr->tkwin); + } else { + (**controlHandle).contrlVis = 255; + } - + if (butPtr->flags & SELECTED) { (**controlHandle).contrlValue = 1; @@ -692,16 +774,20 @@ DrawBufferedControl( } if (butPtr->state == STATE_ACTIVE) { - switch (butPtr->type) { - case TYPE_BUTTON: - (**controlHandle).contrlHilite = kControlButtonPart; - break; - case TYPE_RADIO_BUTTON: - (**controlHandle).contrlHilite = kControlRadioButtonPart; - break; - case TYPE_CHECK_BUTTON: - (**controlHandle).contrlHilite = kControlCheckBoxPart; - break; + if (isBevel) { + (**controlHandle).contrlHilite = kControlButtonPart; + } else { + switch (butPtr->type) { + case TYPE_BUTTON: + (**controlHandle).contrlHilite = kControlButtonPart; + break; + case TYPE_RADIO_BUTTON: + (**controlHandle).contrlHilite = kControlRadioButtonPart; + break; + case TYPE_CHECK_BUTTON: + (**controlHandle).contrlHilite = kControlCheckBoxPart; + break; + } } } else if (butPtr->state == STATE_DISABLED) { (**controlHandle).contrlHilite = kControlInactivePart; @@ -729,36 +815,36 @@ DrawBufferedControl( */ if (TkMacHaveAppearance()) { - SetPort((GrafPort *) destPort); + SetPort((GrafPort *) destPort); } else { - SetPort(windowRef); + SetPort(windowRef); } windowColorChanged = UpdateControlColors(butPtr, controlHandle, - ccTabHandle, &saveBackColor); + ccTabHandle, &saveBackColor); if ((butPtr->type == TYPE_BUTTON) && TkMacHaveAppearance()) { - Boolean isDefault; - - if (butPtr->defaultState == DEFAULT_ACTIVE) { + Boolean isDefault; + + if (butPtr->defaultState == STATE_ACTIVE) { isDefault = true; } else { isDefault = false; } SetControlData(controlHandle, kControlNoPart, - kControlPushButtonDefaultTag, - sizeof(isDefault), (Ptr) &isDefault); + kControlPushButtonDefaultTag, + sizeof(isDefault), (Ptr) &isDefault); } if (TkMacHaveAppearance()) { - DrawControlInCurrentPort(userPaneHandle); + DrawControlInCurrentPort(userPaneHandle); } else { - Draw1Control(controlHandle); + Draw1Control(controlHandle); } if (!TkMacHaveAppearance() && - (butPtr->type == TYPE_BUTTON) && - (butPtr->defaultState == DEFAULT_ACTIVE)) { + (butPtr->type == TYPE_BUTTON) && + (butPtr->defaultState == STATE_ACTIVE)) { Rect box = (**controlHandle).contrlRect; RGBColor rgbColor; @@ -780,21 +866,304 @@ DrawBufferedControl( */ if (TkMacHaveAppearance()) { - SetControlVisibility(controlHandle, false, false); - } else { - (**controlHandle).contrlVis = 0; - } + SetControlVisibility(controlHandle, false, false); + if (isBevel) { + KillPicture(bevelButtonContent.u.picture); + } + } else { + (**controlHandle).contrlVis = 0; + } LMSetWindowList((WindowRef) ((CWindowPeek) windowRef)->nextWindow); } /* *-------------------------------------------------------------- * + * InitSampleControls -- + * + * This function initializes a dummy Macintosh window and + * sample controls to allow drawing Mac controls to any GWorld + * (including off-screen bitmaps). + * + * Results: + * None. + * + * Side effects: + * Controls & a window are created. + * + *-------------------------------------------------------------- + */ + +static void +InitSampleControls() +{ + Rect geometry = {0, 0, 10, 10}; + CWindowPeek windowList; + + /* + * Create a dummy window that we can draw to. We will + * actually replace this window's bitmap with the one + * we want to draw to at a later time. This window and + * the data structures attached to it are only deallocated + * on exit of the application. + */ + + windowRef = NewCWindow(NULL, &geometry, "\pempty", false, + zoomDocProc, (WindowRef) -1, true, 0); + if (windowRef == NULL) { + panic("Can't allocate buffer window."); + } + + /* + * Now add the three standard controls to hidden window. We + * only create one of each and reuse them for every widget in + * Tk. + * Under Appearance, we have to embed the controls in a UserPane + * control, so that we can color the background text in + * radiobuttons and checkbuttons. + */ + + SetPort(windowRef); + + if (TkMacHaveAppearance()) { + + OSErr err; + ControlRef dontCare; + + /* Adding UserPaneBackgroundProcs to the root control does + * not seem to work, so we have to add another UserPane to + * the root control. + */ + + err = CreateRootControl(windowRef, &dontCare); + if (err != noErr) { + panic("Can't create root control in DrawBufferedControl"); + } + + userPaneHandle = NewControl(windowRef, &geometry, "\p", + true, kControlSupportsEmbedding|kControlHasSpecialBackground, + 0, 1, kControlUserPaneProc, (SInt32) 0); + SetUserPaneSetUpSpecialBackgroundProc(userPaneHandle, + UserPaneBackgroundProc); + SetUserPaneDrawProc(userPaneHandle, UserPaneDraw); + + buttonHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, kControlPushButtonProc, (SInt32) 0); + EmbedControl(buttonHandle, userPaneHandle); + checkHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, kControlCheckBoxProc, (SInt32) 0); + EmbedControl(checkHandle, userPaneHandle); + radioHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, kControlRadioButtonProc, (SInt32) 0); + EmbedControl(radioHandle, userPaneHandle); + smallBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + kControlBehaviorOffsetContents << 16 + | kControlContentPictHandle, + kControlBevelButtonSmallBevelProc, (SInt32) 0); + EmbedControl(smallBevelHandle, userPaneHandle); + medBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + kControlBehaviorOffsetContents << 16 + | kControlContentPictHandle, + kControlBevelButtonNormalBevelProc, (SInt32) 0); + EmbedControl(medBevelHandle, userPaneHandle); + largeBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + kControlBehaviorOffsetContents << 16 + | kControlContentPictHandle, + kControlBevelButtonLargeBevelProc, (SInt32) 0); + EmbedControl(largeBevelHandle, userPaneHandle); + bevelButtonContent.contentType = kControlContentPictHandle; + smallStickyBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + (kControlBehaviorOffsetContents + | kControlBehaviorSticky) << 16 + | kControlContentPictHandle, + kControlBevelButtonSmallBevelProc, (SInt32) 0); + EmbedControl(smallStickyBevelHandle, userPaneHandle); + medStickyBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + (kControlBehaviorOffsetContents + | kControlBehaviorSticky) << 16 + | kControlContentPictHandle, + kControlBevelButtonNormalBevelProc, (SInt32) 0); + EmbedControl(medStickyBevelHandle, userPaneHandle); + largeStickyBevelHandle = NewControl(windowRef, &geometry, "\p", + false, 0, 0, + (kControlBehaviorOffsetContents + | kControlBehaviorSticky) << 16 + | kControlContentPictHandle, + kControlBevelButtonLargeBevelProc, (SInt32) 0); + EmbedControl(largeStickyBevelHandle, userPaneHandle); + + picParams.version = -2; + picParams.hRes = 0x00480000; + picParams.vRes = 0x00480000; + picParams.srcRect.top = 0; + picParams.srcRect.left = 0; + + ((CWindowPeek) windowRef)->visible = true; + } else { + buttonHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, pushButProc, (SInt32) 0); + checkHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, checkBoxProc, (SInt32) 0); + radioHandle = NewControl(windowRef, &geometry, "\p", + false, 1, 0, 1, radioButProc, (SInt32) 0); + ((CWindowPeek) windowRef)->visible = true; + + buttonTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); + checkTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); + radioTabHandle = (CCTabHandle) NewHandle(sizeof(CtlCTab)); + } + + /* + * Remove our window from the window list. This way our + * applications and others will not be confused that this + * window exists - but no one knows about it. + */ + + windowList = (CWindowPeek) LMGetWindowList(); + if (windowList == (CWindowPeek) windowRef) { + LMSetWindowList((WindowRef) windowList->nextWindow); + } else { + while ((windowList != NULL) + && (windowList->nextWindow != (CWindowPeek) windowRef)) { + windowList = windowList->nextWindow; + } + if (windowList != NULL) { + windowList->nextWindow = windowList->nextWindow->nextWindow; + } + } + ((CWindowPeek) windowRef)->nextWindow = NULL; + + /* + * Create an exit handler to clean up this mess if we our + * unloaded etc. We need to remember the windows portPixMap + * so it isn't leaked. + * + * TODO: The ButtonExitProc doesn't currently work and the + * code it includes will crash the Mac on exit from Tk. + + oldPixPtr = ((CWindowPeek) windowRef)->port.portPixMap; + Tcl_CreateExitHandler(ButtonExitProc, (ClientData) NULL); + */ + +} + +/* + *-------------------------------------------------------------- + * + * SetupBevelButton -- + * + * Sets up the Bevel Button with image by copying the + * source image onto the PicHandle for the button. + * + * Results: + * None + * + * Side effects: + * The image or bitmap for the button is copied over to a picture. + * + *-------------------------------------------------------------- + */ +void +SetupBevelButton( + TkButton *butPtr, /* Tk button. */ + ControlRef controlHandle, /* The control to set this picture to */ + GWorldPtr destPort, /* Off screen GWorld. */ + GC gc, /* The GC we are drawing into - needed for + * the bevel button */ + Pixmap pixmap /* The pixmap we are drawing into - needed + for the bevel button */ + ) +{ + int height, width; + ControlButtonGraphicAlignment theAlignment; + + SetPort((GrafPtr) destPort); + + if (butPtr->image != None) { + Tk_SizeOfImage(butPtr->image, + &width, &height); + } else { + Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, + &width, &height); + } + + if ((butPtr->width > 0) && (butPtr->width < width)) { + width = butPtr->width; + } + if ((butPtr->height > 0) && (butPtr->height < height)) { + height = butPtr->height; + } + + picParams.srcRect.right = width; + picParams.srcRect.bottom = height; + + bevelButtonContent.u.picture = OpenCPicture(&picParams); + + /* + * TO DO - There is one case where XCopyPlane calls CopyDeepMask, + * which does not get recorded in the picture. So the bitmap code + * will fail in that case. + */ + + if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { + Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height, + pixmap, 0, 0); + } else if (butPtr->image != NULL) { + Tk_RedrawImage(butPtr->image, 0, 0, width, + height, pixmap, 0, 0); + } else { + XSetClipOrigin(butPtr->display, gc, 0, 0); + XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0, + (unsigned int) width, (unsigned int) height, 0, 0, 1); + } + + ClosePicture(); + + SetControlData(controlHandle, kControlButtonPart, + kControlBevelButtonContentTag, + sizeof(ControlButtonContentInfo), + (char *) &bevelButtonContent); + + if (butPtr->anchor == TK_ANCHOR_N) { + theAlignment = kControlBevelButtonAlignTop; + } else if (butPtr->anchor == TK_ANCHOR_NE) { + theAlignment = kControlBevelButtonAlignTopRight; + } else if (butPtr->anchor == TK_ANCHOR_E) { + theAlignment = kControlBevelButtonAlignRight; + } else if (butPtr->anchor == TK_ANCHOR_SE) { + theAlignment = kControlBevelButtonAlignBottomRight; + } else if (butPtr->anchor == TK_ANCHOR_S) { + theAlignment = kControlBevelButtonAlignBottom; + } else if (butPtr->anchor == TK_ANCHOR_SW) { + theAlignment = kControlBevelButtonAlignBottomLeft; + } else if (butPtr->anchor == TK_ANCHOR_W) { + theAlignment = kControlBevelButtonAlignLeft; + } else if (butPtr->anchor == TK_ANCHOR_NW) { + theAlignment = kControlBevelButtonAlignTopLeft; + } else if (butPtr->anchor == TK_ANCHOR_CENTER) { + theAlignment = kControlBevelButtonAlignCenter; + } + + SetControlData(controlHandle, kControlButtonPart, + kControlBevelButtonGraphicAlignTag, + sizeof(ControlButtonGraphicAlignment), + (char *) &theAlignment); + +} + +/* + *-------------------------------------------------------------- + * * SetUserPaneDrawProc -- * * Utility function to add a UserPaneDrawProc - * to a userPane control. From MoreControls code - * from Apple DTS. + * to a userPane control. From MoreControls code + * from Apple DTS. * * Results: * MacOS system error. @@ -805,15 +1174,15 @@ DrawBufferedControl( *-------------------------------------------------------------- */ pascal OSErr SetUserPaneDrawProc ( - ControlRef control, - ControlUserPaneDrawProcPtr upp) + ControlRef control, + ControlUserPaneDrawProcPtr upp) { ControlUserPaneDrawUPP myControlUserPaneDrawUPP; myControlUserPaneDrawUPP = NewControlUserPaneDrawProc(upp); return SetControlData (control, - kControlNoPart, kControlUserPaneDrawProcTag, - sizeof(myControlUserPaneDrawUPP), - (Ptr) &myControlUserPaneDrawUPP); + kControlNoPart, kControlUserPaneDrawProcTag, + sizeof(myControlUserPaneDrawUPP), + (Ptr) &myControlUserPaneDrawUPP); } /* @@ -822,7 +1191,7 @@ pascal OSErr SetUserPaneDrawProc ( * SetUserPaneSetUpSpecialBackgroundProc -- * * Utility function to add a UserPaneBackgroundProc - * to a userPane control + * to a userPane control * * Results: * MacOS system error. @@ -840,9 +1209,9 @@ SetUserPaneSetUpSpecialBackgroundProc( ControlUserPaneBackgroundUPP myControlUserPaneBackgroundUPP; myControlUserPaneBackgroundUPP = NewControlUserPaneBackgroundProc(upp); return SetControlData (control, kControlNoPart, - kControlUserPaneBackgroundProcTag, - sizeof(myControlUserPaneBackgroundUPP), - (Ptr) &myControlUserPaneBackgroundUPP); + kControlUserPaneBackgroundProcTag, + sizeof(myControlUserPaneBackgroundUPP), + (Ptr) &myControlUserPaneBackgroundUPP); } /* @@ -851,7 +1220,7 @@ SetUserPaneSetUpSpecialBackgroundProc( * UserPaneDraw -- * * This function draws the background of the user pane that will - * lie under checkboxes and radiobuttons. + * lie under checkboxes and radiobuttons. * * Results: * None. @@ -866,9 +1235,9 @@ UserPaneDraw( ControlRef control, ControlPartCode cpc) { - Rect contrlRect = (**control).contrlRect; - RGBBackColor (&gUserPaneBackground); - EraseRect (&contrlRect); + Rect contrlRect = (**control).contrlRect; + RGBBackColor (&gUserPaneBackground); + EraseRect (&contrlRect); } /* @@ -877,7 +1246,7 @@ UserPaneDraw( * UserPaneBackgroundProc -- * * This function sets up the background of the user pane that will - * lie under checkboxes and radiobuttons. + * lie under checkboxes and radiobuttons. * * Results: * None. @@ -894,7 +1263,7 @@ UserPaneBackgroundProc( ControlBackgroundPtr info) { if (info->colorDevice) { - RGBBackColor (&gUserPaneBackground); + RGBBackColor (&gUserPaneBackground); } } @@ -908,8 +1277,8 @@ UserPaneBackgroundProc( * used we create a custom palette for the button, populate * with the colors for the button and install the palette. * - * Under Appearance, we just set the pointer that will be - * used by the UserPaneDrawProc. + * Under Appearance, we just set the pointer that will be + * used by the UserPaneDrawProc. * * Results: * None. @@ -932,7 +1301,7 @@ UpdateControlColors( /* * Under Appearance we cannot change the background of the * button itself. However, the color we are setting is the color - * of the containing userPane. This will be the color that peeks + * of the containing userPane. This will be the color that peeks * around the rounded corners of the button. * We make this the highlightbackground rather than the background, * because if you color the background of a frame containing a @@ -941,38 +1310,39 @@ UpdateControlColors( */ if (TkMacHaveAppearance() && (butPtr->type == TYPE_BUTTON)) { - xcolor = Tk_3DBorderColor(butPtr->highlightBorder); + xcolor = Tk_3DBorderColor(butPtr->highlightBorder); } else { - xcolor = Tk_3DBorderColor(butPtr->normalBorder); + xcolor = Tk_3DBorderColor(butPtr->normalBorder); } if (TkMacHaveAppearance()) { - TkSetMacColor(xcolor->pixel, &gUserPaneBackground); - } else { - (**ccTabHandle).ccSeed = 0; - (**ccTabHandle).ccRider = 0; - (**ccTabHandle).ctSize = 3; - (**ccTabHandle).ctTable[0].value = cBodyColor; - TkSetMacColor(xcolor->pixel, - &(**ccTabHandle).ctTable[0].rgb); - (**ccTabHandle).ctTable[1].value = cTextColor; - TkSetMacColor(butPtr->normalFg->pixel, - &(**ccTabHandle).ctTable[1].rgb); - (**ccTabHandle).ctTable[2].value = cFrameColor; - TkSetMacColor(butPtr->highlightColorPtr->pixel, - &(**ccTabHandle).ctTable[2].rgb); - SetControlColor(controlHandle, ccTabHandle); - if (((xcolor->pixel >> 24) != CONTROL_BODY_PIXEL) && - ((butPtr->type == TYPE_CHECK_BUTTON) || - (butPtr->type == TYPE_RADIO_BUTTON))) { - RGBColor newColor; + TkSetMacColor(xcolor->pixel, &gUserPaneBackground); + } else { + (**ccTabHandle).ccSeed = 0; + (**ccTabHandle).ccRider = 0; + (**ccTabHandle).ctSize = 3; + (**ccTabHandle).ctTable[0].value = cBodyColor; + TkSetMacColor(xcolor->pixel, + &(**ccTabHandle).ctTable[0].rgb); + (**ccTabHandle).ctTable[1].value = cTextColor; + TkSetMacColor(butPtr->normalFg->pixel, + &(**ccTabHandle).ctTable[1].rgb); + (**ccTabHandle).ctTable[2].value = cFrameColor; + TkSetMacColor(butPtr->highlightColorPtr->pixel, + &(**ccTabHandle).ctTable[2].rgb); + SetControlColor(controlHandle, ccTabHandle); + + if (((xcolor->pixel >> 24) != CONTROL_BODY_PIXEL) && + ((butPtr->type == TYPE_CHECK_BUTTON) || + (butPtr->type == TYPE_RADIO_BUTTON))) { + RGBColor newColor; TkSetMacColor(xcolor->pixel, &newColor); ChangeBackgroundWindowColor((**controlHandle).contrlOwner, newColor, saveColorPtr); - return true; + return true; } } - + return false; } @@ -983,7 +1353,7 @@ UpdateControlColors( * * This procedure will change the background color entry * in the Window's colortable. The system isn't notified - * of the change. This call should only be used to fool + * of the change. This call should only be used to fool * the drawing routines for checkboxes and radiobuttons. * Any change should be temporary and be reverted after * the widget is drawn. @@ -1057,7 +1427,7 @@ ButtonExitProc(clientData) /* * Restore our dummy window to it's origional state by putting it - * back in the window list and restoring it's bits. The destroy + * back in the window list and restoring it's bits. The destroy * the controls and window. */ diff --git a/mac/tkMacClipboard.c b/mac/tkMacClipboard.c index 1ae497c..e681125 100644 --- a/mac/tkMacClipboard.c +++ b/mac/tkMacClipboard.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. * - * SCCS: @(#) tkMacClipboard.c 1.19 97/11/07 21:21:42 + * RCS: @(#) $Id: tkMacClipboard.c,v 1.1.4.2 1998/09/30 02:18:03 stanton Exp $ */ #include "tkInt.h" diff --git a/mac/tkMacColor.c b/mac/tkMacColor.c index 56fe38d..35fc4ab 100644 --- a/mac/tkMacColor.c +++ b/mac/tkMacColor.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. * - * SCCS: @(#) tkMacColor.c 1.36 96/11/25 11:02:12 + * RCS: @(#) $Id: tkMacColor.c,v 1.1.4.1 1998/09/30 02:18:03 stanton Exp $ */ #include <tkColor.h> diff --git a/mac/tkMacConfig.c b/mac/tkMacConfig.c index 83da6cf..59bb91a 100644 --- a/mac/tkMacConfig.c +++ b/mac/tkMacConfig.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. * - * SCCS: @(#) tkMacConfig.c 1.3 97/10/08 10:07:55 + * RCS: @(#) $Id: tkMacConfig.c,v 1.1.2.2 1998/09/30 02:18:04 stanton Exp $ */ #include "tk.h" diff --git a/mac/tkMacCursor.c b/mac/tkMacCursor.c index 3f34434..6a2b228 100644 --- a/mac/tkMacCursor.c +++ b/mac/tkMacCursor.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. * - * SCCS: @(#) tkMacCursor.c 1.24 98/01/22 17:00:29 + * RCS: @(#) $Id: tkMacCursor.c,v 1.1.4.2 1998/09/30 02:18:04 stanton Exp $ */ #include "tkPort.h" diff --git a/mac/tkMacCursors.r b/mac/tkMacCursors.r index 44ad02e..016eba4 100644 --- a/mac/tkMacCursors.r +++ b/mac/tkMacCursors.r @@ -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. * - * SCCS: @(#) tkMacCursors.r 1.3 96/01/25 10:24:15 + * RCS: @(#) $Id: tkMacCursors.r,v 1.1.4.1 1998/09/30 02:18:04 stanton Exp $ */ /* diff --git a/mac/tkMacDefault.h b/mac/tkMacDefault.h index da574fd..29fc14c 100644 --- a/mac/tkMacDefault.h +++ b/mac/tkMacDefault.h @@ -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. * - * SCCS: @(#) tkMacDefault.h 1.49 98/01/08 13:18:41 + * RCS: @(#) $Id: tkMacDefault.h,v 1.1.4.2 1998/09/30 02:18:05 stanton Exp $ */ #ifndef _TKMACDEFAULT diff --git a/mac/tkMacDialog.c b/mac/tkMacDialog.c index e1031d9..6f40831 100644 --- a/mac/tkMacDialog.c +++ b/mac/tkMacDialog.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. * - * SCCS: @(#) tkMacDialog.c 1.20 97/11/07 21:23:36 + * RCS: @(#) $Id: tkMacDialog.c,v 1.1.4.2 1998/09/30 02:18:05 stanton Exp $ */ #include <Gestalt.h> diff --git a/mac/tkMacDraw.c b/mac/tkMacDraw.c index 9624041..5935d12 100644 --- a/mac/tkMacDraw.c +++ b/mac/tkMacDraw.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. * - * SCCS: @(#) tkMacDraw.c 1.55 97/11/20 18:28:56 + * RCS: @(#) $Id: tkMacDraw.c,v 1.1.4.1 1998/09/30 02:18:06 stanton Exp $ */ #include "tkInt.h" diff --git a/mac/tkMacEmbed.c b/mac/tkMacEmbed.c index 21e4803..58c6716 100644 --- a/mac/tkMacEmbed.c +++ b/mac/tkMacEmbed.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. * - * SCCS: @(#) tkMacEmbed.c 1.8 97/12/03 18:56:10 + * RCS: @(#) $Id: tkMacEmbed.c,v 1.1.4.2 1998/09/30 02:18:06 stanton Exp $ */ #include "tkInt.h" diff --git a/mac/tkMacFont.c b/mac/tkMacFont.c index 616034e..4cd088b 100644 --- a/mac/tkMacFont.c +++ b/mac/tkMacFont.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. * - * SCCS: @(#) tkMacFont.c 1.54 97/11/26 10:51:12 + * RCS: @(#) $Id: tkMacFont.c,v 1.1.4.2 1998/09/30 02:18:07 stanton Exp $ */ #include <Windows.h> diff --git a/mac/tkMacHLEvents.c b/mac/tkMacHLEvents.c index bbf56fb..e767cba 100644 --- a/mac/tkMacHLEvents.c +++ b/mac/tkMacHLEvents.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. * - * SCCS: @(#) tkMacHLEvents.c 1.22 97/11/07 21:20:50 + * RCS: @(#) $Id: tkMacHLEvents.c,v 1.1.4.2 1998/09/30 02:18:08 stanton Exp $ */ #include "tcl.h" diff --git a/mac/tkMacInit.c b/mac/tkMacInit.c index 11f730a..f14941d 100644 --- a/mac/tkMacInit.c +++ b/mac/tkMacInit.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. * - * SCCS: @(#) tkMacInit.c 1.30 96/12/17 15:20:16 + * RCS: @(#) $Id: tkMacInit.c,v 1.1.4.2 1998/09/30 02:18:08 stanton Exp $ */ #include <Resources.h> diff --git a/mac/tkMacInt.h b/mac/tkMacInt.h index 7cbb21e..c4e305e 100644 --- a/mac/tkMacInt.h +++ b/mac/tkMacInt.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. * - * SCCS:@(#) tkMacInt.h 1.69 98/02/18 10:50:53 + * RCS: @(#) $Id: tkMacInt.h,v 1.1.4.2 1998/09/30 02:18:09 stanton Exp $ */ #ifndef _TKMACINT diff --git a/mac/tkMacKeyboard.c b/mac/tkMacKeyboard.c index 3c10b58..0122504 100644 --- a/mac/tkMacKeyboard.c +++ b/mac/tkMacKeyboard.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. * - * SCCS: @(#) tkMacKeyboard.c 1.16 98/01/16 10:42:35 + * RCS: @(#) $Id: tkMacKeyboard.c,v 1.1.4.2 1998/09/30 02:18:09 stanton Exp $ */ #include "tkInt.h" diff --git a/mac/tkMacLibrary.r b/mac/tkMacLibrary.r index 1d9c041..1b2cfe8 100644 --- a/mac/tkMacLibrary.r +++ b/mac/tkMacLibrary.r @@ -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. * - * SCCS: @(#) tkMacLibrary.r 1.10 98/02/10 10:37:21 + * RCS: @(#) $Id: tkMacLibrary.r,v 1.1.4.2 1998/09/30 02:18:10 stanton Exp $ */ /* diff --git a/mac/tkMacMDEF.c b/mac/tkMacMDEF.c index f7ce485..29371c1 100644 --- a/mac/tkMacMDEF.c +++ b/mac/tkMacMDEF.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. * - * SCCS: @(#) tkMacMDEF.c 1.5 97/07/11 %V% + * RCS: @(#) $Id: tkMacMDEF.c,v 1.1.4.1 1998/09/30 02:18:10 stanton Exp $ */ #define MAC_TCL diff --git a/mac/tkMacMDEF.r b/mac/tkMacMDEF.r index 5c18104..c84c5dd 100644 --- a/mac/tkMacMDEF.r +++ b/mac/tkMacMDEF.r @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tkMacMDEF.r 1.6 97/07/11 18:09:47 + * RCS: @(#) $Id: tkMacMDEF.r,v 1.1.4.1 1998/09/30 02:18:10 stanton Exp $ */ #include <Types.r> diff --git a/mac/tkMacMenu.c b/mac/tkMacMenu.c index a44636c..54aa33d 100644 --- a/mac/tkMacMenu.c +++ b/mac/tkMacMenu.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. * - * SCCS: @(#) tkMacMenu.c 1.111 98/01/21 22:04:59 + * RCS: @(#) $Id: tkMacMenu.c,v 1.1.4.2 1998/09/30 02:18:11 stanton Exp $ */ #include <Menus.h> @@ -510,9 +510,8 @@ TkpNewMenu( macMenuHdl = NewMenu(menuID, itemText); #ifdef GENERATINGCFM { - Handle mdefProc = GetResource('MDEF', 591); - Handle sicnHandle = GetResource('SICN', SICN_RESOURCE_NUMBER); - if ((mdefProc != NULL) && (sicnHandle != NULL)) { + Handle mdefProc = FixMDEF(); + if ((mdefProc != NULL)) { (*macMenuHdl)->menuProc = mdefProc; } } @@ -4067,8 +4066,8 @@ TkMacClearMenubarActive(void) { if ((menuBarRefPtr != NULL) && (menuBarRefPtr->menuPtr != NULL)) { TkMenu *menuPtr; - for (menuPtr = menuBarRefPtr->menuPtr->masterMenuPtr; - menuPtr != NULL; + for (menuPtr = menuBarRefPtr->menuPtr->masterMenuPtr; + menuPtr != NULL; menuPtr = menuPtr->nextInstancePtr) { if (menuPtr->menuType == MENUBAR) { RecursivelyClearActiveMenu(menuPtr); @@ -4126,29 +4125,33 @@ TkpMenuNotifyToplevelCreate( * figure it out. * * Results: - * None. + * Returns the MDEF handle. * * Side effects: - * Allcates a hash table. + * The MDEF is read in and massaged. * *---------------------------------------------------------------------- */ -static void +static Handle FixMDEF(void) { #ifdef GENERATINGCFM Handle MDEFHandle = GetResource('MDEF', 591); Handle SICNHandle = GetResource('SICN', SICN_RESOURCE_NUMBER); if ((MDEFHandle != NULL) && (SICNHandle != NULL)) { - MoveHHi(MDEFHandle); - HLock(MDEFHandle); - if ( menuDefProc == NULL) { - menuDefProc = TkNewMenuDefProc(MenuDefProc); + HLock(MDEFHandle); + HLock(SICNHandle); + if (menuDefProc == NULL) { + menuDefProc = TkNewMenuDefProc(MenuDefProc); } memmove((void *) (((long) (*MDEFHandle)) + 0x24), &menuDefProc, 4); + return MDEFHandle; + } else { + return NULL; } - +#else + return NULL; #endif } diff --git a/mac/tkMacMenu.r b/mac/tkMacMenu.r index 9952cea..904295a 100644 --- a/mac/tkMacMenu.r +++ b/mac/tkMacMenu.r @@ -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. * - * SCCS: @(#) tkMacMenu.r 1.1 97/07/11 18:06:27 + * RCS: @(#) $Id: tkMacMenu.r,v 1.1.4.1 1998/09/30 02:18:12 stanton Exp $ */ #include <Types.r> @@ -20,7 +20,7 @@ * Icons used in menu items. */ -resource 'SICN' (128, preload) { +resource 'SICN' (128, preload, locked) { { /* array: 7 elements */ /* [1] */ $"0000 0000 8000 C000 E000 F000 F800 FC00" diff --git a/mac/tkMacMenubutton.c b/mac/tkMacMenubutton.c index 42b8d2b..5eba33e 100644 --- a/mac/tkMacMenubutton.c +++ b/mac/tkMacMenubutton.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. * - * SCCS: @(#) tkMacMenubutton.c 1.4 97/01/03 13:55:19 + * RCS: @(#) $Id: tkMacMenubutton.c,v 1.1.4.1 1998/09/30 02:18:12 stanton Exp $ */ #include "tkMenubutton.h" diff --git a/mac/tkMacMenus.c b/mac/tkMacMenus.c index 6eaf0ae..ce885b8 100644 --- a/mac/tkMacMenus.c +++ b/mac/tkMacMenus.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. * - * SCCS: @(#) tkMacMenus.c 1.38 97/10/31 17:37:03 + * RCS: @(#) $Id: tkMacMenus.c,v 1.1.4.1 1998/09/30 02:18:13 stanton Exp $ */ #include "tcl.h" diff --git a/mac/tkMacPort.h b/mac/tkMacPort.h index e05b7ba..beb6979 100644 --- a/mac/tkMacPort.h +++ b/mac/tkMacPort.h @@ -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. * - * SCCS: @(#) tkMacPort.h 1.53 98/01/08 14:59:32 + * RCS: @(#) $Id: tkMacPort.h,v 1.1.4.2 1998/09/30 02:18:13 stanton Exp $ */ #ifndef _TKMACPORT diff --git a/mac/tkMacRegion.c b/mac/tkMacRegion.c index 534624c..25e2e88 100644 --- a/mac/tkMacRegion.c +++ b/mac/tkMacRegion.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. * - * SCCS: @(#) tkMacRegion.c 1.9 96/12/03 11:46:50 + * RCS: @(#) $Id: tkMacRegion.c,v 1.1.4.1 1998/09/30 02:18:14 stanton Exp $ */ #include "tkInt.h" diff --git a/mac/tkMacResource.r b/mac/tkMacResource.r index 76bd528..b5c2220 100644 --- a/mac/tkMacResource.r +++ b/mac/tkMacResource.r @@ -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. * - * SCCS: @(#) tkMacResource.r 1.38 98/02/10 10:38:07 + * RCS: @(#) $Id: tkMacResource.r,v 1.1.4.2 1998/09/30 02:18:14 stanton Exp $ */ /* @@ -93,7 +93,6 @@ read 'TEXT' (24, "Console", purgeable, preload) "::library:console.tcl"; read 'TEXT' (25, "msgbox", purgeable, preload) "::library:msgbox.tcl"; read 'TEXT' (26, "comdlg", purgeable, preload) "::library:comdlg.tcl"; - /* * The following resource is used when creating the 'env' variable in * the Macintosh environment. The creation mechanisim looks for the diff --git a/mac/tkMacScale.c b/mac/tkMacScale.c index 292a064..b0ec4f5 100644 --- a/mac/tkMacScale.c +++ b/mac/tkMacScale.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. * - * SCCS: @(#) tkMacScale.c 1.3 96/10/17 13:16:18 + * RCS: @(#) $Id: tkMacScale.c,v 1.1.4.1 1998/09/30 02:18:15 stanton Exp $ */ #include "tkScale.h" diff --git a/mac/tkMacScrlbr.c b/mac/tkMacScrlbr.c index c76daec..cc54900 100644 --- a/mac/tkMacScrlbr.c +++ b/mac/tkMacScrlbr.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. * - * SCCS: @(#) tkMacScrlbr.c 1.9 96/12/10 20:04:39 + * RCS: @(#) $Id: tkMacScrlbr.c,v 1.1.4.1 1998/09/30 02:18:15 stanton Exp $ */ #include "tkScrollbar.h" diff --git a/mac/tkMacSend.c b/mac/tkMacSend.c index dc4e8fd..05b5052 100644 --- a/mac/tkMacSend.c +++ b/mac/tkMacSend.c @@ -31,7 +31,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tkMacSend.c 1.9 98/02/18 11:01:26 + * RCS: @(#) $Id: tkMacSend.c,v 1.1.4.2 1998/09/30 02:18:16 stanton Exp $ */ #include <Gestalt.h> diff --git a/mac/tkMacShLib.exp b/mac/tkMacShLib.exp index 04e397a..e6b4aa5 100644 --- a/mac/tkMacShLib.exp +++ b/mac/tkMacShLib.exp @@ -544,7 +544,7 @@ XChangeWindowAttributes XConfigureWindow XCopyArea XCopyPlane -XCreateBitmapFromData +TkCreateBitmapFromData XCreateColormap XCreateGC XCreateImage @@ -583,7 +583,7 @@ XMoveWindow XParseColor XQueryPointer XRaiseWindow -XReadBitmapFile +TkReadBitmapFile XRefreshKeyboardMapping XResizeWindow XRootWindow diff --git a/mac/tkMacSubwindows.c b/mac/tkMacSubwindows.c index 562a977..62cc561 100644 --- a/mac/tkMacSubwindows.c +++ b/mac/tkMacSubwindows.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. * - * SCCS: @(#) tkMacSubwindows.c 1.84 98/02/19 14:56:28 + * RCS: @(#) $Id: tkMacSubwindows.c,v 1.1.4.2 1998/09/30 02:18:17 stanton Exp $ */ #include "tkInt.h" @@ -27,7 +27,7 @@ static RgnHandle tmpRgn = NULL; static void UpdateOffsets _ANSI_ARGS_((TkWindow *winPtr, int deltaX, int deltaY)); -void MacMoveWindow _ANSI_ARGS_((WindowRef window, int x, int y)); +void tkMacMoveWindow _ANSI_ARGS_((WindowRef window, int x, int y)); /* *---------------------------------------------------------------------- @@ -405,7 +405,7 @@ XMoveResizeWindow( SizeWindow((WindowRef) destPort, (short) width, (short) height, false); - MacMoveWindow((WindowRef) destPort, x, y); + tkMacMoveWindow((WindowRef) destPort, x, y); /* TODO: is the following right? */ TkMacInvalidateWindow(macWin, TK_WINDOW_ONLY); @@ -507,7 +507,7 @@ XMoveWindow( * region. It is currently assumed that Tk will need * to completely redraw anway. */ - MacMoveWindow((WindowRef) destPort, x, y); + tkMacMoveWindow((WindowRef) destPort, x, y); /* TODO: is the following right? */ TkMacInvalidateWindow(macWin, TK_WINDOW_ONLY); @@ -931,24 +931,21 @@ TkMacGetDrawablePort( if (contWinPtr != NULL) { resultPort = TkMacGetDrawablePort( - (Drawable) contWinPtr->privatePtr); + (Drawable) contWinPtr->privatePtr); } else if (gMacEmbedHandler != NULL) { resultPort = gMacEmbedHandler->getPortProc( (Tk_Window) macWin->winPtr); - if (resultPort == NULL) { - panic("Embed Handler couldn't find port"); - return NULL; - } - } else { - panic("TkMacGetDrawablePort couldn't find container"); - return NULL; + } + + if (resultPort == NULL) { + panic("TkMacGetDrawablePort couldn't find container"); + return NULL; + } - /* - * NOTE: Here we should handle out of process embedding. - */ + /* + * NOTE: Here we should handle out of process embedding. + */ - } - } return resultPort; } @@ -1054,7 +1051,7 @@ TkMacWinBounds( /* *---------------------------------------------------------------------- * - * MacMoveWindow -- + * tkMacMoveWindow -- * * A replacement for the Macintosh MoveWindow function. This * function adjusts the inputs to MoveWindow to offset the root of @@ -1071,7 +1068,7 @@ TkMacWinBounds( */ void -MacMoveWindow( +tkMacMoveWindow( WindowRef window, int x, int y) diff --git a/mac/tkMacTest.c b/mac/tkMacTest.c index b1b9db0..2717a8f 100644 --- a/mac/tkMacTest.c +++ b/mac/tkMacTest.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. * - * SCCS: @(#) tkMacTest.c 1.3 97/09/23 16:25:54 + * RCS: @(#) $Id: tkMacTest.c,v 1.1.4.2 1998/09/30 02:18:17 stanton Exp $ */ #include <Types.h> diff --git a/mac/tkMacWindowMgr.c b/mac/tkMacWindowMgr.c index e04abd6..bc6d497 100644 --- a/mac/tkMacWindowMgr.c +++ b/mac/tkMacWindowMgr.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. * - * SCCS: @(#) tkMacWindowMgr.c 1.62 98/01/16 10:42:51 + * RCS: @(#) $Id: tkMacWindowMgr.c,v 1.1.4.2 1998/09/30 02:18:18 stanton Exp $ */ #include <Events.h> diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c index 4cd7920..7435fe2 100644 --- a/mac/tkMacWm.c +++ b/mac/tkMacWm.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. * - * SCCS: @(#) tkMacWm.c 1.77 98/02/18 11:03:54 + * RCS: @(#) $Id: tkMacWm.c,v 1.1.4.2 1998/09/30 02:18:18 stanton Exp $ */ #include <Gestalt.h> @@ -306,7 +306,7 @@ static Tk_GeomMgr wmMgrType = { static Tcl_HashTable windowTable; static int windowHashInit = false; -void MacMoveWindow(WindowRef window, int x, int y); +void tkMacMoveWindow(WindowRef window, int x, int y); /* * Forward declarations for procedures defined in this file: @@ -3941,7 +3941,7 @@ TkMacMakeRealWindowExist( tkMacWindowListPtr = listPtr; macWin->portPtr = (GWorldPtr) newWindow; - MacMoveWindow(newWindow, (int) geometry.left, (int) geometry.top); + tkMacMoveWindow(newWindow, (int) geometry.left, (int) geometry.top); SetPort((GrafPtr) newWindow); if (!windowHashInit) { diff --git a/mac/tkMacXCursors.r b/mac/tkMacXCursors.r index 29ddc3e..4982988 100644 --- a/mac/tkMacXCursors.r +++ b/mac/tkMacXCursors.r @@ -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. * - * SCCS: @(#) tkMacXCursors.r 1.4 96/01/11 13:18:22 + * RCS: @(#) $Id: tkMacXCursors.r,v 1.1.4.1 1998/09/30 02:18:20 stanton Exp $ */ /* diff --git a/mac/tkMacXStubs.c b/mac/tkMacXStubs.c index 4f52e41..a6180fb 100644 --- a/mac/tkMacXStubs.c +++ b/mac/tkMacXStubs.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. * - * SCCS: @(#) tkMacXStubs.c 1.89 97/11/26 13:10:52 + * RCS: @(#) $Id: tkMacXStubs.c,v 1.1.4.2 1998/09/30 02:18:20 stanton Exp $ */ #include "tkInt.h" |