Skip to content
Permalink
Browse files
8260616: Removing remaining JNF dependencies in the java.desktop module
Reviewed-by: gziemski, ihse, serb
  • Loading branch information
Phil Race committed Feb 4, 2021
1 parent e2516e4 commit 8760688d213865eaf1bd675056eb809cdae67048
Showing with 481 additions and 337 deletions.
  1. +0 −2 make/modules/java.desktop/Lib.gmk
  2. +1 −5 make/modules/java.desktop/lib/Awt2dLibraries.gmk
  3. +1 −1 make/test/JtregNativeJdk.gmk
  4. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m
  5. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m
  6. +18 −22 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
  7. +2 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m
  8. +9 −11 src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m
  9. +1 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m
  10. +1 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CCursorManager.m
  11. +3 −6 src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m
  12. +2 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m
  13. +7 −8 src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSource.m
  14. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSourceContextPeer.m
  15. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTarget.m
  16. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTargetContextPeer.m
  17. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m
  18. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.h
  19. +8 −9 src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m
  20. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m
  21. +12 −15 src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m
  22. +3 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m
  23. +2 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/CInputMethod.m
  24. +1 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.m
  25. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m
  26. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuComponent.m
  27. +2 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m
  28. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CPopupMenu.m
  29. +7 −8 src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m
  30. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
  31. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m
  32. +12 −7 src/java.desktop/macosx/native/libawt_lwawt/awt/CTextPipe.m
  33. +3 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m
  34. +1 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/CWrapper.m
  35. +4 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m
  36. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/ImageSurfaceData.m
  37. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m
  38. +1 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.h
  39. +12 −14 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m
  40. +56 −31 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m
  41. +22 −22 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m
  42. +6 −6 src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
  43. +2 −4 src/java.desktop/macosx/native/libawt_lwawt/awt/PrintModel.m
  44. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterSurfaceData.m
  45. +5 −7 src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterView.m
  46. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzRenderer.m
  47. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m
  48. +5 −5 src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.m
  49. +5 −7 src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m
  50. +0 −1 src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m
  51. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/font/CCharToGlyphMapper.m
  52. +1 −1 src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m
  53. +2 −1 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m
  54. +0 −2 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h
  55. +1 −1 src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m
  56. +18 −21 src/java.desktop/macosx/native/libosx/CFileManager.m
  57. +11 −1 src/java.desktop/macosx/native/libosxapp/JNIUtilities.h
  58. +108 −0 src/java.desktop/macosx/native/libosxapp/JNIUtilities.m
  59. +1 −7 src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h
  60. +3 −6 src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m
  61. +0 −4 src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.h
  62. +2 −2 src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.m
  63. +2 −2 src/java.desktop/macosx/native/libosxapp/ThreadUtilities.h
  64. +40 −3 src/java.desktop/macosx/native/libosxapp/ThreadUtilities.m
  65. +4 −5 src/java.desktop/macosx/native/libosxui/AquaFileView.m
  66. +0 −3 src/java.desktop/macosx/native/libosxui/AquaLookAndFeel.m
  67. +0 −1 src/java.desktop/macosx/native/libosxui/AquaNativeResources.m
  68. +1 −1 src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.m
  69. +1 −1 src/java.desktop/macosx/native/libosxui/JRSUIController.m
  70. +1 −1 src/java.desktop/macosx/native/libosxui/JRSUIFocus.m
  71. +0 −1 src/java.desktop/macosx/native/libosxui/ScreenMenu.h
  72. +17 −8 src/java.desktop/macosx/native/libosxui/ScreenMenu.m
  73. +6 −7 src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
  74. +44 −10 test/jdk/java/awt/Window/MainKeyWindowTest/libTestMainKeyWindow.m
