Revision: 15889
          http://sourceforge.net/p/skim-app/code/15889
Author:   hofman
Date:     2025-12-17 22:50:23 +0000 (Wed, 17 Dec 2025)
Log Message:
-----------
remove conveniencce view method

Modified Paths:
--------------
    trunk/NSView_SKExtensions.h
    trunk/NSView_SKExtensions.m
    trunk/SKBookmarkController.m
    trunk/SKColorMenuView.m
    trunk/SKColorSwatch.m
    trunk/SKDownloadController.m
    trunk/SKGroupView.m
    trunk/SKLineWell.m
    trunk/SKLoupeController.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKMainWindowController_UI.m
    trunk/SKNavigationWindow.m
    trunk/SKNoteWindowController.m
    trunk/SKPDFView.m
    trunk/SKPresentationOptionsSheetController.m
    trunk/SKPresentationView.m

Modified: trunk/NSView_SKExtensions.h
===================================================================
--- trunk/NSView_SKExtensions.h 2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/NSView_SKExtensions.h 2025-12-17 22:50:23 UTC (rev 15889)
@@ -51,11 +51,6 @@
 
 @property (nonatomic, nullable, readonly) SKFontWell *activeFontWell;
 
-- (NSRect)convertRectToScreen:(NSRect)rect;
-- (NSRect)convertRectFromScreen:(NSRect)rect;
-- (NSPoint)convertPointToScreen:(NSPoint)point;
-- (NSPoint)convertPointFromScreen:(NSPoint)point;
-
 - (nullable NSBitmapImageRep *)bitmapImageRepCachingDisplay;
 
 - (void)addSubviewWithConstraints:(NSView *)view;

Modified: trunk/NSView_SKExtensions.m
===================================================================
--- trunk/NSView_SKExtensions.m 2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/NSView_SKExtensions.m 2025-12-17 22:50:23 UTC (rev 15889)
@@ -73,26 +73,6 @@
     return nil;
 }
 
-- (NSRect)convertRectToScreen:(NSRect)rect {
-    return [[self window] convertRectToScreen:[self convertRect:rect 
toView:nil]];
-}
-
-- (NSRect)convertRectFromScreen:(NSRect)rect {
-    return [self convertRect:[[self window] convertRectFromScreen:rect] 
fromView:nil];
-}
-
-- (NSPoint)convertPointToScreen:(NSPoint)point {
-    NSRect rect = NSZeroRect;
-    rect.origin = [self convertPoint:point toView:nil];
-    return [[self window] convertRectToScreen:rect].origin;
-}
-
-- (NSPoint)convertPointFromScreen:(NSPoint)point {
-    NSRect rect = NSZeroRect;
-    rect.origin = point;
-    return [self convertPoint:[[self window] 
convertRectFromScreen:rect].origin fromView:nil];
-}
-
 - (NSBitmapImageRep *)bitmapImageRepCachingDisplay {
     NSRect rect = [self bounds];
     NSBitmapImageRep *imageRep = [self 
bitmapImageRepForCachingDisplayInRect:rect];

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKBookmarkController.m        2025-12-17 22:50:23 UTC (rev 15889)
@@ -1359,7 +1359,7 @@
     if (item != nil && row != -1) {
         NSImageView *imageView = [[outlineView viewAtColumn:0 row:row 
makeIfNecessary:NO] imageView];
         if (imageView && NSIsEmptyRect([imageView visibleRect]) == NO)
-            iconRect = [imageView convertRectToScreen:[imageView bounds]];
+            iconRect = [[self window] convertRectToScreen:[imageView 
convertRect:[imageView bounds] toView:nil]];;
     }
     return iconRect;
 }

