Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix renamed C type NSAutoresizingMaskOptions (10.10+)
  • 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
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;

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
{
NSUInteger popUpMask = [exportInputPopUpButton autoresizingMask];
NSUInteger fileCheckMask = [exportFilePerTableCheck autoresizingMask];
NSUInteger scrollMask = [exportTablelistScrollView autoresizingMask];
NSUInteger buttonBarMask = [exportTableListButtonBar autoresizingMask];
NSUInteger buttonMask = [exportCustomFilenameViewButton autoresizingMask];
NSUInteger textFieldMask = [exportCustomFilenameViewLabelButton autoresizingMask];
NSUInteger customFilenameViewMask = [exportCustomFilenameView autoresizingMask];
NSUInteger tabBarMask = [exportOptionsTabBar autoresizingMask];
NSAutoresizingMaskOptions popUpMask = [exportInputPopUpButton autoresizingMask];
NSAutoresizingMaskOptions fileCheckMask = [exportFilePerTableCheck autoresizingMask];
NSAutoresizingMaskOptions scrollMask = [exportTablelistScrollView autoresizingMask];
NSAutoresizingMaskOptions buttonBarMask = [exportTableListButtonBar autoresizingMask];
NSAutoresizingMaskOptions buttonMask = [exportCustomFilenameViewButton autoresizingMask];
NSAutoresizingMaskOptions textFieldMask = [exportCustomFilenameViewLabelButton autoresizingMask];
NSAutoresizingMaskOptions customFilenameViewMask = [exportCustomFilenameView autoresizingMask];
NSAutoresizingMaskOptions tabBarMask = [exportOptionsTabBar autoresizingMask];

NSRect frame = [[self window] frame];

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

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
{
#ifndef SP_CODA /* resizeWindowByHeightDelta: */
NSUInteger tableMask = [fieldMapperTableScrollView autoresizingMask];
NSUInteger headerSwitchMask = [importFieldNamesHeaderSwitch autoresizingMask];
NSUInteger alignPopupMask = [alignByPopup autoresizingMask];
NSUInteger alignPopupLabelMask = [alignByPopupLabel autoresizingMask];
NSUInteger importMethodLabelMask = [importMethodLabel autoresizingMask];
NSUInteger importMethodMask = [importMethodPopup autoresizingMask];
NSUInteger advancedButtonMask = [advancedButton autoresizingMask];
NSUInteger advancedLabelMask = [advancedLabel autoresizingMask];
NSUInteger insertViewMask = [advancedInsertView autoresizingMask];
NSUInteger updateViewMask = [advancedUpdateView autoresizingMask];
NSUInteger replaceViewMask = [advancedReplaceView autoresizingMask];
NSAutoresizingMaskOptions tableMask = [fieldMapperTableScrollView autoresizingMask];
NSAutoresizingMaskOptions headerSwitchMask = [importFieldNamesHeaderSwitch autoresizingMask];
NSAutoresizingMaskOptions alignPopupMask = [alignByPopup autoresizingMask];
NSAutoresizingMaskOptions alignPopupLabelMask = [alignByPopupLabel autoresizingMask];
NSAutoresizingMaskOptions importMethodLabelMask = [importMethodLabel autoresizingMask];
NSAutoresizingMaskOptions importMethodMask = [importMethodPopup autoresizingMask];
NSAutoresizingMaskOptions advancedButtonMask = [advancedButton autoresizingMask];
NSAutoresizingMaskOptions advancedLabelMask = [advancedLabel autoresizingMask];
NSAutoresizingMaskOptions insertViewMask = [advancedInsertView autoresizingMask];
NSAutoresizingMaskOptions updateViewMask = [advancedUpdateView autoresizingMask];
NSAutoresizingMaskOptions replaceViewMask = [advancedReplaceView autoresizingMask];

NSRect frame = [[self window] frame];
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
{
NSUInteger popUpMask = [indexTypePopUpButton autoresizingMask];
NSUInteger nameFieldMask = [indexNameTextField autoresizingMask];
NSUInteger scrollMask = [indexedColumnsScrollView autoresizingMask];
NSUInteger buttonMask = [indexAdvancedOptionsViewButton autoresizingMask];
NSUInteger textFieldMask = [indexAdvancedOptionsViewLabelButton autoresizingMask];
NSUInteger advancedViewMask = [indexAdvancedOptionsView autoresizingMask];
NSUInteger typeLabelMask = [indexTypeLabel autoresizingMask];
NSUInteger nameLabelMask = [indexNameLabel autoresizingMask];
NSUInteger buttonBarMask = [(NSView*)anchoredButtonBar autoresizingMask];
NSAutoresizingMaskOptions popUpMask = [indexTypePopUpButton autoresizingMask];
NSAutoresizingMaskOptions nameFieldMask = [indexNameTextField autoresizingMask];
NSAutoresizingMaskOptions scrollMask = [indexedColumnsScrollView autoresizingMask];
NSAutoresizingMaskOptions buttonMask = [indexAdvancedOptionsViewButton autoresizingMask];
NSAutoresizingMaskOptions textFieldMask = [indexAdvancedOptionsViewLabelButton autoresizingMask];
NSAutoresizingMaskOptions advancedViewMask = [indexAdvancedOptionsView autoresizingMask];
NSAutoresizingMaskOptions typeLabelMask = [indexTypeLabel autoresizingMask];
NSAutoresizingMaskOptions nameLabelMask = [indexNameLabel autoresizingMask];
NSAutoresizingMaskOptions buttonBarMask = [anchoredButtonBar autoresizingMask];

NSRect frame = [[self window] frame];

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

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

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

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

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

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

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

@end

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

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

@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
* 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]];
if (!self) return nil;

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

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

@implementation SPSplitViewAnimationRetainCycleBypass

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

0 comments on commit 3074e64

Please sign in to comment.