@@ -101,7 +101,6 @@ ifeq ($(call isTargetOs, macosx), true)
-framework Cocoa \
-framework Security \
-framework ExceptionHandling \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework OpenGL \
-framework IOSurface \
@@ -127,7 +126,6 @@ ifeq ($(call isTargetOs, macosx), true)
-losxapp \
-framework Cocoa \
-framework ApplicationServices \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework SystemConfiguration \
$(JDKLIB_LIBS), \
@@ -160,7 +160,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
LIBS_macosx := -lmlib_image \
-framework Cocoa \
-framework OpenGL \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework ApplicationServices \
-framework AudioToolbox, \
@@ -767,8 +766,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
-framework ApplicationServices \
-framework Foundation \
-framework Security \
-framework Cocoa \
-framework JavaNativeFoundation
-framework Cocoa
else ifeq ($(call isTargetOs, windows), true)
LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib
else
@@ -866,7 +864,6 @@ ifeq ($(call isTargetOs, macosx), true)
-framework Cocoa \
-framework Security \
-framework ExceptionHandling \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-framework OpenGL \
-framework QuartzCore -ljava, \
@@ -904,7 +901,6 @@ ifeq ($(call isTargetOs, macosx), true)
-framework Cocoa \
-framework Carbon \
-framework ApplicationServices \
-framework JavaNativeFoundation \
-framework JavaRuntimeSupport \
-ljava -ljvm, \
))
@@ -78,7 +78,7 @@ endif
ifeq ($(call isTargetOs, macosx), true)
BUILD_JDK_JTREG_EXCLUDE += exelauncher.c
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := \
-framework Cocoa -framework JavaNativeFoundation
-framework Cocoa
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJniInvocationTest := -ljli
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestDynamicStore := \
-framework Cocoa -framework SystemConfiguration
@@ -29,7 +29,6 @@

#import "JNIUtilities.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <sys/time.h>
#import <Carbon/Carbon.h>

@@ -28,7 +28,6 @@
#import "LWCToolkit.h"
#import "JNIUtilities.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <QuartzCore/CATransaction.h>

@implementation AWTSurfaceLayers
@@ -35,7 +35,6 @@
#import "JNIUtilities.h"

#import <Carbon/Carbon.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

// keyboard layout
static NSString *kbdLayout;
@@ -135,7 +134,7 @@ - (void) viewDidMoveToWindow {

[AWTToolkit eventCountPlusPlus];

[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
[ThreadUtilities performOnMainThreadWaiting:NO block:^() {
[[self window] makeFirstResponder: self];
}];
if ([self window] != NULL) {
@@ -461,8 +460,8 @@ -(void) deliverJavaKeyEventHelper: (NSEvent *) event {
jstring characters = NULL;
jstring charactersIgnoringModifiers = NULL;
if ([event type] != NSFlagsChanged) {
characters = JNFNSToJavaString(env, [event characters]);
charactersIgnoringModifiers = JNFNSToJavaString(env, [event charactersIgnoringModifiers]);
characters = NSStringToJavaString(env, [event characters]);
charactersIgnoringModifiers = NSStringToJavaString(env, [event charactersIgnoringModifiers]);
}

DECLARE_CLASS(jc_NSEvent, "sun/lwawt/macosx/NSEvent");
@@ -575,10 +574,7 @@ - (jobject)awtComponent:(JNIEnv*)env
DECLARE_FIELD_RETURN(jf_Peer, jc_CPlatformView, "peer", "Lsun/lwawt/LWWindowPeer;", NULL);
if ((env == NULL) || (m_cPlatformView == NULL)) {
NSLog(@"Apple AWT : Error AWTView:awtComponent given bad parameters.");
if (env != NULL)
{
JNFDumpJavaStack(env);
}
NSLog(@"%@",[NSThread callStackSymbols]);
return NULL;
}

@@ -592,7 +588,7 @@ - (jobject)awtComponent:(JNIEnv*)env
DECLARE_FIELD_RETURN(jf_Target, jc_LWWindowPeer, "target", "Ljava/awt/Component;", NULL);
if (peer == NULL) {
NSLog(@"Apple AWT : Error AWTView:awtComponent got null peer from CPlatformView");
JNFDumpJavaStack(env);
NSLog(@"%@",[NSThread callStackSymbols]);
return NULL;
}
jobject comp = (*env)->GetObjectField(env, peer, jf_Target);
@@ -989,8 +985,8 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
}

DECLARE_METHOD(jm_insertText, jc_CInputMethod, "insertText", "(Ljava/lang/String;)V");
jstring insertedText = JNFNSToJavaString(env, useString);
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_insertText, insertedText); // AWT_THREADING Safe (AWTRunLoopMode)
jstring insertedText = NSStringToJavaString(env, useString);
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_insertText, insertedText);
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, insertedText);

@@ -1055,8 +1051,8 @@ - (void) setMarkedText:(id)aString selectedRange:(NSRange)selectionRange replace
// NSInputContext already did the analysis of the TSM event and created attributes indicating
// the underlining and color that should be done to the string. We need to look at the underline
// style and color to determine what kind of Java hilighting needs to be done.
jstring inProcessText = JNFNSToJavaString(env, incomingString);
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_startIMUpdate, inProcessText); // AWT_THREADING Safe (AWTRunLoopMode)
jstring inProcessText = NSStringToJavaString(env, incomingString);
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_startIMUpdate, inProcessText);
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, inProcessText);

