Revision: 15887
http://sourceforge.net/p/skim-app/code/15887
Author: hofman
Date: 2025-12-17 22:18:48 +0000 (Wed, 17 Dec 2025)
Log Message:
-----------
remove conveniencce event method
Modified Paths:
--------------
trunk/NSEvent_SKExtensions.h
trunk/NSEvent_SKExtensions.m
trunk/PDFView_SKExtensions.m
trunk/SKColorMenuView.m
trunk/SKColorSwatch.m
trunk/SKMainWindowController_UI.m
trunk/SKNoteOutlineView.m
trunk/SKPDFView.m
trunk/SKPresentationView.m
trunk/SKSecondaryPDFView.m
trunk/SKSideWindow.m
trunk/SKSnapshotPDFView.m
trunk/SKStatusBar.m
trunk/SKTableView.m
Modified: trunk/NSEvent_SKExtensions.h
===================================================================
--- trunk/NSEvent_SKExtensions.h 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/NSEvent_SKExtensions.h 2025-12-17 22:18:48 UTC (rev 15887)
@@ -53,7 +53,6 @@
@property (nonatomic, readonly) unichar firstCharacter;
-- (NSPoint)locationInView:(NSView *)view;
@property (nonatomic, readonly) NSPoint locationOnScreen;
@end
Modified: trunk/NSEvent_SKExtensions.m
===================================================================
--- trunk/NSEvent_SKExtensions.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/NSEvent_SKExtensions.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -59,10 +59,6 @@
return [characters length] > 0 ? [characters characterAtIndex:0] : 0;
}
-- (NSPoint)locationInView:(NSView *)view {
- return [view convertPoint:[self locationInWindow] fromView:nil];
-}
-
- (NSPoint)locationOnScreen {
NSRect rect = NSZeroRect;
rect.origin = [self locationInWindow];
Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/PDFView_SKExtensions.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -136,7 +136,7 @@
- (void)doDragContentWithEvent:(NSEvent *)theEvent {
NSView *contentView = [[self scrollView] contentView];
- NSPoint startLocation = [theEvent locationInView:contentView];
+ NSPoint startLocation = [contentView convertPoint:[theEvent
locationInWindow] fromView:nil];
[[NSCursor closedHandCursor] push];
@@ -147,7 +147,7 @@
break;
// convert takes flipping and scaling into account
- NSPoint newLocation = [theEvent locationInView:contentView];
+ NSPoint newLocation = [contentView convertPoint:[theEvent
locationInWindow] fromView:nil];
NSPoint point = SKAddPoints([contentView bounds].origin,
SKSubstractPoints(startLocation, newLocation));
[contentView scrollPoint:point];
@@ -178,7 +178,7 @@
[[[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kClippingTextType)] drawInRect:rect
fromRect:rect operation:NSCompositingOperationCopy fraction:1.0
respectFlipped:YES hints:nil];
}];
- NSRect dragFrame = SKRectFromCenterAndSize([theEvent locationInView:self],
[dragImage size]);
+ NSRect dragFrame = SKRectFromCenterAndSize([self convertPoint:[theEvent
locationInWindow] fromView:nil], [dragImage size]);
NSDraggingItem *dragItem = [[NSDraggingItem alloc]
initWithPasteboardWriter:[[self currentSelection] attributedString]];
[dragItem setDraggingFrame:dragFrame contents:dragImage];
@@ -188,7 +188,7 @@
}
- (PDFPage *)pageAndPoint:(NSPoint *)point forEvent:(NSEvent *)event
nearest:(BOOL)nearest {
- NSPoint p = [event locationInView:self];
+ NSPoint p = [self convertPoint:[event locationInWindow] fromView:nil];
PDFPage *page = [self pageForPoint:p nearest:nearest];
if (page && point)
*point = [self convertPoint:p toPage:page];
Modified: trunk/SKColorMenuView.m
===================================================================
--- trunk/SKColorMenuView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKColorMenuView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -39,7 +39,6 @@
#import "SKColorMenuView.h"
#import <Quartz/Quartz.h>
#import "NSColor_SKExtensions.h"
-#import "NSEvent_SKExtensions.h"
#import "PDFAnnotation_SKExtensions.h"
#import "NSView_SKExtensions.h"
@@ -136,13 +135,13 @@
}
- (void)mouseDown:(NSEvent *)theEvent {
- NSUInteger idx = [self indexForPoint:[theEvent locationInView:self]];
+ NSUInteger idx = [self indexForPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil]];
if (idx != NSNotFound) {
[self setHoveredIndex:idx];
NSRect rect = [self rectAtIndex:idx];
while (YES) {
theEvent = [[self window]
nextEventMatchingMask:NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
- BOOL inside = NSPointInRect([theEvent locationInView:self], rect);
+ BOOL inside = NSPointInRect([self convertPoint:[theEvent
locationInWindow] fromView:nil], rect);
[self setHoveredIndex:inside ? idx : NSNotFound];
if ([theEvent type] == NSEventTypeLeftMouseUp) {
if (inside) {
Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKColorSwatch.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -38,7 +38,6 @@
#import "SKColorSwatch.h"
#import "NSColor_SKExtensions.h"
-#import "NSEvent_SKExtensions.h"
#import "NSGeometry_SKExtensions.h"
#import "NSImage_SKExtensions.h"
#import "NSView_SKExtensions.h"
@@ -373,7 +372,7 @@
#pragma mark Event handling and actions
- (void)mouseDown:(NSEvent *)theEvent {
- NSPoint mouseLoc = [theEvent locationInView:self];
+ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSInteger i = [self colorIndexAtPoint:mouseLoc];
if (i != -1) {
@@ -403,7 +402,7 @@
[[NSBezierPath
bezierPathWithRoundedRect:NSInsetRect(rect, 0.5, 0.5) xRadius:r yRadius:r]
stroke];
}];
- NSRect rect = SKRectFromCenterAndSquareSize([theEvent
locationInView:self], 12.0);
+ NSRect rect = SKRectFromCenterAndSquareSize([self
convertPoint:[theEvent locationInWindow] fromView:nil], 12.0);
NSDraggingItem *dragItem = [[NSDraggingItem alloc]
initWithPasteboardWriter:color];
[dragItem setDraggingFrame:rect contents:image];
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKMainWindowController_UI.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -69,7 +69,6 @@
#import "NSColor_SKExtensions.h"
#import "SKSplitView.h"
#import "SKScrollView.h"
-#import "NSEvent_SKExtensions.h"
#import "SKDocumentController.h"
#import "NSError_SKExtensions.h"
#import "PDFView_SKExtensions.h"
@@ -333,7 +332,7 @@
if ([pdfView temporaryToolMode] != SKToolModeNone && [pdfView window] ==
window) {
if ([event type] == NSEventTypeLeftMouseDown) {
- NSView *view = [pdfView hitTest:[event locationInView:pdfView]];
+ NSView *view = [pdfView hitTest:[pdfView convertPoint:[event
locationInWindow] fromView:nil]];
if ([view isDescendantOf:[pdfView documentView]] == NO || [view
isKindOfClass:[NSTextView class]])
[pdfView setTemporaryToolMode:SKToolModeNone];
} else {
Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKNoteOutlineView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -38,7 +38,6 @@
#import "SKNoteOutlineView.h"
#import "SKTypeSelectHelper.h"
-#import "NSEvent_SKExtensions.h"
#import "SKApplication.h"
#import "NSGeometry_SKExtensions.h"
#import "NSMenu_SKExtensions.h"
@@ -120,7 +119,7 @@
- (void)mouseDown:(NSEvent *)theEvent {
if ([theEvent clickCount] == 1 && [[self delegate]
respondsToSelector:@selector(outlineView:heightOfRowByItem:)]) {
- NSPoint mouseLoc = [theEvent locationInView:self];
+ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSInteger row = [self rowAtPoint:mouseLoc];
id item = row != -1 ? [self itemAtRow:row] : nil;
@@ -134,7 +133,7 @@
while ([theEvent type] != NSEventTypeLeftMouseUp) {
theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
if ([theEvent type] == NSEventTypeLeftMouseDragged) {
- CGFloat currentHeight = fmax([self rowHeight],
round(startHeight + [theEvent locationInView:self].y - mouseLoc.y));
+ CGFloat currentHeight = fmax([self rowHeight],
round(startHeight + [self convertPoint:[theEvent locationInWindow]
fromView:nil].y - mouseLoc.y));
[self setRowHeight:currentHeight forItem:item];
[self noteHeightOfRowChanged:row animating:NO];
}
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKPDFView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -1925,7 +1925,7 @@
}
}
- NSValue *pointValue = [NSValue valueWithPoint:[theEvent
locationInView:self]];
+ NSValue *pointValue = [NSValue valueWithPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil]];
i = [menu indexOfItemWithTarget:self andAction:@selector(copy:)];
if (i != -1) {
@@ -4023,7 +4023,7 @@
// Old (current) annotation location and click point relative to it
NSRect originalBounds = [currentAnnotation bounds];
BOOL isLine = [currentAnnotation isLine];
- NSPoint mousePoint = [theEvent locationInView:self];
+ NSPoint mousePoint = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
PDFPage *page = [self pageForPoint:mousePoint nearest:YES];
NSPoint initialPoint = [self convertPoint:mousePoint toPage:page];
SKNoteType noteType = annotationMode;
@@ -4090,7 +4090,7 @@
[self beginNewUndoGroupIfNeeded];
draggedAnnotation = YES;
}
- mousePoint = [theEvent locationInView:self];
+ mousePoint = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
if (resizeHandle == SKRectEdgesNone) {
lastMouseEvent = theEvent;
[clipView autoscroll:lastMouseEvent];
@@ -4322,7 +4322,7 @@
[PDFAnnotation addPoint:point toSkimNotesPath:bezierPath];
}
- point = [self convertPoint:[theEvent locationInView:self]
toPage:page];
+ point = [self convertPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil] toPage:page];
if (isOption && wantsBreak == NO) {
NSInteger eltCount = [bezierPath elementCount];
@@ -4445,7 +4445,7 @@
NSRect newRect = initialRect;
NSPoint delta;
- newPoint = SKIntegralPoint([self convertPoint:[theEvent
locationInView:self] toPage:page]);
+ newPoint = SKIntegralPoint([self convertPoint:[self
convertPoint:[theEvent locationInWindow] fromView:nil] toPage:page]);
delta = SKSubstractPoints(newPoint, initialPoint);
if (resizeHandle) {
@@ -4589,7 +4589,7 @@
NSInteger lineAngle = [page lineDirectionAngle];
NSEvent *lastMouseEvent = theEvent;
- NSPoint lastMouseLoc = [theEvent locationInView:self];
+ NSPoint lastMouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSPoint point = [self convertPoint:lastMouseLoc toPage:page];
NSInteger lineOffset = [page indexOfLineRectAtPoint:point lower:YES] -
[readingBar currentLine];
NSDate *lastPageChangeDate = [NSDate distantPast];
@@ -4732,7 +4732,7 @@
- (NSRect)doSelectRectWithEvent:(NSEvent *)theEvent didDrag:(BOOL *)didDrag {
NSView *docView = [self documentView];
NSClipView *clipView = [[self scrollView] contentView];
- NSPoint startPoint = [theEvent locationInView:docView];
+ NSPoint startPoint = [docView convertPoint:[theEvent locationInWindow]
fromView:nil];
NSPoint currentPoint = startPoint;
NSRect selRect = {startPoint, NSZeroSize};
BOOL dragged = NO;
@@ -4751,7 +4751,7 @@
if ([theEvent type] == NSEventTypeLeftMouseDragged) {
// change mouseLoc
[clipView autoscroll:theEvent];
- currentPoint = [theEvent locationInView:docView];
+ currentPoint = [docView convertPoint:[theEvent locationInWindow]
fromView:nil];
dragged = YES;
}
Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKPresentationView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -955,7 +955,7 @@
[transform scaleBy:1.0 / scale];
[transform translateXBy:-NSMidX(bounds) yBy:-NSMidY(bounds)];
- NSPoint point = [transform transformPoint:[theEvent locationInView:self]];
+ NSPoint point = [transform transformPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil]];
NSWindow *window = [self window];
BOOL wasMouseCoalescingEnabled = [NSEvent isMouseCoalescingEnabled];
BOOL isOption = ([theEvent modifierFlags] & NSEventModifierFlagOption) !=
0;
@@ -1011,7 +1011,7 @@
[PDFAnnotation addPoint:point toSkimNotesPath:bezierPath];
}
- point = [transform transformPoint:[theEvent locationInView:self]];
+ point = [transform transformPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil]];
if (isOption && wantsBreak == NO) {
NSInteger eltCount = [bezierPath elementCount];
@@ -1094,7 +1094,7 @@
if ([[page annotations] count] == 0)
return nil;
- NSPoint point = [self convertPointToPage:theEvent ? [theEvent
locationInView:self] : [self convertPointFromScreen:[NSEvent mouseLocation]]];
+ NSPoint point = [self convertPointToPage:theEvent ? [self
convertPoint:[theEvent locationInWindow] fromView:nil] : [self
convertPointFromScreen:[NSEvent mouseLocation]]];
for (PDFAnnotation *annotation in [[page annotations]
reverseObjectEnumerator]) {
if ([annotation isLink] && NSPointInRect(point, [annotation bounds]))
Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKSecondaryPDFView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -721,7 +721,7 @@
PDFAreaOfInterest area = [super areaOfInterestForMouse:theEvent];
NSEventModifierFlags modifiers = [theEvent deviceIndependentModifierFlags];
- if ([controlView superview] && NSMouseInRect([theEvent
locationInView:controlView], [controlView bounds], [controlView isFlipped])) {
+ if ([controlView superview] && NSMouseInRect([controlView
convertPoint:[theEvent locationInWindow] fromView:nil], [controlView bounds],
[controlView isFlipped])) {
area = kPDFNoArea;
} else if ((modifiers & ~NSEventModifierFlagShift) ==
NSEventModifierFlagCommand) {
area = (area & kPDFPageArea) | SKSpecialToolArea;
Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKSideWindow.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -284,7 +284,7 @@
}
- (void)mouseDown:(NSEvent *)theEvent {
- if (NSMouseInRect([theEvent locationInView:self], [self resizeHandleRect],
[self isFlipped]))
+ if (NSMouseInRect([self convertPoint:[theEvent locationInWindow]
fromView:nil], [self resizeHandleRect], [self isFlipped]))
[(SKSideWindow *)[self window] resizeWithEvent:theEvent];
else
[super mouseDown:theEvent];
Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKSnapshotPDFView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -633,7 +633,7 @@
PDFAreaOfInterest area = [super areaOfInterestForMouse:theEvent];
NSEventModifierFlags modifiers = [theEvent deviceIndependentModifierFlags];
- if ([controlView superview] && NSMouseInRect([theEvent
locationInView:controlView], [controlView bounds], [controlView isFlipped])) {
+ if ([controlView superview] && NSMouseInRect([controlView
convertPoint:[theEvent locationInWindow] fromView:nil], [controlView bounds],
[controlView isFlipped])) {
area = kPDFNoArea;
} else if (modifiers == (NSEventModifierFlagCommand |
NSEventModifierFlagShift)) {
area = (area & kPDFPageArea) | SKSpecialToolArea;
Modified: trunk/SKStatusBar.m
===================================================================
--- trunk/SKStatusBar.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKStatusBar.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -39,7 +39,6 @@
#import "SKStatusBar.h"
#import "NSGeometry_SKExtensions.h"
#import "SKStringConstants.h"
-#import "NSEvent_SKExtensions.h"
#import "SKApplication.h"
#import "NSView_SKExtensions.h"
#import <Quartz/Quartz.h>
@@ -333,7 +332,7 @@
BOOL inside = YES;
while ([theEvent type] != NSEventTypeLeftMouseUp) {
theEvent = [[self window] nextEventMatchingMask:
NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp | NSEventMaskMouseEntered
| NSEventMaskMouseExited];
- inside = NSMouseInRect([theEvent locationInView:self], bounds,
[self isFlipped]);
+ inside = NSMouseInRect([self convertPoint:[theEvent
locationInWindow] fromView:nil], bounds, [self isFlipped]);
if (inside != [(SKStatusTextFieldCell *)[self cell] isUnderlined])
{
[(SKStatusTextFieldCell *)[self cell] setUnderlined:inside];
[self setNeedsDisplay:YES];
Modified: trunk/SKTableView.m
===================================================================
--- trunk/SKTableView.m 2025-12-17 18:01:59 UTC (rev 15886)
+++ trunk/SKTableView.m 2025-12-17 22:18:48 UTC (rev 15887)
@@ -114,10 +114,10 @@
[[SKImageToolTipWindow sharedToolTipWindow] remove];
if ([self selectionHighlightStyle] ==
NSTableViewSelectionHighlightStyleSourceList) {
if ([self allowsMultipleSelection] == NO && [theEvent
deviceIndependentModifierFlags] == NSEventModifierFlagCommand && [[self
delegate] respondsToSelector:@selector(tableView:commandSelectRow:)]) {
- NSInteger row = [self rowAtPoint:[theEvent locationInView:self]];
+ NSInteger row = [self rowAtPoint:[self convertPoint:[theEvent
locationInWindow] fromView:nil]];
if (row != -1 && [NSApp willDragMouse] == NO && [[self delegate]
tableView:self commandSelectRow:row])
return;
- } else if ([self allowsEmptySelection] && [theEvent
deviceIndependentModifierFlags] == 0 && [self rowAtPoint:[theEvent
locationInView:self]] == -1 && [self rowAtPoint:[theEvent locationInView:self]]
== -1 && [NSApp willDragMouse] == NO) {
+ } else if ([self allowsEmptySelection] && [theEvent
deviceIndependentModifierFlags] == 0 && [self rowAtPoint:[self
convertPoint:[theEvent locationInWindow] fromView:nil]] == -1 && [self
rowAtPoint:[self convertPoint:[theEvent locationInWindow] fromView:nil]] == -1
&& [NSApp willDragMouse] == NO) {
[self deselectAll:nil];
return;
}
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