Check-in [6f4939db8c]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add tk upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6f4939db8cbf3195e8c39b25681b3b3ac773a3d4
User & Date: chw 2019-07-16 20:36:46
Context
2019-07-17
10:35
update tklib/tablelist and add scrollutil check-in: 592d20919d user: chw tags: trunk
2019-07-16
20:37
merge with trunk check-in: 9fcf12f0bd user: chw tags: wtf-8-experiment
20:36
add tk upstream changes check-in: 6f4939db8c user: chw tags: trunk
20:36
add tcl upstream changes check-in: 6e36b8fa44 user: chw tags: trunk
Changes

Changes to jni/sdl2tk/macosx/tkMacOSXColor.c.

335
336
337
338
339
340
341
342
343
344
345
346

347
348
349
350
351
352
353
...
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
	case 0:
	    color = [[NSColor textColor] colorUsingColorSpace: deviceRGB];
	    break;
	case 1:
	    color = [[NSColor selectedTextColor] colorUsingColorSpace: deviceRGB];
	    break;
	case 2:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
	    color = [[NSColor labelColor] colorUsingColorSpace: deviceRGB];
#else
	    color = [[NSColor textColor] colorUsingColorSpace: deviceRGB];
#endif

	    break;
	case 3:
	    color = [[NSColor controlTextColor] colorUsingColorSpace:
			  deviceRGB];
	    break;
	case 4:
	    color = [[NSColor disabledControlTextColor] colorUsingColorSpace:
................................................................................
    CGContextRef context)
{
    OSStatus err = noErr;
    CGColorRef cgColor = nil;
    struct SystemColorMapEntry entry;
    CGRect rect;
    int code = (pixel >> 24) & 0xff;
    HIThemeBackgroundDrawInfo info = { 0, kThemeStateActive, entry.value };
    static CGColorSpaceRef deviceRGBSpace = NULL;

    if (!deviceRGBSpace) {
	deviceRGBSpace = CGColorSpaceCreateDeviceRGB();
    }
    if (code < FIRST_SEMANTIC_COLOR) {
	cgColor = CopyCachedColor(gc, pixel);







|
|
|
|
<
>







 







|







335
336
337
338
339
340
341
342
343
344
345

346
347
348
349
350
351
352
353
...
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
	case 0:
	    color = [[NSColor textColor] colorUsingColorSpace: deviceRGB];
	    break;
	case 1:
	    color = [[NSColor selectedTextColor] colorUsingColorSpace: deviceRGB];
	    break;
	case 2:
	    if ([NSApp macMinorVersion] > 9) {
		color = [[NSColor labelColor] colorUsingColorSpace: deviceRGB];
	    } else {
		color = [[NSColor textColor] colorUsingColorSpace: deviceRGB];

	    }
	    break;
	case 3:
	    color = [[NSColor controlTextColor] colorUsingColorSpace:
			  deviceRGB];
	    break;
	case 4:
	    color = [[NSColor disabledControlTextColor] colorUsingColorSpace:
................................................................................
    CGContextRef context)
{
    OSStatus err = noErr;
    CGColorRef cgColor = nil;
    struct SystemColorMapEntry entry;
    CGRect rect;
    int code = (pixel >> 24) & 0xff;
    HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};
    static CGColorSpaceRef deviceRGBSpace = NULL;

    if (!deviceRGBSpace) {
	deviceRGBSpace = CGColorSpaceCreateDeviceRGB();
    }
    if (code < FIRST_SEMANTIC_COLOR) {
	cgColor = CopyCachedColor(gc, pixel);

Changes to jni/sdl2tk/macosx/tkMacOSXWindowEvent.c.

288
289
290
291
292
293
294
















295
296
297
298
299
300
301

- (void) applicationActivate: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
    [NSApp tkCheckPasteboard];
















}

- (void) applicationDeactivate: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317

- (void) applicationActivate: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
    [NSApp tkCheckPasteboard];

    /*
     * When the application is activated with Command-Tab it will create a
     * zombie window for every Tk window which has been withdrawn.  So iterate
     * through the list of windows and order out any withdrawn window.
     */

    for (NSWindow *win in [NSApp windows]) {
	TkWindow *winPtr = TkMacOSXGetTkWindow(win);
	if (!winPtr || !winPtr->wmInfoPtr) {
	    continue;
	}
	if (winPtr->wmInfoPtr->hints.initial_state == WithdrawnState) {
	    [win orderOut:nil];
	}
    }
}

- (void) applicationDeactivate: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif

Changes to jni/sdl2tk/macosx/tkMacOSXWm.c.

5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923

5924
5925
5926
5927

5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951

5952
5953


5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964

5965
5966
5967
5968
5969
5970
5971
....
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885

6886

6887
6888
6889
6890
6891
6892
6893
	APPEARANCE_AQUA, APPEARANCE_DARKAQUA, APPEARANCE_AUTO
    };
    Tcl_Obj *result = NULL;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
    NSAppearanceName appearance;
#else
    NSString *appearance;
