You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
| 2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
| 2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
| 2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
| 2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
| 2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
| 2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
| 2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
| 2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
| 2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
| 2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
| 2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
| 2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
| 2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
| 2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
| 2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
| 2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
| 2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
(63) |
Nov
(52) |
Dec
|
|
From: <ho...@us...> - 2025-07-07 16:02:44
|
Revision: 15615
http://sourceforge.net/p/skim-app/code/15615
Author: hofman
Date: 2025-07-07 16:02:37 +0000 (Mon, 07 Jul 2025)
Log Message:
-----------
calculate point and page if needed in main dragging handler
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-07 09:31:34 UTC (rev 15614)
+++ trunk/SKPDFView.m 2025-07-07 16:02:37 UTC (rev 15615)
@@ -3825,20 +3825,17 @@
}
}
-- (void)doMoveAnnotationWithEvent:(NSEvent *)theEvent offset:(NSPoint)offset {
+- (void)doMoveAnnotationToPoint:(NSPoint)point onPage:(PDFPage *)page {
// Move annotation.
- NSPoint point = NSZeroPoint;
- PDFPage *newActivePage = [self pageAndPoint:&point forEvent:theEvent nearest:YES];
-
- if (newActivePage) { // newActivePage should never be nil, but just to be sure
- if (newActivePage != [currentAnnotation page])
+ if (page) { // page should never be nil, but just to be sure
+ if (page != [currentAnnotation page])
// move the annotation to the new page
- [[self document] moveAnnotation:currentAnnotation toPage:newActivePage];
+ [[self document] moveAnnotation:currentAnnotation toPage:page];
NSRect newBounds = [currentAnnotation bounds];
- newBounds.origin = SKIntegralPoint(SKSubstractPoints(point, offset));
+ newBounds.origin = SKIntegralPoint(point);
// constrain bounds inside page bounds
- newBounds = SKConstrainRect(newBounds, [newActivePage boundsForBox:[self displayBox]]);
+ newBounds = SKConstrainRect(newBounds, [page boundsForBox:[self displayBox]]);
// Change annotation's location.
[currentAnnotation setBounds:newBounds];
@@ -3845,21 +3842,19 @@
}
}
-- (void)doResizeLineAnnotationWithEvent:(NSEvent *)theEvent fromPoint:(NSPoint)originalPagePoint originalStartPoint:(NSPoint)originalStartPoint originalEndPoint:(NSPoint)originalEndPoint resizeHandle:(SKRectEdges)resizeHandle {
+- (void)doResizeLineAnnotationWithRelativePoint:(NSPoint)relPoint originalStartPoint:(NSPoint)originalStartPoint originalEndPoint:(NSPoint)originalEndPoint dragStartPoint:(BOOL)dragStartPoint shiftDown:(BOOL)shiftDown {
PDFPage *page = [currentAnnotation page];
NSRect pageBounds = [page boundsForBox:[self displayBox]];
- NSPoint currentPagePoint = [self convertPoint:[theEvent locationInView:self] toPage:page];
- NSPoint relPoint = SKSubstractPoints(currentPagePoint, originalPagePoint);
NSPoint endPoint = originalEndPoint;
NSPoint startPoint = originalStartPoint;
- NSPoint *draggedPoint = (resizeHandle & SKMinXEdgeMask) ? &startPoint : &endPoint;
+ NSPoint *draggedPoint = dragStartPoint ? &startPoint : &endPoint;
*draggedPoint = SKConstrainPointInRect(SKAddPoints(*draggedPoint, relPoint), pageBounds);
draggedPoint->x = floor(draggedPoint->x);
draggedPoint->y = floor(draggedPoint->y);
- if (([theEvent modifierFlags] & NSEventModifierFlagShift)) {
- NSPoint *fixedPoint = (resizeHandle & SKMinXEdgeMask) ? &endPoint : &startPoint;
+ if (shiftDown) {
+ NSPoint *fixedPoint = dragStartPoint ? &endPoint : &startPoint;
NSPoint diffPoint = SKSubstractPoints(*draggedPoint, *fixedPoint);
CGFloat dx = fabs(diffPoint.x), dy = fabs(diffPoint.y);
@@ -3893,25 +3888,14 @@
}
}
-- (void)doResizeAnnotationWithEvent:(NSEvent *)theEvent fromPoint:(NSPoint)originalPagePoint originalBounds:(NSRect)originalBounds originalPaths:(NSArray *)originalPaths margin:(CGFloat)margin resizeHandle:(SKRectEdges *)resizeHandlePtr {
+- (void)doResizeAnnotationWithRelativePoint:(NSPoint)relPoint originalBounds:(NSRect)originalBounds originalPaths:(NSArray *)originalPaths margin:(CGFloat)margin resizeHandle:(SKRectEdges)resizeHandle shiftDown:(BOOL)shiftDown {
PDFPage *page = [currentAnnotation page];
NSRect newBounds = originalBounds;
NSRect pageBounds = [page boundsForBox:[self displayBox]];
- NSPoint currentPagePoint = [self convertPoint:[theEvent locationInView:self] toPage:page];
- NSPoint relPoint = SKSubstractPoints(currentPagePoint, originalPagePoint);
- SKRectEdges resizeHandle = *resizeHandlePtr;
CGFloat minSize = fmax(MIN_NOTE_SIZE, 2.0 * margin + 2.0);
BOOL isInk = [currentAnnotation isInk];
- if (NSEqualSizes(originalBounds.size, NSZeroSize)) {
- SKRectEdges currentResizeHandle = (relPoint.x < 0.0 ? SKMinXEdgeMask : SKMaxXEdgeMask) | (relPoint.y <= 0.0 ? SKMinYEdgeMask : SKMaxYEdgeMask);
- if (currentResizeHandle != resizeHandle) {
- *resizeHandlePtr = resizeHandle = currentResizeHandle;
- [self setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
- }
- }
-
- if (([theEvent modifierFlags] & NSEventModifierFlagShift) == 0) {
+ if (shiftDown == NO) {
if ((resizeHandle & SKMaxXEdgeMask)) {
newBounds.size.width += relPoint.x;
@@ -4031,7 +4015,7 @@
CGFloat sy = fmax(1.0, NSHeight(newBounds) - 2.0 * margin) / fmax(1.0, NSHeight(originalBounds) - 2.0 * margin);
[transform translateXBy:margin yBy:margin];
- if (([theEvent modifierFlags] & NSEventModifierFlagShift))
+ if (shiftDown)
[transform scaleBy:fmin(sx, sy)];
else
[transform scaleXBy:sx yBy:sy];
@@ -4052,8 +4036,8 @@
// Old (current) annotation location and click point relative to it
NSRect originalBounds = [currentAnnotation bounds];
BOOL isLine = [currentAnnotation isLine];
- NSPoint pagePoint = NSZeroPoint;
- PDFPage *page = [self pageAndPoint:&pagePoint forEvent:theEvent nearest:YES];
+ NSPoint initialPoint = NSZeroPoint;
+ PDFPage *page = [self pageAndPoint:&initialPoint forEvent:theEvent nearest:YES];
SKNoteType noteType = annotationMode;
BOOL shouldAddAnnotation = currentAnnotation == nil;
NSPoint originalStartPoint = NSZeroPoint;
@@ -4060,23 +4044,21 @@
NSPoint originalEndPoint = NSZeroPoint;
NSArray *originalPaths = nil;
CGFloat margin = 0.0;
-
// Hit-test for resize box.
- SKRectEdges resizeHandle = [currentAnnotation resizeHandleForPoint:pagePoint scaleFactor:[self scaleFactor]];
+ SKRectEdges resizeHandle = [currentAnnotation resizeHandleForPoint:initialPoint scaleFactor:[self scaleFactor]];
- if (shouldAddAnnotation && temporaryToolMode >= SKToolModeFreeText)
- noteType = NOTE_TYPE_FROM_TEMP_TOOL_MODE(temporaryToolMode);
-
atomic_store(&highlightLayerState, SKLayerAdd);
- if (currentAnnotation)
+ if (shouldAddAnnotation == NO)
[self updatedAnnotation:currentAnnotation];
if (shouldAddAnnotation) {
+ if (temporaryToolMode >= SKToolModeFreeText)
+ noteType = NOTE_TYPE_FROM_TEMP_TOOL_MODE(temporaryToolMode);
if (noteType == SKNoteTypeAnchored) {
- [self addAnnotationWithType:SKNoteTypeAnchored selection:nil page:page bounds:SKRectFromCenterAndSquareSize(SKIntegralPoint(pagePoint), 0.0)];
+ [self addAnnotationWithType:SKNoteTypeAnchored selection:nil page:page bounds:SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0)];
originalBounds = [[self currentAnnotation] bounds];
} else {
- originalBounds = SKRectFromCenterAndSquareSize(SKIntegralPoint(pagePoint), 0.0);
+ originalBounds = SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0);
if (noteType == SKNoteTypeLine) {
isLine = YES;
resizeHandle = SKMaxXEdgeMask;
@@ -4096,7 +4078,6 @@
// we move or resize the annotation in an event loop, which ensures it's enclosed in a single undo group
BOOL draggedAnnotation = NO;
NSEvent *lastMouseEvent = theEvent;
- NSPoint offset = SKSubstractPoints(pagePoint, originalBounds.origin);
NSUInteger eventMask = NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
[self setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
@@ -4104,6 +4085,8 @@
[[NSCursor closedHandCursor] push];
[NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1];
eventMask |= NSEventMaskPeriodic;
+
+ initialPoint = SKSubstractPoints(initialPoint, originalBounds.origin);
}
while (YES) {
@@ -4125,12 +4108,25 @@
if (currentAnnotation == nil || [[[self scrollView] contentView] autoscroll:lastMouseEvent] == NO)
continue;
}
+ BOOL shiftDown = ([theEvent modifierFlags] & NSEventModifierFlagShift) != 0;
+ NSPoint point = [lastMouseEvent locationInView:self];
if (resizeHandle == 0)
- [self doMoveAnnotationWithEvent:lastMouseEvent offset:offset];
- else if (isLine)
- [self doResizeLineAnnotationWithEvent:lastMouseEvent fromPoint:pagePoint originalStartPoint:originalStartPoint originalEndPoint:originalEndPoint resizeHandle:resizeHandle];
- else
- [self doResizeAnnotationWithEvent:lastMouseEvent fromPoint:pagePoint originalBounds:originalBounds originalPaths:originalPaths margin:margin resizeHandle:&resizeHandle];
+ page = [self pageForPoint:point nearest:YES];
+ point = SKSubstractPoints([self convertPoint:point toPage:page], initialPoint);
+ if (resizeHandle == 0) {
+ [self doMoveAnnotationToPoint:point onPage:page];
+ } else if (isLine) {
+ [self doResizeLineAnnotationWithRelativePoint:point originalStartPoint:originalStartPoint originalEndPoint:originalEndPoint dragStartPoint:(resizeHandle & SKMinXEdgeMask) != 0 shiftDown:shiftDown];
+ } else {
+ if (shouldAddAnnotation) {
+ SKRectEdges currentResizeHandle = (point.x < 0.0 ? SKMinXEdgeMask : SKMaxXEdgeMask) | (point.y <= 0.0 ? SKMinYEdgeMask : SKMaxYEdgeMask);
+ if (currentResizeHandle != resizeHandle) {
+ resizeHandle = currentResizeHandle;
+ [self setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
+ }
+ }
+ [self doResizeAnnotationWithRelativePoint:point originalBounds:originalBounds originalPaths:originalPaths margin:margin resizeHandle:resizeHandle shiftDown:shiftDown];
+ }
[[highlightLayerController layer] setNeedsDisplay];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-07 09:31:36
|
Revision: 15614
http://sourceforge.net/p/skim-app/code/15614
Author: hofman
Date: 2025-07-07 09:31:34 +0000 (Mon, 07 Jul 2025)
Log Message:
-----------
declare as properties
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.h
Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h 2025-07-07 09:22:53 UTC (rev 15613)
+++ trunk/PDFAnnotation_SKExtensions.h 2025-07-07 09:31:34 UTC (rev 15614)
@@ -99,21 +99,11 @@
@property (nonatomic, nullable, readonly) NSString *textString;
-- (BOOL)isMarkup;
-- (BOOL)isNote;
-- (BOOL)isText;
-- (BOOL)isLine;
-- (BOOL)isInk;
-- (BOOL)isLink;
-- (BOOL)isWidget;
-- (BOOL)isResizable;
-- (BOOL)isMovable;
-- (BOOL)isEditable;
-- (BOOL)hasBorder;
-- (BOOL)hasInteriorColor;
+@property (nonatomic, readonly) BOOL isMarkup, isNote, isText, isLine, isInk, isLink, isWidget;
+@property (nonatomic, readonly) BOOL isResizable, isMovable, isEditable;
+@property (nonatomic, readonly) BOOL hasBorder, hasInteriorColor;
+@property (nonatomic, readonly) BOOL isConvertibleAnnotation;
-- (BOOL)isConvertibleAnnotation;
-
- (BOOL)hitTest:(NSPoint)point;
@property (nonatomic, readonly) CGFloat boundsOrder;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-07 09:22:56
|
Revision: 15613
http://sourceforge.net/p/skim-app/code/15613
Author: hofman
Date: 2025-07-07 09:22:53 +0000 (Mon, 07 Jul 2025)
Log Message:
-----------
no need to check for skim note, is implicit
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-07 09:22:05 UTC (rev 15612)
+++ trunk/SKPDFView.m 2025-07-07 09:22:53 UTC (rev 15613)
@@ -3302,9 +3302,7 @@
return ([[self currentSelection] hasCharacters] || [currentAnnotation isSkimNote] ||
(toolMode == SKToolModeSelect && NSIsEmptyRect(selectionRect) == NO && selectionPageIndex != NSNotFound && [[self document] isLocked] == NO));
} else if (action == @selector(cut:)) {
- if ([currentAnnotation isSkimNote] && [currentAnnotation isMovable])
- return YES;
- return NO;
+ return [currentAnnotation isMovable];
} else if (action == @selector(paste:)) {
return [self canSelectNote] && [[NSPasteboard generalPasteboard] canReadObjectForClasses:@[[PDFAnnotation class], [NSString class], [NSImage class]] options:@{}];
} else if (action == @selector(alternatePaste:)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-07 09:22:08
|
Revision: 15612
http://sourceforge.net/p/skim-app/code/15612
Author: hofman
Date: 2025-07-07 09:22:05 +0000 (Mon, 07 Jul 2025)
Log Message:
-----------
no need to check for skim note, is implicit
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-06 16:57:32 UTC (rev 15611)
+++ trunk/SKPDFView.m 2025-07-07 09:22:05 UTC (rev 15612)
@@ -2102,11 +2102,10 @@
[item setAlternate:YES];
}
- if (([currentAnnotation isSkimNote] && [currentAnnotation isMovable]) || [[self currentSelection] hasCharacters]) {
- if ([currentAnnotation isSkimNote] && [currentAnnotation isMovable])
- [menu insertItemWithTitle:NSLocalizedString(@"Cut", @"Menu item title") action:@selector(cut:) keyEquivalent:@"" atIndex:0];
+ if ([currentAnnotation isMovable])
+ [menu insertItemWithTitle:NSLocalizedString(@"Cut", @"Menu item title") action:@selector(cut:) keyEquivalent:@"" atIndex:0];
+ if (([currentAnnotation isMovable]) || [[self currentSelection] hasCharacters])
[menu insertItemWithTitle:NSLocalizedString(@"Copy", @"Menu item title") action:@selector(copy:) keyEquivalent:@"" atIndex:0];
- }
if ([[menu itemAtIndex:0] isSeparatorItem])
[menu removeItemAtIndex:0];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-06 16:57:35
|
Revision: 15611
http://sourceforge.net/p/skim-app/code/15611
Author: hofman
Date: 2025-07-06 16:57:32 +0000 (Sun, 06 Jul 2025)
Log Message:
-----------
we can just use originalBounds. Autoscroll from main event handler.
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-06 15:44:07 UTC (rev 15610)
+++ trunk/SKPDFView.m 2025-07-06 16:57:32 UTC (rev 15611)
@@ -3830,8 +3830,6 @@
- (void)doMoveAnnotationWithEvent:(NSEvent *)theEvent offset:(NSPoint)offset {
// Move annotation.
- [[[self scrollView] contentView] autoscroll:theEvent];
-
NSPoint point = NSZeroPoint;
PDFPage *newActivePage = [self pageAndPoint:&point forEvent:theEvent nearest:YES];
@@ -4118,14 +4116,17 @@
} else if ([theEvent type] == NSEventTypeLeftMouseDragged) {
if (draggedAnnotation == NO) {
if (currentAnnotation == nil)
- [self addAnnotationWithType:noteType selection:nil page:page bounds:SKRectFromCenterAndSquareSize(originalBounds.origin, 0.0)];
+ [self addAnnotationWithType:noteType selection:nil page:page bounds:originalBounds];
else if (shouldAddAnnotation == NO)
[self beginNewUndoGroupIfNeeded];
draggedAnnotation = YES;
}
lastMouseEvent = theEvent;
- } else if (currentAnnotation == nil) {
- continue;
+ if (resizeHandle == 0)
+ [[[self scrollView] contentView] autoscroll:theEvent];
+ } else if ([theEvent type] == NSEventTypePeriodic) {
+ if (currentAnnotation == nil || [[[self scrollView] contentView] autoscroll:lastMouseEvent] == NO)
+ continue;
}
if (resizeHandle == 0)
[self doMoveAnnotationWithEvent:lastMouseEvent offset:offset];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-06 15:44:09
|
Revision: 15610
http://sourceforge.net/p/skim-app/code/15610
Author: hofman
Date: 2025-07-06 15:44:07 +0000 (Sun, 06 Jul 2025)
Log Message:
-----------
no need to open new undo group when just added an anchored note
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-06 09:30:49 UTC (rev 15609)
+++ trunk/SKPDFView.m 2025-07-06 15:44:07 UTC (rev 15610)
@@ -4119,7 +4119,7 @@
if (draggedAnnotation == NO) {
if (currentAnnotation == nil)
[self addAnnotationWithType:noteType selection:nil page:page bounds:SKRectFromCenterAndSquareSize(originalBounds.origin, 0.0)];
- else
+ else if (shouldAddAnnotation == NO)
[self beginNewUndoGroupIfNeeded];
draggedAnnotation = YES;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-06 09:30:51
|
Revision: 15609
http://sourceforge.net/p/skim-app/code/15609
Author: hofman
Date: 2025-07-06 09:30:49 +0000 (Sun, 06 Jul 2025)
Log Message:
-----------
don't set undo action name during undo or redo
Modified Paths:
--------------
trunk/SKMainWindowController_Actions.m
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2025-07-06 09:21:48 UTC (rev 15608)
+++ trunk/SKMainWindowController_Actions.m 2025-07-06 09:30:49 UTC (rev 15609)
@@ -510,7 +510,8 @@
- (void)rotatePageAtIndex:(NSUInteger)idx by:(NSInteger)rotation {
NSUndoManager *undoManager = [[self document] undoManager];
[[undoManager prepareWithInvocationTarget:self] rotatePageAtIndex:idx by:-rotation];
- [undoManager setActionName:NSLocalizedString(@"Rotate Page", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Rotate Page", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
PDFPage *page = [[pdfView document] pageAtIndex:idx];
@@ -523,7 +524,8 @@
- (void)rotateAllBy:(NSInteger)rotation {
NSUndoManager *undoManager = [[self document] undoManager];
[[undoManager prepareWithInvocationTarget:self] rotateAllBy:-rotation];
- [undoManager setActionName:NSLocalizedString(@"Rotate", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Rotate", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
if (([pdfView displayMode] & kPDFDisplaySinglePageContinuous))
@@ -557,7 +559,8 @@
NSRect oldRect = [[[pdfView document] pageAtIndex:anIndex] boundsForBox:kPDFDisplayBoxCropBox];
NSUndoManager *undoManager = [[self document] undoManager];
[[undoManager prepareWithInvocationTarget:self] cropPageAtIndex:anIndex toRect:oldRect];
- [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
PDFPage *page = [[pdfView document] pageAtIndex:anIndex];
@@ -596,7 +599,8 @@
NSUndoManager *undoManager = [[self document] undoManager];
[[undoManager prepareWithInvocationTarget:self] cropPagesToRects:oldRects];
- [undoManager setActionName:NSLocalizedString(@"Crop", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Crop", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
[[NSNotificationCenter defaultCenter] postNotificationName:SKPDFPageBoundsDidChangeNotification
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-06 09:21:50
|
Revision: 15608
http://sourceforge.net/p/skim-app/code/15608
Author: hofman
Date: 2025-07-06 09:21:48 +0000 (Sun, 06 Jul 2025)
Log Message:
-----------
don't set undo action name during undo or redo
Modified Paths:
--------------
trunk/PDFPage_SKExtensions.m
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2025-07-04 17:06:13 UTC (rev 15607)
+++ trunk/PDFPage_SKExtensions.m 2025-07-06 09:21:48 UTC (rev 15608)
@@ -568,7 +568,8 @@
if ([self isEditable] && angle != [self rotation]) {
NSUndoManager *undoManager = [self undoManager];
[(PDFPage *)[undoManager prepareWithInvocationTarget:self] setRotationAngle:[self rotation]];
- [undoManager setActionName:NSLocalizedString(@"Rotate Page", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Rotate Page", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
[self setRotation:angle];
@@ -586,7 +587,8 @@
if ([self isEditable] && inQDBoundsAsData && [inQDBoundsAsData isEqual:[NSNull null]] == NO) {
NSUndoManager *undoManager = [self undoManager];
[[undoManager prepareWithInvocationTarget:self] setBoundsAsQDRect:[self boundsAsQDRect]];
- [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
NSRect newBounds = [inQDBoundsAsData rectValueAsQDRect];
@@ -609,7 +611,8 @@
if ([self isEditable] && inQDBoundsAsData && [inQDBoundsAsData isEqual:[NSNull null]] == NO) {
NSUndoManager *undoManager = [self undoManager];
[[undoManager prepareWithInvocationTarget:self] setMediaBoundsAsQDRect:[self mediaBoundsAsQDRect]];
- [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
+ [undoManager setActionName:NSLocalizedString(@"Crop Page", @"Undo action name")];
[undoManager setActionIsDiscardable:YES];
NSRect newBounds = [inQDBoundsAsData rectValueAsQDRect];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 17:06:15
|
Revision: 15607
http://sourceforge.net/p/skim-app/code/15607
Author: hofman
Date: 2025-07-04 17:06:13 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
make sure wantsNewUndoGroup ivar is reset after adding new undo group, the notification is not always send for some reason
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-04 16:41:53 UTC (rev 15606)
+++ trunk/SKPDFView.m 2025-07-04 17:06:13 UTC (rev 15607)
@@ -2838,6 +2838,7 @@
[undoManger endUndoGrouping];
[undoManger beginUndoGrouping];
}
+ wantsNewUndoGroup = NO;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 16:41:55
|
Revision: 15606
http://sourceforge.net/p/skim-app/code/15606
Author: hofman
Date: 2025-07-04 16:41:53 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
don't use local variable
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-04 16:25:53 UTC (rev 15605)
+++ trunk/SKMainWindowController.m 2025-07-04 16:41:53 UTC (rev 15606)
@@ -2736,7 +2736,6 @@
// Is this the first observed note change in the current undo group?
NSUndoManager *undoManager = [[self document] undoManager];
- BOOL isUndoOrRedo = ([undoManager isUndoing] || [undoManager isRedoing]);
if ([undoManager isUndoRegistrationEnabled] == NO)
return;
@@ -2747,7 +2746,7 @@
// Register an undo operation for any note property changes that are going to be coalesced between now and the next invocation of -observeUndoManagerCheckpoint:.
[undoManager registerUndoWithTarget:self selector:@selector(setNoteProperties:) object:undoGroupOldPropertiesPerNote];
// Don't set the undo action name during undoing and redoing
- if (isUndoOrRedo == NO)
+ if ([undoManager isUndoing] == NO && [undoManager isRedoing] == NO)
[undoManager setActionName:NSLocalizedString(@"Edit Note", @"Undo action name")];
}
@@ -2758,7 +2757,7 @@
oldNoteProperties = [[NSMutableDictionary alloc] init];
[undoGroupOldPropertiesPerNote setObject:oldNoteProperties forKey:note];
// set the mod date here, need to do that only once for each note for a real user action
- if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisableModificationDateKey] == NO && isUndoOrRedo == NO && [keyPath isEqualToString:SKNPDFAnnotationModificationDateKey] == NO && [note isSkimNote])
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:SKDisableModificationDateKey] == NO && [undoManager isUndoing] == NO && [undoManager isRedoing] == NO && [keyPath isEqualToString:SKNPDFAnnotationModificationDateKey] == NO && [note isSkimNote])
[note setModificationDate:[NSDate date]];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 16:25:54
|
Revision: 15605
http://sourceforge.net/p/skim-app/code/15605
Author: hofman
Date: 2025-07-04 16:25:53 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
static set for note keeys that don't affect display
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-04 15:24:39 UTC (rev 15604)
+++ trunk/SKMainWindowController.m 2025-07-04 16:25:53 UTC (rev 15605)
@@ -2766,8 +2766,12 @@
if ([oldNoteProperties objectForKey:keyPath] == nil)
[oldNoteProperties setObject:oldValue forKey:keyPath];
+ static NSSet *invisibleKeys = nil;
+ if (invisibleKeys == nil)
+ invisibleKeys = [[NSSet alloc] initWithObjects:SKNPDFAnnotationModificationDateKey, SKNPDFAnnotationUserNameKey, SKNPDFAnnotationTextKey, nil];
+
// Update the UI, we should always do that unless the value did not really change or we're just changing the mod date or user name
- if ([keyPath isEqualToString:SKNPDFAnnotationModificationDateKey] == NO && [keyPath isEqualToString:SKNPDFAnnotationUserNameKey] == NO && [keyPath isEqualToString:SKNPDFAnnotationTextKey] == NO && ([note isText] || [keyPath isEqualToString:SKNPDFAnnotationStringKey] == NO)) {
+ if ([invisibleKeys containsObject:keyPath] == NO && ([note isText] || [keyPath isEqualToString:SKNPDFAnnotationStringKey] == NO)) {
PDFPage *page = [note page];
[self updateThumbnailAtPageIndex:[note pageIndex]];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 15:24:41
|
Revision: 15604
http://sourceforge.net/p/skim-app/code/15604
Author: hofman
Date: 2025-07-04 15:24:39 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
Log errors when writing notes to extended attributes
Modified Paths:
--------------
trunk/SKMainDocument.m
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2025-07-04 14:49:11 UTC (rev 15603)
+++ trunk/SKMainDocument.m 2025-07-04 15:24:39 UTC (rev 15604)
@@ -519,6 +519,7 @@
SKNSkimNotesWritingOptions writeOptions = 0;
SKNXattrFlags flags = kSKNXattrDefault;
+ NSError *error = nil;
if ([[NSUserDefaults standardUserDefaults] boolForKey:SKWriteLegacySkimNotesKey] == NO) {
writeOptions = SKNSkimNotesWritingSyncable;
if ([[NSUserDefaults standardUserDefaults] boolForKey:SKWriteSkimNotesAsArchiveKey] == NO)
@@ -526,8 +527,11 @@
flags = kSKNXattrSyncable;
}
- BOOL success = [fm writeSkimNotes:[self SkimNoteProperties] textNotes:[self notesString] richTextNotes:[self notesRTFData] toExtendedAttributesAtURL:absoluteURL options:writeOptions error:NULL];
+ BOOL success = [fm writeSkimNotes:[self SkimNoteProperties] textNotes:[self notesString] richTextNotes:[self notesRTFData] toExtendedAttributesAtURL:absoluteURL options:writeOptions error:&error];
+ if (success == NO)
+ NSLog(@"Error attaching notes: %@", error);
+
NSDictionary *options = [self presentationOptions];
SKNExtendedAttributeManager *eam = [SKNExtendedAttributeManager sharedNoSplitManager];
[eam removeExtendedAttributeNamed:PRESENTATION_OPTIONS_KEY atPath:[absoluteURL path] traverseLink:YES error:NULL];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 14:49:12
|
Revision: 15603
http://sourceforge.net/p/skim-app/code/15603
Author: hofman
Date: 2025-07-04 14:49:11 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
return error when writing wwrapper fails
Modified Paths:
--------------
trunk/SkimNotes/SKNExtendedAttributeManager.m
Modified: trunk/SkimNotes/SKNExtendedAttributeManager.m
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.m 2025-07-04 09:36:47 UTC (rev 15602)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.m 2025-07-04 14:49:11 UTC (rev 15603)
@@ -370,10 +370,13 @@
NSParameterAssert([wrapperData length] < MAX_XATTR_LENGTH && [wrapperData length] > 0);
// we don't want to split this dictionary (or compress it)
- if (setxattr(fsPath, attrName, [wrapperData bytes], [wrapperData length], 0, xopts))
+ int status = setxattr(fsPath, attrName, [wrapperData bytes], [wrapperData length], 0, xopts);
+ if(status == -1) {
+ if(error) *error = [self xattrError:errno forPath:path];
success = NO;
- else
+ } else {
success = YES;
+ }
// now split the original data value into multiple segments
NSString *name;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-04 09:36:50
|
Revision: 15602
http://sourceforge.net/p/skim-app/code/15602
Author: hofman
Date: 2025-07-04 09:36:47 +0000 (Fri, 04 Jul 2025)
Log Message:
-----------
rermove unnecessary parenthesis
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 14:50:28 UTC (rev 15601)
+++ trunk/SKPDFView.m 2025-07-04 09:36:47 UTC (rev 15602)
@@ -1852,7 +1852,7 @@
} else if ([self doDragTextWithEvent:theEvent] == NO) {
[self setCurrentAnnotation:nil];
[super mouseDown:theEvent];
- if ((toolMode == SKToolModeNote && [self canAddNotes] && IS_MARKUP(annotationMode)) && [[self currentSelection] hasCharacters]) {
+ if (toolMode == SKToolModeNote && [self canAddNotes] && IS_MARKUP(annotationMode) && [[self currentSelection] hasCharacters]) {
[self addAnnotationWithType:annotationMode];
[self setCurrentSelection:nil];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 14:50:30
|
Revision: 15601
http://sourceforge.net/p/skim-app/code/15601
Author: hofman
Date: 2025-07-03 14:50:28 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
convenience macro for text or note tool mode
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 14:40:04 UTC (rev 15600)
+++ trunk/SKPDFView.m 2025-07-03 14:50:28 UTC (rev 15601)
@@ -85,6 +85,7 @@
#define IS_MARKUP(noteType) (noteType == SKNoteTypeHighlight || noteType == SKNoteTypeUnderline || noteType == SKNoteTypeStrikeOut)
#define IS_MARKUP_TOOL(tempToolMode) (tempToolMode == SKToolModeHighlight || tempToolMode == SKToolModeUnderline || tempToolMode == SKToolModeStrikeOut)
+#define IS_TEXT_OR_NOTE_TOOL (toolMode == SKToolModeText || toolMode == SKToolModeNote)
#define NOTE_TYPE_FROM_TEMP_TOOL_MODE(tempToolMode) (SKNoteType)(tempToolMode - SKToolModeFreeText)
#define TEMP_TOOL_MODE_FROM_NOTE_TYPE(noteType) (SKTemporaryToolMode)(noteType + SKToolModeFreeText)
@@ -621,7 +622,7 @@
- (void)setToolMode:(SKToolMode)newToolMode {
if (toolMode != newToolMode) {
[self setTemporaryToolMode:SKToolModeNone];
- if (toolMode == SKToolModeText || toolMode == SKToolModeNote) {
+ if (IS_TEXT_OR_NOTE_TOOL) {
if (newToolMode != SKToolModeText) {
if (newToolMode != SKToolModeNote && currentAnnotation)
[self setCurrentAnnotation:nil];
@@ -947,7 +948,7 @@
}
- (BOOL)canSelectNote {
- return [self canAddNotes] && (toolMode == SKToolModeText || toolMode == SKToolModeNote);
+ return [self canAddNotes] && IS_TEXT_OR_NOTE_TOOL;
}
- (NSDictionary *)displaySettings {
@@ -2380,7 +2381,7 @@
[self beginNewUndoGroupIfNeeded];
[[self document] addAnnotation:annotation toPage:page];
[[self undoManager] setActionName:NSLocalizedString(@"Add Note", @"Undo action name")];
- if (shouldSelect && (toolMode == SKToolModeText || toolMode == SKToolModeNote))
+ if (shouldSelect && IS_TEXT_OR_NOTE_TOOL)
[self setCurrentAnnotation:annotation];
}
@@ -2394,7 +2395,7 @@
[[self document] addAnnotation:annotation toPage:[annotationAndPage lastObject]];
}
[[self undoManager] setActionName:NSLocalizedString(@"Add Note", @"Undo action name")];
- if (toolMode == SKToolModeText || toolMode == SKToolModeNote)
+ if (IS_TEXT_OR_NOTE_TOOL)
[self setCurrentAnnotation:annotation];
}
@@ -2708,7 +2709,7 @@
}
- (void)addAnnotationWithType:(SKNoteType)annotationType {
- if ((toolMode == SKToolModeText || toolMode == SKToolModeNote) && (annotationType == SKNoteTypeInk || (([[NSUserDefaults standardUserDefaults] boolForKey:SKNewNoteRequiresSelectionKey] || IS_MARKUP(annotationType)) && [[self currentSelection] hasCharacters] == NO))) {
+ if (IS_TEXT_OR_NOTE_TOOL && (annotationType == SKNoteTypeInk || (([[NSUserDefaults standardUserDefaults] boolForKey:SKNewNoteRequiresSelectionKey] || IS_MARKUP(annotationType)) && [[self currentSelection] hasCharacters] == NO))) {
[self setTemporaryToolMode:TEMP_TOOL_MODE_FROM_NOTE_TYPE(annotationType)];
} else {
[self addAnnotationWithType:annotationType context:nil];
@@ -5081,7 +5082,7 @@
if ((area & kPDFPageArea) == 0 || toolMode == SKToolModeMove) {
if ((area & SKReadingBarArea) == 0)
area |= SKDragArea;
- } else if (toolMode == SKToolModeText || toolMode == SKToolModeNote) {
+ } else if (IS_TEXT_OR_NOTE_TOOL) {
if (editor && [[currentAnnotation page] isEqual:page] && NSPointInRect(p, [currentAnnotation bounds])) {
area = kPDFTextFieldArea;
} else if ((area & SKReadingBarArea) == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 14:40:07
|
Revision: 15600
http://sourceforge.net/p/skim-app/code/15600
Author: hofman
Date: 2025-07-03 14:40:04 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
convenience method for allowing notes
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 14:22:35 UTC (rev 15599)
+++ trunk/SKPDFView.m 2025-07-03 14:40:04 UTC (rev 15600)
@@ -84,7 +84,7 @@
#define TOOL_MODE_COUNT 5
#define IS_MARKUP(noteType) (noteType == SKNoteTypeHighlight || noteType == SKNoteTypeUnderline || noteType == SKNoteTypeStrikeOut)
-#define IS_MARKUP_TOOL(tempoToolMode) (tempoToolMode == SKToolModeHighlight || tempoToolMode == SKToolModeUnderline || tempoToolMode == SKToolModeStrikeOut)
+#define IS_MARKUP_TOOL(tempToolMode) (tempToolMode == SKToolModeHighlight || tempToolMode == SKToolModeUnderline || tempToolMode == SKToolModeStrikeOut)
#define NOTE_TYPE_FROM_TEMP_TOOL_MODE(tempToolMode) (SKNoteType)(tempToolMode - SKToolModeFreeText)
#define TEMP_TOOL_MODE_FROM_NOTE_TYPE(noteType) (SKTemporaryToolMode)(noteType + SKToolModeFreeText)
@@ -942,8 +942,12 @@
return undoManager;
}
+- (BOOL)canAddNotes {
+ return hideNotes == NO && [[self document] allowsNotes];
+}
+
- (BOOL)canSelectNote {
- return hideNotes == NO && (toolMode == SKToolModeText || toolMode == SKToolModeNote) && [[self document] allowsNotes];
+ return [self canAddNotes] && (toolMode == SKToolModeText || toolMode == SKToolModeNote);
}
- (NSDictionary *)displaySettings {
@@ -1817,7 +1821,7 @@
} else if (toolMode == SKToolModeMagnify) {
[self setCurrentSelection:nil];
[self doMagnifyWithEvent:theEvent];
- } else if (hideNotes == NO && [[self document] allowsNotes] && IS_TABLET_EVENT(theEvent, NSPointingDeviceTypeEraser)) {
+ } else if ([self canAddNotes] && IS_TABLET_EVENT(theEvent, NSPointingDeviceTypeEraser)) {
[self doEraseAnnotationsWithEvent:theEvent];
} else if ([self doSelectAnnotationWithEvent:theEvent]) {
if ([currentAnnotation isLink]) {
@@ -1832,7 +1836,7 @@
} else {
[self doDragMouseWithEvent:theEvent];
}
- } else if (toolMode == SKToolModeNote && hideNotes == NO && [[self document] allowsNotes] && IS_MARKUP(annotationMode) == NO) {
+ } else if (toolMode == SKToolModeNote && [self canAddNotes] && IS_MARKUP(annotationMode) == NO) {
if ((area & kPDFLinkArea) != 0 && [NSApp willDragMouse] == NO) {
[super mouseDown:theEvent];
} else if (annotationMode == SKNoteTypeInk) {
@@ -1847,7 +1851,7 @@
} else if ([self doDragTextWithEvent:theEvent] == NO) {
[self setCurrentAnnotation:nil];
[super mouseDown:theEvent];
- if ((toolMode == SKToolModeNote && hideNotes == NO && [[self document] allowsNotes] && IS_MARKUP(annotationMode)) && [[self currentSelection] hasCharacters]) {
+ if ((toolMode == SKToolModeNote && [self canAddNotes] && IS_MARKUP(annotationMode)) && [[self currentSelection] hasCharacters]) {
[self addAnnotationWithType:annotationMode];
[self setCurrentSelection:nil];
}
@@ -4213,7 +4217,7 @@
if (newCurrentAnnotation == nil)
return NO;
- if (hideNotes == NO && [[self document] allowsNotes]) {
+ if ([self canAddNotes]) {
NSUInteger modifiers = [theEvent modifierFlags];
if ((modifiers & NSEventModifierFlagOption) && [newCurrentAnnotation isMovable] &&
[newCurrentAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]] == 0 &&
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 14:22:36
|
Revision: 15599
http://sourceforge.net/p/skim-app/code/15599
Author: hofman
Date: 2025-07-03 14:22:35 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
don't use local variable
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 14:20:05 UTC (rev 15598)
+++ trunk/SKPDFView.m 2025-07-03 14:22:35 UTC (rev 15599)
@@ -4214,7 +4214,6 @@
return NO;
if (hideNotes == NO && [[self document] allowsNotes]) {
- BOOL isInk = toolMode == SKToolModeNote && annotationMode == SKNoteTypeInk;
NSUInteger modifiers = [theEvent modifierFlags];
if ((modifiers & NSEventModifierFlagOption) && [newCurrentAnnotation isMovable] &&
[newCurrentAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]] == 0 &&
@@ -4223,7 +4222,7 @@
newCurrentAnnotation = [PDFAnnotation newSkimNoteWithProperties:[newCurrentAnnotation SkimNoteProperties]];
[self addAnnotation:newCurrentAnnotation toPage:page select:NO];
} else if (([newCurrentAnnotation isMarkup] ||
- (isInk && (newCurrentAnnotation != currentAnnotation || (modifiers & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock))))) &&
+ (toolMode == SKToolModeNote && annotationMode == SKNoteTypeInk && (newCurrentAnnotation != currentAnnotation || (modifiers & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock))))) &&
[NSApp willDragMouse]) {
// don't drag markup notes or in freehand tool mode, unless the note was previously selected, so we can select text or draw freehand strokes
return NO;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 14:20:09
|
Revision: 15598
http://sourceforge.net/p/skim-app/code/15598
Author: hofman
Date: 2025-07-03 14:20:05 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
check for markup or ink beforre joining notes
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 14:14:44 UTC (rev 15597)
+++ trunk/SKPDFView.m 2025-07-03 14:20:05 UTC (rev 15598)
@@ -4227,7 +4227,7 @@
[NSApp willDragMouse]) {
// don't drag markup notes or in freehand tool mode, unless the note was previously selected, so we can select text or draw freehand strokes
return NO;
- } else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation != newCurrentAnnotation && [currentAnnotation page] == page && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation type]]) {
+ } else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation != newCurrentAnnotation && [currentAnnotation page] == page && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation type]] && ([currentAnnotation isMarkup] || [currentAnnotation isInk])) {
newCurrentAnnotation = [self joinAnnotationToCurrentAnnotation:newCurrentAnnotation] ?: newCurrentAnnotation;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 14:14:46
|
Revision: 15597
http://sourceforge.net/p/skim-app/code/15597
Author: hofman
Date: 2025-07-03 14:14:44 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
simplify page comparison
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:52:02 UTC (rev 15596)
+++ trunk/SKPDFView.m 2025-07-03 14:14:44 UTC (rev 15597)
@@ -4227,7 +4227,7 @@
[NSApp willDragMouse]) {
// don't drag markup notes or in freehand tool mode, unless the note was previously selected, so we can select text or draw freehand strokes
return NO;
- } else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation != newCurrentAnnotation && [[currentAnnotation page] isEqual:[newCurrentAnnotation page]] && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation type]]) {
+ } else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation != newCurrentAnnotation && [currentAnnotation page] == page && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation type]]) {
newCurrentAnnotation = [self joinAnnotationToCurrentAnnotation:newCurrentAnnotation] ?: newCurrentAnnotation;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:52:04
|
Revision: 15596
http://sourceforge.net/p/skim-app/code/15596
Author: hofman
Date: 2025-07-03 09:52:02 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
return early when not selecting new note
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:50:56 UTC (rev 15595)
+++ trunk/SKPDFView.m 2025-07-03 09:52:02 UTC (rev 15596)
@@ -4226,7 +4226,7 @@
(isInk && (newCurrentAnnotation != currentAnnotation || (modifiers & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock))))) &&
[NSApp willDragMouse]) {
// don't drag markup notes or in freehand tool mode, unless the note was previously selected, so we can select text or draw freehand strokes
- newCurrentAnnotation = nil;
+ return NO;
} else if ((modifiers & NSEventModifierFlagShift) && currentAnnotation != newCurrentAnnotation && [[currentAnnotation page] isEqual:[newCurrentAnnotation page]] && [[currentAnnotation type] isEqualToString:[newCurrentAnnotation type]]) {
newCurrentAnnotation = [self joinAnnotationToCurrentAnnotation:newCurrentAnnotation] ?: newCurrentAnnotation;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:50:58
|
Revision: 15595
http://sourceforge.net/p/skim-app/code/15595
Author: hofman
Date: 2025-07-03 09:50:56 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
set variale directly to new note
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:47:31 UTC (rev 15594)
+++ trunk/SKPDFView.m 2025-07-03 09:50:56 UTC (rev 15595)
@@ -4220,9 +4220,8 @@
[newCurrentAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]] == 0 &&
[NSApp willDragMouse]) {
// select a new copy of the annotation
- PDFAnnotation *newAnnotation = [PDFAnnotation newSkimNoteWithProperties:[newCurrentAnnotation SkimNoteProperties]];
- [self addAnnotation:newAnnotation toPage:page select:NO];
- newCurrentAnnotation = newAnnotation;
+ newCurrentAnnotation = [PDFAnnotation newSkimNoteWithProperties:[newCurrentAnnotation SkimNoteProperties]];
+ [self addAnnotation:newCurrentAnnotation toPage:page select:NO];
} else if (([newCurrentAnnotation isMarkup] ||
(isInk && (newCurrentAnnotation != currentAnnotation || (modifiers & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock))))) &&
[NSApp willDragMouse]) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:47:33
|
Revision: 15594
http://sourceforge.net/p/skim-app/code/15594
Author: hofman
Date: 2025-07-03 09:47:31 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
return early when not clicking on a page or an annotation
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:33:54 UTC (rev 15593)
+++ trunk/SKPDFView.m 2025-07-03 09:47:31 UTC (rev 15594)
@@ -4179,8 +4179,11 @@
- (BOOL)doSelectAnnotationWithEvent:(NSEvent *)theEvent {
PDFAnnotation *newCurrentAnnotation = nil;
NSPoint point = NSZeroPoint;
- PDFPage *page = [self pageAndPoint:&point forEvent:theEvent nearest:YES];
+ PDFPage *page = [self pageAndPoint:&point forEvent:theEvent nearest:NO];
+ if (page == nil)
+ return NO;
+
if ([currentAnnotation page] == page && [currentAnnotation isResizable] && [currentAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]] != 0) {
newCurrentAnnotation = currentAnnotation;
} else {
@@ -4207,7 +4210,10 @@
newCurrentAnnotation = linkAnnotation;
}
- if (hideNotes == NO && [[self document] allowsNotes] && page != nil && newCurrentAnnotation != nil) {
+ if (newCurrentAnnotation == nil)
+ return NO;
+
+ if (hideNotes == NO && [[self document] allowsNotes]) {
BOOL isInk = toolMode == SKToolModeNote && annotationMode == SKNoteTypeInk;
NSUInteger modifiers = [theEvent modifierFlags];
if ((modifiers & NSEventModifierFlagOption) && [newCurrentAnnotation isMovable] &&
@@ -4227,10 +4233,10 @@
}
}
- if (newCurrentAnnotation && newCurrentAnnotation != currentAnnotation)
+ if (newCurrentAnnotation != currentAnnotation)
[self setCurrentAnnotation:newCurrentAnnotation];
- return newCurrentAnnotation != nil;
+ return YES;
}
static NSArray *scaledDashPattern(NSArray *dashPattern, CGFloat scale) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:33:58
|
Revision: 15593
http://sourceforge.net/p/skim-app/code/15593
Author: hofman
Date: 2025-07-03 09:33:54 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
let pdfview observe undomanager notifications
Modified Paths:
--------------
trunk/SKMainWindowController_UI.m
trunk/SKPDFView.h
trunk/SKPDFView.m
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-07-03 09:23:10 UTC (rev 15592)
+++ trunk/SKMainWindowController_UI.m 2025-07-03 09:33:54 UTC (rev 15593)
@@ -2095,10 +2095,6 @@
undoGroupOldPropertiesPerNote = nil;
}
-- (void)handleOpenOrCloseUndoGroupNotification:(NSNotification *)notification {
- [pdfView undoManagerDidOpenOrCloseUndoGroup];
-}
-
#pragma mark Observer registration
- (void)registerForNotifications {
@@ -2117,13 +2113,8 @@
[nc addObserver:self selector:@selector(handleReadingBarDidChangeNotification:)
name:SKPDFViewReadingBarDidChangeNotification object:pdfView];
// UndoManager
- NSUndoManager *undoManager = [[self document] undoManager];
[nc addObserver:self selector:@selector(observeUndoManagerCheckpoint:)
- name:NSUndoManagerCheckpointNotification object:undoManager];
- [nc addObserver:self selector:@selector(handleOpenOrCloseUndoGroupNotification:)
- name:NSUndoManagerDidOpenUndoGroupNotification object:undoManager];
- [nc addObserver:self selector:@selector(handleOpenOrCloseUndoGroupNotification:)
- name:NSUndoManagerDidCloseUndoGroupNotification object:undoManager];
+ name:NSUndoManagerCheckpointNotification object:[[self document] undoManager]];
// SKDocumentController
[nc addObserver:self selector:@selector(handleWillRemoveDocumentNotification:)
name:SKDocumentControllerWillRemoveDocumentNotification object:nil];
Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h 2025-07-03 09:23:10 UTC (rev 15592)
+++ trunk/SKPDFView.h 2025-07-03 09:33:54 UTC (rev 15593)
@@ -253,8 +253,6 @@
- (nullable NSString *)currentColorDefaultKeyForAlternate:(BOOL)isAlt;
-- (void)undoManagerDidOpenOrCloseUndoGroup;
-
- (void)updatedAnnotation:(PDFAnnotation *)annotation forKey:(nullable NSString *)key fromValue:(nullable id)oldValue;
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page;
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:23:10 UTC (rev 15592)
+++ trunk/SKPDFView.m 2025-07-03 09:33:54 UTC (rev 15593)
@@ -243,6 +243,7 @@
- (void)handlePageChangedNotification:(NSNotification *)notification;
- (void)handleScaleChangedNotification:(NSNotification *)notification;
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification;
+- (void)handleOpenOrCloseUndoGroupNotification:(NSNotification *)notification;
- (void)registerForDocumentNotifications;
- (void)unregisterForDocumentNotifications;
@@ -3233,7 +3234,7 @@
[self setTemporaryToolMode:SKToolModeNone];
}
-- (void)undoManagerDidOpenOrCloseUndoGroup {
+- (void)handleOpenOrCloseUndoGroupNotification:(NSNotification *)notification {
wantsNewUndoGroup = NO;
}
@@ -5151,6 +5152,11 @@
if (newDelegate == nil)
[self cleanup];
[super setDelegate:newDelegate];
+ if (newDelegate) {
+ NSUndoManager *undoManager = [self undoManager];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenOrCloseUndoGroupNotification:) name:NSUndoManagerDidOpenUndoGroupNotification object:undoManager];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenOrCloseUndoGroupNotification:) name:NSUndoManagerDidCloseUndoGroupNotification object:undoManager];
+ }
}
- (NSString *)currentColorDefaultKeyForAlternate:(BOOL)isAlt {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:23:14
|
Revision: 15592
http://sourceforge.net/p/skim-app/code/15592
Author: hofman
Date: 2025-07-03 09:23:10 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
use array convenience method
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:20:21 UTC (rev 15591)
+++ trunk/SKPDFView.m 2025-07-03 09:23:10 UTC (rev 15592)
@@ -2429,8 +2429,7 @@
if ([string length] > 0)
[newAnnotation setString:string];
} else if ([currentAnnotation isInk]) {
- NSMutableArray *paths = [[currentAnnotation pagePaths] mutableCopy];
- [paths addObjectsFromArray:[annotation pagePaths]];
+ NSArray *paths = [[currentAnnotation pagePaths] arrayByAddingObjectsFromArray:[annotation pagePaths]];
NSString *string1 = [currentAnnotation string];
NSString *string2 = [annotation string];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-03 09:20:24
|
Revision: 15591
http://sourceforge.net/p/skim-app/code/15591
Author: hofman
Date: 2025-07-03 09:20:21 +0000 (Thu, 03 Jul 2025)
Log Message:
-----------
combine adding freehand note
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-03 09:13:55 UTC (rev 15590)
+++ trunk/SKPDFView.m 2025-07-03 09:20:21 UTC (rev 15591)
@@ -4352,17 +4352,19 @@
[NSEvent setMouseCoalescingEnabled:wasMouseCoalescingEnabled];
if (bezierPath) {
+ PDFAnnotation *annotation = nil;
+ BOOL select = YES;
if (currentAnnotation) {
- PDFAnnotation *annotation = [PDFAnnotation newSkimNoteWithPaths:[[currentAnnotation pagePaths] arrayByAddingObject:bezierPath]];
+ annotation = [PDFAnnotation newSkimNoteWithPaths:[[currentAnnotation pagePaths] arrayByAddingObject:bezierPath]];
[annotation setColor:[currentAnnotation color]];
[annotation setBorder:[currentAnnotation border]];
[annotation setString:[currentAnnotation string]];
[[self document] removeAnnotation:currentAnnotation];
- [self addAnnotation:annotation toPage:page select:YES];
} else {
- PDFAnnotation *annotation = [PDFAnnotation newSkimNoteWithPaths:@[bezierPath]];
- [self addAnnotation:annotation toPage:page select:([theEvent modifierFlags] & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock)) != 0];
+ annotation = [PDFAnnotation newSkimNoteWithPaths:@[bezierPath]];
+ select = ([theEvent modifierFlags] & (NSEventModifierFlagShift | NSEventModifierFlagCapsLock)) != 0;
}
+ [self addAnnotation:annotation toPage:page select:select];
} else if (([theEvent modifierFlags] & NSEventModifierFlagCapsLock)) {
[self setCurrentAnnotation:nil];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|