jdk/src/macosx/native/com/apple/laf/ScreenMenu.m
changeset 13678 5c8001201f98
parent 12047 320a714614e9
child 23010 6dadb192ad81
equal deleted inserted replaced
13508:7c6aa31ff1b2 13678:5c8001201f98
    35 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
    35 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
    36 
    36 
    37 #import "ThreadUtilities.h"
    37 #import "ThreadUtilities.h"
    38 #import "CMenuBar.h"
    38 #import "CMenuBar.h"
    39 
    39 
    40 
    40 /* Use THIS_FILE when it is available. */
       
    41 #ifndef THIS_FILE
       
    42     #define THIS_FILE __FILE__     
       
    43 #endif 
       
    44  
    41 static JNF_CLASS_CACHE(sjc_ScreenMenu, "com/apple/laf/ScreenMenu");
    45 static JNF_CLASS_CACHE(sjc_ScreenMenu, "com/apple/laf/ScreenMenu");
    42 
    46 
    43 static jint ns2awtModifiers(NSUInteger keyMods) {
    47 static jint ns2awtModifiers(NSUInteger keyMods) {
    44     jint result = 0;
    48     jint result = 0;
    45     if (keyMods & NSShiftKeyMask)        result |= java_awt_Event_SHIFT_MASK;
    49     if (keyMods & NSShiftKeyMask)        result |= java_awt_Event_SHIFT_MASK;
    95 
    99 
    96 - (void)menuWillOpen:(NSMenu *)menu
   100 - (void)menuWillOpen:(NSMenu *)menu
    97 {
   101 {
    98     if (self.javaObjectWrapper == nil) {
   102     if (self.javaObjectWrapper == nil) {
    99 #ifdef DEBUG
   103 #ifdef DEBUG
   100         NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__);
   104         NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__);
   101 #endif
   105 #endif
   102         return;
   106         return;
   103     }
   107     }
   104 
   108 
   105     JNIEnv *env = [ThreadUtilities getJNIEnv];
   109     JNIEnv *env = [ThreadUtilities getJNIEnv];
   113 
   117 
   114 - (void)menuDidClose:(NSMenu *)menu
   118 - (void)menuDidClose:(NSMenu *)menu
   115 {
   119 {
   116     if (self.javaObjectWrapper == nil) {
   120     if (self.javaObjectWrapper == nil) {
   117 #ifdef DEBUG
   121 #ifdef DEBUG
   118         NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__);
   122         NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__);
   119 #endif
   123 #endif
   120         return;
   124         return;
   121     }
   125     }
   122 
   126 
   123     JNIEnv *env = [ThreadUtilities getJNIEnv];
   127     JNIEnv *env = [ThreadUtilities getJNIEnv];
   131 
   135 
   132 - (void)handleJavaMenuItemTargetedAtIndex:(NSUInteger)menuIndex rect:(NSRect)rect
   136 - (void)handleJavaMenuItemTargetedAtIndex:(NSUInteger)menuIndex rect:(NSRect)rect
   133 {
   137 {
   134     if (self.javaObjectWrapper == nil) {
   138     if (self.javaObjectWrapper == nil) {
   135 #ifdef DEBUG
   139 #ifdef DEBUG
   136         NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__);
   140         NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__);
   137 #endif
   141 #endif
   138         return;
   142         return;
   139     }
   143     }
   140 
   144 
   141     JNIEnv *env = [ThreadUtilities getJNIEnv];
   145     JNIEnv *env = [ThreadUtilities getJNIEnv];