Modified: trunk/SKColorMenuView.m
===================================================================
--- trunk/SKColorMenuView.m     2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKColorMenuView.m     2025-12-17 22:50:23 UTC (rev 15889)
@@ -166,7 +166,7 @@
         NSMutableArray *array = [NSMutableArray array];
         [colors enumerateObjectsUsingBlock:^(NSColor *color, NSUInteger i, 
BOOL *stop){
             NSRect rect = [self rectAtIndex:i];
-            SKAccessibilityColorElement *element = 
[SKAccessibilityColorElement 
accessibilityElementWithRole:NSAccessibilityColorWellRole frame:[self 
convertRectToScreen:rect] label:[color accessibilityValue] parent:self];
+            SKAccessibilityColorElement *element = 
[SKAccessibilityColorElement 
accessibilityElementWithRole:NSAccessibilityColorWellRole frame:[[self window] 
convertRectToScreen:[self convertRect:rect toView:nil]] label:[color 
accessibilityValue] parent:self];
             [element setAccessibilityFrameInParentSpace:rect];
             [array addObject:element];
         }];

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKColorSwatch.m       2025-12-17 22:50:23 UTC (rev 15889)
@@ -781,7 +781,7 @@
 }
 
 - (NSRect)accessibilityFrame {
-    return [self convertRectToScreen:[self bounds]];
+    return [[self window] convertRectToScreen:[self convertRect:[self bounds] 
toView:nil]];
 }
 
 - (id)accessibilityParent {
@@ -810,7 +810,7 @@
 }
 
 - (id)accessibilityHitTest:(NSPoint)point {
-    NSPoint localPoint = [self convertPointFromScreen:point];
+    NSPoint localPoint = [self convertPoint:[[self window] 
convertPointFromScreen:point] fromView:nil];
     NSInteger i = [self colorIndexAtPoint:localPoint];
     if (i != -1) {
         return NSAccessibilityUnignoredAncestor([itemViews objectAtIndex:i]);
@@ -1054,7 +1054,7 @@
 }
 
 - (NSRect)accessibilityFrame {
-    return [self convertRectToScreen:[self bounds]];
+    return [[self window] convertRectToScreen:[self convertRect:[self bounds] 
toView:nil]];
 }
 
 - (id)accessibilityParent {

Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m        2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKDownloadController.m        2025-12-17 22:50:23 UTC (rev 15889)
@@ -615,7 +615,7 @@
     if (row != NSNotFound) {
         iconRect = [tableView frameOfCellAtColumn:0 row:row];
         if (NSIntersectsRect([tableView visibleRect], iconRect)) {
-            iconRect = [tableView convertRectToScreen:iconRect];
+            iconRect = [[self window] convertRectToScreen:[tableView 
convertRect:iconRect toView:nil]];
         } else {
             iconRect = NSZeroRect;
         }

Modified: trunk/SKGroupView.m
===================================================================
--- trunk/SKGroupView.m 2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKGroupView.m 2025-12-17 22:50:23 UTC (rev 15889)
@@ -54,7 +54,7 @@
 }
 
 - (NSRect)accessibilityFrame {
-    return [self convertRectToScreen:[self bounds]];
+    return [[self window] convertRectToScreen:[self convertRect:[self bounds] 
toView:nil]];
 }
 
 - (id)accessibilityParent {

Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m  2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKLineWell.m  2025-12-17 22:50:23 UTC (rev 15889)
@@ -626,7 +626,7 @@
 }
 
 - (NSRect)accessibilityFrame {
-    return [self convertRectToScreen:[self bounds]];
+    return [[self window] convertRectToScreen:[self convertRect:[self bounds] 
toView:nil]];
 }
 
 - (id)accessibilityParent {

Modified: trunk/SKLoupeController.m
===================================================================
--- trunk/SKLoupeController.m   2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKLoupeController.m   2025-12-17 22:50:23 UTC (rev 15889)
@@ -99,7 +99,7 @@
         CGColorRelease(borderColor);
     }
     
-    NSWindow *window = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:[pdfView convertRectToScreen:[pdfView bounds]]];
+    NSWindow *window = [[SKAnimatedBorderlessWindow alloc] 
initWithContentRect:[[pdfView window] convertRectToScreen:[pdfView 
convertRect:[pdfView bounds] toView:nil]]];
     [[window contentView] setLayer:layer];
     [[window contentView] setWantsLayer:YES];
     [window setHasShadow:YES];
@@ -176,7 +176,7 @@
 }
 
 - (void)update {
-    NSRect visibleRect = [pdfView convertRectToScreen:[pdfView 
unobscuredContentRect]];
+    NSRect visibleRect = [[pdfView window] convertRectToScreen:[pdfView 
convertRect:[pdfView unobscuredContentRect] toView:nil]];
     NSPoint mouseLoc = [NSEvent mouseLocation];
     
     if (NSPointInRect(mouseLoc, visibleRect)) {
@@ -238,12 +238,12 @@
 }
 
 - (void)drawLayer:(CALayer *)aLayer inContext:(CGContextRef)context {
-    NSPoint mouseLoc = [pdfView convertPointFromScreen:[NSEvent 
mouseLocation]];
+    NSPoint mouseLoc = [pdfView convertPoint:[[pdfView window] 
convertPointFromScreen:[NSEvent mouseLocation]] fromView:nil];
     
     if (NSPointInRect(mouseLoc, [pdfView unobscuredContentRect]) == NO)
         return;
     
-    NSRect magRect = [pdfView convertRectFromScreen:[[self window] frame]];
+    NSRect magRect = [pdfView convertRect:[[self window] 
convertRectFromScreen:[[self window] frame]] fromView:nil];
     
     CGFloat scaleFactor = [pdfView scaleFactor];
     CGColorRef shadowColor = NULL;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKMainWindowController.m      2025-12-17 22:50:23 UTC (rev 15889)
@@ -2510,7 +2510,7 @@
             rect.origin = 
SKBottomLeftPoint([rightSideController.snapshotTableView visibleRect]);
             rect.size.width = rect.size.height = 1.0;
         }
-        rect = [rightSideController.snapshotTableView 
convertRectToScreen:rect];
+        rect = [[self window] 
convertRectToScreen:[rightSideController.snapshotTableView convertRect:rect 
toView:nil]];
         if (shouldReopenRightSidePane) {
             [self toggleRightSidePane:nil];
             [[self window] enableFlushWindow];

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2025-12-17 22:22:35 UTC (rev 
15888)
+++ trunk/SKMainWindowController_FullScreen.m   2025-12-17 22:50:23 UTC (rev 
15889)
@@ -523,7 +523,7 @@
             if ((view = [item view]))
                 break;
     }
-    return view ? NSMaxY([view convertRectToScreen:[view frame]]) - 
NSMaxY([[view window] frame]) : 0.0;
+    return view ? NSMaxY([window convertRectToScreen:[view convertRect:[view 
bounds] toView:nil]]) - NSMaxY([[view window] frame]) : 0.0;
 }
 
 static inline CGFloat fullScreenOffset(NSWindow *window) {

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKMainWindowController_UI.m   2025-12-17 22:50:23 UTC (rev 15889)
@@ -427,7 +427,7 @@
         if (view) {
             // The docs say it uses screen coordinates when we pass a nil view.
             // In reality the coodinates are offset by the mouse postion 
relative to the top-left of the screen, it seems. Huh?
-            NSRect frame = [view convertRectToScreen:[view bounds]];
+            NSRect frame = [[view window] convertRectToScreen:[view 
convertRect:[view bounds] toView:nil]];
             frame.origin.x -= screenPoint.x - [session draggingLocation].x;
             frame.origin.y -= screenPoint.y - [session draggingLocation].y;
             NSArray *classes = @[[NSPasteboardItem class]];

Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m  2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKNavigationWindow.m  2025-12-17 22:50:23 UTC (rev 15889)
@@ -430,7 +430,7 @@
     view = aView;
     [[self contentView] setStringValue:toolTip];
     NSRect newFrame = NSZeroRect;
-    NSRect viewRect = [view convertRectToScreen:[view bounds]];
+    NSRect viewRect = [[view window] convertRectToScreen:[view 
convertRect:[view bounds] toView:nil]];
     newFrame.size = [[self contentView] fitSize];
     newFrame.origin = NSMakePoint(ceil(NSMidX(viewRect) - 0.5 * 
NSWidth(newFrame)), NSMaxY(viewRect) + LABEL_OFFSET);
     [self setFrame:newFrame display:YES];

Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m      2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKNoteWindowController.m      2025-12-17 22:50:23 UTC (rev 15889)
@@ -480,7 +480,7 @@
 }
 
 - (NSRect)previewPanel:(QLPreviewPanel *)panel 
sourceFrameOnScreenForPreviewItem:(id <QLPreviewItem>)item {
-    return [imageView convertRectToScreen:NSInsetRect([imageView bounds], 8.0, 
8.0)];
+    return [[self window] convertRectToScreen:[imageView 
convertRect:NSInsetRect([imageView bounds], 8.0, 8.0) toView:nil]];
 }
 
 - (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event {

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKPDFView.m   2025-12-17 22:50:23 UTC (rev 15889)
@@ -375,7 +375,7 @@
         NSRect visibleRect = [self unobscuredContentRect];
         NSView *docView = [self documentView];
         BOOL hasLinkToolTips = toolMode != SKToolModeMagnify;
-        NSPoint mouseLoc = [docView convertPointFromScreen:[NSEvent 
mouseLocation]];
+        NSPoint mouseLoc = [docView convertPoint:[[self window] 
convertPointFromScreen:[NSEvent mouseLocation]] fromView:nil];
         BOOL mouseInView = [[self window] isVisible] && 
NSMouseInRect(mouseLoc, [docView visibleRect], [docView isFlipped]);
         NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited | 
NSTrackingActiveInKeyWindow;
         PDFAnnotation *hoverAnnotation = nil;
@@ -2869,7 +2869,7 @@
             NSRect bounds = [annotation bounds]; 
             NSPoint point = NSMakePoint(NSMinX(bounds) + 
TOOLTIP_OFFSET_FRACTION * NSWidth(bounds), NSMinY(bounds) + 
TOOLTIP_OFFSET_FRACTION * NSHeight(bounds));
             point = [self convertPoint:point fromPage:[annotation page]];
-            point = [self convertPointToScreen:NSMakePoint(round(point.x), 
round(point.y))];
+            point = [[self window] convertPointToScreen:[self 
convertPoint:NSMakePoint(round(point.x), round(point.y)) toView:nil]];
             [[SKImageToolTipWindow sharedToolTipWindow] 
showForImageContext:annotation scale:[self scaleFactor] atPoint:point];
         } else {
             [[SKImageToolTipWindow sharedToolTipWindow] orderOut:self];
@@ -2917,7 +2917,7 @@
             NSRect bounds = [annotation bounds]; 
             NSPoint point = NSMakePoint(NSMinX(bounds) + 
TOOLTIP_OFFSET_FRACTION * NSWidth(bounds), NSMinY(bounds) + 
TOOLTIP_OFFSET_FRACTION * NSHeight(bounds));
             point = [self convertPoint:point fromPage:[annotation page]] ;
-            point = [self convertPointToScreen:NSMakePoint(round(point.x), 
round(point.y))];
+            point = [[self window] convertPointToScreen:[self 
convertPoint:NSMakePoint(round(point.x), round(point.y)) toView:nil]];
             [[SKImageToolTipWindow sharedToolTipWindow] 
showForImageContext:annotation scale:[self scaleFactor] atPoint:point];
         } else {
             [[SKImageToolTipWindow sharedToolTipWindow] orderOut:self];

Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m        2025-12-17 22:22:35 UTC 
(rev 15888)
+++ trunk/SKPresentationOptionsSheetController.m        2025-12-17 22:50:23 UTC 
(rev 15889)
@@ -506,7 +506,7 @@
     
     NSTableRowView *view = [tv rowViewAtRow:[rowIndexes firstIndex] 
makeIfNecessary:NO];
     if (view) {
-        NSRect frame = [view convertRectToScreen:[view bounds]];
+        NSRect frame = [[self window] convertRectToScreen:[view 
convertRect:[view bounds] toView:nil]];
         frame.origin.x -= screenPoint.x - [session draggingLocation].x;
         frame.origin.y -= screenPoint.y - [session draggingLocation].y;
         [session enumerateDraggingItemsWithOptions:0 forView:nil 
classes:@[[SKTransitionInfo class]] searchOptions:@{} 
usingBlock:^(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop){

Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m  2025-12-17 22:22:35 UTC (rev 15888)
+++ trunk/SKPresentationView.m  2025-12-17 22:50:23 UTC (rev 15889)
@@ -1094,7 +1094,7 @@
     if ([[page annotations] count] == 0)
         return nil;
     
-    NSPoint point = [self convertPointToPage:theEvent ? [self 
convertPoint:[theEvent locationInWindow] fromView:nil] : [self 
convertPointFromScreen:[NSEvent mouseLocation]]];
+    NSPoint point = [self convertPointToPage:[self convertPoint:(theEvent ? 
[theEvent locationInWindow] : [[self window] convertPointFromScreen:[NSEvent 
mouseLocation]]) fromView:nil]];
     
     for (PDFAnnotation *annotation in [[page annotations] 
reverseObjectEnumerator]) {
         if ([annotation isLink] && NSPointInRect(point, [annotation bounds]))

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