Revision: 13379
          http://sourceforge.net/p/skim-app/code/13379
Author:   hofman
Date:     2023-03-16 17:21:09 +0000 (Thu, 16 Mar 2023)
Log Message:
-----------
move function implementation

Modified Paths:
--------------
    trunk/SKMainWindowController_FullScreen.m

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2023-03-16 17:11:29 UTC (rev 
13378)
+++ trunk/SKMainWindowController_FullScreen.m   2023-03-16 17:21:09 UTC (rev 
13379)
@@ -351,6 +351,32 @@
     [fullScreenWindow orderOut:nil];
 }
 
+static NSImage *imageForWindow(NSWindow *window) {
+    NSRect frame = [window frame];
+    CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
+    if (([window styleMask] & NSWindowStyleMaskFullScreen) != 0 && 
autoHideToolbarInFullScreen == NO && [[window toolbar] isVisible]) {
+        NSWindow *tbWindow = nil;
+        for (tbWindow in [window childWindows])
+            if ([NSStringFromClass([tbWindow class]) 
containsString:@"Toolbar"])
+                break;
+        if (tbWindow) {
+            CGImageRef tbCgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[tbWindow windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
+            size_t width = CGImageGetWidth(cgImage), height = 
CGImageGetHeight(cgImage);
+            size_t tbWidth = CGImageGetWidth(tbCgImage), tbHeight = 
CGImageGetHeight(tbCgImage);
+            CGContextRef ctx = CGBitmapContextCreate(NULL, width, height, 8, 4 
* width, CGImageGetColorSpace(cgImage), kCGBitmapByteOrder32Host | 
kCGImageAlphaPremultipliedFirst);
+            CGContextDrawImage(ctx, CGRectMake(0.0, 0.0, width, height), 
cgImage);
+            CGContextDrawImage(ctx, CGRectMake(0.0, height - tbHeight, 
tbWidth, tbHeight), tbCgImage);
+            CGImageRelease(tbCgImage);
+            CGImageRelease(cgImage);
+            cgImage = CGBitmapContextCreateImage(ctx);
+            CGContextRelease(ctx);
+        }
+    }
+    NSImage *image = [[NSImage alloc] initWithCGImage:cgImage size:frame.size];
+    CGImageRelease(cgImage);
+    return [image autorelease];
+}
+
 #pragma mark API
 
 - (void)enterFullscreen {
@@ -560,32 +586,6 @@
     return 0.0;
 }
 
-static NSImage *imageForWindow(NSWindow *window) {
-    NSRect frame = [window frame];
-    CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
-    if (([window styleMask] & NSWindowStyleMaskFullScreen) != 0 && 
autoHideToolbarInFullScreen == NO && [[window toolbar] isVisible]) {
-        NSWindow *tbWindow = nil;
-        for (tbWindow in [window childWindows])
-            if ([NSStringFromClass([tbWindow class]) 
containsString:@"Toolbar"])
-                break;
-        if (tbWindow) {
-            CGImageRef tbCgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[tbWindow windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
-            size_t width = CGImageGetWidth(cgImage), height = 
CGImageGetHeight(cgImage);
-            size_t tbWidth = CGImageGetWidth(tbCgImage), tbHeight = 
CGImageGetHeight(tbCgImage);
-            CGContextRef ctx = CGBitmapContextCreate(NULL, width, height, 8, 4 
* width, CGImageGetColorSpace(cgImage), kCGBitmapByteOrder32Host | 
kCGImageAlphaPremultipliedFirst);
-            CGContextDrawImage(ctx, CGRectMake(0.0, 0.0, width, height), 
cgImage);
-            CGContextDrawImage(ctx, CGRectMake(0.0, height - tbHeight, 
tbWidth, tbHeight), tbCgImage);
-            CGImageRelease(tbCgImage);
-            CGImageRelease(cgImage);
-            cgImage = CGBitmapContextCreateImage(ctx);
-            CGContextRelease(ctx);
-        }
-    }
-    NSImage *image = [[NSImage alloc] initWithCGImage:cgImage size:frame.size];
-    CGImageRelease(cgImage);
-    return [image autorelease];
-}
-
 - (void)windowWillEnterFullScreen:(NSNotification *)notification {
     mwcFlags.isSwitchingFullScreen = 1;
     interactionMode = SKFullScreenMode;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to