modules/javafx.graphics/src/main/native-glass/mac/GlassWindow+Java.m

Print this page




  52 @end
  53 
  54 @implementation GlassWindow (Java)
  55 
  56 #pragma mark --- Callbacks
  57 
  58 - (void)_sendJavaWindowMoveToAnotherScreenEventIfNeeded
  59 {
  60     NSScreen *newScreen = [self->nsWindow screen];
  61 
  62     // Update only if the newScreen isn't nil
  63     if (self->currentScreen != newScreen && newScreen != nil)
  64     {
  65         self->currentScreen = newScreen;
  66 
  67         GET_MAIN_JENV;
  68         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyMoveToAnotherScreen, createJavaScreen(env, newScreen));
  69     }
  70 }
  71 






  72 - (void)_sendJavaWindowMoveEventForFrame:(NSRect)frame
  73 {
  74     if (self->suppressWindowMoveEvent == NO)
  75     {
  76         self->lastReportedLocation = frame.origin;
  77 
  78         GET_MAIN_JENV;
  79 
  80         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyMove,
  81             (int)frame.origin.x,  (int)frame.origin.y, [self->nsWindow isZoomed]);
  82         [self _sendJavaWindowMoveToAnotherScreenEventIfNeeded];
  83     }
  84 }
  85 
  86 - (void)_sendJavaWindowResizeEvent:(int)type forFrame:(NSRect)frame
  87 {
  88     if (self->suppressWindowResizeEvent == NO)
  89     {
  90         GET_MAIN_JENV;
  91         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyResize,




  52 @end
  53 
  54 @implementation GlassWindow (Java)
  55 
  56 #pragma mark --- Callbacks
  57 
  58 - (void)_sendJavaWindowMoveToAnotherScreenEventIfNeeded
  59 {
  60     NSScreen *newScreen = [self->nsWindow screen];
  61 
  62     // Update only if the newScreen isn't nil
  63     if (self->currentScreen != newScreen && newScreen != nil)
  64     {
  65         self->currentScreen = newScreen;
  66 
  67         GET_MAIN_JENV;
  68         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyMoveToAnotherScreen, createJavaScreen(env, newScreen));
  69     }
  70 }
  71 
  72 - (void)_sendJavaWindowNotifyScaleChanged:(CGFloat)newScale
  73 {
  74     GET_MAIN_JENV;
  75     (*env)->CallVoidMethod(env, jWindow, jWindowNotifyScaleChanged, 1.0f, 1.0f, newScale, newScale);
  76 }
  77 
  78 - (void)_sendJavaWindowMoveEventForFrame:(NSRect)frame
  79 {
  80     if (self->suppressWindowMoveEvent == NO)
  81     {
  82         self->lastReportedLocation = frame.origin;
  83 
  84         GET_MAIN_JENV;
  85 
  86         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyMove,
  87             (int)frame.origin.x,  (int)frame.origin.y, [self->nsWindow isZoomed]);
  88         [self _sendJavaWindowMoveToAnotherScreenEventIfNeeded];
  89     }
  90 }
  91 
  92 - (void)_sendJavaWindowResizeEvent:(int)type forFrame:(NSRect)frame
  93 {
  94     if (self->suppressWindowResizeEvent == NO)
  95     {
  96         GET_MAIN_JENV;
  97         (*env)->CallVoidMethod(env, jWindow, jWindowNotifyResize,