Add more forward declarations for scrubber APIs

This commit is contained in:
Kevin Sawicki 2017-03-14 13:57:39 -07:00
parent a55cddaa53
commit 8b7675baee
2 changed files with 16 additions and 5 deletions

View file

@ -536,17 +536,17 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
settings.Get("overlayStyle", &overlayStyle); settings.Get("overlayStyle", &overlayStyle);
if (selectedStyle == "outline") { if (selectedStyle == "outline") {
scrubber.selectionBackgroundStyle = [NSScrubberSelectionStyle outlineOverlayStyle]; scrubber.selectionBackgroundStyle = [NSClassFromString(@"NSScrubberSelectionStyle") outlineOverlayStyle];
} else if (selectedStyle == "background") { } else if (selectedStyle == "background") {
scrubber.selectionBackgroundStyle = [NSScrubberSelectionStyle roundedBackgroundStyle]; scrubber.selectionBackgroundStyle = [NSClassFromString(@"NSScrubberSelectionStyle") roundedBackgroundStyle];
} else { } else {
scrubber.selectionBackgroundStyle = nil; scrubber.selectionBackgroundStyle = nil;
} }
if (overlayStyle == "outline") { if (overlayStyle == "outline") {
scrubber.selectionOverlayStyle = [NSScrubberSelectionStyle outlineOverlayStyle]; scrubber.selectionOverlayStyle = [NSClassFromString(@"NSScrubberSelectionStyle") outlineOverlayStyle];
} else if (overlayStyle == "background") { } else if (overlayStyle == "background") {
scrubber.selectionOverlayStyle = [NSScrubberSelectionStyle roundedBackgroundStyle]; scrubber.selectionOverlayStyle = [NSClassFromString(@"NSScrubberSelectionStyle") roundedBackgroundStyle];
} else { } else {
scrubber.selectionOverlayStyle = nil; scrubber.selectionOverlayStyle = nil;
} }

View file

@ -14,7 +14,7 @@
#pragma clang assume_nonnull begin #pragma clang assume_nonnull begin
@class NSTouchBar, NSTouchBarItem; @class NSTouchBar, NSTouchBarItem;
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView; @class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
@protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource; @protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource;
typedef float NSTouchBarItemPriority; typedef float NSTouchBarItemPriority;
@ -134,6 +134,10 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
@property(weak) id<NSScrubberDelegate> delegate; @property(weak) id<NSScrubberDelegate> delegate;
@property(weak) id<NSScrubberDataSource> dataSource; @property(weak) id<NSScrubberDataSource> dataSource;
@property NSScrubberMode mode; @property NSScrubberMode mode;
@property BOOL showsArrowButtons;
@property(getter=isContinuous) BOOL continuous;
@property(strong, nullable) NSScrubberSelectionStyle* selectionBackgroundStyle;
@property(strong, nullable) NSScrubberSelectionStyle* selectionOverlayStyle;
- (void)registerClass:(Class)itemViewClass - (void)registerClass:(Class)itemViewClass
forItemIdentifier:(NSString*)itemIdentifier; forItemIdentifier:(NSString*)itemIdentifier;
@ -144,6 +148,13 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
@end @end
@interface NSScrubberSelectionStyle : NSObject<NSCoding>
@property(class, strong, readonly) NSScrubberSelectionStyle* outlineOverlayStyle;
@property(class, strong, readonly) NSScrubberSelectionStyle* roundedBackgroundStyle;
@end
@interface NSScrubberArrangedView : NSView @interface NSScrubberArrangedView : NSView
@end @end