< prev index next >

modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m

Print this page




1027 
1028 - (void)sendJavaFullScreenEvent:(BOOL)entered withNativeWidget:(BOOL)isNative
1029 {
1030     if (isNative) {
1031         // Must be done before sending the event to Java since the event handler
1032         // may re-request the operation.
1033         if (entered) {
1034             self->nativeFullScreenModeWindow = [[self->nsView window] retain];
1035         } else {
1036             [self->nativeFullScreenModeWindow release];
1037             self->nativeFullScreenModeWindow = nil;
1038         }
1039     }
1040 
1041     GET_MAIN_JENV;
1042     (*env)->CallVoidMethod(env, self->jView, jViewNotifyEvent,
1043             entered ? com_sun_glass_events_ViewEvent_FULLSCREEN_ENTER : com_sun_glass_events_ViewEvent_FULLSCREEN_EXIT);
1044     GLASS_CHECK_EXCEPTION(env);
1045 }
1046 















1047 /*
1048  The hierarchy for our view is view -> superview (host) -> window
1049 
1050  1. create superview (new host) for our view
1051  2. create fullscreen window with the new superview
1052  3. create the background window (for fading out the desktop)
1053  4. remove our view from the window superview and insert it into the fullscreen window superview
1054  5. show our fullscreen window (and hide the original window)
1055  6. attach to it our background window (which will show it as well)
1056  7. zoom out our fullscreen window and at the same time animate the background window transparency
1057  8. enter fullscreen
1058  */
1059 - (void)enterFullscreenWithAnimate:(BOOL)animate withKeepRatio:(BOOL)keepRatio withHideCursor:(BOOL)hideCursor
1060 {
1061     LOG("GlassViewDelegate enterFullscreenWithAnimate:%d withKeepRatio:%d withHideCursor:%d", animate, keepRatio, hideCursor);
1062 
1063     if ([[self->nsView window] isKindOfClass:[GlassEmbeddedWindow class]] == NO)
1064     {
1065         [[self->nsView window] toggleFullScreen:self];
1066         // wait until the operation is complete




1027 
1028 - (void)sendJavaFullScreenEvent:(BOOL)entered withNativeWidget:(BOOL)isNative
1029 {
1030     if (isNative) {
1031         // Must be done before sending the event to Java since the event handler
1032         // may re-request the operation.
1033         if (entered) {
1034             self->nativeFullScreenModeWindow = [[self->nsView window] retain];
1035         } else {
1036             [self->nativeFullScreenModeWindow release];
1037             self->nativeFullScreenModeWindow = nil;
1038         }
1039     }
1040 
1041     GET_MAIN_JENV;
1042     (*env)->CallVoidMethod(env, self->jView, jViewNotifyEvent,
1043             entered ? com_sun_glass_events_ViewEvent_FULLSCREEN_ENTER : com_sun_glass_events_ViewEvent_FULLSCREEN_EXIT);
1044     GLASS_CHECK_EXCEPTION(env);
1045 }
1046 
1047 - (void)setResizableForFullscreen:(BOOL)resizable
1048 {
1049     NSWindow* window =  [self->nsView window];
1050     if ([window isKindOfClass:[GlassEmbeddedWindow class]] == NO
1051         && !((GlassWindow*) window)->isResizable) {
1052         NSUInteger mask = [window styleMask];
1053         if (resizable) {
1054             mask |= NSResizableWindowMask;
1055         } else {
1056             mask &= ~(NSUInteger)NSResizableWindowMask;
1057         }
1058         [window setStyleMask: mask];
1059     }
1060 }
1061 
1062 /*
1063  The hierarchy for our view is view -> superview (host) -> window
1064 
1065  1. create superview (new host) for our view
1066  2. create fullscreen window with the new superview
1067  3. create the background window (for fading out the desktop)
1068  4. remove our view from the window superview and insert it into the fullscreen window superview
1069  5. show our fullscreen window (and hide the original window)
1070  6. attach to it our background window (which will show it as well)
1071  7. zoom out our fullscreen window and at the same time animate the background window transparency
1072  8. enter fullscreen
1073  */
1074 - (void)enterFullscreenWithAnimate:(BOOL)animate withKeepRatio:(BOOL)keepRatio withHideCursor:(BOOL)hideCursor
1075 {
1076     LOG("GlassViewDelegate enterFullscreenWithAnimate:%d withKeepRatio:%d withHideCursor:%d", animate, keepRatio, hideCursor);
1077 
1078     if ([[self->nsView window] isKindOfClass:[GlassEmbeddedWindow class]] == NO)
1079     {
1080         [[self->nsView window] toggleFullScreen:self];
1081         // wait until the operation is complete


< prev index next >