diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7cb32fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Created by https://www.gitignore.io/api/xcode +# Edit at https://www.gitignore.io/?templates=xcode + +### Xcode ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Xcode Patch +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno + +### Xcode Patch ### +**/xcshareddata/WorkspaceSettings.xcsettings + +# End of https://www.gitignore.io/api/xcode diff --git a/English.lproj/MainMenu.nib/classes.nib b/Base.lproj/MainMenu.nib/classes.nib similarity index 100% rename from English.lproj/MainMenu.nib/classes.nib rename to Base.lproj/MainMenu.nib/classes.nib diff --git a/English.lproj/MainMenu.nib/info.nib b/Base.lproj/MainMenu.nib/info.nib similarity index 100% rename from English.lproj/MainMenu.nib/info.nib rename to Base.lproj/MainMenu.nib/info.nib diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/Base.lproj/MainMenu.nib/keyedobjects.nib similarity index 100% rename from English.lproj/MainMenu.nib/keyedobjects.nib rename to Base.lproj/MainMenu.nib/keyedobjects.nib diff --git a/English.lproj/MyDocument.nib/classes.nib b/Base.lproj/MyDocument.nib/classes.nib similarity index 100% rename from English.lproj/MyDocument.nib/classes.nib rename to Base.lproj/MyDocument.nib/classes.nib diff --git a/English.lproj/MyDocument.nib/info.nib b/Base.lproj/MyDocument.nib/info.nib similarity index 100% rename from English.lproj/MyDocument.nib/info.nib rename to Base.lproj/MyDocument.nib/info.nib diff --git a/English.lproj/MyDocument.nib/keyedobjects.nib b/Base.lproj/MyDocument.nib/keyedobjects.nib similarity index 100% rename from English.lproj/MyDocument.nib/keyedobjects.nib rename to Base.lproj/MyDocument.nib/keyedobjects.nib diff --git a/FPCheckmark.m b/FPCheckmark.m index a536096..f6d2ede 100644 --- a/FPCheckmark.m +++ b/FPCheckmark.m @@ -61,8 +61,8 @@ - (BOOL)placeWithEvent:(NSEvent *)theEvent // get ready for next iteration of the loop, or break out of loop theEvent = [[_docView window] nextEventMatchingMask: - (NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + (NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) break; } diff --git a/FPDocumentView.m b/FPDocumentView.m index 8c58c96..4cfae46 100644 --- a/FPDocumentView.m +++ b/FPDocumentView.m @@ -177,8 +177,15 @@ - (void)scrollToMidpointOnPage:(unsigned int)page point:(NSPoint)midPoint NSPoint viewPoint = [self convertPoint:midPoint fromPage:page]; NSPoint viewOrigin = NSMakePoint(floorf(viewPoint.x - viewWidth/2.0), floorf(viewPoint.y - viewHeight/2.0)); +/* + TODO + Fix the error: + Sending 'NSPoint' (aka 'struct CGPoint') to parameter of incompatible type 'NSRect' (aka 'struct CGRect') [[_scrollView contentView] scrollToPoint: - [[_scrollView contentView] constrainScrollPoint:viewOrigin]]; + [[_scrollView contentView] constrainBoundsRect:viewOrigin]]; + */ + [[_scrollView contentView] scrollToPoint:viewOrigin]; + [_scrollView reflectScrolledClipView:[_scrollView contentView]]; } @@ -302,7 +309,8 @@ - (void)drawRect:(NSRect)rect [at concat]; if (!_is_printing || [_doc drawsOriginalPDF]) - [[_pdf_document pageAtIndex:i] drawWithBox:_box]; + [[_pdf_document pageAtIndex:i] drawWithBox:_box + toContext:theContext.CGContext]; for (unsigned int j = 0; j < [_overlayGraphics count]; j++) { FPGraphic *g; @@ -453,9 +461,8 @@ - (void)moveSelectionWithEvent:(NSEvent *)theEvent for (;;) { // get ready for next iteration of the loop, or break out of loop theEvent = - [[self window] nextEventMatchingMask:(NSLeftMouseDraggedMask | - NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + [[self window] nextEventMatchingMask:(NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) break; // main loop body @@ -586,7 +593,7 @@ - (void)mouseDown:(NSEvent *)theEvent if (([graphic page] == page) && NSPointInRect(pagePoint, [graphic safeBounds])) { // we hit 'graphic' - if ([theEvent modifierFlags] & NSShiftKeyMask) { + if ([theEvent modifierFlags] & NSEventModifierFlagShift) { [_selectedGraphics invertMembershipForObject:graphic]; [[NSNotificationCenter defaultCenter] postNotificationName:FPSelectionChangedNotification object:[self window] @@ -630,7 +637,7 @@ - (void)mouseDown:(NSEvent *)theEvent } else { if ([_selectedGraphics count]) { [self setNeedsDisplay:YES]; - if ([theEvent modifierFlags] & NSAlternateKeyMask) { + if ([theEvent modifierFlags] & NSEventModifierFlagOption) { DLog(@"will copy\n"); // if option key is down, and a drag is begun, // copy the elements and drag those new ones @@ -762,23 +769,22 @@ - (IBAction)placeImage:(id)sender DLog(@"DocView's plageImage\n"); NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setAllowsMultipleSelection:NO]; - [panel beginSheetForDirectory:nil - file:nil - types:nil - modalForWindow:[self window] - modalDelegate:self - didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) - contextInfo:nil]; + [panel beginSheetModalForWindow:[self window] + completionHandler:^(NSInteger returnCode) { + [self openPanelDidEnd:panel + returnCode:returnCode + contextInfo:NULL ]; + } ]; + } - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if (NSOKButton != returnCode) return; - + if (NSModalResponseOK != returnCode) return; NSImage *image = [[[NSImage alloc] - initWithContentsOfFile:[panel filename]] autorelease]; + initWithContentsOfFile:[[panel URL] path]] autorelease]; if (nil == image) { // failed to open diff --git a/FPDocumentWindow.m b/FPDocumentWindow.m index f6920a5..1070935 100644 --- a/FPDocumentWindow.m +++ b/FPDocumentWindow.m @@ -92,8 +92,8 @@ - (void)flagsChanged:(NSEvent *)theEvent { DLog(@"flags changed\n"); if ((NO == _sentQuickMove) && - ([theEvent modifierFlags] & NSAlternateKeyMask) && - ([theEvent modifierFlags] & NSCommandKeyMask) && + ([theEvent modifierFlags] & NSEventModifierFlagOption) && + ([theEvent modifierFlags] & NSEventModifierFlagCommand) && ([_docView shouldEnterQuickMove])) { DLog(@"got apple-option\n"); [[NSNotificationCenter defaultCenter] postNotification: diff --git a/FPGraphic.m b/FPGraphic.m index aa09cc9..64e4d83 100644 --- a/FPGraphic.m +++ b/FPGraphic.m @@ -142,13 +142,9 @@ - (id)initWithArchivalDictionary:(NSDictionary *)dict _strokeWidth = [[dict objectForKey:strokeWidthArchiveKey] floatValue]; _fillColor = - [[NSUnarchiver - unarchiveObjectWithData: - [dict objectForKey:fillColorArchiveKey]] retain]; + [[NSKeyedUnarchiver unarchivedObjectOfClass:[NSColor class] fromData:[dict objectForKey:fillColorArchiveKey] error:nil] retain]; _strokeColor = - [[NSUnarchiver - unarchiveObjectWithData: - [dict objectForKey:strokeColorArchiveKey]] retain]; + [[NSKeyedUnarchiver unarchivedObjectOfClass:[NSColor class] fromData:[dict objectForKey:strokeColorArchiveKey] error:nil] retain]; _knobMask = [[dict objectForKey:knobMaskArchiveKey] intValue]; _gFlags.hidesWhenPrinting = @@ -171,9 +167,9 @@ - (NSDictionary *)archivalDictionary forKey:drawsStrokeArchiveKey]; [ret setObject:[NSNumber numberWithFloat:_strokeWidth] forKey:strokeWidthArchiveKey]; - [ret setObject:[NSArchiver archivedDataWithRootObject:_fillColor] + [ret setObject:[NSKeyedArchiver archivedDataWithRootObject:_fillColor requiringSecureCoding:YES error:nil] forKey:fillColorArchiveKey]; - [ret setObject:[NSArchiver archivedDataWithRootObject:_strokeColor] + [ret setObject:[NSKeyedArchiver archivedDataWithRootObject:_strokeColor requiringSecureCoding:YES error:nil] forKey:strokeColorArchiveKey]; [ret setObject:[NSNumber numberWithInt:_knobMask] forKey:knobMaskArchiveKey]; @@ -218,8 +214,8 @@ - (BOOL)placeWithEvent:(NSEvent *)theEvent // get ready for next iteration of the loop, or break out of loop theEvent = [[_docView window] nextEventMatchingMask: - (NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + (NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) break; } assert(_hasPage); @@ -365,7 +361,7 @@ - (void)resizeWithEvent:(NSEvent *)theEvent byKnob:(int)knob } } - if ([theEvent modifierFlags] & NSShiftKeyMask) { + if ([theEvent modifierFlags] & NSEventModifierFlagShift) { BOOL didFlip; switch (knob) { case UpperRightKnob: @@ -395,8 +391,8 @@ - (void)resizeWithEvent:(NSEvent *)theEvent byKnob:(int)knob // get ready for next iteration of the loop, or break out of loop theEvent = [[_docView window] nextEventMatchingMask: - (NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + (NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) break; } [_docView discardCursorRects]; diff --git a/FPImage.m b/FPImage.m index 52d3f09..066c40c 100644 --- a/FPImage.m +++ b/FPImage.m @@ -36,8 +36,8 @@ - (id)initWithArchivalDictionary:(NSDictionary *)dict self = [super initWithArchivalDictionary:dict inDocumentView:docView]; if (self) { - _image = [[NSUnarchiver unarchiveObjectWithData: - [dict objectForKey:imageArchiveKey]] retain]; + _image=[[NSKeyedUnarchiver unarchivedObjectOfClass:[FPImage class] + fromData:[dict objectForKey:imageArchiveKey] error:nil] retain]; } return self; } @@ -47,7 +47,9 @@ - (NSDictionary *)archivalDictionary NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithDictionary:[super archivalDictionary]]; - [ret setObject:[NSArchiver archivedDataWithRootObject:_image] + [ret setObject:[NSKeyedArchiver archivedDataWithRootObject:_image + requiringSecureCoding:YES + error:nil] forNonexistentKey:imageArchiveKey]; return ret; } @@ -81,7 +83,7 @@ - (void)draw:(BOOL)selected { [_image drawInRect:[self bounds] fromRect:NSZeroRect - operation:NSCompositeSourceOver + operation:NSCompositingOperationSourceOver fraction:1.0]; // 1.0 means fully opaque } diff --git a/FPInspectorController.m b/FPInspectorController.m index f4b2187..e3fb2a4 100644 --- a/FPInspectorController.m +++ b/FPInspectorController.m @@ -34,7 +34,7 @@ - (void)awakeFromNib - (void)cascadeEnabledness { - BOOL doStroke = ([_strokeCheckbox state] == NSOnState); + BOOL doStroke = ([_strokeCheckbox state] == NSControlStateValueOn); [_widthTextField setEnabled:doStroke]; [_widthStepper setEnabled:doStroke]; [_strokeColorWell setEnabled:doStroke]; @@ -46,7 +46,7 @@ - (void)cascadeEnabledness [_widthLabel setTextColor:[NSColor grayColor]]; } - BOOL doFill = ([_fillCheckbox state] == NSOnState); + BOOL doFill = ([_fillCheckbox state] == NSControlStateValueOn); [_fillColorWell setEnabled:doFill]; } diff --git a/FPRectangle.m b/FPRectangle.m index 73c6c43..f4999ad 100644 --- a/FPRectangle.m +++ b/FPRectangle.m @@ -47,8 +47,8 @@ - (BOOL)placeWithEvent:(NSEvent *)theEvent _naturalBounds.size = NSMakeSize(1.0, 1.0); // if the next event is mouse up, then the user didn't drag at all, so scrap the shape. - theEvent = [[_docView window] nextEventMatchingMask:(NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + theEvent = [[_docView window] nextEventMatchingMask:(NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) return NO; // ok, we have a shape, and user is dragging to size it [self resizeWithEvent:theEvent byKnob:LowerRightKnob]; diff --git a/FPSquiggle.m b/FPSquiggle.m index ec92aaa..526a7b5 100644 --- a/FPSquiggle.m +++ b/FPSquiggle.m @@ -153,10 +153,10 @@ - (BOOL)placeWithEvent:(NSEvent *)theEvent // get ready for next iteration of the loop, or break out of loop point = new_point; - + theEvent = [[_docView window] nextEventMatchingMask: - (NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; - if ([theEvent type] == NSLeftMouseUp) + (NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; + if ([theEvent type] == NSEventTypeLeftMouseUp) break; } _bounds = [_path bounds]; diff --git a/FPTextAreaB.m b/FPTextAreaB.m index a349012..5e5bac5 100644 --- a/FPTextAreaB.m +++ b/FPTextAreaB.m @@ -101,7 +101,7 @@ - (NSDictionary *)archivalDictionary forNonexistentKey:editorFrameKey]; NSData *d = [_textStorage RTFFromRange:NSMakeRange(0, [_textStorage length]) - documentAttributes:nil]; + documentAttributes: @{}]; NSString *rtfstr = [[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding]; @@ -149,9 +149,9 @@ - (BOOL)placeWithEvent:(NSEvent *)theEvent // if the next event is mouse up, then the user didn't drag at all theEvent = [[_docView window] nextEventMatchingMask: - (NSLeftMouseDraggedMask | NSLeftMouseUpMask)]; + (NSEventMaskLeftMouseDragged | NSEventMaskLeftMouseUp)]; _isAutoSizedX = _isAutoSizedY = YES; - if ([theEvent type] != NSLeftMouseUp) { + if ([theEvent type] != NSEventTypeLeftMouseUp) { [self resizeWithEvent:theEvent byKnob:LowerRightKnob]; } _isPlacing = NO; diff --git a/FPTipsController.m b/FPTipsController.m index f52c97e..a0fabbd 100644 --- a/FPTipsController.m +++ b/FPTipsController.m @@ -67,10 +67,10 @@ - (void)awakeFromNib DLog(@"unable to load tips.plist\n"); return; } - _tips = [NSPropertyListSerialization propertyListFromData:data - mutabilityOption:NSPropertyListImmutable - format:nil - errorDescription:nil]; + _tips = [NSPropertyListSerialization propertyListWithData:data + options:NSPropertyListImmutable + format:nil + error:nil]; [_tips retain]; _tipOnDisplay = [self getNextTipIndexFromDefaults]; [self displayTip:_tipOnDisplay]; diff --git a/FPToolPaletteController.m b/FPToolPaletteController.m index 288adc4..f01bb12 100644 --- a/FPToolPaletteController.m +++ b/FPToolPaletteController.m @@ -66,8 +66,8 @@ + (FPToolPaletteController *)sharedToolPaletteController - (IBAction)chooseTool:(id)sender { [_buttonArray makeObjectsPerformSelector:@selector(setState:) - withObject:(id)NSOffState]; - [sender setState:NSOnState]; + withObject:(id)NSControlStateValueOff]; + [sender setState:NSControlStateValueOn]; [[NSNotificationCenter defaultCenter] postNotification: [NSNotification notificationWithName:FPToolChosen object:self]]; @@ -78,7 +78,7 @@ - (unsigned int)currentTool for (unsigned int i = 0; i < [_buttonArray count]; i++) { NSButton *b = [_buttonArray objectAtIndex:i]; DLog(@"button = 0x%08x\n", (unsigned)b); - if ([[_buttonArray objectAtIndex:i] state] == NSOnState) + if ([[_buttonArray objectAtIndex:i] state] == NSControlStateValueOn) return i; } assert(0); @@ -103,7 +103,7 @@ - (void)keyDown:(NSEvent *)theEvent if (1 != [[theEvent charactersIgnoringModifiers] length]) return; // we don't want any modifiers, except numeric pad is okay - if ((NSDeviceIndependentModifierFlagsMask ^ NSNumericPadKeyMask) & [theEvent modifierFlags]) { + if ((NSEventModifierFlagDeviceIndependentFlagsMask ^ NSEventModifierFlagNumericPad) & [theEvent modifierFlags]) { return; } unichar c = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; diff --git a/FormulatePro.xcodeproj/project.pbxproj b/FormulatePro.xcodeproj/project.pbxproj index 0c2e246..0df1cd9 100644 --- a/FormulatePro.xcodeproj/project.pbxproj +++ b/FormulatePro.xcodeproj/project.pbxproj @@ -3,16 +3,18 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ + 8509150223AF99B5004B320B /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4C682E01089898500771440 /* Sparkle.framework */; }; + 8509150323AF99B5004B320B /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C4C682E01089898500771440 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 8D15AC2D0486D014006FF6A4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; }; 8D15AC2E0486D014006FF6A4 /* MyDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B4FDCFA73011CA2CEA /* MyDocument.nib */; }; 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; }; 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; - 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; settings = {ATTRIBUTES = (Required, ); }; }; C43595C60D306E02006A7FF5 /* FPNonMainWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C43595C40D306E02006A7FF5 /* FPNonMainWindow.m */; }; C43B61D30B2FD56D00C1B850 /* FPTextAreaB.m in Sources */ = {isa = PBXBuildFile; fileRef = C43B61D20B2FD56D00C1B850 /* FPTextAreaB.m */; }; C449817A0A922A890084F508 /* AOSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = C44981790A922A890084F508 /* AOSegmentedControl.m */; }; @@ -43,8 +45,6 @@ C4AB447F0A718D7600EE29B2 /* continuous.psd in Resources */ = {isa = PBXBuildFile; fileRef = C4AB447E0A718D7600EE29B2 /* continuous.psd */; }; C4B25AAB0B431F8800DADA0F /* FPImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C4B25AA90B431F8800DADA0F /* FPImage.m */; }; C4B25D980B4ADF8100DADA0F /* NSMutableDictionaryAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C4B25D960B4ADF8100DADA0F /* NSMutableDictionaryAdditions.m */; }; - C4C682E11089898500771440 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4C682E01089898500771440 /* Sparkle.framework */; }; - C4C682EA1089899300771440 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = C4C682E01089898500771440 /* Sparkle.framework */; }; C4C6834D108AF0B900771440 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = C4C6834C108AF0B900771440 /* dsa_pub.pem */; }; C4DC0D980A82D28800DB476E /* viewmag-.png in Resources */ = {isa = PBXBuildFile; fileRef = C4DC0D960A82D28800DB476E /* viewmag-.png */; }; C4DC0D990A82D28800DB476E /* viewmag+.png in Resources */ = {isa = PBXBuildFile; fileRef = C4DC0D970A82D28800DB476E /* viewmag+.png */; }; @@ -56,30 +56,32 @@ /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C4F40BBD0B35FC0F008063B4 /* CopyFiles */ = { + 8509150423AF99B5004B320B /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C4C682EA1089899300771440 /* Sparkle.framework in CopyFiles */, + 8509150323AF99B5004B320B /* Sparkle.framework in Embed Frameworks */, ); + name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = ""; }; 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = ""; }; 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2A37F4B5FDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MyDocument.nib; sourceTree = ""; }; - 2A37F4B7FDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32DBCF750370BD2300C91783 /* FormulatePro_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormulatePro_Prefix.pch; sourceTree = ""; }; + 8509150923AFDCE3004B320B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = en; path = en.lproj/Credits.html; sourceTree = ""; }; + 8509150A23AFDCE3004B320B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 8509150D23AFDCEA004B320B /* Base */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Base; path = Base.lproj/MainMenu.nib; sourceTree = ""; }; + 8509150E23AFDCEA004B320B /* Base */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Base; path = Base.lproj/MyDocument.nib; sourceTree = ""; }; 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D15AC370486D014006FF6A4 /* FormulatePro.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FormulatePro.app; sourceTree = BUILT_PRODUCTS_DIR; }; C43595C40D306E02006A7FF5 /* FPNonMainWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPNonMainWindow.m; sourceTree = ""; }; @@ -112,7 +114,6 @@ C4AB423C0A5FA01D00EE29B2 /* arrowTool.psd */ = {isa = PBXFileReference; lastKnownFileType = file; path = arrowTool.psd; sourceTree = ""; }; C4AB42800A623A6800EE29B2 /* FPToolPaletteController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FPToolPaletteController.h; sourceTree = ""; }; C4AB42810A623A6800EE29B2 /* FPToolPaletteController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FPToolPaletteController.m; sourceTree = ""; }; - C4AB42D10A6245F100EE29B2 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = English; path = English.lproj/Credits.html; sourceTree = ""; }; C4AB437F0A67C3E600EE29B2 /* stampTool.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = stampTool.png; sourceTree = ""; }; C4AB43960A6A3B0D00EE29B2 /* oneUp.psd */ = {isa = PBXFileReference; lastKnownFileType = file; path = oneUp.psd; sourceTree = ""; }; C4AB440A0A711A0C00EE29B2 /* twoUp.psd */ = {isa = PBXFileReference; lastKnownFileType = file; path = twoUp.psd; sourceTree = ""; }; @@ -151,8 +152,8 @@ buildActionMask = 2147483647; files = ( 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, + 8509150223AF99B5004B320B /* Sparkle.framework in Frameworks */, C4AB3EE90A5B010000EE29B2 /* PDFKit.framework in Frameworks */, - C4C682E11089898500771440 /* Sparkle.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -314,7 +315,7 @@ 8D15AC2B0486D014006FF6A4 /* Resources */, 8D15AC300486D014006FF6A4 /* Sources */, 8D15AC330486D014006FF6A4 /* Frameworks */, - C4F40BBD0B35FC0F008063B4 /* CopyFiles */, + 8509150423AF99B5004B320B /* Embed Frameworks */, ); buildRules = ( ); @@ -331,12 +332,16 @@ /* Begin PBXProject section */ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 1130; + }; buildConfigurationList = C4AB3E9F0A5AFE1100EE29B2 /* Build configuration list for PBXProject "FormulatePro" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( en, + Base, ); mainGroup = 2A37F4AAFDCFA73011CA2CEA /* FormulatePro */; projectDirPath = ""; @@ -413,7 +418,7 @@ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C1660FE840EACC02AAC07 /* English */, + 8509150A23AFDCE3004B320B /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -421,7 +426,7 @@ 2A37F4B4FDCFA73011CA2CEA /* MyDocument.nib */ = { isa = PBXVariantGroup; children = ( - 2A37F4B5FDCFA73011CA2CEA /* English */, + 8509150E23AFDCEA004B320B /* Base */, ); name = MyDocument.nib; sourceTree = ""; @@ -429,7 +434,7 @@ 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */ = { isa = PBXVariantGroup; children = ( - 2A37F4B7FDCFA73011CA2CEA /* English */, + 8509150D23AFDCEA004B320B /* Base */, ); name = MainMenu.nib; sourceTree = ""; @@ -437,7 +442,7 @@ C4AB42D00A6245F100EE29B2 /* Credits.html */ = { isa = PBXVariantGroup; children = ( - C4AB42D10A6245F100EE29B2 /* English */, + 8509150923AFDCE3004B320B /* en */, ); name = Credits.html; sourceTree = SOURCE_ROOT; @@ -448,14 +453,17 @@ C4AB3E9C0A5AFE1100EE29B2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; + ARCHS = "$(ARCHS_STANDARD)"; + CODE_SIGN_IDENTITY = "Apple Development"; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 0.0.7; + DEVELOPMENT_TEAM = 5KC7826QG5; FRAMEWORK_SEARCH_PATHS = ( "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(PROJECT_DIR)/third_party/Sparkle", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -472,6 +480,8 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.14; PREBINDING = NO; PRODUCT_NAME = FormulatePro; SDKROOT = macosx; @@ -483,14 +493,18 @@ C4AB3E9D0A5AFE1100EE29B2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; + ARCHS = "$(ARCHS_STANDARD)"; + CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 0.0.7; + DEVELOPMENT_TEAM = 5KC7826QG5; FRAMEWORK_SEARCH_PATHS = ( "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_2)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_3)", "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "@loader_path/../Frameworks", + "$(PROJECT_DIR)/third_party/Sparkle", ); FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Versions/A/Frameworks\""; FRAMEWORK_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)\""; @@ -505,6 +519,8 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.14; PREBINDING = NO; PRODUCT_NAME = FormulatePro; SDKROOT = macosx; @@ -516,15 +532,16 @@ C4AB3EA00A5AFE1100EE29B2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_PEDANTIC = NO; MACOSX_DEPLOYMENT_TARGET = 10.4; OTHER_CFLAGS = "-DDEBUG"; PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; WARNING_CFLAGS = "-Wmost"; }; name = Debug; @@ -536,13 +553,14 @@ ppc, i386, ); + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_VERSION = 4.0; + GCC_VERSION = ""; GCC_WARN_PEDANTIC = NO; MACOSX_DEPLOYMENT_TARGET = 10.4; PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; WARNING_CFLAGS = "-Wmost"; }; name = Release; diff --git a/Info.plist b/Info.plist index ae64e5c..b05ff8a 100644 --- a/Info.plist +++ b/Info.plist @@ -2,8 +2,6 @@ - SUPublicDSAKeyFile - dsa_pub.pem CFBundleDevelopmentRegion English CFBundleDocumentTypes @@ -56,12 +54,16 @@ CFBundleSignature ???? CFBundleVersion - 0.0.6 + $(CURRENT_PROJECT_VERSION) + LSApplicationCategoryType + public.app-category.productivity NSMainNibFile MainMenu NSPrincipalClass NSApplication SUFeedURL http://adlr.info/appcasts/formulatepro.xml + SUPublicDSAKeyFile + dsa_pub.pem diff --git a/MyDocument.m b/MyDocument.m index 6200fce..da9e55c 100644 --- a/MyDocument.m +++ b/MyDocument.m @@ -189,15 +189,16 @@ - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError DLog(@"line %d\n", __LINE__); - NSString *errorDesc; + NSError *errorData; NSData *ret = [NSPropertyListSerialization - dataFromPropertyList:d + dataWithPropertyList:d format:NSPropertyListXMLFormat_v1_0 - errorDescription:&errorDesc]; + options:0 + error:&errorData]; if (nil == ret) { - DLog(@"error: %@\n", errorDesc); - [errorDesc release]; + DLog(@"error: %@\n", errorData.localizedDescription); + [errorData release]; return [NSData data]; } return ret; @@ -215,11 +216,10 @@ - (BOOL)readFromData:(NSData *)data // pops the save-as dialog } else if ([typeName isEqualToString:@"FormulatePro Document"]) { NSMutableDictionary *dict = - [NSPropertyListSerialization - propertyListFromData:data - mutabilityOption:NSPropertyListMutableContainersAndLeaves - format:nil - errorDescription:nil]; + [NSPropertyListSerialization propertyListWithData:data + options:NSPropertyListMutableContainersAndLeaves + format:nil + error:nil]; assert(nil != dict); // TODO(adlr): check for error, version, convert these keys to // constants @@ -625,7 +625,13 @@ - (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings // add option for (not) printing original PDF // this uses deprecated method b/c the replacement method is 10.5 only - [printOperation setAccessoryView:_print_accessory_view]; +/* + TODO FIX THE printOperation + DEPRECATED + 'setAccessoryView:' is deprecated: first deprecated in macOS 10.5 - Use -[NSPrintPanel addAccessoryController:] and -[NSPrintPanel removeAccessoryController:] instead + [printOperation setAccessoryView:_print_accessory_view]; + */ + // [printOperation setAccessoryView:_print_accessory_view]; // We don't have to autorelease the print operation because // +[NSPrintOperation printOperationWithView:printInfo:] of course already diff --git a/English.lproj/Credits.html b/en.lproj/Credits.html similarity index 100% rename from English.lproj/Credits.html rename to en.lproj/Credits.html diff --git a/English.lproj/InfoPlist.strings b/en.lproj/InfoPlist.strings similarity index 100% rename from English.lproj/InfoPlist.strings rename to en.lproj/InfoPlist.strings diff --git a/main.m b/main.m index 246e008..9df380b 100644 --- a/main.m +++ b/main.m @@ -11,21 +11,23 @@ int main(int argc, char *argv[]) { // before anything else, set the appcast url - SInt32 os_version; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (3 == argc && !strcmp("--feedUrl", argv[1])) { [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithUTF8String:argv[2]] forKey:@"SUFeedURL"]; - } else if (Gestalt(gestaltSystemVersion, &os_version) == noErr) { - char buf[5]; + } else { + NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; + + NSString* major = [NSString stringWithFormat:@"%ld", version.majorVersion]; + NSString* minor = [NSString stringWithFormat:@"%ld", version.minorVersion]; + NSString *feedURL; NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleVersion"]; - sprintf(buf, "%0x", (unsigned)os_version); - buf[3] = '\0'; // chop off minor version number + feedURL = [NSString stringWithFormat: - @"http://adlr.info/appcasts/formulatepro-%s-v%@.xml", buf, appVersion]; + @"http://adlr.info/appcasts/formulatepro-%@%@-v%@.xml", major, minor, appVersion]; NSLog(@"feed url: %@\n", feedURL); [[NSUserDefaults standardUserDefaults] setObject:feedURL forKey:@"SUFeedURL"];