diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-31 16:33:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-08-31 16:33:11 (GMT) |
commit | 63e7c156ff551d2baffbc1a9e50a093a791c1387 (patch) | |
tree | 643be1ed2a3013ba6e00a641d5327723e0cf91b1 | |
parent | e1eecfdc5e113682068409908da7a8b5057b77e5 (diff) | |
parent | e9be26a5cd7994354c11df68142dedd1ad385705 (diff) | |
download | tk-63e7c156ff551d2baffbc1a9e50a093a791c1387.zip tk-63e7c156ff551d2baffbc1a9e50a093a791c1387.tar.gz tk-63e7c156ff551d2baffbc1a9e50a093a791c1387.tar.bz2 |
Merge 8.6
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 32 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 13 | ||||
-rw-r--r-- | macosx/tkMacOSXRegion.c | 18 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 60 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 23 |
6 files changed, 32 insertions, 116 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index a25c5d0..c649986 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -325,7 +325,7 @@ static const char* scriptTextProc = "::tk::mac::DoScriptText"; if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, data, actual, NULL)) { - data[actual] = '\0'; + data[actual] = '\0'; AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); Tcl_DString *scriptTextCommand = &AEInfo->command; Tcl_DStringInit(scriptTextCommand); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index c3cb951..1020a40 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -56,10 +56,6 @@ enum { Tk_Window tkwin; NSPoint local, global; NSInteger button = -1; -#if 0 - NSTrackingArea *trackingArea = nil; - NSInteger eventNumber, clickCount, buttonNumber; -#endif [NSEvent stopPeriodicEvents]; #ifdef TK_MAC_DEBUG_EVENTS @@ -314,34 +310,6 @@ enum { /* *---------------------------------------------------------------------- * - * TkMacOSXKeyModifiers -- - * - * Returns the current state of the modifier keys. - * - * Results: - * An OS Modifier state. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -EventModifiers -TkMacOSXModifierState(void) -{ - UInt32 keyModifiers; - int isFrontProcess = (GetCurrentEvent() && Tk_MacOSXIsAppInFront()); - - keyModifiers = isFrontProcess ? GetCurrentEventKeyModifiers() : - GetCurrentKeyModifiers(); - - return (EventModifiers) (keyModifiers & USHRT_MAX); -} - -/* - *---------------------------------------------------------------------- - * * TkMacOSXButtonKeyState -- * * Returns the current state of the button & modifier keys. diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 4abad36..c0c8ab2 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -226,10 +226,6 @@ MODULE_SCOPE HIMutableShapeRef TkMacOSXHIShapeCreateMutableWithRect( MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithShape( HIMutableShapeRef inDestShape, HIShapeRef inSrcShape); -#if 0 -MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithRect(HIMutableShapeRef inShape, - const CGRect *inRect); -#endif MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect( HIMutableShapeRef inShape, const CGRect *inRect); MODULE_SCOPE OSStatus TkMacOSHIShapeUnionWithRect(HIMutableShapeRef inShape, @@ -250,12 +246,8 @@ MODULE_SCOPE int TkMacOSXUseAntialiasedText(Tcl_Interp *interp, int enable); MODULE_SCOPE int TkMacOSXInitCGDrawing(Tcl_Interp *interp, int enable, int antiAlias); -MODULE_SCOPE int TkMacOSXGenerateFocusEvent(TkWindow *winPtr, - int activeFlag); -MODULE_SCOPE WindowClass TkMacOSXWindowClass(TkWindow *winPtr); MODULE_SCOPE int TkMacOSXIsWindowZoomed(TkWindow *winPtr); MODULE_SCOPE int TkGenerateButtonEventForXPointer(Window window); -MODULE_SCOPE EventModifiers TkMacOSXModifierState(void); MODULE_SCOPE void TkMacOSXDrawCGImage(Drawable d, GC gc, CGContextRef context, CGImageRef image, unsigned long imageForeground, unsigned long imageBackground, CGRect imageBounds, @@ -266,11 +258,6 @@ MODULE_SCOPE void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr); MODULE_SCOPE void TkMacOSXSetColorInContext(GC gc, unsigned long pixel, CGContextRef context); -MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr, - NSWindow *window, int fullscreen, - Tcl_Interp *interp); -MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr, - int active); MODULE_SCOPE NSWindow* TkMacOSXDrawableWindow(Drawable drawable); #define TkMacOSXDrawableView(macWin) (TKContentView *)TkMacOSXGetRootControl((Drawable)(macWin)) MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds); diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index 59eca6c..6cb61dd 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -479,7 +479,7 @@ XOffsetRegion( *---------------------------------------------------------------------- * * TkMacOSXHIShapeCreateEmpty, TkMacOSXHIShapeCreateMutableWithRect, - * TkMacOSXHIShapeSetWithShape, TkMacOSXHIShapeSetWithRect, + * TkMacOSXHIShapeSetWithShape, * TkMacOSHIShapeDifferenceWithRect, TkMacOSHIShapeUnionWithRect, * TkMacOSHIShapeUnion -- * @@ -518,22 +518,6 @@ TkMacOSXHIShapeSetWithShape( return result; } -#if 0 -OSStatus -TkMacOSXHIShapeSetWithRect( - HIMutableShapeRef inShape, - const CGRect *inRect) -{ - OSStatus result; - HIShapeRef rgn = HIShapeCreateWithRect(inRect); - - result = TkMacOSXHIShapeSetWithShape(inShape, rgn); - CFRelease(rgn); - - return result; -} -#endif - OSStatus TkMacOSHIShapeDifferenceWithRect( HIMutableShapeRef inShape, diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index a449b4b..cd12a28 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -536,35 +536,6 @@ GenerateUpdates( /* *---------------------------------------------------------------------- * - * GenerateActivateEvents -- - * - * Given a Macintosh window activate event this function generates all the - * X Activate events needed by Tk. - * - * Results: - * True if event(s) are generated - false otherwise. - * - * Side effects: - * Additional events may be placed on the Tk event queue. - * - *---------------------------------------------------------------------- - */ - -int -GenerateActivateEvents( - TkWindow *winPtr, - int activeFlag) -{ - TkGenerateActivateEvents(winPtr, activeFlag); - if (activeFlag || ![NSApp isActive]) { - TkMacOSXGenerateFocusEvent(winPtr, activeFlag); - } - return true; -} - -/* - *---------------------------------------------------------------------- - * * TkMacOSXGenerateFocusEvent -- * * Given a Macintosh window activate event this function generates all @@ -579,7 +550,7 @@ GenerateActivateEvents( *---------------------------------------------------------------------- */ -MODULE_SCOPE int +static int TkMacOSXGenerateFocusEvent( TkWindow *winPtr, /* Root X window for event. */ int activeFlag) @@ -621,6 +592,35 @@ TkMacOSXGenerateFocusEvent( /* *---------------------------------------------------------------------- * + * GenerateActivateEvents -- + * + * Given a Macintosh window activate event this function generates all the + * X Activate events needed by Tk. + * + * Results: + * True if event(s) are generated - false otherwise. + * + * Side effects: + * Additional events may be placed on the Tk event queue. + * + *---------------------------------------------------------------------- + */ + +int +GenerateActivateEvents( + TkWindow *winPtr, + int activeFlag) +{ + TkGenerateActivateEvents(winPtr, activeFlag); + if (activeFlag || ![NSApp isActive]) { + TkMacOSXGenerateFocusEvent(winPtr, activeFlag); + } + return true; +} + +/* + *---------------------------------------------------------------------- + * * TkGenWMConfigureEvent -- * * Generate a ConfigureNotify event for Tk. Depending on the value of flag diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 09af190..03ffba5 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6427,29 +6427,6 @@ TkpIsWindowFloating( } /* - *---------------------------------------------------------------------- - * - * TkMacOSXWindowClass -- - * - * Returns OS X window class of window - * - * Results: - * 1 or 0 depending on window's floating attribute. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -MODULE_SCOPE WindowClass -TkMacOSXWindowClass( - TkWindow *winPtr) -{ - return winPtr->wmInfoPtr->macClass; -} - -/* *-------------------------------------------------------------- * * TkMacOSXWindowOffset -- |