< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m

Print this page
rev 54096 : 8259651: [macOS] Replace JNF_COCOA_ENTER/EXIT macros
rev 54098 : 8260616: Removing remaining JNF dependencies in the java.desktop module
8259729: Missed JNFInstanceOf -> IsInstanceOf conversion

*** 21,32 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #import <AppKit/AppKit.h> - #import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaRuntimeSupport/JavaRuntimeSupport.h> #import "CMenuBar.h" #import "CMenu.h" --- 21,33 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ + #import "JNIUtilities.h" + #import <AppKit/AppKit.h> #import <JavaRuntimeSupport/JavaRuntimeSupport.h> #import "CMenuBar.h" #import "CMenu.h"
*** 405,415 **** JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeCreateMenuBar (JNIEnv *env, jobject peer) { __block CMenuBar *aCMenuBar = nil; ! JNF_COCOA_ENTER(env); jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ --- 406,416 ---- JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeCreateMenuBar (JNIEnv *env, jobject peer) { __block CMenuBar *aCMenuBar = nil; ! JNI_COCOA_ENTER(env); jobject cPeerObjGlobal = (*env)->NewGlobalRef(env, peer); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
*** 418,428 **** }]; if (aCMenuBar == nil) { return 0L; } ! JNF_COCOA_EXIT(env); return ptr_to_jlong(aCMenuBar); } /* * Class: sun_lwawt_macosx_CMenuBar --- 419,429 ---- }]; if (aCMenuBar == nil) { return 0L; } ! JNI_COCOA_EXIT(env); return ptr_to_jlong(aCMenuBar); } /* * Class: sun_lwawt_macosx_CMenuBar
*** 432,445 **** JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeAddAtIndex (JNIEnv *env, jobject peer, jlong menuBarObject, jlong menuObject, jint index) { ! JNF_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaAddMenu:(CMenu *) jlong_to_ptr(menuObject) atIndex:index]; ! JNF_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CMenuBar * Method: nativeDelMenu --- 433,446 ---- JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeAddAtIndex (JNIEnv *env, jobject peer, jlong menuBarObject, jlong menuObject, jint index) { ! JNI_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaAddMenu:(CMenu *) jlong_to_ptr(menuObject) atIndex:index]; ! JNI_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CMenuBar * Method: nativeDelMenu
*** 447,460 **** */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeDelMenu (JNIEnv *env, jobject peer, jlong menuBarObject, jint index) { ! JNF_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaDeleteMenu: index]; ! JNF_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CMenuBar * Method: nativeSetHelpMenu --- 448,461 ---- */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeDelMenu (JNIEnv *env, jobject peer, jlong menuBarObject, jint index) { ! JNI_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaDeleteMenu: index]; ! JNI_COCOA_EXIT(env); } /* * Class: sun_lwawt_macosx_CMenuBar * Method: nativeSetHelpMenu
*** 462,471 **** */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeSetHelpMenu (JNIEnv *env, jobject peer, jlong menuBarObject, jlong menuObject) { ! JNF_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaSetHelpMenu: ((CMenu *)jlong_to_ptr(menuObject))]; ! JNF_COCOA_EXIT(env); } --- 463,472 ---- */ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CMenuBar_nativeSetHelpMenu (JNIEnv *env, jobject peer, jlong menuBarObject, jlong menuObject) { ! JNI_COCOA_ENTER(env); // Remove the specified item. [((CMenuBar *) jlong_to_ptr(menuBarObject)) javaSetHelpMenu: ((CMenu *)jlong_to_ptr(menuObject))]; ! JNI_COCOA_EXIT(env); }
< prev index next >