@@ -1081,7 +1077,7 @@ - (void) setMarkedText:(id)aString selectedRange:(NSRange)selectionRange replace
isGray = !([underlineColorObj isEqual:[NSColor blackColor]]);

(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_addAttribute, isThickUnderline,
isGray, effectiveRange.location, effectiveRange.length); // AWT_THREADING Safe (AWTRunLoopMode)
isGray, effectiveRange.location, effectiveRange.length);
CHECK_EXCEPTION();
}
}
@@ -1096,7 +1092,7 @@ - (void) setMarkedText:(id)aString selectedRange:(NSRange)selectionRange replace
}

(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_dispatchText,
selectionRange.location, selectionRange.length, JNI_FALSE); // AWT_THREADING Safe (AWTRunLoopMode)
selectionRange.location, selectionRange.length, JNI_FALSE);
CHECK_EXCEPTION();
// If the marked text is being cleared (zero-length string) don't handle the key event.
if ([incomingString length] == 0) {
@@ -1118,7 +1114,7 @@ - (void) unmarkText
JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_CIM_CLASS();
DECLARE_METHOD(jm_unmarkText, jc_CInputMethod, "unmarkText", "()V");
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_unmarkText); // AWT_THREADING Safe (AWTRunLoopMode)
(*env)->CallVoidMethod(env, fInputMethodLOCKABLE, jm_unmarkText);
CHECK_EXCEPTION();
}

@@ -1171,10 +1167,10 @@ - (NSAttributedString *) attributedSubstringForProposedRange:(NSRange)theRange a

JNIEnv *env = [ThreadUtilities getJNIEnv];
DECLARE_METHOD_RETURN(jm_substringFromRange, jc_CInputMethod, "attributedSubstringFromRange", "(II)Ljava/lang/String;", nil);
jobject theString = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length); // AWT_THREADING Safe (AWTRunLoopMode)
jobject theString = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_substringFromRange, theRange.location, theRange.length);
CHECK_EXCEPTION_NULL_RETURN(theString, nil);

id result = [[[NSAttributedString alloc] initWithString:JNFJavaToNSString(env, theString)] autorelease];
id result = [[[NSAttributedString alloc] initWithString:JavaStringToNSString(env, theString)] autorelease];
#ifdef IM_DEBUG
NSLog(@"attributedSubstringFromRange returning \"%@\"", result);
#endif // IM_DEBUG
@@ -1205,7 +1201,7 @@ - (NSRange) markedRange
GET_CIM_CLASS_RETURN(range);
DECLARE_METHOD_RETURN(jm_markedRange, jc_CInputMethod, "markedRange", "()[I", range);

array = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_markedRange); // AWT_THREADING Safe (AWTRunLoopMode)
array = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_markedRange);
CHECK_EXCEPTION();

if (array) {
@@ -1246,7 +1242,7 @@ - (NSRange) selectedRange
fprintf(stderr, "AWTView InputMethod Selector Called : [selectedRange]\n");
#endif // IM_DEBUG

array = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_selectedRange); // AWT_THREADING Safe (AWTRunLoopMode)
array = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_selectedRange);
CHECK_EXCEPTION();
if (array) {
_array = (*env)->GetIntArrayElements(env, array, &isCopy);
@@ -1285,7 +1281,7 @@ - (NSRect) firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePoin
#endif // IM_DEBUG

array = (*env)->CallObjectMethod(env, fInputMethodLOCKABLE, jm_firstRectForCharacterRange,
theRange.location); // AWT_THREADING Safe (AWTRunLoopMode)
theRange.location);
CHECK_EXCEPTION();

_array = (*env)->GetIntArrayElements(env, array, &isCopy);
@@ -1326,7 +1322,7 @@ - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
#endif // IM_DEBUG

jint index = (*env)->CallIntMethod(env, fInputMethodLOCKABLE, jm_characterIndexForPoint,
(jint)flippedLocation.x, (jint)flippedLocation.y); // AWT_THREADING Safe (AWTRunLoopMode)
(jint)flippedLocation.x, (jint)flippedLocation.y);
CHECK_EXCEPTION();

#ifdef IM_DEBUG
@@ -24,7 +24,6 @@
*/

#import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

