OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / macosx / HBPreviewController.m
index cc0e738..c6421d0 100644 (file)
     MaxOutputWidth = title->width - job->crop[2] - job->crop[3];
     MaxOutputHeight = title->height - job->crop[0] - job->crop[1];
     [self SettingsChanged: nil];
+    
+    /* set the top of the hud controller boxes centered vertically with the origin of our window */
+    NSPoint hudControlBoxOrigin = [fPictureControlBox frame].origin;
+    hudControlBoxOrigin.y = ([[self window] frame].size.height / 2) - [fPictureControlBox frame].size.height;
+    [fPictureControlBox setFrameOrigin:hudControlBoxOrigin];
+    [fEncodingControlBox setFrameOrigin:hudControlBoxOrigin];
 
 }
 
 }
 
 
-
+- (IBAction)goWindowedScreen:(id)sender
+{
+    
+    /* Get the screen info to release the display but don't actually do
+     * it until the windowed screen is setup.
+     */
+    scaleToScreen = NO;
+    [self pictureSliderChanged:nil];
+    [fScaleToScreenToggleButton setTitle:@"<->"];
+        
+    NSScreen* mainScreen = [NSScreen mainScreen]; 
+    NSDictionary* screenInfo = [mainScreen deviceDescription]; 
+    NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"];
+    CGDirectDisplayID displayID = (CGDirectDisplayID)[screenID longValue]; 
+    
+    [fFullScreenWindow dealloc];
+    [fFullScreenWindow release];
+    
+    
+    [fPreviewWindow setContentView:fPictureViewArea]; 
+    [fPictureViewArea setNeedsDisplay:YES];
+    [self setWindow:fPreviewWindow];
+    
+    // Show the window. 
+    [fPreviewWindow makeKeyAndOrderFront:self];
+    
+    /* Set the window back to regular level */
+    [fPreviewWindow setLevel:NSNormalWindowLevel];
+    
+    /* Set the isFullScreen flag back to NO */
+    //isFullScreen = NO;
+    scaleToScreen = NO;
+    /* make sure we are set to a still preview */
+    [self pictureSliderChanged:nil];
+    [self showPreviewWindow:nil];
+    
+    /* Change the name of fFullScreenToggleButton appropriately */
+    //[fFullScreenToggleButton setTitle: @"Full Screen"];
+    // [fScaleToScreenToggleButton setHidden:YES];
+    /* set the picture settings pallete back to normal level */
+    [fHBController picturePanelWindowed];
+    
+    /* Release the display now that the we are back in windowed mode */
+    CGDisplayRelease(displayID);
+    
+    [fPreviewWindow setAcceptsMouseMovedEvents:YES];
+    //[fFullScreenWindow setAcceptsMouseMovedEvents:NO];
+    
+    hudTimerSeconds = 0;
+    [self startHudTimer];
+    
+}
 
 
 #pragma mark Still Preview Image Processing
     
     [fPictureView setFrameOrigin:origin];
     
-    /* set the top of the hud controller boxes centered vertically with the origin of our window */
-    NSPoint hudControlBoxOrigin = [fPictureControlBox frame].origin;
-    hudControlBoxOrigin.y = ([[self window] frame].size.height / 2) - [fPictureControlBox frame].size.height;
-    [fPictureControlBox setFrameOrigin:hudControlBoxOrigin];
-    [fEncodingControlBox setFrameOrigin:hudControlBoxOrigin];
 }