< prev index next >

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

Print this page




 933                         static JNF_MEMBER_CACHE(jm_orderAboveSiblings, jc_CPlatformWindow, "orderAboveSiblings", "()V");
 934                         JNFCallVoidMethod(env,platformWindow, jm_orderAboveSiblings);
 935                         (*env)->DeleteLocalRef(env, platformWindow);
 936                     }
 937                 }
 938                 [self orderChildWindows:YES];
 939             }
 940 
 941             NSPoint p = [NSEvent mouseLocation];
 942             NSRect frame = [self.nsWindow frame];
 943             NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame];
 944 
 945             // Check if the click happened in the non-client area (title bar)
 946             if (p.y >= (frame.origin.y + contentRect.size.height)) {
 947                 JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
 948                 jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
 949                 if (platformWindow != NULL) {
 950                     // Currently, no need to deliver the whole NSEvent.
 951                     static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V");
 952                     JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown);





 953                     (*env)->DeleteLocalRef(env, platformWindow);
 954                 }
 955             }
 956         }
 957 }
 958 
 959 - (void)constrainSize:(NSSize*)size {
 960     float minWidth = 0.f, minHeight = 0.f;
 961 
 962     if (IS(self.styleBits, DECORATED)) {
 963         NSRect frame = [self.nsWindow frame];
 964         NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]];
 965 
 966         float top = frame.size.height - contentRect.size.height;
 967         float left = contentRect.origin.x - frame.origin.x;
 968         float bottom = contentRect.origin.y - frame.origin.y;
 969         float right = frame.size.width - (contentRect.size.width + left);
 970 
 971         // Speculative estimation: 80 - enough for window decorations controls
 972         minWidth += left + right + 80;




 933                         static JNF_MEMBER_CACHE(jm_orderAboveSiblings, jc_CPlatformWindow, "orderAboveSiblings", "()V");
 934                         JNFCallVoidMethod(env,platformWindow, jm_orderAboveSiblings);
 935                         (*env)->DeleteLocalRef(env, platformWindow);
 936                     }
 937                 }
 938                 [self orderChildWindows:YES];
 939             }
 940 
 941             NSPoint p = [NSEvent mouseLocation];
 942             NSRect frame = [self.nsWindow frame];
 943             NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame];
 944 
 945             // Check if the click happened in the non-client area (title bar)
 946             if (p.y >= (frame.origin.y + contentRect.size.height)) {
 947                 JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
 948                 jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
 949                 if (platformWindow != NULL) {
 950                     // Currently, no need to deliver the whole NSEvent.
 951                     static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V");
 952                     JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown);
 953                     // Deliver double click on title bar
 954                     if ([event clickCount] > 1) {
 955                         static JNF_MEMBER_CACHE(jm_deliverDoubleClickOnTitlebar, jc_CPlatformWindow, "deliverDoubleClickOnTitlebar", "()V");
 956                         JNFCallVoidMethod(env, platformWindow, jm_deliverDoubleClickOnTitlebar);
 957                     }
 958                     (*env)->DeleteLocalRef(env, platformWindow);
 959                 }
 960             }
 961         }
 962 }
 963 
 964 - (void)constrainSize:(NSSize*)size {
 965     float minWidth = 0.f, minHeight = 0.f;
 966 
 967     if (IS(self.styleBits, DECORATED)) {
 968         NSRect frame = [self.nsWindow frame];
 969         NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]];
 970 
 971         float top = frame.size.height - contentRect.size.height;
 972         float left = contentRect.origin.x - frame.origin.x;
 973         float bottom = contentRect.origin.y - frame.origin.y;
 974         float right = frame.size.width - (contentRect.size.width + left);
 975 
 976         // Speculative estimation: 80 - enough for window decorations controls
 977         minWidth += left + right + 80;


< prev index next >