Skip to content

Commit

Permalink
Fix renamed C type NSAutoresizingMaskOptions (10.10+)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoagx committed Nov 8, 2018
1 parent dee3201 commit 3074e64
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
2 changes: 2 additions & 0 deletions Source/SPCompatibility.h
Expand Up @@ -84,6 +84,8 @@


// This enum is available since 10.5 but only got a "name" in 10.10 // This enum is available since 10.5 but only got a "name" in 10.10
typedef NSUInteger NSCellHitResult; typedef NSUInteger NSCellHitResult;
// This bitfield is available since 10.0 but only got a "name" in 10.10
typedef NSUInteger NSAutoresizingMaskOptions;


@compatibility_alias NSTitlebarAccessoryViewController NSViewController; @compatibility_alias NSTitlebarAccessoryViewController NSViewController;


Expand Down
30 changes: 15 additions & 15 deletions Source/SPExportController.m
Expand Up @@ -2353,14 +2353,14 @@ - (NSString *)expandCustomFilenameFormatUsingTableName:(NSString *)table
*/ */
- (void)_resizeWindowForCustomFilenameViewByHeightDelta:(NSInteger)delta - (void)_resizeWindowForCustomFilenameViewByHeightDelta:(NSInteger)delta
{ {
NSUInteger popUpMask = [exportInputPopUpButton autoresizingMask]; NSAutoresizingMaskOptions popUpMask = [exportInputPopUpButton autoresizingMask];
NSUInteger fileCheckMask = [exportFilePerTableCheck autoresizingMask]; NSAutoresizingMaskOptions fileCheckMask = [exportFilePerTableCheck autoresizingMask];
NSUInteger scrollMask = [exportTablelistScrollView autoresizingMask]; NSAutoresizingMaskOptions scrollMask = [exportTablelistScrollView autoresizingMask];
NSUInteger buttonBarMask = [exportTableListButtonBar autoresizingMask]; NSAutoresizingMaskOptions buttonBarMask = [exportTableListButtonBar autoresizingMask];
NSUInteger buttonMask = [exportCustomFilenameViewButton autoresizingMask]; NSAutoresizingMaskOptions buttonMask = [exportCustomFilenameViewButton autoresizingMask];
NSUInteger textFieldMask = [exportCustomFilenameViewLabelButton autoresizingMask]; NSAutoresizingMaskOptions textFieldMask = [exportCustomFilenameViewLabelButton autoresizingMask];
NSUInteger customFilenameViewMask = [exportCustomFilenameView autoresizingMask]; NSAutoresizingMaskOptions customFilenameViewMask = [exportCustomFilenameView autoresizingMask];
NSUInteger tabBarMask = [exportOptionsTabBar autoresizingMask]; NSAutoresizingMaskOptions tabBarMask = [exportOptionsTabBar autoresizingMask];


NSRect frame = [[self window] frame]; NSRect frame = [[self window] frame];


Expand Down Expand Up @@ -2412,13 +2412,13 @@ - (void)_resizeWindowForCustomFilenameViewByHeightDelta:(NSInteger)delta
*/ */
- (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta - (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta
{ {
NSUInteger scrollMask = [exportTablelistScrollView autoresizingMask]; NSAutoresizingMaskOptions scrollMask = [exportTablelistScrollView autoresizingMask];
NSUInteger buttonBarMask = [exportTableListButtonBar autoresizingMask]; NSAutoresizingMaskOptions buttonBarMask = [exportTableListButtonBar autoresizingMask];
NSUInteger tabBarMask = [exportTypeTabBar autoresizingMask]; NSAutoresizingMaskOptions tabBarMask = [exportTypeTabBar autoresizingMask];
NSUInteger optionsTabBarMask = [exportOptionsTabBar autoresizingMask]; NSAutoresizingMaskOptions optionsTabBarMask = [exportOptionsTabBar autoresizingMask];
NSUInteger buttonMask = [exportAdvancedOptionsViewButton autoresizingMask]; NSAutoresizingMaskOptions buttonMask = [exportAdvancedOptionsViewButton autoresizingMask];
NSUInteger textFieldMask = [exportAdvancedOptionsViewLabelButton autoresizingMask]; NSAutoresizingMaskOptions textFieldMask = [exportAdvancedOptionsViewLabelButton autoresizingMask];
NSUInteger advancedViewMask = [exportAdvancedOptionsView autoresizingMask]; NSAutoresizingMaskOptions advancedViewMask = [exportAdvancedOptionsView autoresizingMask];


NSRect frame = [[self window] frame]; NSRect frame = [[self window] frame];


Expand Down
22 changes: 11 additions & 11 deletions Source/SPFieldMapperController.m
Expand Up @@ -1324,17 +1324,17 @@ - (IBAction)insertRecentGlobalValue:(id)sender
- (void)resizeWindowByHeightDelta:(NSInteger)delta - (void)resizeWindowByHeightDelta:(NSInteger)delta
{ {
#ifndef SP_CODA /* resizeWindowByHeightDelta: */ #ifndef SP_CODA /* resizeWindowByHeightDelta: */
NSUInteger tableMask = [fieldMapperTableScrollView autoresizingMask]; NSAutoresizingMaskOptions tableMask = [fieldMapperTableScrollView autoresizingMask];
NSUInteger headerSwitchMask = [importFieldNamesHeaderSwitch autoresizingMask]; NSAutoresizingMaskOptions headerSwitchMask = [importFieldNamesHeaderSwitch autoresizingMask];
NSUInteger alignPopupMask = [alignByPopup autoresizingMask]; NSAutoresizingMaskOptions alignPopupMask = [alignByPopup autoresizingMask];
NSUInteger alignPopupLabelMask = [alignByPopupLabel autoresizingMask]; NSAutoresizingMaskOptions alignPopupLabelMask = [alignByPopupLabel autoresizingMask];
NSUInteger importMethodLabelMask = [importMethodLabel autoresizingMask]; NSAutoresizingMaskOptions importMethodLabelMask = [importMethodLabel autoresizingMask];
NSUInteger importMethodMask = [importMethodPopup autoresizingMask]; NSAutoresizingMaskOptions importMethodMask = [importMethodPopup autoresizingMask];
NSUInteger advancedButtonMask = [advancedButton autoresizingMask]; NSAutoresizingMaskOptions advancedButtonMask = [advancedButton autoresizingMask];
NSUInteger advancedLabelMask = [advancedLabel autoresizingMask]; NSAutoresizingMaskOptions advancedLabelMask = [advancedLabel autoresizingMask];
NSUInteger insertViewMask = [advancedInsertView autoresizingMask]; NSAutoresizingMaskOptions insertViewMask = [advancedInsertView autoresizingMask];
NSUInteger updateViewMask = [advancedUpdateView autoresizingMask]; NSAutoresizingMaskOptions updateViewMask = [advancedUpdateView autoresizingMask];
NSUInteger replaceViewMask = [advancedReplaceView autoresizingMask]; NSAutoresizingMaskOptions replaceViewMask = [advancedReplaceView autoresizingMask];


NSRect frame = [[self window] frame]; NSRect frame = [[self window] frame];
if(frame.size.height>600 && delta > heightOffset) { if(frame.size.height>600 && delta > heightOffset) {
Expand Down
24 changes: 11 additions & 13 deletions Source/SPIndexesController.m
Expand Up @@ -1026,15 +1026,15 @@ - (void)_removingIndexFailedWithForeignKeyError:(NSDictionary *)info
*/ */
- (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta - (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta
{ {
NSUInteger popUpMask = [indexTypePopUpButton autoresizingMask]; NSAutoresizingMaskOptions popUpMask = [indexTypePopUpButton autoresizingMask];
NSUInteger nameFieldMask = [indexNameTextField autoresizingMask]; NSAutoresizingMaskOptions nameFieldMask = [indexNameTextField autoresizingMask];
NSUInteger scrollMask = [indexedColumnsScrollView autoresizingMask]; NSAutoresizingMaskOptions scrollMask = [indexedColumnsScrollView autoresizingMask];
NSUInteger buttonMask = [indexAdvancedOptionsViewButton autoresizingMask]; NSAutoresizingMaskOptions buttonMask = [indexAdvancedOptionsViewButton autoresizingMask];
NSUInteger textFieldMask = [indexAdvancedOptionsViewLabelButton autoresizingMask]; NSAutoresizingMaskOptions textFieldMask = [indexAdvancedOptionsViewLabelButton autoresizingMask];
NSUInteger advancedViewMask = [indexAdvancedOptionsView autoresizingMask]; NSAutoresizingMaskOptions advancedViewMask = [indexAdvancedOptionsView autoresizingMask];
NSUInteger typeLabelMask = [indexTypeLabel autoresizingMask]; NSAutoresizingMaskOptions typeLabelMask = [indexTypeLabel autoresizingMask];
NSUInteger nameLabelMask = [indexNameLabel autoresizingMask]; NSAutoresizingMaskOptions nameLabelMask = [indexNameLabel autoresizingMask];
NSUInteger buttonBarMask = [(NSView*)anchoredButtonBar autoresizingMask]; NSAutoresizingMaskOptions buttonBarMask = [anchoredButtonBar autoresizingMask];


NSRect frame = [[self window] frame]; NSRect frame = [[self window] frame];


Expand All @@ -1053,8 +1053,7 @@ - (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta
[indexAdvancedOptionsView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; [indexAdvancedOptionsView setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin];
[indexTypeLabel setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; [indexTypeLabel setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin];
[indexNameLabel setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin]; [indexNameLabel setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin];

[anchoredButtonBar setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin];
[(NSView*)anchoredButtonBar setAutoresizingMask:NSViewNotSizable | NSViewMinYMargin];


NSInteger newMinHeight = (windowMinHeigth - heightOffset + delta < windowMinHeigth) ? windowMinHeigth : windowMinHeigth - heightOffset + delta; NSInteger newMinHeight = (windowMinHeigth - heightOffset + delta < windowMinHeigth) ? windowMinHeigth : windowMinHeigth - heightOffset + delta;


Expand All @@ -1078,8 +1077,7 @@ - (void)_resizeWindowForAdvancedOptionsViewByHeightDelta:(NSInteger)delta
[indexAdvancedOptionsView setAutoresizingMask:advancedViewMask]; [indexAdvancedOptionsView setAutoresizingMask:advancedViewMask];
[indexTypeLabel setAutoresizingMask:typeLabelMask]; [indexTypeLabel setAutoresizingMask:typeLabelMask];
[indexNameLabel setAutoresizingMask:nameLabelMask]; [indexNameLabel setAutoresizingMask:nameLabelMask];

[anchoredButtonBar setAutoresizingMask:buttonBarMask];
[(NSView*)anchoredButtonBar setAutoresizingMask:buttonBarMask];
} }


#pragma mark - #pragma mark -
Expand Down
12 changes: 6 additions & 6 deletions Source/SPSplitView.m
Expand Up @@ -58,17 +58,17 @@ @interface SPSplitViewHelperView : NSView
NSView *wrappedView; NSView *wrappedView;
} }


- (id)initReplacingView:(NSView *)aView inVerticalSplitView:(BOOL)verticalSplitView; - (instancetype)initReplacingView:(NSView *)aView inVerticalSplitView:(BOOL)verticalSplitView;
- (void)restoreOriginalView; - (void)restoreOriginalView;


@end @end


@interface SPSplitViewAnimationRetainCycleBypass : NSObject @interface SPSplitViewAnimationRetainCycleBypass : NSObject
{ {
SPSplitView *parentSplitView; __unsafe_unretained SPSplitView *parentSplitView;
} }


- (id)initWithParent:(SPSplitView *)aSplitView; - (instancetype)initWithParent:(SPSplitView *)aSplitView;
- (void)_animationStep:(NSTimer *)aTimer; - (void)_animationStep:(NSTimer *)aTimer;


@end @end
Expand Down Expand Up @@ -1106,12 +1106,12 @@ @implementation SPSplitViewHelperView
* specified view, adding it as a subview to maintain the same appearance, and then * specified view, adding it as a subview to maintain the same appearance, and then
* can be animated without affecting the contained view. * can be animated without affecting the contained view.
*/ */
- (id)initReplacingView:(NSView *)aView inVerticalSplitView:(BOOL)verticalSplitView - (instancetype)initReplacingView:(NSView *)aView inVerticalSplitView:(BOOL)verticalSplitView
{ {
self = [super initWithFrame:[aView frame]]; self = [super initWithFrame:[aView frame]];
if (!self) return nil; if (!self) return nil;


NSUInteger wrappedResizeMask = [wrappedView autoresizingMask]; NSAutoresizingMaskOptions wrappedResizeMask = [wrappedView autoresizingMask];


// Retain the wrapped view while this view exists // Retain the wrapped view while this view exists
wrappedView = [aView retain]; wrappedView = [aView retain];
Expand Down Expand Up @@ -1197,7 +1197,7 @@ - (void)dealloc


@implementation SPSplitViewAnimationRetainCycleBypass @implementation SPSplitViewAnimationRetainCycleBypass


- (id)initWithParent:(SPSplitView *)aSplitView - (instancetype)initWithParent:(SPSplitView *)aSplitView
{ {
self = [super init]; self = [super init];
if (!self) return nil; if (!self) return nil;
Expand Down

0 comments on commit 3074e64

Please sign in to comment.