#import "sun_lwawt_macosx_CPlatformWindow.h"
#import "com_apple_eawt_event_GestureHandler.h"
@@ -1444,7 +1443,7 @@ + (AWTWindow *) lastKeyWindow {

NSWindow *nsWindow = OBJC(windowPtr);
[nsWindow performSelectorOnMainThread:@selector(setTitle:)
withObject:JNFJavaToNSString(env, jtitle)
withObject:JavaStringToNSString(env, jtitle)
waitUntilDone:NO];

JNI_COCOA_EXIT(env);
@@ -1520,7 +1519,7 @@ + (AWTWindow *) lastKeyWindow {
JNI_COCOA_ENTER(env);

NSWindow *nsWindow = OBJC(windowPtr);
NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)];
NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:NormalizedPathNSStringFromJavaString(env, filename)];
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[nsWindow setRepresentedURL:url];
}];
@@ -32,8 +32,6 @@
#import "com_apple_eawt__AppMenuBarHandler.h"
#import "com_apple_eawt__AppMiscHandlers.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>

#import "CPopupMenu.h"
#import "CMenuBar.h"
#import "ThreadUtilities.h"
@@ -290,10 +288,10 @@ - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEven

//fprintf(stderr,"jm_handleOpenURL\n");
JNIEnv *env = [ThreadUtilities getJNIEnv];
jstring jURL = JNFNSToJavaString(env, url);
jstring jURL = NSStringToJavaString(env, url);
GET_APPEVENTHANDLER_CLASS();
DECLARE_STATIC_METHOD(jm_handleOpenURI, sjc_AppEventHandler, "handleOpenURI", "(Ljava/lang/String;)V");
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handleOpenURI, jURL); // AWT_THREADING Safe (event)
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handleOpenURI, jURL);
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, jURL);

@@ -312,11 +310,11 @@ - (jobject)_createFilePathArrayFrom:(NSArray *)filenames withEnv:(JNIEnv *)env {
DECLARE_METHOD_RETURN(jm_ArrayList_ctor, sjc_ArrayList, "<init>", "(I)V", NULL);
DECLARE_METHOD_RETURN(jm_ArrayList_add, sjc_ArrayList, "add", "(Ljava/lang/Object;)Z", NULL);

jobject jFileNamesArray = (*env)->NewObject(env, sjc_ArrayList, jm_ArrayList_ctor, (jint)[filenames count]); // AWT_THREADING Safe (known object)
jobject jFileNamesArray = (*env)->NewObject(env, sjc_ArrayList, jm_ArrayList_ctor, (jint)[filenames count]);
CHECK_EXCEPTION_NULL_RETURN(jFileNamesArray, NULL);

for (NSString *filename in filenames) {
jstring jFileName = JNFNormalizedJavaStringForPath(env, filename);
jstring jFileName = NormalizedPathJavaStringFromNSString(env, filename);
(*env)->CallVoidMethod(env, jFileNamesArray, jm_ArrayList_add, jFileName);
CHECK_EXCEPTION();
}
@@ -338,7 +336,7 @@ - (void)application:(NSApplication *)theApplication openFiles:(NSArray *)fileNam
// if these files were opened from a Spotlight query, try to get the search text from the current AppleEvent
NSAppleEventDescriptor *currentEvent = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent];
NSString *searchString = [[currentEvent paramDescriptorForKeyword:keyAESearchText] stringValue];
jstring jSearchString = JNFNSToJavaString(env, searchString);
jstring jSearchString = NSStringToJavaString(env, searchString);

// convert the file names array
jobject jFileNamesArray = [self _createFilePathArrayFrom:fileNames withEnv:env];
@@ -365,7 +363,7 @@ - (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(
GET_APPEVENTHANDLER_CLASS_RETURN(NSPrintingCancelled);
DECLARE_STATIC_METHOD_RETURN(jm_handlePrintFile, sjc_AppEventHandler,
"handlePrintFiles", "(Ljava/util/List;)V", NSPrintingCancelled);
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handlePrintFile, jFileNamesArray); // AWT_THREADING Safe (event)
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handlePrintFile, jFileNamesArray);
CHECK_EXCEPTION();
(*env)->DeleteLocalRef(env, jFileNamesArray);

@@ -380,7 +378,7 @@ + (void)_notifyJava:(jint)notificationType {
JNIEnv *env = [ThreadUtilities getJNIEnv];
GET_APPEVENTHANDLER_CLASS();
DECLARE_STATIC_METHOD(jm_handleNativeNotification, sjc_AppEventHandler, "handleNativeNotification", "(I)V");
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handleNativeNotification, notificationType); // AWT_THREADING Safe (event)
(*env)->CallStaticVoidMethod(env, sjc_AppEventHandler, jm_handleNativeNotification, notificationType);
CHECK_EXCEPTION();
}

