Revision: 29174
http://sourceforge.net/p/bibdesk/svn/29174
Author: hofman
Date: 2025-04-23 16:36:32 +0000 (Wed, 23 Apr 2025)
Log Message:
-----------
Set delegate of display view, not in init
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2025-04-23
16:11:18 UTC (rev 29173)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2025-04-23
16:36:32 UTC (rev 29174)
@@ -194,7 +194,7 @@
@end
-@class FVSliderWindow, FVOperationQueue, FVBackgroundView, FVHighlightView,
FVArrowButton, FVDropHighlightView;
+@class FVSliderWindow, FVOperationQueue, FVBackgroundView, FVHighlightView,
FVDisplayView, FVDropHighlightView, FVArrowButton;
/**
FVFileView is the primary class in the framework.
@@ -216,14 +216,14 @@
NSMapTable *_infoTable;
NSUInteger _numberOfColumns;
NSUInteger _numberOfRows;
- CFRunLoopTimerRef _zombieTimer;
+ CFRunLoopTimerRef _zombieTimer;
NSIndexSet *_selectionIndexes;
- CGLayerRef _selectionOverlay;
NSUInteger _lastClickedIndex;
- NSView *_contentView;
- NSView *_rubberBandView;
+ FVBackgroundView *_backgroundView;
FVHighlightView *_highlightView;
+ FVDisplayView *_contentView;
FVDropHighlightView *_dropHighlightView;
+ NSView *_rubberBandView;
struct __fvFlags {
unsigned int displayMode:2;
unsigned int isEditable:1;
@@ -257,7 +257,6 @@
NSMutableArray *_accessibilityIcons;
NSMutableSet *_modificationSet;
NSLock *_modificationLock;
- FVBackgroundView *_backgroundView;
}
/** The icon URLs.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-23
16:11:18 UTC (rev 29173)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-23
16:36:32 UTC (rev 29174)
@@ -173,9 +173,9 @@
@end
@interface FVDisplayView : NSView {
- __weak id<FVDisplayViewDelegate> _delegate;
+ __weak id<FVDisplayViewDelegate> _delegate;
}
-- (id)initWithFrame:(NSRect)frameRect
delegate:(id<FVDisplayViewDelegate>)delegate;
+@property (nonatomic, weak) id<FVDisplayViewDelegate> delegate;
@end
#pragma mark -
@@ -374,10 +374,11 @@
}
if (_contentView == nil) {
- _contentView = [[FVDisplayView alloc] initWithFrame:frame
delegate:self];
+ _contentView = [[FVDisplayView alloc] initWithFrame:frame];
[_contentView setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
[self addSubview:_contentView];
}
+ [_contentView setDelegate:self];
// Icons keyed by URL; may contain icons that are no longer displayed.
Keeping this as primary storage means that
// rearranging/reloading is relatively cheap, since we don't recreate all
FVIcon instances every time -reload is called.
@@ -2860,7 +2861,8 @@
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
if (_dropHighlightView == nil) {
- _dropHighlightView = [[FVDropHighlightView alloc]
initWithFrame:[_contentView bounds] delegate:self];
+ _dropHighlightView = [[FVDropHighlightView alloc]
initWithFrame:[_contentView bounds]];
+ [_dropHighlightView setDelegate:self];
[_contentView addSubview:_dropHighlightView];
}
// !!! this is quite expensive to call repeatedly in -draggingUpdated
@@ -5304,32 +5306,8 @@
@implementation FVDisplayView
-- (id)initWithFrame:(NSRect)frameRect
delegate:(id<FVDisplayViewDelegate>)delegate {
- self = [self initWithFrame:frameRect];
- if (self) {
- _delegate = delegate;
- }
- return self;
-}
+@synthesize delegate=_delegate;
-- (id)initWithCoder:(NSCoder *)coder
-{
- self = [super initWithCoder:coder];
- if (self) {
- _delegate = [coder decodeObjectForKey:@"delegate"];
- for (NSView *view in [[self subviews] copy]) {
- [view removeFromSuperview];
- }
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder
-{
- [super encodeWithCoder:coder];
- [coder encodeConditionalObject:_delegate forKey:@"delegate"];
-}
-
- (BOOL)isFlipped { return YES; }
- (NSView *)hitTest:(NSPoint)point { return nil; }
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