< prev index next >
src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSourceContextPeer.m
Print this page
rev 54096 : 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros
rev 54097 : 8259869: [macOS] Remove desktop module dependencies on JNF Reference APIs
rev 54098 : 8260616: Removing remaining JNF dependencies in the java.desktop module
8259729: Missed JNFInstanceOf -> IsInstanceOf conversion
@@ -23,11 +23,11 @@
* questions.
*/
#import "sun_lwawt_macosx_CDragSourceContextPeer.h"
-#import <JavaNativeFoundation/JavaNativeFoundation.h>
+#import "JNIUtilities.h"
#import "CDragSource.h"
#import "ThreadUtilities.h"
@@ -44,19 +44,19 @@
jint jsourceactions, jlongArray jformats, jobject jformatmap)
{
id controlObj = (id) jlong_to_ptr(jnativepeer);
__block CDragSource* dragSource = nil;
-JNF_COCOA_ENTER(env);
+JNI_COCOA_ENTER(env);
// Global references are disposed when the DragSource is removed
- jobject gComponent = JNFNewGlobalRef(env, jcomponent);
- jobject gDragSourceContextPeer = JNFNewGlobalRef(env, jthis);
- jobject gTransferable = JNFNewGlobalRef(env, jtransferable);
- jobject gTriggerEvent = JNFNewGlobalRef(env, jtrigger);
- jlongArray gFormats = JNFNewGlobalRef(env, jformats);
- jobject gFormatMap = JNFNewGlobalRef(env, jformatmap);
+ jobject gComponent = (*env)->NewGlobalRef(env, jcomponent);
+ jobject gDragSourceContextPeer = (*env)->NewGlobalRef(env, jthis);
+ jobject gTransferable = (*env)->NewGlobalRef(env, jtransferable);
+ jobject gTriggerEvent = (*env)->NewGlobalRef(env, jtrigger);
+ jlongArray gFormats = (*env)->NewGlobalRef(env, jformats);
+ jobject gFormatMap = (*env)->NewGlobalRef(env, jformatmap);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
dragSource = [[CDragSource alloc] init:gDragSourceContextPeer
component:gComponent
control:controlObj
@@ -72,11 +72,11 @@
dragImageOffsetY:jdragimageoffsety
sourceActions:jsourceactions
formats:gFormats
formatMap:gFormatMap];
}];
-JNF_COCOA_EXIT(env);
+JNI_COCOA_EXIT(env);
return ptr_to_jlong(dragSource);
}
/*
@@ -89,13 +89,13 @@
{
AWT_ASSERT_NOT_APPKIT_THREAD;
CDragSource* dragSource = (CDragSource*) jlong_to_ptr(nativeDragSourceVal);
-JNF_COCOA_ENTER(env);
+JNI_COCOA_ENTER(env);
[dragSource drag];
-JNF_COCOA_EXIT(env);
+JNI_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CDragSourceContextPeer
* Method: releaseNativeDragSource
@@ -104,9 +104,9 @@
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_releaseNativeDragSource
(JNIEnv *env, jobject jthis, jlong nativeDragSourceVal)
{
CDragSource* dragSource = (CDragSource*) jlong_to_ptr(nativeDragSourceVal);
-JNF_COCOA_ENTER(env);
+JNI_COCOA_ENTER(env);
[dragSource removeFromView:env];
-JNF_COCOA_EXIT(env);
+JNI_COCOA_EXIT(env);
}
< prev index next >