diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-11-27 11:12:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-11-27 11:12:01 (GMT) |
commit | c7c7d22777da93312e8351f289c0eae3253889c7 (patch) | |
tree | 0c6af3e83a24e865135704b4e3aaf230c769b3de /macosx | |
parent | 1a9ed03cff3ca2e3ce2fba690a478d0651c55d12 (diff) | |
download | tk-c7c7d22777da93312e8351f289c0eae3253889c7.zip tk-c7c7d22777da93312e8351f289c0eae3253889c7.tar.gz tk-c7c7d22777da93312e8351f289c0eae3253889c7.tar.bz2 |
tkWinDialog.c: Change a LoadLibrary() call to GetModuleHandle(), since "shell32.dll" is already linked to Tk.
Also various whitespace changes (mainly at line-ends) and comment fixes. Nothing functional.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/README | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXConstants.h | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 5 | ||||
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXImage.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 19 |
8 files changed, 23 insertions, 27 deletions
diff --git a/macosx/README b/macosx/README index c796396..13b5e66 100644 --- a/macosx/README +++ b/macosx/README @@ -391,7 +391,7 @@ The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3. 4. Details regarding the macOS port of Tk. ------------------------------------------- - + 4.1 About the event loop ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h index 1ee85a6..95983dd 100644 --- a/macosx/tkMacOSXConstants.h +++ b/macosx/tkMacOSXConstants.h @@ -4,7 +4,7 @@ * Macros which map the names of NS constants used in the Tk code to * the new name that Apple came up with for subsequent versions of the * operating system. (Each new OS release seems to come with a new - * naming convention for the same old constants.) + * naming convention for the same old constants.) * * Copyright (c) 2017 Marc Culler * @@ -53,7 +53,7 @@ #define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask #define NSCommandKeyMask NSEventModifierFlagCommand #define NSShiftKeyMask NSEventModifierFlagShift -#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock +#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock #define NSAlternateKeyMask NSEventModifierFlagOption #define NSControlKeyMask NSEventModifierFlagControl #define NSNumericPadKeyMask NSEventModifierFlagNumericPad diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 65762b7..5a53bdd 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -325,11 +325,6 @@ #define DEF_MENU_SELECT_COLOR "systemMenuActive" #define DEF_MENU_SELECT_MONO BLACK #define DEF_MENU_TAKE_FOCUS "0" - -/* - * FIXME: Turn the default back to 1 when we make tearoff menus work again. - */ - #define DEF_MENU_TEAROFF "0" #define DEF_MENU_TEAROFF_CMD ((char *) NULL) #define DEF_MENU_TITLE "" diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 0c2ca69..edcd064 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -193,7 +193,7 @@ TkpMakeWindow( int TkpScanWindowId( Tcl_Interp *interp, - CONST char * string, + const char * string, Window *idPtr) { int code; diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 2436e60..096faac 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -212,7 +212,7 @@ XGetImage( CFRelease(bitmap_rep); return NULL; } - + if (macDraw->flags & TK_USE_XIMAGE_ALPHA) { /* * When called by TkImgPhotoDisplay we are being asked to return a @@ -230,7 +230,7 @@ XGetImage( memcpy(bitmap, (char *)[bitmap_rep bitmapData], size); } CFRelease(bitmap_rep); - + /* * When Apple extracts a bitmap from an NSView, it may be in * either BGRA or ABGR format. For an XImage we need RGBA. @@ -243,7 +243,7 @@ XGetImage( G = *(bitmap + m + pixel.g); B = *(bitmap + m + pixel.b); A = *(bitmap + m + pixel.a); - + *(bitmap + m) = R; *(bitmap + m + 1) = G; *(bitmap + m + 2) = B; @@ -543,7 +543,7 @@ TkPutImage( { TkMacOSXDrawingContext dc; MacDrawable *macDraw = ((MacDrawable*)drawable); - + display->request++; if (!TkMacOSXSetupDrawingContext(drawable, gc, 1, &dc)) { return BadDrawable; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 7b91f97..b38036c 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -129,7 +129,7 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt */ _defaultMainMenu = nil; [self _setupMenus]; - + /* * Set the application icon. This is unnecessary when running Wish.app * but it is easier than testing for that situation to just do it. @@ -167,7 +167,7 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt - (void) _setup: (Tcl_Interp *) interp { - /* + /* * Remember our interpreter. */ _eventInterp = interp; @@ -304,7 +304,7 @@ TkpInit( TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed"); } #endif - + /* * FIXME: Close stdin & stdout for remote debugging otherwise we will * fight with gdb for stdin & stdout @@ -319,7 +319,7 @@ TkpInit( * Instantiate our NSApplication object. This needs to be * done before we check whether to open a console window. */ - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2c036bb..3d5e986 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -156,7 +156,7 @@ XMapWindow( * before applicationDidFinishLaunching returns. Forcing * the app to activate too early can make the menu bar * unresponsive. - */ + */ [NSApp activateIgnoringOtherApps:NO]; if ( [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 23d3e1f..6983839 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -189,7 +189,7 @@ static const Tk_GeomMgr wmMgrType = { * The following keeps state for Aqua dock icon bounce notification. */ -static int tkMacOSXWmAttrNotifyVal = 0; +static int tkMacOSXWmAttrNotifyVal = 0; /* * Hash table for Mac Window -> TkWindow mapping. @@ -786,7 +786,7 @@ TkWmMapWindow( /*Add window to Window menu.*/ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); - [win setExcludedFromWindowsMenu:NO]; + [win setExcludedFromWindowsMenu:NO]; } @@ -923,7 +923,7 @@ TkWmDeadWindow( WmInfo *wmPtr = winPtr2->wmInfoPtr; BOOL minimized = (wmPtr->hints.initial_state == IconicState || wmPtr->hints.initial_state == WithdrawnState); - /* + /* * If no windows are left on the screen and the next * window is iconified or withdrawn, we don't want to * make it be the KeyWindow because that would cause @@ -1976,7 +1976,7 @@ WmGridCmd( { register WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; - char *errorMsg; + const char *errorMsg; if ((objc != 3) && (objc != 7)) { Tcl_WrongNumArgs(interp, 2, objv, @@ -2355,7 +2355,7 @@ WmIconnameCmd( * WmIconphotoCmd -- * * This procedure is invoked to process the "wm iconphoto" Tcl command. - * See the user documentation for details on what it does. + * See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2366,6 +2366,7 @@ WmIconnameCmd( * *---------------------------------------------------------------------- */ + static int WmIconphotoCmd( Tk_Window tkwin, /* Main window of the application. */ @@ -2395,7 +2396,7 @@ WmIconphotoCmd( /*Get icon name. We only use the first icon name because macOS does not support multiple images in Tk photos.*/ - char *icon; + char *icon; if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) { icon = Tcl_GetString(objv[4]); } else { @@ -2411,7 +2412,7 @@ WmIconphotoCmd( Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "PHOTO", NULL); return TCL_ERROR; } - + NSImage *newIcon; Tk_SizeOfImage(tk_icon, &width, &height); newIcon = TkMacOSXGetNSImageWithTkImage(winPtr->display, tk_icon, width, height); @@ -3524,8 +3525,8 @@ WmWithdrawCmd( TkpWmSetState(winPtr, WithdrawnState); /*Remove window from Window menu.*/ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); - [win setExcludedFromWindowsMenu:YES]; - + [win setExcludedFromWindowsMenu:YES]; + return TCL_OK; } |