#endif
    const char *resultString;
    NSWindow *win = TkMacOSXDrawableWindow(winPtr->window);
    if (win) {
#if MAC_OS_X_VERSION_MAX_ALLOWED > 1090
	appearance = win.appearance.name;
	if (appearance == nil) {
	    resultString = appearanceStrings[APPEARANCE_AUTO];
	} else if (appearance == NSAppearanceNameAqua) {
	    resultString = appearanceStrings[APPEARANCE_AQUA];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400

	} else if (appearance == NSAppearanceNameDarkAqua) {
	    resultString = appearanceStrings[APPEARANCE_DARKAQUA];
#endif
	} else {

	    resultString = "unrecognized";
	}
#else
	resultString = appearanceStrings[APPEARANCE_AQUA];
#endif
	result = Tcl_NewStringObj(resultString, strlen(resultString));
    }
    if (result == NULL) {
	Tcl_Panic("Failed to read appearance name.");
    }
    if (objc == 4) {
	int index;
	if (Tcl_GetIndexFromObjStruct(interp, objv[3], appearanceStrings,
                sizeof(char *), "appearancename", 0, &index) != TCL_OK) {
            return TCL_ERROR;
        }
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
	switch ((enum appearances) index) {
	case APPEARANCE_AQUA:
	    win.appearance = [NSAppearance appearanceNamed:
		NSAppearanceNameAqua];
	    break;
	case APPEARANCE_DARKAQUA:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400

	    win.appearance = [NSAppearance appearanceNamed:
		NSAppearanceNameDarkAqua];


	    break;
#endif
	default:
	    win.appearance = nil;
	}
#endif
    }
    Tcl_SetObjResult(interp, result);
    return TCL_OK;
#endif
    return TCL_ERROR;

}
 
/*
 *----------------------------------------------------------------------
 *
 * TkpMakeMenuWindow --
 *
................................................................................
		    b |= NSWindowCollectionBehaviorFullScreenPrimary;

		    /*
		     * The default max size has height less than the screen
		     * height. This causes the window manager to refuse to
		     * allow the window to be resized when it is a split
		     * window. To work around this we make the max size equal
		     * to the screen size.
		     */


		    [macWindow setMaxFullScreenContentSize:screenSize];

		}
	    }
#endif

	    if (newAttributes & tkCanJoinAllSpacesAttribute) {
		b |= NSWindowCollectionBehaviorCanJoinAllSpaces;
	    } else if (newAttributes & tkMoveToActiveSpaceAttribute) {







|
|


<






>
|
|
<
<
>
|

<
<
<











<







>
|
|
>
>

<



<



|

>







 







|

<
>
|
>







5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916

5917
5918
5919
5920
5921
5922
5923
5924
5925


5926
5927
5928



5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939

5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952

5953
5954
5955

5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
....
6873
6874
6875
6876
6877
6878
6879
6880
6881

6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
	APPEARANCE_AQUA, APPEARANCE_DARKAQUA, APPEARANCE_AUTO
    };
    Tcl_Obj *result = NULL;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
    NSAppearanceName appearance;
#else
    NSString *appearance;
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
    const char *resultString = "unrecognized";
    NSWindow *win = TkMacOSXDrawableWindow(winPtr->window);
    if (win) {

	appearance = win.appearance.name;
	if (appearance == nil) {
	    resultString = appearanceStrings[APPEARANCE_AUTO];
	} else if (appearance == NSAppearanceNameAqua) {
	    resultString = appearanceStrings[APPEARANCE_AQUA];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
	} else if (@available(macOS 10.14, *)) {
	    if (appearance == NSAppearanceNameDarkAqua) {
		resultString = appearanceStrings[APPEARANCE_DARKAQUA];


	    }
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
	}



	result = Tcl_NewStringObj(resultString, strlen(resultString));
    }
    if (result == NULL) {
	Tcl_Panic("Failed to read appearance name.");
    }
    if (objc == 4) {
	int index;
	if (Tcl_GetIndexFromObjStruct(interp, objv[3], appearanceStrings,
                sizeof(char *), "appearancename", 0, &index) != TCL_OK) {
            return TCL_ERROR;
        }

	switch ((enum appearances) index) {
	case APPEARANCE_AQUA:
	    win.appearance = [NSAppearance appearanceNamed:
		NSAppearanceNameAqua];
	    break;
	case APPEARANCE_DARKAQUA:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
	    if (@available(macOS 10.14, *)) {
		win.appearance = [NSAppearance appearanceNamed:
		    NSAppearanceNameDarkAqua];
	    }
#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
	    break;

	default:
	    win.appearance = nil;
	}

    }
    Tcl_SetObjResult(interp, result);
    return TCL_OK;
#else // MAC_OS_X_VERSION_MAX_ALLOWED > 1090
    return TCL_ERROR;
#endif
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkpMakeMenuWindow --
 *
................................................................................
		    b |= NSWindowCollectionBehaviorFullScreenPrimary;

		    /*
		     * The default max size has height less than the screen
		     * height. This causes the window manager to refuse to
		     * allow the window to be resized when it is a split
		     * window. To work around this we make the max size equal
		     * to the screen size.  (For 10.11 and up, only)
		     */

		    if ([NSApp macMinorVersion] > 10) {
			[macWindow setMaxFullScreenContentSize:screenSize];
		    }
		}
	    }
#endif

	    if (newAttributes & tkCanJoinAllSpacesAttribute) {
		b |= NSWindowCollectionBehaviorCanJoinAllSpaces;
	    } else if (newAttributes & tkMoveToActiveSpaceAttribute) {

jni/tcl/library/msgs/ja.msg became executable.