Revision: 28630
http://sourceforge.net/p/bibdesk/svn/28630
Author: hofman
Date: 2024-01-18 15:52:26 +0000 (Thu, 18 Jan 2024)
Log Message:
-----------
Use @property for properties, and synthesize some accessors. Use formal
download delegate protocol. Allow weak for MRC and declare weak, strong, and
unsafe_unretained variables and properties.
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/Configurations/FileView-Common.xcconfig
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperationQueue.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m
Modified:
trunk/bibdesk_vendorsrc/amaxwell/FileView/Configurations/FileView-Common.xcconfig
===================================================================
---
trunk/bibdesk_vendorsrc/amaxwell/FileView/Configurations/FileView-Common.xcconfig
2024-01-17 17:13:03 UTC (rev 28629)
+++
trunk/bibdesk_vendorsrc/amaxwell/FileView/Configurations/FileView-Common.xcconfig
2024-01-18 15:52:26 UTC (rev 28630)
@@ -6,6 +6,8 @@
ZERO_LINK = NO
COMBINE_HIDPI_IMAGES = YES
+CLANG_ENABLE_OBJC_WEAK = YES
+
ALWAYS_SEARCH_USER_PATHS = NO
// libstdc++ cannot be linked in Xcode 10
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.h
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.h
2024-01-18 15:52:26 UTC (rev 28630)
@@ -44,7 +44,7 @@
id _parent;
}
- (id)initWithIndex:(NSUInteger)anIndex parent:(id)aParent;
-- (NSUInteger)index;
+@property (nonatomic, readonly) NSUInteger index;
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.m
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVAccessibilityIconElement.m
2024-01-18 15:52:26 UTC (rev 28630)
@@ -41,6 +41,8 @@
@implementation FVAccessibilityIconElement
+@synthesize index=_index;
+
- (id)initWithIndex:(NSUInteger)anIndex parent:(id)aParent;
{
if (self = [super init]) {
@@ -50,10 +52,6 @@
return self;
}
-- (NSUInteger)index {
- return _index;
-}
-
- (NSArray *)accessibilityAttributeNames {
static NSArray *attributes = nil;
if (attributes == nil) {
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -72,19 +72,19 @@
/** @internal @brief Core Graphics context.
@return CGContext owned by FVBitmapContext. */
-- (CGContextRef)graphicsPort;
+@property (nonatomic, readonly) CGContextRef graphicsPort;
/** @internal @brief Unflipped Cocoa graphics context.
Lazily instantiates a new NSGraphicsContext from
FVBitmapContext::graphicsPort.
@return Unflipped NSGraphicsContext owned by FVBitmapContext. */
-- (NSGraphicsContext *)graphicsContext;
+@property (nonatomic, readonly) NSGraphicsContext *graphicsContext;
/** @internal @brief Flipped Cocoa graphics context.
Lazily instantiates a new NSGraphicsContext from
FVBitmapContext::graphicsPort.
@return Flipped NSGraphicsContext owned by FVBitmapContext. */
-- (NSGraphicsContext *)flippedGraphicsContext;
+@property (nonatomic, readonly) NSGraphicsContext *flippedGraphicsContext;
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVBitmapContext.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -50,6 +50,10 @@
@implementation FVBitmapContext
+@dynamic graphicsPort;
+@dynamic graphicsContext;
+@dynamic flippedGraphicsContext;
+
- (id)init
{
[NSException raise:NSInternalInconsistencyException format:@"Invalid
initializer %s", __func__];
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
2024-01-18 15:52:26 UTC (rev 28630)
@@ -345,7 +345,7 @@
NSCParameterAssert(tableElements <= sizeof(table) / sizeof(unsigned char));
CGColorSpaceGetColorTable(cspace, table);
- FVImageBuffer *planarBuffers[4];
+ __unsafe_unretained FVImageBuffer *planarBuffers[4];
[buffers getObjects:planarBuffers range:NSMakeRange(0, 4)];
// set sizes to avoid a mismatch; these are guaranteed to be large enough
@@ -408,7 +408,7 @@
}
vImage_Error ret;
- FVImageBuffer *planarBuffers[4];
+ __unsafe_unretained FVImageBuffer *planarBuffers[4];
[buffers getObjects:planarBuffers range:NSMakeRange(0, 4)];
// set sizes to avoid a mismatch; these are guaranteed to be large enough
@@ -473,7 +473,7 @@
}
vImage_Error ret;
- FVImageBuffer *planarBuffers[4];
+ __unsafe_unretained FVImageBuffer *planarBuffers[4];
[buffers getObjects:planarBuffers range:NSMakeRange(0, 4)];
// set sizes to avoid a mismatch; these are guaranteed to be large enough
@@ -631,7 +631,7 @@
{
NSCParameterAssert([planarBuffers count] == 4);
- const FVImageBuffer *planarA[4];
+ const __unsafe_unretained FVImageBuffer *planarA[4];
[planarBuffers getObjects:planarA range:NSMakeRange(0, 4)];
vImage_Error ret;
@@ -874,10 +874,10 @@
}
imageBuffer = nil;
- const FVImageBuffer *planarA[4];
+ const __unsafe_unretained FVImageBuffer *planarA[4];
[planarTilesA getObjects:planarA range:NSMakeRange(0, 4)];
- const FVImageBuffer *planarB[4];
+ const __unsafe_unretained FVImageBuffer *planarB[4];
[planarTilesB getObjects:planarB range:NSMakeRange(0, 4)];
// keep track of the next scanline/byte offset in the final image
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -64,7 +64,7 @@
NSTextFieldCell *_labelCell;
NSTextFieldCell *_labelNameCell;
SEL _action;
- id _target;
+ __weak id _target;
}
/** @brief Returns a new, autoreleased instance.
@@ -80,17 +80,12 @@
/** @brief Target for control action.
- Target must implement @code -(NSInteger)tag @endcode to return the selected
Finder label.
- @param target The receiver of the view's action selector. */
-- (void)setTarget:(id)target;
-/** The control's target. */
-- (id)target;
+ Target must implement @code -(NSInteger)tag @endcode to return the selected
Finder label. */
+@property (weak) id target;
-/** Action for selection changes. */
-- (SEL)action;
-/** Sets the action for selection changes.
-
- @param action Action will be sent to the control's target. */
-- (void)setAction:(SEL)action;
+/** Action for selection changes.
+ Action will be sent to the control's target. */
+@property SEL action;
+
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -65,6 +65,9 @@
@implementation FVColorMenuView
+@dynamic target;
+@dynamic action;
+
#define DEFAULT_FRAME ((NSRect) { 0.0, 0.0, 188.0, 68.0 })
#define DEFAULT_SIZE ((NSSize) { 188.0, 68.0 })
#define DEFAULT_HEIGHT ((CGFloat) 68.0)
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -38,37 +38,35 @@
#import <Cocoa/Cocoa.h>
+@protocol FVDownloadDelegate;
@interface FVDownload : NSObject <NSURLDownloadDelegate>
{
@private;
- NSURL *_downloadURL;
- NSURL *_fileURL;
- BOOL _replace;
- NSUInteger _indexInView;
- long long _expectedLength;
- long long _receivedLength;
- id _delegate;
- NSURLDownload *_download;
+ NSURL *_downloadURL;
+ NSURL *_fileURL;
+ BOOL _replace;
+ NSUInteger _indexInView;
+ long long _expectedLength;
+ long long _receivedLength;
+ __weak id<FVDownloadDelegate> _delegate;
+ NSURLDownload *_download;
}
- (id)initWithDownloadURL:(NSURL *)aURL indexInView:(NSUInteger)indexInView
replace:(BOOL)replace;
-- (void)setDelegate:(id)obj;
-- (id)delegate;
+@property (nonatomic, weak) id<FVDownloadDelegate> delegate;
-- (NSURL *)downloadURL;
-- (NSUInteger)indexInView;
-- (BOOL)replace;
+@property (nonatomic, readonly) NSURL *downloadURL;
+@property (nonatomic, readonly) NSUInteger indexInView;
+@property (nonatomic, readonly) BOOL replace;
-- (void)setFileURL:(NSURL *)fileURL;
-- (NSURL *)fileURL;
+@property (nonatomic, strong) NSURL *fileURL;
-- (void)setExpectedLength:(long long)expectedLength;
-- (long long)expectedLength;
+@property (nonatomic) long long expectedLength;
- (void)incrementReceivedLengthBy:(NSUInteger)length;
-- (CGFloat)currentProgress;
+@property (nonatomic, readonly) CGFloat currentProgress;
- (void)start;
- (void)cancel;
@@ -75,7 +73,7 @@
@end
-@interface NSObject (FVDownloadDelegate)
+@protocol FVDownloadDelegate <NSObject>
- (void)downloadUpdated:(FVDownload *)download;
- (void)downloadFinished:(FVDownload *)download;
- (void)downloadFailed:(FVDownload *)download;
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVDownload.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -45,8 +45,21 @@
FVDownload can be used in a hashing collection.
*/
+@interface FVDownload ()
+@property (nonatomic) long long receivedLength;
+@end
+
@implementation FVDownload
+@synthesize delegate=_delegate;
+@synthesize downloadURL=_downloadURL;
+@synthesize indexInView=_indexInView;
+@synthesize replace=_replace;
+@synthesize fileURL=_fileURL;
+@synthesize expectedLength=_expectedLength;
+@synthesize receivedLength=_receivedLength;
+@dynamic currentProgress;
+
- (id)initWithDownloadURL:(NSURL *)aURL indexInView:(NSUInteger)indexInView
replace:(BOOL)replace;
{
NSParameterAssert(nil != aURL);
@@ -91,7 +104,6 @@
return ([other isKindOfClass:[self class]] && [other->_downloadURL
isEqual:_downloadURL] && other->_indexInView == _indexInView);
}
-- (NSURL *)fileURL { return _fileURL; }
- (void)setFileURL:(NSURL *)fileURL
{
NSAssert1(nil == _fileURL, @"Error: attempt to set _fileURL when it is
already set to %@", _fileURL);
@@ -100,31 +112,11 @@
_fileURL = [fileURL copy];
}
-- (void)setExpectedLength:(long long)expectedLength
-{
- _expectedLength = expectedLength;
-}
-- (long long)expectedLength { return _expectedLength; }
-
-- (long long)receivedLength { return _receivedLength; }
-- (void)setReceivedLength:(long long)receivedLength
-{
- _receivedLength = receivedLength;
-}
-
- (void)incrementReceivedLengthBy:(NSUInteger)length;
{
_receivedLength += length;
}
-- (NSURL *)downloadURL { return _downloadURL; }
-- (NSUInteger)indexInView { return _indexInView; }
-- (BOOL)replace { return _replace; }
-
-- (id)delegate { return _delegate; }
-
-- (void)setDelegate:(id)obj { _delegate = obj; }
-
- (void)start
{
NSAssert1(nil == _download, @"Error: already called -start on %@", self);
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -208,23 +208,23 @@
@interface FVFileView : NSView
{
@private
- id<FVFileViewDelegate> _delegate;
- id<FVFileViewDataSource> _dataSource;
- NSMutableArray *_orderedIcons;
- NSMutableArray *_orderedURLs;
- NSMutableArray *_orderedSubtitles;
- NSMutableDictionary *_iconCache;
- NSMutableDictionary *_zombieIconCache;
- CFMutableDictionaryRef _infoTable;
- NSUInteger _numberOfColumns;
- NSUInteger _numberOfRows;
- NSColor *_backgroundColor;
- CFRunLoopTimerRef _zombieTimer;
- NSIndexSet *_selectionIndexes;
- CGLayerRef _selectionOverlay;
- NSUInteger _lastClickedIndex;
- NSUInteger _dropIndex;
- NSRect _rubberBandRect;
+ __weak id<FVFileViewDelegate> _delegate;
+ __weak id<FVFileViewDataSource> _dataSource;
+ NSMutableArray *_orderedIcons;
+ NSMutableArray *_orderedURLs;
+ NSMutableArray *_orderedSubtitles;
+ NSMutableDictionary *_iconCache;
+ NSMutableDictionary *_zombieIconCache;
+ CFMutableDictionaryRef _infoTable;
+ NSUInteger _numberOfColumns;
+ NSUInteger _numberOfRows;
+ NSColor *_backgroundColor;
+ CFRunLoopTimerRef _zombieTimer;
+ NSIndexSet *_selectionIndexes;
+ CGLayerRef _selectionOverlay;
+ NSUInteger _lastClickedIndex;
+ NSUInteger _dropIndex;
+ NSRect _rubberBandRect;
struct __fvFlags {
unsigned int displayMode:2;
unsigned int dropOperation:2;
@@ -238,178 +238,113 @@
unsigned int controllingSharedPreviewer:1;
unsigned int controllingQLPreviewPanel:1;
} _fvFlags;
- NSSize _padding;
- NSSize _iconSize;
- double _minScale;
- double _maxScale;
- NSPoint _lastMouseDownLocInView;
- CFAbsoluteTime _timeOfLastOrigin;
- NSPoint _lastOrigin;
- NSTextFieldCell *_titleCell;
- NSTextFieldCell *_subtitleCell;
- NSMutableArray *_trackingAreas;
- NSButtonCell *_leftArrow;
- NSButtonCell *_rightArrow;
- NSRect _leftArrowFrame;
- NSRect _rightArrowFrame;
- CGFloat _arrowAlpha;
- NSAnimation *_arrowAnimation;
- FVSliderWindow *_sliderWindow;
- NSTrackingArea *_topSliderArea;
- NSTrackingArea *_bottomSliderArea;
- FVOperationQueue *_operationQueue;
- NSDictionary *_contentBinding;
- NSMutableArray *_downloads;
- NSMutableDictionary *_progressIndicators;
- CFRunLoopTimerRef _progressTimer;
- NSMutableArray *_accessibilityIcons;
- NSMutableSet *_modificationSet;
- NSLock *_modificationLock;
- FVBackgroundView *_backgroundView;
+ NSSize _padding;
+ NSSize _iconSize;
+ double _minScale;
+ double _maxScale;
+ NSPoint _lastMouseDownLocInView;
+ CFAbsoluteTime _timeOfLastOrigin;
+ NSPoint _lastOrigin;
+ NSTextFieldCell *_titleCell;
+ NSTextFieldCell *_subtitleCell;
+ NSMutableArray *_trackingAreas;
+ NSButtonCell *_leftArrow;
+ NSButtonCell *_rightArrow;
+ NSRect _leftArrowFrame;
+ NSRect _rightArrowFrame;
+ CGFloat _arrowAlpha;
+ NSAnimation *_arrowAnimation;
+ FVSliderWindow *_sliderWindow;
+ NSTrackingArea *_topSliderArea;
+ NSTrackingArea *_bottomSliderArea;
+ FVOperationQueue *_operationQueue;
+ NSDictionary *_contentBinding;
+ NSMutableArray *_downloads;
+ NSMutableDictionary *_progressIndicators;
+ CFRunLoopTimerRef _progressTimer;
+ NSMutableArray *_accessibilityIcons;
+ NSMutableSet *_modificationSet;
+ NSLock *_modificationLock;
+ FVBackgroundView *_backgroundView;
}
/** The icon URLs.
This property is KVO-compliant and supports Cocoa bindings.*/
-- (NSArray *)iconURLs;
+@property (nonatomic, copy, readonly) NSArray *iconURLs;
/** Currently selected indexes.
- This property is KVO-compliant and supports Cocoa bindings. Indexes are
numbered in ascending order order from left to right, top to bottom (row-major
order).*/
-- (NSIndexSet *)selectionIndexes;
+ This property is KVO-compliant and supports Cocoa bindings. Indexes are
numbered in ascending order order from left to right, top to bottom (row-major
order).
+ Must not be nil. Pass an empty NSIndexSet to clear selection.*/
+@property (nonatomic, copy) NSIndexSet *selectionIndexes;
-/** Set current selection indexes.
-
- This property is KVO-compliant and supports Cocoa bindings. Indexes are
numbered in ascending order order from left to right, top to bottom (row-major
order).
-
- @param indexSet Must not be nil. Pass an empty NSIndexSet to clear
selection.*/
-- (void)setSelectionIndexes:(NSIndexSet *)indexSet;
-
/** The current icon scale of the view.
This property has no physical meaning; it's proportional to internal
constants which determine the cached sizes of icons. Can be bound.*/
-- (double)iconScale;
+@property (nonatomic) double iconScale;
-/** Set the current icon scale.
- @param scale The new value of FVFileView::iconScale. */
-- (void)setIconScale:(double)scale;
-
/** Maximum value of iconScale
Default value is 16. Legitimate values are from 0.01 -- 100 in IB, but this
is not enforced in the view (i.e. you can set anything programmatically). Can
be bound.*/
-- (double)maxIconScale;
+@property (nonatomic) double maxIconScale;
-/** Set maximum value of iconScale
-
- Legitmate values are from 0.01 -- 100 in IB, but this is not enforced in the
view (i.e. you can set anything programmatically). Can be bound.
- @param scale The new value of FileView::maxIconScale. */
-- (void)setMaxIconScale:(double)scale;
-
/** Minimum value of iconScale
Default value is 0.5. Legitmate values are from 0.01 -- 100 in IB, but this
is not enforced in the view (i.e. you can set anything programmatically). Can
be bound. */
-- (double)minIconScale;
+@property (nonatomic) double minIconScale;
-/** Set minimum value of iconScale
-
- Legitmate values are from 0.01 -- 100 in IB, but this is not enforced in the
view (i.e. you can set anything programmatically). Can be bound.
- @param scale The new value of FileView::minIconScale. */
-- (void)setMinIconScale:(double)scale;
-
/** Whether the icons scale are ordered in a grid or a single auto-scaled
column or row.
- When this is not set to FVDisplayModeGrid, setIconScale: will be ignored, and
the view shows the icons in a single column or row with a scale determined by
the current width or height of the view. Can be bound.*/
-- (FVDisplayMode)displayMode;
+ When this is not set to FVDisplayModeGrid, iconScale will be ignored, and the
view shows the icons in a single column or row with a scale determined by the
current width or height of the view. Can be bound.*/
+@property (nonatomic) FVDisplayMode displayMode;
-/** Set whether the icons are ordered in a grid or a single auto-scaled column
or row.
- @param mode The new value of FVFileView::displayMode. */
-- (void)setDisplayMode:(FVDisplayMode)mode;
-
/** Current number of rows displayed.*/
-- (NSUInteger)numberOfRows;
+@property (nonatomic, readonly) NSUInteger numberOfRows;
/** Current number of columns displayed.*/
-- (NSUInteger)numberOfColumns;
+@property (nonatomic, readonly) NSUInteger numberOfColumns;
/** Whether the view can be edited.
- Can be bound.*/
-- (BOOL)isEditable;
-
-/** Change the view's editable property.
-
Default is NO for views created in code. Can be bound.
- @param flag If set to YES, requires the datasource to implement the dragging
related methods in the @link <FVFileViewDataSource> @endlink formal protocol.
If set to NO, drop/paste/delete actions will be ignored, even if the protocol
is implemented. */
-- (void)setEditable:(BOOL)flag;
+ If set to YES, requires the datasource to implement the dragging related
methods in the @link <FVFileViewDataSource> @endlink formal protocol. If set
to NO, drop/paste/delete actions will be ignored, even if the protocol is
implemented.*/
+@property (nonatomic, getter=isEditable) BOOL editable;
/** Whether the view allows downloading URLs.
- Can be bound.*/
-- (BOOL)allowsDownloading;
-
-/** Change the view's allowsDownloading property.
+ Can be bound.
- Default is NO for views created in code. Can be bound.
-
- @param flag If set to YES, a contextual download menu item is added for
external URLs, and external URLs dropped while holding the Option key will be
automatically downloaded. */
-- (void)setAllowsDownloading:(BOOL)flag;
+ If set to YES, a contextual download menu item is added for external URLs,
and external URLs dropped while holding the Option key will be automatically
downloaded.*/
+@property (nonatomic) BOOL allowsDownloading;
/** The current background color.
The default is NSOutlineView's source list color, or an approximation thereof
on 10.4. Can be bound. */
-- (NSColor *)backgroundColor;
+@property (nonatomic, copy) NSColor *backgroundColor;
-/** Change the background color.
-
- The default is NSOutlineView's source list color, or an approximation thereof
on 10.4. Can be bound.
- @param aColor The new background color. */
-- (void)setBackgroundColor:(NSColor *)aColor;
/** The current text color.
The default is +[NSColor secondaryLabelColor]. Can be bound. */
-- (NSColor *)textColor;
+@property (nonatomic, strong) NSColor *textColor;
-/** Change the text color.
-
- The default is +[NSColor secondaryLabelColor]. Can be bound.
- @param aColor The new text color. */
-- (void)setTextColor:(NSColor *)aColor;
-
/** The current subtitle color.
The default is +[NSColor tertiaryLabelColor]. Can be bound. */
-- (NSColor *)subtitleColor;
+@property (nonatomic, strong) NSColor *subtitleColor;
-/** Change the subtitle color.
-
- The default is +[NSColor tertiaryLabelColor]. Can be bound.
- @param aColor The new subtitle color. */
-- (void)setSubtitleColor:(NSColor *)aColor;
-
/** The current text font.
The default is the system font at 12pt. Can be bound. */
-- (NSFont *)font;
+@property (nonatomic, strong) NSFont *font;
-/** Change the text font.
-
- The default is the system font at 12pt. Can be bound.
- @param aFont The new text font. */
-- (void)setFont:(NSFont *)aFont;
-
/** The current subtitle font.
The default is the system font at 10pt. Can be bound. */
-- (NSFont *)subtitleFont;
+@property (nonatomic, strong) NSFont *subtitleFont;
-/** Change the subtitle font.
-
- The default is the system font at 10pt. Can be bound.
- @param aFont The new subtitle font. */
-- (void)setSubtitleFont:(NSFont *)aFont;
-
/** Invalidates all content and marks view for redisplay.
This must be called if the URLs provided by a datasource change, either in
number or content, unless the Content binding is used. May be fairly expensive
if your datasource is slow, since it requests all values (unlike NSTableView).
Icon data such as bitmaps will be generated lazily as needed, however, and is
also persistent for the life of the application.*/
@@ -447,27 +382,22 @@
Wraps -[NSWorkspace openURL:].*/
- (IBAction)openSelectedURLs:(id)sender;
-/** Receiver forFileViewDataSource and @link <FVFileViewDataSource> @endlink
messages.
+/** Current datasource or nil.
+ Nonretained, and may be set to nil.
A non-nil datasource is required for drag-and-drop support.
- @param obj Nonretained, and may be set to nil.
@see @link <FVFileViewDataSource> @endlink */
-- (void)setDataSource:(id<FVFileViewDataSource>)obj;
+@property (nonatomic, weak) id<FVFileViewDataSource> dataSource;
-/** Current datasource or nil.*/
-- (id<FVFileViewDataSource>)dataSource;
-
-/** Set a delegate for the view.
+/** The delegate for the view.
+ Nonretained, and may be set to nil.
- The delegate may implement any or all of the methods in the @link
NSObject(FileViewDelegate) @endlink informal protocol.
+ The delegate may implement any or all of the methods in the @link
NSObject(FileViewDelegate) @endlink protocol.
@param obj The object to set as delegate. Not retained.*/
-- (void)setDelegate:(id<FVFileViewDelegate>)obj;
+@property (nonatomic, weak) id<FVFileViewDelegate> delegate;
-/** Returns the current delegate or nil.*/
-- (id<FVFileViewDelegate>)delegate;
-
/** Change drop index and drop operation for a drop on the view.
This can be used in the @link <FVFileViewDelegate> @endlink drop validation
method to change the drop index or drop operation.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -114,8 +114,8 @@
NSUInteger _label;
}
- (id)initWithURL:(NSURL *)aURL;
-- (NSString *)name;
-- (NSUInteger)label;
+@property (nonatomic, readonly) NSString *name;
+@property (nonatomic, readonly) NSUInteger label;
@end
#pragma mark -
@@ -136,8 +136,7 @@
@interface FVBackgroundView : NSView {
NSColor *_backgroundColor;
}
-- (NSColor *)backgroundColor;
-- (void)setBackgroundColor:(NSColor *)backgroundColor;
+@property (nonatomic, strong) NSColor *backgroundColor;
@end
static void FVFillBackgroundColorOrGradient(NSColor *backgroundColor, NSRect
rect, NSRect bounds, NSWindow *window);
@@ -151,7 +150,7 @@
#import <Quartz/Quartz.h>
-@interface FVFileView (FVDelegateDeclarations) <FVAnimationDelegate,
QLPreviewPanelDataSource, QLPreviewPanelDelegate>
+@interface FVFileView (FVDelegateDeclarations) <FVAnimationDelegate,
FVDownloadDelegate, QLPreviewPanelDataSource, QLPreviewPanelDelegate>
@end
@interface FVAnimation : NSAnimation
@@ -217,14 +216,15 @@
#pragma mark -
-@interface FVFileView (Private)
+@interface FVFileView ()
// wrapper that calls bound array or datasource transparently; for internal use
// clients should access the datasource or bound array directly
- (NSURL *)URLAtIndex:(NSUInteger)anIndex;
-- (NSUInteger)numberOfIcons;
-- (void)setIconURLs:(NSArray *)anArray;
+@property (nonatomic, readonly) NSUInteger numberOfIcons;
+@property (nonatomic, copy) NSArray *iconURLs;
+
// only declare methods here to shut the compiler up if we can't rearrange
- (FVIcon *)iconAtIndex:(NSUInteger)anIndex;
- (FVIcon *)_cachedIconForURL:(NSURL *)aURL;
@@ -237,7 +237,6 @@
- (void)_getRangeOfRows:(NSRange *)rowRange columns:(NSRange *)columnRange
inRect:(NSRect)aRect;
- (void)_showArrowsForIconAtIndex:(NSUInteger)anIndex;
- (void)_hideArrows;
-- (BOOL)_hasArrows;
- (void)_cancelDownloads;
- (void)_invalidateProgressTimer;
- (void)_downloadURLAtIndex:(NSUInteger)anIndex replace:(BOOL)replace;
@@ -256,6 +255,25 @@
@implementation FVFileView
+@synthesize iconURLs=_orderedURLs;
+@synthesize selectionIndexes=_selectionIndexes;
+@dynamic iconScale;
+@synthesize maxIconScale=_maxScale;
+@synthesize minIconScale=_minSize;
+@dynamic displayMode;
+@synthesize numberOfRows=_numberOfRows;
+@synthesize numberOfColumns=_numberOfColumns;
+@dynamic editable;
+@dynamic allowsDownloading;
+@synthesize backgroundColor=_backgroundColor;
+@dynamic textColor;
+@dynamic subtitleColor;
+@dynamic font;
+@dynamic subtitleFont;
+@synthesize dataSource;
+@synthesize delegate;
+@dynamic numberOfIcons;
+
+ (void)initialize
{
FVINITIALIZE(FVFileView);
@@ -498,11 +516,6 @@
}
}
-- (NSColor *)backgroundColor
-{
- return _backgroundColor;
-}
-
- (void)setTextColor:(NSColor *)aColor;
{
[_titleCell setTextColor:aColor];
@@ -660,8 +673,6 @@
return _iconSize.width / DEFAULT_ICON_SIZE.width;
}
-- (double)maxIconScale { return _maxScale; }
-
- (void)setMaxIconScale:(double)scale {
_maxScale = scale;
[[_sliderWindow slider] setMaxValue:log(scale)];
@@ -669,8 +680,6 @@
[self setIconScale:scale];
}
-- (double)minIconScale { return _minScale; }
-
- (void)setMinIconScale:(double)scale {
_minScale = scale;
[[_sliderWindow slider] setMinValue:log(scale)];
@@ -779,8 +788,6 @@
[self reloadIcons];
}
-- (id<FVFileViewDataSource>)dataSource { return _dataSource; }
-
- (BOOL)isEditable
{
return _fvFlags.isEditable;
@@ -811,13 +818,6 @@
}
}
-- (void)setDelegate:(id<FVFileViewDelegate>)obj;
-{
- _delegate = obj;
-}
-
-- (id<FVFileViewDelegate>)delegate { return _delegate; }
-
- (void)_setSelectionIndexes:(NSIndexSet *)indexSet {
[self setSelectionIndexes:indexSet];
[self _updateBinding:SELECTIONINDEXES_BINDING_NAME];
@@ -839,11 +839,6 @@
}
}
-- (NSIndexSet *)selectionIndexes;
-{
- return _selectionIndexes;
-}
-
- (void)setIconURLs:(NSArray *)array
{
if (_orderedURLs != array) {
@@ -852,11 +847,6 @@
}
}
-- (NSArray *)iconURLs
-{
- return _orderedURLs;
-}
-
#pragma mark Binding/datasource wrappers
- (FVIcon *)iconAtIndex:(NSUInteger)anIndex {
@@ -1177,10 +1167,6 @@
- (CGFloat)_bottomMargin { return 0.0; }
-- (NSUInteger)numberOfRows { return _numberOfRows; }
-
-- (NSUInteger)numberOfColumns { return _numberOfColumns; }
-
- (CGFloat)_textHeight;
{
CGFloat textHeight = [_titleCell cellSize].height;
@@ -4872,6 +4858,9 @@
@implementation _FVURLInfo
+@synthesize name=_name;
+@synthesize label=_label;
+
- (id)initWithURL:(NSURL *)aURL;
{
if (self = [super init]) {
@@ -4903,10 +4892,6 @@
[super dealloc];
}
-- (NSString *)name { return _name; }
-
-- (NSUInteger)label { return _label; }
-
@end
#pragma mark -
@@ -5096,6 +5081,8 @@
@implementation FVBackgroundView
+@synthesize backgroundColor=_backgroundColor;
+
- (void)_updateVisualEffectViewIfNeeded {
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_9) {
NSInteger material = -1;
@@ -5138,10 +5125,6 @@
- (BOOL)isFlipped { return YES; }
-- (NSColor *)backgroundColor {
- return _backgroundColor;
-}
-
- (void)setBackgroundColor:(NSColor *)backgroundColor
{
if (backgroundColor != _backgroundColor) {
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.h 2024-01-17 17:13:03 UTC
(rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.h 2024-01-18 15:52:26 UTC
(rev 28630)
@@ -85,7 +85,7 @@
/** Determine if releaseResources is possible.
@return NO if releaseResources will be a no-op or otherwise is not possible.
*/
-- (BOOL)canReleaseResources;
+@property (nonatomic, readonly) BOOL canReleaseResources;
/** Determine if renderForSize: is required.
@@ -115,11 +115,11 @@
Only useful for multi-page formats such as PDF and PS. Multi-page TIFFs and
text documents are not supported, and calling the showNextPage/showPreviousPage
methods will have no effect.
@return Number of pages available for drawing. */
-- (NSUInteger)pageCount;
+@property (nonatomic, readonly) NSUInteger pageCount;
/** The index of the current page.
@return The return value is 1-based, as in CGPDFDocumentGetPageCount. */
-- (NSUInteger)currentPageIndex;
+@property (nonatomic, readonly) NSUInteger currentPageIndex;
/** Increments the internal page index.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon_Private.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -75,7 +75,7 @@
queuedKeysByClass = CFDictionaryCreateMutable(NULL, 0, NULL,
&kCFTypeDictionaryValueCallBacks);
if (numClasses > 0) {
- Class *classes = NSZoneCalloc([self zone], numClasses, sizeof(Class));
+ Class *classes = (Class *)NSZoneCalloc([self zone], numClasses,
sizeof(Class));
numClasses = objc_getClassList(classes, numClasses);
Class FVIconClass = [FVIcon self];
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -95,11 +95,11 @@
If you set _freeBufferOnDealloc to NO, use this allocator to free
buffer->data when you're finished with it. Do not rely on this returning the
same allocator for all instances.
@return A CFAllocator instance. */
-- (CFAllocatorRef)allocator;
+@property (nonatomic, readonly) CFAllocatorRef allocator;
/** @internal @brief Internal buffer size.
Use for debugging and asserting. In case of reshaping the underlying buffer,
this preserves the original size. If you change the data pointer in the buffer
and then call this, you'll get what you deserve. */
-- (size_t)bufferSize;
+@property (nonatomic, readonly) size_t bufferSize;
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageBuffer.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -47,6 +47,9 @@
@implementation FVImageBuffer
+@dynamic allocator;
+@synthesize bufferSize=_bufferSize;
+
+ (uint64_t)allocatedBytes
{
return FVAtomicLoad(_allocatedBytes);
@@ -128,6 +131,4 @@
- (CFAllocatorRef)allocator { return FVAllocatorGetDefault(); }
-- (size_t)bufferSize { return _bufferSize; }
-
@end
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.h
2024-01-18 15:52:26 UTC (rev 28630)
@@ -63,13 +63,13 @@
- (id)initWithTarget:(id)target selector:(SEL)sel object:(id)arg;
/** @return The operation's invocation. */
-- (NSInvocation *)invocation;
+@property (nonatomic, readonly) NSInvocation *invocation;
/** @brief Get the return value.
@warning This has only undergone limited testing, but is known to work for
object and NSRect types. Test it yourself for others.
@return The return value of the invocation. If this is not an object, it
will be wrapped in an NSValue. */
-- (id)result;
+@property (nonatomic, readonly) id result;
/** @brief Wrapper for result
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVInvocationOperation.m
2024-01-18 15:52:26 UTC (rev 28630)
@@ -41,6 +41,9 @@
@implementation FVInvocationOperation
+@synthesize invocation=_invocation;
+@dynamic result;
+
- (id)initWithInvocation:(NSInvocation *)inv;
{
NSParameterAssert(nil != inv);
@@ -72,7 +75,10 @@
[invocation setTarget:target];
[invocation setSelector:sel];
- if (nil != arg) [invocation setArgument:&arg atIndex:2];
+ if (nil != arg) {
+ __unsafe_unretained id tmpArg = arg;
+ [invocation setArgument:&tmpArg atIndex:2];
+ }
return (nil != invocation) ? [self initWithInvocation:invocation] : nil;
}
@@ -92,8 +98,6 @@
- (NSUInteger)hash { return [_invocation hash]; }
-- (NSInvocation *)invocation { return _invocation; }
-
- (void)main
{
@autoreleasepool {
@@ -133,7 +137,9 @@
@throw _exception;
if (strcmp(returnType, @encode(id)) == 0) {
- [_invocation getReturnValue:&value];
+ __unsafe_unretained id tmpValue = nil;
+ [_invocation getReturnValue:&tmpValue];
+ value = tmpValue;
}
else {
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -88,22 +88,15 @@
@return YES if instances are equal as determined by the implementor. */
- (BOOL)isEqual:(id)object;
-/** Sets the FVOperationQueue.
- @param aQueue The queue that will execute this task. */
-- (void)setQueue:(id)aQueue;
-
/** The queue that will execute the task.
@return An instance of FVOperationQueue or nil. */
-- (id)queue;
+@property (nonatomic, strong) id queue;
/** Priority of this task.
- @return The operation's priority. */
-- (FVOperationQueuePriority)queuePriority;
+ @return The operation's priority.
+ An integral value from the FVOperation.h::FVOperationQueuePriority enum.*/
+@property FVOperationQueuePriority queuePriority;
-/** Set priority of this task.
- @param queuePriority An integral value from the
FVOperation.h::FVOperationQueuePriority enum. */
-- (void)setQueuePriority:(FVOperationQueuePriority)queuePriority;
-
/** Cancel this task.
*/
- (void)cancel;
@@ -110,17 +103,17 @@
/** Cancellation status of this task.
@return YES if FVOperation::cancel was called previously. */
-- (BOOL)isCancelled;
+@property (readonly, getter=isCancelled) BOOL cancelled;
/** Whether the task is running.
@return YES if the task is currently executing. */
-- (BOOL)isExecuting;
+@property (readonly, getter=isExecuting) BOOL executing;
/** Whether the task is finished.
Required for subclassers. Do not call super.
@return YES if the task has finished executing. */
-- (BOOL)isFinished;
+@property (readonly, getter=isFinished) BOOL finished;
/** Primary work entry point.
@@ -131,15 +124,10 @@
/** Check to see if the operation is concurrent.
This method returns YES by default. Subclasses may override this.
- @return YES if it detaches a new thread in FVOperation::start, NO otherwise.
*/
-- (BOOL)isConcurrent;
+ @return YES if it detaches a new thread in FVOperation::start, NO otherwise.
+ This is not part of the NSOperation API, but it's useful. Raises an
exception if the operation was previously cancelled or executed. */
+@property (getter=isConcurrent) BOOL concurrent;
-/** Change concurrency.
-
- This is not part of the NSOperation API, but it's useful. Raises an
exception if the operation was previously cancelled or executed.
- @param flag YES if the operation should detach its own thread to call
FVOperation::main. */
-- (void)setConcurrent:(BOOL)flag;
-
/** Compares priority.
If receiver's priority is higher than other, returns NSOrderedDescending. If
receiver's priority is lower than other, returns NSOrderedAscending. If same
priority, returns NSOrderedSame.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperation.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -51,6 +51,13 @@
@implementation FVOperation
+@synthesize queue=_queue;
+@dynamic queuePriority;
+@dynamic cancelled;
+@dynamic executing;
+@dynamic finished;
+@dynamic concurrent;
+
- (id)init
{
self = [super init];
@@ -120,10 +127,6 @@
_queue = [queue retain];
}
-- (id)queue {
- return _queue;
-};
-
- (BOOL)isConcurrent {
return FVAtomicLoad(_flags->_concurrent);
}
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperationQueue.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperationQueue.m
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVOperationQueue.m
2024-01-18 15:52:26 UTC (rev 28630)
@@ -49,7 +49,6 @@
@implementation FVOperationQueue
static id _mainThreadQueue = nil;
-static FVOperationQueue *defaultPlaceholderQueue = nil;
static Class FVOperationQueueClass = Nil;
+ (void)initialize
@@ -56,13 +55,21 @@
{
FVINITIALIZE(FVOperationQueue);
FVOperationQueueClass = self;
- defaultPlaceholderQueue = (FVOperationQueue
*)NSAllocateObject([FVPlaceholderOperationQueue self], 0, [self zone]);
_mainThreadQueue = [FVMainThreadOperationQueue new];
}
+ (id)allocWithZone:(NSZone *)aZone
{
- return FVOperationQueueClass == self ? defaultPlaceholderQueue : [super
allocWithZone:aZone];
+ static FVPlaceholderOperationQueue *defaultPlaceholderQueue = nil;
+ static dispatch_once_t onceToken = 0;
+ if (FVOperationQueueClass == self) {
+ dispatch_once(&onceToken, ^{
+ defaultPlaceholderQueue = [FVPlaceholderOperationQueue
allocWithZone:NULL];
+ });
+ return defaultPlaceholderQueue;
+ } else {
+ return [super allocWithZone:aZone];
+ }
}
// ensure that alloc always calls through to allocWithZone:
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -99,7 +99,7 @@
/** Test to see if the previewer is active.
@return YES if QL preview is on screen or the custom preview window is
showing. */
-- (BOOL)isPreviewing;
+@property (nonatomic, readonly, getter=isPreviewing) BOOL previewing;
/** Override of FileView::previewAction:
This is implemented to send FVPreviewer::stopPreviewing: if the previewer
window is the first responder. You should never call this method directly. */
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -58,6 +58,8 @@
@implementation FVPreviewer
+@dynamic previewing;
+
+ (FVPreviewer *)sharedPreviewer;
{
FVAPIAssert(pthread_main_np() != 0, @"FVPreviewer must only be used on the
main thread");
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -59,13 +59,13 @@
@interface FVPriorityQueue : NSObject <NSFastEnumeration>
{
@private;
- CFMutableSetRef _set;
- id *_values;
- NSUInteger _count;
- NSUInteger _capacity;
- unsigned long _mutations;
- BOOL _madeHeap;
- BOOL _sorted;
+ CFMutableSetRef _set;
+ id __unsafe_unretained *_values;
+ NSUInteger _count;
+ NSUInteger _capacity;
+ unsigned long _mutations;
+ BOOL _madeHeap;
+ BOOL _sorted;
}
/** Designated intializer. */
@@ -87,7 +87,7 @@
/** Enumeration.
Objects are returned in descending priority (high priority objects returned
first).
@return An autoreleased enumerator. */
-- (NSEnumerator *)objectEnumerator;
+@property (nonatomic, readonly) NSEnumerator *objectEnumerator;
/** Operation on the collection.
The \a selector is invoked on each object in the queue in order of descending
priority (high priority first).
@@ -96,7 +96,7 @@
/** Object count.
@return The number of objects in the queue. */
-- (NSUInteger)count;
+@property (nonatomic, readonly) NSUInteger count;
/** Remove all objects. */
- (void)removeAllObjects;
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
2024-01-17 17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPriorityQueue.mm
2024-01-18 15:52:26 UTC (rev 28630)
@@ -75,6 +75,9 @@
@implementation FVPriorityQueue
+@dynamic objectEnumerator;
+@dynamic count;
+
static inline NSUInteger __FVPriorityQueueRoundUpCapacity(NSUInteger capacity)
{
if (capacity < 4) return 4;
return (1 << flsl(capacity));
@@ -105,15 +108,15 @@
NSUInteger oldCount = __FVPriorityQueueCount(self);
NSUInteger capacity = __FVPriorityQueueRoundUpCapacity(oldCount +
numNewValues);
__FVPriorityQueueSetCapacity(self, capacity);
- self->_values = (id *)NSZoneRealloc([self zone], self->_values, capacity *
sizeof(id));
+ self->_values = (id __unsafe_unretained *)NSZoneRealloc([self zone],
self->_values, capacity * sizeof(id));
}
-static inline id *__FVPriorityQueueHeapStart(FVPriorityQueue *self)
+static inline id __unsafe_unretained
*__FVPriorityQueueHeapStart(FVPriorityQueue *self)
{
return self->_values;
}
-static inline id *__FVPriorityQueueHeapEnd(FVPriorityQueue *self)
+static inline id __unsafe_unretained *__FVPriorityQueueHeapEnd(FVPriorityQueue
*self)
{
NSUInteger count = __FVPriorityQueueCount(self);
return &(self->_values[count]);
@@ -129,7 +132,7 @@
_set = CFSetCreateMutable(CFAllocatorGetDefault(), 0,
&kCFTypeSetCallBacks);
capacity = __FVPriorityQueueRoundUpCapacity(capacity);
- _values = (id *)NSZoneCalloc([self zone], capacity, sizeof(id));
+ _values = (id __unsafe_unretained *)NSZoneCalloc([self zone],
capacity, sizeof(id));
__FVPriorityQueueSetCount(self, 0);
__FVPriorityQueueSetCapacity(self, capacity);
_madeHeap = NO;
@@ -191,12 +194,12 @@
const CFIndex iMax = CFArrayGetCount(cfObjects);
CFIndex i, numberAdded = 0;
- id stackBuf[FV_STACK_MAX] = { nil };
- id *buffer = NULL;
+ __unsafe_unretained id stackBuf[FV_STACK_MAX] = { nil };
+ id __unsafe_unretained *buffer = NULL;
if (iMax > FV_STACK_MAX) {
try {
- buffer = new id[iMax];
+ buffer = new __unsafe_unretained id[iMax];
}
catch (std::bad_alloc&) {
// !!! early return
@@ -223,7 +226,7 @@
if ((count + numberAdded) >= __FVPriorityQueueCapacity(self))
__FVPriorityQueueGrow(self, numberAdded);
- id *dest = &_values[count];
+ id __unsafe_unretained *dest = &_values[count];
// copy before changing count
memcpy(dest, buffer, numberAdded * sizeof(id));
__FVPriorityQueueSetCount(self, count + numberAdded);
@@ -297,7 +300,7 @@
[_values[i] performSelector:selector];
}
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(id *)stackbuf count:(NSUInteger)len;
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(id __unsafe_unretained *)stackbuf count:(NSUInteger)len;
{
// We keep track of whether the heap is sorted in order to make this
method reentrant.
if (NO == _sorted)
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.h 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.h 2024-01-18
15:52:26 UTC (rev 28630)
@@ -48,7 +48,7 @@
- (id)init;
-- (FVSlider *)slider;
+@property (nonatomic, readonly) FVSlider *slider;
- (void)fadeIn:(id)sender;
- (void)fadeOut:(id)sender;
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -148,6 +148,8 @@
@implementation FVSliderWindow
+@synthesize slider=_slider;
+
- (id)init
{
#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >=
MAC_OS_X_VERSION_10_12
@@ -179,8 +181,6 @@
[self fadeOut:self];
}
-- (FVSlider *)slider { return _slider; }
-
- (void)fadeIn:(id)sender {
if ([self isVisible] == NO && [self
respondsToSelector:@selector(animator)]) {
[self setAlphaValue:0.0];
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m 2024-01-17
17:13:03 UTC (rev 28629)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m 2024-01-18
15:52:26 UTC (rev 28630)
@@ -280,8 +280,8 @@
@end
@interface NSObject (NSAppearanceCustomization)
-@property (retain) NSAppearance *appearance;
-@property (readonly, retain) NSAppearance *effectiveAppearance;
+@property (strong) NSAppearance *appearance;
+@property (readonly, strong) NSAppearance *effectiveAppearance;
@end
#elif !defined(MAC_OS_X_VERSION_10_14) || MAC_OS_X_VERSION_MAX_ALLOWED <
MAC_OS_X_VERSION_10_14
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit