Skip to content
Permalink
Browse files
8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros
Reviewed-by: serb
  • Loading branch information
Phil Race committed Jan 15, 2021
1 parent 360c722 commit 5855d52a2a670a49b7a968fd58404b5d1836a8e1
Showing with 583 additions and 544 deletions.
  1. +9 −9 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m
  2. +5 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m
  3. +10 −10 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
  4. +49 −53 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
  5. +34 −34 src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m
  6. +11 −11 src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m
  7. +12 −10 src/java.desktop/macosx/native/libawt_lwawt/awt/CCursorManager.m
  8. +7 −7 src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m
  9. +5 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m
  10. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSource.m
  11. +7 −6 src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSourceContextPeer.m
  12. +4 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTarget.m
  13. +4 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTargetContextPeer.m
  14. +4 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m
  15. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m
  16. +12 −12 src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m
  17. +10 −18 src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m
  18. +26 −26 src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m
  19. +12 −12 src/java.desktop/macosx/native/libawt_lwawt/awt/CInputMethod.m
  20. +11 −10 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.m
  21. +10 −8 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m
  22. +16 −16 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m
  23. +4 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CPopupMenu.m
  24. +16 −16 src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m
  25. +5 −5 src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
  26. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m
  27. +10 −9 src/java.desktop/macosx/native/libawt_lwawt/awt/CTextPipe.m
  28. +10 −10 src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m
  29. +57 −55 src/java.desktop/macosx/native/libawt_lwawt/awt/CWrapper.m
  30. +4 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/ImageSurfaceData.m
  31. +18 −18 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
  32. +22 −22 src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
  33. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/PrintModel.m
  34. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterSurfaceData.m
  35. +16 −16 src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzRenderer.m
  36. +3 −7 src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.h
  37. +9 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m
  38. +14 −14 src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m
  39. +17 −17 src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m
  40. +6 −4 src/java.desktop/macosx/native/libawt_lwawt/font/CCharToGlyphMapper.m
  41. +3 −2 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m
  42. +4 −4 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m
  43. +15 −15 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m
  44. +24 −22 src/java.desktop/macosx/native/libosx/CFileManager.m
  45. +31 −0 src/java.desktop/macosx/native/libosxapp/JNIUtilities.h
  46. +13 −13 src/java.desktop/macosx/native/libosxui/AquaFileView.m
  47. +2 −2 src/java.desktop/macosx/native/libosxui/AquaNativeResources.m
  48. +12 −12 src/java.desktop/macosx/native/libosxui/ScreenMenu.m
@@ -27,7 +27,7 @@
#import "java_awt_event_KeyEvent.h"
#import "LWCToolkit.h"

#import "jni_util.h"
#import "JNIUtilities.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <sys/time.h>
@@ -668,11 +668,11 @@ jlong UTC(NSEvent *event) {
{
jint jmodifiers = 0;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

jmodifiers = GetJavaMouseModifiers(modifierFlags);

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return jmodifiers;
}
@@ -688,7 +688,7 @@ jlong UTC(NSEvent *event) {
{
BOOL postsTyped = NO;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

jboolean copy = JNI_FALSE;
jint *data = (*env)->GetIntArrayElements(env, inData, &copy);
@@ -716,7 +716,7 @@ jlong UTC(NSEvent *event) {

(*env)->ReleaseIntArrayElements(env, inData, data, 0);

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return postsTyped;
}
@@ -730,7 +730,7 @@ jlong UTC(NSEvent *event) {
Java_sun_lwawt_macosx_NSEvent_nsKeyModifiersToJavaKeyInfo
(JNIEnv *env, jclass cls, jintArray inData, jintArray outData)
{
JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

jboolean copy = JNI_FALSE;
jint *data = (*env)->GetIntArrayElements(env, inData, &copy);
@@ -757,7 +757,7 @@ jlong UTC(NSEvent *event) {

(*env)->ReleaseIntArrayElements(env, inData, data, 0);

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);
}

/*
@@ -771,11 +771,11 @@ jlong UTC(NSEvent *event) {
{
jchar javaChar = 0;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

javaChar = NsCharToJavaChar(nsChar, modifierFlags, spaceKeyTyped);

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return javaChar;
}
@@ -26,6 +26,7 @@
#import "AWTSurfaceLayers.h"
#import "ThreadUtilities.h"
#import "LWCToolkit.h"
#import "JNIUtilities.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <QuartzCore/CATransaction.h>
@@ -101,15 +102,15 @@ - (void) setBounds:(CGRect)rect {
{
__block AWTSurfaceLayers *surfaceLayers = nil;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

[ThreadUtilities performOnMainThreadWaiting:YES block:^(){

CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
}];

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return ptr_to_jlong(surfaceLayers);
}
@@ -122,7 +123,7 @@ - (void) setBounds:(CGRect)rect {
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformComponent_nativeSetBounds
(JNIEnv *env, jclass clazz, jlong surfaceLayersPtr, jint x, jint y, jint width, jint height)
{
JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);

@@ -132,5 +133,5 @@ - (void) setBounds:(CGRect)rect {
[surfaceLayers setBounds: rect];
}];

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);
}
@@ -1404,7 +1404,7 @@ - (void)abandonInput
{
__block AWTView *newView = nil;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

NSRect rect = NSMakeRect(originX, originY, width, height);
jobject cPlatformView = (*env)->NewWeakGlobalRef(env, obj);
@@ -1417,7 +1417,7 @@ - (void)abandonInput
windowLayer:windowLayer];
}];

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return ptr_to_jlong(newView);
}
@@ -1432,7 +1432,7 @@ - (void)abandonInput
Java_sun_lwawt_macosx_CPlatformView_nativeSetAutoResizable
(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize)
{
JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

NSView *view = (NSView *)jlong_to_ptr(viewPtr);

@@ -1449,7 +1449,7 @@ - (void)abandonInput
}

}];
JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);
}

/*
@@ -1464,15 +1464,15 @@ - (void)abandonInput
{
__block jint ret; //CGDirectDisplayID

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
NSWindow *window = [view window];
ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
}];

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return ret;
}
@@ -1489,7 +1489,7 @@ - (void)abandonInput
{
jobject jRect = NULL;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

__block NSRect rect = NSZeroRect;

@@ -1505,7 +1505,7 @@ - (void)abandonInput
}];
jRect = NSToJavaRect(env, rect);

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return jRect;
}
@@ -1521,7 +1521,7 @@ - (void)abandonInput
{
__block jboolean underMouse = JNI_FALSE;

JNF_COCOA_ENTER(env);
JNI_COCOA_ENTER(env);

NSView *nsView = OBJC(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
@@ -1530,7 +1530,7 @@ - (void)abandonInput
underMouse = [nsView hitTest:ptViewCoords] != nil;
}];

JNF_COCOA_EXIT(env);
JNI_COCOA_EXIT(env);

return underMouse;
}

1 comment on commit 5855d52

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 5855d52 Jan 15, 2021

Please sign in to comment.