< 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,33 **** * questions. */ #import "sun_lwawt_macosx_CDragSourceContextPeer.h" ! #import <JavaNativeFoundation/JavaNativeFoundation.h> #import "CDragSource.h" #import "ThreadUtilities.h" --- 23,33 ---- * questions. */ #import "sun_lwawt_macosx_CDragSourceContextPeer.h" ! #import "JNIUtilities.h" #import "CDragSource.h" #import "ThreadUtilities.h"
*** 44,62 **** jint jsourceactions, jlongArray jformats, jobject jformatmap) { id controlObj = (id) jlong_to_ptr(jnativepeer); __block CDragSource* dragSource = nil; ! JNF_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); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ dragSource = [[CDragSource alloc] init:gDragSourceContextPeer component:gComponent control:controlObj --- 44,62 ---- jint jsourceactions, jlongArray jformats, jobject jformatmap) { id controlObj = (id) jlong_to_ptr(jnativepeer); __block CDragSource* dragSource = nil; ! JNI_COCOA_ENTER(env); // Global references are disposed when the DragSource is removed ! 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,82 **** dragImageOffsetY:jdragimageoffsety sourceActions:jsourceactions formats:gFormats formatMap:gFormatMap]; }]; ! JNF_COCOA_EXIT(env); return ptr_to_jlong(dragSource); } /* --- 72,82 ---- dragImageOffsetY:jdragimageoffsety sourceActions:jsourceactions formats:gFormats formatMap:gFormatMap]; }]; ! JNI_COCOA_EXIT(env); return ptr_to_jlong(dragSource); } /*
*** 89,101 **** { AWT_ASSERT_NOT_APPKIT_THREAD; CDragSource* dragSource = (CDragSource*) jlong_to_ptr(nativeDragSourceVal); ! JNF_COCOA_ENTER(env); [dragSource drag]; ! JNF_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CDragSourceContextPeer * Method: releaseNativeDragSource --- 89,101 ---- { AWT_ASSERT_NOT_APPKIT_THREAD; CDragSource* dragSource = (CDragSource*) jlong_to_ptr(nativeDragSourceVal); ! JNI_COCOA_ENTER(env); [dragSource drag]; ! JNI_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CDragSourceContextPeer * Method: releaseNativeDragSource
*** 104,112 **** 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); [dragSource removeFromView:env]; ! JNF_COCOA_EXIT(env); } --- 104,112 ---- JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_releaseNativeDragSource (JNIEnv *env, jobject jthis, jlong nativeDragSourceVal) { CDragSource* dragSource = (CDragSource*) jlong_to_ptr(nativeDragSourceVal); ! JNI_COCOA_ENTER(env); [dragSource removeFromView:env]; ! JNI_COCOA_EXIT(env); }
< prev index next >