Revision: 13908
http://sourceforge.net/p/skim-app/code/13908
Author: hofman
Date: 2023-12-16 15:25:09 +0000 (Sat, 16 Dec 2023)
Log Message:
-----------
remove scroller subclass
Modified Paths:
--------------
trunk/Base.lproj/TransitionSheet.xib
trunk/LeftSideView.xib
trunk/SKMainWindowController.m
trunk/SKMainWindowController_UI.m
trunk/SKPDFSynchronizer.h
trunk/SKPDFSynchronizer.m
trunk/SKPresentationOptionsSheetController.h
trunk/SKPresentationOptionsSheetController.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/SKScroller.h
trunk/SKScroller.m
Modified: trunk/Base.lproj/TransitionSheet.xib
===================================================================
--- trunk/Base.lproj/TransitionSheet.xib 2023-12-16 14:47:23 UTC (rev
13907)
+++ trunk/Base.lproj/TransitionSheet.xib 2023-12-16 15:25:09 UTC (rev
13908)
@@ -388,7 +388,7 @@
<rect key="frame" x="-100" y="-100" width="128"
height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
- <scroller key="verticalScroller" wantsLayer="YES"
verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="447"
userLabel="Vertical Scroller" customClass="SKScroller">
+ <scroller key="verticalScroller" wantsLayer="YES"
verticalHuggingPriority="750" controlSize="small" horizontal="NO" id="447"
userLabel="Vertical Scroller">
<rect key="frame" x="116" y="1" width="14"
height="232"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
Modified: trunk/LeftSideView.xib
===================================================================
--- trunk/LeftSideView.xib 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/LeftSideView.xib 2023-12-16 15:25:09 UTC (rev 13908)
@@ -109,7 +109,7 @@
<rect key="frame" x="0.0" y="0.0" width="200" height="399"/>
<clipView key="contentView" drawsBackground="NO"
translatesAutoresizingMaskIntoConstraints="NO" id="Mfb-HY-gcR">
<rect key="frame" x="1" y="1" width="198" height="397"/>
- <autoresizingMask key="autoresizingMask"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES"
heightSizable="YES"/>
<subviews>
<tableView focusRingType="none"
verticalHuggingPriority="750" allowsExpansionToolTips="YES"
columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="sourceList"
columnReordering="NO" columnResizing="NO" multipleSelection="NO"
emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="32"
viewBased="YES" id="101" customClass="SKTableView">
<rect key="frame" x="0.0" y="0.0" width="198"
height="397"/>
@@ -216,7 +216,7 @@
<rect key="frame" x="-100" y="-100" width="183" height="15"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
- <scroller key="verticalScroller" hidden="YES" wantsLayer="YES"
verticalHuggingPriority="750" doubleValue="0.12060301507537691" horizontal="NO"
id="100" userLabel="Vertical Scroller" customClass="SKScroller">
+ <scroller key="verticalScroller" hidden="YES" wantsLayer="YES"
verticalHuggingPriority="750" doubleValue="0.12060301507537691" horizontal="NO"
id="100" userLabel="Vertical Scroller">
<rect key="frame" x="184" y="1" width="15" height="398"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
@@ -336,7 +336,7 @@
<rect key="frame" x="0.0" y="0.0" width="200" height="403"/>
<clipView key="contentView"
translatesAutoresizingMaskIntoConstraints="NO" id="VaG-cU-bQa">
<rect key="frame" x="1" y="1" width="198" height="401"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES"
heightSizable="YES"/>
+ <autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView focusRingType="none"
verticalHuggingPriority="750" allowsExpansionToolTips="YES"
columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES"
columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO"
headerView="108" viewBased="YES" id="111" customClass="SKTableView">
<rect key="frame" x="0.0" y="0.0" width="198"
height="376"/>
@@ -453,7 +453,7 @@
<rect key="frame" x="0.0" y="0.0" width="200" height="403"/>
<clipView key="contentView"
translatesAutoresizingMaskIntoConstraints="NO" id="CUc-Bz-YWJ">
<rect key="frame" x="1" y="1" width="198" height="401"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES"
heightSizable="YES"/>
+ <autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView focusRingType="none"
verticalHuggingPriority="750" allowsExpansionToolTips="YES"
columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES"
columnReordering="NO" columnResizing="NO" autosaveColumns="NO" typeSelect="NO"
headerView="125" viewBased="YES" id="128" customClass="SKTableView">
<rect key="frame" x="0.0" y="0.0" width="198"
height="376"/>
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKMainWindowController.m 2023-12-16 15:25:09 UTC (rev 13908)
@@ -97,7 +97,6 @@
#import "NSScreen_SKExtensions.h"
#import "PDFView_SKExtensions.h"
#import "NSScanner_SKExtensions.h"
-#import "SKScroller.h"
#import "SKMainWindow.h"
#import "PDFOutline_SKExtensions.h"
#import "NSWindow_SKExtensions.h"
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKMainWindowController_UI.m 2023-12-16 15:25:09 UTC (rev 13908)
@@ -79,7 +79,6 @@
#import "NSURL_SKExtensions.h"
#import "PDFDocument_SKExtensions.h"
#import "NSArray_SKExtensions.h"
-#import "SKScroller.h"
#import "SKNoteTableRowView.h"
#import "SKHighlightingTableRowView.h"
#import "SKSecondaryPDFView.h"
Modified: trunk/SKPDFSynchronizer.h
===================================================================
--- trunk/SKPDFSynchronizer.h 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKPDFSynchronizer.h 2023-12-16 15:25:09 UTC (rev 13908)
@@ -53,8 +53,9 @@
__weak id <SKPDFSynchronizerDelegate> delegate;
dispatch_queue_t queue;
- dispatch_queue_t lockQueue;
+ NSLock *lock;
+
NSString *fileName;
NSString *syncFileName;
NSDate *lastModDate;
Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKPDFSynchronizer.m 2023-12-16 15:25:09 UTC (rev 13908)
@@ -68,8 +68,9 @@
self = [super init];
if (self) {
queue = NULL;
- lockQueue =
dispatch_queue_create("net.sourceforge.skim-app.lockQueue.SKPDFSynchronizer",
NULL);
+ lock = [[NSLock alloc] init];
+
fileName = nil;
syncFileName = nil;
lastModDate = nil;
@@ -108,10 +109,9 @@
}
- (NSString *)fileName {
- NSString __block *file = nil;
- dispatch_sync(lockQueue, ^{
- file = fileName;
- });
+ [lock lock];
+ NSString *file = fileName;
+ [lock unlock];
return file;
}
@@ -118,40 +118,38 @@
- (void)setFileName:(NSString *)newFileName {
// we compare filenames in canonical form throughout, so we need to make
sure fileName also is in canonical form
newFileName = [[newFileName stringByResolvingSymlinksInPath]
stringByStandardizingPath];
- dispatch_sync(lockQueue, ^{
- if (fileName != newFileName) {
- if ([fileName isEqualToString:newFileName] == NO) {
- syncFileName = nil;
- lastModDate = nil;
- }
- fileName = newFileName;
+ [lock lock];
+ if (fileName != newFileName) {
+ if ([fileName isEqualToString:newFileName] == NO) {
+ syncFileName = nil;
+ lastModDate = nil;
}
- });
+ fileName = newFileName;
+ }
+ [lock unlock];
}
- (NSString *)syncFileName {
- NSString __block *file = nil;
- dispatch_sync(lockQueue, ^{
- file = syncFileName;
- });
+ [lock lock];
+ NSString *file = syncFileName;
+ [lock unlock];
return file;
}
// this should only be used from the server thread
- (void)setSyncFileName:(NSString *)newSyncFileName {
- dispatch_sync(lockQueue, ^{
- if (syncFileName != newSyncFileName) {
- syncFileName = newSyncFileName;
- }
- lastModDate = (syncFileName ? [[fileManager
attributesOfItemAtPath:syncFileName error:NULL] fileModificationDate] : nil);
- });
+ [lock lock];
+ if (syncFileName != newSyncFileName) {
+ syncFileName = newSyncFileName;
+ }
+ lastModDate = (syncFileName ? [[fileManager
attributesOfItemAtPath:syncFileName error:NULL] fileModificationDate] : nil);
+ [lock unlock];
}
- (NSDate *)lastModDate {
- NSDate __block *date = nil;
- dispatch_sync(lockQueue, ^{
- date = lastModDate;
- });
+ [lock lock];
+ NSDate *date = lastModDate;
+ [lock unlock];
return date;
}
Modified: trunk/SKPresentationOptionsSheetController.h
===================================================================
--- trunk/SKPresentationOptionsSheetController.h 2023-12-16 14:47:23 UTC
(rev 13907)
+++ trunk/SKPresentationOptionsSheetController.h 2023-12-16 15:25:09 UTC
(rev 13908)
@@ -40,7 +40,7 @@
#import "SKTransitionController.h"
#import "SKTableView.h"
-@class SKMainWindowController, SKThumbnail, SKTransitionInfo, SKScroller;
+@class SKMainWindowController, SKThumbnail, SKTransitionInfo;
@interface SKPresentationOptionsSheetController : NSWindowController
<NSWindowDelegate, SKTableViewDelegate, NSTableViewDataSource,
NSTouchBarDelegate> {
NSPopUpButton *notesDocumentPopUpButton;
@@ -72,7 +72,6 @@
@property (nonatomic, readonly) NSArray *pageTransitions;
@property (nonatomic, readonly) NSDocument *notesDocument;
@property (nonatomic, readonly) NSInteger notesDocumentOffset;
-@property (nonatomic, readonly) SKScroller *verticalScroller;
@property (nonatomic, readonly) NSUndoManager *undoManager;
- (instancetype)initForController:(SKMainWindowController *)aController;
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2023-12-16 14:47:23 UTC
(rev 13907)
+++ trunk/SKPresentationOptionsSheetController.m 2023-12-16 15:25:09 UTC
(rev 13908)
@@ -47,7 +47,6 @@
#import "SKMainWindowController.h"
#import "SKPDFView.h"
#import "SKImageToolTipWindow.h"
-#import "SKScroller.h"
#import "NSWindowController_SKExtensions.h"
#import "NSDocument_SKExtensions.h"
#import "NSGraphics_SKExtensions.h"
@@ -82,7 +81,7 @@
@implementation SKPresentationOptionsSheetController
@synthesize notesDocumentPopUpButton, tableView, stylePopUpButton, okButton,
cancelButton, tableWidthConstraint, boxLeadingConstraint, arrayController,
separate, transition, transitions, undoManager;
-@dynamic currentTransitions, pageTransitions, notesDocument,
notesDocumentOffset, verticalScroller;
+@dynamic currentTransitions, pageTransitions, notesDocument,
notesDocumentOffset;
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
@@ -340,10 +339,6 @@
return [[notesDocumentPopUpButton selectedItem] tag];
}
-- (SKScroller *)verticalScroller {
- return (SKScroller *)[[tableView enclosingScrollView] verticalScroller];
-}
-
#pragma mark Undo
- (void)observeUndoManagerCheckpoint:(NSNotification *)notification {
Deleted: trunk/SKScroller.h
===================================================================
--- trunk/SKScroller.h 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKScroller.h 2023-12-16 15:25:09 UTC (rev 13908)
@@ -1,47 +0,0 @@
-//
-// SKScroller.h
-// Skim
-//
-// Created by Christiaan Hofman on 3/25/15.
-/*
- This software is Copyright (c) 2015-2023
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-extern NSString *SKScrollerDidScrollNotification;
-
-@interface SKScroller : NSScroller {
- BOOL scrolling;
-}
-@property (nonatomic, readonly, getter=isScrolling) BOOL scrolling;
-@end
Deleted: trunk/SKScroller.m
===================================================================
--- trunk/SKScroller.m 2023-12-16 14:47:23 UTC (rev 13907)
+++ trunk/SKScroller.m 2023-12-16 15:25:09 UTC (rev 13908)
@@ -1,58 +0,0 @@
-//
-// SKScroller.m
-// Skim
-//
-// Created by Christiaan Hofman on 3/25/15.
-/*
- This software is Copyright (c) 2015-2023
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "SKScroller.h"
-
-NSString *SKScrollerDidScrollNotification = @"SKScrollerDidScrollNotification";
-
-@implementation SKScroller
-
-@synthesize scrolling;
-
-+ (BOOL)isCompatibleWithOverlayScrollers {
- return YES;
-}
-
-- (void)trackKnob:(NSEvent *)theEvent {
- scrolling = YES;
- [super trackKnob:theEvent];
- scrolling = NO;
- [[NSNotificationCenter defaultCenter]
postNotificationName:SKScrollerDidScrollNotification object:self];
-}
-
-@end
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2023-12-16 14:47:23 UTC (rev
13907)
+++ trunk/Skim.xcodeproj/project.pbxproj 2023-12-16 15:25:09 UTC (rev
13908)
@@ -272,7 +272,6 @@
CEE8DFCE0E5C809C00EFA97F /* SkimNotes.framework in Frameworks
*/ = {isa = PBXBuildFile; fileRef = CE7DC7320E09286500D6D76D /*
SkimNotes.framework */; };
CEE8DFCF0E5C809C00EFA97F /* Sparkle.framework in Frameworks */
= {isa = PBXBuildFile; fileRef = CE2BD8200BD4127A00A5F4DB /* Sparkle.framework
*/; };
CEE9BC0814CDD98100262718 /* SKBookmarkSheetController.m in
Sources */ = {isa = PBXBuildFile; fileRef = CEE9BC0714CDD98100262718 /*
SKBookmarkSheetController.m */; };
- CEEB32831AC30ECA00BDB4E8 /* SKScroller.m in Sources */ = {isa =
PBXBuildFile; fileRef = CEEB32821AC30ECA00BDB4E8 /* SKScroller.m */; };
CEEC0A0A0DCB2594003DD9B6 /* SKMainWindowController_UI.m in
Sources */ = {isa = PBXBuildFile; fileRef = CEEC0A090DCB2594003DD9B6 /*
SKMainWindowController_UI.m */; };
CEECD61C12E9E30B00B9E35E /* NSError_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CEECD61B12E9E30B00B9E35E /*
NSError_SKExtensions.m */; };
CEED148C2709EE4D00A8C4AA /* SKBasePDFView.m in Sources */ =
{isa = PBXBuildFile; fileRef = CEED148B2709EE4D00A8C4AA /* SKBasePDFView.m */;
};
@@ -1221,8 +1220,6 @@
CEE7E77A24426C380034690E /*
PDFAnnotationChoiceWidget_SKExtensions.m */ = {isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc; path =
PDFAnnotationChoiceWidget_SKExtensions.m; sourceTree = "<group>"; };
CEE9BC0614CDD98100262718 /* SKBookmarkSheetController.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = SKBookmarkSheetController.h; sourceTree = "<group>"; };
CEE9BC0714CDD98100262718 /* SKBookmarkSheetController.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = SKBookmarkSheetController.m; sourceTree = "<group>";
};
- CEEB32811AC30ECA00BDB4E8 /* SKScroller.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKScroller.h; sourceTree = "<group>"; };
- CEEB32821AC30ECA00BDB4E8 /* SKScroller.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= SKScroller.m; sourceTree = "<group>"; };
CEEC0A080DCB2594003DD9B6 /* SKMainWindowController_UI.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = SKMainWindowController_UI.h; sourceTree = "<group>"; };
CEEC0A090DCB2594003DD9B6 /* SKMainWindowController_UI.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = SKMainWindowController_UI.m; sourceTree = "<group>";
};
CEECD61A12E9E30B00B9E35E /* NSError_SKExtensions.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
NSError_SKExtensions.h; sourceTree = "<group>"; };
@@ -1898,8 +1895,6 @@
CE7611630EA49D1400301E45 /* SKPrintableView.m
*/,
CE7A3A3E2269CC5E00F1B89B /*
SKProgressTableCellView.h */,
CE7A3A3F2269CC5E00F1B89B /*
SKProgressTableCellView.m */,
- CEEB32811AC30ECA00BDB4E8 /* SKScroller.h */,
- CEEB32821AC30ECA00BDB4E8 /* SKScroller.m */,
CED76EFF1A1825DE00D1ACA4 /* SKScrollView.h */,
CED76F001A1825DE00D1ACA4 /* SKScrollView.m */,
CEAE1C450CA1877F00849B0F /*
SKSecondaryPDFView.h */,
@@ -2978,7 +2973,6 @@
CE19641516E811D40027E2CF /* SKSnapshotWindow.m
in Sources */,
CED76F011A1825DE00D1ACA4 /* SKScrollView.m in
Sources */,
CE5234A61A6424F200710CF2 /*
NSShadow_SKExtensions.m in Sources */,
- CEEB32831AC30ECA00BDB4E8 /* SKScroller.m in
Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
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