@@ -624,7 +622,7 @@ + (NSImage *)_dockIconImage {
[ThreadUtilities performOnMainThread:@selector(_registerForNotification:)
on:[ApplicationDelegate class]
withObject:[NSNumber numberWithInt:notificationType]
waitUntilDone:NO]; // AWT_THREADING Safe (non-blocking)
waitUntilDone:NO];
JNI_COCOA_EXIT(env);
}

@@ -714,7 +712,7 @@ + (NSImage *)_dockIconImage {
{
JNI_COCOA_ENTER(env);

NSString *badgeString = JNFJavaToNSString(env, badge);
NSString *badgeString = JavaStringToNSString(env, badge);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
NSDockTile *dockTile = [NSApp dockTile];
[dockTile setBadgeLabel:badgeString];
@@ -27,7 +27,6 @@
#import "ThreadUtilities.h"
#import "JNIUtilities.h"
#import <Cocoa/Cocoa.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

@interface CClipboard : NSObject { }
@property NSInteger changeCount;
@@ -99,7 +98,7 @@ - (void)checkPasteboard:(id)sender {
DECLARE_METHOD(jm_lostOwnership, jc_CClipboard, "notifyLostOwnership", "()V");
@synchronized(self) {
if (self.clipboardOwner) {
(*env)->CallVoidMethod(env, self.clipboardOwner, jm_lostOwnership); // AWT_THREADING Safe (event)
(*env)->CallVoidMethod(env, self.clipboardOwner, jm_lostOwnership);
CHECK_EXCEPTION();
(*env)->DeleteGlobalRef(env, self.clipboardOwner);
self.clipboardOwner = NULL;
@@ -26,7 +26,6 @@
#include "sun_lwawt_macosx_CCursorManager.h"

#include <Cocoa/Cocoa.h>
#include <JavaNativeFoundation/JavaNativeFoundation.h>

#include "GeomUtilities.h"
#include "ThreadUtilities.h"
@@ -75,7 +74,7 @@ static void setCursorOnAppKitThread(NSCursor *cursor) {
{
JNI_COCOA_ENTER(env);

NSString *cursorName = JNFJavaToNSString(env, name);
NSString *cursorName = JavaStringToNSString(env, name);
SEL cursorSelector = (type == sun_lwawt_macosx_CCursorManager_NAMED_CURSOR) ? lookupCursorSelectorForName(cursorName) : lookupCursorSelectorForType(type);
if (cursorSelector == nil) {
NSString *reason = [NSString stringWithFormat:@"unimplemented built-in cursor type: %d / %@", type, cursorName];
@@ -28,9 +28,6 @@

#import "JNIUtilities.h"

#import <JavaNativeFoundation/JavaNativeFoundation.h>


// ***** NOTE ***** This dictionary corresponds to the static array predefinedClipboardNames
// in CDataTransferer.java.
NSMutableDictionary *sStandardMappings = nil;
@@ -110,7 +107,7 @@ jlong registerFormatWithPasteboard(NSString *format) {
{
jlong returnValue = -1;
JNI_COCOA_ENTER(env);
returnValue = registerFormatWithPasteboard(JNFJavaToNSString(env, newformat));
returnValue = registerFormatWithPasteboard(JavaStringToNSString(env, newformat));
JNI_COCOA_EXIT(env);
return returnValue;
}
@@ -125,7 +122,7 @@ jlong registerFormatWithPasteboard(NSString *format) {
{
jstring returnValue = NULL;
JNI_COCOA_ENTER(env);
returnValue = JNFNSToJavaString(env, formatForIndex(index));
returnValue = NSStringToJavaString(env, formatForIndex(index));
JNI_COCOA_EXIT(env);
return returnValue;
}
@@ -138,7 +135,7 @@ static jobjectArray CreateJavaFilenameArray(JNIEnv *env, NSArray *filenameArray)
// Get the java.lang.String class object:
jclass stringClazz = (*env)->FindClass(env, "java/lang/String");
CHECK_NULL_RETURN(stringClazz, nil);
jobject jfilenameArray = (*env)->NewObjectArray(env, filenameCount, stringClazz, NULL); // AWT_THREADING Safe (known object)
jobject jfilenameArray = (*env)->NewObjectArray(env, filenameCount, stringClazz, NULL);
if ((*env)->ExceptionOccurred(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
Loading

0 comments on commit 8760688

Please sign in to comment.